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