[gd_scene load_steps=12 format=1]

[ext_resource path="res://font/titilium-bold.fnt" type="BitmapFont" id=1]
[ext_resource path="res://image/icons/explode.png" type="Texture" id=2]
[ext_resource path="res://image/icons/energy.png" type="Texture" id=3]
[ext_resource path="res://image/icons/dumping.png" type="Texture" id=4]
[ext_resource path="res://image/icons/infect.png" type="Texture" id=5]

[sub_resource type="GDScript" id=1]

script/source = "extends Label\n\nfunc update():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tset_text(\"money: %d\" % gs.money);\n\nfunc _on_moneyShow_visibility_changed():\n\tupdate();\n\tpass # replace with function body\n"

[sub_resource type="GDScript" id=2]

script/source = "extends Button\nfunc _ready():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tset_text((\"add explosion power. Current: %d\" % gs.explodeForce) + \". Cost: %d\" % (50+gs.explodeUpgradeLevel*10));\n\tcheckNotMax()\n\tpass\n\t\nfunc _on_Button_pressed():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.money < (50+gs.explodeUpgradeLevel*10)): return;\n\tgs.money -= (50+gs.explodeUpgradeLevel*10);\n\tget_node(\"../../../moneyShow\").set_text(\"money:%d\"%gs.money);\n\tgs.explodeForce += 5;\n\tgs.explodeUpgradeLevel += 1;\n\tset_text((\"add explosion power. Current: %d\" % gs.explodeForce) + \". Cost: %d\" % (50+gs.explodeUpgradeLevel*10));\n\tcheckNotMax();\n\tpass # replace with function body\n\nfunc checkNotMax():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.explodeForce >= 400):\n\t\tset_text(\"max\");\n\t\tset_disabled(true);\n\t"

[sub_resource type="GDScript" id=3]

script/source = "extends Button\nfunc _ready():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tset_text((\"increase max energy. Current: %d\" % gs.maxEnergy) + \". Cost: %d\" % (100+gs.energyUpgradeLevel*20));\n\tcheckNotMax()\n\tpass\n\t\nfunc _on_Button_pressed():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.money < (100+gs.energyUpgradeLevel*20)): return;\n\tgs.money -= (100+gs.energyUpgradeLevel*20);\n\tgs.energyUpgradeLevel += 1;\n\tget_node(\"../../../moneyShow\").set_text(\"money:%d\"%gs.money);\n\tgs.maxEnergy += 10;\n\tset_text((\"increase max energy. Current: %d\" % gs.maxEnergy) + \". Cost: %d\" % (100+gs.energyUpgradeLevel*20));\n\tcheckNotMax()\n\tpass # replace with function body\n\nfunc checkNotMax():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.maxEnergy >= 200):\n\t\tset_text(\"max\");\n\t\tset_disabled(true);"

[sub_resource type="GDScript" id=4]

script/source = "extends Button\nfunc _ready():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tset_text((\"decrease dumping. Current: %1.3f\" % gs.dumping) + \". Cost: %d\" % (50+gs.dumpingUpgradeLevel*10));\n\tcheckNotMax();\n\tpass\n\t\nfunc _on_Button_pressed():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.money < (50+gs.dumpingUpgradeLevel*10)): return;\n\tgs.money -= (50+gs.dumpingUpgradeLevel*10);\n\tgs.dumpingUpgradeLevel += 1;\n\tget_node(\"../../../moneyShow\").set_text(\"money:%d\"%gs.money);\n\tgs.dumping -= 0.1;\n\tset_text((\"decrease dumping. Current: %1.3f\" % gs.dumping) + \". Cost: %d\" % (50+gs.dumpingUpgradeLevel*10));\n\tcheckNotMax();\n\tpass # replace with function body\n\nfunc checkNotMax():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.dumping <= 2):\n\t\tset_text(\"max\");\n\t\tset_disabled(true);"

[sub_resource type="GDScript" id=5]

script/source = "extends Button\nfunc _ready():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tset_text((\"add infect power. Current: %d\" % gs.explodeForce) + \". Cost: %d\" % (50+gs.infectUpgradeLevel*10));\n\tpass\n\nfunc _on_Button1_pressed():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.money < (50+gs.infectUpgradeLevel*10)): return;\n\tgs.money -= (50+gs.infectUpgradeLevel*10);\n\tget_node(\"../../../moneyShow\").set_text(\"money:%d\"%gs.money);\n\tgs.infectPower += 20;\n\tgs.infectUpgradeLevel += 1;\n\tset_text((\"add infect power. Current: %d\" % gs.infectPower) + \". Cost: %d\" % (50+gs.infectUpgradeLevel*10));\n\tpass # replace with function body\n\nfunc checkNotMax():\n\tvar gs = Globals.get(\"game_saver\").savedict;\n\tif(gs.infectPower  >= 500):\n\t\tset_text(\"max\");\n\t\tset_disabled(true);"

[sub_resource type="GDScript" id=6]

script/source = "\n\nfunc _on_Button_pressed():\n\tGlobals.get(\"game_saver\").saveData();\n\tget_tree().reload_current_scene();\n\tpass # replace with function body\n"

[node name="store" type="Control"]

focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 0.0
margin/bottom = 0.0

[node name="moneyShow" type="Label" parent="."]

anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = -1101.0
margin/top = 13.0
margin/right = -1169.0
margin/bottom = 36.0
custom_fonts/font = ExtResource( 1 )
text = "money:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
script/script = SubResource( 1 )

[node name="VBoxContainer" type="VBoxContainer" parent="."]

anchor/left = 3
anchor/right = 3
anchor/bottom = 3
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = -225.0
margin/top = 287.0
margin/right = -980.0
margin/bottom = -597.0
alignment = 0

[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]

focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 755.0
margin/bottom = 70.0
alignment = 1

[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]

rect/min_size = Vector2( 100, 0 )
hint/tooltip = "Сила, с которой будут разлетаться ваши вирусы"
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 165.0
margin/top = 0.0
margin/right = 375.0
margin/bottom = 70.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "add explosion power"
icon = ExtResource( 2 )
flat = false
script/script = SubResource( 2 )

[node name="Button2" type="Button" parent="VBoxContainer/HBoxContainer"]

rect/min_size = Vector2( 100, 0 )
hint/tooltip = "Максимальный запас энергии, доступный за игру"
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 379.0
margin/top = 0.0
margin/right = 589.0
margin/bottom = 70.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "increase max energy"
icon = ExtResource( 3 )
flat = false
script/script = SubResource( 3 )

[node name="HBoxContainer1" type="HBoxContainer" parent="VBoxContainer"]

focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 74.0
margin/right = 755.0
margin/bottom = 144.0
alignment = 1

[node name="Button3" type="Button" parent="VBoxContainer/HBoxContainer1"]

rect/min_size = Vector2( 100, 0 )
hint/tooltip = "Сила торможения"
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 185.0
margin/top = 0.0
margin/right = 381.0
margin/bottom = 70.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "decrease dumping"
icon = ExtResource( 4 )
flat = false
script/script = SubResource( 4 )

[node name="Button1" type="Button" parent="VBoxContainer/HBoxContainer1"]

rect/min_size = Vector2( 100, 0 )
hint/tooltip = "Сила сопротивления иммунитету"
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 385.0
margin/top = 0.0
margin/right = 569.0
margin/bottom = 70.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "add infect power"
icon = ExtResource( 5 )
flat = false
script/script = SubResource( 5 )

[node name="Button" type="Button" parent="VBoxContainer"]

focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 148.0
margin/right = 755.0
margin/bottom = 168.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "restart\?"
flat = false
script/script = SubResource( 6 )

[connection signal="visibility_changed" from="moneyShow" to="moneyShow" method="_on_moneyShow_visibility_changed"]

[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="VBoxContainer/HBoxContainer/Button" method="_on_Button_pressed"]

[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button2" to="VBoxContainer/HBoxContainer/Button2" method="_on_Button_pressed"]

[connection signal="pressed" from="VBoxContainer/HBoxContainer1/Button3" to="VBoxContainer/HBoxContainer1/Button3" method="_on_Button_pressed"]

[connection signal="pressed" from="VBoxContainer/HBoxContainer1/Button1" to="VBoxContainer/HBoxContainer1/Button1" method="_on_Button1_pressed"]

[connection signal="pressed" from="VBoxContainer/Button" to="VBoxContainer/Button" method="_on_Button_pressed"]


