2024-02-16 16:55:13 +00:00
|
|
|
extends Panel
|
|
|
|
|
|
|
|
signal claimed
|
|
|
|
|
|
|
|
@export var tower: Tower
|
|
|
|
@export var player: Player
|
|
|
|
|
2024-02-17 04:04:43 +00:00
|
|
|
var value
|
|
|
|
|
2024-02-16 16:55:13 +00:00
|
|
|
@export var id: String
|
|
|
|
@export var title: String
|
|
|
|
@export var subtitle: String
|
|
|
|
@export var description: String
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
$Title.text = title
|
|
|
|
$Subtitle.text = subtitle
|
|
|
|
$Description.text = description
|
|
|
|
|
|
|
|
func _on_claim():
|
2024-02-17 04:04:43 +00:00
|
|
|
match id:
|
|
|
|
"FIRE_COOLDOWN" when player.fire_cooldown_duration > 0:
|
|
|
|
player.fire_cooldown_duration += value[0]
|
|
|
|
player.weapon_bullet_damage -= value[1]
|
|
|
|
"BULLET_DAMAGE":
|
|
|
|
player.weapon_bullet_damage += value
|
|
|
|
"BULLET_KNOCKBACK":
|
|
|
|
player.weapon_bullet_knockback += value
|
2024-02-17 04:15:49 +00:00
|
|
|
"PLAYER_SPEED":
|
|
|
|
player.speed += value
|
2024-02-17 04:04:43 +00:00
|
|
|
"TOWER_HEALTH":
|
|
|
|
tower.health += value
|
2024-02-16 16:55:13 +00:00
|
|
|
claimed.emit()
|