Yellow tanks give up if blocked
This commit is contained in:
parent
2eb7c4cff9
commit
408e4cd9f6
@ -966,6 +966,11 @@ export class Level {
|
||||
return;
|
||||
let all_blocked = true;
|
||||
for (let [i, direction] of direction_preference.entries()) {
|
||||
if (direction === null) {
|
||||
// This actor is giving up! Alas.
|
||||
actor.decision = direction;
|
||||
break;
|
||||
}
|
||||
if (typeof direction === 'function') {
|
||||
// Lazy direction calculation (used for walkers)
|
||||
direction = direction();
|
||||
|
||||
@ -1861,12 +1861,7 @@ const TILE_TYPES = {
|
||||
},
|
||||
movement_speed: 4,
|
||||
decide_movement(me, level) {
|
||||
if (level.yellow_tank_decision) {
|
||||
return [level.yellow_tank_decision];
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
return [level.yellow_tank_decision, null];
|
||||
}
|
||||
},
|
||||
blob: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user