Procházet zdrojové kódy

Added logic for saving dropdown menus, and added paw types

tags/v0.7.0
Fen Dweller před 8 roky
rodič
revize
9dd2cb7cde
3 změnil soubory, kde provedl 69 přidání a 11 odebrání
  1. +50
    -1
      game.js
  2. +11
    -10
      recursive-desc.js
  3. +8
    -0
      stroll.html

+ 50
- 1
game.js Zobrazit soubor

@@ -81,6 +81,47 @@ let macro =
"assScale": 1, "assScale": 1,
"analVore": true, "analVore": true,


// part types

"footType": "paw",

"footDesc": function(plural=false,capital=false) {
let result = "";
switch(this.footType) {
case "paw":
result = plural ? "paws" : "paw";
break;
case "hoof":
result = plural ? "hooves" : "hoof";
break;
case "feet":
case "avian":
result = plural ? "feet" : "foot";
break;
}
return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result;
},

"toeDesc": function(plural=false,capital=false) {
let result = "";
switch(this.footType) {
case "paw":
result = plural ? "toes" : "toe";
break;
case "hoof":
result = plural ? "hooves" : "hoof";
break;
case "feet":
result = plural ? "toes" : "toe";
break;
case "avian":
result = plural ? "talons" : "talon";
breka;
}
return capital ? result.charAt(0).toUpperCase() + result.slice(1) : result;
},
"jawType": "jaws",

"hasTail": true, "hasTail": true,
"tailType": "slinky", "tailType": "slinky",
"tailCount": 1, "tailCount": 1,
@@ -1802,7 +1843,6 @@ function sheath_absorb()
macro.arouse(45); macro.arouse(45);
} }



function cockslap() function cockslap()
{ {
let area = macro.dickArea; let area = macro.dickArea;
@@ -2540,6 +2580,8 @@ function saveSettings() {
let name = form[i].name.match(/(?:[a-zA-Z]+-)*[a-zA-Z]+/)[0]; let name = form[i].name.match(/(?:[a-zA-Z]+-)*[a-zA-Z]+/)[0];
if (form[i].checked) if (form[i].checked)
settings[name] = form[i].id; settings[name] = form[i].id;
} else if (form[i].type == "select-one") {
settings[form[i].name] = form[i][form[i].selectedIndex].value;
} }
} }


@@ -2566,6 +2608,13 @@ function loadSettings() {
} else if (form[i].type == "radio") { } else if (form[i].type == "radio") {
let name = form[i].name.match(/(?:[a-zA-Z]+-)*[a-zA-Z]+/)[0]; let name = form[i].name.match(/(?:[a-zA-Z]+-)*[a-zA-Z]+/)[0];
form[i].checked = (settings[name] == form[i].id); form[i].checked = (settings[name] == form[i].id);
} else if (form[i].type == "select-one") {
for (let j=0; j<form[i].length; j++) {
if (form[i][j].value == settings[form[i].name]) {
form[i].selectedIndex = j;
break;
}
}
} }
} }
} }


+ 11
- 10
recursive-desc.js Zobrazit soubor

@@ -132,7 +132,7 @@ function defaultChew(container, macro, verbose) {


function defaultStomp(container, macro, verbose) { function defaultStomp(container, macro, verbose) {
if (container.count == 0) if (container.count == 0)
return "Your paw thumps the ground.";
return "Your " + macro.footDesc() + " thumps the ground.";
else if (isFatal(macro)) else if (isFatal(macro))
return "You crush " + container.describe(verbose) + " underfoot."; return "You crush " + container.describe(verbose) + " underfoot.";
else else
@@ -141,7 +141,7 @@ function defaultStomp(container, macro, verbose) {


function defaultKick(container, macro, verbose) { function defaultKick(container, macro, verbose) {
if (container.count == 0) if (container.count == 0)
return "You swing your mighty paw..and hit nothing.";
return "You swing your mighty " + macro.footDesc() + "..and hit nothing.";
else else
return "You punt " + container.describe(verbose) + ", destroying " + (container.count > 1 ? "them" : "it") + "."; return "You punt " + container.describe(verbose) + ", destroying " + (container.count > 1 ? "them" : "it") + ".";
} }
@@ -417,11 +417,11 @@ function defaultSoulVore(container, macro, verbose) {
function defaultSoulAbsorbPaw(container, macro, verbose) { function defaultSoulAbsorbPaw(container, macro, verbose) {
let sum = container.sum()["Person"]; let sum = container.sum()["Person"];
if (container.count == 0) if (container.count == 0)
return "Your paw thumps against the ground";
return "Your " + macro.footDesc() + " thumps against the ground";
else if (sum == 0) else if (sum == 0)
return "Your paw slams down on " + container.describe(verb0se) + "...but there aren't any souls within!";
return "Your " + macro.footDesc() + " slams down on " + container.describe(verb0se) + "...but there aren't any souls within!";
else else
return "Your paw slams down on " + container.describe(verbose) + ", smashing them to pieces and absorbing " + sum + (sum == 1 ? " soul" : " souls") + " into your pads.";
return "Your " + macro.footDesc() + " slams down on " + container.describe(verbose) + ", smashing them to pieces and absorbing " + sum + (sum == 1 ? " soul" : " souls") + " into your pads.";
} }


function defaultStomach(container, macro, verbose) { function defaultStomach(container, macro, verbose) {
@@ -590,7 +590,7 @@ rules["stomp"].push({
hasExactly(container, "Person", 1) && hasExactly(container, "Person", 1) &&
isFatal(macro); isFatal(macro);
}, "desc": function(container, macro, verbose) { }, "desc": function(container, macro, verbose) {
return "Your heavy paw slams down on " + container.describe(verbose) + ", smashing the poor thing like an insect.";
return "Your heavy " + macro.footDesc() + " slams down on " + container.describe(verbose) + ", smashing the poor thing like an insect.";
} }
}); });


@@ -600,7 +600,7 @@ rules["stomp"].push({
hasExactly(container, "Person", 1) && hasExactly(container, "Person", 1) &&
isGory(macro); isGory(macro);
}, "desc": function(container, macro, verbose) { }, "desc": function(container, macro, verbose) {
return "Your paw thumps " + container.describe(verbose) + ", shoving your victim to the ground and cracking them open like an egg.";
return "Your " + macro.footDesc() + " thumps " + container.describe(verbose) + ", shoving your victim to the ground and cracking them open like an egg.";
} }
}); });


@@ -610,16 +610,17 @@ rules["stomp"].push({
hasExactly(container, "Person", 1) && hasExactly(container, "Person", 1) &&
isGory(macro); isGory(macro);
}, "desc": function(container, macro, verbose) { }, "desc": function(container, macro, verbose) {
return "Your shadow falls over " + container.describe(verbose) + ", and your paw follows, crushing their soft body and reducing them to a heap of broken gore.";
return "Your shadow falls over " + container.describe(verbose) + ", and your " + macro.footDesc() + " follows, crushing their soft body and reducing them to a heap of broken gore.";
} }
}); });


rules["stomp"].push({ rules["stomp"].push({
"test": function(container, macro) { "test": function(container, macro) {
return hasNothingElse(container, ["Person","Cow","Car"]) && return hasNothingElse(container, ["Person","Cow","Car"]) &&
isNonFatal(macro);
isNonFatal(macro) &&
macro.footType == "paw";
}, "desc": function(container, macro, verbose) { }, "desc": function(container, macro, verbose) {
return "Your soft paws smoosh over " + container.describe(verbose) + ". They stick to your toes, carried along for the ride as you take another few steps before finally\
return "Your paw smooshes over " + container.describe(verbose) + ". They stick to your toes, carried along for the ride as you take another few steps before finally\
falling off."; falling off.";
} }
}); });


+ 8
- 0
stroll.html Zobrazit soubor

@@ -233,6 +233,14 @@
<label for="soulVoreEnabled">Soul vore</label> <label for="soulVoreEnabled">Soul vore</label>
<input type="checkbox" checked="true" name="soulVoreEnabled"/> <input type="checkbox" checked="true" name="soulVoreEnabled"/>
</li> </li>
<li>
<label for="footType">Foot type</label>
<select name="footType">
<option value="paw">Paws</option>
<option value="hoof">Hooves</option>
<option value="foot">Human</option>
<option value="avian">Avian</option>
</select>
</div> </div>
</div> </div>
<div class="custom-category"> <div class="custom-category">


Načítá se…
Zrušit
Uložit