CleverRaven / CleverRaven/Cataclysm-DDA
Monster spellcasting doesn't respect obstacles as it should
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.2k
- Forks
- 4.6k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 205
Description
Describe the bug
Monsters are able to aim and cast blast spells through impassable obstacles, but aren't able to cast NO_PROJECTILE spells through (transparent) walls.
Steps to reproduce
- Paste the spell+monster combo from Additional Context
- Start a game in the evac shelter, open a blind and (optionally) kill the starting NPC to test in peace
- Spawn Blasto on the other side of the window and behold your shelter getting filled by lightning
- Kill Blasto and spawn Zappo, watch his supposedly wall-ignoring zaps failing to penetrate the window
Expected behavior
Blast spells stopping at impassable obstacles unless otherwise specified, wall-penetrating spells penetrating walls as advertised. You can't even game the system with tacking the blast spell onto the line spell as an extra effect since extras are cast from the caster's position near as I can tell.
Screenshots
No response
Versions and configuration
- OS: Windows
- OS Version: 10.0.19044.1826 (21H2)
- Game Version: 8f8b8d9 [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
No Fungal Growth [no_fungal_growth],
Bionic Professions [package_bionic_professions],
Magiclysm [magiclysm]
]
Additional context
{
"type": "MONSTER",
"id": "mon_debug_spell_blast",
"name": { "str": "Blasto" },
"description": "This zombie looks delighted to support your debugging efforts. Has a blast spell it shouldn't be able to cast through walls.",
"copy-from": "mon_zombie",
"special_attacks": [
{ "type": "spell", "spell_data": { "id": "shock_aoe_3x3" } }
]
},
{
"type": "MONSTER",
"id": "mon_debug_spell_line",
"name": { "str": "Zappo" },
"description": "This zombie looks delighted to support your debugging efforts. Has a line spell it should be able to cast through walls (won't, though).",
"copy-from": "mon_zombie",
"special_attacks": [
{ "type": "spell", "spell_data": { "id": "shock_line" } }
]
},
{
"type": "SPELL",
"id": "shock_line",
"name": { "str": "Shock Line" },
"description": "Spawns electric fields along the LOS",
"effect": "attack",
"shape": "line",
"valid_targets": [ "hostile", "ground" ],
"max_level": 5,
"min_damage": 0,
"max_damage": 0,
"aoe_increment": 4,
"min_range": 8,
"max_range": 28,
"range_increment": 4,
"base_casting_time": 50,
"field_id": "fd_electricity",
"min_field_intensity": 1,
"max_field_intensity": 9,
"field_intensity_increment": 2,
"field_intensity_variance": 0.2,
"field_chance": 1,
"damage_type": "electric",
"sound_description": "a crackle",
"//extra_effects": [ { "id": "shock_aoe_3x3", "max_level": 1 } ],
"flags": [ "NO_PROJECTILE"]
},
{
"type": "SPELL",
"id": "shock_aoe_3x3",
"name": { "str": "Shock Blast" },
"description": "Spawns electric fields in a blast",
"effect": "attack",
"shape": "blast",
"valid_targets": [ "hostile", "ground" ],
"flags": [ "LOUD" ],
"max_level": 1,
"min_damage": 0,
"max_damage": 0,
"min_range": 8,
"min_aoe": 3,
"max_aoe": 3,
"field_id": "fd_electricity",
"min_field_intensity": 3,
"max_field_intensity": 5,
"field_chance": 1,
"field_intensity_variance": 0.2
},
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in the evac shelter using the monster and spell definitions in Additional context: mon_debug_spell_blast, mon_debug_spell_line, shock_aoe_3x3, and shock_line. Compare blast targeting with the NO_PROJECTILE line spell across a window, then trace the monster spellcasting and obstacle checks. Done means blast spells stop at impassable obstacles while NO_PROJECTILE spells penetrate transparent walls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100