소스 검색

Fixed broken conditions. Worked on walf

tags/v0.2.8
Fen Dweller 7 년 전
부모
커밋
cded99a5cf
3개의 변경된 파일55개의 추가작업 그리고 8개의 파일을 삭제
  1. +1
    -1
      feast.js
  2. +49
    -7
      forest.js
  3. +5
    -0
      vore.js

+ 1
- 1
feast.js 파일 보기

@@ -313,7 +313,7 @@ function updateActions() {
actions = [];
currentRoom.objects.forEach(function (object) {
object.actions.forEach(function (action) {
if (action.conditions == undefined || action.conditions.reduce((result, cond) => result && cond(player.prefs), true))
if (action.conditions == undefined || action.conditions.reduce((result, cond) => result && cond(player), true))
actions.push(action);
});
});


+ 49
- 7
forest.js 파일 보기

@@ -38,16 +38,15 @@ function Wolf() {

this.hasName = false;

this.description = function() { return "wolf"; };
this.description = function(prefix) { return prefix + " wolf"; };

this.attacks = [];

this.attacks.push(wolfBite(this));

//this.attacks.push(wolfSwallow(this));
this.attacks.push(wolfHowl(this));

this.attacks.push(wolfTackle(this));
//this.attacks.push(wolfTackleBite(this));
this.attacks.push(wolfTackleBite(this));
this.attacks.push(wolfTackleSwallow(this));

this.attacks.push(wolfDigest(this));
@@ -57,15 +56,15 @@ function Wolf() {
this.flags.stage = "combat";

this.startCombat = function(player) {
return ["Oh no a feral wolf"];
return ["A snapping twig grabs your attention. You turn and find yourself facing a large, mangy wolf. The cur stands at least half your height at the shoulder, and it looks <i>hungry.</i>"];
};

this.finishCombat = function() {
return ["Oops eaten"];
return ["The wolf knocks you to the ground. You bash your head on a rock and black out."];
};

this.status = function(player) {
return ["It's a wolf"];
return [];
};
}

@@ -88,6 +87,26 @@ function wolfBite(attacker) {
};
}

function wolfHowl(attacker) {
return {
attackPlayer: function(defender){
attacker.statBuffs.push(new StatBuff("str", 1.25));
return ["The wolf backs up and lets out a long, wailing howl.",newline,"It seems emboldened."];
},
requirements: [
function(attacker, defender) {
return attacker.flags.stage == "combat";
},
function(attacker, defender) {
return !attacker.flags.grappled && !defender.flags.grappled;
}
],
priority: 1,
weight: function(attacker, defender) { return 0.25; }
};
}


function wolfTackle(attacker) {
return {
attackPlayer: function(defender){
@@ -107,6 +126,29 @@ function wolfTackle(attacker) {
};
}

function wolfTackleBite(attacker) {
return {
attackPlayer: function(defender){
let damage = attack(attacker, defender, attacker.str * 1.5);
return pickRandom([
["Pain shoots through your arm as the wolf bites it for " + damage + " damage!"],
["You struggle against the wolf as it bites your shoulder for " + damage + " damage."],
["The wolf's claws dig into your legs for " + damage + " damage."]
]);
},
requirements: [
function(attacker, defender) {
return attacker.flags.stage == "combat";
},
function(attacker, defender) {
return !attacker.flags.grappled && defender.flags.grappled;
}
],
priority: 1,
weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
};
}

function wolfTackleSwallow(attacker) {
return {
attackPlayer: function(defender){


+ 5
- 0
vore.js 파일 보기

@@ -1,5 +1,10 @@
"use strict";

function StatBuff(type, amount) {
this.stat = type;
this.amount = amount;
}

function Creature(name = "Creature", str = 10, dex = 10, con = 10) {
this.name = name;



불러오는 중...
취소
저장