Merge remote-tracking branch 'Upstream/master' into TGUIs_Nexties
This commit is contained in:
@@ -259,6 +259,9 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
|
||||
//Hallway
|
||||
|
||||
/area/hallway
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_PUBLIC
|
||||
|
||||
/area/hallway/primary/aft
|
||||
name = "Aft Primary Hallway"
|
||||
icon_state = "hallA"
|
||||
@@ -404,14 +407,17 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
name = "Dormitories"
|
||||
icon_state = "Sleep"
|
||||
safe = TRUE
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/dorms/male
|
||||
name = "Male Dorm"
|
||||
icon_state = "Sleep"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_NONE
|
||||
|
||||
/area/crew_quarters/dorms/female
|
||||
name = "Female Dorm"
|
||||
icon_state = "Sleep"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_NONE
|
||||
|
||||
/area/crew_quarters/rehab_dome
|
||||
name = "Rehabilitation Dome"
|
||||
@@ -448,26 +454,32 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
/area/crew_quarters/locker
|
||||
name = "Locker Room"
|
||||
icon_state = "locker"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/lounge
|
||||
name = "Lounge"
|
||||
icon_state = "yellow"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/fitness
|
||||
name = "Fitness Room"
|
||||
icon_state = "fitness"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/fitness/recreation
|
||||
name = "Recreation Area"
|
||||
icon_state = "fitness"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/cafeteria
|
||||
name = "Cafeteria"
|
||||
icon_state = "cafeteria"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/cafeteria/lunchroom
|
||||
name = "Lunchroom"
|
||||
icon_state = "cafeteria"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/kitchen
|
||||
name = "Kitchen"
|
||||
@@ -480,6 +492,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
/area/crew_quarters/bar
|
||||
name = "Bar"
|
||||
icon_state = "bar"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/crew_quarters/bar/atrium
|
||||
name = "Atrium"
|
||||
@@ -518,6 +531,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
name = "Library"
|
||||
icon_state = "library"
|
||||
flags_1 = NONE
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/library/lounge
|
||||
name = "Library Lounge"
|
||||
@@ -527,6 +541,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
name = "Abandoned Library"
|
||||
icon_state = "library"
|
||||
flags_1 = NONE
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_NONE
|
||||
|
||||
/area/chapel
|
||||
icon_state = "chapel"
|
||||
@@ -534,12 +549,14 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
|
||||
flags_1 = NONE
|
||||
clockwork_warp_allowed = FALSE
|
||||
clockwork_warp_fail = "The consecration here prevents you from warping in."
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_RECREATION
|
||||
|
||||
/area/chapel/main
|
||||
name = "Chapel"
|
||||
|
||||
/area/chapel/main/monastery
|
||||
name = "Monastery"
|
||||
nightshift_public_area = NIGHTSHIFT_AREA_NONE
|
||||
|
||||
/area/chapel/office
|
||||
name = "Chapel Office"
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
var/xenobiology_compatible = FALSE //Can the Xenobio management console transverse this area by default?
|
||||
var/list/canSmoothWithAreas //typecache to limit the areas that atoms in this area can smooth with
|
||||
|
||||
var/nightshift_public_area = NIGHTSHIFT_AREA_NONE //considered a public area for nightshift
|
||||
|
||||
/*Adding a wizard area teleport list because motherfucking lag -- Urist*/
|
||||
/*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/
|
||||
GLOBAL_LIST_EMPTY(teleportlocs)
|
||||
|
||||
@@ -378,3 +378,11 @@
|
||||
/obj/item/circuitboard/computer/apc_control,
|
||||
/obj/item/circuitboard/computer/robotics
|
||||
)
|
||||
|
||||
/obj/effect/spawner/lootdrop/keg
|
||||
name = "random keg spawner"
|
||||
lootcount = 1
|
||||
loot = list(/obj/structure/reagent_dispensers/keg/mead = 5,
|
||||
/obj/structure/reagent_dispensers/keg/aphro = 2,
|
||||
/obj/structure/reagent_dispensers/keg/aphro/strong = 2,
|
||||
/obj/structure/reagent_dispensers/keg/gargle = 1)
|
||||
|
||||
@@ -10,6 +10,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
var/item_state = null
|
||||
var/lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
|
||||
var/righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
var/list/alternate_screams = list() //REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
||||
|
||||
//Dimensions of the icon file used when this item is worn, eg: hats.dmi
|
||||
//eg: 32x32 sprite, 64x64 sprite, etc.
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
/* BALLS - GLORIOUS BALLS
|
||||
//
|
||||
// Includes:-
|
||||
// 1) Tennis balls, lines 10 - 92
|
||||
//
|
||||
//
|
||||
//
|
||||
*/
|
||||
|
||||
/obj/item/toy/tennis
|
||||
name = "tennis ball"
|
||||
desc = "A classical tennis ball. It appears to have faint bite marks scattered all over its surface."
|
||||
icon = 'modular_citadel/icons/obj/balls.dmi'
|
||||
icon_state = "tennis_classic"
|
||||
lefthand_file = 'modular_citadel/icons/mob/inhands/balls_left.dmi'
|
||||
righthand_file = 'modular_citadel/icons/mob/inhands/balls_right.dmi'
|
||||
item_state = "tennis_classic"
|
||||
alternate_worn_icon = 'modular_citadel/icons/mob/mouthball.dmi'
|
||||
slot_flags = ITEM_SLOT_HEAD | ITEM_SLOT_NECK | ITEM_SLOT_EARS //Fluff item, put it wherever you want!
|
||||
throw_range = 14
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
|
||||
/obj/item/toy/tennis/pre_altattackby(atom/A, mob/living/user, params) //checks if it can do right click memes
|
||||
altafterattack(A, user, TRUE, params)
|
||||
return TRUE
|
||||
|
||||
/obj/item/toy/tennis/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters) //does right click memes
|
||||
if(istype(user))
|
||||
user.visible_message("<span class='notice'>[user] waggles [src] at [target].</span>", "<span class='notice'>You waggle [src] at [target].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/toy/tennis/rainbow
|
||||
name = "pseudo-euclidean interdimensional tennis sphere"
|
||||
desc = "A tennis ball from another plane of existance. Really groovy."
|
||||
icon_state = "tennis_rainbow"
|
||||
item_state = "tennis_rainbow"
|
||||
actions_types = list(/datum/action/item_action/squeeze) //Giving the masses easy access to unilimted honks would be annoying
|
||||
|
||||
/obj/item/toy/tennis/rainbow/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/squeak)
|
||||
|
||||
/obj/item/toy/tennis/rainbow/izzy //izzyinbox's donator item
|
||||
name = "Katlin's Ball"
|
||||
desc = "A tennis ball that's seen a good bit of love, being covered in a few black and white hairs and slobber."
|
||||
icon_state = "tennis_izzy"
|
||||
item_state = "tennis_izzy"
|
||||
|
||||
/obj/item/toy/tennis/red //da red wuns go fasta
|
||||
name = "red tennis ball"
|
||||
desc = "A red tennis ball. It goes three times faster!"
|
||||
icon_state = "tennis_red"
|
||||
item_state = "tennis_red"
|
||||
throw_speed = 9
|
||||
|
||||
/obj/item/toy/tennis/yellow //because yellow is hot I guess
|
||||
name = "yellow tennis ball"
|
||||
desc = "A yellow tennis ball. It seems to have a flame-retardant coating."
|
||||
icon_state = "tennis_yellow"
|
||||
item_state = "tennis_yellow"
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
/obj/item/toy/tennis/green //pestilence
|
||||
name = "green tennis ball"
|
||||
desc = "A green tennis ball. It seems to have an impermeable coating."
|
||||
icon_state = "tennis_green"
|
||||
item_state = "tennis_green"
|
||||
permeability_coefficient = 0.9
|
||||
|
||||
/obj/item/toy/tennis/cyan //electric
|
||||
name = "cyan tennis ball"
|
||||
desc = "A cyan tennis ball. It seems to have odd electrical properties."
|
||||
icon_state = "tennis_cyan"
|
||||
item_state = "tennis_cyan"
|
||||
siemens_coefficient = 0.9
|
||||
|
||||
/obj/item/toy/tennis/blue //reliability
|
||||
name = "blue tennis ball"
|
||||
desc = "A blue tennis ball. It seems ever so slightly more robust than normal."
|
||||
icon_state = "tennis_blue"
|
||||
item_state = "tennis_blue"
|
||||
max_integrity = 300
|
||||
|
||||
/obj/item/toy/tennis/purple //because purple dyes have high pH and would neutralize acids I guess
|
||||
name = "purple tennis ball"
|
||||
desc = "A purple tennis ball. It seems to have an acid-resistant coating."
|
||||
icon_state = "tennis_purple"
|
||||
item_state = "tennis_purple"
|
||||
resistance_flags = ACID_PROOF
|
||||
|
||||
/datum/action/item_action/squeeze
|
||||
name = "Squeak!"
|
||||
@@ -0,0 +1,61 @@
|
||||
/obj/item/boombox
|
||||
name = "boombox"
|
||||
desc = "A dusty, gray, bulky, battery-powered, auto-looping stereo cassette player. An ancient relic from prehistoric times on that one planet with humans and stuff. Yeah, that one."
|
||||
icon = 'modular_citadel/icons/obj/boombox.dmi'
|
||||
icon_state = "raiqbawks_off"//PLACEHOLDER UNTIL SOMEONE SPRITES PLAIN NON-FANCY BOOMBOXES
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
force = 3
|
||||
var/baseiconstate = "raiqbawks"
|
||||
var/boomingandboxing = FALSE
|
||||
var/list/availabletrackids
|
||||
|
||||
/obj/item/boombox/attack_self(mob/user)
|
||||
. = ..()
|
||||
if(boomingandboxing)
|
||||
SSjukeboxes.removejukebox(SSjukeboxes.findjukeboxindex(src))
|
||||
boomingandboxing = FALSE
|
||||
to_chat(user, "<span class='notice'>You flip a switch on [src], and the music immediately stops.")
|
||||
update_icon()
|
||||
return
|
||||
if(!availabletrackids || !availabletrackids.len)
|
||||
to_chat(user, "<span class='notice'>[src] flashes as you prod it senselessly. It doesn't have any songs stored on it.</span>")
|
||||
return
|
||||
if(!boomingandboxing)
|
||||
var/list/tracklist = list()
|
||||
for(var/datum/track/S in SSjukeboxes.songs)
|
||||
if(istype(S) && S.song_associated_id in availabletrackids)
|
||||
tracklist[S.song_name] = S
|
||||
var/selected = input(user, "Play song", "Track:") as null|anything in tracklist
|
||||
if(QDELETED(src) || !selected || !istype(tracklist[selected], /datum/track))
|
||||
return
|
||||
var/jukeboxslottotake = SSjukeboxes.addjukebox(src, tracklist[selected])
|
||||
if(jukeboxslottotake)
|
||||
boomingandboxing = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/boombox/Destroy(mob/user)
|
||||
SSjukeboxes.removejukebox(SSjukeboxes.findjukeboxindex(src))
|
||||
. = ..()
|
||||
|
||||
/obj/item/boombox/update_icon()
|
||||
icon_state = "[baseiconstate]_[boomingandboxing ? "on" : "off"]"
|
||||
return
|
||||
|
||||
/obj/item/boombox/raiq
|
||||
name = "Miami Boomer"
|
||||
desc = "A shiny, fashionable boombox filled to the brim with neon lights, synthesizers, gang violence, and broken R keys. A worn-out sticker on the back states \"Includes three kickin' beats!\""
|
||||
icon_state = "raiqbawks_off"
|
||||
baseiconstate = "raiqbawks"
|
||||
availabletrackids = list("hotline.ogg","chiptune.ogg","genesis.ogg")
|
||||
|
||||
/obj/item/boombox/raiq/update_icon()
|
||||
. = ..()
|
||||
if(boomingandboxing)
|
||||
START_PROCESSING(SSobj, src)
|
||||
else
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
set_light(0)
|
||||
|
||||
/obj/item/boombox/raiq/process()
|
||||
set_light(5,0.95,pick("#d87aff","#7a7aff","#89ecff","#b88eff","#ff59ad"))
|
||||
return
|
||||
@@ -144,3 +144,80 @@ Code:
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/electropack/shockcollar
|
||||
name = "shock collar"
|
||||
desc = "A reinforced metal collar. It seems to have some form of wiring near the front. Strange.."
|
||||
icon = 'modular_citadel/icons/obj/clothing/cit_neck.dmi'
|
||||
alternate_worn_icon = 'modular_citadel/icons/mob/citadel/neck.dmi'
|
||||
icon_state = "shockcollar"
|
||||
item_state = "shockcollar"
|
||||
body_parts_covered = NECK
|
||||
slot_flags = ITEM_SLOT_NECK | ITEM_SLOT_DENYPOCKET //no more pocket shockers
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
strip_delay = 60
|
||||
equip_delay_other = 60
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2000)
|
||||
|
||||
var/tagname = null
|
||||
|
||||
/datum/design/electropack/shockcollar
|
||||
name = "Shockcollar"
|
||||
id = "shockcollar"
|
||||
build_type = AUTOLATHE
|
||||
build_path = /obj/item/electropack/shockcollar
|
||||
materials = list(MAT_METAL=5000, MAT_GLASS=2000)
|
||||
category = list("hacked", "Misc")
|
||||
|
||||
/obj/item/electropack/shockcollar/attack_hand(mob/user)
|
||||
if(loc == user && user.get_item_by_slot(SLOT_NECK))
|
||||
to_chat(user, "<span class='warning'>The collar is fastened tight! You'll need help taking this off!</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/electropack/shockcollar/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.data["code"] != code)
|
||||
return
|
||||
|
||||
if(isliving(loc) && on)
|
||||
if(shock_cooldown == TRUE)
|
||||
return
|
||||
shock_cooldown = TRUE
|
||||
addtimer(VARSET_CALLBACK(src, shock_cooldown, FALSE), 100)
|
||||
var/mob/living/L = loc
|
||||
step(L, pick(GLOB.cardinals))
|
||||
|
||||
to_chat(L, "<span class='danger'>You feel a sharp shock from the collar!</span>")
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(3, 1, L)
|
||||
s.start()
|
||||
|
||||
L.Knockdown(100)
|
||||
|
||||
if(master)
|
||||
master.receive_signal()
|
||||
return
|
||||
|
||||
/obj/item/electropack/shockcollar/attackby(obj/item/W, mob/user, params) //moves it here because on_click is being bad
|
||||
if(istype(W, /obj/item/pen))
|
||||
var/t = input(user, "Would you like to change the name on the tag?", "Name your new pet", tagname ? tagname : "Spot") as null|text
|
||||
if(t)
|
||||
tagname = copytext(sanitize(t), 1, MAX_NAME_LEN)
|
||||
name = "[initial(name)] - [tagname]"
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/electropack/shockcollar/ui_interact(mob/user) //on_click calls this
|
||||
var/dat = {"
|
||||
<TT>
|
||||
<B>Frequency/Code</B> for shock collar:<BR>
|
||||
Frequency:
|
||||
[format_frequency(src.frequency)]
|
||||
<A href='byond://?src=[REF(src)];set=freq'>Set</A><BR>
|
||||
Code:
|
||||
[src.code]
|
||||
<A href='byond://?src=[REF(src)];set=code'>Set</A><BR>
|
||||
</TT>"}
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
@@ -92,7 +92,13 @@
|
||||
/obj/item/encryptionkey/heads/hop
|
||||
name = "\proper the head of personnel's encryption key"
|
||||
icon_state = "hop_cypherkey"
|
||||
channels = list(RADIO_CHANNEL_SUPPLY = 1, RADIO_CHANNEL_SERVICE = 1, RADIO_CHANNEL_COMMAND = 1)
|
||||
channels = list(RADIO_CHANNEL_SERVICE = 1, RADIO_CHANNEL_COMMAND = 1)
|
||||
|
||||
/obj/item/encryptionkey/heads/qm
|
||||
name = "\proper the quartermaster's encryption key"
|
||||
desc = "An encryption key for a radio headset. Channels are as follows: :u - supply, :c - command."
|
||||
icon_state = "hop_cypherkey"
|
||||
channels = list(RADIO_CHANNEL_SUPPLY = 1, RADIO_CHANNEL_COMMAND = 1)
|
||||
|
||||
/obj/item/encryptionkey/headset_cargo
|
||||
name = "supply radio encryption key"
|
||||
|
||||
@@ -206,6 +206,12 @@ GLOBAL_LIST_INIT(channel_tokens, list(
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/hop
|
||||
|
||||
/obj/item/radio/headset/heads/qm
|
||||
name = "\proper the quartermaster's headset"
|
||||
desc = "The headset of the king (or queen) of paperwork."
|
||||
icon_state = "com_headset"
|
||||
keyslot = new /obj/item/encryptionkey/heads/qm
|
||||
|
||||
/obj/item/radio/headset/headset_cargo
|
||||
name = "supply radio headset"
|
||||
desc = "A headset used by the QM and his slaves."
|
||||
|
||||
@@ -466,7 +466,7 @@ SLIME SCANNER
|
||||
msg += "<span class='notice'>Subject is not addicted to any reagents.</span>\n"
|
||||
|
||||
var/datum/reagent/impure/fermiTox/F = M.reagents.has_reagent(/datum/reagent/impure/fermiTox)
|
||||
if(istype(F))
|
||||
if(istype(F,/datum/reagent/impure/fermiTox))
|
||||
switch(F.volume)
|
||||
if(5 to 10)
|
||||
msg += "<span class='notice'>Subject contains a low amount of toxic isomers.</span>\n"
|
||||
|
||||
@@ -122,3 +122,6 @@
|
||||
owner.visible_message("<span class='danger'>[attack_text] hits [owner]'s [src], setting it off! What a shot!</span>")
|
||||
prime()
|
||||
return TRUE //It hit the grenade, not them
|
||||
|
||||
/obj/item/proc/grenade_prime_react(obj/item/grenade/nade)
|
||||
return
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
icon_state = "datadisk3"
|
||||
|
||||
|
||||
/obj/item/malf_upgrade/afterattack(mob/living/silicon/ai/AI, mob/user)
|
||||
/obj/item/malf_upgrade/afterattack(mob/living/silicon/ai/AI, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(!istype(AI))
|
||||
return
|
||||
if(AI.malf_picker)
|
||||
@@ -18,7 +20,11 @@
|
||||
to_chat(AI, "<span class='userdanger'>[user] has attempted to upgrade you with combat software that you already possess. You gain 50 points to spend on Malfunction Modules instead.</span>")
|
||||
else
|
||||
to_chat(AI, "<span class='userdanger'>[user] has upgraded you with combat software!</span>")
|
||||
to_chat(AI, "<span class='userdanger'>Your current laws and objectives remain unchanged.</span>") //this unlocks malf powers, but does not give the license to plasma flood
|
||||
AI.add_malf_picker()
|
||||
AI.hack_software = TRUE
|
||||
log_game("[key_name(user)] has upgraded [key_name(AI)] with a [src].")
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] has upgraded [ADMIN_LOOKUPFLW(AI)] with a [src].")
|
||||
to_chat(user, "<span class='notice'>You upgrade [AI]. [src] is consumed in the process.</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -26,12 +32,14 @@
|
||||
//Lipreading
|
||||
/obj/item/surveillance_upgrade
|
||||
name = "surveillance software upgrade"
|
||||
desc = "A software package that will allow an artificial intelligence to 'hear' from its cameras via lip reading."
|
||||
desc = "An illegal software package that will allow an artificial intelligence to 'hear' from its cameras via lip reading and hidden microphones."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "datadisk3"
|
||||
|
||||
/obj/item/surveillance_upgrade/afterattack(mob/living/silicon/ai/AI, mob/user)
|
||||
/obj/item/surveillance_upgrade/afterattack(mob/living/silicon/ai/AI, mob/user, proximity)
|
||||
. = ..()
|
||||
if(!proximity)
|
||||
return
|
||||
if(!istype(AI))
|
||||
return
|
||||
if(AI.eyeobj)
|
||||
@@ -39,4 +47,6 @@
|
||||
to_chat(AI, "<span class='userdanger'>[user] has upgraded you with surveillance software!</span>")
|
||||
to_chat(AI, "Via a combination of hidden microphones and lip reading software, you are able to use your cameras to listen in on conversations.")
|
||||
to_chat(user, "<span class='notice'>You upgrade [AI]. [src] is consumed in the process.</span>")
|
||||
log_game("[key_name(user)] has upgraded [key_name(AI)] with a [src].")
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] has upgraded [ADMIN_LOOKUPFLW(AI)] with a [src].")
|
||||
qdel(src)
|
||||
|
||||
@@ -223,6 +223,46 @@
|
||||
if(!iscyborg(loc))
|
||||
deductcharge(1000 / severity, TRUE, FALSE)
|
||||
|
||||
/obj/item/melee/baton/stunsword
|
||||
name = "stunsword"
|
||||
desc = "not actually sharp, this sword is functionally identical to a stunbaton"
|
||||
icon = 'modular_citadel/icons/obj/stunsword.dmi'
|
||||
icon_state = "stunsword"
|
||||
item_state = "sword"
|
||||
lefthand_file = 'modular_citadel/icons/mob/inhands/stunsword_left.dmi'
|
||||
righthand_file = 'modular_citadel/icons/mob/inhands/stunsword_right.dmi'
|
||||
|
||||
/obj/item/melee/baton/stunsword/get_belt_overlay()
|
||||
if(istype(loc, /obj/item/storage/belt/sabre))
|
||||
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "stunsword")
|
||||
return ..()
|
||||
|
||||
/obj/item/melee/baton/stunsword/get_worn_belt_overlay(icon_file)
|
||||
return mutable_appearance(icon_file, "-stunsword")
|
||||
|
||||
/obj/item/ssword_kit
|
||||
name = "stunsword kit"
|
||||
desc = "a modkit for making a stunbaton into a stunsword"
|
||||
icon = 'icons/obj/vending_restock.dmi'
|
||||
icon_state = "refill_donksoft"
|
||||
var/product = /obj/item/melee/baton/stunsword //what it makes
|
||||
var/list/fromitem = list(/obj/item/melee/baton, /obj/item/melee/baton/loaded) //what it needs
|
||||
afterattack(obj/O, mob/user as mob)
|
||||
if(istype(O, product))
|
||||
to_chat(user,"<span class='warning'>[O] is already modified!")
|
||||
else if(O.type in fromitem) //makes sure O is the right thing
|
||||
var/obj/item/melee/baton/B = O
|
||||
if(!B.cell) //checks for a powercell in the baton. If there isn't one, continue. If there is, warn the user to take it out
|
||||
new product(usr.loc) //spawns the product
|
||||
user.visible_message("<span class='warning'>[user] modifies [O]!","<span class='warning'>You modify the [O]!")
|
||||
qdel(O) //Gets rid of the baton
|
||||
qdel(src) //gets rid of the kit
|
||||
|
||||
else
|
||||
to_chat(user,"<span class='warning'>Remove the powercell first!</span>") //We make this check because the stunsword starts without a battery.
|
||||
else
|
||||
to_chat(user, "<span class='warning'> You can't modify [O] with this kit!</span>")
|
||||
|
||||
//Makeshift stun baton. Replacement for stun gloves.
|
||||
/obj/item/melee/baton/cattleprod
|
||||
name = "stunprod"
|
||||
@@ -249,5 +289,6 @@
|
||||
sparkler?.activate()
|
||||
. = ..()
|
||||
|
||||
|
||||
#undef STUNBATON_CHARGE_LENIENCY
|
||||
#undef STUNBATON_DEPLETION_RATE
|
||||
|
||||
+322
-322
@@ -1,322 +1,322 @@
|
||||
#define RESTART_COUNTER_PATH "data/round_counter.txt"
|
||||
|
||||
GLOBAL_VAR(restart_counter)
|
||||
|
||||
GLOBAL_VAR(topic_status_lastcache)
|
||||
GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
//This happens after the Master subsystem new(s) (it's a global datum)
|
||||
//So subsystems globals exist, but are not initialised
|
||||
/world/New()
|
||||
|
||||
log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
|
||||
|
||||
SetupExternalRSC()
|
||||
|
||||
GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
|
||||
|
||||
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
|
||||
|
||||
TgsNew()
|
||||
|
||||
GLOB.revdata = new
|
||||
|
||||
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
|
||||
|
||||
//SetupLogs depends on the RoundID, so lets check
|
||||
//DB schema and set RoundID if we can
|
||||
SSdbcore.CheckSchemaVersion()
|
||||
SSdbcore.SetRoundID()
|
||||
SetupLogs()
|
||||
|
||||
#ifndef USE_CUSTOM_ERROR_HANDLER
|
||||
world.log = file("[GLOB.log_directory]/dd.log")
|
||||
#endif
|
||||
|
||||
load_admins()
|
||||
LoadVerbs(/datum/verbs/menu)
|
||||
if(CONFIG_GET(flag/usewhitelist))
|
||||
load_whitelist()
|
||||
LoadBans()
|
||||
reload_custom_roundstart_items_list()//Cit change - loads donator items. Remind me to remove when I port over bay's loadout system
|
||||
|
||||
GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
|
||||
|
||||
if(fexists(RESTART_COUNTER_PATH))
|
||||
GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
|
||||
fdel(RESTART_COUNTER_PATH)
|
||||
|
||||
if(NO_INIT_PARAMETER in params)
|
||||
return
|
||||
|
||||
cit_initialize()
|
||||
|
||||
Master.Initialize(10, FALSE, TRUE)
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
HandleTestRun()
|
||||
|
||||
/world/proc/HandleTestRun()
|
||||
//trigger things to run the whole process
|
||||
Master.sleep_offline_after_initializations = FALSE
|
||||
SSticker.start_immediately = TRUE
|
||||
CONFIG_SET(number/round_end_countdown, 0)
|
||||
var/datum/callback/cb
|
||||
#ifdef UNIT_TESTS
|
||||
cb = CALLBACK(GLOBAL_PROC, /proc/RunUnitTests)
|
||||
#else
|
||||
cb = VARSET_CALLBACK(SSticker, force_ending, TRUE)
|
||||
#endif
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/addtimer, cb, 10 SECONDS))
|
||||
|
||||
/world/proc/SetupExternalRSC()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
|
||||
var/i=1
|
||||
while(i<=GLOB.external_rsc_urls.len)
|
||||
if(GLOB.external_rsc_urls[i])
|
||||
i++
|
||||
else
|
||||
GLOB.external_rsc_urls.Cut(i,i+1)
|
||||
#endif
|
||||
|
||||
/world/proc/SetupLogs()
|
||||
var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
|
||||
if(!override_dir)
|
||||
var/realtime = world.realtime
|
||||
var/texttime = time2text(realtime, "YYYY/MM/DD")
|
||||
GLOB.log_directory = "data/logs/[texttime]/round-"
|
||||
GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
|
||||
if(GLOB.round_id)
|
||||
GLOB.log_directory += "[GLOB.round_id]"
|
||||
GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
|
||||
GLOB.picture_log_directory += "[GLOB.round_id]"
|
||||
else
|
||||
var/timestamp = replacetext(TIME_STAMP("hh:mm:ss", FALSE), ":", ".")
|
||||
GLOB.log_directory += "[timestamp]"
|
||||
GLOB.picture_log_directory += "[timestamp]"
|
||||
GLOB.picture_logging_prefix += "T_[timestamp]_"
|
||||
else
|
||||
GLOB.log_directory = "data/logs/[override_dir]"
|
||||
GLOB.picture_logging_prefix = "O_[override_dir]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
|
||||
|
||||
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
|
||||
GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
|
||||
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
|
||||
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
|
||||
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
|
||||
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
|
||||
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
|
||||
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
|
||||
GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
|
||||
GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
|
||||
GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
|
||||
GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
|
||||
GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
|
||||
GLOB.tgui_log = "[GLOB.log_directory]/tgui.log"
|
||||
GLOB.subsystem_log = "[GLOB.log_directory]/subsystem.log"
|
||||
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
GLOB.test_log = file("[GLOB.log_directory]/tests.log")
|
||||
start_log(GLOB.test_log)
|
||||
#endif
|
||||
start_log(GLOB.world_game_log)
|
||||
start_log(GLOB.world_attack_log)
|
||||
start_log(GLOB.world_pda_log)
|
||||
start_log(GLOB.world_telecomms_log)
|
||||
start_log(GLOB.world_manifest_log)
|
||||
start_log(GLOB.world_href_log)
|
||||
start_log(GLOB.world_qdel_log)
|
||||
start_log(GLOB.world_runtime_log)
|
||||
start_log(GLOB.world_job_debug_log)
|
||||
start_log(GLOB.tgui_log)
|
||||
start_log(GLOB.subsystem_log)
|
||||
|
||||
GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
|
||||
if(fexists(GLOB.config_error_log))
|
||||
fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
|
||||
fdel(GLOB.config_error_log)
|
||||
|
||||
if(GLOB.round_id)
|
||||
log_game("Round ID: [GLOB.round_id]")
|
||||
|
||||
// This was printed early in startup to the world log and config_error.log,
|
||||
// but those are both private, so let's put the commit info in the runtime
|
||||
// log which is ultimately public.
|
||||
log_runtime(GLOB.revdata.get_log_message())
|
||||
|
||||
/world/Topic(T, addr, master, key)
|
||||
TGS_TOPIC //redirect to server tools if necessary
|
||||
|
||||
if(!SSfail2topic)
|
||||
return "Server not initialized."
|
||||
else if(SSfail2topic.IsRateLimited(addr))
|
||||
return "Rate limited."
|
||||
|
||||
if(length(T) > CONFIG_GET(number/topic_max_size))
|
||||
return "Payload too large!"
|
||||
|
||||
var/static/list/topic_handlers = TopicHandlers()
|
||||
|
||||
var/list/input = params2list(T)
|
||||
var/datum/world_topic/handler
|
||||
for(var/I in topic_handlers)
|
||||
if(I in input)
|
||||
handler = topic_handlers[I]
|
||||
break
|
||||
|
||||
if((!handler || initial(handler.log)) && config && CONFIG_GET(flag/log_world_topic))
|
||||
log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
|
||||
|
||||
if(!handler)
|
||||
return
|
||||
|
||||
handler = new handler()
|
||||
return handler.TryRun(input, addr)
|
||||
|
||||
/world/proc/AnnouncePR(announcement, list/payload)
|
||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
||||
var/id = "[payload["pull_request"]["id"]]"
|
||||
if(!PRcounts[id])
|
||||
PRcounts[id] = 1
|
||||
else
|
||||
++PRcounts[id]
|
||||
if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
|
||||
return
|
||||
|
||||
var/final_composed = "<span class='announce'>PR: [announcement]</span>"
|
||||
for(var/client/C in GLOB.clients)
|
||||
C.AnnouncePR(final_composed)
|
||||
|
||||
/world/proc/FinishTestRun()
|
||||
set waitfor = FALSE
|
||||
var/list/fail_reasons
|
||||
if(GLOB)
|
||||
if(GLOB.total_runtimes != 0)
|
||||
fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
|
||||
#ifdef UNIT_TESTS
|
||||
if(GLOB.failed_any_test)
|
||||
LAZYADD(fail_reasons, "Unit Tests failed!")
|
||||
#endif
|
||||
if(!GLOB.log_directory)
|
||||
LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
|
||||
else
|
||||
fail_reasons = list("Missing GLOB!")
|
||||
if(!fail_reasons)
|
||||
text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
|
||||
else
|
||||
log_world("Test run failed!\n[fail_reasons.Join("\n")]")
|
||||
sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
|
||||
qdel(src) //shut it down
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
TgsReboot()
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request</span>")
|
||||
else
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
FinishTestRun()
|
||||
return
|
||||
|
||||
if(TgsAvailable())
|
||||
var/do_hard_reboot
|
||||
// check the hard reboot counter
|
||||
var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
|
||||
switch(ruhr)
|
||||
if(-1)
|
||||
do_hard_reboot = FALSE
|
||||
if(0)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
if(GLOB.restart_counter >= ruhr)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
|
||||
do_hard_reboot = FALSE
|
||||
|
||||
if(do_hard_reboot)
|
||||
log_world("World hard rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // See comment below.
|
||||
TgsEndProcess()
|
||||
|
||||
log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
|
||||
..()
|
||||
|
||||
/world/proc/update_status()
|
||||
|
||||
var/list/features = list()
|
||||
|
||||
/*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
|
||||
features += GLOB.master_mode
|
||||
|
||||
if (!GLOB.enter_allowed)
|
||||
features += "closed"*/
|
||||
|
||||
var/s = ""
|
||||
var/hostedby
|
||||
if(config)
|
||||
var/server_name = CONFIG_GET(string/servername)
|
||||
if (server_name)
|
||||
s += "<b>[server_name]</b> — "
|
||||
/*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
|
||||
if(CONFIG_GET(flag/allow_vote_mode))
|
||||
features += "vote"
|
||||
if(CONFIG_GET(flag/allow_ai))
|
||||
features += "AI allowed"*/
|
||||
hostedby = CONFIG_GET(string/hostedby)
|
||||
|
||||
s += "<b>[station_name()]</b>";
|
||||
s += " ("
|
||||
s += "<a href=\"https://citadel-station.net/home/\">" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
|
||||
s += "Citadel" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
|
||||
s += "</a>"
|
||||
s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
|
||||
s += "<br>[CONFIG_GET(string/servertagline)]<br>" //CIT CHANGE - adds a tagline!
|
||||
|
||||
var/n = 0
|
||||
for (var/mob/M in GLOB.player_list)
|
||||
if (M.client)
|
||||
n++
|
||||
|
||||
if(SSmapping.config) // this just stops the runtime, honk.
|
||||
features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
|
||||
|
||||
if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
|
||||
features += "[get_security_level()] alert"
|
||||
|
||||
if (n > 1)
|
||||
features += "~[n] players"
|
||||
else if (n > 0)
|
||||
features += "~[n] player"
|
||||
|
||||
if (!host && hostedby)
|
||||
features += "hosted by <b>[hostedby]</b>"
|
||||
|
||||
if (features)
|
||||
s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
|
||||
|
||||
status = s
|
||||
|
||||
/world/proc/update_hub_visibility(new_visibility)
|
||||
if(new_visibility == GLOB.hub_visibility)
|
||||
return
|
||||
GLOB.hub_visibility = new_visibility
|
||||
if(GLOB.hub_visibility)
|
||||
hub_password = "kMZy3U5jJHSiBQjr"
|
||||
else
|
||||
hub_password = "SORRYNOPASSWORD"
|
||||
|
||||
/world/proc/incrementMaxZ()
|
||||
maxz++
|
||||
SSmobs.MaxZChanged()
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
#define RESTART_COUNTER_PATH "data/round_counter.txt"
|
||||
|
||||
GLOBAL_VAR(restart_counter)
|
||||
|
||||
GLOBAL_VAR(topic_status_lastcache)
|
||||
GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
//This happens after the Master subsystem new(s) (it's a global datum)
|
||||
//So subsystems globals exist, but are not initialised
|
||||
/world/New()
|
||||
|
||||
log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
|
||||
|
||||
SetupExternalRSC()
|
||||
|
||||
GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
|
||||
|
||||
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
|
||||
|
||||
TgsNew()
|
||||
|
||||
GLOB.revdata = new
|
||||
|
||||
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
|
||||
|
||||
//SetupLogs depends on the RoundID, so lets check
|
||||
//DB schema and set RoundID if we can
|
||||
SSdbcore.CheckSchemaVersion()
|
||||
SSdbcore.SetRoundID()
|
||||
SetupLogs()
|
||||
|
||||
#ifndef USE_CUSTOM_ERROR_HANDLER
|
||||
world.log = file("[GLOB.log_directory]/dd.log")
|
||||
#endif
|
||||
|
||||
load_admins()
|
||||
load_mentors()
|
||||
LoadVerbs(/datum/verbs/menu)
|
||||
if(CONFIG_GET(flag/usewhitelist))
|
||||
load_whitelist()
|
||||
LoadBans()
|
||||
initialize_global_loadout_items()
|
||||
reload_custom_roundstart_items_list()//Cit change - loads donator items. Remind me to remove when I port over bay's loadout system
|
||||
|
||||
GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
|
||||
|
||||
if(fexists(RESTART_COUNTER_PATH))
|
||||
GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
|
||||
fdel(RESTART_COUNTER_PATH)
|
||||
|
||||
if(NO_INIT_PARAMETER in params)
|
||||
return
|
||||
|
||||
Master.Initialize(10, FALSE, TRUE)
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
HandleTestRun()
|
||||
|
||||
/world/proc/HandleTestRun()
|
||||
//trigger things to run the whole process
|
||||
Master.sleep_offline_after_initializations = FALSE
|
||||
SSticker.start_immediately = TRUE
|
||||
CONFIG_SET(number/round_end_countdown, 0)
|
||||
var/datum/callback/cb
|
||||
#ifdef UNIT_TESTS
|
||||
cb = CALLBACK(GLOBAL_PROC, /proc/RunUnitTests)
|
||||
#else
|
||||
cb = VARSET_CALLBACK(SSticker, force_ending, TRUE)
|
||||
#endif
|
||||
SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/addtimer, cb, 10 SECONDS))
|
||||
|
||||
/world/proc/SetupExternalRSC()
|
||||
#if (PRELOAD_RSC == 0)
|
||||
GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
|
||||
var/i=1
|
||||
while(i<=GLOB.external_rsc_urls.len)
|
||||
if(GLOB.external_rsc_urls[i])
|
||||
i++
|
||||
else
|
||||
GLOB.external_rsc_urls.Cut(i,i+1)
|
||||
#endif
|
||||
|
||||
/world/proc/SetupLogs()
|
||||
var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
|
||||
if(!override_dir)
|
||||
var/realtime = world.realtime
|
||||
var/texttime = time2text(realtime, "YYYY/MM/DD")
|
||||
GLOB.log_directory = "data/logs/[texttime]/round-"
|
||||
GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
|
||||
if(GLOB.round_id)
|
||||
GLOB.log_directory += "[GLOB.round_id]"
|
||||
GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
|
||||
GLOB.picture_log_directory += "[GLOB.round_id]"
|
||||
else
|
||||
var/timestamp = replacetext(TIME_STAMP("hh:mm:ss", FALSE), ":", ".")
|
||||
GLOB.log_directory += "[timestamp]"
|
||||
GLOB.picture_log_directory += "[timestamp]"
|
||||
GLOB.picture_logging_prefix += "T_[timestamp]_"
|
||||
else
|
||||
GLOB.log_directory = "data/logs/[override_dir]"
|
||||
GLOB.picture_logging_prefix = "O_[override_dir]_"
|
||||
GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
|
||||
|
||||
GLOB.world_game_log = "[GLOB.log_directory]/game.log"
|
||||
GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
|
||||
GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
|
||||
GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
|
||||
GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
|
||||
GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
|
||||
GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
|
||||
GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
|
||||
GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
|
||||
GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
|
||||
GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
|
||||
GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
|
||||
GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
|
||||
GLOB.tgui_log = "[GLOB.log_directory]/tgui.log"
|
||||
GLOB.subsystem_log = "[GLOB.log_directory]/subsystem.log"
|
||||
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
GLOB.test_log = file("[GLOB.log_directory]/tests.log")
|
||||
start_log(GLOB.test_log)
|
||||
#endif
|
||||
start_log(GLOB.world_game_log)
|
||||
start_log(GLOB.world_attack_log)
|
||||
start_log(GLOB.world_pda_log)
|
||||
start_log(GLOB.world_telecomms_log)
|
||||
start_log(GLOB.world_manifest_log)
|
||||
start_log(GLOB.world_href_log)
|
||||
start_log(GLOB.world_qdel_log)
|
||||
start_log(GLOB.world_runtime_log)
|
||||
start_log(GLOB.world_job_debug_log)
|
||||
start_log(GLOB.tgui_log)
|
||||
start_log(GLOB.subsystem_log)
|
||||
|
||||
GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
|
||||
if(fexists(GLOB.config_error_log))
|
||||
fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
|
||||
fdel(GLOB.config_error_log)
|
||||
|
||||
if(GLOB.round_id)
|
||||
log_game("Round ID: [GLOB.round_id]")
|
||||
|
||||
// This was printed early in startup to the world log and config_error.log,
|
||||
// but those are both private, so let's put the commit info in the runtime
|
||||
// log which is ultimately public.
|
||||
log_runtime(GLOB.revdata.get_log_message())
|
||||
|
||||
/world/Topic(T, addr, master, key)
|
||||
TGS_TOPIC //redirect to server tools if necessary
|
||||
|
||||
if(!SSfail2topic)
|
||||
return "Server not initialized."
|
||||
else if(SSfail2topic.IsRateLimited(addr))
|
||||
return "Rate limited."
|
||||
|
||||
if(length(T) > CONFIG_GET(number/topic_max_size))
|
||||
return "Payload too large!"
|
||||
|
||||
var/static/list/topic_handlers = TopicHandlers()
|
||||
|
||||
var/list/input = params2list(T)
|
||||
var/datum/world_topic/handler
|
||||
for(var/I in topic_handlers)
|
||||
if(I in input)
|
||||
handler = topic_handlers[I]
|
||||
break
|
||||
|
||||
if((!handler || initial(handler.log)) && config && CONFIG_GET(flag/log_world_topic))
|
||||
log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
|
||||
|
||||
if(!handler)
|
||||
return
|
||||
|
||||
handler = new handler()
|
||||
return handler.TryRun(input, addr)
|
||||
|
||||
/world/proc/AnnouncePR(announcement, list/payload)
|
||||
var/static/list/PRcounts = list() //PR id -> number of times announced this round
|
||||
var/id = "[payload["pull_request"]["id"]]"
|
||||
if(!PRcounts[id])
|
||||
PRcounts[id] = 1
|
||||
else
|
||||
++PRcounts[id]
|
||||
if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
|
||||
return
|
||||
|
||||
var/final_composed = "<span class='announce'>PR: [announcement]</span>"
|
||||
for(var/client/C in GLOB.clients)
|
||||
C.AnnouncePR(final_composed)
|
||||
|
||||
/world/proc/FinishTestRun()
|
||||
set waitfor = FALSE
|
||||
var/list/fail_reasons
|
||||
if(GLOB)
|
||||
if(GLOB.total_runtimes != 0)
|
||||
fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
|
||||
#ifdef UNIT_TESTS
|
||||
if(GLOB.failed_any_test)
|
||||
LAZYADD(fail_reasons, "Unit Tests failed!")
|
||||
#endif
|
||||
if(!GLOB.log_directory)
|
||||
LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
|
||||
else
|
||||
fail_reasons = list("Missing GLOB!")
|
||||
if(!fail_reasons)
|
||||
text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
|
||||
else
|
||||
log_world("Test run failed!\n[fail_reasons.Join("\n")]")
|
||||
sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
|
||||
qdel(src) //shut it down
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
TgsReboot()
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request</span>")
|
||||
else
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
FinishTestRun()
|
||||
return
|
||||
|
||||
if(TgsAvailable())
|
||||
var/do_hard_reboot
|
||||
// check the hard reboot counter
|
||||
var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
|
||||
switch(ruhr)
|
||||
if(-1)
|
||||
do_hard_reboot = FALSE
|
||||
if(0)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
if(GLOB.restart_counter >= ruhr)
|
||||
do_hard_reboot = TRUE
|
||||
else
|
||||
text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
|
||||
do_hard_reboot = FALSE
|
||||
|
||||
if(do_hard_reboot)
|
||||
log_world("World hard rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // See comment below.
|
||||
TgsEndProcess()
|
||||
|
||||
log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
|
||||
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
|
||||
..()
|
||||
|
||||
/world/proc/update_status()
|
||||
|
||||
var/list/features = list()
|
||||
|
||||
/*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
|
||||
features += GLOB.master_mode
|
||||
|
||||
if (!GLOB.enter_allowed)
|
||||
features += "closed"*/
|
||||
|
||||
var/s = ""
|
||||
var/hostedby
|
||||
if(config)
|
||||
var/server_name = CONFIG_GET(string/servername)
|
||||
if (server_name)
|
||||
s += "<b>[server_name]</b> — "
|
||||
/*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
|
||||
if(CONFIG_GET(flag/allow_vote_mode))
|
||||
features += "vote"
|
||||
if(CONFIG_GET(flag/allow_ai))
|
||||
features += "AI allowed"*/
|
||||
hostedby = CONFIG_GET(string/hostedby)
|
||||
|
||||
s += "<b>[station_name()]</b>";
|
||||
s += " ("
|
||||
s += "<a href=\"https://citadel-station.net/home/\">" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
|
||||
s += "Citadel" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
|
||||
s += "</a>"
|
||||
s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
|
||||
s += "<br>[CONFIG_GET(string/servertagline)]<br>" //CIT CHANGE - adds a tagline!
|
||||
|
||||
var/n = 0
|
||||
for (var/mob/M in GLOB.player_list)
|
||||
if (M.client)
|
||||
n++
|
||||
|
||||
if(SSmapping.config) // this just stops the runtime, honk.
|
||||
features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
|
||||
|
||||
if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
|
||||
features += "[get_security_level()] alert"
|
||||
|
||||
if (n > 1)
|
||||
features += "~[n] players"
|
||||
else if (n > 0)
|
||||
features += "~[n] player"
|
||||
|
||||
if (!host && hostedby)
|
||||
features += "hosted by <b>[hostedby]</b>"
|
||||
|
||||
if (features)
|
||||
s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
|
||||
|
||||
status = s
|
||||
|
||||
/world/proc/update_hub_visibility(new_visibility)
|
||||
if(new_visibility == GLOB.hub_visibility)
|
||||
return
|
||||
GLOB.hub_visibility = new_visibility
|
||||
if(GLOB.hub_visibility)
|
||||
hub_password = "kMZy3U5jJHSiBQjr"
|
||||
else
|
||||
hub_password = "SORRYNOPASSWORD"
|
||||
|
||||
/world/proc/incrementMaxZ()
|
||||
maxz++
|
||||
SSmobs.MaxZChanged()
|
||||
SSidlenpcpool.MaxZChanged()
|
||||
|
||||
Reference in New Issue
Block a user