the-crypt/magic/Wands/TripleWand.gd

22 lines
778 B
GDScript3
Raw Normal View History

2020-07-19 23:16:44 -05:00
extends Wand
2020-07-20 16:36:28 -05:00
func _ready():
wand_type = Globals.Conduit2
2020-07-19 23:16:44 -05:00
func fire(projectile, effect):
if $ShootDelay.is_stopped() and projectile != null:
var temp1 = projectile.instance()
var temp2 = projectile.instance()
var temp3 = projectile.instance()
get_tree().current_scene.add_child(temp1)
get_tree().current_scene.add_child(temp2)
get_tree().current_scene.add_child(temp3)
temp1.global_transform = $ProjectileSpawn1.global_transform
temp2.global_transform = $ProjectileSpawn2.global_transform
temp3.global_transform = $ProjectileSpawn3.global_transform
2020-07-20 16:36:28 -05:00
var energy_cost = temp1.launch(wand_type, effect_type)
energy_cost += temp2.launch(wand_type, effect_type)
energy_cost += temp3.launch(wand_type, effect_type)
2020-07-19 23:16:44 -05:00
$ShootDelay.start()
return energy_cost