Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into proc-define-shit

This commit is contained in:
SandPoot
2024-03-08 19:10:22 -03:00
810 changed files with 140372 additions and 5523 deletions
+6 -6
View File
@@ -197,23 +197,23 @@
/obj/machinery/power/am_control_unit/proc/add_shielding(obj/machinery/am_shielding/AMS, AMS_linking = 0)
if(!istype(AMS))
return 0
return FALSE
if(!anchored)
return 0
return FALSE
if(!AMS_linking && !AMS.link_control(src))
return 0
return FALSE
linked_shielding.Add(AMS)
update_shield_icons = 1
return 1
return TRUE
/obj/machinery/power/am_control_unit/proc/remove_shielding(obj/machinery/am_shielding/AMS)
if(!istype(AMS))
return 0
return FALSE
linked_shielding.Remove(AMS)
update_shield_icons = 2
if(active)
toggle_power()
return 1
return TRUE
/obj/machinery/power/am_control_unit/proc/check_stability()//TODO: make it break when low also might want to add a way to fix it like a part or such that can be replaced
if(stability <= 0)
+5 -5
View File
@@ -80,7 +80,7 @@
/obj/machinery/am_shielding/CanPass(atom/movable/mover, turf/target)
return 0
return FALSE
/obj/machinery/am_shielding/process()
@@ -167,12 +167,12 @@
//Call this to link a detected shilding unit to the controller
/obj/machinery/am_shielding/proc/link_control(obj/machinery/power/am_control_unit/AMC)
if(!istype(AMC))
return 0
return FALSE
if(control_unit && control_unit != AMC)
return 0//Already have one
control_unit = AMC
control_unit.add_shielding(src,1)
return 1
return TRUE
//Scans cards for shields or the control unit and if all there it
@@ -186,8 +186,8 @@
found_am_device = 1
break
if(!found_am_device)
return 0
return 1
return FALSE
return TRUE
/obj/machinery/am_shielding/proc/setup_core()
+3 -3
View File
@@ -860,7 +860,7 @@
/obj/machinery/power/apc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == MELEE && damage_amount < 10 && (!(stat & BROKEN) || malfai))
return 0
return FALSE
. = ..()
@@ -1343,7 +1343,7 @@
if(terminal)
return terminal.surplus()
else
return 0
return FALSE
/obj/machinery/power/apc/add_load(amount)
if(terminal && terminal.powernet)
@@ -1353,7 +1353,7 @@
if(terminal)
return terminal.avail(amount)
else
return 0
return FALSE
/obj/machinery/power/apc/process()
if(icon_update_needed)
+10 -9
View File
@@ -198,12 +198,12 @@ By design, d1 is the smallest direction and d2 is the highest
// shock the user with probability prb
/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, TRUE, src)
return 1
return TRUE
else
return 0
return FALSE
/obj/structure/cable/singularity_pull(S, current_size)
..()
@@ -235,13 +235,13 @@ By design, d1 is the smallest direction and d2 is the highest
if(powernet)
return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
return FALSE
/obj/structure/cable/proc/avail(amount)
if(powernet)
return amount ? powernet.avail >= amount : powernet.avail
else
return 0
return FALSE
/obj/structure/cable/proc/add_delayedload(amount)
if(powernet)
@@ -251,13 +251,13 @@ By design, d1 is the smallest direction and d2 is the highest
if(powernet)
return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
return FALSE
/obj/structure/cable/proc/newavail()
if(powernet)
return powernet.newavail
else
return 0
return FALSE
/////////////////////////////////////////////////
// Cable laying helpers
@@ -515,8 +515,9 @@ By design, d1 is the smallest direction and d2 is the highest
used_skills = list(/datum/skill/level/job/wiring)
/obj/item/stack/cable_coil/cyborg
is_cyborg = 1
is_cyborg = TRUE
custom_materials = null
source = /datum/robot_energy_storage/wire
cost = 1
/obj/item/stack/cable_coil/cyborg/attack_self(mob/user)
@@ -572,7 +573,7 @@ By design, d1 is the smallest direction and d2 is the highest
return ..()
/obj/item/stack/cable_coil/update_icon()
/obj/item/stack/cable_coil/update_icon_state()
icon_state = "[initial(item_state)][amount < 3 ? amount : ""]"
name = "cable [amount < 3 ? "piece" : "coil"]"
+6 -6
View File
@@ -76,13 +76,13 @@
/obj/item/stock_parts/cell/use(amount, can_explode = TRUE)
if(rigged && amount > 0 && can_explode)
explode()
return 0
return FALSE
if(charge < amount)
return 0
return FALSE
charge -= amount
if(!istype(loc, /obj/machinery/power/apc))
SSblackbox.record_feedback("tally", "cell_used", 1, type)
return 1
return TRUE
// recharge the cell
/obj/item/stock_parts/cell/proc/give(amount)
@@ -90,7 +90,7 @@
return
if(rigged && amount > 0)
explode()
return 0
return FALSE
if(maxcharge < amount)
amount = maxcharge
var/power_used = min(maxcharge-charge,amount)
@@ -182,7 +182,7 @@
if(charge >= 1000)
return clamp(round(charge/10000), 10, 90) + rand(-5,5)
else
return 0
return FALSE
/obj/item/stock_parts/cell/get_part_rating()
return rating * maxcharge
@@ -298,7 +298,7 @@
chargerate = 30000
/obj/item/stock_parts/cell/infinite/use()
return 1
return TRUE
/obj/item/stock_parts/cell/infinite/abductor
name = "void core"
+11 -11
View File
@@ -44,13 +44,13 @@
if(powernet)
return clamp(powernet.avail-powernet.load, 0, powernet.avail)
else
return 0
return FALSE
/obj/machinery/power/proc/avail(amount)
if(powernet)
return amount ? powernet.avail >= amount : powernet.avail
else
return 0
return FALSE
/obj/machinery/power/proc/add_delayedload(amount)
if(powernet)
@@ -60,13 +60,13 @@
if(powernet)
return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail)
else
return 0
return FALSE
/obj/machinery/power/proc/newavail()
if(powernet)
return powernet.newavail
else
return 0
return FALSE
/obj/machinery/power/proc/disconnect_terminal() // machines without a terminal will just return, no harm no fowl.
return
@@ -105,7 +105,7 @@
addStaticPower(-value, powerchannel)
/obj/machinery/proc/power_change()
//SIGNAL_HANDLER
SHOULD_NOT_SLEEP(TRUE)
//SHOULD_CALL_PARENT(TRUE)
if(stat & BROKEN)
@@ -309,17 +309,17 @@
//No animations will be performed by this proc.
/proc/electrocute_mob(mob/living/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
if(!istype(M) || ismecha(M.loc))
return 0 //feckin mechs are dumb
return FALSE //feckin mechs are dumb
if(dist_check)
if(!in_range(source,M))
return 0
return FALSE
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.siemens_coefficient == 0)
SEND_SIGNAL(M, COMSIG_LIVING_SHOCK_PREVENTED, power_source, source, siemens_coeff, dist_check)
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))
@@ -342,12 +342,12 @@
if (apc.terminal)
PN = apc.terminal.powernet
else if (!power_source)
return 0
return FALSE
else
log_admin("ERROR: /proc/electrocute_mob([M], [power_source], [source]): wrong power_source")
return 0
return FALSE
if (!cell && !PN)
return 0
return FALSE
var/PN_damage = 0
var/cell_damage = 0
if (PN)
+1 -1
View File
@@ -98,4 +98,4 @@
if(avail >= 1000)
return clamp(round(avail/10000), 10, 90) + rand(-5,5)
else
return 0
return FALSE
+3 -3
View File
@@ -383,7 +383,7 @@
auto.Remove(buckled_mob)
. = ..()
/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user)
/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user, check_loc)
if(user.incapacitated() || !istype(user))
return
for(var/atom/movable/A in get_turf(src))
@@ -426,7 +426,7 @@
for(var/obj/item/I in U.held_items)
if(istype(I, /obj/item/turret_control))
qdel(I)
UpdateButtonIcon()
UpdateButtons()
return
else
playsound(PE,'sound/mecha/mechmove01.ogg', 50, TRUE)
@@ -443,7 +443,7 @@
else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand
var/obj/item/turret_control/TC = new /obj/item/turret_control()
U.put_in_hands(TC)
UpdateButtonIcon()
UpdateButtons()
/obj/item/turret_control
@@ -76,7 +76,7 @@ field_generator power level display
if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on
if(active >= FG_CHARGING)
to_chat(user, "<span class='warning'>You are unable to turn off [src] once it is online!</span>")
return 1
return TRUE
else
user.visible_message("[user] turns on [src].", \
"<span class='notice'>You turn on [src].</span>", \
@@ -157,7 +157,7 @@ field_generator power level display
/obj/machinery/field/generator/blob_act(obj/structure/blob/B)
if(active)
return 0
return FALSE
else
..()
@@ -207,25 +207,25 @@ field_generator power level display
if(draw_power(round(power_draw/2,1)))
check_power_level()
return 1
return TRUE
else
visible_message("<span class='danger'>The [name] shuts down!</span>", "<span class='italics'>You hear something shutting down.</span>")
turn_off()
investigate_log("ran out of power and <font color='red'>deactivated</font>", INVESTIGATE_SINGULO)
power = 0
check_power_level()
return 0
return FALSE
//This could likely be better, it tends to start loopin if you have a complex generator loop setup. Still works well enough to run the engine fields will likely recode the field gens and fields sometime -Mport
/obj/machinery/field/generator/proc/draw_power(draw = 0, failsafe = FALSE, obj/machinery/field/generator/G = null, obj/machinery/field/generator/last = null)
if((G && (G == src)) || (failsafe >= 8))//Loopin, set fail
return 0
return FALSE
else
failsafe++
if(power >= draw)//We have enough power
power -= draw
return 1
return TRUE
else//Need more power
draw -= power
@@ -236,14 +236,14 @@ field_generator power level display
continue
if(G)//Another gen is askin for power and we dont have it
if(FG.draw_power(draw,failsafe,G,src))//Can you take the load
return 1
return TRUE
else
return 0
return FALSE
else//We are askin another for power
if(FG.draw_power(draw,failsafe,src,src))
return 1
return TRUE
else
return 0
return FALSE
/obj/machinery/field/generator/proc/start_fields()
@@ -266,22 +266,22 @@ field_generator power level display
/obj/machinery/field/generator/proc/setup_field(NSEW)
var/turf/T = loc
if(!istype(T))
return 0
return FALSE
var/obj/machinery/field/generator/G = null
var/steps = 0
if(!NSEW)//Make sure its ran right
return 0
return FALSE
for(var/dist in 0 to 7) // checks out to 8 tiles away for another generator
T = get_step(T, NSEW)
if(T.density)//We cant shoot a field though this
return 0
return FALSE
G = locate(/obj/machinery/field/generator) in T
if(G)
steps -= 1
if(!G.active)
return 0
return FALSE
break
for(var/TC in T.contents)
@@ -289,12 +289,12 @@ field_generator power level display
if(ismob(A))
continue
if(A.density)
return 0
return FALSE
steps++
if(!G)
return 0
return FALSE
T = loc
for(var/dist in 0 to steps) // creates each field tile
@@ -141,8 +141,8 @@
/obj/structure/particle_accelerator/proc/connect_master(obj/O)
if(O.dir == dir)
master = O
return 1
return 0
return TRUE
return FALSE
///////////
// PARTS //
@@ -21,8 +21,8 @@
/obj/structure/particle_accelerator/particle_emitter/proc/set_delay(delay)
if(delay >= 0)
fire_delay = delay
return 1
return 0
return TRUE
return FALSE
/obj/structure/particle_accelerator/particle_emitter/proc/emit_particle(strength = 0)
if((last_shot + fire_delay) <= world.time)
@@ -39,5 +39,5 @@
if(3)
P = new/obj/effect/accelerated_particle/powerful(T)
P.setDir(dir)
return 1
return 0
return TRUE
return FALSE
+22 -22
View File
@@ -57,7 +57,7 @@
return ..()
else
last_failed_movement = direct
return 0
return FALSE
/obj/singularity/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
consume(user)
@@ -74,10 +74,10 @@
/obj/singularity/attackby(obj/item/W, mob/user, params)
consume(user)
return 1
return TRUE
/obj/singularity/Process_Spacemove() //The singularity stops drifting for no man!
return 0
return FALSE
/obj/singularity/blob_act(obj/structure/blob/B)
return
@@ -235,18 +235,18 @@
dissipate = 0
if(current_size == allowed_size)
investigate_log("<font color='red'>grew to size [current_size]</font>", INVESTIGATE_SINGULO)
return 1
return TRUE
else if(current_size < (--temp_allowed_size))
expand(temp_allowed_size)
else
return 0
return FALSE
/obj/singularity/proc/check_energy()
if(energy <= 0)
investigate_log("collapsed.", INVESTIGATE_SINGULO)
qdel(src)
return 0
return FALSE
switch(energy)//Some of these numbers might need to be changed up later -Mport
if(1 to 199)
allowed_size = STAGE_ONE
@@ -263,7 +263,7 @@
allowed_size = STAGE_FIVE
if(current_size != allowed_size)
expand()
return 1
return TRUE
/obj/singularity/proc/eat()
@@ -296,7 +296,7 @@
/obj/singularity/proc/move(force_move = 0)
if(!move_self)
return 0
return FALSE
var/movement_dir = pick(GLOB.alldirs - last_failed_movement)
@@ -321,7 +321,7 @@
/obj/singularity/proc/check_turfs_in(direction = 0, step = 0)
if(!direction)
return 0
return FALSE
var/steps = 0
if(!step)
switch(current_size)
@@ -342,7 +342,7 @@
for(var/i = 1 to steps)
T = get_step(T,direction)
if(!isturf(T))
return 0
return FALSE
turfs.Add(T)
var/dir2 = 0
var/dir3 = 0
@@ -357,35 +357,35 @@
for(var/j = 1 to steps-1)
T2 = get_step(T2,dir2)
if(!isturf(T2))
return 0
return FALSE
turfs.Add(T2)
for(var/k = 1 to steps-1)
T = get_step(T,dir3)
if(!isturf(T))
return 0
return FALSE
turfs.Add(T)
for(var/turf/T3 in turfs)
if(isnull(T3))
continue
if(!can_move(T3))
return 0
return 1
return FALSE
return TRUE
/obj/singularity/proc/can_move(turf/T)
if(!T)
return 0
return FALSE
if((locate(/obj/machinery/field/containment) in T)||(locate(/obj/machinery/shieldwall) in T))
return 0
return FALSE
else if(locate(/obj/machinery/field/generator) in T)
var/obj/machinery/field/generator/G = locate(/obj/machinery/field/generator) in T
if(G && G.active)
return 0
return FALSE
else if(locate(/obj/machinery/shieldwallgen) in T)
var/obj/machinery/shieldwallgen/S = locate(/obj/machinery/shieldwallgen) in T
if(S && S.active)
return 0
return 1
return FALSE
return TRUE
/obj/singularity/proc/event()
@@ -397,11 +397,11 @@
mezzer()
if(3,4) //Sets all nearby mobs on fire
if(current_size < STAGE_SIX)
return 0
return FALSE
combust_mobs()
else
return 0
return 1
return FALSE
return TRUE
/obj/singularity/proc/combust_mobs()
+1 -1
View File
@@ -264,7 +264,7 @@
tracker = TRUE
qdel(W)
user.visible_message("[user] inserts the electronics into the solar assembly.", "<span class='notice'>You insert the electronics into the solar assembly.</span>")
return 1
return TRUE
else
if(W.tool_behaviour == TOOL_CROWBAR)
new /obj/item/electronics/tracker(src.loc)
@@ -720,7 +720,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
if(damage > explosion_point)
countdown()
return 1
return TRUE
/obj/machinery/power/supermatter_crystal/bullet_act(obj/item/projectile/Proj)
var/turf/L = loc
+1 -1
View File
@@ -194,6 +194,6 @@
if(anchored && !panel_open)
flick("grounding_rodhit", src)
zap_buckle_check(power)
return 0
return FALSE
else
. = ..()