munch
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

63 Zeilen
1.5 KiB

  1. "use strict";
  2. function DialogNode() {
  3. this.text = "Foo bar baz.";
  4. this.hooks = [];
  5. this.visit = function() {
  6. for (let i=0; i<this.hooks.length; i++)
  7. this.hooks[i]();
  8. };
  9. this.choices = [];
  10. this.addChoice = function(text,node,tests=[]) {
  11. this.choices.push({"text": text, "node": node, "tests": []});
  12. };
  13. }
  14. function EatDude() {
  15. DialogNode.call(this);
  16. let nerd = new Anthro();
  17. this.text = "You approach the " + nerd.description();
  18. let eatHim = new DialogNode();
  19. eatHim.text = "You eat the nerd. Burp.";
  20. eatHim.hooks.push(function() { player.stomach.feed(nerd); });
  21. let dontEatHim = new DialogNode();
  22. dontEatHim.text = "You don't eat the nerd.";
  23. this.addChoice("Eat him lol",eatHim);
  24. this.addChoice("Actually don't",dontEatHim);
  25. }
  26. function PhoneCall() {
  27. DialogNode.call(this);
  28. this.text = "You pick up the phone. Who do you want to call?";
  29. {
  30. let nodeFen = new DialogNode();
  31. this.addChoice("Fen",nodeFen);
  32. nodeFen.text = "You dial Fen's number. Milliseconds later, he kicks open your front door and dabs on you, then runs away.";
  33. }
  34. {
  35. let nodeNerd = new DialogNode();
  36. this.addChoice("Some nerd",nodeNerd);
  37. nodeNerd.text = "You dial some nerd. He shows up at your front door.";
  38. nodeNerd.hooks.push(function() { startDialog(new EatDude()); });
  39. }
  40. {
  41. let nodeCrash = new DialogNode();
  42. this.addChoice("Crash the game",nodeCrash);
  43. nodeCrash.text = "Oh no oops";
  44. nodeCrash.hooks.push(function() { potato() });
  45. }
  46. }