Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Add gold system #31

Merged
merged 4 commits into from
Jan 13, 2021
Merged

Conversation

rodrigocam
Copy link
Collaborator

Add a system to transfer gold from an entity that has died to the entity that killed it.

Copy link
Contributor

@AnneKitsune AnneKitsune left a 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.

@rodrigocam
Copy link
Collaborator Author

Done! (:

GameEvent::KillEntity(_) => game_stats.kill_count += 1,
GameEvent::TransferGold(_, _, gold) => game_stats.earned_gold += gold,
Copy link
Contributor

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

Copy link
Collaborator Author

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?

Copy link
Contributor

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@AnneKitsune AnneKitsune merged commit 038c289 into spicylobstergames:master Jan 13, 2021
@AnneKitsune
Copy link
Contributor

Nice work! <3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants