CleverRaven / Cataclysm-DDA

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

Monster spellcasting doesn't respect obstacles as it should #59949

Open Venera3 opened 2 years ago

Venera3 commented 2 years ago

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

  1. Paste the spell+monster combo from Additional Context
  2. Start a game in the evac shelter, open a blind and (optionally) kill the starting NPC to test in peace
  3. Spawn Blasto on the other side of the window and behold your shelter getting filled by lightning
  4. 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

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
  },
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.