Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[added] TDM shop can be destroyed #2177

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mugg91
Copy link
Contributor

@mugg91 mugg91 commented Nov 21, 2024

Status

  • READY: this PR is (to the best of your knowledge) ready to be incorporated into the game.

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(), from if (oldHealth > 0.0f && this.getHealth() < 0.0f) to if (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.

// spawn trader that can be killed
if (this.exists("trader sex num"))
{
CBlob@ trader = server_CreateBlobNoInit("trader");
Copy link
Member

Choose a reason for hiding this comment

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

You should be calling trader.Init() + doing a null check

Clients can run this code and end up hitting a null error.

@Vam-Jam Vam-Jam added the TDM PR that is focused towards TDM label Nov 23, 2024
@mehwaffle10
Copy link

I don't think this is a good change. I think it'd lead to more frustration than any interesting gameplay. The focus of TDM should be on fighting each other not on map destruction. Is there anything in particular this is meant to address?

@mugg91
Copy link
Contributor Author

mugg91 commented Nov 24, 2024

I don't think this is a good change. I think it'd lead to more frustration than any interesting gameplay. The focus of TDM should be on fighting each other not on map destruction. Is there anything in particular this is meant to address?

Just for fun, adding more aspects and things you can do to the game.
I will implement more fixes and then it's up to the community if they want it or not.

@GELGELAT
Copy link

like it

- onHealthChange checks for isServer() now
- when creating the trader blob, now checks if blob isn't null and runs Init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TDM PR that is focused towards TDM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make TDM shop destructible
4 participants