Pārlūkot izejas kodu

Fixed area variance. Better tracking for micros stuck in treads/socks/paws.

tags/v0.7.0
Fen Dweller pirms 7 gadiem
vecāks
revīzija
a92a888acb
2 mainītis faili ar 25 papildinājumiem un 5 dzēšanām
  1. +24
    -4
      game.js
  2. +1
    -1
      recursive-macro.js

+ 24
- 4
game.js Parādīt failu

@@ -805,6 +805,9 @@ let macro =
} }
}, },


"shoeTrapped": [],
"sockTrapped": [],

"shoe": { "shoe": {
"name": "shoe", "name": "shoe",
"container": new Container(), "container": new Container(),
@@ -1273,8 +1276,10 @@ let macro =
} }
} else if (this.footSockWorn && this.sock.container.count > 0) { } else if (this.footSockWorn && this.sock.container.count > 0) {
line += " Within " + (this.sock.container.count > 1 ? "are" : "is") + " " + this.sock.container.describe(false); line += " Within " + (this.sock.container.count > 1 ? "are" : "is") + " " + this.sock.container.describe(false);
} else if (this.paws.container.count > 0) {
line += " You have " + this.paws.container.describe(false) + " wedged between your toes.";
}

if (this.paws.container.count > 0) {
line += " You have " + this.paws.container.describe(false) + " wedged between your " + macro.toeDesc(true);
} }


result.push(line); result.push(line);
@@ -1667,9 +1672,11 @@ function stomp_wedge() {
let area = 0; let area = 0;


if (!macro.footWear || (!macro.footSockWorn && !macro.footShoeWorn)) if (!macro.footWear || (!macro.footSockWorn && !macro.footShoeWorn))
area = macro.pawArea/10;
area = macro.pawArea / 10;
else if (macro.footShoeWorn)
area = macro.pawArea / 25;
else else
area = 0;
area = macro.pawArea / 50;


let prey = getPrey(biome, area, false); let prey = getPrey(biome, area, false);


@@ -2520,6 +2527,7 @@ function fart(vol)
} }


function wear_shoes() { function wear_shoes() {
macro.shoe.container = macro.shoe.container.merge(macro.paws.container);


let line = describe("wear-shoe",macro.shoe.container.merge(macro.paws.container),macro,verbose); let line = describe("wear-shoe",macro.shoe.container.merge(macro.paws.container),macro,verbose);
macro.paws.container = new Container(); macro.paws.container = new Container();
@@ -2529,12 +2537,18 @@ function wear_shoes() {


footwearUpdate(); footwearUpdate();


macro.paws.container = macro.shoeTrapped;
macro.shoeTrapped = [];

update([line,summary,newline]); update([line,summary,newline]);
} }


function remove_shoes() { function remove_shoes() {
macro.footShoeWorn = false; macro.footShoeWorn = false;


macro.shoeTrapped = macro.paws.container;
macro.paws.container = new Container();

let line = describe("remove-shoe",macro.shoe.container,macro,verbose); let line = describe("remove-shoe",macro.shoe.container,macro,verbose);
let summary = summarize(macro.shoe.container.sum(),false); let summary = summarize(macro.shoe.container.sum(),false);


@@ -2552,6 +2566,9 @@ function wear_socks() {


macro.footSockWorn = true; macro.footSockWorn = true;


macro.paws.container = macro.sockTrapped;
macro.sockTrapped = [];

footwearUpdate(); footwearUpdate();


update([line,summary,newline]); update([line,summary,newline]);
@@ -2560,6 +2577,9 @@ function wear_socks() {
function remove_socks() { function remove_socks() {
macro.footSockWorn = false; macro.footSockWorn = false;


macro.sockTrapped = macro.paws.container;
macro.paws.container = new Container();

let line = describe("remove-sock",macro.sock.container,macro,verbose); let line = describe("remove-sock",macro.sock.container,macro,verbose);
let summary = summarize(macro.sock.container.sum(),false); let summary = summarize(macro.sock.container.sum(),false);




+ 1
- 1
recursive-macro.js Parādīt failu

@@ -231,7 +231,7 @@ function initContents(name,count) {


function fill_area(area, weights, variance=0.15) function fill_area(area, weights, variance=0.15)
{ {
area = area + Math.random() * variance * 2 - variance;
area = area + Math.random() * variance * 2 * area - variance * area;
var result = []; var result = [];
var candidates = []; var candidates = [];
for (var key in weights) { for (var key in weights) {


Notiek ielāde…
Atcelt
Saglabāt