CleverRaven/Cataclysm-DDA

JSONify traps, or at least allow EOCs with them

Open

#70,467 opened on Dec 27, 2023

View on GitHub
 (2 comments) (4 reactions) (0 assignees)C++ (3,991 forks)batch import
<Suggestion / Discussion>EOC: Effects On ConditionFields / Furniture / Terrain / TrapsHelp Wanted[C++]

Repository metrics

Stars
 (9,264 stars)
PR merge metrics
 (Avg merge 6d 5h) (292 merged PRs in 30d)

Description

Is your feature request related to a problem? Please describe.

Currently, all traps need a hardcoded C++ function for them to work at all, e.g "action": "bubble". Making new traps is thus quite complicated. Although you can use spells for them, the difficulty remains.

Solution you would like.

It would be cool to have something like the following. This is includes everything and the kitchen sink for every possibility, so not everything may make sense but you get the rough direction.

"action": "trap",
"trap": [
  {
    "damage": 5,
    "damage_type": "stab",
    "chance_to_break_trap": 5.1,
    "targeted_bodyparts": { "legs": 99.9, "head": 0, "torso": 10 },
    "apply_effect": { "effect": "effect", "probability_to_inflict": 9.9, "length": [ 15, 20 ] }, 
    "cast_spell": { "..." },
    "run_eoc": { "..." }
  },
  { "run_eoc": "stepped_in_trap_demo" }
]

Describe alternatives you have considered.

No response

Additional context

No response

Contributor guide