Skip to content

Commit

Permalink
fix: spells: refactor bug
Browse files Browse the repository at this point in the history
Damage kind not applied correctly
  • Loading branch information
kiedtl committed Jun 20, 2024
1 parent 35f83ee commit a3e10b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/spells.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ pub const Effect = union(enum) {
victim.addStatus(s, spellcfg.power, .{ .Tmp = spellcfg.duration }),
.Damage => |d| if (state.dungeon.at(target_c).mob) |victim| {
victim.takeDamage(.{
.kind = d.kind,
.amount = d.amount.get(spellcfg),
.source = .RangedAttack,
.by_mob = state.dungeon.at(caster_c).mob,
Expand Down Expand Up @@ -1504,8 +1505,9 @@ pub const Spell = struct {
}
}

for (self.effects) |effect|
for (self.effects) |effect| {
effect.execute(opts, caster_coord, coord);
}
}
},
.Smite => {
Expand Down

0 comments on commit a3e10b8

Please sign in to comment.