Bladeren bron

Enemies have meaningful builds now, with different stats

tags/v0.2.8
Fen Dweller 7 jaren geleden
bovenliggende
commit
ad6237a61c
2 gewijzigde bestanden met toevoegingen van 32 en 10 verwijderingen
  1. +4
    -0
      feast.js
  2. +28
    -10
      vore.js

+ 4
- 0
feast.js Bestand weergeven

@@ -21,6 +21,10 @@ let prefs = {
}
};

function pickRandom(list) {
return list[Math.floor(Math.random() * list.length)];
}

function pick(list, attacker, defender) {
if (list.length == 0)
return null;


+ 28
- 10
vore.js Bestand weergeven

@@ -52,20 +52,38 @@ function Player(name = "Player") {
this.backupAttack = new pass(this);
}

function Anthro() {
Creature.call(this, name);
function Anthro(name="Anthro") {
this.build = pickRandom(["skinny", "fat", "muscular", "sickly", "ordinary"]);

switch(this.build) {
case "skinny":
Creature.call(this, name, 8, 12, 8);
this.mass *= ( Math.random() * 0.2 + 0.7 );
break;
case "fat":
Creature.call(this, name, 10, 7, 15);
this.mass *= ( Math.random() * 0.4 + 1.1);
break;
case "muscular":
Creature.call(this, name, 13, 11, 13);
this.mass *= ( Math.random() * 0.1 + 1.1);
break;
case "sickly":
Creature.call(this, name, 6, 8, 6);
this.mass *= ( Math.random() * 0.2 + 0.6 );
break;
case "ordinary":
Creature.call(this, name, 10, 10, 10);
break;

this.mass = 80 * (Math.random()/2 - 0.25 + 1);
this.build = "ordinary";
if (this.mass < 70) {
this.build = "skinny";
} else if (this.mass > 90) {
this.build = "fat";
}

this.species = pick(["dog","cat","lizard","deer","wolf","fox"]);
this.species = pickRandom(["dog","cat","lizard","deer","wolf","fox"]);
this.description = function() {
return this.build + " " + this.species;
if (this.build == "")
return this.species;
else
return this.build + " " + this.species;
};

this.attacks.push(new punchAttack(this));


Laden…
Annuleren
Opslaan