mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-30 04:02:33 +00:00
* Squashed commit of the following: commit 979fe5287c3dd33cd5d69bdd968beae245984f2e Author: hal9000PR <charliesteeples@outlook.com> Date: Sat Jul 9 23:40:53 2022 +0100 guts the old system * refactors spell cooldowns into a handler * charge datum * garbage collection * cleanup, renames cooldown var * review changes * boo cooldown fix * styling Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
57 lines
2.3 KiB
Plaintext
57 lines
2.3 KiB
Plaintext
/obj/effect/proc_holder/spell/charge_up/bounce/magnet
|
|
name = "Magnetic Pull"
|
|
desc = "Pulls metalic objects from enemies hands with the power of MAGNETS."
|
|
action_icon_state = "magnet"
|
|
base_cooldown = 30 SECONDS
|
|
clothes_req = FALSE
|
|
invocation = "UN'LTD P'WAH!"
|
|
invocation_type = "none"
|
|
cooldown_min = 3 SECONDS
|
|
charge_sound = new /sound('sound/magic/lightning_chargeup.ogg', channel = 7)
|
|
max_charge_time = 10 SECONDS
|
|
stop_charging_text = "You stop charging the magnetism around you."
|
|
stop_charging_fail_text = "The magnetism around you is too strong to stop now!"
|
|
start_charging_text = "You start gathering magnetism around you."
|
|
bounce_hit_sound = 'sound/machines/defib_zap.ogg'
|
|
|
|
/obj/effect/proc_holder/spell/charge_up/bounce/magnet/New()
|
|
..()
|
|
charge_up_overlay = image(icon = 'icons/effects/effects.dmi', icon_state = "electricity", layer = EFFECTS_LAYER)
|
|
|
|
/obj/effect/proc_holder/spell/charge_up/bounce/magnet/get_bounce_energy()
|
|
return get_energy_charge()
|
|
|
|
/obj/effect/proc_holder/spell/charge_up/bounce/magnet/get_bounce_amount()
|
|
if(get_energy_charge() >= 75)
|
|
return 5
|
|
return 0
|
|
|
|
/obj/effect/proc_holder/spell/charge_up/bounce/magnet/create_beam(mob/origin, mob/target)
|
|
origin.Beam(target, icon_state = "lightning[rand(1, 12)]", icon = 'icons/effects/effects.dmi', time = 5)
|
|
|
|
/obj/effect/proc_holder/spell/charge_up/bounce/magnet/apply_bounce_effect(mob/origin, mob/target, energy, mob/user)
|
|
var/list/items_to_throw = list()
|
|
switch(energy)
|
|
if(0 to 25)
|
|
if(prob(50))
|
|
if(target.l_hand)
|
|
items_to_throw += target.l_hand
|
|
else
|
|
if(target.r_hand)
|
|
items_to_throw += target.r_hand
|
|
if(25 to INFINITY)
|
|
if(target.r_hand)
|
|
items_to_throw += target.r_hand
|
|
if(target.l_hand)
|
|
items_to_throw += target.l_hand
|
|
for(var/I in items_to_throw)
|
|
try_throw_object(user, target, I)
|
|
|
|
/obj/effect/proc_holder/spell/charge_up/bounce/magnet/proc/try_throw_object(mob/user, mob/thrower, obj/item/to_throw)
|
|
if(!(to_throw.flags & CONDUCT) || !thrower.unEquip(to_throw, silent = TRUE))
|
|
return FALSE
|
|
thrower.visible_message("<span class='warning'>[to_throw] gets thrown out of [thrower] [thrower.p_their()] hands!</span>",
|
|
"<span class='danger'>[to_throw] suddenly gets thrown out of your hands!</span>")
|
|
to_throw.throw_at(user, to_throw.throw_range, 4)
|
|
return TRUE
|