warzone2100
warzone2100 copied to clipboard
js api: Expose `weaponmodifier` and `structuremodifier` via Stats object
Describe the feature you'd like
Expose contents of following json files as properties of the global Stats object:
-
structuremodifier.json
-
Note: this would also require structure
Strengthproperty to be exposed via objects inStats.Building(see #4696)
-
Note: this would also require structure
-
weaponmodifier.json
- _Note: this would also require propulsion
Typeproperty to be exposed via objects inStats.Propulsion(see #4701)
- _Note: this would also require propulsion
As the property keys between the two files are unique (eg. structures are Strength-based, weapons are Propulsion-based) they could be merged together in to a single Modifiers object which would keyed by weaponEffect with object values that are key-value pairs of the various damage modifiers.
Describe why do you think it is needed
The data is currently not exposed via the js api yet is required for AI bots to make informed decisions about what weapons to use against various targets.