Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Description
Fixes #2027
This PR makes it so TradingPost of the other team can be destroyed (only in Sandbox and in TDM).
When destroyed, it spawns a trader of the same gender as the spritelayer that can be killed.
I made it so gender of the spritelayer depends on Network ID so it is the same for everyone and nobody will say
"I killed the trader woman"
"Weird, it's a male trader for me"
Also fixed a check in
onHealthChange()
, fromif (oldHealth > 0.0f && this.getHealth() < 0.0f)
toif (oldHealth > 0.0f && this.getHealth() <= 0.0f)
.Tested in offline and online, no problems found.
TradingPostDestructible.mp4
Remaining Issues
Some maps have blue trading post in the center, so only red team could damage it. Those maps would need to be changed to have a trading post that isn't team 0 or 1. Or we could allow hits to be processed regardless if it's the same team.
TDM shop might be destroyed too quickly, so health could be increased or attack's damage lowered.
Overall, I'm satisfied though.