munch
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

76 lignes
2.2 KiB

  1. function MountainExplore() {
  2. GameObject.call(this, "Explore");
  3. this.actions.push({
  4. "name": "Explore",
  5. "action": function() {
  6. let outcome = Math.random();
  7. advanceTime(60*15);
  8. if (outcome < 0.25) {
  9. startCombat(new MountainWyrm());
  10. } else {
  11. update(["You wander around for a bit, but haven't found your way out yet."]);
  12. }
  13. }
  14. });
  15. }
  16. function MountainWyrm() {
  17. Creature.call(this, "Wyrm", 25, 15, 35);
  18. this.hasName = false;
  19. this.description = function(prefix) { return prefix + " wyrm"; };
  20. this.attacks = [];
  21. this.flags.state = "combat";
  22. this.attacks.push(wyrmBite(this));
  23. /*this.attacks.push(wyrmTail(this));
  24. this.attacks.push(wyrmRoar(this));
  25. this.attacks.push(wyrmPounce(this));
  26. this.attacks.push(wyrmGrind(this));
  27. this.attacks.push(wyrmCockVore(this));
  28. this.attacks.push(wyrmCockSwallow(this));
  29. this.attacks.push(wyrmCockCrush(this));
  30. this.attacks.push(wyrmCockDigest(this));
  31. this.attacks.push(grappledStruggle(this));*/
  32. this.startCombat = function(player) {
  33. return ["A shadow falls over you; a heartbeat later, a hound-sized wyrm swoops down, landing with a heavy <i>thump</i> on the rocky ground. He hisses and snarls at you, rearing up in an attempt to intimidate you..and showing off his throbbing shaft."];
  34. };
  35. this.finishCombat = function() {
  36. if (this.flags.stage == "combat")
  37. return [this.description("The") + " knocks you to the ground. You bash your head on a rock and black out."];
  38. else if (this.flags.stage == "balls")
  39. return ["You fall limp in " + this.description("the") + "'s balls."];
  40. };
  41. }
  42. function wyrmBite(attacker) {
  43. return {
  44. attackPlayer: function(defender){
  45. let damage = attack(attacker, defender, attacker.str);
  46. return [attacker.description("The") + " rushes up and bites you for " + damage + " damage"];
  47. },
  48. requirements: [
  49. function(attacker, defender) {
  50. return attacker.flags.state == "combat";
  51. },
  52. function(attacker, defender) {
  53. return !attacker.flags.grappled && !defender.flags.grappled;
  54. }
  55. ],
  56. priority: 1,
  57. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  58. };
  59. }