Yellow tanks give up if blocked
This commit is contained in:
1 parent
2eb7c4cff9
commit
408e4cd9f6
2 files changed
+6
-6
No files matched your search
@@ -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();
|
||||
|
||||
+1
-6
@@ -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: {
|
||||
|
||||
Reference in new issue
Block a user