Allow the bowling ball to slide normally

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-15 00:26:00 -07:00
parent f858668ca8
commit 55abe8b53a
2 changed files with 13 additions and 3 deletions

View File

@ -1270,15 +1270,20 @@ export class Level {
let success = false; let success = false;
for (let dest of teleporter.type.teleport_dest_order(teleporter, this, actor)) { for (let dest of teleporter.type.teleport_dest_order(teleporter, this, actor)) {
// Teleporters already containing an actor are blocked and unusable // Teleporters already containing an actor are blocked and unusable
// FIXME should check collision?
if (dest.cell.some(tile => tile.type.is_actor && tile !== actor)) if (dest.cell.some(tile => tile.type.is_actor && tile !== actor))
continue; continue;
// Physically move the actor to the new teleporter // Physically move the actor to the new teleporter
// XXX lynx treats this as a slide and does it in a pass in the main loop // XXX lynx treats this as a slide and does it in a pass in the main loop
// XXX not especially undo-efficient // XXX not especially undo-efficient
// FIXME the new aggressive move checker could help here!
this.remove_tile(actor); this.remove_tile(actor);
this.add_tile(actor, dest.cell); this.add_tile(actor, dest.cell);
// FIXME teleport overrides... also allow block slapping... seems like horizontal
// wins...
// Red and green teleporters attempt to spit you out in every direction before // Red and green teleporters attempt to spit you out in every direction before
// giving up on a destination (but not if you return to the original). // giving up on a destination (but not if you return to the original).
// Note that we use actor.direction here (rather than original_direction) because // Note that we use actor.direction here (rather than original_direction) because

View File

@ -2058,8 +2058,9 @@ const TILE_TYPES = {
dynamite_lit: { dynamite_lit: {
draw_layer: DRAW_LAYERS.item, draw_layer: DRAW_LAYERS.item,
is_actor: true, is_actor: true,
// FIXME collision? is_monster: true,
// FIXME kills player on touch // FIXME ???????
collision_mask: COLLISION.block_cc2,
// FIXME inherits a copy of player's inventory! // FIXME inherits a copy of player's inventory!
// FIXME holds down buttons, so needs an on_arrive // FIXME holds down buttons, so needs an on_arrive
// FIXME speaking of buttons, destroyed actors should on_depart // FIXME speaking of buttons, destroyed actors should on_depart
@ -2155,14 +2156,18 @@ const TILE_TYPES = {
draw_layer: DRAW_LAYERS.actor, draw_layer: DRAW_LAYERS.actor,
is_actor: true, is_actor: true,
has_inventory: true, has_inventory: true,
// FIXME collision...? // FIXME ???????
collision_mask: COLLISION.block_cc2,
// FIXME do i start moving immediately when dropped, or next turn? // FIXME do i start moving immediately when dropped, or next turn?
movement_speed: 4, movement_speed: 4,
decide_movement(me, level) { decide_movement(me, level) {
return [me.direction]; return [me.direction];
}, },
// FIXME feel like this should be on_blocked? // FIXME feel like this should be on_blocked?
// FIXME specific case for player!
on_bump(me, level, other) { on_bump(me, level, other) {
if (me.slide_mode)
return;
if (other.type.is_actor) { if (other.type.is_actor) {
level.transmute_tile(me, 'explosion'); level.transmute_tile(me, 'explosion');
level.transmute_tile(other, 'explosion'); level.transmute_tile(other, 'explosion');