Browse Source

Large skyscrapers, some tuning

tags/v0.7.0
Fen Dweller 7 years ago
parent
commit
389da01aed
3 changed files with 54 additions and 36 deletions
  1. +4
    -2
      game.js
  2. +49
    -33
      recursive-macro.js
  3. +1
    -1
      stroll.html

+ 4
- 2
game.js View File

@@ -442,6 +442,7 @@ function initVictims()
"House": 0, "House": 0,
"Barn": 0, "Barn": 0,
"Small Skyscraper": 0, "Small Skyscraper": 0,
"Large Skyscraper": 0,
"Train": 0, "Train": 0,
"Train Car": 0, "Train Car": 0,
"Parking Garage": 0, "Parking Garage": 0,
@@ -475,7 +476,7 @@ function getOnePrey(biome,area)
switch(biome) { switch(biome) {
case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break; case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break;
case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break; case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break;
case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Parking Garage"]; break;
case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Large Skyscraper", "Parking Garage"]; break;
case "rural": potential = ["Person", "Barn", "House", "Cow"]; break; case "rural": potential = ["Person", "Barn", "House", "Cow"]; break;
} }


@@ -549,7 +550,8 @@ function getPrey(region, area)
"Bus": 0.15, "Bus": 0.15,
"Tram": 0.1, "Tram": 0.1,
"Parking Garage": 0.02, "Parking Garage": 0.02,
"Small Skyscraper": 0.4
"Small Skyscraper": 0.4,
"Large Skyscraper": 0.1
}; break; }; break;
} }
} }


+ 49
- 33
recursive-macro.js View File

@@ -11,6 +11,7 @@ var things =
"House": House, "House": House,
"Barn": Barn, "Barn": Barn,
"Small Skyscraper": SmallSkyscraper, "Small Skyscraper": SmallSkyscraper,
"Large Skyscraper": LargeSkyscraper,
"Train": Train, "Train": Train,
"Train Car": TrainCar, "Train Car": TrainCar,
"Parking Garage": ParkingGarage, "Parking Garage": ParkingGarage,
@@ -36,9 +37,10 @@ var areas =
"House": 1000, "House": 1000,
"Barn": 750, "Barn": 750,
"Small Skyscraper": 2500, "Small Skyscraper": 2500,
"Large Skyscraper": 5000,
"Train": 500, "Train": 500,
"TrainCar": 500, "TrainCar": 500,
"Parking Garage": 5000,
"Parking Garage": 10000,
"Overpass": 10000, "Overpass": 10000,
"Town": 1e7, "Town": 1e7,
"City": 1e9, "City": 1e9,
@@ -61,13 +63,14 @@ var masses =
"House": 10000, "House": 10000,
"Barn": 5000, "Barn": 5000,
"Small Skyscraper": 10000000, "Small Skyscraper": 10000000,
"Train": 5000,
"Train Car": 5000,
"Parking Garage": 100000,
"Overpass": 100000,
"Large Skyscraper": 80000000,
"Train": 50000,
"Train Car": 7500,
"Parking Garage": 10000000,
"Overpass": 1000000,
"Town": 1, "Town": 1,
"City": 1, "City": 1,
"Continent": 1e12,
"Continent": 1e21,
"Planet": 5.972e24, "Planet": 5.972e24,
"Star": 1e40, "Star": 1e40,
"Solar System": 1, "Solar System": 1,
@@ -83,12 +86,13 @@ var clusters =
"Bus": 1, "Bus": 1,
"Tram": 1, "Tram": 1,
"Motorcycle": 1, "Motorcycle": 1,
"House": 20,
"House": 5,
"Barn": 1, "Barn": 1,
"Small Skyscraper": 5,
"Small Skyscraper": 2,
"Large Skyscraper": 1,
"Train": 2, "Train": 2,
"Train Car": 1, "Train Car": 1,
"Parking Garage": 0,
"Parking Garage": 1,
"Overpass": 1, "Overpass": 1,
"Town": 1, "Town": 1,
"City": 1, "City": 1,
@@ -369,14 +373,6 @@ function Container(contents = []) {
return describe_all(this.contents,verbose) return describe_all(this.contents,verbose)
} }


this.eat = function(verbose=true) {
var line = containerEat(this,verbose);
if (line == "")
return defaultEat(this)(verbose);
else
return line;
};

return this; return this;
} }


@@ -412,21 +408,6 @@ function Person(count = 1) {
} }
} }


this.stomp = function(verbose=true) {
var line = personStomp(this);
if (line == "")
return defaultStomp(this)(verbose);
else
return line;
};

this.eat = function(verbose=true) {
var line = personEat(this);
if (line == "")
return defaultEat(this)(verbose);
else
return line;
};
return this; return this;
} }


@@ -784,7 +765,7 @@ function SmallSkyscraper(count = 1) {
return this.count + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside"; return this.count + " small skyscrapers with " + describe_all(this.contents,verbose) + " inside";
} }
} else { } else {
return (this.count > 1 ? this.count + " skyscrapers" : "a skyscraper");
return (this.count > 1 ? this.count + " small skyscrapers" : "a small skyscraper");
} }


} }
@@ -798,6 +779,39 @@ function SmallSkyscraper(count = 1) {
}; };
} }


function LargeSkyscraper(count = 1) {
this.name = "Large Skyscraper";
copy_defaults(this,new DefaultEntity());
this.count = count;
this.contents = {};

this.addContent("Person",150,1500,count);

this.addContent("Empty Car",20,100,count);

this.describeOne = function(verbose=true) {
color = random_desc(["blue","white","gray","tan","green"], (verbose ? 0.5 : 0));
name = random_desc(["skyscraper","office tower","office building"], 1);
return "a " + merge_desc(["towering",color,name]);
}

this.describe = function(verbose = true) {
if (verbose) {
if (this.count <= 3) {
list = [];
for (var i = 0; i < this.count; i++) {
list.push(this.describeOne(this.count < 2));
}
return merge_things(list) + " with " + describe_all(this.contents,verbose) + " inside";
} else {
return this.count + " large skyscrapers with " + describe_all(this.contents,verbose) + " inside";
}
} else {
return (this.count > 1 ? this.count + " large skyscrapers" : "a large skyscraper");
}
}
}

function ParkingGarage(count = 1) { function ParkingGarage(count = 1) {
this.name = "Parking Garage"; this.name = "Parking Garage";
copy_defaults(this,new DefaultEntity()); copy_defaults(this,new DefaultEntity());
@@ -886,6 +900,8 @@ function City(count = 1) {


this.addContent("Small Skyscraper",20,100,count); this.addContent("Small Skyscraper",20,100,count);


this.addContent("Large Skyscraper",10,50,count);

this.addContent("Parking Garage",10,50,count); this.addContent("Parking Garage",10,50,count);


this.describe = function(verbose = true) { this.describe = function(verbose = true) {


+ 1
- 1
stroll.html View File

@@ -66,7 +66,7 @@
<a href="https://chemicalcrux.org/stroll">Changelog</a> <a href="https://chemicalcrux.org/stroll">Changelog</a>
<br> <br>
<div id=custom-species> <div id=custom-species>
<p>Build your Character</p>
<p>Build your Character (leave blank for defaults)</p>
<form id=custom-species-form name="custom-species-form"> <form id=custom-species-form name="custom-species-form">
<ul class="flex-outer"> <ul class="flex-outer">
<li> <li>


Loading…
Cancel
Save