Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into space_allocation

This commit is contained in:
Crazylemon64
2016-08-03 13:31:42 -07:00
65 changed files with 174 additions and 2702 deletions
+1 -4
View File
@@ -114,7 +114,4 @@
// Atmos pipe limits
#define MAX_OUTPUT_PRESSURE 4500 // (kPa) What pressure pumps and powered equipment max out at.
#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at.
// Sound Limits
#define SOUND_MINIMUM_PRESSURE 10
#define MAX_TRANSFER_RATE 200 // (L/s) Maximum speed powered equipment can work at.
+5 -1
View File
@@ -263,4 +263,8 @@
#define LAVA_PROOF -2
#define FIRE_PROOF -1
#define FLAMMABLE 0
#define ON_FIRE 1
#define ON_FIRE 1
// Sound
#define SOUND_MINIMUM_PRESSURE 10
#define FALLOFF_SOUNDS 0.5
-37
View File
@@ -1,37 +0,0 @@
/client/var/timed_alert/timed_alert
/client/proc/timed_alert(question as text, title as text, default as text, time = 300, \
choice1 as text, choice2 as text, choice3 as text)
if(timed_alert) del(timed_alert)
var/timed_alert/ref_alert = new
timed_alert = ref_alert
var/ref_result
ref_result = ref_alert.timed_alert(src, question, title, time, choice1, choice2, choice3)
if(!ref_result) ref_result = default
if(ref_alert) del(ref_alert)
return ref_result
/mob/proc/timed_alert(question as text, title as text, default as text, time as num, \
choice1 as text, choice2 as text, choice3 as text)
if(client) return client.timed_alert(question, title, default, time, choice1, choice2, choice3)
return
/timed_alert/proc/timed_alert(client/ref_client, question, title, time, choice1, choice2, choice3)
if(!ref_client) return
spawn (time) del(src) // When src is deleted, the proc ends immediately. The alert itself closes.
var/ref_answer
ref_answer = alert(ref_client, question, title, choice1, choice2, choice3)
if(!ref_client || !ref_answer) return
else return ref_answer
-375
View File
@@ -1,375 +0,0 @@
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if(world.time <= usr:lastDblClick+1)
return
else
usr:lastDblClick = world.time
//Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
// ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x
var/dy = src.y - usr.y
if(dy || dx)
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST
else
if(pixel_y > 16) usr.dir = NORTH
else if(pixel_y < -16) usr.dir = SOUTH
else if(pixel_x > 16) usr.dir = EAST
else if(pixel_x < -16) usr.dir = WEST
// ------- AI -------
else if(istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if(ai.control_disabled)
return
// ------- CYBORG -------
else if(istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if(bot.lockcharge) return
..()
// ------- SHIFT-CLICK -------
if(params)
var/parameters = params2list(params)
if(parameters["shift"]){
if(!isAI(usr))
ShiftClick(usr)
else
AIShiftClick(usr)
return
}
// ------- ALT-CLICK -------
if(parameters["alt"]){
if(!isAI(usr))
AltClick(usr)
else
AIAltClick(usr)
return
}
// ------- CTRL-CLICK -------
if(parameters["ctrl"]){
if(!isAI(usr))
CtrlClick(usr)
else
AICtrlClick(usr)
return
}
// ------- MIDDLE-CLICK -------
if(parameters["middle"]){
if(!isAI(usr))
MiddleClick(usr)
return
}
// ------- THROW -------
if(usr.in_throw_mode)
return usr:throw_item(src)
// ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active))
W = usr:module_active
else
W = null
*/
// ------- ATTACK SELF -------
if(W == src && usr.stat == 0)
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand(0) //update in-hand overlays
else
usr.update_inv_r_hand(0)
return
// ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) -------
if(((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
return
// ------- CLICKING STUFF IN CONTAINERS -------
if((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if(istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if(ai.control_disabled || ai.malfhacking)
return
else
return
// ------- 1 TILE AWAY -------
var/t5
// ------- AI CAN CLICK ANYTHING -------
if(istype(usr, /mob/living/silicon/ai))
t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1
else
t5 = in_range(src, usr) || src.loc == usr
// to_chat(world, "according to dblclick(), t5 is [t5]")
// ------- ACTUALLY DETERMINING STUFF -------
if(((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
// ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
if(usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
// ------- ALREADY USED ONE ITEM WITH USE DELAY IN THE PREVIOUS SECOND -------
return
// ------- DELAY CHECK PASSED -------
if((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
// ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
var/direct = get_dir(usr, src)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
var/ok = 0
if( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
var/turf/Step_1
var/turf/Step_2
switch(direct)
if(5.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, EAST)
if(6.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, EAST)
if(9.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, WEST)
if(10.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, WEST)
else
if(Step_1 && Step_2)
// ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
var/check_1 = 0
var/check_2 = 0
if(step_to(D, Step_1))
check_1 = 1
for(var/obj/border_obstacle in Step_1)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_1 = 0
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
check_1 = 0
D.loc = usr.loc
if(step_to(D, Step_2))
check_2 = 1
for(var/obj/border_obstacle in Step_2)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_2 = 0
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
check_2 = 0
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
More info:
If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
*/
else
// ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
if(loc == usr.loc)
ok = 1
// ------- OBJECT IS ON THE SAME TILE AS YOU -------
else
ok = 1
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in usr.loc)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
ok = 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
/*
See the previous More info, for... more info...
*/
//del(D)
// Garbage Collect Dummy
D.loc = null
D = null
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
if(!( ok ))
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
return 0
if(!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
// ------- YOU ARE NOT REASTRAINED -------
if(W)
// ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
var/ignoreAA = 0 //Ignore afterattack(). Surgery uses this.
if(t5)
ignoreAA = src.attackby(W, usr, params)
if(W && !ignoreAA)
W.afterattack(src, usr, (t5 ? 1 : 0), params)
else
// ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
if(istype(usr, /mob/living/carbon/human))
// ------- YOU ARE HUMAN -------
src.attack_hand(usr, usr.hand)
else
// ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
if(istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/slime))
src.attack_slime(usr)
else if(istype(usr, /mob/living/simple_animal))
src.attack_animal(usr)
else
// ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
if(istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.hand_a(usr, usr.hand)
else
// ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
if(istype(src, /obj/screen))
// ------- IT'S THE HUD YOU'RE CLICKING ON -------
usr.prev_move = usr.next_move
usr:lastDblClick = world.time + 2
if(usr.next_move < world.time)
usr.next_move = world.time + 2
else
return
// ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
if(!( usr.restrained() ))
// ------- YOU ARE NOT RESTRAINED -------
if((W && !( istype(src, /obj/screen) )))
// ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
src.attackby(W, usr, params)
if(W)
W.afterattack(src, usr,, params)
else
// ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
if(istype(usr, /mob/living/carbon/human))
src.attack_hand(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/alien/humanoid))
src.attack_alien(usr, usr.hand)
else
// ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
if(istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
if((LASER in usr:mutations) && usr:a_intent == I_HARM && world.time >= usr.next_move)
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
if(istype(usr, /mob/living/carbon/human))
usr:nutrition -= rand(1,5)
usr:handle_regular_hud_updates()
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc )
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = src
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
A.fire()
usr.next_move = world.time + 6
return
@@ -105,6 +105,10 @@
last_task = 0
last_object = null
/datum/controller/process/Destroy()
..()
return QDEL_HINT_HARDDEL_NOW
/datum/controller/process/proc/started()
// Initialize run_start so we can detect hung processes.
run_start = TimeOfGame
@@ -180,8 +184,7 @@
// Allow inheritors to clean up if needed
onKill()
// This should del
del(src)
qdel(src)
// Do not call this directly - use SHECK or SCHECK_EVERY
/datum/controller/process/proc/sleepCheck(var/tickId = 0)
@@ -58,6 +58,10 @@ var/global/datum/controller/processScheduler/processScheduler
timeAllowance = world.tick_lag * 0.5
timeAllowanceMax = world.tick_lag
/datum/controller/processScheduler/Destroy()
..()
return QDEL_HINT_HARDDEL_NOW
/**
* deferSetupFor
* @param path processPath
@@ -72,7 +76,7 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/setup()
// There can be only one
if(processScheduler && (processScheduler != src))
del(src)
qdel(src)
return 0
var/process
+5 -1
View File
@@ -24,7 +24,7 @@ var/global/pipe_processing_killed = 0
//There can be only one master_controller. Out with the old and in with the new.
if(master_controller != src)
if(istype(master_controller))
del(master_controller)
qdel(master_controller)
master_controller = src
var/watch=0
@@ -38,6 +38,10 @@ var/global/pipe_processing_killed = 0
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
/datum/controller/game_controller/Destroy()
..()
return QDEL_HINT_HARDDEL_NOW
/datum/controller/game_controller/proc/setup()
world.tick_lag = config.Ticklag
+1 -1
View File
@@ -128,7 +128,7 @@ datum/hSB
if("hsbtoolbox")
var/obj/item/weapon/storage/hsb = new/obj/item/weapon/storage/toolbox/mechanical
for(var/obj/item/device/radio/T in hsb)
del(T)
qdel(T)
new/obj/item/weapon/crowbar (hsb)
hsb.loc = usr.loc
if("hsbmedkit")
-99
View File
@@ -148,102 +148,3 @@
// Populate the syndicate coalition:
for(var/datum/faction/syndicate/S in ticker.factions)
ticker.syndicate_coalition.Add(S)
/* This was used for something before, I think, but is not worth the effort to process now.
/proc/setupcorpses()
for(var/obj/effect/landmark/A in landmarks_list)
if(A.name == "Corpse")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
qdel(A)
continue
if(A.name == "Corpse-Engineer")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes)
// M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store)
//M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head)
else
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head)
del(A)
continue
if(A.name == "Corpse-Engineer-Space")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/engineer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space(M), slot_wear_suit)
// M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head)
else
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head)
else
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head)
del(A)
continue
if(A.name == "Corpse-Engineer-Chief")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_eng(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/utilitybelt(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chief_engineer(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(M), slot_shoes)
// M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/device/t_scanner(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/hardhat(M), slot_head)
else
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/welding(M), slot_head)
del(A)
continue
if(A.name == "Corpse-Syndicate")
var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc)
M.real_name = "Corpse"
M.death()
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
//M.equip_to_slot_or_del(new /obj/item/weapon/gun/revolver(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/jetpack(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate(M), slot_wear_suit)
if(prob(50))
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head)
else
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate(M), slot_head)
else
M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/swat(M), slot_head)
qdel(A)
continue
*/
+5
View File
@@ -39,6 +39,11 @@
src.colorlist += D
/obj/machinery/pdapainter/Destroy()
if(storedpda)
qdel(storedpda)
storedpda = null
return ..()
/obj/machinery/pdapainter/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/device/pda))
-245
View File
@@ -1,245 +0,0 @@
//http://www.youtube.com/watch?v=-1GadTfGFvU
//i could have done these as just an ordinary plant, but fuck it - there would have been too much snowflake code
/obj/machinery/apiary
name = "apiary tray"
icon = 'icons/obj/hydroponics.dmi'
icon_state = "hydrotray3"
density = 1
anchored = 1
var/nutrilevel = 0
var/yieldmod = 1
var/mut = 1
var/toxic = 0
var/dead = 0
var/health = -1
var/maxhealth = 100
var/lastcycle = 0
var/cycledelay = 100
var/harvestable_honey = 0
var/beezeez = 0
var/swarming = 0
var/bees_in_hive = 0
var/list/owned_bee_swarms = list()
var/hydrotray_type = /obj/machinery/portable_atmospherics/hydroponics
//overwrite this after it's created if the apiary needs a custom machinery sprite
/obj/machinery/apiary/New()
..()
overlays += image('icons/obj/apiary_bees_etc.dmi', icon_state="apiary")
/obj/machinery/apiary/bullet_act(var/obj/item/projectile/Proj) //Works with the Somatoray to modify plant variables.
if(istype(Proj ,/obj/item/projectile/energy/floramut))
mut++
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
if(!yieldmod)
yieldmod += 1
// to_chat(world, "Yield increased by 1, from 0, to a total of [myseed.yield]")
else if(prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
yieldmod += 1
// to_chat(world, "Yield increased by 1, to a total of [myseed.yield]")
else
..()
return
/obj/machinery/apiary/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O, /obj/item/queen_bee))
if(health > 0)
to_chat(user, "\red There is already a queen in there.")
else
health = 10
nutrilevel += 10
user.drop_item()
del(O)
to_chat(user, "\blue You carefully insert the queen into [src], she gets busy making a hive.")
bees_in_hive = 0
else if(istype(O, /obj/item/beezeez))
beezeez += 100
nutrilevel += 10
user.drop_item()
if(health > 0)
to_chat(user, "\blue You insert [O] into [src]. A relaxed humming appears to pick up.")
else
to_chat(user, "\blue You insert [O] into [src]. Now it just needs some bees.")
del(O)
else if(istype(O, /obj/item/weapon/minihoe))
if(health > 0)
to_chat(user, "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>")
angry_swarm(user)
else
to_chat(user, "\blue You begin to dislodge the dead apiary from the tray.")
if(do_after(user, 50, target = src))
new hydrotray_type(src.loc)
new /obj/item/apiary(src.loc)
to_chat(user, "\red You dislodge the apiary from the tray.")
del(src)
else if(istype(O, /obj/item/weapon/bee_net))
var/obj/item/weapon/bee_net/N = O
if(N.caught_bees > 0)
to_chat(user, "\blue You empty the bees into the apiary.")
bees_in_hive += N.caught_bees
N.caught_bees = 0
else
to_chat(user, "\blue There are no more bees in the net.")
else if(istype(O, /obj/item/weapon/reagent_containers/glass))
var/obj/item/weapon/reagent_containers/glass/G = O
if(harvestable_honey > 0)
if(health > 0)
to_chat(user, "\red You begin to harvest the honey. The bees don't seem to like it.")
angry_swarm(user)
else
to_chat(user, "\blue You begin to harvest the honey.")
if(do_after(user,50, target = src))
G.reagents.add_reagent("honey",harvestable_honey)
harvestable_honey = 0
to_chat(user, "\blue You successfully harvest the honey.")
else
to_chat(user, "\blue There is no honey left to harvest.")
else
angry_swarm(user)
..()
/obj/machinery/apiary/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1
if(istype(mover) && mover.checkpass(PASSTABLE))
return 1
else
return 0
/obj/machinery/apiary/process()
if(swarming > 0)
swarming -= 1
if(swarming <= 0)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
del(B)
else if(bees_in_hive < 10)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
del(B)
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
if(health < 0)
return
//magical bee formula
if(beezeez > 0)
beezeez -= 1
nutrilevel += 2
health += 1
toxic = max(0, toxic - 1)
//handle nutrients
nutrilevel -= bees_in_hive / 10 + owned_bee_swarms.len / 5
if(nutrilevel > 0)
bees_in_hive += 1 * yieldmod
if(health < maxhealth)
health++
else
//nutrilevel is less than 1, so we're effectively subtracting here
health += max(nutrilevel - 1, round(-health / 2))
bees_in_hive += max(nutrilevel - 1, round(-bees_in_hive / 2))
if(owned_bee_swarms.len)
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
B.target_turf = get_turf(src)
//clear out some toxins
if(toxic > 0)
toxic -= 1
health -= 1
if(health <= 0)
return
//make a bit of honey
if(harvestable_honey < 50)
harvestable_honey += 0.5
//make some new bees
if(bees_in_hive >= 10 && prob(bees_in_hive * 10))
var/mob/living/simple_animal/bee/B = new(get_turf(src), src)
owned_bee_swarms.Add(B)
B.mut = mut
B.toxic = toxic
bees_in_hive -= 1
//find some plants, harvest
for(var/obj/machinery/portable_atmospherics/hydroponics/H in view(7, src))
if(H.seed && !H.dead && prob(owned_bee_swarms.len * 10))
src.nutrilevel++
H.nutrilevel++
if(mut < H.mutation_mod - 1)
mut = H.mutation_mod - 1
else if(mut > H.mutation_mod - 1)
H.mutation_mod = mut
//flowers give us pollen (nutrients)
/* - All plants should be giving nutrients to the hive.
if(H.myseed.type == /obj/item/seeds/harebell || H.myseed.type == /obj/item/seeds/sunflowerseed)
src.nutrilevel++
H.nutrilevel++
*/
//have a few beneficial effects on nearby plants
if(prob(10))
H.lastcycle -= 5
if(prob(10))
H.seed.lifespan = max(initial(H.seed.lifespan) * 1.5, H.seed.lifespan + 1)
if(prob(10))
H.seed.endurance = max(initial(H.seed.endurance) * 1.5, H.seed.endurance + 1)
if(H.toxins && prob(10))
H.toxins = min(0, H.toxins - 1)
toxic++
/obj/machinery/apiary/proc/die()
if(owned_bee_swarms.len)
var/mob/living/simple_animal/bee/B = pick(owned_bee_swarms)
B.target_turf = get_turf(src)
B.strength -= 1
if(B.strength <= 0)
del(B)
else if(B.strength <= 5)
B.icon_state = "bees[B.strength]"
bees_in_hive = 0
health = 0
/obj/machinery/apiary/proc/angry_swarm(var/mob/M)
for(var/mob/living/simple_animal/bee/B in owned_bee_swarms)
B.feral = 25
B.target_mob = M
swarming = 25
while(bees_in_hive > 0)
var/spawn_strength = bees_in_hive
if(bees_in_hive >= 5)
spawn_strength = 6
var/mob/living/simple_animal/bee/B = new(get_turf(src), src)
B.target_mob = M
B.strength = spawn_strength
B.feral = 25
B.mut = mut
B.toxic = toxic
bees_in_hive -= spawn_strength
/obj/machinery/apiary/verb/harvest_honeycomb()
set src in oview(1)
set name = "Harvest honeycomb"
set category = "Object"
if(usr.stat || !usr.canmove || usr.restrained())
return
while(health > 15)
health -= 15
var/obj/item/weapon/reagent_containers/food/snacks/honeycomb/H = new(src.loc)
if(toxic > 0)
H.reagents.add_reagent("toxin", toxic)
to_chat(usr, "\blue You harvest the honeycomb from the hive. There is a wild buzzing!")
angry_swarm(usr)
+7 -7
View File
@@ -43,7 +43,7 @@
loopings += ident_tag
loopings[ident_tag] = 0
break
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
for(var/ident_tag in id_tags)
if((M.id_tag == ident_tag) && !(ident_tag in synced) && !(ident_tag in door_only_tags))
@@ -69,7 +69,7 @@
loopings[ident_tag] = 0
break
if(!(ident_tag in synced))
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
if((M.id_tag == ident_tag) && !(ident_tag in synced) && !(ident_tag in door_only_tags))
door_only_tags += ident_tag
@@ -90,7 +90,7 @@
visible_message("Cannot locate any mass driver of that ID. Cancelling firing sequence!")
return
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
if(M.id_tag == ident_tag)
spawn()
@@ -104,7 +104,7 @@
M.drive()
sleep(50)
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
if(M.id_tag == ident_tag)
spawn()
@@ -244,7 +244,7 @@
maxtimes[ident_tag] = min(max(round(maxtimes[ident_tag]), 0), 120)
if(href_list["door"])
var/ident_tag = href_list["driver"]
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
if(M.id_tag == ident_tag)
spawn()
@@ -317,7 +317,7 @@
P.failchance = 0//So it has no fail chance when teleporting.
spawn_marauder.Remove(P.target)
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
if(M.id_tag == ident_tag)
spawn()
@@ -330,7 +330,7 @@
M.drive()
sleep(50)
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.z != src.z) continue
if(M.id_tag == ident_tag)
spawn()
+1 -1
View File
@@ -109,7 +109,7 @@
D.safe = 1
else
for(var/obj/machinery/door/poddoor/M in world)
for(var/obj/machinery/door/poddoor/M in airlocks)
if(M.id_tag == src.id)
if(M.density)
spawn( 0 )
+1 -1
View File
@@ -980,7 +980,7 @@ About the new airlock wires panel:
wires = new(src)
if(src.closeOtherId != null)
spawn (5)
for(var/obj/machinery/door/airlock/A in world)
for(var/obj/machinery/door/airlock/A in airlocks)
if(A.closeOtherId == src.closeOtherId && A != src)
src.closeOther = A
break
-105
View File
@@ -1,105 +0,0 @@
/obj/machinery/drying_rack
name = "drying rack"
desc = "A large rack with a heater built into the base. Used for drying things out."
icon = 'icons/obj/hydroponics.dmi'
icon_state = "drying_rack"
layer = 2.9
density = 1
anchored = 1
use_power = 1
idle_power_usage = 5
active_power_usage = 50
var/list/accepted = list()
var/running = 0
var/volume = 100
/obj/machinery/drying_rack/New()
..()
flags |= NOREACT
create_reagents(volume)
accepted = list(/obj/item/weapon/reagent_containers/food/snacks/grown/coffee_arabica,
/obj/item/weapon/reagent_containers/food/snacks/grown/coffee_robusta,
/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco,
/obj/item/weapon/reagent_containers/food/snacks/grown/tobacco_space,
/obj/item/weapon/reagent_containers/food/snacks/grown/tea_aspera,
/obj/item/weapon/reagent_containers/food/snacks/grown/tea_astra,
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiavulgaris,
/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus,
/obj/item/weapon/reagent_containers/food/snacks/meat,
/obj/item/weapon/reagent_containers/food/snacks/grown/grapes,
/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes)
/obj/machinery/drying_rack/attackby(var/obj/item/W as obj, var/mob/user as mob, params)
if(is_type_in_list(W,accepted))
if(!running)
if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/meat))
user.unEquip(W)
del(W)
to_chat(user, "You add the meat to the drying rack.")
src.running = 1
use_power = 2
icon_state = "drying_rack_on"
sleep(60)
icon_state = "drying_rack"
new /obj/item/weapon/reagent_containers/food/snacks/sosjerky(src.loc)
use_power = 1
src.running = 0
return
if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown/grapes))
user.unEquip(W)
del(W)
to_chat(user, "You add the grapes to the drying rack.")
src.running = 1
use_power = 2
icon_state = "drying_rack_on"
sleep(60)
icon_state = "drying_rack"
new /obj/item/weapon/reagent_containers/food/snacks/no_raisin(src.loc)
use_power = 1
src.running = 0
return
if(istype(W,/obj/item/weapon/reagent_containers/food/snacks/grown/greengrapes))
user.unEquip(W)
del(W)
to_chat(user, "You add the green grapes to the drying rack.")
src.running = 1
use_power = 2
icon_state = "drying_rack_on"
sleep(60)
icon_state = "drying_rack"
new /obj/item/weapon/reagent_containers/food/snacks/no_raisin(src.loc)
use_power = 1
src.running = 0
return
else
if(W:dry == 0)
var/J = W.type
var/obj/item/weapon/reagent_containers/food/snacks/grown/B = W
B.reagents.trans_to(src, B.reagents.total_volume)
to_chat(user, "You add the [W] to the drying rack.")
user.unEquip(W)
del(W)
src.running = 1
use_power = 2
icon_state = "drying_rack_on"
sleep(60)
icon_state = "drying_rack"
var/obj/item/weapon/reagent_containers/food/snacks/grown/D = new J(src.loc)
to_chat(user, "\blue You finish drying the [D]")
D.icon_state = "[D.icon_state]_dry"
D.dry = 1
D.reagents.remove_any(50)
src.reagents.trans_to(D, src.reagents.total_volume)
use_power = 1
src.running = 0
return
else
to_chat(user, "\red That has already been dried!")
else
to_chat(user, "\red Please wait until the last item has dried.")
else
to_chat(user, "\red You cannot add that to the drying rack.")
+7 -1
View File
@@ -19,6 +19,12 @@
src.cell = new(src)
..()
/obj/machinery/floodlight/Destroy()
if(cell)
qdel(cell)
cell = null
return ..()
/obj/machinery/floodlight/proc/updateicon()
icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]"
@@ -31,7 +37,7 @@
set_light(0)
src.visible_message("<span class='warning'>[src] shuts down due to lack of power!</span>")
return
/obj/machinery/floodlight/attack_ai(mob/user as mob)
return
+6
View File
@@ -19,6 +19,12 @@
update_icon()
return
/obj/machinery/space_heater/Destroy()
if(cell)
qdel(cell)
cell = null
return ..()
/obj/machinery/space_heater/update_icon()
overlays.Cut()
icon_state = "sheater[on]"
@@ -61,36 +61,12 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
if(long_range_link == 0 && machine.long_range_link == 0)
continue
// If we're sending a copy, be sure to create the copy for EACH machine and paste the data
var/datum/signal/copy = new
var/datum/signal/copy
if(copysig)
copy = new
copy.transmission_method = 2
copy.frequency = signal.frequency
// Copy the main data contents! Workaround for some nasty bug where the actual array memory is copied and not its contents.
copy.data = list(
"mob" = signal.data["mob"],
"mobtype" = signal.data["mobtype"],
"realname" = signal.data["realname"],
"name" = signal.data["name"],
"job" = signal.data["job"],
"key" = signal.data["key"],
"vmessage" = signal.data["vmessage"],
"vname" = signal.data["vname"],
"vmask" = signal.data["vmask"],
"compression" = signal.data["compression"],
"message" = signal.data["message"],
"connection" = signal.data["connection"],
"radio" = signal.data["radio"],
"slow" = signal.data["slow"],
"traffic" = signal.data["traffic"],
"type" = signal.data["type"],
"server" = signal.data["server"],
"reject" = signal.data["reject"],
"level" = signal.data["level"],
"verb" = signal.data["verb"],
"language" = signal.data["language"]
)
copy.data = signal.data.Copy()
// Keep the "original" signal constant
if(!signal.data["original"])
@@ -98,15 +74,11 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
else
copy.data["original"] = signal.data["original"]
else
qdel(copy)
send_count++
if(machine.is_freq_listening(signal))
machine.traffic++
if(copysig && copy)
if(copysig)
machine.receive_information(copy, src)
else
machine.receive_information(signal, src)
-127
View File
@@ -1,127 +0,0 @@
/*
/obj/effect/biomass
icon = 'icons/obj/biomass.dmi'
icon_state = "stage1"
opacity = 0
density = 0
anchored = 1
layer = 20 //DEBUG
plane = HUD_PLANE //DEBUG
var/health = 10
var/stage = 1
var/obj/effect/rift/originalRift = null //the originating rift of that biomass
var/maxDistance = 15 //the maximum length of a thread
var/newSpreadDistance = 10 //the length of a thread at which new ones are created
var/curDistance = 1 //the current length of a thread
var/continueChance = 3 //weighed chance of continuing in the same direction. turning left or right has 1 weight both
var/spreadDelay = 1 //will change to something bigger later, but right now I want it to spread as fast as possible for testing
/obj/effect/rift
icon = 'icons/obj/biomass.dmi'
icon_state = "rift"
var/list/obj/effect/biomass/linkedBiomass = list() //all the biomass patches that have spread from it
var/newicon = 1 //DEBUG
/obj/effect/rift/New()
set background = 1
..()
for(var/turf/T in orange(1,src))
if(!IsValidBiomassLoc(T))
continue
var/obj/effect/biomass/starting = new /obj/effect/biomass(T)
starting.dir = get_dir(src,starting)
starting.originalRift = src
linkedBiomass += starting
spawn(1) //DEBUG
starting.icon_state = "[newicon]"
/obj/effect/rift/Del()
for(var/obj/effect/biomass/biomass in linkedBiomass)
del(biomass)
..()
/obj/effect/biomass/New()
set background = 1
..()
if(!IsValidBiomassLoc(loc,src))
del(src)
return
spawn(1) //so that the dir and stuff can be set by the source first
if(curDistance >= maxDistance)
return
switch(dir)
if(NORTHWEST)
dir = NORTH
if(NORTHEAST)
dir = EAST
if(SOUTHWEST)
dir = WEST
if(SOUTHEAST)
dir = SOUTH
sleep(spreadDelay)
Spread()
/obj/effect/biomass/proc/Spread(var/direction = dir)
set background = 1
var/possibleDirsInt = 0
for(var/newDirection in cardinal)
if(newDirection == turn(direction,180)) //can't go backwards
continue
var/turf/T = get_step(loc,newDirection)
if(!IsValidBiomassLoc(T,src))
continue
possibleDirsInt |= newDirection
var/list/possibleDirs = list()
if(possibleDirsInt & direction)
for(var/i=0 , i<continueChance , i++)
possibleDirs += direction
if(possibleDirsInt & turn(direction,90))
possibleDirs += turn(direction,90)
if(possibleDirsInt & turn(direction,-90))
possibleDirs += turn(direction,-90)
if(!possibleDirs.len)
return
direction = pick(possibleDirs)
var/obj/effect/biomass/newBiomass = new /obj/effect/biomass(get_step(src,direction))
newBiomass.curDistance = curDistance + 1
newBiomass.maxDistance = maxDistance
newBiomass.dir = direction
newBiomass.originalRift = originalRift
newBiomass.icon_state = "[originalRift.newicon]" //DEBUG
originalRift.linkedBiomass += newBiomass
if(!(curDistance%newSpreadDistance))
var/obj/effect/rift/newrift = new /obj/effect/rift(loc)
if(originalRift.newicon <= 3)
newrift.newicon = originalRift.newicon + 1
// NewSpread()
/obj/effect/biomass/proc/NewSpread(maxDistance = 15)
set background = 1
for(var/turf/T in orange(1,src))
if(!IsValidBiomassLoc(T,src))
continue
var/obj/effect/biomass/starting = new /obj/effect/biomass(T)
starting.dir = get_dir(src,starting)
starting.maxDistance = maxDistance
/proc/IsValidBiomassLoc(turf/location,obj/effect/biomass/source = null)
set background = 1
for(var/obj/effect/biomass/biomass in location)
if(biomass != source)
return 0
if(istype(location,/turf/space))
return 0
if(location.density)
return 0
return 1
*/
+6
View File
@@ -18,6 +18,12 @@
ID = new /obj/item/weapon/card/id
ID.access = get_region_accesses(region_access)
/obj/item/weapon/door_remote/Destroy()
if(ID)
qdel(ID)
ID = null
return ..()
/obj/item/weapon/door_remote/attack_self(mob/user)
switch(mode)
if(WAND_OPEN)
@@ -11,7 +11,6 @@
w_class = 2 //Increased to 2, because diodes are w_class 2. Conservation of matter.
origin_tech = "combat=1"
origin_tech = "magnets=2"
var/turf/pointer_loc
var/energy = 5
var/max_energy = 5
var/effectchance = 33
@@ -35,6 +34,12 @@
if(!pointer_icon_state)
pointer_icon_state = pick("red_laser","green_laser","blue_laser","purple_laser")
/obj/item/device/laser_pointer/Destroy()
if(diode)
qdel(diode)
diode = null
return ..()
/obj/item/device/laser_pointer/upgraded/New()
..()
diode = new /obj/item/weapon/stock_parts/micro_laser/ultra
+7 -3
View File
@@ -24,9 +24,13 @@
overlays += "pai-off"
/obj/item/device/paicard/Destroy()
//Will stop people throwing friend pAIs into the singularity so they can respawn
if(!isnull(pai))
pai.death(0)
if(pai)
pai.ghostize()
qdel(pai)
pai = null
if(radio)
qdel(radio)
radio = null
return ..()
/obj/item/device/paicard/attack_self(mob/user)
@@ -20,6 +20,12 @@
mytape = new /obj/item/device/tape/random(src)
update_icon()
/obj/item/device/taperecorder/Destroy()
if(mytape)
qdel(mytape)
mytape = null
return ..()
/obj/item/device/taperecorder/examine(mob/user)
if(..(user, 1))
to_chat(user, "The wire panel is [open_panel ? "opened" : "closed"].")
@@ -283,7 +289,8 @@
timestamp.Cut()
/obj/item/device/tape/proc/ruin()
overlays += "ribbonoverlay"
if(!ruined)
overlays += "ribbonoverlay"
ruined = 1
@@ -11,6 +11,18 @@
var/toggle = 1
origin_tech = "materials=1;engineering=1"
/obj/item/device/transfer_valve/Destroy()
if(tank_one)
qdel(tank_one)
tank_one = null
if(tank_two)
qdel(tank_two)
tank_two = null
if(attached_device)
qdel(attached_device)
attached_device = null
return ..()
/obj/item/device/transfer_valve/proc/process_activation(var/obj/item/device/D)
/obj/item/device/transfer_valve/IsAssemblyHolder()
+6
View File
@@ -11,6 +11,12 @@
var/state
var/datum/gas_mixture/air_contents = null
/obj/item/latexballon/Destroy()
if(air_contents)
qdel(air_contents)
air_contents = null
return ..()
/obj/item/latexballon/proc/blow(obj/item/weapon/tank/tank, mob/user)
if(icon_state == "latexballon_bursted")
return
@@ -21,16 +21,16 @@
new/obj/item/stack/sheet/glass(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
del(src)
qdel(src)
if(istype(O,/obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
M.amount--
if(M.amount <= 0)
user.unEquip(src, 1)
del(M)
qdel(M)
amount--
new/obj/item/stack/tile/light(user.loc)
if(amount <= 0)
user.unEquip(src, 1)
del(src)
qdel(src)
+6 -5
View File
@@ -23,7 +23,8 @@
/obj/item/stack/Destroy()
if(usr && usr.machine == src)
usr << browse(null, "window=stack")
return ..()
..()
return QDEL_HINT_HARDDEL_NOW // because qdel'd stacks act strange for cyborgs
/obj/item/stack/examine(mob/user)
if(..(user, 1))
@@ -111,7 +112,7 @@
if(href_list["make"])
if(amount < 1)
del(src) //Never should happen
qdel(src) //Never should happen
var/list/recipes_list = recipes
if(href_list["sublist"])
@@ -160,7 +161,7 @@
var/oldsrc = src
src = null //dont kill proc after del()
usr.unEquip(oldsrc, 1)
del(oldsrc) // Not qdel, because qdel'd stacks act strange for cyborgs
qdel(oldsrc)
if(istype(O, /obj/item))
usr.put_in_hands(O)
@@ -168,7 +169,7 @@
//BubbleWrap - so newly formed boxes are empty
if(istype(O, /obj/item/weapon/storage))
for(var/obj/item/I in O)
del(I)
qdel(I)
//BubbleWrap END
if(src && usr.machine == src) //do not reopen closed window
@@ -184,7 +185,7 @@
if(usr)
usr.unEquip(src, 1)
spawn()
del(src) // Not qdel, because qdel'd stacks act strange for cyborgs
qdel(src)
update_icon()
return 1
@@ -16,6 +16,14 @@
var/list/loadedItems = list() //The items loaded into the cannon that will be fired out
var/pressureSetting = 1 //How powerful the cannon is - higher pressure = more gas but more powerful throws
/obj/item/weapon/pneumatic_cannon/Destroy()
if(tank)
qdel(tank)
tank = null
for(var/obj/item/I in loadedItems)
qdel(I)
loadedItems.Cut()
return ..()
/obj/item/weapon/pneumatic_cannon/examine(mob/user)
..()
@@ -23,6 +23,12 @@
update_icon()
return
/obj/item/weapon/melee/baton/Destroy()
if(bcell)
qdel(bcell)
bcell = null
return ..()
/obj/item/weapon/melee/baton/CheckParts(list/parts_list)
..()
bcell = locate(/obj/item/weapon/stock_parts/cell) in contents
@@ -35,6 +35,7 @@
/obj/item/weapon/tank/Destroy()
if(air_contents)
qdel(air_contents)
air_contents = null
processing_objects.Remove(src)
@@ -6,6 +6,7 @@
icon_opened = "coffin_open"
burn_state = FLAMMABLE
burntime = 20
material_drop = /obj/item/stack/sheet/wood
/obj/structure/closet/coffin/update_icon()
if(!opened)
@@ -18,4 +19,5 @@
icon_state = "sarc"
icon_closed = "sarc"
icon_opened = "sarc_open"
sound = 'sound/effects/stonedoor_openclose.ogg'
sound = 'sound/effects/stonedoor_openclose.ogg'
material_drop = /obj/item/stack/sheet/mineral/sandstone
@@ -117,12 +117,12 @@
/obj/structure/closet/secure_closet/atmos_personal
name = "technician's locker"
req_access = list(access_atmospherics)
icon_state = "secureeng1"
icon_closed = "secureeng"
icon_locked = "secureeng1"
icon_opened = "secureengopen"
icon_broken = "secureengbroken"
icon_off = "secureengoff"
icon_state = "secureatm1"
icon_closed = "secureatm"
icon_locked = "secureatm1"
icon_opened = "secureatmopen"
icon_broken = "secureatmbroken"
icon_off = "secureatmoff"
New()
@@ -341,6 +341,7 @@
new /obj/item/clothing/accessory/holster/armpit(src)
new /obj/item/clothing/glasses/sunglasses/yeah(src)
new /obj/item/device/flashlight/seclite(src)
new /obj/item/clothing/accessory/black(src)
/obj/structure/closet/secure_closet/detective/update_icon()
if(broken)
@@ -168,8 +168,8 @@
/obj/structure/closet/wardrobe/atmospherics_yellow
name = "atmospherics wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
icon_state = "atmostech"
icon_closed = "atmostech"
/obj/structure/closet/wardrobe/atmospherics_yellow/New()
..()
@@ -193,8 +193,8 @@
/obj/structure/closet/wardrobe/engineering_yellow
name = "engineering wardrobe"
icon_state = "yellow"
icon_closed = "yellow"
icon_state = "engineer"
icon_closed = "engineer"
/obj/structure/closet/wardrobe/engineering_yellow/New()
..()
-2
View File
@@ -39,8 +39,6 @@ var/list/ricochet = list('sound/weapons/effects/ric1.ogg', 'sound/weapons/effect
if(T && T.z == turf_source.z)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, S)
var/const/FALLOFF_SOUNDS = 0.5
/mob/proc/playsound_local(var/turf/turf_source, soundin, vol as num, vary, frequency, falloff, is_global, sound/S)
if(!src.client || ear_deaf > 0)
return
-2
View File
@@ -152,8 +152,6 @@ var/list/admin_verbs_debug = list(
/client/proc/toggledebuglogs,
/client/proc/qdel_toggle,
/client/proc/gc_dump_hdl,
/client/proc/gc_toggle_profiling,
/client/proc/gc_show_del_report,
/client/proc/debugNatureMapGenerator,
/client/proc/check_bomb_impacts,
/client/proc/test_movable_UI,
+1 -1
View File
@@ -613,7 +613,7 @@
var/obj/effect/buildmode_line/L2 = new(holder, P, M, "[M.name] to [P.name]") // Yes, reversed one so that you can see it from both sides.
L2.color = L.color
link_lines += L2
for(var/obj/machinery/door/poddoor/P in world)
for(var/obj/machinery/door/poddoor/P in airlocks)
if(P.id_tag == M.id)
var/obj/effect/buildmode_line/L = new(holder, M, P, "[M.name] to [P.name]")
L.color = M.normaldoorcontrol ? "#993333" : "#339933"
+5 -1
View File
@@ -24,6 +24,10 @@ var/list/admin_datums = list()
rights = initial_rights
admin_datums[ckey] = src
/datum/admins/Destroy()
..()
return QDEL_HINT_HARDDEL_NOW
/datum/admins/proc/associate(client/C)
if(istype(C))
owner = C
@@ -85,7 +89,7 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself.
admin_datums -= ckey
if(holder)
holder.disassociate()
del(holder)
qdel(holder)
return 1
//This proc checks whether subject has at least ONE of the rights specified in rights_required.
+3 -3
View File
@@ -2562,7 +2562,7 @@
if("eagles")//SCRAW
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","EgL")
for(var/obj/machinery/door/airlock/W in world)
for(var/obj/machinery/door/airlock/W in airlocks)
if(is_station_level(W.z) && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison))
W.req_access = list()
message_admins("[key_name_admin(usr)] activated Egalitarian Station mode")
@@ -2755,12 +2755,12 @@
dat += "No-one has done anything this round!"
usr << browse(dat, "window=admin_log")
if("maint_access_brig")
for(var/obj/machinery/door/airlock/maintenance/M in world)
for(var/obj/machinery/door/airlock/maintenance/M in airlocks)
if(access_maint_tunnels in M.req_access)
M.req_access = list(access_brig)
message_admins("[key_name_admin(usr)] made all maint doors brig access-only.")
if("maint_access_engiebrig")
for(var/obj/machinery/door/airlock/maintenance/M in world)
for(var/obj/machinery/door/airlock/maintenance/M in airlocks)
if(access_maint_tunnels in M.req_access)
M.req_access = list()
M.req_one_access = list(access_brig,access_engine)
+1 -1
View File
@@ -89,7 +89,7 @@
if("delete")
for(var/datum/d in objs)
del(d)
qdel(d)
if("select")
var/text = ""
+1 -1
View File
@@ -736,7 +736,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
var/obj/item/weapon/storage/backpack/backpack = new(M)
for(var/obj/item/I in backpack)
del(I)
qdel(I)
M.equip_to_slot_or_del(backpack, slot_back)
M.equip_to_slot_or_del(new /obj/item/weapon/mop(M), slot_r_hand)
var/obj/item/weapon/reagent_containers/glass/bucket/bucket = new(M)
+4 -28
View File
@@ -146,40 +146,16 @@ client/proc/one_click_antag()
return 0
/datum/admins/proc/makeWizard()
var/list/mob/candidates = list()
var/mob/theghost = null
var/time_passed = world.time
for(var/mob/G in respawnable_list)
if(istype(G) && G.client && (ROLE_WIZARD in G.client.prefs.be_special))
if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate"))
if(player_old_enough_antag(G.client,ROLE_WIZARD))
spawn(0)
switch(G.timed_alert("Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","No",300,"Yes","No"))//alert(G, "Do you wish to be considered for the position of Space Wizard Foundation 'diplomat'?","Please answer in 30 seconds!","Yes","No"))
if("Yes")
if((world.time-time_passed)>300)//If more than 30 game seconds passed.
return
candidates += G
if("No")
return
else
return
sleep(300)
var/list/candidates = pollCandidates("Do you wish to be considered for the position of a Wizard Foundation 'diplomat'?", "wizard")
if(candidates.len)
candidates = shuffle(candidates)
for(var/mob/dead/observer/i in candidates)
if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard
var/mob/dead/observer/selected = pick(candidates)
candidates -= selected
theghost = i
break
if(theghost)
var/mob/living/carbon/human/new_character=makeBody(theghost)
var/mob/living/carbon/human/new_character = makeBody(selected)
new_character.mind.make_Wizard()
return 1
return 0
-1
View File
@@ -57,7 +57,6 @@
if( findtext(href,"<script",1,0) )
log_to_dd("Attempted use of scripts within a topic call, by [src]")
message_admins("Attempted use of scripts within a topic call, by [src]")
//del(usr)
return
//Admin PM
+1 -1
View File
@@ -23,7 +23,7 @@
/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob, params)
..()
pockets.attackby(W, user, params)
return pockets.attackby(W, user, params)
/obj/item/clothing/suit/storage/emp_act(severity)
pockets.emp_act(severity)
-363
View File
@@ -1,363 +0,0 @@
/obj/machinery/computer3/cloning
default_prog = /datum/file/program/cloning
spawn_parts = list(/obj/item/part/computer/storage/hdd,/obj/item/part/computer/storage/removable,/obj/item/part/computer/networking/prox)
/datum/file/program/cloning
name = "cloning console"
desc = "Connects to cloning machinery through the local network."
active_state = "dna_old"
req_access = list(access_heads) //Only used for record deletion right now.
var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning.
var/obj/machinery/clonepod/pod1 = null //Linked cloning pod.
var/temp = "Inactive"
var/scantemp_ckey
var/scantemp = "Ready to Scan"
var/menu = 1 //Which menu screen to display
var/list/records = list()
var/datum/data/record/active_record = null
var/loading = 0 // Nice loading text
var/has_disk = 0
proc/updatemodules()
if(!computer.net) return
if(scanner && pod1)
if(!computer.net.verify_machine(scanner))
scanner = null
if(!computer.net.verify_machine(pod1))
pod1 = null
if(!scanner || !pod1)
var/list/nearby = computer.net.get_machines()
scanner = locate(/obj/machinery/dna_scannernew) in nearby
pod1 = locate(/obj/machinery/clonepod) in nearby
if(pod1)
pod1.connected = src // Some variable the pod needs
proc/ScanningMenu()
if(isnull(scanner))
return "<font class='bad'>ERROR: No Scanner detected!</font><br>"
var/dat = "<h3>Scanner Functions</h3>"
dat += "<div class='statusDisplay'>"
if(!scanner.occupant)
dat += "Scanner Unoccupied"
else if(loading)
dat += "[scanner.occupant] => Scanning..."
else
if(scanner.occupant.ckey != scantemp_ckey)
scantemp = "Ready to Scan"
scantemp_ckey = scanner.occupant.ckey
dat += "[scanner.occupant] => [scantemp]"
dat += "</div>"
if(scanner.occupant)
dat += topic_link(src,"scan","Start Scan") + "<br>"
if(scanner.locked)
dat += topic_link(src,"lock","Unlock Scanner")
else
dat += topic_link(src,"lock","Lock Scanner")
else
dat += fake_link("Start Scan")
// Footer
dat += "<h3>Database Functions</h3>"
if(records.len > 0)
dat += topic_link(src,"menu=2","View Records ([records.len])") + "<br>"
else
dat += fake_link("View Records (0)")
if(has_disk)
dat += topic_link(src,"eject_disk","Eject Disk") + "<br>"
return dat
proc/RecordsList()
var/dat = "<h3>Current records</h3>"
to_chat(dat += topic_link(src,"menu=1",", Back") + "<br><br>")
for(var/datum/data/record/R in records)
dat += "<h4>[R.fields["name"]]</h4>Scan ID [R.fields["id"]] " + topic_link(src,"view_rec=\ref[R]","View Record")
return dat
proc/ShowRecord()
var/dat = "<h3>Selected Record</h3>"
to_chat(dat += topic_link(src,"menu=2",", Back") + "<br><br>")
if(!active_record)
dat += "<font class='bad'>Record not found.</font>"
else
dat += "<h4>[active_record.fields["name"]]</h4>"
dat += "Scan ID [active_record.fields["id"]] [topic_link(src,"clone","Clone")]<br>"
var/obj/item/weapon/implant/health/H = locate(active_record.fields["imp"])
if((H) && (istype(H)))
dat += "<b>Health Implant Data:</b><br />[H.sensehealth()]<br><br />"
else
dat += "<font class='bad'>Unable to locate Health Implant.</font><br /><br />"
dat += "<b>Unique Identifier:</b><br /><span class='highlight'>[active_record.fields["UI"]]</span><br>"
dat += "<b>Structural Enzymes:</b><br /><span class='highlight'>[active_record.fields["SE"]]</span><br>"
if(has_disk)
dat += "<div class='block'>"
dat += "<h4>Inserted Disk</h4>"
dat += "<b>Contents:</b> "
if(computer.floppy.inserted.files.len == 0)
dat += "<i>Empty</i>"
else
for(var/datum/file/data/genome/G in computer.floppy.inserted.files)
dat += topic_link(src,"loadfile=\ref[G]","[G.name]") + "<br>"
dat += "<br /><br /><b>Save to Disk:<b><br />"
dat += topic_link(src,"save_disk=ue","Unique Identifier + Unique Enzymes") + "<br />"
dat += topic_link(src,"save_disk=ui","Unique Identifier") + "<br />"
dat += topic_link(src,"save_disk=se","Structural Enzymes") + "<br />"
dat += "</div>"
dat += "<font size=1>[topic_link(src,"del_rec","Delete Record")]</font>"
return dat
proc/ConfirmDelete()
var/dat = "[temp]<br>"
dat += "<h3>Confirm Record Deletion</h3>"
dat += "<b>[topic_link(src,"del_rec","Scan card to confirm")]</b><br>"
dat += "<b>[topic_link(src,"menu=3","Cancel")]</b>"
return dat
interact()
if(!interactable())
return
updatemodules()
var/dat = ""
dat += topic_link(src,"refresh","Refresh")
dat += "<h3>Cloning Pod Status</h3>"
dat += "<div class='statusDisplay'>[temp]&nbsp;</div>"
has_disk = (computer.floppy && computer.floppy.inserted)
if(!active_record && menu > 2)
menu = 2
switch(menu)
if(1)
dat += ScanningMenu()
if(2)
dat += RecordsList()
if(3)
dat += ShowRecord()
if(4)
dat = ConfirmDelete() // not (+=), this is how it used to be, just putting it in a function
if(!popup)
popup = new(usr, "\ref[computer]", "Cloning System Control")
popup.set_title_image(usr.browse_rsc_icon(overlay.icon, overlay.icon_state))
popup.set_content(dat)
popup.open()
return
Topic(var/href, var/list/href_list)
if(loading || !interactable())
return
if(href_list["menu"])
menu = text2num(href_list["menu"])
else if(("scan" in href_list) && !isnull(scanner))
scantemp = ""
loading = 1
computer.updateUsrDialog()
spawn(20)
scan_mob(scanner.occupant)
loading = 0
computer.updateUsrDialog()
//No locking an open scanner.
else if(("lock" in href_list) && !isnull(scanner))
if((!scanner.locked) && (scanner.occupant))
scanner.locked = 1
else
scanner.locked = 0
else if("view_rec" in href_list)
active_record = locate(href_list["view_rec"])
if(istype(active_record,/datum/data/record))
if( !active_record.fields["ckey"] || active_record.fields["ckey"] == "" )
del(active_record)
temp = "<font class='bad'>Record Corrupt</font>"
else
menu = 3
else
active_record = null
temp = "Record missing."
else if("del_rec" in href_list)
if((!active_record) || (menu < 3))
return
if(menu == 3) //If we are viewing a record, confirm deletion
temp = "Delete record?"
menu = 4
else if(menu == 4)
var/obj/item/weapon/card/id/C = usr.get_active_hand()
if(istype(C)||istype(C, /obj/item/device/pda))
if(check_access(C))
temp = "[active_record.fields["name"]] => Record deleted."
records.Remove(active_record)
del(active_record)
menu = 2
else
temp = "<font class='bad'>Access Denied.</font>"
else if("eject_disk" in href_list)
if(computer.floppy)
computer.floppy.eject_disk()
else if("loadfile" in href_list)
var/datum/file/data/genome/G = locate(href_list["loadfile"]) in computer.floppy.files
if(!istype(G))
temp = "<font class='bad'>Load error.</font>"
computer.updateUsrDialog()
return
switch(G.type)
if(/datum/file/data/genome/UI)
active_record.fields["UI"] = G.content
if(/datum/file/data/genome/UE)
active_record.fields["name"] = G.real_name
if(/datum/file/data/genome/SE)
active_record.fields["SE"] = G.content
if(/datum/file/data/genome/cloning)
active_record = G:record
else if("savefile" in href_list)
if(!active_record || !computer || !computer.floppy)
temp = "<font class='bad'>Save error.</font>"
computer.updateUsrDialog()
return
var/rval = 0
switch(href_list["save_disk"])
if("ui")
var/datum/file/data/genome/UI/ui = new
ui.content = active_record.fields["UI"]
ui.real_name = active_record.fields["name"]
rval = computer.floppy.addfile(ui)
if("ue")
var/datum/file/data/genome/UI/UE/ui = new
ui.content = active_record.fields["UI"]
ui.real_name = active_record.fields["name"]
rval = computer.floppy.addfile(ui)
if("se")
var/datum/file/data/genome/SE/se = new
se.content = active_record.fields["SE"]
se.real_name = active_record.fields["name"]
rval = computer.floppy.addfile(se)
if("clone")
var/datum/file/data/genome/cloning/c = new
c.record = active_record
c.real_name = active_record.fields["name"]
rval = computer.floppy.addfile(c)
if(!rval)
temp = "<font class='bad'>Disk write error.</font>"
else if("refresh" in href_list)
computer.updateUsrDialog()
else if("clone" in href_list)
//Look for that player! They better be dead!
if(active_record)
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
if(!pod1)
temp = "<font class='bad'>No Clonepod detected.</font>"
else if(pod1.occupant)
temp = "<font class='bad'>Clonepod is currently occupied.</font>"
else if(pod1.mess)
temp = "<font class='bad'>Clonepod malfunction.</font>"
else if(!config.revival_cloning)
temp = "<font class='bad'>Unable to initiate cloning cycle.</font>"
else if(pod1.growclone(active_record.fields["ckey"], active_record.fields["name"], active_record.fields["UI"], active_record.fields["SE"], active_record.fields["mind"], active_record.fields["mrace"]))
temp = "[active_record.fields["name"]] => <font class='good'>Cloning cycle in progress...</font>"
records.Remove(active_record)
del(active_record)
menu = 1
else
temp = "[active_record.fields["name"]] => <font class='bad'>Initialisation failure.</font>"
else
temp = "<font class='bad'>Data corruption.</font>"
computer.add_fingerprint(usr)
computer.updateUsrDialog()
return
proc/scan_mob(mob/living/carbon/human/subject as mob)
if((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna))
scantemp = "<font class='bad'>Unable to locate valid genetic data.</font>"
return
if(!getbrain(subject))
scantemp = "<font class='bad'>No signs of intelligence detected.</font>"
return
if(subject.suiciding == 1)
scantemp = "<font class='bad'>Subject's brain is not responding to scanning stimuli.</font>"
return
if((!subject.ckey) || (!subject.client))
scantemp = "<font class='bad'>Mental interface failure.</font>"
return
if(NOCLONE in subject.mutations)
scantemp = "<font class='bad'>Mental interface failure.</font>"
return
if(!isnull(find_record(subject.ckey)))
scantemp = "<font class='average'>Subject already in database.</font>"
return
subject.dna.check_integrity()
var/datum/data/record/R = new /datum/data/record( )
if(subject.dna)
R.fields["mrace"] = subject.dna.mutantrace
R.fields["UI"] = subject.dna.uni_identity
R.fields["SE"] = subject.dna.struc_enzymes
else
R.fields["mrace"] = null
R.fields["UI"] = null
R.fields["SE"] = null
R.fields["ckey"] = subject.ckey
R.fields["name"] = subject.real_name
R.fields["id"] = copytext(md5(subject.real_name), 2, 6)
//Add an implant if needed
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)
if(isnull(imp))
imp = new /obj/item/weapon/implant/health(subject)
imp.implanted = subject
R.fields["imp"] = "\ref[imp]"
//Update it if needed
else
R.fields["imp"] = "\ref[imp]"
if(!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
R.fields["mind"] = "\ref[subject.mind]"
records += R
scantemp = "Subject successfully scanned."
//Find a specific record by key.
proc/find_record(var/find_key)
for(var/datum/data/record/R in records)
if(R.fields["ckey"] == find_key)
return R
return null
@@ -1,242 +0,0 @@
//Config stuff
#define PRISON_MOVETIME 150 //Time to station is milliseconds.
#define PRISON_STATION_AREATYPE "/area/shuttle/prison/station" //Type of the prison shuttle area for station
#define PRISON_DOCK_AREATYPE "/area/shuttle/prison/prison" //Type of the prison shuttle area for dock
var/prison_shuttle_moving_to_station = 0
var/prison_shuttle_moving_to_prison = 0
var/prison_shuttle_at_station = 0
var/prison_shuttle_can_send = 1
var/prison_shuttle_time = 0
var/prison_shuttle_timeleft = 0
/obj/machinery/computer3/prison_shuttle
name = "Prison Shuttle Console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
req_access = list(access_security)
circuit = "/obj/item/part/board/circuit/prison_shuttle"
var/temp = null
var/hacked = 0
var/allowedtocall = 0
var/prison_break = 0
attackby(I as obj, user as mob, params)
return src.attack_hand(user)
attack_ai(var/mob/user as mob)
return src.attack_hand(user)
attack_paw(var/mob/user as mob)
return src.attack_hand(user)
attackby(I as obj, user as mob, params)
if(istype(I, /obj/item/tool/screwdriver))
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(do_after(user, 20, target = src))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/part/board/circuit/prison_shuttle/M = new /obj/item/part/board/circuit/prison_shuttle( A )
for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.anchored = 1
if(src.stat & BROKEN)
to_chat(user, "\blue The broken glass falls out.")
new /obj/item/trash/shard( src.loc )
A.state = 3
A.icon_state = "3"
else
to_chat(user, "\blue You disconnect the monitor.")
A.state = 4
A.icon_state = "4"
del(src)
else if(istype(I,/obj/item/card/emag) && (!hacked))
hacked = 1
to_chat(user, "\blue You disable the lock.")
else
return src.attack_hand(user)
attack_hand(var/mob/user as mob)
if(!src.allowed(user) && (!hacked))
to_chat(user, "\red Access Denied.")
return
if(prison_break)
to_chat(user, "\red Unable to locate shuttle.")
return
if(..())
return
user.set_machine(src)
post_signal("prison")
var/dat
if(src.temp)
dat = src.temp
else
dat += {"<b>Location:</b> [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]<BR>
[prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "\n*Shuttle already called*<BR>\n<BR>":prison_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Send to Dock</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Send to Station</A><BR>\n<BR>"]
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
//user << browse(dat, "window=computer;size=575x450")
//onclose(user, "computer")
var/datum/browser/popup = new(user, "computer", name, 575, 450)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
Topic(href, href_list)
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["sendtodock"])
if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
post_signal("prison")
to_chat(usr, "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.")
src.temp += "Shuttle sent.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
src.updateUsrDialog()
prison_shuttle_moving_to_prison = 1
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
spawn(0)
prison_process()
else if(href_list["sendtostation"])
if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
post_signal("prison")
to_chat(usr, "\blue The prison shuttle has been called and will arrive in [(PRISON_MOVETIME/10)] seconds.")
src.temp += "Shuttle sent.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
src.updateUsrDialog()
prison_shuttle_moving_to_station = 1
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
spawn(0)
prison_process()
else if(href_list["mainmenu"])
src.temp = null
src.add_fingerprint(usr)
src.updateUsrDialog()
return
proc/prison_can_move()
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return 0
else return 1
/*
proc/prison_break()
switch(prison_break)
if(0)
if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return
prison_shuttle_moving_to_prison = 1
prison_shuttle_at_station = prison_shuttle_at_station
if(!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station)
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
spawn(0)
prison_process()
prison_break = 1
if(1)
prison_break = 0
*/
proc/post_signal(var/command)
var/datum/radio_frequency/frequency = radio_controller.return_frequency(1311)
if(!frequency) return
var/datum/signal/status_signal = new
status_signal.source = src
status_signal.transmission_method = 1
status_signal.data["command"] = command
frequency.post_signal(src, status_signal)
return
proc/prison_process()
while(prison_shuttle_time - world.timeofday > 0)
var/ticksleft = prison_shuttle_time - world.timeofday
if(ticksleft > 1e5)
prison_shuttle_time = world.timeofday + 10 // midnight rollover
prison_shuttle_timeleft = (ticksleft / 10)
sleep(5)
prison_shuttle_moving_to_station = 0
prison_shuttle_moving_to_prison = 0
switch(prison_shuttle_at_station)
if(0)
prison_shuttle_at_station = 1
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
var/area/start_location = locate(/area/shuttle/prison/prison)
var/area/end_location = locate(/area/shuttle/prison/station)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
if(1)
prison_shuttle_at_station = 0
if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
var/area/start_location = locate(/area/shuttle/prison/station)
var/area/end_location = locate(/area/shuttle/prison/prison)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
return
@@ -1,76 +0,0 @@
/*
This may not migrate to C3. It's basically a machine in the guise of a computer;
there is nothing interactive about it.
*/
/obj/machinery/computer3/shuttle
name = "Shuttle"
desc = "For shuttle control."
icon_state = "shuttle"
var/auth_need = 3.0
var/list/authorized = list( )
attackby(var/obj/item/card/W as obj, var/mob/user as mob, params)
if(stat & (BROKEN|NOPOWER)) return
if((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
if(istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda))
if(istype(W, /obj/item/device/pda))
var/obj/item/device/pda/pda = W
W = pda.id
if(!W:access) //no access
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
return
var/list/cardaccess = W:access
if(!istype(cardaccess, /list) || !cardaccess.len) //no access
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
return
if(!(access_heads in W:access)) //doesn't have this access
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
return 0
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
if(emergency_shuttle.location != 1 && user.get_active_hand() != W)
return 0
switch(choice)
if("Authorize")
src.authorized -= W:registered_name
src.authorized += W:registered_name
if(src.auth_need - src.authorized.len > 0)
message_admins("[key_name_admin(user)] has authorized early shuttle launch")
log_game("[user.ckey] has authorized early shuttle launch")
to_chat(world, text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len))
else
message_admins("[key_name_admin(user)] has launched the shuttle")
log_game("[user.ckey] has launched the shuttle early")
to_chat(world, "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>")
emergency_shuttle.online = 1
emergency_shuttle.settimeleft(10)
//src.authorized = null
del(src.authorized)
src.authorized = list( )
if("Repeal")
src.authorized -= W:registered_name
to_chat(world, text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len))
if("Abort")
to_chat(world, "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>")
src.authorized.len = 0
src.authorized = list( )
return
emag_act(user as mob)
if(!emagged)
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
if(!emagged && emergency_shuttle.location == 1)
switch(choice)
if("Launch")
to_chat(world, "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>")
emergency_shuttle.settimeleft( 10 )
emagged = 1
if("Cancel")
return
@@ -1,246 +0,0 @@
//Config stuff
#define SPECOPS_MOVETIME 600 //Time to station is milliseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
#define SPECOPS_STATION_AREATYPE "/area/shuttle/specops/station" //Type of the spec ops shuttle area for station
#define SPECOPS_DOCK_AREATYPE "/area/shuttle/specops/centcom" //Type of the spec ops shuttle area for dock
var/specops_shuttle_moving_to_station = 0
var/specops_shuttle_moving_to_centcom = 0
var/specops_shuttle_at_station = 0
var/specops_shuttle_can_send = 1
var/specops_shuttle_time = 0
var/specops_shuttle_timeleft = 0
/obj/machinery/computer3/specops_shuttle
name = "Spec. Ops. Shuttle Console"
icon = 'icons/obj/computer.dmi'
icon_state = "shuttle"
req_access = list(access_cent_specops)
var/temp = null
var/hacked = 0
var/allowedtocall = 0
/proc/specops_process()
var/area/centcom/control/cent_com = locate()//To find announcer. This area should exist for this proc to work.
var/area/centcom/specops/special_ops = locate()//Where is the specops area located?
var/mob/living/silicon/decoy/announcer = locate() in cent_com//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
var/message = "THE SPECIAL OPERATIONS SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
if(announcer)
announcer.say(message)
message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
announcer.say(message)
while(specops_shuttle_time - world.timeofday > 0)
var/ticksleft = specops_shuttle_time - world.timeofday
if(ticksleft > 1e5)
specops_shuttle_time = world.timeofday + 10 // midnight rollover
specops_shuttle_timeleft = (ticksleft / 10)
//All this does is announce the time before launch.
if(announcer)
var/rounded_time_left = round(specops_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
if(rounded_time_left==0)
message = "ALERT: TAKEOFF"
announcer.say(message)
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
sleep(5)
specops_shuttle_moving_to_station = 0
specops_shuttle_moving_to_centcom = 0
specops_shuttle_at_station = 1
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
if(!specops_can_move())
to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
return
//Begin Marauder launchpad.
spawn(0)//So it parallel processes it.
for(var/obj/machinery/door/poddoor/M in special_ops)
switch(M.id)
if("ASSAULT0")
spawn(10)//1 second delay between each.
M.open()
if("ASSAULT1")
spawn(20)
M.open()
if("ASSAULT2")
spawn(30)
M.open()
if("ASSAULT3")
spawn(40)
M.open()
sleep(10)
var/spawn_marauder[] = new()
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "Marauder Entry")
spawn_marauder.Add(L)
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "Marauder Exit")
var/obj/effect/portal/P = new(L.loc)
P.invisibility = 101//So it is not seen by anyone.
P.failchance = 0//So it has no fail chance when teleporting.
P.target = pick(spawn_marauder)//Where the marauder will arrive.
spawn_marauder.Remove(P.target)
sleep(10)
for(var/obj/machinery/mass_driver/M in special_ops)
switch(M.id)
if("ASSAULT0")
spawn(10)
M.drive()
if("ASSAULT1")
spawn(20)
M.drive()
if("ASSAULT2")
spawn(30)
M.drive()
if("ASSAULT3")
spawn(40)
M.drive()
sleep(50)//Doors remain open for 5 seconds.
for(var/obj/machinery/door/poddoor/M in special_ops)
switch(M.id)//Doors close at the same time.
if("ASSAULT0")
spawn(0)
M.close()
if("ASSAULT1")
spawn(0)
M.close()
if("ASSAULT2")
spawn(0)
M.close()
if("ASSAULT3")
spawn(0)
M.close()
special_ops.readyreset()//Reset firealarm after the team launched.
//End Marauder launchpad.
var/area/start_location = locate(/area/shuttle/specops/centcom)
var/area/end_location = locate(/area/shuttle/specops/station)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs += T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
for(var/turf/T in get_area_turfs(end_location) )
var/mob/M = locate(/mob) in T
to_chat(M, "\red You have arrived to [station_name]. Commence operation!")
/proc/specops_can_move()
if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return 0
else return 1
/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params)
return attack_hand(user)
/obj/machinery/computer3/specops_shuttle/attack_ai(var/mob/user as mob)
return attack_hand(user)
/obj/machinery/computer3/specops_shuttle/attack_paw(var/mob/user as mob)
return attack_hand(user)
/obj/machinery/computer3/specops_shuttle/attackby(I as obj, user as mob, params)
if(istype(I,/obj/item/card/emag))
to_chat(user, "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals.")
else
return attack_hand(user)
/obj/machinery/computer3/specops_shuttle/attack_hand(var/mob/user as mob)
if(!allowed(user))
to_chat(user, "\red Access Denied.")
return
if(sent_strike_team == 0)
to_chat(usr, "\red The strike team has not yet deployed.")
return
if(..())
return
user.set_machine(src)
var/dat
if(temp)
dat = temp
else
dat += {"
<b>Location:</b> [specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "Departing for [station_name] in ([specops_shuttle_timeleft] seconds.)":specops_shuttle_at_station ? "Station":"Dock"]<BR>
[specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom ? "\n*The Special Ops. shuttle is already leaving.*<BR>\n<BR>":specops_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
//user << browse(dat, "window=computer;size=575x450")
//onclose(user, "computer")
var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer3/specops_shuttle/Topic(href, href_list)
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["sendtodock"])
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
to_chat(usr, "\blue Central Command will not allow the Special Operations shuttle to return.")
return
else if(href_list["sendtostation"])
if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
if(!specops_can_move())
to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
return
to_chat(usr, "\blue The Special Operations shuttle will arrive on [station_name] in [(SPECOPS_MOVETIME/10)] seconds.")
temp += "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
updateUsrDialog()
var/area/centcom/specops/special_ops = locate()
if(special_ops)
special_ops.readyalert()//Trigger alarm for the spec ops area.
specops_shuttle_moving_to_station = 1
specops_shuttle_time = world.timeofday + SPECOPS_MOVETIME
spawn(0)
specops_process()
else if(href_list["mainmenu"])
temp = null
add_fingerprint(usr)
updateUsrDialog()
return
@@ -1,103 +0,0 @@
#define SYNDICATE_SHUTTLE_MOVE_TIME 240
#define SYNDICATE_SHUTTLE_COOLDOWN 200
/obj/machinery/computer3/syndicate_station
name = "syndicate shuttle terminal"
icon = 'icons/obj/computer.dmi'
icon_state = "syndishuttle"
req_access = list(access_syndicate)
var/area/curr_location
var/moving = 0
var/lastMove = 0
/obj/machinery/computer3/syndicate_station/New()
curr_location= locate(/area/syndicate_station/start)
/obj/machinery/computer3/syndicate_station/proc/syndicate_move_to(area/destination as area)
if(moving) return
if(lastMove + SYNDICATE_SHUTTLE_COOLDOWN > world.time) return
var/area/dest_location = locate(destination)
if(curr_location == dest_location) return
moving = 1
lastMove = world.time
if(curr_location.z != dest_location.z)
var/area/transit_location = locate(/area/syndicate_station/transit)
curr_location.move_contents_to(transit_location)
curr_location = transit_location
sleep(SYNDICATE_SHUTTLE_MOVE_TIME)
curr_location.move_contents_to(dest_location)
curr_location = dest_location
moving = 0
return 1
/obj/machinery/computer3/syndicate_station/attackby(obj/item/I as obj, mob/user as mob, params)
return attack_hand(user)
/obj/machinery/computer3/syndicate_station/attack_ai(mob/user as mob)
return attack_hand(user)
/obj/machinery/computer3/syndicate_station/attack_paw(mob/user as mob)
return attack_hand(user)
/obj/machinery/computer3/syndicate_station/attack_hand(mob/user as mob)
if(!allowed(user))
to_chat(user, "\red Access Denied")
return
user.set_machine(src)
var/dat = {"Location: [curr_location]<br>
Ready to move[max(lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time, 0) ? " in [max(round((lastMove + SYNDICATE_SHUTTLE_COOLDOWN - world.time) * 0.1), 0)] seconds" : ": now"]<br>
<a href='?src=\ref[src];syndicate=1'>Syndicate Space</a><br>
<a href='?src=\ref[src];station_nw=1'>North West of SS13</a> |
<a href='?src=\ref[src];station_n=1'>North of SS13</a> |
<a href='?src=\ref[src];station_ne=1'>North East of SS13</a><br>
<a href='?src=\ref[src];station_sw=1'>South West of SS13</a> |
<a href='?src=\ref[src];station_s=1'>South of SS13</a> |
<a href='?src=\ref[src];station_se=1'>South East of SS13</a><br>
<a href='?src=\ref[src];mining=1'>North East of the Mining Asteroid</a><br>
<a href='?src=\ref[user];mach_close=computer'>Close</a>"}
user << browse(dat, "window=computer;size=575x450")
onclose(user, "computer")
return
/obj/machinery/computer3/syndicate_station/Topic(href, href_list)
if(!isliving(usr)) return
var/mob/living/user = usr
if(in_range(src, user) || istype(user, /mob/living/silicon))
user.set_machine(src)
if(href_list["syndicate"])
syndicate_move_to(/area/syndicate_station/start)
else if(href_list["station_nw"])
syndicate_move_to(/area/syndicate_station/northwest)
else if(href_list["station_n"])
syndicate_move_to(/area/syndicate_station/north)
else if(href_list["station_ne"])
syndicate_move_to(/area/syndicate_station/northeast)
else if(href_list["station_sw"])
syndicate_move_to(/area/syndicate_station/southwest)
else if(href_list["station_s"])
syndicate_move_to(/area/syndicate_station/south)
else if(href_list["station_se"])
syndicate_move_to(/area/syndicate_station/southeast)
// else if(href_list["commssat"])
// syndicate_move_to(/area/syndicate_station/commssat)
else if(href_list["mining"])
syndicate_move_to(/area/syndicate_station/mining)
add_fingerprint(usr)
updateUsrDialog()
return
/obj/machinery/computer3/syndicate_station/bullet_act(var/obj/item/projectile/Proj)
visible_message("[Proj] ricochets off [src]!") //let's not let them fuck themselves in the rear
@@ -1,259 +0,0 @@
//Config stuff
#define SYNDICATE_ELITE_MOVETIME 600 //Time to station is deciseconds. 60 seconds, enough time for everyone to be on the shuttle before it leaves.
#define SYNDICATE_ELITE_STATION_AREATYPE "/area/shuttle/syndicate_elite/station" //Type of the spec ops shuttle area for station
#define SYNDICATE_ELITE_DOCK_AREATYPE "/area/shuttle/syndicate_elite/mothership" //Type of the spec ops shuttle area for dock
var/syndicate_elite_shuttle_moving_to_station = 0
var/syndicate_elite_shuttle_moving_to_mothership = 0
var/syndicate_elite_shuttle_at_station = 0
var/syndicate_elite_shuttle_can_send = 1
var/syndicate_elite_shuttle_time = 0
var/syndicate_elite_shuttle_timeleft = 0
/obj/machinery/computer3/syndicate_elite_shuttle
name = "Elite Syndicate Squad Shuttle Console"
icon = 'icons/obj/computer.dmi'
icon_state = "syndishuttle"
req_access = list(access_cent_specops)
var/temp = null
var/hacked = 0
var/allowedtocall = 0
/proc/syndicate_elite_process()
var/area/syndicate_mothership/control/syndicate_ship = locate()//To find announcer. This area should exist for this proc to work.
var/area/syndicate_mothership/elite_squad/elite_squad = locate()//Where is the specops area located?
var/mob/living/silicon/decoy/announcer = locate() in syndicate_ship//We need a fake AI to announce some stuff below. Otherwise it will be wonky.
var/message_tracker[] = list(0,1,2,3,5,10,30,45)//Create a a list with potential time values.
var/message = "THE SYNDICATE ELITE SHUTTLE IS PREPARING FOR LAUNCH"//Initial message shown.
if(announcer)
announcer.say(message)
// message = "ARMORED SQUAD TAKE YOUR POSITION ON GRAVITY LAUNCH PAD"
// announcer.say(message)
while(syndicate_elite_shuttle_time - world.timeofday > 0)
var/ticksleft = syndicate_elite_shuttle_time - world.timeofday
if(ticksleft > 1e5)
syndicate_elite_shuttle_time = world.timeofday // midnight rollover
syndicate_elite_shuttle_timeleft = (ticksleft / 10)
//All this does is announce the time before launch.
if(announcer)
var/rounded_time_left = round(syndicate_elite_shuttle_timeleft)//Round time so that it will report only once, not in fractions.
if(rounded_time_left in message_tracker)//If that time is in the list for message announce.
message = "ALERT: [rounded_time_left] SECOND[(rounded_time_left!=1)?"S":""] REMAIN"
if(rounded_time_left==0)
message = "ALERT: TAKEOFF"
announcer.say(message)
message_tracker -= rounded_time_left//Remove the number from the list so it won't be called again next cycle.
//Should call all the numbers but lag could mean some issues. Oh well. Not much I can do about that.
sleep(5)
syndicate_elite_shuttle_moving_to_station = 0
syndicate_elite_shuttle_moving_to_mothership = 0
syndicate_elite_shuttle_at_station = 1
if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
if(!syndicate_elite_can_move())
to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
return
sleep(600)
/*
//Begin Marauder launchpad.
spawn(0)//So it parallel processes it.
for(var/obj/machinery/door/poddoor/M in elite_squad)
switch(M.id)
if("ASSAULT0")
spawn(10)//1 second delay between each.
M.open()
if("ASSAULT1")
spawn(20)
M.open()
if("ASSAULT2")
spawn(30)
M.open()
if("ASSAULT3")
spawn(40)
M.open()
sleep(10)
var/spawn_marauder[] = new()
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "Marauder Entry")
spawn_marauder.Add(L)
for(var/obj/effect/landmark/L in landmarks_list)
if(L.name == "Marauder Exit")
var/obj/effect/portal/P = new(L.loc)
P.invisibility = 101//So it is not seen by anyone.
P.failchance = 0//So it has no fail chance when teleporting.
P.target = pick(spawn_marauder)//Where the marauder will arrive.
spawn_marauder.Remove(P.target)
sleep(10)
for(var/obj/machinery/mass_driver/M in elite_squad)
switch(M.id)
if("ASSAULT0")
spawn(10)
M.drive()
if("ASSAULT1")
spawn(20)
M.drive()
if("ASSAULT2")
spawn(30)
M.drive()
if("ASSAULT3")
spawn(40)
M.drive()
sleep(50)//Doors remain open for 5 seconds.
for(var/obj/machinery/door/poddoor/M in elite_squad)
switch(M.id)//Doors close at the same time.
if("ASSAULT0")
spawn(0)
M.close()
if("ASSAULT1")
spawn(0)
M.close()
if("ASSAULT2")
spawn(0)
M.close()
if("ASSAULT3")
spawn(0)
M.close()
*/
elite_squad.readyreset()//Reset firealarm after the team launched.
//End Marauder launchpad.
/*
var/obj/explosionmarker = locate("Syndicate Breach Area")
if(explosionmarker)
var/turf/simulated/T = explosionmarker.loc
if(T)
explosion(T,4,6,8,10,0)
sleep(40)
// proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1)
*/
var/area/start_location = locate(/area/shuttle/syndicate_elite/mothership)
var/area/end_location = locate(/area/shuttle/syndicate_elite/station)
var/list/dstturfs = list()
var/throwy = world.maxy
for(var/turf/T in end_location)
dstturfs = T
if(T.y < throwy)
throwy = T.y
// hey you, get out of the way!
for(var/turf/T in dstturfs)
// find the turf to move things to
var/turf/D = locate(T.x, throwy - 1, 1)
//var/turf/E = get_step(D, SOUTH)
for(var/atom/movable/AM as mob|obj in T)
AM.Move(D)
if(istype(T, /turf/simulated))
del(T)
start_location.move_contents_to(end_location)
for(var/turf/T in get_area_turfs(end_location) )
var/mob/M = locate(/mob) in T
to_chat(M, "\red You have arrived to [station_name]. Commence operation!")
/proc/syndicate_elite_can_move()
if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return 0
else return 1
/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params)
return attack_hand(user)
/obj/machinery/computer3/syndicate_elite_shuttle/attack_ai(var/mob/user as mob)
return attack_hand(user)
/obj/machinery/computer3/syndicate_elite_shuttle/attack_paw(var/mob/user as mob)
return attack_hand(user)
/obj/machinery/computer3/syndicate_elite_shuttle/attackby(I as obj, user as mob, params)
if(istype(I,/obj/item/card/emag))
to_chat(user, "\blue The electronic systems in this console are far too advanced for your primitive hacking peripherals.")
else
return attack_hand(user)
/obj/machinery/computer3/syndicate_elite_shuttle/attack_hand(var/mob/user as mob)
if(!allowed(user))
to_chat(user, "\red Access Denied.")
return
// if(sent_syndicate_strike_team == 0)
// to_chat(usr, "\red The strike team has not yet deployed.")
// return
if(..())
return
user.set_machine(src)
var/dat
if(temp)
dat = temp
else
dat = {"<b>Location:</b> [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]<BR>
[syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "\n*The Syndicate Elite shuttle is already leaving.*<BR>\n<BR>":syndicate_elite_shuttle_at_station ? "\n<A href='?src=\ref[src];sendtodock=1'>Shuttle Offline</A><BR>\n<BR>":"\n<A href='?src=\ref[src];sendtostation=1'>Depart to [station_name]</A><BR>\n<BR>"]
\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"}
//user << browse(dat, "window=computer;size=575x450")
//onclose(user, "computer")
var/datum/browser/popup = new(user, "computer", "Special Operations Shuttle", 575, 450)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
return
/obj/machinery/computer3/syndicate_elite_shuttle/Topic(href, href_list)
if(..())
return
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["sendtodock"])
if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
to_chat(usr, "\blue The Syndicate will not allow the Elite Squad shuttle to return.")
return
else if(href_list["sendtostation"])
if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
if(!specops_can_move())
to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
return
to_chat(usr, "\blue The Syndicate Elite shuttle will arrive on [station_name] in [(SYNDICATE_ELITE_MOVETIME/10)] seconds.")
temp = "Shuttle departing.<BR><BR><A href='?src=\ref[src];mainmenu=1'>OK</A>"
updateUsrDialog()
var/area/syndicate_mothership/elite_squad/elite_squad = locate()
if(elite_squad)
elite_squad.readyalert()//Trigger alarm for the spec ops area.
syndicate_elite_shuttle_moving_to_station = 1
syndicate_elite_shuttle_time = world.timeofday + SYNDICATE_ELITE_MOVETIME
spawn(0)
syndicate_elite_process()
else if(href_list["mainmenu"])
temp = null
add_fingerprint(usr)
updateUsrDialog()
return
+1 -1
View File
@@ -14,7 +14,7 @@
evil_tree.icon_living = evil_tree.icon_state
evil_tree.icon_dead = evil_tree.icon_state
evil_tree.icon_gib = evil_tree.icon_state
del(xmas)
qdel(xmas)
/obj/item/weapon/toy/xmas_cracker
name = "xmas cracker"
+2 -3
View File
@@ -16,7 +16,7 @@
if(is_station_level(T.z))
pick_turfs += T
for(var/i = 1, i <= number_of_wormholes, i++)
for(var/i in 1 to number_of_wormholes)
var/turf/T = pick(pick_turfs)
wormholes += new /obj/effect/portal/wormhole(T, null, null, -1)
@@ -30,9 +30,8 @@
if(T) O.loc = T
/datum/event/wormholes/end()
portals.Remove(wormholes)
for(var/obj/effect/portal/wormhole/O in wormholes)
O.loc = null
qdel(O)
wormholes.Cut()
+2 -3
View File
@@ -43,9 +43,8 @@ that can't be. There are two main procs involved in this process:
/datum/proc/Destroy()
This is, effectively, a replacement for Del() (with some exceptions) which is also responsible for nulling out
references to or on the object it is called on. Like Del, the Destroy proc will always be called, even if the object
is getting destroyed by a direct del instead of qdel; in that case, isnull(gcDestroyed) will be true, and some
references can safely be ignored.
references to or on the object it is called on. Unlike Del, the Destroy proc will only be called by qdel; generally,
this should only happen to datums that are no longer referenced by anything, which shouldn't be an issue.
The exceptions where Destroy cannot replace Del are for the same non-datum types mentioned under qdel, above. Those
should use a Del proc for any necessary cleanup, as a Destroy proc on them will not automatically get called.
@@ -92,12 +92,13 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
if(isnull(D))
return
if(isnull(garbageCollector))
if(!istype(D)) // A non-datum was passed into qdel - just delete it outright.
// warning("qdel() passed object of type [D.type]. qdel() can only handle /datum/ types.")
del(D)
return
if(!istype(D)) // A non-datum was passed into qdel - just delete it outright.
// warning("qdel() passed object of type [D.type]. qdel() can only handle /datum/ types.")
if(isnull(garbageCollector))
D.Destroy()
del(D)
return
@@ -162,22 +163,5 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
tag = null
return QDEL_HINT_QUEUE // Garbage Collect everything.
// If something gets deleted directly, make sure its Destroy proc is still called
/datum/Del()
if(isnull(gcDestroyed)) // Not GC'd
try
Destroy()
catch(var/exception/e)
if(istype(e))
log_runtime(e, src, "Caught by Del() destroying [type]")
else
gcwarning("Del() caught runtime destroying [type]: [e]")
if(del_profiling)
delete_profile(src)
else
if(del_profiling)
delete_profile(src)
return ..()
/proc/gcwarning(msg)
log_to_dd("## GC WARNING: [msg]")
@@ -13,28 +13,6 @@
log_admin("[key_name(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].")
message_admins("\blue [key_name_admin(usr)] turned qdel [garbageCollector.del_everything ? "off" : "on"].", 1)
/client/proc/gc_toggle_profiling()
set name = "(GC) Toggle Profiling"
set desc = "Toggle profiling of deletion methods"
set category = "Debug"
if(!check_rights(R_DEBUG))
return
del_profiling = !del_profiling
log_admin("[key_name(usr)] turned deletion profiling [del_profiling ? "on" : "off"].")
message_admins("\blue [key_name_admin(usr)] turned deletion profiling [del_profiling ? "on" : "off"].", 1)
/client/proc/gc_show_del_report()
set name = "(GC) Show Del Report"
set desc = "Show report of deletions seen while profiling"
set category = "Debug"
if(!check_rights(R_DEBUG))
return
delete_profiler_report()
/client/proc/gc_dump_hdl()
set name = "(GC) Hard Del List"
set desc = "List types that are hard del()'d by the GC."
@@ -51,77 +29,6 @@
for(var/A in gc_hard_del_types)
to_chat(usr, "[A]")
// Profiling stuff
var/global/del_profiling = 0
var/global/list/dels_profiled = list()
var/global/list/gdels_profiled = list()
var/global/list/ghdels_profiled = list()
/proc/delete_profile(var/datum/D)
if(!ticker || (ticker.current_state < 3)) return
var/code = 0
var/type = D.type
if(isnull(D.gcDestroyed))
code = 0
else if(D.hard_deleted == -1)
code = 0 // A non-queued hard deletion is counted as a straight deletion
else if(D.hard_deleted)
code = 1
else
code = 2
switch(code)
if(0) // Directly deleted (skipped the GC queue entirely)
if(!("[type]" in dels_profiled))
dels_profiled["[type]"] = 0
dels_profiled["[type]"] += 1
if(1) // Hard-deleted by the GC
if(!("[type]" in ghdels_profiled))
ghdels_profiled["[type]"] = 0
ghdels_profiled["[type]"] += 1
if(2) // qdel'd and garbage collected by BYOND
if(!("[type]" in gdels_profiled))
gdels_profiled["[type]"] = 0
gdels_profiled["[type]"] += 1
/proc/delete_profiler_report()
var/dat = "<html><head><title>Deletion Profiler Report</title></head>"
if(dels_profiled.len + gdels_profiled.len + ghdels_profiled.len)
dat += "<a href='#DD'>Direct Deletions</a><br />"
dat += "<a href='#SD'>GC Soft Deletions</a><br />"
dat += "<a href='#HD'>GC Hard Deletions</a><br />"
dat += delete_profiler_sortedlist(dels_profiled, "Direct Deletions", "DD")
dat += delete_profiler_sortedlist(gdels_profiled, "GC Soft Deletions", "SD")
dat += delete_profiler_sortedlist(ghdels_profiled, "GC Hard Deletions", "HD")
else
dat += "(No deletions profiled; listing types that have been hard-deleted by GC)<br />"
dat += "<table border='1'><tr><th>GC Hard Deletion Types</th></tr>"
for(var/A in gc_hard_del_types)
dat += "<tr><td>[A]</td></tr>"
dat += "</table>"
usr << browse(dat, "window=delete_profiler_report;size=600x480")
/proc/delete_profiler_sortedlist(var/list/L, var/header, var/anchorid)
L = L.Copy()
// Yes, this is a terrible sort, but I'm too lazy to find a good one
var/v,i,j,s
for(i = 1 to L.len-1)
s=i
v = L[L[i]]
for(j = i + 1 to L.len)
if(L[L[j]] > v)
s = j
v = L[L[j]]
L.Swap(i,s)
var/dat = "<table border='1' id='[anchorid]'><tr><th colspan='2'>[header]</th></tr>"
for(var/t in L)
dat +="<tr><td>[L[t]]</td><td>[t]</td></tr>"
dat += "</table>"
return dat
#ifdef TESTING
/client/var/running_find_references
/datum/var/running_find_references
+5 -1
View File
@@ -37,11 +37,15 @@ var/global/datum/controller/plants/plant_controller // Set in New().
/datum/controller/plants/New()
if(plant_controller && plant_controller != src)
log_debug("Rebuilding plant controller.")
del(plant_controller)
qdel(plant_controller)
plant_controller = src
setup()
process()
/datum/controller/plants/Destroy()
..()
return QDEL_HINT_HARDDEL_NOW
// Predefined/roundstart varieties use a string key to make it
// easier to grab the new variety when mutating. Post-roundstart
// and mutant varieties use their uid converted to a string instead.
@@ -669,9 +669,6 @@ var/list/robot_verbs_default = list(
C.r_arm = new/obj/item/robot_parts/r_arm(C)
C.updateicon()
new/obj/item/robot_parts/chest(loc)
// This doesn't work. Don't use it.
//src.Destroy()
// del() because it's infrequent and mobs act weird in qdel.
qdel(src)
else
// Okay we're not removing the cell or an MMI, but maybe something else?
@@ -1,179 +0,0 @@
//separate dm since hydro is getting bloated already
/obj/effect/supermatter_crystal
name = "supermatter growth"
anchored = 1
opacity = 0
density = 0
icon = 'icons/obj/lighting.dmi'
icon_state = "supermatter_crystalf"
layer = 2.1
light_color = "#8A8A00"
var/endurance = 100
var/delay = 1200
var/floor = 0
var/spreadChance = 10
var/spreadIntoAdjacentChance = 10
var/lastTick = 0
var/spreaded = 1
var/deleted = 0
/obj/effect/supermatter_crystal/single
spreadChance = 0
/obj/effect/supermatter_crystal/New()
..()
light_color = "#8A8A00"
dir = CalcDir()
if(!floor)
switch(dir) //offset to make it be on the wall rather than on the floor
if(NORTH)
pixel_y = 32
if(SOUTH)
pixel_y = -32
if(EAST)
pixel_x = 32
if(WEST)
pixel_x = -32
icon_state = "supermatter_crystal"
else
if( prob( 10 )) // Only 10% of all floor crystals survive, so there's not a forest of 'em
icon_state = "supermatter_crystalf"
name = "supermatter crystal"
density = 1
else
deleted = 1
del( src )
processing_objects += src
set_light(3)
lastTick = world.timeofday
/obj/effect/supermatter_crystal/Del()
if( !deleted )
visible_message("\red <B>\The [src] shatters!</B>")
new /obj/item/weapon/shard/supermatter( src.loc )
processing_objects -= src
..()
/obj/effect/supermatter_crystal/process()
if(!spreaded)
return
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
lastTick = world.timeofday
spreaded = 0
for(var/mob/living/l in range( src, 2 ))
var/rads = 5
l.apply_effect(rads, IRRADIATE)
for(var/i=1,i<=3,i++)
if(prob(spreadChance))
var/list/possibleLocs = list()
var/spreadsIntoAdjacent = 0
if(prob(spreadIntoAdjacentChance))
spreadsIntoAdjacent = 1
for(var/turf/simulated/floor/floor in view(3,src))
if(spreadsIntoAdjacent || !locate(/obj/effect/supermatter_crystal) in view(1,floor))
possibleLocs += floor
if(!possibleLocs.len)
break
var/turf/newLoc = pick(possibleLocs)
var/crystalCount = 0 //hacky
var/placeCount = 1
for(var/obj/effect/supermatter_crystal/shroom in newLoc)
crystalCount++
for(var/wallDir in cardinal)
var/turf/isWall = get_step(newLoc,wallDir)
if(isWall.density)
placeCount++
if(crystalCount >= placeCount)
continue
var/obj/effect/supermatter_crystal/child = new /obj/effect/supermatter_crystal(newLoc)
if( child )
child.delay = delay
child.endurance = endurance
spreaded++
/obj/effect/supermatter_crystal/proc/CalcDir(turf/location = loc)
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
return wallDir
/*
var/direction = 16
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
direction |= wallDir
for(var/obj/effect/supermatter_crystal/crystal in location)
if(crystal == src)
continue
if(crystal.floor) //special
direction &= ~16
else
direction &= ~crystal.dir
var/list/dirList = list()
for(var/i=1,i<=16,i <<= 1)
if(direction & i)
dirList += i
if(dirList.len)
var/newDir = pick(dirList)
if(newDir == 16)
floor = 1
newDir = 1
return newDir
*/
floor = 1
return 1
/obj/effect/supermatter_crystal/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
endurance -= W.force
CheckEndurance()
/obj/effect/supermatter_crystal/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
return
if(2.0)
if(prob(50))
qdel(src)
return
if(3.0)
if(prob(5))
qdel(src)
return
else
return
/obj/effect/supermatter_crystal/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
endurance -= 5
CheckEndurance()
/obj/effect/supermatter_crystal/proc/CheckEndurance()
if(endurance <= 0)
qdel(src)
@@ -85,12 +85,12 @@
move_gamma_ship()
if(security_level < SEC_LEVEL_RED)
for(var/obj/machinery/door/airlock/highsecurity/red/R in world)
for(var/obj/machinery/door/airlock/highsecurity/red/R in airlocks)
if(is_station_level(R.z))
R.locked = 0
R.update_icon()
for(var/obj/machinery/door/airlock/hatch/gamma/H in world)
for(var/obj/machinery/door/airlock/hatch/gamma/H in airlocks)
if(is_station_level(H.z))
H.locked = 0
H.update_icon()
@@ -0,0 +1,4 @@
author: chopchop1614
delete-after: True
changes:
- bugfix: "Fixed the C4 labcoat exploding bug"
Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 KiB

After

Width:  |  Height:  |  Size: 466 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 152 KiB

+2 -2
View File
@@ -36,8 +36,8 @@
<h3>Containers:</h3>
<div class='item'>
{{if data.condi}}
{{:helper.link('Create pill (10u max)', 'arrow-right', {'createpill': 1})}}
{{:helper.link('Create bottle (50u max)', 'arrow-right', {'createpill': 1})}}
{{:helper.link('Create pack (10u max)', 'arrow-right', {'createpill': 1})}}
{{:helper.link('Create bottle (50u max)', 'arrow-right', {'createbottle': 1})}}
{{else}}
<table>
<tr>
-1
View File
@@ -64,7 +64,6 @@
#include "code\__HELPERS\sanitize_values.dm"
#include "code\__HELPERS\text.dm"
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\timed_alerts.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\_DATASTRUCTURES\heap.dm"