mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
30 lines
1.0 KiB
Plaintext
30 lines
1.0 KiB
Plaintext
/obj/item/weapon/spell/projectile
|
|
name = "projectile template"
|
|
icon_state = "generic"
|
|
desc = "This is a generic template that shoots projectiles. If you can read this, the game broke!"
|
|
cast_methods = CAST_RANGED
|
|
var/obj/item/projectile/spell_projectile = null
|
|
var/energy_cost_per_shot = 0
|
|
var/instability_per_shot = 0
|
|
var/pre_shot_delay = 0
|
|
|
|
/obj/item/weapon/spell/projectile/on_ranged_cast(atom/hit_atom, mob/living/user)
|
|
var/turf/T = get_turf(hit_atom)
|
|
if(set_up(hit_atom, user))
|
|
var/obj/item/projectile/new_projectile = new spell_projectile(get_turf(user))
|
|
new_projectile.launch(T)
|
|
owner.adjust_instability(instability_per_shot)
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/weapon/spell/projectile/proc/set_up(atom/hit_atom, mob/living/user)
|
|
if(spell_projectile)
|
|
if(pay_energy(energy_cost_per_shot))
|
|
if(pre_shot_delay)
|
|
var/image/target_image = image(icon = 'icons/obj/spells.dmi', loc = get_turf(hit_atom), icon_state = "target")
|
|
user << target_image
|
|
user.Stun(pre_shot_delay)
|
|
sleep(pre_shot_delay)
|
|
qdel(target_image)
|
|
return 1
|
|
return 0 |