comparison game/js/tower.js @ 15:c1c7e4f54bf6

balance work prep
author ark
date 2026-10-19 23:36 +0200
parents 8df95050fc8b
children
comparison
equal deleted inserted replaced
14:7fda634d15ad 15:c1c7e4f54bf6
24 cooldown: 0, 24 cooldown: 0,
25 burst: 0 25 burst: 0
26 }; 26 };
27 } 27 }
28 28
29 // cost of the next level, null at the top level. level n costs the 29 // cost of the next level, null at the top level
30 // base cost x n.
31 function upgradeCost(t) { 30 function upgradeCost(t) {
32 return t.level < t.def.damage.length ? t.def.cost * (t.level + 1) : null; 31 return t.level < t.def.cost.length ? t.def.cost[t.level] : null;
33 } 32 }
34 33
35 // coins back for selling the tower: half of everything paid for it, 34 // coins back for selling the tower: half of everything paid for it,
36 // rounded down 35 // rounded down
37 function refund(t) { 36 function refund(t) {