Sfoglia il codice sorgente

Added chewing. Adjusted layout, again.

tags/v0.7.0
Fen Dweller 7 anni fa
parent
commit
afcf47d77d
4 ha cambiato i file con 51 aggiunte e 4 eliminazioni
  1. +40
    -0
      game.js
  2. +6
    -0
      recursive-desc.js
  3. +2
    -1
      stroll.html
  4. +3
    -3
      style.css

+ 40
- 0
game.js Vedi File

@@ -873,6 +873,42 @@ function feed()
update([sound,line,linesummary,newline]);
}

function chew()
{
var area = macro.handArea;
var prey = getPrey(biome, area);

var line = describe("chew", prey, macro, verbose)
var linesummary = summarize(prey.sum(), false);

var people = get_living_prey(prey.sum());
var sound = "";
if (people == 0) {
sound = "";
} else if (people < 3) {
sound = "Snap.";
} else if (people < 10) {
sound = "Crunch.";
} else if (people < 50) {
sound = "Crack!";
} else if (people < 500) {
sound = "CRUNCH!";
} else if (people < 5000) {
sound = "CRRRUNCH!";
} else {
sound = "Oh the humanity!";
}

var preyMass = prey.sum_property("mass");

macro.addGrowthPoints(preyMass);

macro.arouse(10);

updateVictims("digested",prey);
update([sound,line,linesummary,newline]);
}

function stomp()
{
var area = macro.pawArea;
@@ -1812,6 +1848,9 @@ function startGame(e) {
victimTypes.push("splooged");
}

if (macro.brutality < 1) {
document.getElementById("button-chew").style.display = 'none';
}
var table = document.getElementById("victim-table");

var tr = document.createElement('tr');
@@ -1887,6 +1926,7 @@ window.addEventListener('load', function(event) {

document.getElementById("button-look").addEventListener("click",look);
document.getElementById("button-feed").addEventListener("click",feed);
document.getElementById("button-chew").addEventListener("click",chew);
document.getElementById("button-stomp").addEventListener("click",stomp);
document.getElementById("button-anal_vore").addEventListener("click",anal_vore);
document.getElementById("button-tail_slap").addEventListener("click",tail_slap);


+ 6
- 0
recursive-desc.js Vedi File

@@ -1,6 +1,7 @@
rules = {};

rules["eat"] = [];
rules["chew"] = [];
rules["stomp"] = [];
rules["kick"] = [];
rules["anal-vore"] = [];
@@ -112,6 +113,7 @@ function describe(action, container, macro, verbose=true) {
function describeDefault(action, container, macro, verbose=true) {
switch(action) {
case "eat": return defaultEat(container, macro, verbose);
case "chew": return defaultChew(container, macro, verbose);
case "stomp": return defaultStomp(container, macro, verbose);
case "kick": return defaultKick(container, macro, verbose);
case "anal-vore": return defaultAnalVore(container, macro, verbose);
@@ -142,6 +144,10 @@ function defaultEat(container, macro, verbose) {
return "You scoop up " + container.describe(verbose) + " and swallow " + (container.count > 1 ? "them" : "it") + " whole.";
}

function defaultChew(container, macro, verbose) {
return "You scoop up " + container.describe(verbose) + " and crunch " + (container.count > 1 ? "them" : "it") + " in your powerful jaws, then swallow them down.";
}

function defaultStomp(container, macro, verbose) {
if (isFatal(macro))
return "You crush " + container.describe(verbose) + " underfoot.";


+ 2
- 1
stroll.html Vedi File

@@ -72,6 +72,7 @@
<div class=button-container id=action-panel>
<button class=action-button id=button-look>Look</button>
<button class=action-button id=button-feed>Eat</button>
<button class=action-button id=button-chew>Chew</button>
<button class=action-button id=button-stomp>Stomp</button>
<button class=action-button id=button-anal_vore>Sit</button>
<button class=action-button id=button-tail_slap>Tail Slap</button>
@@ -89,7 +90,7 @@
<button class=action-button class=action-button id=button-numbers>Numbers: Full</button>
<button class=action-button class=action-button id=button-units>Units: Metric</button>
<button class=action-button id=button-verbose>Verbose</button>
<button class=action-button id=button-grow-lots>Get WAY Bigger</button>
<button class=action-button id=button-grow-lots>SUPER BIG</button>
</div>




+ 3
- 3
style.css Vedi File

@@ -27,7 +27,7 @@ body {
}

#log {
height: 600px;
height: 900px;
overflow: auto;
background-color: #fff;
}
@@ -90,8 +90,8 @@ body {

.action-button {
font-size: 24px;
width: 120px;
height: 60px;
width: 150px;
height: 75px;
}

#victim-table {


Loading…
Annulla
Salva