Units and Players can modify the IState instance. They can modify the IResource.thisTurnValue , board, and other units.
units / buildings can modify the state of the game, Examples:
a "caravan" unit can generate +5 gold per turn.
a fremen unit will produce +10 of "water" when killing an organic unit
a bank building will multiply by 50% all the gold produced in a turn. on(after-end-of-turn, count player.units.find(bank) )
a kamikaze unit will damage +40 units that are up to 3 boxes near him when it dies. on(after-unit-die, if (unit is .kanikaze) foePlayer.units.near(kamikaze).foreach.health-=40
a dock building will make destructors and battleships units 40% cheaper. ( on(before-unit-create, (if(player.buildings.find(docker)){fi unit created is battl or desc then - substract 40%})=>{}))
So stateModifiers for a particular event, will behave like "PluginContainer" in order respecting defined prioerities,
each of this modifiers will end up in a subscription in the game and notified when requested event happen so they have the chance to modify the state somehow
Units and Players can modify the IState instance. They can modify the IResource.thisTurnValue , board, and other units.
units / buildings can modify the state of the game, Examples: a "caravan" unit can generate +5 gold per turn. a fremen unit will produce +10 of "water" when killing an organic unit a bank building will multiply by 50% all the gold produced in a turn. on(after-end-of-turn, count player.units.find(bank) ) a kamikaze unit will damage +40 units that are up to 3 boxes near him when it dies. on(after-unit-die, if (unit is .kanikaze) foePlayer.units.near(kamikaze).foreach.health-=40 a dock building will make destructors and battleships units 40% cheaper. ( on(before-unit-create, (if(player.buildings.find(docker)){fi unit created is battl or desc then - substract 40%})=>{})) So stateModifiers for a particular event, will behave like "PluginContainer" in order respecting defined prioerities,