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
|
|
|
|
var effect_type
|
2020-07-19 18:36:36 -05:00
|
|
|
|
|
|
|
func fire(projectile, effect):
|
|
|
|
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-20 16:36:28 -05:00
|
|
|
var energy_cost = temp.launch(wand_type, effect_type)
|
2020-07-19 18:36:36 -05:00
|
|
|
$ShootDelay.start()
|
2020-07-19 19:15:43 -05:00
|
|
|
return energy_cost
|