From 8fe00de3b5384ea77c04b86734ddf4d0075f9cfe Mon Sep 17 00:00:00 2001 From: Gabor Biro Date: Sun, 3 Aug 2014 03:53:48 +0200 Subject: [PATCH] Introducing Reputation-type upgrade --- js/game.js | 13 +++++-- json/messages.json | 10 ++++++ json/research.json | 10 +++--- json/upgrades.json | 88 ++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 json/messages.json diff --git a/js/game.js b/js/game.js index d94586c..0d45541 100644 --- a/js/game.js +++ b/js/game.js @@ -17,11 +17,14 @@ detector: { rate: 1 }, + factor: { + rate: 5 + }, data: 0, reputation: 0, money: 0, getGrant: function () { - this.money += this.reputation * 5; // TODO: adjust factor + this.money += this.reputation * this.factor.rate; // TODO: adjust factor, 5 }, acquire: function(amount) { this.data += amount; @@ -85,7 +88,10 @@ upgrade.getReceiver = function() { if (this.type === "detector") { return lab.detector; - } else { + } else if (this.type === "reputation"){ + return lab.factor; + } + else { var context; if (this.type === "research") { context = research; } else if (this.type === "hr") { context = workers; } @@ -102,6 +108,9 @@ if (this.type === "detector") { return true; } + if (this.type === "reputation") { + return true; + } var rec = this.getReceiver(); if (this.type === "research") { return rec.level > 0; diff --git a/json/messages.json b/json/messages.json new file mode 100644 index 0000000..81ffa8d --- /dev/null +++ b/json/messages.json @@ -0,0 +1,10 @@ +{ + { + "name": "01", + "message": "Nobody knows you.", + }, + { + "name": "02", + "message": "If you were working in McDonalds, you were more successfull.", + } +} diff --git a/json/research.json b/json/research.json index ff5e281..6f44004 100644 --- a/json/research.json +++ b/json/research.json @@ -4,7 +4,7 @@ "description": "The W-Boson is the carrier boson of the weak force.", "reputation": 1, "cost": 10, - "cost_increase": 1.3, + "cost_increase": 1.4, "image": "assets/W.png" }, { @@ -12,7 +12,7 @@ "description": "The Z-Boson.", "reputation": 5, "cost": 100, - "cost_increase": 1.35, + "cost_increase": 1.45, "image": "assets/Z.png" }, { @@ -20,7 +20,7 @@ "description": "The top-Quark.", "reputation": 50, "cost": 2000, - "cost_increase": 1.4, + "cost_increase": 1.5, "image": "assets/t.png" }, { @@ -28,7 +28,7 @@ "description": "They are slightly slower than speed (yes, really...), and on top of that they're oscillating.", "reputation": 100, "cost": 25000, - "cost_increase": 1.45, + "cost_increase": 1.55, "image": "assets/nu.png" }, { @@ -36,7 +36,7 @@ "description": "The Higgs-Boson...", "reputation": 200, "cost": 50000, - "cost_increase": 1.5, + "cost_increase": 1.6, "image": "assets/H.png" }, { diff --git a/json/upgrades.json b/json/upgrades.json index a6fce80..03a2b05 100644 --- a/json/upgrades.json +++ b/json/upgrades.json @@ -111,13 +111,13 @@ }, { "name": "New gadgets", - "description": "Your Research Fellows get new techs. They will produce 1.4 times more data.", + "description": "Your Research Fellows get new techs. They will produce 1.2 times more data.", "cost": 800000, "used": false, "type": "hr", "receiver": "Research Fellows", "property": "rate", - "factor": 1.4, + "factor": 1.2, "constant": 0, "image": "assets/gadget.png" }, @@ -150,75 +150,75 @@ { "name": "Accelerator upgrade", - "description": "Increases the luminosity (you get 2 times more data with clicks).", + "description": "Increases the luminosity (you get 3 times more data with clicks).", "cost": 1000, "used": false, "type": "detector", "receiver": "", "property": "rate", - "factor": 2, + "factor": 3, "constant": 0, "image": "assets/energy.png" }, { "name": "Accelerator upgrade 2", - "description": "Increases the luminosity (you get 2 times more data with clicks).", + "description": "Increases the luminosity (you get 3 times more data with clicks).", "cost": 10000, "used": false, "type": "detector", "receiver": "", "property": "rate", - "factor": 2, + "factor": 3, "constant": 0, "image": "assets/energy.png" }, { "name": "Accelerator upgrade 3", - "description": "Increases the luminosity (you get 2 times more data with clicks).", + "description": "Increases the luminosity (you get 3 times more data with clicks).", "cost": 100000, "used": false, "type": "detector", "receiver": "", "property": "rate", - "factor": 2, + "factor": 3, "constant": 0, "image": "assets/energy.png" }, { "name": "Detector upgrade", - "description": "Your amazing detector works with better efficiency (you get +2 data with clicks).", + "description": "Your amazing detector works with better efficiency (you get +4 data with clicks).", "cost": 500, "used": false, "type": "detector", "receiver": "", "property": "rate", "factor": 1, - "constant": 2, + "constant": 4, "image": "assets/efficiency.png" }, { "name": "Detector upgrade 2", - "description": "Your amazing detector works with better efficiency (you get +6 data with clicks).", + "description": "Your amazing detector works with better efficiency (you get +12 data with clicks).", "cost": 5000, "used": false, "type": "detector", "receiver": "", "property": "rate", "factor": 1, - "constant": 6, + "constant": 12, "image": "assets/efficiency.png" }, { "name": "Detector upgrade 3", - "description": "Your amazing detector works with better efficiency (you get +24 data with clicks).", + "description": "Your amazing detector works with better efficiency (you get +42 data with clicks).", "cost": 50000, "used": false, "type": "detector", "receiver": "", "property": "rate", "factor": 0, - "constant": 24, + "constant": 42, "image": "assets/efficiency.png" }, @@ -281,5 +281,65 @@ "factor": 1.2, "constant": 1, "image": "assets/propaganda.png" + }, + { + "name": "Science is cool!! lvl 1", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 1000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.1, + "constant": 0, + "image": "assets/budget.png" + }, + { + "name": "Science is cool!! lvl 2", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 10000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.1, + "constant": 0, + "image": "assets/budget.png" + }, + { + "name": "Science is cool!! lvl 3", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 100000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.1, + "constant": 0, + "image": "assets/budget.png" + }, + { + "name": "Science is cool!! lvl 4", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 1000000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.1, + "constant": 0, + "image": "assets/budget.png" + }, + { + "name": "Science is cool!! lvl 5", + "description": "Because your science is so popular, you get 1.1 times more money for your reputation.", + "cost": 10000000, + "used": false, + "type": "reputation", + "receiver": "", + "property": "rate", + "factor": 1.1, + "constant": 0, + "image": "assets/budget.png" } ]