Fix collision masks for dynamite and bowling balls

This commit is contained in:
Eevee (Evelyn Woods) 2021-01-02 12:19:52 -07:00
parent a657682035
commit 69d62f8266
2 changed files with 8 additions and 6 deletions

View File

@ -82,6 +82,7 @@ export const COLLISION = {
block_cc1: 0x0010, block_cc1: 0x0010,
block_cc2: 0x0020, // ice + frame (+ circuit, etc) block_cc2: 0x0020, // ice + frame (+ circuit, etc)
dropped_item: 0x0040, // rolling ball, dynamite
// Monsters are a little complicated, because some of them have special rules, e.g. fireballs // Monsters are a little complicated, because some of them have special rules, e.g. fireballs
// aren't blocked by fire. // aren't blocked by fire.

View File

@ -2207,8 +2207,7 @@ const TILE_TYPES = {
draw_layer: DRAW_LAYERS.item, draw_layer: DRAW_LAYERS.item,
is_actor: true, is_actor: true,
is_monster: true, is_monster: true,
// FIXME ??????? collision_mask: COLLISION.dropped_item,
collision_mask: COLLISION.block_cc2,
blocks_collision: COLLISION.all_but_real_player, blocks_collision: COLLISION.all_but_real_player,
// 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
@ -2301,11 +2300,10 @@ const TILE_TYPES = {
rolling_ball: { rolling_ball: {
draw_layer: DRAW_LAYERS.actor, draw_layer: DRAW_LAYERS.actor,
is_actor: true, is_actor: true,
is_monster: true,
has_inventory: true, has_inventory: true,
can_reveal_walls: true, can_reveal_walls: true,
// FIXME ??????? collision_mask: COLLISION.dropped_item,
// FIXME we need to hit the player also
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) {
@ -2328,6 +2326,9 @@ const TILE_TYPES = {
}, },
on_blocked(me, level, direction) { on_blocked(me, level, direction) {
// Blow up anything we run into // Blow up anything we run into
// FIXME if we hit a wall, we should definitely /not/ blow up an actor... but that's
// tricky because on_blocked doesn't tell us what we hit, and on_bump goes top to bottom
// so it hits actors before walls...
let cell = level.get_neighboring_cell(me.cell, direction); let cell = level.get_neighboring_cell(me.cell, direction);
let other; let other;
if (cell) { if (cell) {
@ -2700,7 +2701,7 @@ const TILE_TYPES = {
draw_layer: DRAW_LAYERS.actor, draw_layer: DRAW_LAYERS.actor,
is_actor: true, is_actor: true,
collision_mask: 0, collision_mask: 0,
ttl: 4 * 3, ttl: 6 * 3,
}, },
// Invalid tiles that appear in some CCL levels because community level // Invalid tiles that appear in some CCL levels because community level