Merge pull request #3052 from Anewbe/emp_things

Reworks empulse and emp_act
This commit is contained in:
Neerti
2017-03-14 21:39:01 -04:00
committed by GitHub
42 changed files with 274 additions and 83 deletions
+8 -4
View File
@@ -637,14 +637,18 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/heavy = input("Range of heavy pulse.", text("Input")) as num|null
if(heavy == null) return
var/med = input("Range of medium pulse.", text("Input")) as num|null
if(med == null) return
var/light = input("Range of light pulse.", text("Input")) as num|null
if(light == null) return
var/long = input("Range of long pulse.", text("Input")) as num|null
if(long == null) return
if (heavy || light)
if (heavy || med || light || long)
empulse(O, heavy, light)
log_admin("[key_name(usr)] created an EM Pulse ([heavy],[light]) at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] created an EM PUlse ([heavy],[light]) at ([O.x],[O.y],[O.z])", 1)
empulse(O, heavy, med, light, long)
log_admin("[key_name(usr)] created an EM Pulse ([heavy],[med],[light],[long]) at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] created an EM PUlse ([heavy],[med],[light],[long]) at ([O.x],[O.y],[O.z])", 1)
feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
+1 -4
View File
@@ -199,10 +199,7 @@
/obj/item/clothing/gloves/emp_act(severity)
if(cell)
//why is this not part of the powercell code?
cell.charge -= 1000 / severity
if (cell.charge < 0)
cell.charge = 0
cell.emp_act(severity)
..()
// Called just before an attack_hand(), in mob/UnarmedAttack()
+6 -2
View File
@@ -164,7 +164,9 @@
if(2)
brainmob.emp_damage += rand(10,20)
if(3)
brainmob.emp_damage += rand(0,10)
brainmob.emp_damage += rand(5,10)
if(4)
brainmob.emp_damage += rand(0,5)
..()
/obj/item/device/mmi/digital
@@ -216,7 +218,9 @@
if(2)
src.brainmob.emp_damage += rand(10,20)
if(3)
src.brainmob.emp_damage += rand(0,10)
src.brainmob.emp_damage += rand(5,10)
if(4)
src.brainmob.emp_damage += rand(0,5)
..()
/obj/item/device/mmi/digital/transfer_identity(var/mob/living/carbon/H)
@@ -112,7 +112,9 @@
if(2)
src.brainmob.emp_damage += rand(10,20)
if(3)
src.brainmob.emp_damage += rand(0,10)
src.brainmob.emp_damage += rand(5,10)
if(4)
src.brainmob.emp_damage += rand(0,5)
..()
/obj/item/device/mmi/digital/posibrain/New()
@@ -65,7 +65,13 @@
src.take_organ_damage(0,20,emp=1)
confused = (min(confused + 5, 30))
if(2)
src.take_organ_damage(0,15,emp=1)
confused = (min(confused + 4, 30))
if(3)
src.take_organ_damage(0,10,emp=1)
confused = (min(confused + 3, 30))
if(4)
src.take_organ_damage(0,5,emp=1)
confused = (min(confused + 2, 30))
flash_eyes(affect_silicon = 1)
src << "<span class='danger'><B>*BZZZT*</B></span>"
+6 -2
View File
@@ -281,9 +281,13 @@ var/list/organ_cache = list()
return
switch (severity)
if (1)
take_damage(5)
take_damage(rand(6,12))
if (2)
take_damage(2)
take_damage(rand(4,8))
if (3)
take_damage(rand(3,6))
if (4)
take_damage(rand(1,4))
/obj/item/organ/proc/removed(var/mob/living/user)
+13 -5
View File
@@ -102,11 +102,19 @@
/obj/item/organ/external/emp_act(severity)
if(!(robotic >= ORGAN_ROBOT))
return
var/burn_damage = 0
switch (severity)
if (1)
take_damage(8)
burn_damage += rand(8, 13)
if (2)
take_damage(4)
burn_damage += rand(6, 9)
if(3)
burn_damage += rand(4, 7)
if(4)
burn_damage += rand(1, 5)
if(burn_damage)
take_damage(0, burn_damage)
/obj/item/organ/external/attack_self(var/mob/living/user)
if(!contents.len)
@@ -243,12 +251,12 @@
return (vital || (robotic >= ORGAN_ROBOT) || brute_dam + burn_dam + additional_damage < max_damage)
/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list())
brute = round(brute * brute_mod, 0.1)
burn = round(burn * burn_mod, 0.1)
if((brute <= 0) && (burn <= 0))
return 0
brute *= brute_mod
burn *= burn_mod
// High brute damage or sharp objects may damage internal organs
if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= 5) || brute >= 10) && prob(5))))
// Damage an internal organ
+6
View File
@@ -97,6 +97,12 @@
if(2)
if(active) toggle_power()
stability -= rand(10,20)
if(3)
if(active) toggle_power()
stability -= rand(8,15)
if(4)
if(active) toggle_power()
stability -= rand(5,10)
..()
return 0
+12 -7
View File
@@ -1193,22 +1193,27 @@ obj/machinery/power/apc/proc/autoset(var/cur_state, var/on)
/obj/machinery/power/apc/ex_act(severity)
switch(severity)
if(1.0)
if(1)
//set_broken() //now qdel() do what we need
if (cell)
cell.ex_act(1.0) // more lags woohoo
cell.ex_act(1) // more lags woohoo
qdel(src)
return
if(2.0)
if(2)
if (prob(75))
set_broken()
if (cell && prob(50))
cell.ex_act(2)
if(3)
if (prob(50))
set_broken()
if (cell && prob(50))
cell.ex_act(2.0)
if(3.0)
cell.ex_act(3)
if(4)
if (prob(25))
set_broken()
if (cell && prob(25))
cell.ex_act(3.0)
if (cell && prob(50))
cell.ex_act(3)
return
/obj/machinery/power/apc/disconnect_terminal()
+3 -3
View File
@@ -165,7 +165,7 @@
return
if (overcharge_percent >= 140)
if (prob(1))
empulse(src.loc, 3, 8, 1)
empulse(src.loc, 2, 3, 6, 8, 1)
if ((2.4e6+1) to 3.6e6)
if (overcharge_percent >= 115)
if (prob(7))
@@ -174,7 +174,7 @@
return
if (overcharge_percent >= 130)
if (prob(1))
empulse(src.loc, 3, 8, 1)
empulse(src.loc, 2, 3, 6, 8, 1)
if (overcharge_percent >= 150)
if (prob(1))
explosion(src.loc, 0, 1, 3, 5)
@@ -186,7 +186,7 @@
return
if (overcharge_percent >= 125)
if (prob(2))
empulse(src.loc, 4, 10, 1)
empulse(src.loc, 2, 4, 7, 10, 1)
if (overcharge_percent >= 140)
if (prob(1))
explosion(src.loc, 1, 3, 5, 8)
+4 -1
View File
@@ -62,9 +62,12 @@
stat &= BROKEN
if(prob(75)) explode()
if(2)
if(prob(25)) stat &= BROKEN
if(prob(50)) stat &= BROKEN
if(prob(10)) explode()
if(3)
if(prob(25)) stat &= BROKEN
duration = 300
if(4)
if(prob(10)) stat &= BROKEN
duration = 300
@@ -441,9 +441,9 @@
/obj/singularity/proc/emp_area()
if(current_size != 11)
empulse(src, 8, 10)
empulse(src, 4, 6, 8, 10)
else
empulse(src, 12, 16)
empulse(src, 12, 14, 16, 18)
/obj/singularity/proc/smwave()
for(var/mob/living/M in view(10, src.loc))
+6 -2
View File
@@ -393,10 +393,14 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
if(prob(50))
if(prob(25))
emp_act(1)
else
else if(prob(25))
emp_act(2)
else if(prob(25))
emp_act(3)
else
emp_act(4)
if(prob(5)) //smoke only
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
smoke.set_up(3, 0, src.loc)
+2 -2
View File
@@ -212,7 +212,7 @@
h_user.adjustFireLoss(rand(10,25))
h_user.Paralyse(5)
spawn(0)
empulse(src.loc, 2, 4)
empulse(src.loc, 1, 2, 3, 4)
charge = 0
if (36 to 60)
@@ -229,7 +229,7 @@
h_user.adjustFireLoss(rand(35,75))
h_user.Paralyse(12)
spawn(0)
empulse(src.loc, 8, 16)
empulse(src.loc, 6, 8, 12, 16)
charge = 0
apcs_overload(1, 10)
src.ping("Caution. Output regulators malfunction. Uncontrolled discharge detected.")
@@ -26,6 +26,10 @@
name = "speedloader (.38 rubber)"
ammo_type = /obj/item/ammo_casing/c38r
/obj/item/ammo_magazine/c38/emp
name = "ammunition box (.38 haywire)"
ammo_type = /obj/item/ammo_casing/c38/emp
///////// .45 /////////
/obj/item/ammo_magazine/c45m
@@ -57,6 +61,10 @@
name = "magazine (.45 AP)"
ammo_type = /obj/item/ammo_casing/c45ap
/obj/item/ammo_magazine/box/emp/c45
name = "ammunition box (.45 haywire)"
ammo_type = /obj/item/ammo_casing/c45/emp
/obj/item/ammo_magazine/c45uzi
name = "stick magazine (.45)"
icon_state = "uzi45"
@@ -272,6 +280,10 @@
max_ammo = 9
multiple_sprites = 1
/obj/item/ammo_magazine/box/emp/a10mm
name = "ammunition box (10mm haywire)"
ammo_type = /obj/item/ammo_casing/a10mm/emp
///////// 5.56mm /////////
/obj/item/ammo_magazine/a556
+23 -3
View File
@@ -24,6 +24,13 @@
icon_state = "r-casing"
projectile_type = /obj/item/projectile/bullet/pistol/rubber
/obj/item/ammo_casing/c38/emp
name = ".38 haywire round"
desc = "A .38 bullet casing fitted with a single-use ion pulse generator."
icon_state = "empcasing"
projectile_type = /obj/item/projectile/ion/small
matter = list(DEFAULT_WALL_MATERIAL = 130, "uranium" = 100)
/obj/item/ammo_casing/c9mm
desc = "A 9mm bullet casing."
caliber = "9mm"
@@ -87,11 +94,24 @@
icon_state = "r-casing"
projectile_type = /obj/item/projectile/energy/flash
/obj/item/ammo_casing/c45/emp
name = ".45 haywire round"
desc = "A .45 bullet casing fitted with a single-use ion pulse generator."
projectile_type = /obj/item/projectile/ion/small
icon_state = "empcasing"
matter = list(DEFAULT_WALL_MATERIAL = 130, "uranium" = 100)
/obj/item/ammo_casing/a10mm
desc = "A 10mm bullet casing."
caliber = "10mm"
projectile_type = /obj/item/projectile/bullet/pistol/medium
/obj/item/ammo_casing/a10mm/emp
name = "10mm haywire round"
desc = "A 10mm bullet casing fitted with a single-use ion pulse generator."
projectile_type = /obj/item/projectile/ion/small
icon_state = "empcasing"
matter = list(DEFAULT_WALL_MATERIAL = 130, "uranium" = 100)
/obj/item/ammo_casing/shotgun
name = "shotgun slug"
@@ -150,13 +170,13 @@
projectile_type = /obj/item/projectile/energy/flash/flare
matter = list(DEFAULT_WALL_MATERIAL = 90, "glass" = 90)
/obj/item/ammo_casing/shotgun/emp
name = "ion shell"
desc = "An advanced shotgun round that creates a small EMP when it strikes a target."
icon_state = "empshell"
projectile_type = /obj/item/projectile/bullet/shotgun/ion
matter = list(DEFAULT_WALL_MATERIAL = 360, "glass" = 720)
projectile_type = /obj/item/projectile/ion
// projectile_type = /obj/item/projectile/bullet/shotgun/ion
matter = list(DEFAULT_WALL_MATERIAL = 360, "uranium" = 240)
/obj/item/ammo_casing/a762
desc = "A 7.62mm bullet casing."
@@ -12,14 +12,18 @@
projectile_type = /obj/item/projectile/ion
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
..(max(severity, 2)) //so it doesn't EMP itself, I guess
..(max(severity, 4)) //so it doesn't EMP itself, I guess
/obj/item/weapon/gun/energy/ionrifle/update_icon()
..()
if(power_supply.charge < charge_cost)
item_state = "ionrifle0"
else
item_state = initial(item_state)
/obj/item/weapon/gun/energy/ionrifle/pistol
name = "ion pistol"
desc = "The NT Mk63 EW Pan is a man portable anti-armor weapon designed to disable mechanical threats, produced by NT. This model sacrifices capacity for portability.."
icon_state = "ionpistol"
item_state = null
w_class = ITEMSIZE_NORMAL
force = 5
slot_flags = SLOT_BELT
charge_cost = 480
projectile_type = /obj/item/projectile/ion
/obj/item/weapon/gun/energy/decloner
name = "biological demolecularisor"
@@ -76,6 +76,10 @@
fire_sound = 'sound/weapons/Gunshot_light.ogg'
ammo_type = /obj/item/ammo_casing/c38
/obj/item/weapon/gun/projectile/revolver/deckard/emp
ammo_type = /obj/item/ammo_casing/c38/emp
/obj/item/weapon/gun/projectile/revolver/deckard/update_icon()
..()
if(loaded.len)
@@ -172,7 +172,8 @@
range_step = 1
spread_step = 10
//EMP shotgun 'slug', it's basically a beanbag that pops a tiny emp when it hits.
//EMP shotgun 'slug', it's basically a beanbag that pops a tiny emp when it hits. //Not currently used
/obj/item/projectile/bullet/shotgun/ion
name = "ion slug"
damage = 15
@@ -182,9 +183,10 @@
/obj/item/projectile/bullet/shotgun/ion/on_hit(var/atom/target, var/blocked = 0)
..()
empulse(target, 0, 0) //Only affects what it hits
empulse(target, 0, 0, 0, 0) //Only affects what it hits
return 1
/* "Rifle" rounds */
/obj/item/projectile/bullet/rifle
@@ -8,12 +8,16 @@
light_range = 2
light_power = 0.5
light_color = "#55AAFF"
var/pulse_range = 1
on_hit(var/atom/target, var/blocked = 0)
empulse(target, 1, 1)
empulse(target, pulse_range, pulse_range, pulse_range, pulse_range)
return 1
/obj/item/projectile/ion/small
pulse_range = 0
/obj/item/projectile/bullet/gyro
name ="explosive bolt"
icon_state= "bolter"
+1 -1
View File
@@ -665,7 +665,7 @@
var/location = get_turf(holder.my_atom)
// 100 created volume = 4 heavy range & 7 light range. A few tiles smaller than traitor EMP grandes.
// 200 created volume = 8 heavy range & 14 light range. 4 tiles larger than traitor EMP grenades.
empulse(location, round(created_volume / 24), round(created_volume / 14), 1)
empulse(location, round(created_volume / 24), round(created_volume / 20), round(created_volume / 18), round(created_volume / 14), 1)
holder.clear_reagents()
return
+7 -1
View File
@@ -84,8 +84,14 @@
if(1)
qdel(src)
if(2)
if(prob(75))
qdel(src)
if(3)
if(prob(50))
qdel(src)
if(4)
if(prob(25))
qdel(src)
/obj/machinery/shield/hitby(AM as mob|obj)
@@ -264,7 +270,7 @@
else
user << "The device must first be secured to the floor."
return
/obj/machinery/shieldgen/emag_act(var/remaining_charges, var/mob/user)
if(!malfunction)
malfunction = 1
+5 -3
View File
@@ -11,13 +11,15 @@
cooldown_min = 200 //50 deciseconds reduction per rank
var/emp_heavy = 6
var/emp_light = 10
var/emp_heavy = 3
var/emp_med = 5
var/emp_light = 8
var/emp_long = 10
hud_state = "wiz_tech"
/spell/aoe_turf/disable_tech/cast(list/targets)
for(var/turf/target in targets)
empulse(get_turf(target), emp_heavy, emp_light)
empulse(get_turf(target), emp_heavy, emp_med, emp_light, emp_long)
return
+1 -1
View File
@@ -432,4 +432,4 @@
/obj/item/weapon/spellbook/oneuse/charge/recoil(mob/user as mob)
..()
user <<"<span class='warning'>[src] suddenly feels very warm!</span>"
empulse(src, 1, 1)
empulse(src, 1, 1, 1, 1)
+1 -1
View File
@@ -9,5 +9,5 @@
/datum/artifact_effect/emp/DoEffectPulse()
if(holder)
var/turf/T = get_turf(holder)
empulse(T, effectrange/2, effectrange)
empulse(T, effectrange/4, effectrange/3, effectrange/2, effectrange)
return 1