From ea348bdbbf65c3bf4062263a447bb0518a02adf8 Mon Sep 17 00:00:00 2001 From: Luna Brovchuk Date: Mon, 2 Oct 2023 18:59:52 +0200 Subject: [PATCH] Send Spells to SpellHolder Node --- src/scenes/game/card_placeholder.gd | 1 + src/scenes/game/game.gd | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/scenes/game/card_placeholder.gd b/src/scenes/game/card_placeholder.gd index b6bede1..0061ccd 100644 --- a/src/scenes/game/card_placeholder.gd +++ b/src/scenes/game/card_placeholder.gd @@ -15,5 +15,6 @@ func _ready(): func select_hover(node): game.selected_card = id + game.selected_modifier = $Card.frame $AudioCardSelect.play() diff --git a/src/scenes/game/game.gd b/src/scenes/game/game.gd index 8635432..e7a5dbd 100644 --- a/src/scenes/game/game.gd +++ b/src/scenes/game/game.gd @@ -1,6 +1,7 @@ extends Node var selected_card = null +var selected_modifier = 0 var difficulty = 0 var last_diff = 0 var mob_preloads = [ @@ -12,6 +13,17 @@ var mob_preloads = [ var mob_timers = [.0, .0, .0, .0] var mob_threshold = [5, 7, 10, 7] +var spells = [ + "ricochet", + "big_magic", + "explode", + "fireball", + "freeze", + "poison", + "quick_magic", + "rapidfire", +] + func _ready(): Global.playing = true Global.play_time = 55.0 @@ -54,5 +66,6 @@ func _physics_process(delta): func select_card(): if selected_card != null: + $"../Center/SpellHolder".add_modifier(spells[selected_modifier]) Global.playing = true $UIWrapper/UI/Cards.visible = false