Browse Source

Upgrade for anthros, fixes to layout, micro upgrades buff clicks

tags/v0.0.1
Fen Dweller 7 years ago
parent
commit
81687b1a9c
No known key found for this signature in database GPG Key ID: E80B35A6F11C3656
4 changed files with 48 additions and 22 deletions
  1. +18
    -2
      constants.js
  2. +14
    -13
      gorge.css
  3. +1
    -1
      gorge.html
  4. +15
    -6
      gorge.js

+ 18
- 2
constants.js View File

@@ -114,7 +114,7 @@ const upgrades = {
"name": "Bigger Micros", "name": "Bigger Micros",
"desc": "A macro micro? Certainly more filling.", "desc": "A macro micro? Certainly more filling.",
"cost": { "cost": {
"food": 100
"food": buildings.micro.cost * 5
}, },
"effect": { "effect": {
"type": "prod-2x", "type": "prod-2x",
@@ -130,7 +130,7 @@ const upgrades = {
"name": "Beefy Micros", "name": "Beefy Micros",
"desc": "25% more protein, 10% fewer carbs.", "desc": "25% more protein, 10% fewer carbs.",
"cost": { "cost": {
"food": 500
"food": buildings.micro.cost * 50
}, },
"effect": { "effect": {
"type": "prod-2x", "type": "prod-2x",
@@ -141,5 +141,21 @@ const upgrades = {
"micro": 10 "micro": 10
} }
} }
},
"anthro-prod-1": {
"name": "Willing Prey",
"desc": "Why bother chasing it down?",
"cost": {
"food": buildings.anthro.cost * 5
},
"effect": {
"type": "prod-2x",
"target": "anthro"
},
"prereqs": {
"buildings": {
"anthro": 1
}
}
} }
} }

+ 14
- 13
gorge.css View File

@@ -122,37 +122,37 @@ body.dark {
#upgrade-tooltip { #upgrade-tooltip {
position: absolute; position: absolute;
width: 200px; width: 200px;
height: 300px;
background: #222;
height: 125%;
background: #333;
display: none; display: none;
z-index: 1; z-index: 1;
left: 0px; left: 0px;
top: 0px; top: 0px;
border: 5px;
border-color: #fff;
} }


#upgrade-tooltip-desc { #upgrade-tooltip-desc {
position:absolute;
top: 0px;
left: 0px;
font-size: 14px;
color: #bbb;
margin: 10px;
top: 50%;
left: 10px;
} }


#upgrade-tooltip-effect { #upgrade-tooltip-effect {
position: absolute;
top: 50px;
font-size: 20px;
margin: 10px;
} }


#upgrade-tooltip-cost { #upgrade-tooltip-cost {
position: absolute; position: absolute;
right: 0px;
bottom: 0px;
right: 10px;
bottom: 10px;
} }


#upgrade-tooltip-prereqs { #upgrade-tooltip-prereqs {
position: absolute; position: absolute;
left: 0px;
bottom: 0px;
left: 10px;
bottom: 10px;
} }


.cost-met { .cost-met {
@@ -174,6 +174,7 @@ body.dark {


.upgrade-button-inactive { .upgrade-button-inactive {
background-color: #222 !important; background-color: #222 !important;
color: #999 !important;
} }


.upgrade-button-name { .upgrade-button-name {


+ 1
- 1
gorge.html View File

@@ -35,8 +35,8 @@
<div id="upgrades-area"> <div id="upgrades-area">
<div id="upgrades" class="title">Upgrades</div> <div id="upgrades" class="title">Upgrades</div>
<div id="upgrade-tooltip"> <div id="upgrade-tooltip">
<div id="upgrade-tooltip-desc"></div>
<div id="upgrade-tooltip-effect"></div> <div id="upgrade-tooltip-effect"></div>
<div id="upgrade-tooltip-desc"></div>
<div id="upgrade-tooltip-prereqs"></div> <div id="upgrade-tooltip-prereqs"></div>
<div id="upgrade-tooltip-cost"></div> <div id="upgrade-tooltip-cost"></div>
</div> </div>


+ 15
- 6
gorge.js View File

@@ -20,8 +20,8 @@ function calculateProductivity() {


// here's where upgrades will go :3 // here's where upgrades will go :3


function productivityOf(type) {
let baseProd = buildings[type].prod;
function productivityMultiplierOf(type) {
let base = 1;


for (const [key, value] of Object.entries(upgrades)) { for (const [key, value] of Object.entries(upgrades)) {
if (!ownedUpgrades[key]) { if (!ownedUpgrades[key]) {
@@ -31,11 +31,20 @@ function productivityOf(type) {


if (value.effect.type == "prod-2x") { if (value.effect.type == "prod-2x") {
if (value.effect.target == type) { if (value.effect.target == type) {
baseProd *= 2;
base *= 2;
} }
} }
} }
return baseProd * belongings[type].count;

return base;
}

function productivityOf(type) {
let baseProd = buildings[type].prod;

let prod = baseProd * productivityMultiplierOf(type);

return prod * belongings[type].count;
} }


function costOfBuilding(type) { function costOfBuilding(type) {
@@ -148,7 +157,7 @@ function buyUpgrade(id) {
} }


function eatMicro() { function eatMicro() {
resources.food += 1;
resources.food += productivityMultiplierOf("micro");
} }
// setup stuff lol // setup stuff lol


@@ -332,7 +341,7 @@ function upgradeTooltip(id, event) {


let tooltip = document.querySelector("#upgrade-tooltip"); let tooltip = document.querySelector("#upgrade-tooltip");


tooltip.style.setProperty("display", "block");
tooltip.style.setProperty("display", "inline-block");


let tooltipDesc = document.querySelector("#upgrade-tooltip-desc"); let tooltipDesc = document.querySelector("#upgrade-tooltip-desc");




Loading…
Cancel
Save