munch
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

46 рядки
833 B

  1. function pick(list) {
  2. return list[Math.floor(Math.random()*list.length)];
  3. }
  4. function Creature(name = "Creature") {
  5. this.name = name;
  6. this.health = 100;
  7. this.maxHealth = 100;
  8. this.mass = 80;
  9. this.stomach = Stomach();
  10. }
  11. function Player(name = "Player") {
  12. Creature.call(this, name);
  13. this.fullness = 100;
  14. this.maxFullness = 200;
  15. }
  16. function Anthro() {
  17. let species = pick(["dog","cat","lizard","deer","wolf","fox"]);
  18. Creature.call(this, name);
  19. }
  20. // vore stuff here
  21. function Container(name = "stomach") {
  22. this.name = name;
  23. this.contents = [];
  24. this.digest = function() {
  25. };
  26. }
  27. function Stomach() {
  28. Container.call(this, "stomach");
  29. this.digest = function() {
  30. let lines = [];
  31. this.contents.forEach(function (prey) {
  32. lines.push("Something is digesting!");
  33. });
  34. return lines;
  35. }
  36. }