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

Traps: InstantPlacement & RemoveOnceDepleted #3635

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

Conversation

walt253
Copy link
Contributor

@walt253 walt253 commented Nov 4, 2024

Two new properties for traps: InstantPlacement & RemoveOnceDepleted.

; Place the trap immediately without needing imps to drag the crate to arm it.
InstantPlacement = 0
; Destroy the trap once it runs out of Shots.
RemoveOnceDepleted = 0

Good for tower defense map.

Add new properties: InstantPlacement & RemoveOnceDepleted
@walt253 walt253 marked this pull request as ready for review November 4, 2024 23:20
@PieterVdc
Copy link
Member

I suppose TrapStats should still get merged into TrapConfigStats, any reason why 1 of the properties is in 1 and the other in the other?

@walt253
Copy link
Contributor Author

walt253 commented Nov 6, 2024

I suppose TrapStats should still get merged into TrapConfigStats, any reason why 1 of the properties is in 1 and the other in the other?

Yes, merging those two in a future PR would be a good idea.

The reason for this PR is simply that it was more practical:

struct TrapConfigStats* trap_cfg = get_trap_model_stats(tngmodel); is already being used in player_place_trap_at.
struct TrapStats* trapstat = &game.conf.trap_stats[traptng->model]; is already being used in process_trap_charge.

@walt253
Copy link
Contributor Author

walt253 commented Nov 7, 2024

I suppose TrapStats should still get merged into TrapConfigStats, any reason why 1 of the properties is in 1 and the other in the other?

Yes, merging those two in a future PR would be a good idea.

The reason for this PR is simply that it was more practical:

struct TrapConfigStats* trap_cfg = get_trap_model_stats(tngmodel); is already being used in player_place_trap_at. struct TrapStats* trapstat = &game.conf.trap_stats[traptng->model]; is already being used in process_trap_charge.

I'm working on merging it now but this will be for a separate PR. I started yesterday and got tons of builds errors I fixed, still a few remaining but so far so good. I would like to get this PR merged first however.

@PieterVdc
Copy link
Member

to me code looks fine, and yeah merging should be seperate PR so fine by me

@walt253 walt253 marked this pull request as draft November 7, 2024 11:20
@walt253 walt253 marked this pull request as ready for review November 7, 2024 11:20
@walt253
Copy link
Contributor Author

walt253 commented Nov 13, 2024

I fixed the conflicts.

Copy link
Contributor

@Spatulade Spatulade left a comment

Choose a reason for hiding this comment

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

👍 looks good, and will come in handy for eventually being able to place and remove traps via script.

(I assume you can't do the opposite and force doors to be placed with crates because doors are slabs and transparency wouldn't work for slabs and it'd probably involve making some sort of "door blueprint" slab that only you can see etc etc and that would be awful to code)

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

Successfully merging this pull request may close these issues.

3 participants