diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 57527a2aa61..d72e5a9049e 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -672,7 +672,7 @@ Turf and target are seperate in case you want to teleport some distance from a t else return get_step(ref, base_dir) -/proc/do_mob(mob/user , mob/target, time = 30, numticks = 5, stealth = 0) //This is quite an ugly solution but i refuse to use the old request system. +/proc/do_mob(mob/user , mob/target, time = 30, numticks = 5, uninterruptible = 0) //This is quite an ugly solution but i refuse to use the old request system. if(!user || !target) return 0 if(numticks == 0) @@ -691,7 +691,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(user && user.client) user.client.images -= progbar return 0 - if ( user.loc != user_loc || target.loc != target_loc || user.get_active_hand() != holding || user.incapacitated() || user.lying ) + if (!uninterruptible && (user.loc != user_loc || target.loc != target_loc || user.get_active_hand() != holding || user.incapacitated() || user.lying )) if(user && user.client) user.client.images -= progbar return 0 diff --git a/code/datums/spells/lightning.dm b/code/datums/spells/lightning.dm index 54d0a3378b7..3fbefee6c16 100644 --- a/code/datums/spells/lightning.dm +++ b/code/datums/spells/lightning.dm @@ -10,7 +10,7 @@ cooldown_min = 30 selection_type = "view" random_target = 1 - var/energy = 0 + var/start_time = 0 var/ready = 0 var/image/halo = null var/sound/Snd // so far only way i can think of to stop a sound, thank MSO for the idea. @@ -18,7 +18,7 @@ action_icon_state = "lightning" /obj/effect/proc_holder/spell/targeted/lightning/Click() - if(!ready && energy==0) + if(!ready && start_time==0) if(cast_check()) StartChargeup() else @@ -33,16 +33,14 @@ halo = image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = EFFECTS_LAYER) user.overlays.Add(halo) playsound(get_turf(usr), Snd, 50, 0) - spawn(0) - while(ready) - energy++ - if(energy >= 100 && ready) - Discharge() - sleep(1) + start_time = world.time + if(do_mob(user,user,100,uninterruptible=1)) + if(ready) + Discharge() /obj/effect/proc_holder/spell/targeted/lightning/proc/Reset(mob/user = usr) ready = 0 - energy = 0 + start_time = 0 if(halo) user.overlays.Remove(halo) @@ -72,26 +70,18 @@ playsound(get_turf(usr), 'sound/magic/lightningbolt.ogg', 50, 1) user.Beam(target,icon_state="lightning",icon='icons/effects/effects.dmi',time=5) - switch(energy) - if(1 to 25) - target.electrocute_act(10,"Lightning Bolt") - playsound(get_turf(target), 'sound/magic/LightningShock.ogg', 50, 1, -1) - if(25 to 75) - target.electrocute_act(25,"Lightning Bolt") - playsound(get_turf(target), 'sound/magic/LightningShock.ogg', 50, 1, -1) - if(75 to 100) - //CHAIN LIGHTNING - Bolt(user,target,energy,user) + var/energy = min(world.time - start_time,100) + Bolt(user,target,max(15,energy/2),5,user) //5 bounces for energy/2 burn Reset(user) -/obj/effect/proc_holder/spell/targeted/lightning/proc/Bolt(mob/origin,mob/target,bolt_energy,mob/user = usr) +/obj/effect/proc_holder/spell/targeted/lightning/proc/Bolt(mob/origin,mob/target,bolt_energy,bounces,mob/user = usr) origin.Beam(target,icon_state="lightning",icon='icons/effects/effects.dmi',time=5) var/mob/living/carbon/current = target - if(bolt_energy < 75) - current.electrocute_act(25,"Lightning Bolt") + if(bounces < 1) + current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1) playsound(get_turf(current), 'sound/magic/LightningShock.ogg', 50, 1, -1) else - current.electrocute_act(25,"Lightning Bolt") + current.electrocute_act(bolt_energy,"Lightning Bolt",safety=1) playsound(get_turf(current), 'sound/magic/LightningShock.ogg', 50, 1, -1) var/list/possible_targets = new for(var/mob/living/M in view_or_range(range,target,"view")) @@ -102,4 +92,4 @@ return var/mob/living/next = pick(possible_targets) if(next) - Bolt(current,next,bolt_energy-6,user) // 5 max bounces \ No newline at end of file + Bolt(current,next,bolt_energy,bounces-1,user) \ No newline at end of file diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index ee3c44eb666..ea570bc40b7 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -376,7 +376,7 @@ Sorry Giacom. Please don't be mad :( return 0 -/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0) +/mob/living/proc/electrocute_act(shock_damage, obj/source, siemens_coeff = 1.0, safety = 0) return 0 //only carbon liveforms have this proc /mob/living/emp_act(severity) diff --git a/html/changelogs/AnturK-LB.yml b/html/changelogs/AnturK-LB.yml new file mode 100644 index 00000000000..e086a125e6a --- /dev/null +++ b/html/changelogs/AnturK-LB.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# spellcheck (typo fixes) +# experiment +# tgs (TG-ported fixes?) +################################# + +# Your name. +author: AnturK + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Lightning Bolt now always bounces 5 times and deals 15 to 50 burn damage to each target depending on the chargeup"