mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Merge pull request #18887 from coiax/cleaning-1
Code cleaning; countdown for transformer
This commit is contained in:
@@ -1390,3 +1390,5 @@ proc/pick_closest_path(value)
|
||||
animate(C, color = old_color, time = flash_time)
|
||||
|
||||
#define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255)))
|
||||
|
||||
#define QDEL_IN(item, time) addtimer(GLOBAL_PROC, "qdel", time, FALSE, item)
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
if(M.isMotion())
|
||||
motioncamera = M
|
||||
M.area_motion = src
|
||||
return
|
||||
return
|
||||
|
||||
/area/ai_monitored/Entered(atom/movable/O)
|
||||
..()
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
D.cancelAlarm("Power", src, source)
|
||||
else
|
||||
D.triggerAlarm("Power", src, cameras, source)
|
||||
return
|
||||
|
||||
/area/proc/atmosalert(danger_level, obj/source)
|
||||
if(danger_level != atmosalm)
|
||||
@@ -129,7 +128,6 @@
|
||||
aiPlayer.triggerAlarm("Fire", src, cameras, source)
|
||||
for (var/mob/living/simple_animal/drone/D in mob_list)
|
||||
D.triggerAlarm("Fire", src, cameras, source)
|
||||
return
|
||||
|
||||
/area/proc/firereset(obj/source)
|
||||
for(var/area/RA in related)
|
||||
@@ -152,7 +150,6 @@
|
||||
a.cancelAlarm("Fire", src, source)
|
||||
for (var/mob/living/simple_animal/drone/D in mob_list)
|
||||
D.cancelAlarm("Fire", src, source)
|
||||
return
|
||||
|
||||
/area/proc/burglaralert(obj/trigger)
|
||||
if(always_unpowered == 1) //no burglar alarms in space/asteroid
|
||||
@@ -188,13 +185,11 @@
|
||||
if(!eject)
|
||||
eject = 1
|
||||
updateicon()
|
||||
return
|
||||
|
||||
/area/proc/readyreset()
|
||||
if(eject)
|
||||
eject = 0
|
||||
updateicon()
|
||||
return
|
||||
|
||||
/area/proc/partyalert()
|
||||
if(src.name == "Space") //no parties in space!!!
|
||||
@@ -203,7 +198,6 @@
|
||||
src.party = 1
|
||||
src.updateicon()
|
||||
src.mouse_opacity = 0
|
||||
return
|
||||
|
||||
/area/proc/partyreset()
|
||||
if (src.party)
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
hulk.changeNext_move(CLICK_CD_MELEE)
|
||||
add_logs(hulk, src, "punched", "hulk powers")
|
||||
hulk.do_attack_animation(src)
|
||||
return
|
||||
|
||||
/atom/proc/CheckParts(list/parts_list)
|
||||
for(var/A in parts_list)
|
||||
@@ -141,7 +140,6 @@
|
||||
return 1
|
||||
else if(src in container)
|
||||
return 1
|
||||
return
|
||||
|
||||
/*
|
||||
* atom/proc/search_contents_for(path,list/filter_path=null)
|
||||
|
||||
@@ -312,22 +312,18 @@
|
||||
|
||||
/atom/movable/overlay/New()
|
||||
verbs.Cut()
|
||||
return
|
||||
|
||||
/atom/movable/overlay/attackby(a, b, c)
|
||||
if (src.master)
|
||||
return src.master.attackby(a, b, c)
|
||||
return
|
||||
|
||||
/atom/movable/overlay/attack_paw(a, b, c)
|
||||
if (src.master)
|
||||
return src.master.attack_paw(a, b, c)
|
||||
return
|
||||
|
||||
/atom/movable/overlay/attack_hand(a, b, c)
|
||||
if (src.master)
|
||||
return src.master.attack_hand(a, b, c)
|
||||
return
|
||||
|
||||
/atom/movable/proc/handle_buckled_mob_movement(newloc,direct)
|
||||
for(var/m in buckled_mobs)
|
||||
|
||||
@@ -95,7 +95,6 @@
|
||||
return
|
||||
|
||||
src.attack_hand(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/ai_slipper/proc/slip_process()
|
||||
while(cooldown_time - world.timeofday > 0)
|
||||
@@ -112,4 +111,3 @@
|
||||
if (uses >= 0)
|
||||
cooldown_on = 0
|
||||
src.power_change()
|
||||
return
|
||||
@@ -160,8 +160,7 @@
|
||||
if(device)
|
||||
device.pulsed()
|
||||
|
||||
spawn(15)
|
||||
update_icon()
|
||||
addtimer(src, "update_icon", 15)
|
||||
|
||||
/obj/machinery/button/power_change()
|
||||
..()
|
||||
@@ -220,4 +219,4 @@
|
||||
icon = 'icons/obj/apc_repair.dmi'
|
||||
icon_state = "button_frame"
|
||||
result_path = /obj/machinery/button
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
|
||||
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
@@ -142,11 +142,13 @@
|
||||
|
||||
/obj/structure/barricade/security/New()
|
||||
..()
|
||||
spawn(40)
|
||||
icon_state = "barrier1"
|
||||
density = 1
|
||||
anchored = 1
|
||||
visible_message("<span class='warning'>[src] deploys!</span>")
|
||||
addtimer(src, "deploy", 40)
|
||||
|
||||
/obj/structure/barricade/security/proc/deploy()
|
||||
icon_state = "barrier1"
|
||||
density = 1
|
||||
anchored = 1
|
||||
visible_message("<span class='warning'>[src] deploys!</span>")
|
||||
|
||||
|
||||
/obj/item/weapon/grenade/barrier
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/obj/machinery/transformer
|
||||
name = "\improper Automatic Robotic Factory 5000"
|
||||
desc = "A large metallic machine with an entrance and an exit. A sign on the side reads, 'human go in, robot come out', human must be lying down and alive. Has to cooldown between each use."
|
||||
desc = "A large metallic machine with an entrance and an exit. A sign on \
|
||||
the side reads, 'human go in, robot come out'. The human must be \
|
||||
lying down and alive. Has to cooldown between each use."
|
||||
icon = 'icons/obj/recycling.dmi'
|
||||
icon_state = "separator-AO1"
|
||||
layer = ABOVE_ALL_MOB_LAYER // Overhead
|
||||
@@ -10,12 +12,28 @@
|
||||
var/transform_standing = 0
|
||||
var/cooldown_duration = 600 // 1 minute
|
||||
var/cooldown = 0
|
||||
var/cooldown_timer
|
||||
var/robot_cell_charge = 5000
|
||||
var/obj/effect/countdown/transformer/countdown
|
||||
|
||||
/obj/machinery/transformer/New()
|
||||
// On us
|
||||
..()
|
||||
new /obj/machinery/conveyor/auto(loc, WEST)
|
||||
countdown = new(src)
|
||||
countdown.start()
|
||||
|
||||
/obj/machinery/transformer/examine(mob/user)
|
||||
. = ..()
|
||||
if(cooldown && (issilicon(user) || isobserver(user)))
|
||||
var/seconds_remaining = (cooldown_timer - world.time) / 10
|
||||
user << "It will be ready in [max(0, seconds_remaining)] seconds."
|
||||
|
||||
/obj/machinery/transformer/Destroy()
|
||||
if(countdown)
|
||||
qdel(countdown)
|
||||
countdown = null
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/transformer/power_change()
|
||||
..()
|
||||
@@ -29,7 +47,6 @@
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/machinery/transformer/Bumped(atom/movable/AM)
|
||||
|
||||
if(cooldown == 1)
|
||||
return
|
||||
|
||||
@@ -43,12 +60,19 @@
|
||||
do_transform(AM)
|
||||
|
||||
/obj/machinery/transformer/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(!ishuman(mover)) // Allows items to go through, to stop them from blocking the conveyour belt.
|
||||
// Allows items to go through,
|
||||
// to stop them from blocking the conveyor belt.
|
||||
if(!ishuman(mover))
|
||||
var/dir = get_dir(src, mover)
|
||||
if(dir == EAST)
|
||||
return ..()
|
||||
return 0
|
||||
|
||||
/obj/machinery/transformer/process()
|
||||
if(cooldown && (cooldown_timer <= world.time))
|
||||
cooldown = FALSE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/transformer/proc/do_transform(mob/living/carbon/human/H)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
@@ -61,10 +85,8 @@
|
||||
|
||||
// Activate the cooldown
|
||||
cooldown = 1
|
||||
cooldown_timer = world.time + cooldown_duration
|
||||
update_icon()
|
||||
spawn(cooldown_duration)
|
||||
cooldown = 0
|
||||
update_icon()
|
||||
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
H.emote("scream") // It is painful
|
||||
@@ -81,18 +103,20 @@
|
||||
|
||||
// So he can't jump out the gate right away.
|
||||
R.SetLockdown()
|
||||
spawn(50)
|
||||
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
sleep(30)
|
||||
if(R)
|
||||
R.SetLockdown(0)
|
||||
R.notify_ai(1)
|
||||
addtimer(src, "unlock_new_robot", 50, FALSE, R)
|
||||
|
||||
/obj/machinery/transformer/proc/unlock_new_robot(mob/living/silicon/robot/R)
|
||||
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
|
||||
sleep(30)
|
||||
if(R)
|
||||
R.SetLockdown(0)
|
||||
R.notify_ai(1)
|
||||
|
||||
/obj/machinery/transformer/conveyor/New()
|
||||
..()
|
||||
var/turf/T = loc
|
||||
if(T)
|
||||
// Spawn Conveyour Belts
|
||||
// Spawn Conveyor Belts
|
||||
|
||||
//East
|
||||
var/turf/east = locate(T.x + 1, T.y, T.z)
|
||||
|
||||
@@ -579,7 +579,6 @@
|
||||
|
||||
stat |= BROKEN
|
||||
icon_state = "[initial(icon_state)]-broken"
|
||||
return
|
||||
|
||||
//Somebody cut an important wire and now we're following a new definition of "pitch."
|
||||
/obj/machinery/vending/proc/throw_item()
|
||||
|
||||
@@ -91,7 +91,6 @@
|
||||
var/atom/target = get_edge_target_turf(A, get_dir(src, get_step_away(A, src)))
|
||||
A.throw_at(target, 5, 1)
|
||||
boing = 0
|
||||
return
|
||||
|
||||
/////////////////////
|
||||
|
||||
@@ -156,7 +155,6 @@
|
||||
/obj/effect/anomaly/bluespace/Bumped(atom/A)
|
||||
if(isliving(A))
|
||||
do_teleport(A, locate(A.x, A.y, A.z), 8)
|
||||
return
|
||||
|
||||
/////////////////////
|
||||
|
||||
@@ -210,7 +208,6 @@
|
||||
affect_coord(x-t, y+r, ex_act_force, pull_chance, turf_removal_chance)
|
||||
affect_coord(x+r, y+t, ex_act_force, pull_chance, turf_removal_chance)
|
||||
affect_coord(x-r, y-t, ex_act_force, pull_chance, turf_removal_chance)
|
||||
return
|
||||
|
||||
/obj/effect/anomaly/bhole/proc/affect_coord(x, y, ex_act_force, pull_chance, turf_removal_chance)
|
||||
//Get turf at coordinate
|
||||
@@ -231,4 +228,3 @@
|
||||
//Damaging the turf
|
||||
if( T && prob(turf_removal_chance) )
|
||||
T.ex_act(ex_act_force)
|
||||
return
|
||||
|
||||
@@ -208,7 +208,6 @@ list(name = "- Carbon Dioxide", desc = " This informational poster teaches the v
|
||||
else
|
||||
user << "<span class='notice'>You carefully remove the poster from the wall.</span>"
|
||||
roll_and_drop(user.loc, official)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/sign/poster/attack_hand(mob/user)
|
||||
@@ -277,4 +276,3 @@ list(name = "- Carbon Dioxide", desc = " This informational poster teaches the v
|
||||
user << "<span class='notice'>You place the poster!</span>"
|
||||
else
|
||||
D.roll_and_drop(temp_loc,D.official)
|
||||
return
|
||||
@@ -22,15 +22,7 @@
|
||||
name = "invisible wall"
|
||||
desc = "You have a bad feeling about this."
|
||||
var/timeleft = 300
|
||||
var/last_process = 0
|
||||
|
||||
/obj/effect/forcefield/mime/New()
|
||||
..()
|
||||
last_process = world.time
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/effect/forcefield/mime/process()
|
||||
timeleft -= (world.time - last_process)
|
||||
if(timeleft <= 0)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
qdel(src)
|
||||
QDEL_IN(src, timeleft)
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
unacidable = 1//Just to be sure.
|
||||
|
||||
/obj/effect/manifest/New()
|
||||
|
||||
src.invisibility = INVISIBILITY_ABSTRACT
|
||||
return
|
||||
|
||||
/obj/effect/manifest/proc/manifest()
|
||||
var/dat = "<B>Crew Manifest</B>:<BR>"
|
||||
@@ -18,4 +16,3 @@
|
||||
P.name = "paper- 'Crew Manifest'"
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
@@ -17,7 +17,6 @@
|
||||
if(3)
|
||||
if (prob(5))
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/effect/spider/attacked_by(obj/item/I, mob/user)
|
||||
..()
|
||||
|
||||
@@ -121,3 +121,15 @@
|
||||
return
|
||||
else if(G.health && !G.purpose_fulfilled)
|
||||
return "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'>[GATEWAY_RATVAR_ARRIVAL - G.progress_in_seconds]</div>"
|
||||
|
||||
/obj/effect/countdown/transformer
|
||||
name = "transformer countdown"
|
||||
text_color = "#4C5866"
|
||||
|
||||
/obj/effect/countdown/transformer/get_value()
|
||||
var/obj/machinery/transformer/T = attached_to
|
||||
if(!istype(T))
|
||||
return
|
||||
else if(T.cooldown)
|
||||
var/seconds_left = max(0, (T.cooldown_timer - world.time) / 10)
|
||||
return "[round(seconds_left)]"
|
||||
|
||||
Reference in New Issue
Block a user