dynamite vs electrified floor, holes and cracked floor (60 partial fix)

This commit is contained in:
Timothy.Stiles 2021-03-03 14:10:44 +11:00
parent ee718323cd
commit 6971eb4d54
2 changed files with 25 additions and 10 deletions

View File

@ -2587,9 +2587,10 @@ export class Level extends LevelInterface {
this._set_tile_prop(tile, 'last_extra_cooldown_tic', null);
}
this._do_extra_cooldown(tile);
if (old_type.on_death) {
old_type.on_death(tile, this);
}
}
if (old_type.on_death) {
old_type.on_death(tile, this);
}
}

View File

@ -1079,12 +1079,14 @@ const TILE_TYPES = {
if (other === level.player) {
level.sfx.play_once('popwall', me.cell);
}
//update hole visual state
me.type.on_begin(me, level);
var one_south = level.cell(me.cell.x, me.cell.y + 1);
if (one_south !== null && one_south.get_terrain().type.name == 'hole') {
me.type.on_begin(one_south.get_terrain(), level);
}
},
on_death(me, level) {
//update hole visual state
me.type.on_begin(me, level);
var one_south = level.cell(me.cell.x, me.cell.y + 1);
if (one_south !== null && one_south.get_terrain().type.name == 'hole') {
me.type.on_begin(one_south.get_terrain(), level);
}
},
},
thief_tools: {
@ -1860,6 +1862,11 @@ const TILE_TYPES = {
on_depower(me, level) {
level._set_tile_prop(me, 'is_active', false);
},
on_death(me, level) {
//need to remove our wires since they're an implementation detail
level._set_tile_prop(me, 'wire_directions', 0);
level.recalculate_circuitry_next_wire_phase = true;
},
visual_state(me) {
return ! me || me.is_active ? 'active' : 'inactive';
},
@ -2687,7 +2694,14 @@ const TILE_TYPES = {
}
else if (terrain) {
// Anything other than these babies gets blown up and turned into floor
if (!(
if (terrain.type.name === 'hole') {
//do nothing
}
else if (terrain.type.name === 'cracked_floor') {
level.transmute_tile(terrain, 'hole');
removed_anything = true;
}
else if (!(
terrain.type.name === 'steel' || terrain.type.name === 'socket' ||
terrain.type.name === 'logic_gate' || terrain.type.name === 'floor'))
{