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,11 +2587,12 @@ export class Level extends LevelInterface {
this._set_tile_prop(tile, 'last_extra_cooldown_tic', null); this._set_tile_prop(tile, 'last_extra_cooldown_tic', null);
} }
this._do_extra_cooldown(tile); this._do_extra_cooldown(tile);
}
if (old_type.on_death) { if (old_type.on_death) {
old_type.on_death(tile, this); old_type.on_death(tile, this);
} }
} }
}
// Have an actor try to pick up a particular tile; it's prevented if there's a no sign, and the // Have an actor try to pick up a particular tile; it's prevented if there's a no sign, and the
// tile is removed if successful // tile is removed if successful

View File

@ -1079,6 +1079,8 @@ const TILE_TYPES = {
if (other === level.player) { if (other === level.player) {
level.sfx.play_once('popwall', me.cell); level.sfx.play_once('popwall', me.cell);
} }
},
on_death(me, level) {
//update hole visual state //update hole visual state
me.type.on_begin(me, level); me.type.on_begin(me, level);
var one_south = level.cell(me.cell.x, me.cell.y + 1); var one_south = level.cell(me.cell.x, me.cell.y + 1);
@ -1860,6 +1862,11 @@ const TILE_TYPES = {
on_depower(me, level) { on_depower(me, level) {
level._set_tile_prop(me, 'is_active', false); 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) { visual_state(me) {
return ! me || me.is_active ? 'active' : 'inactive'; return ! me || me.is_active ? 'active' : 'inactive';
}, },
@ -2687,7 +2694,14 @@ const TILE_TYPES = {
} }
else if (terrain) { else if (terrain) {
// Anything other than these babies gets blown up and turned into floor // 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 === 'steel' || terrain.type.name === 'socket' ||
terrain.type.name === 'logic_gate' || terrain.type.name === 'floor')) terrain.type.name === 'logic_gate' || terrain.type.name === 'floor'))
{ {