git @ Cat's Eye Technologies Super-Wumpus-Land / 5ddf2c0
Implement entropy. catseye 9 years ago
1 changed file(s) with 38 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
389389 if (d(1,8) === 1) { this.rooms[wumpus.room].guano++; }
390390 }
391391 }
392 };
393
394 this.entropy = function() {
395 var self = this;
396 var message = false;
397 var print = function(str) {
398 self.tty.write(str);
399 message = true;
400 };
401 if (this.batbgon > 0) {
402 this.batbgon--;
403 if (this.batbgon == 1) { print("Your \"Bat-B-Gon\" is wearing off.\n"); }
404 if (this.batbgon == 0) { print("Your \"Bat-B-Gon\" has worn off.\n"); }
405 }
406 if (this.codliver > 0) {
407 this.codliver == 1;
408 if (this.codliver == 1) { print("The cod liver oil seems to be wearing off.\n"); }
409 if (this.codliver == 0) { print("The cod liver oil seems to have all worn off.\n"); }
410 }
411 if (this.camo > 0) {
412 this.camo--;
413 if (this.camo == 1) { print("Your camoflage is peeling.\n"); }
414 if (this.camo == 0) { print("Your camoflage is gone.\n"); }
415 }
416 if (this.grip > 0) {
417 this.grip--;
418 if (this.grip == 1) { print("Your hands and feet are starting to feel less sticky.\n"); }
419 if (this.grip == 0) { print("Your hands and feet are no longer sticky.\n"); }
420 }
421 if (this.ustink > 0) {
422 this.ustink--;
423 if (this.ustink == 0) { print("Your sense of smell seems to have returned.\n"); }
424 }
425 return message;
392426 };
393427
394428 /* -*-*-*- GAME STATES -*-*-*- */
486520 }
487521
488522 this.moveWumpi();
523 if (this.entropy()) {
524 this.pause('statePrompt');
525 return;
526 }
489527
490528 if (this.show()) {
491529 this.ask();