diff options
Diffstat (limited to 'scripts/control.gd')
-rw-r--r-- | scripts/control.gd | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/control.gd b/scripts/control.gd index 7c8b95d..68b0bb4 100644 --- a/scripts/control.gd +++ b/scripts/control.gd @@ -88,8 +88,8 @@ func build_option (st, sttype): func buy (pos, rot, turr_name): var info = load_turrets.info[turr_name] - if resources.greater_than(info.cost): - resources.sub(info.cost) + if ineditor or resources.greater_than(info.cost): + if !ineditor: resources.sub(info.cost) var obj = placer.inst_turret(pos, rot, turr_name) editing_turret = obj.name state = Globals.PlayerState.EDIT @@ -100,8 +100,8 @@ func buy (pos, rot, turr_name): func upgrade (turr_inst_name, upg_name): var info = load_turrets.info[upg_name] - if resources.greater_than(info.cost): - resources.sub(info.cost) + if ineditor or resources.greater_than(info.cost): + if !ineditor: resources.sub(info.cost) var prv = turret_holder.get_node(turr_inst_name) var pos = prv.transform.origin var rot = prv.transform.basis.get_rotation_quat() @@ -254,6 +254,15 @@ func gui_start_wave_event (): wave.start() gui.refresh() +func end_wave_event (): + wave.end() + + for turr in turret_holder.get_children(): + if turr.info.has("resource_per_wave"): + resources.add(turr.info.resource_per_wave) + + _refresh() + func gui_save_map_event (): saveload_map.map_save() func gui_save_as_map_event (mapname : String): |