|
|
|
@ -45,6 +45,30 @@ onready var Effect4 = $Inventory/Effects/Effect4
|
|
|
|
|
func _ready():
|
|
|
|
|
for id in Player.unlocked:
|
|
|
|
|
add_item(id)
|
|
|
|
|
if Player.current_wand != -1:
|
|
|
|
|
active_conduit = Globals.Magic[Player.current_wand]
|
|
|
|
|
parent.WandPosition.set_current_conduit(active_conduit)
|
|
|
|
|
match Player.current_wand:
|
|
|
|
|
0:
|
|
|
|
|
ConduitSelect.global_position = Conduit1Position.global_position
|
|
|
|
|
1:
|
|
|
|
|
ConduitSelect.global_position = Conduit2Position.global_position
|
|
|
|
|
2:
|
|
|
|
|
ConduitSelect.global_position = Conduit3Position.global_position
|
|
|
|
|
3:
|
|
|
|
|
ConduitSelect.global_position = Conduit4Position.global_position
|
|
|
|
|
|
|
|
|
|
if Player.current_spell != -1:
|
|
|
|
|
active_projectile = Globals.Magic[Player.current_wand]
|
|
|
|
|
match Player.current_spell:
|
|
|
|
|
4:
|
|
|
|
|
ProjectileSelect.global_position = Projectile1Position.global_position
|
|
|
|
|
5:
|
|
|
|
|
ProjectileSelect.global_position = Projectile2Position.global_position
|
|
|
|
|
6:
|
|
|
|
|
ProjectileSelect.global_position = Projectile3Position.global_position
|
|
|
|
|
7:
|
|
|
|
|
ProjectileSelect.global_position = Projectile3Position.global_position
|
|
|
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
|
if Input.is_action_just_pressed("inventory"):
|
|
|
|
@ -103,24 +127,28 @@ func add_item(index):
|
|
|
|
|
|
|
|
|
|
func _on_Conduit1_toggled():
|
|
|
|
|
if Conduit1.is_visible() and active_conduit != Globals.Magic[Globals.Conduit1]:
|
|
|
|
|
Player.current_wand = Globals.Magicp
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit1]
|
|
|
|
|
parent.WandPosition.set_current_conduit(active_conduit)
|
|
|
|
|
ConduitSelect.global_position = Conduit1Position.global_position
|
|
|
|
|
|
|
|
|
|
func _on_Conduit2_toggled():
|
|
|
|
|
if Conduit2.is_visible() and active_conduit != Globals.Magic[Globals.Conduit2]:
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit2]
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit2]
|
|
|
|
|
parent.WandPosition.set_current_conduit(active_conduit)
|
|
|
|
|
ConduitSelect.global_position = Conduit2Position.global_position
|
|
|
|
|
|
|
|
|
|
func _on_Conduit3_toggled():
|
|
|
|
|
if Conduit3.is_visible() and active_conduit != Globals.Magic[Globals.Conduit3]:
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit3]
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit3]
|
|
|
|
|
parent.WandPosition.set_current_conduit(active_conduit)
|
|
|
|
|
ConduitSelect.global_position = Conduit3Position.global_position
|
|
|
|
|
|
|
|
|
|
func _on_Conduit4_toggled():
|
|
|
|
|
if Conduit4.is_visible() and active_conduit != Globals.Magic[Globals.Conduit4]:
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit4]
|
|
|
|
|
active_conduit = Globals.Magic[Globals.Conduit4]
|
|
|
|
|
parent.WandPosition.set_current_conduit(active_conduit)
|
|
|
|
|
ConduitSelect.global_position = Conduit4Position.global_position
|
|
|
|
@ -128,24 +156,28 @@ func _on_Conduit4_toggled():
|
|
|
|
|
|
|
|
|
|
func _on_Projectile1_pressed():
|
|
|
|
|
if Projectile1.is_visible() and active_projectile != Globals.Magic[Globals.Projectile1]:
|
|
|
|
|
Player.active_spell = Globals.Magic[Globals.Conduit1]
|
|
|
|
|
active_projectile = Globals.Magic[Globals.Projectile1]
|
|
|
|
|
ProjectileSelect.global_position = Projectile1Position.global_position
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_Projectile2_pressed():
|
|
|
|
|
if Projectile2.is_visible() and active_projectile != Globals.Magic[Globals.Projectile2]:
|
|
|
|
|
Player.active_spell = Globals.Magic[Globals.Conduit2]
|
|
|
|
|
active_projectile = Globals.Magic[Globals.Projectile2]
|
|
|
|
|
ProjectileSelect.global_position = Projectile2Position.global_position
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_Projectile3_pressed():
|
|
|
|
|
if Projectile3.is_visible() and active_projectile != Globals.Magic[Globals.Projectile3]:
|
|
|
|
|
Player.active_spell = Globals.Magic[Globals.Conduit3]
|
|
|
|
|
active_projectile = Globals.Magic[Globals.Projectile3]
|
|
|
|
|
ProjectileSelect.global_position = Projectile3Position.global_position
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _on_Projectile4_pressed():
|
|
|
|
|
if Projectile4.is_visible() and active_projectile != Globals.Magic[Globals.Projectile4]:
|
|
|
|
|
Player.active_spell = Globals.Magic[Globals.Conduit4]
|
|
|
|
|
active_projectile = Globals.Magic[Globals.Projectile4]
|
|
|
|
|
ProjectileSelect.global_position = Projectile4Position.global_position
|
|
|
|
|
|
|
|
|
|