2018-05-29 00:08:30 -04:00
|
|
|
#
|
|
|
|
# Copyright (C) 2018 Sage Vaillancourt, sagev9000@gmail.com
|
|
|
|
#
|
|
|
|
# This file is part of Fronter.
|
|
|
|
#
|
|
|
|
# Fronter is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Fronter is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Fronter. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
2018-05-23 01:40:45 -04:00
|
|
|
extends Node
|
|
|
|
|
2018-05-23 03:57:15 -04:00
|
|
|
signal refund
|
|
|
|
signal speed_upgrade
|
|
|
|
signal bullet_delay_upgrade
|
2018-05-26 02:55:17 -04:00
|
|
|
signal ship_speed_upgrade
|
2018-05-29 02:39:43 -04:00
|
|
|
signal double_laser_upgrade
|
2018-05-23 03:57:15 -04:00
|
|
|
signal add_laser
|
|
|
|
signal plasma_lasers
|
2018-05-27 02:20:51 -04:00
|
|
|
signal menu_closed
|
2018-05-29 00:08:30 -04:00
|
|
|
signal change_color
|
2018-05-23 03:57:15 -04:00
|
|
|
|
2018-05-23 21:35:16 -04:00
|
|
|
var bullet_delay_tier
|
2018-05-23 11:02:52 -04:00
|
|
|
var shooting_speed_tier
|
|
|
|
var ship_speed_tier
|
|
|
|
var double_lasers
|
2018-05-23 01:40:45 -04:00
|
|
|
|
|
|
|
func _ready():
|
2018-05-24 04:19:59 -04:00
|
|
|
bullet_delay_tier = get_parent().bullet_delay_tier
|
2018-05-26 02:55:17 -04:00
|
|
|
$ShootingSpeedUpgrade/Icon.frame = bullet_delay_tier
|
|
|
|
ship_speed_tier = get_parent().ship_speed_tier
|
|
|
|
$ShipSpeedUpgrade/Icon.frame = ship_speed_tier
|
2018-05-27 02:20:51 -04:00
|
|
|
if get_tree().has_network_peer():
|
|
|
|
$ColorRect.color = Color(1,1,1,0.5)
|
|
|
|
else:
|
|
|
|
$ColorRect.color = Color(1,1,1,0.5)
|
2018-05-23 01:40:45 -04:00
|
|
|
|
2018-05-23 21:35:16 -04:00
|
|
|
func _process(delta):
|
2018-05-26 02:55:17 -04:00
|
|
|
$ShootingSpeedUpgrade/Icon.frame = bullet_delay_tier
|
|
|
|
$ShipSpeedUpgrade/Icon.frame = ship_speed_tier
|
2018-05-23 21:35:16 -04:00
|
|
|
if (Input.is_action_pressed("ui_quit")):
|
|
|
|
get_tree().quit()
|
2018-05-26 02:55:17 -04:00
|
|
|
if Input.is_action_pressed("ui_accept"):
|
|
|
|
_on_Button_pressed()
|
2018-05-23 01:40:45 -04:00
|
|
|
|
|
|
|
func _on_Button_pressed():
|
|
|
|
get_tree().paused = false
|
2018-05-27 02:20:51 -04:00
|
|
|
emit_signal("menu_closed")
|
2018-05-23 01:40:45 -04:00
|
|
|
queue_free()
|
2018-05-23 03:57:15 -04:00
|
|
|
|
|
|
|
func _on_Refund_pressed():
|
2018-05-26 02:55:17 -04:00
|
|
|
bullet_delay_tier = 0
|
|
|
|
ship_speed_tier = 0
|
|
|
|
$ShootingSpeedUpgrade/Icon.frame = 0
|
|
|
|
$ShipSpeedUpgrade/Icon.frame = 0
|
2018-05-23 03:57:15 -04:00
|
|
|
get_tree().paused = false
|
|
|
|
emit_signal("refund")
|
2018-05-23 11:02:52 -04:00
|
|
|
|
|
|
|
func _on_ShootingSpeedUpgrade_pressed():
|
|
|
|
get_tree().paused = false
|
|
|
|
emit_signal("bullet_delay_upgrade")
|
2018-05-23 21:35:16 -04:00
|
|
|
bullet_delay_tier = get_parent().bullet_delay_tier
|
2018-05-26 02:55:17 -04:00
|
|
|
|
|
|
|
func _on_ShipSpeedUpgrade_pressed():
|
|
|
|
get_tree().paused = false
|
|
|
|
emit_signal("ship_speed_upgrade")
|
|
|
|
prints("UPGRADE SHIP SPEED SIGNAL EMITTED")
|
|
|
|
ship_speed_tier = get_parent().ship_speed_tier
|
2018-05-29 00:08:30 -04:00
|
|
|
|
2018-05-29 02:39:43 -04:00
|
|
|
func _on_DoubleLaserUpgrade_pressed():
|
|
|
|
get_tree().paused = false
|
|
|
|
emit_signal("double_laser_upgrade")
|
|
|
|
prints("UPGRADE SHIP SPEED SIGNAL EMITTED")
|
2018-05-29 00:08:30 -04:00
|
|
|
|
|
|
|
func _on_Goldenrod_pressed():
|
|
|
|
emit_signal("change_color", "daa520")
|
|
|
|
|
|
|
|
func _on_Purple_pressed():
|
|
|
|
emit_signal("change_color", "800080")
|
|
|
|
|
|
|
|
func _on_SlateBlue_pressed():
|
|
|
|
emit_signal("change_color", "708090")
|
|
|
|
|
|
|
|
func _on_Salmon_pressed():
|
|
|
|
emit_signal("change_color", "e9967a")
|
|
|
|
|
|
|
|
func _on_Crimson_pressed():
|
|
|
|
emit_signal("change_color", "dc143c")
|
|
|
|
|
|
|
|
func _on_MediumSpringGreen_pressed():
|
|
|
|
emit_signal("change_color", "3cb371")
|
|
|
|
|
|
|
|
func _on_Tomato_pressed():
|
|
|
|
emit_signal("change_color", "ff3e2d")
|
|
|
|
prints("put tomato in dere")
|
|
|
|
|
|
|
|
func _on_DarkenedLawnGreen_pressed():
|
|
|
|
emit_signal("change_color", "7bd126")
|
|
|
|
|
|
|
|
func _on_DeepSkyBlue_pressed():
|
|
|
|
emit_signal("change_color", "00bfff")
|