....#...
0...h...
....#@..
....#...
....#...
..../h..
....#@..
....#...
Former human was knockbacked by barrel explosion(min 7 dmg) and also should have been hit by my shot(min 8 dmg) but he hadn't died. He also didn't have any armor. It wasn't instant revive too because no drop appeared.
############################
.........................#
#0=........................#
===.........................#
#= #..............^.....0.....#
..=. #...............%...........#
..=..0#############+#/#############
==....i................|..........#
.=....#...........................#
=. #@..........................#
#................|..........#
#}..........................#
###+###../###########..######
#........................0..#
^ ########./#######/#/##/######
#.........................#
################/##/#########
#==========================
#========|=================
###########################
Q2Z0v Armor : blue armor [1/2] (25%)
Health: 60% Exp: 3/15% Weapon: shotgun (8d3) [1/1]
cautious Phobos Lev3
############################
.........................#
#0=........................#
===.........................#
#= #..............^.....0.....#
..=. #...............%...........#
..=...#############+#/#############
==..../................|..........#
.=....#...........................#
=. #@i.........................#
#................|..........#
#}..........................#
###+###../###########..######
#........................0..#
^ ########./#######/#/##/######
#.........................#
################/##/#########
#==========================
#========|=================
###########################
Q2Z0v Armor : blue armor [1/2] (25%)
Health: 60% Exp: 3/15% Weapon: shotgun (8d3) [1/1]
cautious Phobos Lev3
// An object has two additional fields: a boolean flag "damaged interatively" and an integer "damage received"
// A splash damage function has a designated area of tiles which roll for damage, say "apply_damage(dice,sides)"
// This code triggers after something shoots and the shot is getting resolved.
if shot.splash then shot.doSplashDamage;
level.resolveAllDamage;
while (level.explosionsToProcess>0) do begin
for each (explosion in level.explosions) explosion.doSplashDamage;
level.resolveAllDamage;
end;
...
procedure doSplashDamage;
begin
for each (tile in this.splashArea) if tile.occupied then begin
tile.occupied.takeDamage(this.dice,this.sides,this.sourceTile);
end;
...
procedure object.takeDamage(dice:integer,sides:integer,sourceTile:Tile);
begin
var rolled:integer;
damageToResolve:=true;
rolled:=roll(dice,sides);
inc(damage,rolled)
addKnockback(rolled,source); // this accumulates knockback similarly to damage. Yes, barrels can get knocked back with this as well, get knocked into lava, etc etc. BTW, it'll allow barrels to move from floor to normal objects.
end;
...
procedure level.resolveAllDamage;
begin
explosions:=0;
for each (object in level) if object.damaged then object.processDamage;
// this is as normal, sets damaged to false, applied accumulated damage to HP, processes knockback, calls level.thereWasAnExplosion in case a barrel gets damaged or knocked into lava/acid so the level will know that the process has to be iterated again.
end;
and you largely get screwed if you're not prepared.