From 6d4326fe5bf754c68958d11f04e580442c7448ba Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Mon, 14 Dec 2020 23:29:05 -0700 Subject: [PATCH] Thieves only steal from the player --- js/tiletypes.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/js/tiletypes.js b/js/tiletypes.js index b9051d2..eb8e401 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -812,18 +812,18 @@ const TILE_TYPES = { draw_layer: DRAW_LAYERS.terrain, blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid, on_arrive(me, level, other) { + if (! other.type.is_real_player) + return; if (level.take_tool_from_actor(other, 'bribe')) { // TODO bribe sound return; } let lost = level.take_all_tools_from_actor(other); - if (other.type.is_real_player) { - if (level.bonus_points > 0) { - lost = true; - } - level.adjust_bonus(0, 0.5); + if (level.bonus_points > 0) { + lost = true; } + level.adjust_bonus(0, 0.5); if (lost && other === level.player) { level.sfx.play_once('thief', me.cell); } @@ -833,18 +833,19 @@ const TILE_TYPES = { draw_layer: DRAW_LAYERS.terrain, blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid, on_arrive(me, level, other) { + if (! other.type.is_real_player) + return; + if (level.take_tool_from_actor(other, 'bribe')) { // TODO bribe sound return; } let lost = level.take_all_keys_from_actor(other); - if (other.type.is_real_player) { - if (level.bonus_points > 0) { - lost = true; - } - level.adjust_bonus(0, 0.5); + if (level.bonus_points > 0) { + lost = true; } + level.adjust_bonus(0, 0.5); if (lost && other === level.player) { level.sfx.play_once('thief', me.cell); }