From 2693a44a80272bc82c0bfa7579fface2dbd181ac Mon Sep 17 00:00:00 2001 From: AnturK Date: Sun, 12 Jul 2015 20:42:18 +0200 Subject: [PATCH 1/2] Buffs Lightning Bolt --- code/__HELPERS/unsorted.dm | 4 ++-- code/datums/spells/lightning.dm | 38 ++++++++++++------------------- code/modules/mob/living/living.dm | 2 +- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 2a223184ccf..32b70c13cd1 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -674,7 +674,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) @@ -693,7 +693,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 46fb3469ab3..472e92fdecd 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) From ca79395bb7fbd26628b8ca1e555f43b31c174dcd Mon Sep 17 00:00:00 2001 From: AnturK Date: Mon, 13 Jul 2015 09:49:37 +0200 Subject: [PATCH 2/2] Changelog --- html/changelogs/AnturK-LB.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 html/changelogs/AnturK-LB.yml 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"