2020-07-19 18:36:36 -05:00
|
|
|
extends Sprite
|
2020-07-19 23:16:44 -05:00
|
|
|
class_name Wand
|
2020-07-20 16:36:28 -05:00
|
|
|
var wand_type
|
2020-07-19 18:36:36 -05:00
|
|
|
|
2020-07-21 15:00:32 -05:00
|
|
|
func fire(projectile):
|
2020-07-19 18:36:36 -05:00
|
|
|
if $ShootDelay.is_stopped() and projectile != null:
|
|
|
|
var temp = projectile.instance()
|
|
|
|
get_tree().current_scene.add_child(temp)
|
|
|
|
temp.global_transform = $ProjectileSpawn.global_transform
|
2020-07-21 15:00:32 -05:00
|
|
|
var energy_cost = temp.launch(wand_type)
|
2020-07-19 18:36:36 -05:00
|
|
|
$ShootDelay.start()
|
2020-07-19 19:15:43 -05:00
|
|
|
return energy_cost
|