mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into turfs
# Conflicts: # code/modules/mob/living/simple_animal/friendly/farm_animals.dm # paradise.dme
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
anchored = 1
|
||||
use_power = NO_POWER_USE
|
||||
req_access = list(access_engine_equip)
|
||||
siemens_strength = 1
|
||||
var/spooky=0
|
||||
var/area/area
|
||||
var/areastring = null
|
||||
@@ -538,7 +539,7 @@
|
||||
if(C.amount >= 10 && !terminal && opened && has_electronics != 2)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/N = T.get_cable_node()
|
||||
if(prob(50) && electrocute_mob(usr, N, N))
|
||||
if(prob(50) && electrocute_mob(usr, N, N, 1, TRUE))
|
||||
do_sparks(5, 1, src)
|
||||
return
|
||||
C.use(10)
|
||||
@@ -1240,13 +1241,13 @@
|
||||
if(prob(5))
|
||||
var/list/shock_mobs = list()
|
||||
for(var/C in view(get_turf(src), 5)) //We only want to shock a single random mob in range, not every one.
|
||||
if(iscarbon(C))
|
||||
shock_mobs +=C
|
||||
if(isliving(C))
|
||||
shock_mobs += C
|
||||
if(shock_mobs.len)
|
||||
var/mob/living/carbon/S = pick(shock_mobs)
|
||||
S.electrocute_act(rand(5,25), "electrical arc")
|
||||
playsound(get_turf(S), 'sound/effects/eleczap.ogg', 75, 1)
|
||||
Beam(S,icon_state="lightning[rand(1,12)]",icon='icons/effects/effects.dmi',time=5)
|
||||
var/mob/living/L = pick(shock_mobs)
|
||||
L.electrocute_act(rand(5, 25), "electrical arc")
|
||||
playsound(get_turf(L), 'sound/effects/eleczap.ogg', 75, 1)
|
||||
Beam(L, icon_state = "lightning[rand(1, 12)]", icon = 'icons/effects/effects.dmi', time = 5)
|
||||
|
||||
else // no cell, switch everything off
|
||||
|
||||
|
||||
@@ -187,14 +187,14 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
src.add_fingerprint(user)
|
||||
|
||||
// shock the user with probability prb
|
||||
/obj/structure/cable/proc/shock(mob/user, prb, var/siemens_coeff = 1.0)
|
||||
/obj/structure/cable/proc/shock(mob/user, prb, siemens_coeff = 1)
|
||||
if(!prob(prb))
|
||||
return 0
|
||||
return FALSE
|
||||
if(electrocute_mob(user, powernet, src, siemens_coeff))
|
||||
do_sparks(5, 1, src)
|
||||
return 1
|
||||
return TRUE
|
||||
else
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
//explosion handling
|
||||
/obj/structure/cable/ex_act(severity)
|
||||
|
||||
@@ -162,23 +162,10 @@
|
||||
ex_act(EXPLODE_DEVASTATE)
|
||||
|
||||
/obj/item/stock_parts/cell/proc/get_electrocute_damage()
|
||||
switch(charge)
|
||||
if(5000000 to INFINITY)
|
||||
return min(rand(200, 300),rand(200, 300))
|
||||
if(4000000 to 5000000 - 1)
|
||||
return min(rand(80, 180),rand(80, 180))
|
||||
if(1000000 to 4000000 - 1)
|
||||
return min(rand(50, 160),rand(50, 160))
|
||||
if(200000 to 1000000 - 1)
|
||||
return min(rand(25, 80),rand(25, 80))
|
||||
if(100000 to 200000 - 1)//Ave powernet
|
||||
return min(rand(20, 60),rand(20, 60))
|
||||
if(50000 to 100000 - 1)
|
||||
return min(rand(15, 40),rand(15, 40))
|
||||
if(1000 to 50000 - 1)
|
||||
return min(rand(10, 20),rand(10, 20))
|
||||
else
|
||||
return 0
|
||||
if(charge >= 1000)
|
||||
return Clamp(20 + round(charge / 25000), 20, 195) + rand(-5, 5)
|
||||
else
|
||||
return 0
|
||||
|
||||
// Cell variants
|
||||
/obj/item/stock_parts/cell/empty/New()
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
M.show_message("[user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2)
|
||||
if(on && (W.flags & CONDUCT))
|
||||
if(prob(12))
|
||||
electrocute_mob(user, get_area(src), src, 0.3)
|
||||
electrocute_mob(user, get_area(src), src, 0.3, TRUE)
|
||||
broken()
|
||||
|
||||
else
|
||||
@@ -387,7 +387,7 @@
|
||||
if(has_power() && (W.flags & CONDUCT))
|
||||
do_sparks(3, 1, src)
|
||||
if(prob(75))
|
||||
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
|
||||
electrocute_mob(user, get_area(src), src, rand(0.7, 1), TRUE)
|
||||
|
||||
|
||||
// returns whether this light has power
|
||||
|
||||
@@ -298,34 +298,37 @@
|
||||
//power_source is a source of electricity, can be powercell, area, apc, cable, powernet or null
|
||||
//source is an object caused electrocuting (airlock, grille, etc)
|
||||
//No animations will be performed by this proc.
|
||||
/proc/electrocute_mob(mob/living/carbon/M as mob, var/power_source, var/obj/source, var/siemens_coeff = 1.0)
|
||||
/proc/electrocute_mob(mob/living/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
|
||||
if(!istype(M))
|
||||
return 0
|
||||
return FALSE
|
||||
if(istype(M.loc,/obj/mecha))
|
||||
return 0 //feckin mechs are dumb
|
||||
return FALSE //feckin mechs are dumb
|
||||
if(dist_check)
|
||||
if(!in_range(source, M))
|
||||
return FALSE
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.gloves)
|
||||
var/obj/item/clothing/gloves/G = H.gloves
|
||||
if(G.siemens_coefficient == 0)
|
||||
return 0 //to avoid spamming with insulated glvoes on
|
||||
return FALSE //to avoid spamming with insulated glvoes on
|
||||
|
||||
var/area/source_area
|
||||
if(istype(power_source,/area))
|
||||
if(istype(power_source, /area))
|
||||
source_area = power_source
|
||||
power_source = source_area.get_apc()
|
||||
if(istype(power_source,/obj/structure/cable))
|
||||
if(istype(power_source, /obj/structure/cable))
|
||||
var/obj/structure/cable/Cable = power_source
|
||||
power_source = Cable.powernet
|
||||
|
||||
var/datum/powernet/PN
|
||||
var/obj/item/stock_parts/cell/cell
|
||||
|
||||
if(istype(power_source,/datum/powernet))
|
||||
if(istype(power_source, /datum/powernet))
|
||||
PN = power_source
|
||||
else if(istype(power_source,/obj/item/stock_parts/cell))
|
||||
cell = power_source
|
||||
else if(istype(power_source,/obj/machinery/power/apc))
|
||||
else if(istype(power_source, /obj/machinery/power/apc))
|
||||
var/obj/machinery/power/apc/apc = power_source
|
||||
cell = apc.cell
|
||||
if(apc.terminal)
|
||||
@@ -344,7 +347,7 @@
|
||||
if(cell)
|
||||
cell_damage = cell.get_electrocute_damage()
|
||||
var/shock_damage = 0
|
||||
if(PN_damage>=cell_damage)
|
||||
if(PN_damage >= cell_damage)
|
||||
power_source = PN
|
||||
shock_damage = PN_damage
|
||||
else
|
||||
|
||||
@@ -128,23 +128,10 @@
|
||||
newavail = 0
|
||||
|
||||
/datum/powernet/proc/get_electrocute_damage()
|
||||
switch(avail)
|
||||
if(5000000 to INFINITY)
|
||||
return min(rand(200,300),rand(200,300))
|
||||
if(4000000 to 5000000)
|
||||
return min(rand(80,180),rand(80,180))
|
||||
if(1000000 to 4000000)
|
||||
return min(rand(50,160),rand(50,160))
|
||||
if(200000 to 1000000)
|
||||
return min(rand(25,80),rand(25,80))
|
||||
if(100000 to 200000)//Ave powernet
|
||||
return min(rand(20,60),rand(20,60))
|
||||
if(50000 to 100000)
|
||||
return min(rand(15,40),rand(15,40))
|
||||
if(1000 to 50000)
|
||||
return min(rand(10,20),rand(10,20))
|
||||
else
|
||||
return 0
|
||||
if(avail >= 1000)
|
||||
return Clamp(20 + round(avail / 25000), 20, 195) + rand(-5, 5)
|
||||
else
|
||||
return 0
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// Misc.
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
if(isliving(user))
|
||||
var/shock_damage = min(rand(30,40),rand(30,40))
|
||||
|
||||
if(iscarbon(user))
|
||||
if(isliving(user) && !issilicon(user))
|
||||
var/stun = min(shock_damage, 15)
|
||||
user.Stun(stun)
|
||||
user.Weaken(10)
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
playsound(src.loc, I.usesound, 50, 1)
|
||||
|
||||
if(do_after(user, 50 * I.toolspeed, target = src))
|
||||
if(prob(50) && electrocute_mob(usr, terminal.powernet, terminal)) //animate the electrocution if uncautious and unlucky
|
||||
if(prob(50) && electrocute_mob(usr, terminal.powernet, terminal, 1, TRUE)) //animate the electrocution if uncautious and unlucky
|
||||
do_sparks(5, 1, src)
|
||||
return
|
||||
|
||||
@@ -320,7 +320,7 @@
|
||||
if(do_after(user, 50, target = src))
|
||||
var/turf/T = get_turf(user)
|
||||
var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one
|
||||
if(prob(50) && electrocute_mob(user, N, N)) //animate the electrocution if uncautious and unlucky
|
||||
if(prob(50) && electrocute_mob(usr, N, N, 1, TRUE)) //animate the electrocution if uncautious and unlucky
|
||||
do_sparks(5, 1, src)
|
||||
return
|
||||
|
||||
|
||||
@@ -115,6 +115,16 @@
|
||||
/obj/singularity/energy_ball/Bumped(atom/A)
|
||||
dust_mobs(A)
|
||||
|
||||
/obj/singularity/energy_ball/attack_tk(mob/user)
|
||||
if(iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
to_chat(C, "<span class='userdanger'>That was a shockingly dumb idea.</span>")
|
||||
var/obj/item/organ/internal/brain/B = C.get_int_organ(/obj/item/organ/internal/brain)
|
||||
C.ghostize(0)
|
||||
if(B)
|
||||
B.remove(C)
|
||||
qdel(B)
|
||||
|
||||
/obj/singularity/energy_ball/orbit(obj/singularity/energy_ball/target)
|
||||
if(istype(target))
|
||||
target.orbiting_balls += src
|
||||
@@ -130,6 +140,10 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/singularity/energy_ball/proc/dust_mobs(atom/A)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(L.incorporeal_move || L.status_flags & GODMODE)
|
||||
return
|
||||
if(!iscarbon(A))
|
||||
return
|
||||
for(var/obj/machinery/power/grounding_rod/GR in orange(src, 2))
|
||||
@@ -155,7 +169,6 @@
|
||||
var/static/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
|
||||
/obj/machinery/power/emitter,
|
||||
/obj/machinery/field/generator,
|
||||
/mob/living/simple_animal,
|
||||
/obj/machinery/particle_accelerator/control_box,
|
||||
/obj/structure/particle_accelerator/fuel_chamber,
|
||||
/obj/structure/particle_accelerator/particle_emitter/center,
|
||||
@@ -165,6 +178,9 @@
|
||||
/obj/structure/particle_accelerator/end_cap,
|
||||
/obj/machinery/field/containment,
|
||||
/obj/structure/disposalpipe,
|
||||
/obj/structure/disposaloutlet,
|
||||
/obj/machinery/disposal/deliveryChute,
|
||||
/obj/machinery/camera,
|
||||
/obj/structure/sign,
|
||||
/obj/machinery/gateway,
|
||||
/obj/structure/grille,
|
||||
@@ -255,7 +271,7 @@
|
||||
|
||||
else if(closest_mob)
|
||||
var/shock_damage = Clamp(round(power/400), 10, 90) + rand(-5, 5)
|
||||
closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = 1)
|
||||
closest_mob.electrocute_act(shock_damage, source, 1, tesla_shock = TRUE)
|
||||
if(issilicon(closest_mob))
|
||||
var/mob/living/silicon/S = closest_mob
|
||||
if(stun_mobs)
|
||||
|
||||
Reference in New Issue
Block a user