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 can directly trigger EoCs as their action #77464

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

Conversation

Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Oct 30, 2024

Summary

Infrastructure "Traps can directly trigger EoCs as their action"

Purpose of change

Triggering simple EoCs via spells is ugly and cumbersome

Describe the solution

Traps can trigger EoCs directly with the creature that triggers it as the alpha talker
Passes the trap's location as a context variable trap_location for use primarily with ranged traps
If triggered by an item passes the item's id as a context variable trap_item_trigger, so you can do cool silly stuff like puzzle switches where putting different key items on a trap does different things and you need to figure out the solution, with incorrect placement potentially having bad consequences (Erk posited something like this for nether dungeons before)
Documents the above
Unhardcodes the trap action "telepad" (and "portal" which was just an alias) bc I needed to write an EoC to test it anyway
Changes trap->spell->eoc to trap->eoc across the repo

Describe alternatives you've considered

Doing this in #77455 but it's not required for those changes and could do with a repo wide sweep up of existing pseudo EoC traps
I attempted items that trigger traps to be passed as talkers but couldn't get that to work, I considered falling back on passing a trap_item_trigger context var with the id of the item (and maybe another for it's translated name) but that would require passing an irrelevant talker like the player as you can't have 0 talker dialogues which seems very hacky. Will attempt to try this again if I think of anything

Testing

The tr_telepad works as expected with the player and Liam

Additional context

Firing EoCs via spells can still make sense if you want something complicated

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` Monsters Monsters both friendly and unfriendly. Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [Markdown] Markdown issues and PRs Lore Game lore, in-game communication. Also the Lore tab. Code: Tooling Tooling that is not part of the main game but is part of the repo. Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions Mechanics: Enchantments / Spells Enchantments and spells Mods: Aftershock Anything to do with the Aftershock mod Mods: Mind Over Matter labels Oct 30, 2024
@github-actions github-actions bot added EOC: Effects On Condition Anything concerning Effects On Condition Mods: Sky Island Anything about the Sky Island mod labels Nov 7, 2024
@Procyonae Procyonae marked this pull request as ready for review November 8, 2024 11:59
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 8, 2024
src/trap.cpp Outdated Show resolved Hide resolved
src/trap.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tooling Tooling that is not part of the main game but is part of the repo. <Documentation> Design documents, internal info, guides and help. EOC: Effects On Condition Anything concerning Effects On Condition Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Lore Game lore, in-game communication. Also the Lore tab. Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mechanics: Enchantments / Spells Enchantments and spells Mods: Aftershock Anything to do with the Aftershock mod Mods: Mind Over Matter Mods: Sky Island Anything about the Sky Island mod Mods Issues related to mods or modding Monsters Monsters both friendly and unfriendly. NPC / Factions NPCs, AI, Speech, Factions, Ownership Tutorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant