DainDwarf/IncrementalEmpire

Dynamically display an upgrade’s effect

Closed this issue · 3 comments

Example:
Click Power: this (will) multiply your ressource spells by X

Display for already bought and upgrades to buy. Ideally take into account the price for the effect on upgrades to buy.

For this, I might need to make the upgrade bonus a part of the upgrade itself (which would be nice, because it would better localized!). I might need to make the upgrade computed return the upgrade itself instead of the upgrade.isActive. The upgrade helper should stick to the isActive though.

You could have a bonus and actualBonus: bonus is what it would give if it applies, while actualBonus check if the bonus applies (correct empire type, upgrade bought, ...)

Upgrades that currently have a bonus formula:

  • Click Power: Multiply ressource spell by sqrt(mana)
  • Hoarding: Multiply ressource storage by 2
  • Economical Efficiency: Multiply storage in economical by log10(money)
  • Economical Overflow: Multiply non-economical production by log10(money)
  • Economical Power: Multiply economical production by 1+log10(money)
  • War Preparations: Multiply military metal production by log10(money)
  • Aggressive Diplomacy: Multiply military conquest by 5
  • Weapon Forging: Multiply military metal production by 1+sqrt(strength)
  • Community Spirit: Multiply population storage by 4

Maybe I will need to add a kind of "reduce" for upgrades, like for hoarding, or in template ratios.

Also TODO:

  • Maybe tests to check that formulae are still OK?
  • Maybe avoid recoding the formual for display/actual bonus by adding "additional conditions" ?