crunch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

120 lines
3.6 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.flags.roars = 0;
  23. this.attacks.push(wyrmBite(this));
  24. this.attacks.push(wyrmTail(this));
  25. this.attacks.push(wyrmRoar(this));
  26. /*this.attacks.push(wyrmPounce(this));
  27. this.attacks.push(wyrmGrind(this));
  28. this.attacks.push(wyrmCockVore(this));
  29. this.attacks.push(wyrmCockSwallow(this));
  30. this.attacks.push(wyrmCockCrush(this));
  31. this.attacks.push(wyrmCockDigest(this));
  32. this.attacks.push(grappledStruggle(this));*/
  33. this.startCombat = function(player) {
  34. 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."];
  35. };
  36. this.finishCombat = function() {
  37. if (this.flags.state == "combat")
  38. return [this.description("The") + " knocks you to the ground. You bash your head on a rock and black out."];
  39. else if (this.flags.state == "balls")
  40. return ["You fall limp in " + this.description("the") + "'s balls."];
  41. };
  42. }
  43. function wyrmBite(attacker) {
  44. return {
  45. attackPlayer: function(defender){
  46. let damage = attack(attacker, defender, attacker.str);
  47. return [attacker.description("The") + " rushes up and bites you for " + damage + " damage"];
  48. },
  49. requirements: [
  50. function(attacker, defender) {
  51. return attacker.flags.state == "combat";
  52. },
  53. function(attacker, defender) {
  54. return !attacker.flags.grappled && !defender.flags.grappled;
  55. }
  56. ],
  57. priority: 1,
  58. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  59. };
  60. }
  61. function wyrmTail(attacker) {
  62. return {
  63. attackPlayer: function(defender){
  64. let damage = attack(attacker, defender, attacker.dex);
  65. return [attacker.description("The") + " lashes at you with his tail, dealing " + damage + " damage."];
  66. },
  67. requirements: [
  68. function(attacker, defender) {
  69. return attacker.flags.state == "combat";
  70. },
  71. function(attacker, defender) {
  72. return !attacker.flags.grappled && !defender.flags.grappled;
  73. }
  74. ],
  75. priority: 1,
  76. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  77. };
  78. }
  79. function wyrmRoar(attacker) {
  80. return {
  81. attackPlayer: function(defender){
  82. attacker.flags.roars += 1;
  83. attacker.statBuffs.push(new StatBuff("str", 1.25));
  84. attacker.statBuffs.push(new StatBuff("con", 1.25));
  85. return [attacker.description("The") + " lets out an earsplitting roar. It looks even angrier now."];
  86. },
  87. requirements: [
  88. function(attacker, defender) {
  89. return attacker.flags.state == "combat";
  90. },
  91. function(attacker, defender) {
  92. return !attacker.flags.grappled && !defender.flags.grappled;
  93. },
  94. function(attacker, defender) {
  95. return attacker.flags.roars < 2;
  96. }
  97. ],
  98. priority: 1,
  99. weight: function(attacker, defender) { return 0.25 + attacker.flags.roars / 2; }
  100. };
  101. }