This commit is contained in:
timothyteakettle
2020-09-10 03:49:47 +01:00
parent f1cd94fc97
commit e0f44ef717
31 changed files with 48 additions and 72 deletions

View File

@@ -230,9 +230,6 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define EXPLODE_LIGHT 3
#define EXPLODE_GIB_THRESHOLD 50
#define EMP_HEAVY 1
#define EMP_LIGHT 2
#define GRENADE_CLUMSY_FUMBLE 1
#define GRENADE_NONCLUMSY_FUMBLE 2
#define GRENADE_NO_FUMBLE 3

View File

@@ -1,11 +1,11 @@
/proc/empulse(turf/epicenter, power, log=0)
/proc/c(turf/epicenter, power, log=0)
if(!epicenter)
return
if(!isturf(epicenter))
epicenter = get_turf(epicenter.loc)
var/max_distance = round((power/7)^0.7)
var/max_distance = max(round((power/7)^0.7), 1)
if(log)
message_admins("EMP with power [power], max distance [max_distance] in area [epicenter.loc.name] ")
@@ -17,6 +17,8 @@
for(var/A in spiral_range(light_range, epicenter))
var/atom/T = A
var/distance = get_dist(epicenter, T)
var/severity = min(100 * (1 - log(max_distance, distance)), 1) //if it goes below 1 stuff gets bad
var/severity = 100
if(distance != 0) //please dont log 0 thank you
severity = min(100 * (1 - log(max_distance, distance)), 1) //if it goes below 1 stuff gets bad
T.emp_act(severity)
return 1

View File

@@ -351,7 +351,7 @@
/obj/item/book/granter/spell/charge/recoil(mob/user)
..()
to_chat(user,"<span class='warning'>[src] suddenly feels very warm!</span>")
empulse(src, 1, 1)
empulse(src, 7)
/obj/item/book/granter/spell/summonitem
spell = /obj/effect/proc_holder/spell/targeted/summonitem

View File

@@ -7,5 +7,5 @@
/obj/item/grenade/empgrenade/prime(mob/living/lanced_by)
. = ..()
update_mob()
empulse(src, 4, 10)
empulse(src, 400)
qdel(src)

View File

@@ -65,7 +65,7 @@
/obj/item/implant/emp/activate()
. = ..()
uses--
empulse(imp_in, 3, 5)
empulse(imp_in, 200)
if(!uses)
qdel(src)

View File

@@ -646,23 +646,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
var/heavy = input("Range of heavy pulse.", text("Input")) as num|null
if(heavy == null)
return
var/light = input("Range of light pulse.", text("Input")) as num|null
if(light == null)
var/power = input("Power.", text("Input")) as num|null
if(!power)
return
log_admin("[key_name(usr)] created an EM Pulse - log below")
message_admins("[key_name_admin(usr)] created an EM Pulse at [AREACOORD(O)] with power [power]")
empulse(O, power, TRUE) //its details get shown too
if (heavy || light)
empulse(O, heavy, light)
log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at [AREACOORD(O)]")
message_admins("[key_name_admin(usr)] created an EM Pulse ([heavy],[light]) at [AREACOORD(O)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "EM Pulse") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
else
return
SSblackbox.record_feedback("tally", "admin_verb", 1, "EM Pulse") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_gib(mob/M in GLOB.mob_list)
set category = "Special Verbs"

View File

@@ -18,7 +18,7 @@
/datum/blobstrain/reagent/electromagnetic_web/death_reaction(obj/structure/blob/B, damage_flag)
if(damage_flag == "melee" || damage_flag == "bullet" || damage_flag == "laser")
empulse(B.loc, 1, 3) //less than screen range, so you can stand out of range to avoid it
empulse(B.loc, 75) //less than screen range, so you can stand out of range to avoid it
/datum/reagent/blob/electromagnetic_web
name = "Electromagnetic Web"

View File

@@ -48,6 +48,6 @@
for(var/obj/machinery/light/L in range(5, usr))
L.on = 1
L.break_light_tube()
empulse(get_turf(user), 2, 5, 1)
empulse(get_turf(user), 140, TRUE)
playsound(get_turf(user), 'sound/effects/lingempscreech.ogg', 75, TRUE, 5, soundenvwet = 0)
return TRUE

View File

@@ -11,7 +11,7 @@
/obj/structure/destructible/clockwork/trap/power_nullifier/activate()
if(!activated)
activated = TRUE
empulse(get_turf(src),1,1,TRUE)
empulse(get_turf(src),7,TRUE)
/obj/structure/destructible/clockwork/trap/power_nullifier/emp_act(var/strength=1)
activate()

View File

@@ -165,7 +165,7 @@
/datum/action/innate/cult/blood_spell/emp/Activate()
owner.visible_message("<span class='warning'>[owner]'s hand flashes a bright blue!</span>", \
"<span class='cultitalic'>You speak the cursed words, emitting an EMP blast from your hand.</span>")
empulse(owner, 2, 5)
empulse(owner, 140)
owner.whisper(invocation, language = /datum/language/common)
charges--
if(charges<=0)

View File

@@ -982,7 +982,7 @@ structure_check() searches for nearby cultist structures required for the invoca
visible_message("<span class='warning'>A colossal shockwave of energy bursts from the rune, disintegrating it in the process!</span>")
for(var/mob/living/L in range(src, 3))
L.DefaultCombatKnockdown(30)
empulse(T, 0.42*(intensity), 1)
empulse(T, 16*(intensity))
var/list/images = list()
var/zmatch = T.z
var/datum/atom_hud/AH = GLOB.huds[DATA_HUD_SECURITY_ADVANCED]

View File

@@ -6,5 +6,5 @@
if(!ninjacost(250,N_STEALTH_CANCEL))
var/mob/living/carbon/human/H = affecting
playsound(H.loc, 'sound/effects/empulse.ogg', 60, 2)
empulse(H, 4, 6) //Procs sure are nice. Slightly weaker than wizard's disable tch.
empulse(H, 200) //Procs sure are nice. Slightly weaker than wizard's disable tch.
s_coold = 2

View File

@@ -434,7 +434,7 @@
/obj/singularity/proc/emp_area()
empulse(src, 8, 10)
empulse(src, 250)
return
/obj/singularity/singularity_act()

View File

@@ -10,7 +10,7 @@
/obj/item/projectile/ion/on_hit(atom/target, blocked = FALSE)
..()
empulse(target, emp_radius, emp_radius)
empulse(target, emp_radius * 7)
return BULLET_ACT_HIT
/obj/item/projectile/ion/weak

View File

@@ -114,12 +114,9 @@
/datum/chemical_reaction/emp_pulse/on_reaction(datum/reagents/holder, multiplier)
var/location = get_turf(holder.my_atom)
// 100 multiplier = 4 heavy range & 7 light range. A few tiles smaller than traitor EMP grandes.
// 200 multiplier = 8 heavy range & 14 light range. 4 tiles larger than traitor EMP grenades.
empulse(location, round(multiplier / 12), round(multiplier / 7), 1)
empulse(location, multiplier)
holder.clear_reagents()
/datum/chemical_reaction/beesplosion
name = "Bee Explosion"
id = "beesplosion"

View File

@@ -296,7 +296,7 @@
required_other = TRUE
/datum/chemical_reaction/slime/slimeoverload/on_reaction(datum/reagents/holder, multiplier)
empulse(get_turf(holder.my_atom), 3, 7)
empulse(get_turf(holder.my_atom), 200)
..()
/datum/chemical_reaction/slime/slimecell

View File

@@ -328,7 +328,7 @@
throwSmoke(loc)
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
visible_message("<span class='warning'>[src] melts [exp_on], ionizing the air around it!</span>")
empulse(loc, 4, 6)
empulse(loc, 150)
investigate_log("Experimentor has generated an Electromagnetic Pulse.", INVESTIGATE_EXPERIMENTOR)
ejectItem(TRUE)
////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -123,7 +123,7 @@
rogue_types = list(/datum/nanite_program/toxic)
/datum/nanite_program/emp/on_trigger(comm_message)
empulse(host_mob, 1, 2)
empulse(host_mob, 40)
/datum/nanite_program/pyro/active_effect()
host_mob.fire_stacks += 1

View File

@@ -40,12 +40,12 @@
else
working = TRUE
/obj/machinery/rnd/server/emp_act()
/obj/machinery/rnd/server/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
stat |= EMPED
addtimer(CALLBACK(src, .proc/unemp), 600)
addtimer(CALLBACK(src, .proc/unemp), severity*9)
refresh_working()
/obj/machinery/rnd/server/proc/unemp()

View File

@@ -258,7 +258,7 @@
if(SLIME_ACTIVATE_MAJOR)
user.visible_message("<span class='warning'>[user]'s skin starts flashing intermittently...</span>", "<span class='warning'>Your skin starts flashing intermittently...</span>")
if(do_after(user, 25, target = user))
empulse(user, 1, 2)
empulse(user, 40)
user.visible_message("<span class='warning'>[user]'s skin flashes!</span>", "<span class='warning'>Your skin flashes as you emit an electromagnetic pulse!</span>")
return 600

View File

@@ -3,9 +3,7 @@
desc = "This spell emplodes an area."
charge_max = 250
cooldown_min = 50
var/emp_heavy = 2
var/emp_light = 3
var/power = 100 //same as a 50/50 reaction of uranium and iron
action_icon_state = "emp"
sound = 'sound/weapons/zapbang.ogg'
@@ -15,6 +13,6 @@
for(var/mob/living/target in targets)
if(target.anti_magic_check())
continue
empulse(target.loc, emp_heavy, emp_light)
empulse(target.loc, power)
return

View File

@@ -33,10 +33,9 @@
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
owner.reagents.add_reagent(/datum/reagent/toxin/bad_food, poison_amount / severity)
owner.reagents.add_reagent(/datum/reagent/toxin/bad_food, poison_amount * severity/100)
to_chat(owner, "<span class='warning'>You feel like your insides are burning.</span>")
/obj/item/organ/cyberimp/chest/nutriment/plus
name = "Nutriment pump implant PLUS"
desc = "This implant will synthesize and pump into your bloodstream a small amount of nutriment when you are hungry."
@@ -115,10 +114,10 @@
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(H.stat != DEAD && prob(50 / severity) && H.can_heartattack())
if(H.stat != DEAD && prob(severity/2) && H.can_heartattack())
H.set_heartattack(TRUE)
to_chat(H, "<span class='userdanger'>You feel a horrible agony in your chest!</span>")
addtimer(CALLBACK(src, .proc/undo_heart_attack), 60 SECONDS / severity)
addtimer(CALLBACK(src, .proc/undo_heart_attack), (60 * severity/100) SECONDS)
/obj/item/organ/cyberimp/chest/reviver/proc/undo_heart_attack()
var/mob/living/carbon/human/H = owner

View File

@@ -34,11 +34,10 @@
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
var/stun_amount = 200/severity
var/stun_amount = 2*severity
owner.Stun(stun_amount)
to_chat(owner, "<span class='warning'>Your body seizes up!</span>")
/obj/item/organ/cyberimp/brain/anti_drop
name = "anti-drop implant"
desc = "This cybernetic brain implant will allow you to force your hand muscles to contract, preventing item dropping. Twitch ear to toggle."
@@ -68,12 +67,11 @@
release_items()
to_chat(owner, "<span class='notice'>Your hands relax...</span>")
/obj/item/organ/cyberimp/brain/anti_drop/emp_act(severity)
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
var/range = severity ? 10 : 5
var/range = severity/10
var/atom/A
if(active)
release_items()
@@ -114,7 +112,7 @@
return
crit_fail = TRUE
organ_flags |= ORGAN_FAILING
addtimer(CALLBACK(src, .proc/reboot), 90 / severity)
addtimer(CALLBACK(src, .proc/reboot), 0.9 * severity)
/obj/item/organ/cyberimp/brain/anti_stun/proc/reboot()
crit_fail = FALSE
@@ -136,6 +134,6 @@
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
if(prob(60/severity))
if(prob(0.6*severity))
to_chat(owner, "<span class='warning'>Your breathing tube suddenly closes!</span>")
owner.losebreath += 2

View File

@@ -131,4 +131,4 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
damage += 40/severity
damage += 0.5 * severity

View File

@@ -155,7 +155,7 @@
return
to_chat(owner, "<span class='warning'>Static obfuscates your vision!</span>")
owner.flash_act(visual = 1)
if(severity == EMP_HEAVY)
if(severity >= 70)
owner.adjustOrganLoss(ORGAN_SLOT_EYES, 20)

View File

@@ -198,8 +198,8 @@ obj/item/organ/heart/slime
if(. & EMP_PROTECT_SELF)
return
Stop()
addtimer(CALLBACK(src, .proc/Restart), 20/severity SECONDS)
damage += 100/severity
addtimer(CALLBACK(src, .proc/Restart), 0.2*severity SECONDS)
damage += severity
/obj/item/organ/heart/cybernetic/upgraded
name = "upgraded cybernetic heart"

View File

@@ -112,8 +112,4 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
damage+=100
if(2)
damage+=50
damage += severity

View File

@@ -487,7 +487,6 @@
owner.losebreath = 20
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 25)
/obj/item/organ/lungs/cybernetic/upgraded
name = "upgraded cybernetic lungs"
desc = "A more advanced version of the stock cybernetic lungs. They are capable of filtering out lower levels of toxins and carbon dioxide."

View File

@@ -11,7 +11,7 @@
var/recentpump = 0 // to prevent spammage
/obj/item/gun/energy/pumpaction/emp_act(severity) //makes it not rack itself when emp'd
cell.use(round(cell.charge / severity))
cell.use(round(cell.charge * severity/100))
chambered = null //we empty the chamber
update_icon()

View File

@@ -221,7 +221,7 @@
C.electrocute_act(10, (get_turf(C)), 1, SHOCK_ILLUSION)
if(prob(10))
var/atom/T = C
T.emp_act(EMP_HEAVY)
T.emp_act(80)
to_chat(C, "<span class='warning'>You feel a strange tingling sensation come from your core.</b></span>")
if(isnull(N))
return ..()
@@ -233,7 +233,7 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
if(O == active_obj)
return
react_objs += O
O.emp_act(EMP_HEAVY)
O.emp_act(80)
/datum/reagent/fermi/nanite_b_goneTox
name = "Electromagnetic crystals"
@@ -248,7 +248,7 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
C.electrocute_act(10, (get_turf(C)), 1, SHOCK_ILLUSION)
if(prob(50))
var/atom/T = C
T.emp_act(EMP_HEAVY)
T.emp_act(80)
to_chat(C, "<span class='warning'>You feel your hair stand on end as you glow brightly for a moment!</b></span>")
..()

View File

@@ -95,8 +95,7 @@
if(!ImpureTot == 0) //If impure, v.small emp (0.6 or less)
ImpureTot *= volume
var/empVol = clamp(volume/10, 0, 15)
empulse(T, empVol, ImpureTot/10, 1)
empulse(T, volume, 1)
my_atom.reagents.clear_reagents() //just in case
return