-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
177 lines (172 loc) · 6.83 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Trimps Perk Calculator</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script src="https://raw.githubusercontent.com/jquery/jquery-mousewheel/master/jquery.mousewheel.min.js"></script>
<script>
var perks = {
"coordinated": {
baseCost: 150000,
target: "coordinated",
ratio: 1
},
"carpentry": {
baseCost: 25,
target: "coordinated",
ratio: 2.5
},
"artisanistry": {
baseCost: 15,
target: "carpentry",
ratio: 4
},
"looting": {
baseCost: 1,
target: "artisanistry",
ratio: 1
},
"resourceful": {
baseCost: 50000,
target: "artisanistry",
ratio: 2
},
"resilience": {
baseCost: 100,
target: "artisanistry",
ratio: 2
},
"power": {
baseCost: 1,
target: "artisanistry",
ratio: 4
},
"motivation": {
baseCost: 2,
target: "artisanistry",
ratio: 5
},
"toughness": {
baseCost: 1,
target: "power",
ratio: 3
},
"pheromones": {
baseCost: 3,
target: "toughness",
ratio: 2
}
};
var calcCost = function (perk, level) {
"use strict";
return Math.ceil(level / 2 + perks[perk].baseCost * Math.pow(1.3, level));
};
function recalculateCosts() {
for (perk in perks) {
perks[perk].cost = calcCost(perk,$("#"+perk+" input").val());
$("#"+perk+" .cost").text(perks[perk].cost.toLocaleString());
perks[perk].targetCost = Math.ceil(perks[perks[perk].target].cost / perks[perk].ratio);
$("#"+perk+" .targetCost").text(perks[perk].targetCost.toLocaleString());
if (perks[perk].targetCost < perks[perk].cost) {
$("#"+perk).addClass("ui-state-error");
} else {
$("#"+perk).removeClass("ui-state-error");
}
}
}
$(function () {
$("input").spinner({
min: 1,
change: recalculateCosts
}).mousewheel(recalculateCosts);
recalculateCosts();
$("#info").dialog();
});
</script>
<style>
tr {
text-align: right;
}
th {
text-align: center;
}
</style>
</head>
<body>
<div id="info" title="Instructions">
<p>Enter the level displayed on the "View Perks" screen. You have to click off of the input box to recalculate the values.</p>
<p>Only upgrade Coordinated once everything else is red.</p>
</div>
<div id="content">
<table>
<thead>
<th>Perk</th>
<th>Cost</th>
<th>Target Cost</th>
</thead>
<tr id="coordinated">
<td><label>Coordinated: <input name="level"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="carpentry">
<td><label>Carpentry: <input name="level"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="artisanistry">
<td><label>Artisanistry: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="looting">
<td><label>Looting: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="resourceful">
<td><label>Resourceful: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="resilience">
<td><label>Resilience: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="power">
<td><label>Power: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="motivation">
<td><label>Motivation: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="toughness">
<td><label>Toughness: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
<tr id="pheromones">
<td><label>Pheromones: <input id="spinner"></label></td>
<td><span class="cost"></span></td>
<td><span class="targetCost"></span></td>
</tr>
</table>
</div>
<div>
<p>
Credits:
<ul>
<li><a href="http://www.kongregate.com/games/GreenSatellite/trimps">Trimps</a></li>
<li><a href="https://www.reddit.com/r/Trimps/comments/4g8duv/lategame_perk_ratios/">/u/nsheetz</a></li>
</ul>
</p>
</div>
</body>
</html>