Преглед на файлове

Enemies can have custom defeat dialogs now.

tags/v0.2.8
Fen Dweller преди 7 години
родител
ревизия
f308499076
променени са 4 файла, в които са добавени 11 реда и са изтрити 3 реда
  1. +3
    -0
      customs.js
  2. +5
    -1
      dialog.js
  3. +1
    -2
      feast.js
  4. +2
    -0
      vore.js

+ 3
- 0
customs.js Целия файл

@@ -238,4 +238,7 @@ function Trance() {

this.startCombat = function() { return ["You yelp and turn around as hot breath spills over your shoulder. A massive sergal has crept up on you...and he looks <i>hungry</i>"]; };
this.digestFinish = function() { return ["The sergal's crushing guts reduce you to a pool of chyme..."]; };
this.defeated = function() { changeMode("explore"); update(["The sergal winces and stumbles, grabbing a thick branch to steady himself...and snapping in half like a twig. You decide discretion is the better part of valor and run while you can."]); };
this.prefs.prey = false;

}

+ 5
- 1
dialog.js Целия файл

@@ -66,13 +66,17 @@ function PhoneCall() {
function FallenFoe(foe) {
DialogNode.call(this);

this.text = ["What do you want to do with your enemy?"];
this.text = [foe.description("The") + " falls to the ground!", newline, "What do you want to do with your enemy?"];

{
let nodeEat = new DialogNode();
this.addChoice("Devour!",nodeEat);
nodeEat.text = ["You grab your helpless prey and force them down your gullet. You hack up their wallet a minute later, finding $" + foe.cash + " inside."];

nodeEat.requirements.push( function(attacker, defender) {
return defender.prefs.prey;
});

nodeEat.hooks.push(function() {
player.cash += foe.cash;
});


+ 1
- 2
feast.js Целия файл

@@ -398,8 +398,7 @@ function attackClicked(index) {
update(playerAttacks[index].attack(currentFoe));

if (currentFoe.health <= 0) {
update([currentFoe.description("The") + " falls to the ground!"]);
startDialog(new FallenFoe(currentFoe));
currentFoe.defeated();
} else if (mode == "combat") {
let attack = pick(filterPriority(filterValid(currentFoe.attacks, currentFoe, player)), currentFoe, player);



+ 2
- 0
vore.js Целия файл

@@ -52,6 +52,8 @@ function Creature(name = "Creature", str=10, dex=10, con=10) {
this.startCombat = function() { return [this.description("A") + " appears. It's a fight!"]; };

this.finishDigest = function() { return [this.description("The") + " digests you..."]; };

this.defeated = function() { startDialog(new FallenFoe(this)); };
}

function Player(name = "Player") {


Loading…
Отказ
Запис