Badges: Met the Backhoe becomes Met the Chaos Monkey
Earned on the monkey's first visit instead of any fiber cut; the badge keeps its id, so ones already earned carry over. Monkey-proof gets a shield. The monkey's cheer also cancels a spray still pending from its last hop.
This commit is contained in:
parent
f4486ee955
commit
cbb7ca8772
12 changed files with 30 additions and 17 deletions
|
|
@ -97,3 +97,13 @@ test('saves keep the monkey; old and broken saves are repaired', () => {
|
|||
ev('for(let i=0;i<5;i++)dayTick()');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('"Met the Chaos Monkey" comes from a visit, not from an ordinary fiber cut', () => {
|
||||
const { ev, errors } = net('oncall');
|
||||
ev("fireFailure('cut');checkBadges()");
|
||||
assert.equal(ev('S.ach.backhoe===undefined'), true, 'a cut alone is not the monkey');
|
||||
ev('S.monkey.next=S.day;dayTick();checkBadges()');
|
||||
assert.notEqual(ev('S.ach.backhoe'), undefined);
|
||||
assert.equal(ev("BADGES.find(b=>b.id==='backhoe').t"), 'Met the Chaos Monkey');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ test('rare badges hook into incidents and deals', () => {
|
|||
const { ev, errors } = load();
|
||||
base(ev);
|
||||
ev("addInc({type:'cut',ref:'x',until:S.day+1,msg:'A crocodile took a bite. A ship dragged its anchor.'});checkGoals()");
|
||||
assert.ok(ev("S.ach.croc!==undefined&&S.ach.anchor!==undefined&&S.ach.backhoe!==undefined"));
|
||||
assert.ok(ev("S.ach.croc!==undefined&&S.ach.anchor!==undefined&&S.ach.backhoe===undefined"), "a cut alone earns no Met the Chaos Monkey");
|
||||
ev("S.stats.survived=100;checkGoals()");
|
||||
assert.ok(ev("S.ach.unbreak!==undefined"));
|
||||
assert.equal(ev("BADGES.length>=46&&new Set(BADGES.map(b=>b.id)).size===BADGES.length"), true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue