munch
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

38 行
782 B

  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. return this.text;
  9. }
  10. this.choices = [];
  11. this.addChoice = function(text,node) {
  12. this.choices.push({"text": text, "node": node});
  13. }
  14. }
  15. function EatDude() {
  16. DialogNode.call(this);
  17. let nerd = new Anthro();
  18. this.text = "You approach the " + nerd.description();
  19. let eatHim = new DialogNode();
  20. eatHim.text = "You eat the nerd. Burp.";
  21. eatHim.hooks.push(function() { player.stomach.feed(nerd); });
  22. let dontEatHim = new DialogNode();
  23. dontEatHim.text = "You don't eat the nerd.";
  24. this.addChoice("Eat him lol",eatHim);
  25. this.addChoice("Actually don't",dontEatHim);
  26. }