-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should replace the DoubleGold effector by DoubleGoldGain, and create a new stat called GoldGainMultiplier, then use this multiplier stat inside of transfer_gold_system. This way we can have multiple effectors modifying the gold gain multiplier per kill, as well as reducing the amount of code needed by reusing the effector logic.
Done! (: |
src/systems/game_stats_updater.rs
Outdated
GameEvent::KillEntity(_) => game_stats.kill_count += 1, | ||
GameEvent::TransferGold(_, _, gold) => game_stats.earned_gold += gold, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not take into account gold that was gained from the gold gain multiplier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, would you suggest to do the calculation of the multiplier again or pass the gold amount multiplied already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
GameEvent::TransferGold(from, to)
GameEvent::TransferedGold(to, multiplied_quantity)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Nice work! <3 |
Add a system to transfer gold from an entity that has died to the entity that killed it.