CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
9.92k stars 4.08k forks source link

Faction camp takeovers #74604

Closed RenechCDDA closed 4 days ago

RenechCDDA commented 1 week ago

Summary

Features "(Currently player only) Factions can take over and loot camps they don't own"

Purpose of change

Further expansion of basecamp support. Now that NPCs have camps, I'd like the player to be able to interact with them (and eventually, but not yet, vice versa).

Also address some outstanding issues. -Address https://github.com/CleverRaven/Cataclysm-DDA/pull/73372#issuecomment-2105414794 (z-level doesn't prevent Luliya/etc from eating from food supply, was much easier than I thought). -Remove isherwoods' 4th camp. I did not realize that the cabin ends up being a gift to the player. Kind of a jerk of a gift if their name is all over it, you know? But with this PR you can - peacefully(or not) - put your name on it even if it's already got theirs on it. -Closed up a dialogue talk function which let you inappropriately access camp functions by speaking to a follower that was located at a camp you didn't own

Describe the solution

Add the function for handling camp takeovers. Is currently only accessed through a bulletin board at a camp you don't own, and requires there to be no nearby NPCs of the owning faction in the bubble.

For the player, it gives the option of looting the camp of anything of value. Doing so will of course make the previous owner hate you if they didn't already, but also transfer food supply in proportion to their total camp holdings (e.g. a single-camp faction has its entire stockpile plundered, a 10-camp faction has 10% stolen).

Add an event bus pulse that triggers when a camp is taken over

Make a little EOC which uses the event bus pulse, to light the way for other contributors.

Fix my bad math and misplaced cabin camp from the previous PR

Describe alternatives you've considered

Testing

https://github.com/CleverRaven/Cataclysm-DDA/assets/84619419/d730f45d-7ace-4bc3-8188-1acece32d42d

Additional context