Thieves only steal from the player
This commit is contained in:
1 parent
3e18e38f15
commit
6d4326fe5b
1 file changed
+5
-4
+5
-4
@@ -812,18 +812,18 @@ const TILE_TYPES = {
|
|||||||
draw_layer: DRAW_LAYERS.terrain,
|
draw_layer: DRAW_LAYERS.terrain,
|
||||||
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid,
|
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid,
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
|
if (! other.type.is_real_player)
|
||||||
|
return;
|
||||||
if (level.take_tool_from_actor(other, 'bribe')) {
|
if (level.take_tool_from_actor(other, 'bribe')) {
|
||||||
// TODO bribe sound
|
// TODO bribe sound
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let lost = level.take_all_tools_from_actor(other);
|
let lost = level.take_all_tools_from_actor(other);
|
||||||
if (other.type.is_real_player) {
|
|
||||||
if (level.bonus_points > 0) {
|
if (level.bonus_points > 0) {
|
||||||
lost = true;
|
lost = true;
|
||||||
}
|
}
|
||||||
level.adjust_bonus(0, 0.5);
|
level.adjust_bonus(0, 0.5);
|
||||||
}
|
|
||||||
if (lost && other === level.player) {
|
if (lost && other === level.player) {
|
||||||
level.sfx.play_once('thief', me.cell);
|
level.sfx.play_once('thief', me.cell);
|
||||||
}
|
}
|
||||||
@@ -833,18 +833,19 @@ const TILE_TYPES = {
|
|||||||
draw_layer: DRAW_LAYERS.terrain,
|
draw_layer: DRAW_LAYERS.terrain,
|
||||||
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid,
|
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_solid,
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
|
if (! other.type.is_real_player)
|
||||||
|
return;
|
||||||
|
|
||||||
if (level.take_tool_from_actor(other, 'bribe')) {
|
if (level.take_tool_from_actor(other, 'bribe')) {
|
||||||
// TODO bribe sound
|
// TODO bribe sound
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let lost = level.take_all_keys_from_actor(other);
|
let lost = level.take_all_keys_from_actor(other);
|
||||||
if (other.type.is_real_player) {
|
|
||||||
if (level.bonus_points > 0) {
|
if (level.bonus_points > 0) {
|
||||||
lost = true;
|
lost = true;
|
||||||
}
|
}
|
||||||
level.adjust_bonus(0, 0.5);
|
level.adjust_bonus(0, 0.5);
|
||||||
}
|
|
||||||
if (lost && other === level.player) {
|
if (lost && other === level.player) {
|
||||||
level.sfx.play_once('thief', me.cell);
|
level.sfx.play_once('thief', me.cell);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user