Merge branch 'master' into character-slot-clearing

This commit is contained in:
mochi
2020-07-13 21:04:20 +02:00
126 changed files with 37222 additions and 281562 deletions
+2 -2
View File
@@ -211,7 +211,7 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
query.Execute()
while(query.NextRow())
ban_id = query.item[1]
ban_number++;
ban_number++
if(ban_number == 0)
to_chat(usr, "<span class='warning'>Database update failed due to no bans fitting the search criteria. If this is not a legacy ban you should contact the database admin.</span>")
@@ -314,7 +314,7 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
query.Execute()
while(query.NextRow())
pckey = query.item[1]
ban_number++;
ban_number++
if(ban_number == 0)
to_chat(usr, "<span class='warning'>Database update failed due to a ban id not being present in the database.</span>")
-3
View File
@@ -58,9 +58,6 @@ GLOBAL_PROTECT(banlist_savefile) // Obvious reasons
GLOB.CMinutes = (world.realtime / 10) / 60
return 1
/hook/startup/proc/loadBans()
return LoadBans()
/proc/LoadBans()
GLOB.banlist_savefile = new("data/banlist.bdb")
-4
View File
@@ -11,10 +11,6 @@
/proc/investigate_subject2file(var/subject)
return file("[INVESTIGATE_DIR][subject].html")
/hook/startup/proc/resetInvestigate()
investigate_reset()
return 1
/proc/investigate_reset()
if(fdel(INVESTIGATE_DIR)) return 1
return 0
+5 -4
View File
@@ -56,11 +56,12 @@ GLOBAL_PROTECT(admin_ranks) // this shit is being protected for obvious reasons
testing(msg)
#endif
/hook/startup/proc/loadAdmins()
load_admins()
return 1
/proc/load_admins()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin reload blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to reload admins via advanced proc-call")
log_admin("[key_name(usr)] attempted to reload admins via advanced proc-call")
return
//clear the datums references
GLOB.admin_datums.Cut()
for(var/client/C in GLOB.admins)
-4
View File
@@ -56,10 +56,6 @@ DEBUG
jobban_loadbanfile()
*/
/hook/startup/proc/loadJobBans()
jobban_loadbanfile()
return 1
/proc/jobban_loadbanfile()
if(config.ban_legacy_system)
var/savefile/S=new("data/job_full.ban")
+25
View File
@@ -16,6 +16,11 @@ GLOBAL_PROTECT(admin_datums) // This is protected because we dont want people ma
var/admincaster_signature //What you'll sign the newsfeeds as
/datum/admins/New(initial_rank = "Temporary Admin", initial_rights = 0, ckey)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin rank creation blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to create a new admin rank via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback a new admin rank via advanced proc-call")
return
if(!ckey)
error("Admin datum created without a ckey argument. Datum has been deleted")
qdel(src)
@@ -26,10 +31,20 @@ GLOBAL_PROTECT(admin_datums) // This is protected because we dont want people ma
GLOB.admin_datums[ckey] = src
/datum/admins/Destroy()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin rank deletion blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to delete an admin rank via advanced proc-call")
log_admin("[key_name(usr)] attempted to delete an admin rank via advanced proc-call")
return
..()
return QDEL_HINT_HARDDEL_NOW
/datum/admins/proc/associate(client/C)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Rank association blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to associate an admin rank to a new client via advanced proc-call")
log_admin("[key_name(usr)] attempted to associate an admin rank to a new client via advanced proc-call")
return
if(istype(C))
owner = C
owner.holder = src
@@ -39,6 +54,11 @@ GLOBAL_PROTECT(admin_datums) // This is protected because we dont want people ma
GLOB.admins |= C
/datum/admins/proc/disassociate()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Rank disassociation blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to disassociate an admin rank from a client via advanced proc-call")
log_admin("[key_name(usr)] attempted to disassociate an admin rank from a client via advanced proc-call")
return
if(owner)
GLOB.admins -= owner
owner.remove_admin_verbs()
@@ -88,6 +108,11 @@ you will have to do something like if(client.holder.rights & R_ADMIN) yourself.
return 0
/client/proc/deadmin()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Deadmin blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to de-admin a client via advanced proc-call")
log_admin("[key_name(usr)] attempted to de-admin a client via advanced proc-call")
return
GLOB.admin_datums -= ckey
if(holder)
holder.disassociate()
@@ -102,6 +102,11 @@
to_chat(usr, "<span class='notice'>Admin rank changed.</span>")
/datum/admins/proc/log_admin_permission_modification(var/adm_ckey, var/new_permission)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Admin edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit admin ranks via advanced proc-call")
return
if(config.admin_legacy_system)
return
+2 -2
View File
@@ -3475,9 +3475,9 @@
hunter_mind.objectives += protect_objective
SSticker.mode.traitors |= hunter_mob.mind
to_chat(hunter_mob, "<span class='danger'>ATTENTION:</span> You are now on a mission!")
to_chat(hunter_mob, "<B>Goal: <span class='danger'>[killthem ? "MURDER" : "PROTECT"] [H.real_name]</span>, currently in [get_area(H.loc)]. </B>");
to_chat(hunter_mob, "<B>Goal: <span class='danger'>[killthem ? "MURDER" : "PROTECT"] [H.real_name]</span>, currently in [get_area(H.loc)]. </B>")
if(killthem)
to_chat(hunter_mob, "<B>If you kill [H.p_them()], [H.p_they()] cannot be revived.</B>");
to_chat(hunter_mob, "<B>If you kill [H.p_them()], [H.p_they()] cannot be revived.</B>")
hunter_mob.mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/atom_hud/antag/tatorhud = GLOB.huds[ANTAG_HUD_TRAITOR]
tatorhud.join_hud(hunter_mob)
+2 -2
View File
@@ -444,9 +444,9 @@
if(object == world) // Global proc.
procname = "/proc/[procname]"
return call(procname)(arglist(new_args))
return (WrapAdminProcCall(GLOBAL_PROC, procname, new_args))
return call(object, procname)(arglist(new_args))
return (WrapAdminProcCall(object, procname, new_args))
/proc/SDQL2_tokenize(query_text)
+1 -1
View File
@@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown","the","a","an","of","mo
var/admin_number_ignored = 0 //Holds the number of admins without +BAN (so admins who are not really admins)
var/admin_number_decrease = 0 //Holds the number of admins with are afk, ignored or both
for(var/client/X in GLOB.admins)
admin_number_total++;
admin_number_total++
var/invalid = 0
if(requiredflags != 0 && !check_rights_for(X, requiredflags))
admin_number_ignored++
+66 -4
View File
@@ -85,18 +85,80 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
message_admins("[key_name_admin(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
returnval = WrapAdminProcCall(target, procname, lst) // Pass the lst as an argument list to the proc
else
//this currently has no hascall protection. wasn't able to get it working.
message_admins("[key_name_admin(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
returnval = WrapAdminProcCall(GLOBAL_PROC, procname, lst) // Pass the lst as an argument list to the proc
to_chat(usr, "<font color='blue'>[procname] returned: [!isnull(returnval) ? returnval : "null"]</font>")
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
// All these vars are related to proc call protection
// If you add more of these, for the love of fuck, protect them
/// Who is currently calling procs
GLOBAL_VAR(AdminProcCaller)
GLOBAL_PROTECT(AdminProcCaller)
/// How many procs have been called
GLOBAL_VAR_INIT(AdminProcCallCount, 0)
GLOBAL_PROTECT(AdminProcCallCount)
/// UID of the admin who last called
GLOBAL_VAR(LastAdminCalledTargetUID)
GLOBAL_PROTECT(LastAdminCalledTargetUID)
/// Last target to have a proc called on it
GLOBAL_VAR(LastAdminCalledTarget)
GLOBAL_PROTECT(LastAdminCalledTarget)
/// Last proc called
GLOBAL_VAR(LastAdminCalledProc)
GLOBAL_PROTECT(LastAdminCalledProc)
/// List to handle proc call spam prevention
GLOBAL_LIST_EMPTY(AdminProcCallSpamPrevention)
GLOBAL_PROTECT(AdminProcCallSpamPrevention)
// Wrapper for proccalls where the datum is flagged as vareditted
/proc/WrapAdminProcCall(datum/target, procname, list/arguments)
if(target && procname == "Del")
to_chat(usr, "Calling Del() is not allowed")
return
if(target != GLOBAL_PROC && !target.CanProcCall(procname))
to_chat(usr, "Proccall on [target.type]/proc/[procname] is disallowed!")
return
var/current_caller = GLOB.AdminProcCaller
var/ckey = usr ? usr.client.ckey : GLOB.AdminProcCaller
if(!ckey)
CRASH("WrapAdminProcCall with no ckey: [target] [procname] [english_list(arguments)]")
if(current_caller && current_caller != ckey)
if(!GLOB.AdminProcCallSpamPrevention[ckey])
to_chat(usr, "<span class='adminnotice'>Another set of admin called procs are still running, your proc will be run after theirs finish.</span>")
GLOB.AdminProcCallSpamPrevention[ckey] = TRUE
UNTIL(!GLOB.AdminProcCaller)
to_chat(usr, "<span class='adminnotice'>Running your proc</span>")
GLOB.AdminProcCallSpamPrevention -= ckey
else
UNTIL(!GLOB.AdminProcCaller)
GLOB.LastAdminCalledProc = procname
if(target != GLOBAL_PROC)
GLOB.LastAdminCalledTargetUID = target.UID()
GLOB.AdminProcCaller = ckey //if this runtimes, too bad for you
++GLOB.AdminProcCallCount
. = world.WrapAdminProcCall(target, procname, arguments)
if(--GLOB.AdminProcCallCount == 0)
GLOB.AdminProcCaller = null
//adv proc call this, ya nerds
/world/proc/WrapAdminProcCall(datum/target, procname, list/arguments)
if(target == GLOBAL_PROC)
return call(procname)(arglist(arguments))
else if(target != world)
return call(target, procname)(arglist(arguments))
else
to_chat(usr, "<span class='boldannounce'>Call to world/proc/[procname] blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to call world/proc/[procname] with arguments: [english_list(arguments)]")
log_admin("[key_name(usr)] attempted to call world/proc/[procname] with arguments: [english_list(arguments)]l")
/proc/IsAdminAdvancedProcCall()
#ifdef TESTING
@@ -131,7 +193,7 @@ GLOBAL_PROTECT(AdminProcCaller)
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"]")
spawn()
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
var/returnval = WrapAdminProcCall(A, procname, lst) // Pass the lst as an argument list to the proc
to_chat(src, "<span class='notice'>[procname] returned: [!isnull(returnval) ? returnval : "null"]</span>")
feedback_add_details("admin_verb","DPC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -428,7 +490,7 @@ GLOBAL_PROTECT(AdminProcCaller)
id.icon_state = "gold"
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
else
var/obj/item/card/id/id = new/obj/item/card/id(M);
var/obj/item/card/id/id = new/obj/item/card/id(M)
id.icon_state = "gold"
id:access = get_all_accesses()+get_all_centcom_access()+get_all_syndicate_access()
id.registered_name = H.real_name
+2 -2
View File
@@ -53,7 +53,7 @@ GLOBAL_LIST_EMPTY(sounds_cache)
set name = "Play Server Sound"
if(!check_rights(R_SOUNDS)) return
var/list/sounds = file2list("sound/serversound_list.txt");
var/list/sounds = file2list("sound/serversound_list.txt")
sounds += GLOB.sounds_cache
var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds
@@ -71,7 +71,7 @@ GLOBAL_LIST_EMPTY(sounds_cache)
var/A = alert("This will play a sound at every intercomm, are you sure you want to continue? This works best with short sounds, beware.","Warning","Yep","Nope")
if(A != "Yep") return
var/list/sounds = file2list("sound/serversound_list.txt");
var/list/sounds = file2list("sound/serversound_list.txt")
sounds += GLOB.sounds_cache
var/melody = input("Select a sound from the server to play", "Server sound list") as null|anything in sounds
+1 -1
View File
@@ -627,7 +627,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
print_command_report(input, "[command_name()] Update")
if("No")
//same thing as the blob stuff - it's not public, so it's classified, dammit
GLOB.command_announcer.autosay("A classified message has been printed out at all communication consoles.");
GLOB.command_announcer.autosay("A classified message has been printed out at all communication consoles.")
print_command_report(input, "Classified [command_name()] Update")
else
return
@@ -9,39 +9,6 @@ GLOBAL_LIST_EMPTY(gear_datums)
category = cat
..()
/hook/startup/proc/populate_gear_list()
//create a list of gear datums to sort
for(var/geartype in subtypesof(/datum/gear))
var/datum/gear/G = geartype
var/use_name = initial(G.display_name)
var/use_category = initial(G.sort_category)
if(G == initial(G.subtype_path))
continue
if(!use_name)
error("Loadout - Missing display name: [G]")
continue
if(!initial(G.cost))
error("Loadout - Missing cost: [G]")
continue
if(!initial(G.path))
error("Loadout - Missing path definition: [G]")
continue
if(!GLOB.loadout_categories[use_category])
GLOB.loadout_categories[use_category] = new /datum/loadout_category(use_category)
var/datum/loadout_category/LC = GLOB.loadout_categories[use_category]
GLOB.gear_datums[use_name] = new geartype
LC.gear[use_name] = GLOB.gear_datums[use_name]
GLOB.loadout_categories = sortAssoc(GLOB.loadout_categories)
for(var/loadout_category in GLOB.loadout_categories)
var/datum/loadout_category/LC = GLOB.loadout_categories[loadout_category]
LC.gear = sortAssoc(LC.gear)
return 1
/datum/gear
var/display_name //Name/index. Must be unique.
var/description //Description of this gear. If left blank will default to the description of the pathed item.
@@ -1 +0,0 @@
//placeholder for holiday stuff
-61
View File
@@ -1,61 +0,0 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/a_gift(T)
for(var/mob/living/simple_animal/corgi/Ian/Ian in GLOB.mob_list)
Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian))
/proc/ChristmasEvent()
for(var/obj/structure/flora/tree/pine/xmas in world)
var/mob/living/simple_animal/hostile/tree/evil_tree = new /mob/living/simple_animal/hostile/tree(xmas.loc)
evil_tree.icon_state = xmas.icon_state
evil_tree.icon_living = evil_tree.icon_state
evil_tree.icon_dead = evil_tree.icon_state
evil_tree.icon_gib = evil_tree.icon_state
qdel(xmas)
/obj/item/toy/xmas_cracker
name = "xmas cracker"
icon = 'icons/obj/christmas.dmi'
icon_state = "cracker"
desc = "Directions for use: Requires two people, one to pull each end."
var/cracked = 0
/obj/item/toy/xmas_cracker/New()
..()
/obj/item/toy/xmas_cracker/attack(mob/target, mob/user)
if( !cracked && istype(target,/mob/living/carbon/human) && (target.stat == CONSCIOUS) && !target.get_active_hand() )
target.visible_message("<span class='notice'>[user] and [target] pop \an [src]! *pop*</span>", "<span class='notice'>You pull \an [src] with [target]! *pop*</span>", "<span class='notice'>You hear a *pop*.</span>")
var/obj/item/paper/Joke = new /obj/item/paper(user.loc)
Joke.name = "[pick("awful","terrible","unfunny")] joke"
Joke.info = pick("What did one snowman say to the other?\n\n<i>'Is it me or can you smell carrots?'</i>",
"Why couldn't the snowman get laid?\n\n<i>He was frigid!</i>",
"Where are santa's helpers educated?\n\n<i>Nowhere, they're ELF-taught.</i>",
"What happened to the man who stole advent calanders?\n\n<i>He got 25 days.</i>",
"What does Santa get when he gets stuck in a chimney?\n\n<i>Claus-trophobia.</i>",
"Where do you find chili beans?\n\n<i>The north pole.</i>",
"What do you get from eating tree decorations?\n\n<i>Tinsilitis!</i>",
"What do snowmen wear on their heads?\n\n<i>Ice caps!</i>",
"Why is Christmas just like life on ss13?\n\n<i>You do all the work and the fat guy gets all the credit.</i>",
"Why doesnt Santa have any children?\n\n<i>Because he only comes down the chimney.</i>")
new /obj/item/clothing/head/festive(target.loc)
user.update_icons()
cracked = 1
icon_state = "cracker1"
var/obj/item/toy/xmas_cracker/other_half = new /obj/item/toy/xmas_cracker(target)
other_half.cracked = 1
other_half.icon_state = "cracker2"
target.put_in_active_hand(other_half)
playsound(user, 'sound/effects/snap.ogg', 50, 1)
return 1
return ..()
/obj/item/clothing/head/festive
name = "festive paper hat"
icon_state = "xmashat"
desc = "A crappy paper hat that you are REQUIRED to wear."
flags_inv = 0
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
-1
View File
@@ -1 +0,0 @@
//placeholder for holiday stuff
-183
View File
@@ -1,183 +0,0 @@
//Uncommenting ALLOW_HOLIDAYS in config.txt will enable Holidays
GLOBAL_VAR_INIT(Holiday) // I didnt update the rest of this code because this file hasnt been ticked in years, and holiday code got overhauled
// If it really needs fixing, yell at me, -aa
//Just thinking ahead! Here's the foundations to a more robust Holiday event system.
//It's easy as hell to add stuff. Just set Holiday to something using the switch(or something else)
//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only
//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause
//the game to lag even more in the name of one-day content.
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//ALSO, MOST IMPORTANTLY: Don't add stupid stuff! Discuss bonus content with Project-Heads first please!//
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// ~Carn
/hook/startup/proc/updateHoliday()
Get_Holiday()
return 1
//sets up the Holiday global variable. Shouldbe called on game configuration or something.
/proc/Get_Holiday()
if(!Holiday) return // Holiday stuff was not enabled in the config!
Holiday = null // reset our switch now so we can recycle it as our Holiday name
var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
//Main switch. If any of these are too dumb/inappropriate, or you have better ones, feel free to change whatever
switch(MM)
if(1) //Jan
switch(DD)
if(1) Holiday = "New Year's Day"
if(2) //Feb
switch(DD)
if(2) Holiday = "Groundhog Day"
if(14) Holiday = "Valentine's Day"
if(17) Holiday = "Random Acts of Kindness Day"
if(3) //Mar
switch(DD)
if(14) Holiday = "Pi Day"
if(17) Holiday = "St. Patrick's Day"
if(27)
if(YY == 16)
Holiday = "Easter"
if(31)
if(YY == 13)
Holiday = "Easter"
if(4) //Apr
switch(DD)
if(1)
Holiday = "April Fool's Day"
if(YY == 18 && prob(50)) Holiday = "Easter"
if(5)
if(YY == 15) Holiday = "Easter"
if(16)
if(YY == 17) Holiday = "Easter"
if(20)
Holiday = "Four-Twenty"
if(YY == 14 && prob(50)) Holiday = "Easter"
if(22) Holiday = "Earth Day"
if(5) //May
switch(DD)
if(1) Holiday = "Labour Day"
if(4) Holiday = "FireFighter's Day"
if(12) Holiday = "Owl and Pussycat Day" //what a dumb day of observence...but we -do- have costumes already :3
if(6) //Jun
if(7) //Jul
switch(DD)
if(1) Holiday = "Doctor's Day"
if(2) Holiday = "UFO Day"
if(8) Holiday = "Writer's Day"
if(30) Holiday = "Friendship Day"
if(8) //Aug
switch(DD)
if(5) Holiday = "Beer Day"
if(9) //Sep
switch(DD)
if(19) Holiday = "Talk-Like-a-Pirate Day"
if(28) Holiday = "Stupid-Questions Day"
if(10) //Oct
switch(DD)
if(4) Holiday = "Animal's Day"
if(7) Holiday = "Smiling Day"
if(16) Holiday = "Boss' Day"
if(31) Holiday = "Halloween"
if(11) //Nov
switch(DD)
if(1) Holiday = "Vegan Day"
if(13) Holiday = "Kindness Day"
if(19) Holiday = "Flowers Day"
if(21) Holiday = "Saying-'Hello' Day"
if(12) //Dec
switch(DD)
if(10) Holiday = "Human-Rights Day"
if(14) Holiday = "Monkey Day"
if(21) if(YY==12) Holiday = "End of the World"
if(22) Holiday = "Orgasming Day" //lol. These all actually exist
if(24) Holiday = "Christmas Eve"
if(25) Holiday = "Christmas"
if(26) Holiday = "Boxing Day"
if(31) Holiday = "New Year's Eve"
if(!Holiday)
//Friday the 13th
if(DD == 13)
if(time2text(world.timeofday, "DDD") == "Fri")
Holiday = "Friday the 13th"
//Allows GA and GM to set the Holiday variable
/client/proc/Set_Holiday(T as text|null)
set name = ".Set Holiday"
set category = "Event"
set desc = "Force-set the Holiday variable to make the game think it's a certain day."
if(!check_rights(R_SERVER)) return
Holiday = T
//get a new station name
station_name = null
station_name()
//update our hub status
world.update_status()
Holiday_Game_Start()
message_admins("<span class='notice'>ADMIN: Event: [key_name_admin(src)] force-set Holiday to \</span>"[Holiday]\"")
log_admin("[key_name(src)] force-set Holiday to \"[Holiday]\"")
//Run at the start of a round
/proc/Holiday_Game_Start()
if(Holiday)
to_chat(world, "<font color='blue'>and...</font>")
to_chat(world, "<h4>Happy [Holiday] Everybody!</h4>")
switch(Holiday) //special holidays
if("Easter")
//do easter stuff
if("Christmas Eve","Christmas")
Christmas_Game_Start()
return
//Nested in the random events loop. Will be triggered every 2 minutes
/proc/Holiday_Random_Event()
switch(Holiday) //special holidays
if("",null) //no Holiday today! Back to work!
return
if("Easter") //I'll make this into some helper procs at some point
/* var/list/turf/simulated/floor/Floorlist = list()
for(var/turf/simulated/floor/T)
if(T.contents)
Floorlist += T
var/turf/simulated/floor/F = Floorlist[rand(1,Floorlist.len)]
Floorlist = null
var/obj/structure/closet/C = locate(/obj/structure/closet) in F
var/obj/item/reagent_containers/food/snacks/chocolateegg/wrapped/Egg
if( C ) Egg = new(C)
else Egg = new(F)
*/
/* var/list/obj/containers = list()
for(var/obj/item/storage/S in world)
if(!is_station_level(S.z)) continue
containers += S
message_admins("<span class='notice'>DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])</span>")*/
if("End of the World")
if(prob(eventchance)) GameOver()
if("Christmas","Christmas Eve")
if(prob(eventchance)) ChristmasEvent()
+1 -1
View File
@@ -38,7 +38,7 @@ GLOBAL_VAR_INIT(account_hack_attempted, 0)
if(!isnull(affected_account) && !affected_account.suspended)
message = "The hack attempt has succeeded."
var/lost = affected_account.money * (MINIMUM_PERCENTAGE_LOSS + rand(0,VARIABLE_LOSS) / 10);
var/lost = affected_account.money * (MINIMUM_PERCENTAGE_LOSS + rand(0,VARIABLE_LOSS) / 10)
affected_account.phantom_charge(lost)
-33
View File
@@ -1,33 +0,0 @@
/hook/startup/proc/setup_title_screen()
var/list/provisional_title_screens = flist("config/title_screens/images/")
var/list/title_screens = list()
var/use_rare_screens = prob(1)
for(var/S in provisional_title_screens)
var/list/L = splittext(S,"+")
if(L.len == 1 && L[1] != "blank.png")
title_screens += S
else if(L.len > 1)
if(use_rare_screens && lowertext(L[1]) == "rare")
title_screens += S
else if(GLOB.using_map && (lowertext(L[1]) == lowertext(GLOB.using_map.name)))
title_screens += S
if(!isemptylist(title_screens))
if(length(title_screens) > 1)
for(var/S in title_screens)
var/list/L = splittext(S,".")
if(L.len != 2 || L[1] != "default")
continue
title_screens -= S
break
var/file_path = "config/title_screens/images/[pick(title_screens)]"
var/icon/icon = new(fcopy_rsc(file_path))
for(var/turf/unsimulated/wall/splashscreen/splash in world)
splash.icon = icon
return TRUE
return FALSE
@@ -17,10 +17,10 @@
update_icon()
/obj/item/reagent_containers/food/snacks/icecream/update_icon()
overlays.Cut()
var/image/filling = image('icons/obj/kitchen.dmi', src, "icecream_color")
filling.icon += mix_color_from_reagents(reagents.reagent_list)
overlays += filling
cut_overlays()
var/mutable_appearance/filling = mutable_appearance('icons/obj/kitchen.dmi', "icecream_color")
filling.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
/obj/item/reagent_containers/food/snacks/icecream/icecreamcone
name = "ice cream cone"
@@ -43,10 +43,9 @@
return
if(istype(I, /obj/item/reagent_containers/food/snacks/icecream))
if(!I.reagents.has_reagent("sprinkles"))
if(I.reagents.total_volume > 29) I.reagents.remove_any(1)
I.reagents.add_reagent("sprinkles",1)
var/image/sprinkles = image('icons/obj/kitchen.dmi', src, "sprinkles")
I.overlays += sprinkles
if(I.reagents.total_volume > 29)
I.reagents.remove_any(1)
I.reagents.add_reagent("sprinkles", 1)
I.name += " with sprinkles"
I.desc += ". This also has sprinkles."
else
@@ -1,256 +0,0 @@
#define ICECREAM_VANILLA 1
#define FLAVOUR_CHOCOLATE 2
#define FLAVOUR_STRAWBERRY 3
#define FLAVOUR_BLUE 4
#define CONE_WAFFLE 5
#define CONE_CHOC 6
#define INGR_MILK 7
#define INGR_FLOUR 8
#define INGR_SUGAR 9
#define INGR_ICE 10
#define MUCK 11
GLOBAL_LIST_INIT(ingredients_source, list(
"berryjuice" = FLAVOUR_STRAWBERRY,\
"cocoa" = FLAVOUR_CHOCOLATE,\
"singulo" = FLAVOUR_BLUE,\
"milk" = INGR_MILK,\
"soymilk" = INGR_MILK,\
"ice" = INGR_ICE,\
"flour" = INGR_FLOUR,\
"sugar" = INGR_SUGAR,\
))
/proc/get_icecream_flavour_string(var/flavour_type)
switch(flavour_type)
if(FLAVOUR_CHOCOLATE)
return "chocolate"
if(FLAVOUR_STRAWBERRY)
return "strawberry"
if(FLAVOUR_BLUE)
return "blue"
if(CONE_WAFFLE)
return "waffle"
if(CONE_CHOC)
return "chocolate"
if(INGR_MILK)
return "milk"
if(INGR_FLOUR)
return "flour"
if(INGR_SUGAR)
return "sugar"
if(INGR_ICE)
return "ice"
if(MUCK)
return "muck"
else
return "vanilla"
/obj/machinery/icecream_vat
name = "icecream vat"
desc = "Ding-aling ding dong. Get your Nanotrasen-approved ice cream!"
icon = 'icons/obj/kitchen.dmi'
icon_state = "icecream_vat"
density = 1
anchored = 0
max_integrity = 300
var/list/ingredients = list()
var/dispense_flavour = 1
var/obj/item/reagent_containers/glass/held_container
/obj/machinery/icecream_vat/New()
..()
create_reagents(50)
while(ingredients.len < 11)
ingredients.Add(5)
/obj/machinery/icecream_vat/attack_hand(mob/user)
user.set_machine(src)
interact(user)
/obj/machinery/icecream_vat/interact(mob/user)
var/dat
dat += "<a href='?src=[UID()];dispense=[ICECREAM_VANILLA]'><b>Dispense vanilla icecream</b></a> There is [ingredients[ICECREAM_VANILLA]] scoops of vanilla icecream left (made from milk and ice).<br>"
dat += "<a href='?src=[UID()];dispense=[FLAVOUR_STRAWBERRY]'><b>Dispense strawberry icecream</b></a> There is [ingredients[FLAVOUR_STRAWBERRY]] dollops of strawberry flavouring left (obtained from berry juice.<br>"
dat += "<a href='?src=[UID()];dispense=[FLAVOUR_CHOCOLATE]'><b>Dispense chocolate icecream</b></a> There is [ingredients[FLAVOUR_CHOCOLATE]] dollops of chocolate flavouring left (obtained from cocoa powder).<br>"
dat += "<a href='?src=[UID()];dispense=[FLAVOUR_BLUE]'><b>Dispense blue icecream</b></a> There is [ingredients[FLAVOUR_BLUE]] dollops of blue flavouring left (obtained from bluespace tomato singulo).<br>"
dat += "<br>"
dat += "<a href='?src=[UID()];cone=[CONE_WAFFLE]'><b>Dispense waffle cones</b></a> There are [ingredients[CONE_WAFFLE]] waffle cones left. <br>"
dat += "<a href='?src=[UID()];cone=[CONE_CHOC]'><b>Dispense chocolate cones</b></a> There are [ingredients[CONE_CHOC]] chocolate cones left.<br>"
dat += "<br>"
dat += "<a href='?src=[UID()];make=[CONE_WAFFLE]'><b>Make waffle cones</b></a> There is [ingredients[INGR_FLOUR]]/[ingredients[INGR_SUGAR]] of flour and sugar left.<br>"
dat += "<a href='?src=[UID()];make=[CONE_CHOC]'><b>Make chocolate cones</b></a> There is [ingredients[FLAVOUR_CHOCOLATE]]/[ingredients[CONE_WAFFLE]] of chocolate flavouring and waffle cones left.<br>"
dat += "<a href='?src=[UID()];make=[ICECREAM_VANILLA]'><b>Make vanilla icecream</b></a> There is [ingredients[INGR_MILK]]/[ingredients[INGR_ICE]] of milk and ice left.<br>"
dat += "<br>"
if(held_container)
dat += "<a href='?src=[UID()];eject=1'>Eject [held_container]</a> "
else
dat += "No beaker inserted. "
dat += "<a href='?src=[UID()];refresh=1'>Refresh</a> <a href='?src=[UID()];close=1'>Close</a>"
var/datum/browser/popup = new(user, "icecreamvat", name, 600, 400)
popup.set_content(dat)
popup.open(0)
/obj/machinery/icecream_vat/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/reagent_containers))
if(istype(O, /obj/item/reagent_containers/food/snacks/icecream))
var/obj/item/reagent_containers/food/snacks/icecream/I = O
if(!I.ice_creamed)
if(ingredients[ICECREAM_VANILLA] > 0)
var/flavour_name = get_icecream_flavour_string(dispense_flavour)
if(dispense_flavour < 11 && ingredients[dispense_flavour] > 0)
visible_message("[bicon(src)] <span class='info'>[user] scoops delicious [flavour_name] flavoured icecream into [I].</span>")
ingredients[dispense_flavour] -= 1
ingredients[ICECREAM_VANILLA] -= 1
I.add_ice_cream(dispense_flavour)
if(held_container)
held_container.reagents.trans_to(I, 10)
if(I.reagents.total_volume < 10)
I.reagents.add_reagent("sugar", 10 - I.reagents.total_volume)
else
to_chat(user, "<span class='warning'>There is not enough [flavour_name] flavouring left! Insert more of the required ingredients.</span>")
else
to_chat(user, "<span class='warning'>There is not enough icecream left! Insert more milk and ice.</span>")
else
to_chat(user, "<span class='notice'>[O] already has icecream in it.</span>")
else if(istype(O, /obj/item/reagent_containers/glass))
if(held_container)
to_chat(user, "<span class='notice'>You must remove [held_container] from [src] first.</span>")
else
if(!user.drop_item())
to_chat(user, "<span class='warning'>\The [O] is stuck to your hand!</span>")
return
O.forceMove(src)
to_chat(user, "<span class='info'>You insert [O] into [src].</span>")
held_container = O
else
var/obj/item/reagent_containers/R = O
if(R.reagents)
visible_message("<span class='info'>[user] has emptied all of [R] into [src].</span>")
for(var/datum/reagent/current_reagent in R.reagents.reagent_list)
if(GLOB.ingredients_source[current_reagent.id])
add(GLOB.ingredients_source[current_reagent.id], current_reagent.volume / 2)
else
add(MUCK, current_reagent.volume / 5)
R.reagents.clear_reagents()
return 1
else
return ..()
/obj/machinery/icecream_vat/proc/add(var/add_type, var/amount)
if(add_type <= ingredients.len)
ingredients[add_type] += amount
updateDialog()
/obj/machinery/icecream_vat/proc/make(var/mob/user, var/make_type)
switch(make_type)
if(CONE_WAFFLE)
if(ingredients[INGR_FLOUR] > 0 && ingredients[INGR_SUGAR] > 0)
var/amount = max( min(ingredients[INGR_FLOUR], ingredients[INGR_SUGAR]), 5)
ingredients[INGR_FLOUR] -= amount
ingredients[INGR_SUGAR] -= amount
ingredients[CONE_WAFFLE] += amount
visible_message("<span class='info'>[user] cooks up some waffle cones.</span>")
else
to_chat(user, "<span class='notice'>You require sugar and flour to make waffle cones.</span>")
if(CONE_CHOC)
if(ingredients[FLAVOUR_CHOCOLATE] > 0 && ingredients[CONE_WAFFLE] > 0)
var/amount = min(ingredients[CONE_WAFFLE], ingredients[FLAVOUR_CHOCOLATE])
ingredients[CONE_WAFFLE] -= amount
ingredients[FLAVOUR_CHOCOLATE] -= amount
ingredients[CONE_CHOC] += amount
visible_message("<span class='info'>[user] cooks up some chocolate cones.</span>")
else
to_chat(user, "<span class='notice'>You require waffle cones and chocolate flavouring to make chocolate cones.</span>")
if(ICECREAM_VANILLA)
if(ingredients[INGR_ICE] > 0 && ingredients[INGR_MILK] > 0)
var/amount = min(ingredients[INGR_ICE], ingredients[INGR_MILK])
ingredients[INGR_ICE] -= amount
ingredients[INGR_MILK] -= amount
ingredients[ICECREAM_VANILLA] += amount
visible_message("<span class='info'>[user] whips up some vanilla icecream.</span>")
else
to_chat(user, "<span class='notice'>You require milk and ice to make vanilla icecream.</span>")
updateDialog()
/obj/machinery/icecream_vat/Topic(href, href_list)
if(..())
return
if(href_list["dispense"])
dispense_flavour = text2num(href_list["dispense"])
visible_message("<span class='notice'>[usr] sets [src] to dispense [get_icecream_flavour_string(dispense_flavour)] flavoured icecream.</span>")
if(href_list["cone"])
var/dispense_cone = text2num(href_list["cone"])
if(ingredients[dispense_cone] <= ingredients.len)
var/cone_name = get_icecream_flavour_string(dispense_cone)
if(ingredients[dispense_cone] >= 1)
ingredients[dispense_cone] -= 1
var/obj/item/reagent_containers/food/snacks/icecream/I = new(loc)
I.cone_type = cone_name
I.icon_state = "icecream_cone_[cone_name]"
I.desc = "Delicious [cone_name] cone, but no ice cream."
visible_message("<span class='info'>[usr] dispenses a crunchy [cone_name] cone from [src].</span>")
else
to_chat(usr, "<span class='warning'>There are no [cone_name] cones left!</span>")
updateDialog()
if(href_list["make"])
make( usr, text2num(href_list["make"]) )
updateDialog()
if(href_list["eject"])
if(held_container)
held_container.forceMove(loc)
held_container = null
updateDialog()
if(href_list["refresh"])
updateDialog()
if(href_list["close"])
usr.unset_machine()
usr << browse(null,"window=icecreamvat")
return
/obj/machinery/icecream_vat/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
new /obj/item/stack/sheet/metal(loc, 4)
qdel(src)
/obj/item/reagent_containers/food/snacks/icecream
name = "ice cream cone"
desc = "Delicious waffle cone, but no ice cream."
icon = 'icons/obj/kitchen.dmi'
icon_state = "icecream_cone"
layer = 3.1
var/ice_creamed = 0
var/cone_type
bitesize = 3
/obj/item/reagent_containers/food/snacks/icecream/New()
..()
create_reagents(20)
reagents.add_reagent("nutriment", 5)
/obj/item/reagent_containers/food/snacks/icecream/proc/add_ice_cream(var/flavour)
var/flavour_name = get_icecream_flavour_string(flavour)
name = "[flavour_name] icecream"
overlays += "icecream_[flavour_name]"
desc = "Delicious [cone_type] cone with a dollop of [flavour_name] ice cream."
ice_creamed = 1
#undef ICECREAM_VANILLA
#undef FLAVOUR_CHOCOLATE
#undef FLAVOUR_STRAWBERRY
#undef FLAVOUR_BLUE
#undef CONE_WAFFLE
#undef CONE_CHOC
#undef INGR_MILK
#undef INGR_FLOUR
#undef INGR_SUGAR
#undef INGR_ICE
#undef MUCK
+1 -6
View File
@@ -3,11 +3,6 @@
GLOBAL_DATUM_INIT(library_catalog, /datum/library_catalog, new())
GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "Adult", "Reference", "Religion"))
/hook/startup/proc/load_manuals()
GLOB.library_catalog.initialize()
return 1
/*
* Borrowbook datum
*/
@@ -65,7 +60,7 @@ GLOBAL_LIST_INIT(library_section_names, list("Any", "Fiction", "Non-Fiction", "A
/datum/library_catalog
var/list/cached_books = list()
/datum/library_catalog/proc/initialize()
/datum/library_catalog/New()
var/newid=1
for(var/typepath in subtypesof(/obj/item/book/manual))
var/obj/item/book/B = new typepath(null)
+1 -1
View File
@@ -624,7 +624,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(href_list["jump"])
var/mob/target = locate(href_list["jump"])
var/mob/A = usr;
var/mob/A = usr
to_chat(A, "Teleporting to [target]...")
//var/mob/living/silicon/ai/A = locate(href_list["track2"]) in GLOB.mob_list
if(target && target != usr)
@@ -16,7 +16,7 @@
death()
return
if(paralysis || sleeping || getOxyLoss() > 50 || (HEALTH_THRESHOLD_CRIT <= health && check_death_method()))
if(paralysis || sleeping || getOxyLoss() > 50 || (health <= HEALTH_THRESHOLD_CRIT && check_death_method()))
if(stat == CONSCIOUS)
KnockOut()
create_debug_log("fell unconscious, trigger reason: [reason]")
@@ -1,17 +1,5 @@
GLOBAL_LIST_INIT(body_accessory_by_name, list("None" = null))
/hook/startup/proc/initalize_body_accessories()
__init_body_accessory(/datum/body_accessory/body)
__init_body_accessory(/datum/body_accessory/tail)
if(GLOB.body_accessory_by_name.len)
if(initialize_body_accessory_by_species())
return TRUE
return FALSE //fail if no bodies are found
GLOBAL_LIST_INIT(body_accessory_by_species, list("None" = null))
/proc/initialize_body_accessory_by_species()
@@ -1,15 +1,5 @@
GLOBAL_LIST_EMPTY(empty_playable_ai_cores)
/hook/roundstart/proc/spawn_empty_ai()
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
if(S.name != "AI")
continue
if(locate(/mob/living) in S.loc)
continue
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(get_turf(S))
return 1
/mob/living/silicon/ai/verb/wipe_core()
set name = "Wipe Core"
set category = "OOC"
@@ -1,6 +1,6 @@
// Recruiting observers to play as pAIs
GLOBAL_DATUM(paiController, /datum/paiController) // Global handler for pAI candidates
GLOBAL_DATUM_INIT(paiController, /datum/paiController, new) // Global handler for pAI candidates
/datum/paiCandidate
var/name
@@ -10,12 +10,6 @@ GLOBAL_DATUM(paiController, /datum/paiController) // Global handler for pAI cand
var/comments
var/ready = 0
/hook/startup/proc/paiControllerSetup()
GLOB.paiController = new /datum/paiController()
return 1
/datum/paiController
var/list/pai_candidates = list()
var/list/asked = list()
@@ -13,19 +13,6 @@ GLOBAL_LIST_INIT(pai_emotions, list(
GLOBAL_LIST_EMPTY(pai_software_by_key)
GLOBAL_LIST_EMPTY(default_pai_software)
/hook/startup/proc/populate_pai_software_list()
var/r = 1 // I would use ., but it'd sacrifice runtime detection
for(var/type in subtypesof(/datum/pai_software))
var/datum/pai_software/P = new type()
if(GLOB.pai_software_by_key[P.id])
var/datum/pai_software/O = GLOB.pai_software_by_key[P.id]
to_chat(world, "<span class='warning'>pAI software module [P.name] has the same key as [O.name]!</span>")
r = 0
continue
GLOB.pai_software_by_key[P.id] = P
if(P.default)
GLOB.default_pai_software[P.id] = P
return r
/mob/living/silicon/pai/New()
..()
@@ -227,7 +227,7 @@
throw_speed = 5
throw_range = 10
origin_tech = "magnets=1;biotech=1"
var/mode = 1;
var/mode = 1
/obj/item/robotanalyzer/attack(mob/living/M as mob, mob/living/user as mob)
if(( (CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
@@ -239,7 +239,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
if(custom_name)
return 0
if(!allow_rename)
to_chat(src, "<span class='warning'>Rename functionality is not enabled on this unit.</span>");
to_chat(src, "<span class='warning'>Rename functionality is not enabled on this unit.</span>")
return 0
rename_self(braintype, 1)
+2 -2
View File
@@ -92,7 +92,7 @@
var output = "<!DOCTYPE html><html><body>"
if(polltype == POLLTYPE_MULTI || polltype == POLLTYPE_OPTION)
select_query = GLOB.dbcon.NewQuery("SELECT text, percentagecalc, (SELECT COUNT(optionid) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id GROUP BY optionid) AS votecount FROM [format_table_name("poll_option")] WHERE pollid = [pollid]");
select_query = GLOB.dbcon.NewQuery("SELECT text, percentagecalc, (SELECT COUNT(optionid) FROM [format_table_name("poll_vote")] WHERE optionid = poll_option.id GROUP BY optionid) AS votecount FROM [format_table_name("poll_option")] WHERE pollid = [pollid]")
select_query.Execute()
var/list/options = list()
var/total_votes = 1
@@ -177,7 +177,7 @@
output += "</table></td></tr>"
output += "</table>"
if(polltype == POLLTYPE_TEXT)
select_query = GLOB.dbcon.NewQuery("SELECT replytext, COUNT(replytext) AS countresponse, GROUP_CONCAT(DISTINCT ckey SEPARATOR ', ') as ckeys FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] GROUP BY replytext ORDER BY countresponse DESC");
select_query = GLOB.dbcon.NewQuery("SELECT replytext, COUNT(replytext) AS countresponse, GROUP_CONCAT(DISTINCT ckey SEPARATOR ', ') as ckeys FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] GROUP BY replytext ORDER BY countresponse DESC")
select_query.Execute()
output += {"
<table width='900' align='center' bgcolor='#eeffee' cellspacing='0' cellpadding='4'>
+1 -1
View File
@@ -57,7 +57,7 @@
log_world("NanoMapGen: <B>GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])</B>")
to_chat(usr, "NanoMapGen: <B>GENERATE MAP ([startX],[startY],[currentZ]) to ([endX],[endY],[currentZ])</B>")
var/count = 0;
var/count = 0
for(var/WorldX = startX, WorldX <= endX, WorldX++)
for(var/WorldY = startY, WorldY <= endY, WorldY++)
+1 -1
View File
@@ -163,7 +163,7 @@
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
open_uis[src_object_key] = list(ui.ui_key = list())
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !istype(open_uis[src_object_key][ui.ui_key], /list))
open_uis[src_object_key][ui.ui_key] = list();
open_uis[src_object_key][ui.ui_key] = list()
ui.user.open_uis.Add(ui)
var/list/uis = open_uis[src_object_key][ui.ui_key]
+1 -1
View File
@@ -231,7 +231,7 @@ GLOBAL_LIST_INIT(SpookyGhosts, list("ghost","shade","shade2","ghost-narsie","hor
var/atoms[] = list()
for(var/turf/the_turf in turfs)
// Add ourselves to the list of stuff to draw
atoms.Add(the_turf);
atoms.Add(the_turf)
// As well as anything that isn't invisible.
for(var/atom/A in the_turf)
if(A.invisibility)
+211
View File
@@ -0,0 +1,211 @@
//Bureaucracy machine!
//Simply set this up in the hopline and you can serve people based on ticket numbers
/obj/machinery/ticket_machine
name = "ticket machine"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "ticketmachine"
desc = "A marvel of bureaucratic engineering encased in an efficient plastic shell. It can be refilled with a hand labeler refill roll and linked to buttons with a multitool."
density = FALSE
maptext_height = 26
maptext_width = 32
maptext_x = 7
maptext_y = 10
layer = HIGH_OBJ_LAYER
var/ticket_number = 0 //Increment the ticket number whenever the HOP presses his button
var/current_number = 0 //What ticket number are we currently serving?
var/max_number = 100 //At this point, you need to refill it.
var/cooldown = 50
var/ready = TRUE
var/list/ticket_holders = list()
var/list/tickets = list()
var/id = 1
/obj/machinery/ticket_machine/Destroy()
for(var/obj/item/ticket_machine_ticket/ticket in tickets)
ticket.visible_message("<span class='notice'>\the [ticket] disperses!</span>")
qdel(ticket)
tickets.Cut()
return ..()
/obj/machinery/ticket_machine/emag_act(mob/user) //Emag the ticket machine to dispense burning tickets, as well as randomize its number to destroy the HoP's mind.
if(emagged)
return
to_chat(user, "<span class='warning'>You overload [src]'s bureaucratic logic circuitry to its MAXIMUM setting.</span>")
ticket_number = rand(0, max_number)
current_number = ticket_number
emagged = TRUE
for(var/obj/item/ticket_machine_ticket/ticket in tickets)
ticket.visible_message("<span class='notice'>\the [ticket] disperses!</span>")
qdel(ticket)
tickets.Cut()
update_icon()
/obj/machinery/ticket_machine/Initialize(mapload)
. = ..()
update_icon()
/obj/machinery/ticket_machine/proc/increment()
if(current_number > ticket_number)
return
if(current_number && !(emagged) && tickets[current_number])
var/obj/item/ticket_machine_ticket/ticket = tickets[current_number]
ticket.audible_message("<span class='notice'>\the [tickets[current_number]] disperses!</span>")
qdel(ticket)
if(current_number < ticket_number)
current_number ++ //Increment the one we're serving.
playsound(src, 'sound/misc/announce_dig.ogg', 50, FALSE)
atom_say("Now serving ticket #[current_number]!")
if(!(emagged) && tickets[current_number])
var/obj/item/ticket_machine_ticket/ticket = tickets[current_number]
ticket.audible_message("<span class='notice'>\the [tickets[current_number]] vibrates!</span>")
update_icon() //Update our icon here rather than when they take a ticket to show the current ticket number being served
/obj/machinery/door_control/ticket_machine_button
name = "increment ticket counter"
desc = "Use this button after you've served someone to tell the next person to come forward."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "doorctrl0"
req_access = list()
id = 1
var/cooldown = FALSE
/obj/machinery/door_control/ticket_machine_button/attack_hand(mob/user)
if(allowed(usr) || user.can_advanced_admin_interact())
icon_state = "doorctrl1"
addtimer(CALLBACK(src, /obj/machinery/door_control/ticket_machine_button/.proc/update_icon), 15)
for(var/obj/machinery/ticket_machine/M in GLOB.machines)
if(M.id == id)
if(cooldown)
return
cooldown = TRUE
M.increment()
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 10)
else
to_chat(usr, "<span class='warning'>Access denied.</span>")
flick("doorctrl-denied", src)
/obj/machinery/door_control/ticket_machine_button/update_icon()
if(!(stat & NOPOWER))
icon_state = "doorctrl0"
/obj/machinery/ticket_machine/update_icon()
switch(ticket_number) //Gives you an idea of how many tickets are left
if(0 to 49)
icon_state = "ticketmachine_100"
if(50 to 99)
icon_state = "ticketmachine_50"
if(100)
icon_state = "ticketmachine_0"
handle_maptext()
/obj/machinery/ticket_machine/proc/handle_maptext()
switch(ticket_number) //This is here to handle maptext offsets so that the numbers align.
if(0 to 9)
maptext_x = 13
if(10 to 99)
maptext_x = 10
if(100)
maptext_x = 8
maptext = "[current_number]" //Finally, apply the maptext
/obj/machinery/ticket_machine/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/hand_labeler_refill))
if(!(ticket_number >= max_number))
to_chat(user, "<span class='notice'>[src] refuses [I]! There [max_number-ticket_number==1 ? "is" : "are"] still [max_number-ticket_number] ticket\s left!</span>")
return
to_chat(user, "<span class='notice'>You start to refill [src]'s ticket holder (doing this will reset its ticket count!).</span>")
if(do_after(user, 30, target = src))
to_chat(user, "<span class='notice'>You insert [I] into [src] as it whirs nondescriptly.</span>")
user.drop_item()
qdel(I)
ticket_number = 0
current_number = 0
for(var/obj/item/ticket_machine_ticket/ticket in tickets)
ticket.audible_message("<span class='notice'>\the [ticket] disperses!</span>")
qdel(ticket)
tickets.Cut()
max_number = initial(max_number)
update_icon()
return
else
return ..()
/obj/machinery/ticket_machine/proc/reset_cooldown()
ready = TRUE
/obj/machinery/ticket_machine/attack_hand(mob/living/carbon/user)
. = ..()
if(!ready)
to_chat(user,"<span class='warning'>You press the button, but nothing happens...</span>")
return
if(ticket_number >= max_number)
to_chat(user,"<span class='warning'>Ticket supply depleted, please refill this unit with a hand labeller refill cartridge!</span>")
return
if((user.UID() in ticket_holders) && !(emagged))
to_chat(user, "<span class='warning'>You already have a ticket!</span>")
return
playsound(src, 'sound/machines/terminal_insert_disc.ogg', 100, FALSE)
ticket_number ++
to_chat(user, "<span class='notice'>You take a ticket from [src], looks like you're ticket number #[ticket_number]...</span>")
var/obj/item/ticket_machine_ticket/theirticket = new /obj/item/ticket_machine_ticket(get_turf(src))
theirticket.name = "Ticket #[ticket_number]"
theirticket.maptext = "<font color='#000000'>[ticket_number]</font>"
theirticket.saved_maptext = "<font color='#000000'>[ticket_number]</font>"
theirticket.ticket_number = ticket_number
theirticket.source = src
theirticket.owner = user.UID()
user.put_in_hands(theirticket)
ticket_holders += user.UID()
tickets += theirticket
if(emagged) //Emag the machine to destroy the HOP's life.
ready = FALSE
addtimer(CALLBACK(src, .proc/reset_cooldown), cooldown)//Small cooldown to prevent piles of flaming tickets
theirticket.fire_act()
user.drop_item()
user.adjust_fire_stacks(1)
user.IgniteMob()
/obj/item/ticket_machine_ticket
name = "Ticket"
desc = "A ticket which shows your place in the Head of Personnel's line. Made from Nanotrasen patented NanoPaper®. Though solid, its form seems to shimmer slightly. Feels (and burns) just like the real thing."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "ticket"
maptext_x = 7
maptext_y = 10
w_class = WEIGHT_CLASS_TINY
resistance_flags = FLAMMABLE
max_integrity = 50
var/saved_maptext = null
var/owner //soft ref of the ticket owner's UID()
var/obj/machinery/ticket_machine/source
var/ticket_number
/obj/item/ticket_machine_ticket/attack_hand(mob/user)
. = ..()
maptext = saved_maptext //For some reason, storage code removes all maptext off objs, this stops its number from being wiped off when taken out of storage.
/obj/item/ticket_machine_ticket/attackby(obj/item/P, mob/living/carbon/human/user, params) //Stolen from papercode
..()
if(is_hot(P))
if((CLUMSY in user.mutations) && prob(10))
user.visible_message("<span class='warning'>[user] accidentally ignites [user.p_them()]self!</span>", \
"<span class='userdanger'>You miss the paper and accidentally light yourself on fire!</span>")
user.drop_item()
user.adjust_fire_stacks(1)
user.IgniteMob()
return
user.visible_message("<span class='danger'>[user] lights [src] ablaze with [P]!</span>", "<span class='danger'>You light [src] on fire!</span>")
fire_act()
/obj/item/paper/extinguish()
..()
update_icon()
/obj/item/ticket_machine_ticket/Destroy()
if(owner && source)
source.ticket_holders -= owner
source.tickets[ticket_number] = null
source = null
return ..()
+25 -26
View File
@@ -18,62 +18,61 @@
..()
chambered = new /obj/item/ammo_casing/syringegun(src)
/obj/item/gun/syringe/newshot()
if(!syringes.len)
/obj/item/gun/syringe/process_chamber()
if(!length(syringes) || chambered.BB)
return
var/obj/item/reagent_containers/syringe/S = syringes[1]
if(!S)
return
chambered.BB = new S.projectile_type (src)
chambered.BB = new S.projectile_type(src)
S.reagents.trans_to(chambered.BB, S.reagents.total_volume)
chambered.BB.name = S.name
syringes.Remove(S)
qdel(S)
return
/obj/item/gun/syringe/process_chamber()
return
/obj/item/gun/syringe/afterattack(atom/target as mob|obj|turf, mob/living/user as mob|obj, params)
/obj/item/gun/syringe/afterattack(atom/target, mob/living/user, flag, params)
if(target == loc)
return
newshot()
..()
/obj/item/gun/syringe/examine(mob/user)
. = ..()
. += "Can hold [max_syringes] syringe\s. Has [syringes.len] syringe\s remaining."
var/num_syringes = syringes.len + (chambered.BB ? 1 : 0)
. += "Can hold [max_syringes] syringe\s. Has [num_syringes] syringe\s remaining."
/obj/item/gun/syringe/attack_self(mob/living/user as mob)
if(!syringes.len)
/obj/item/gun/syringe/attack_self(mob/living/user)
if(!length(syringes) && !chambered.BB)
to_chat(user, "<span class='notice'>[src] is empty.</span>")
return 0
return FALSE
var/obj/item/reagent_containers/syringe/S = syringes[syringes.len]
if(!S)
return 0
S.loc = user.loc
var/obj/item/reagent_containers/syringe/S
if(chambered.BB) // Remove the chambered syringe first
S = new()
chambered.BB.reagents.trans_to(S, chambered.BB.reagents.total_volume)
qdel(chambered.BB)
chambered.BB = null
else
S = syringes[length(syringes)]
user.put_in_hands(S)
syringes.Remove(S)
process_chamber()
to_chat(user, "<span class='notice'>You unload [S] from \the [src]!</span>")
return TRUE
return 1
/obj/item/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = 1)
/obj/item/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
if(istype(A, /obj/item/reagent_containers/syringe))
if(syringes.len < max_syringes)
if(length(syringes) < max_syringes)
if(!user.unEquip(A))
return
to_chat(user, "<span class='notice'>You load [A] into \the [src]!</span>")
syringes.Add(A)
A.loc = src
return 1
process_chamber() // Chamber the syringe if none is already
return TRUE
else
to_chat(user, "<span class='notice'>[src] cannot hold more syringes.</span>")
else
@@ -185,8 +185,8 @@
color = COLOR_PALE_BTL_GREEN
if("Orange wrapper")
color = COLOR_ORANGE
loaded_pill_bottle.wrapper_color = color;
loaded_pill_bottle.apply_wrap();
loaded_pill_bottle.wrapper_color = color
loaded_pill_bottle.apply_wrap()
else if(href_list["close"])
usr << browse(null, "window=chem_master")
onclose(usr, "chem_master")
+30
View File
@@ -305,6 +305,11 @@ GLOBAL_DATUM(blackbox, /obj/machinery/blackbox_recorder)
//This proc is only to be called at round end.
/obj/machinery/blackbox_recorder/proc/save_all_data_to_sql()
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Blackbox seal blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to seal the blackbox via advanced proc-call")
log_admin("[key_name(usr)] attempted to seal the blackbox via advanced proc-call")
return
if(!feedback) return
round_end_data_gathering() //round_end time logging and some other data processing
@@ -331,6 +336,11 @@ GLOBAL_DATUM(blackbox, /obj/machinery/blackbox_recorder)
proc/feedback_set(var/variable,var/value)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Feedback edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
return
if(!GLOB.blackbox) return
variable = sanitizeSQL(variable)
@@ -342,6 +352,11 @@ proc/feedback_set(var/variable,var/value)
FV.set_value(value)
proc/feedback_inc(var/variable,var/value)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Feedback edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
return
if(!GLOB.blackbox) return
variable = sanitizeSQL(variable)
@@ -353,6 +368,11 @@ proc/feedback_inc(var/variable,var/value)
FV.inc(value)
proc/feedback_dec(var/variable,var/value)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Feedback edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
return
if(!GLOB.blackbox) return
variable = sanitizeSQL(variable)
@@ -364,6 +384,11 @@ proc/feedback_dec(var/variable,var/value)
FV.dec(value)
proc/feedback_set_details(var/variable,var/details)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Feedback edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
return
if(!GLOB.blackbox) return
variable = sanitizeSQL(variable)
@@ -376,6 +401,11 @@ proc/feedback_set_details(var/variable,var/details)
FV.set_details(details)
proc/feedback_add_details(var/variable,var/details)
if(IsAdminAdvancedProcCall())
to_chat(usr, "<span class='boldannounce'>Feedback edit blocked: Advanced ProcCall detected.</span>")
message_admins("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
log_admin("[key_name(usr)] attempted to edit feedback data via advanced proc-call")
return
if(!GLOB.blackbox) return
variable = sanitizeSQL(variable)
+2 -1
View File
@@ -297,7 +297,8 @@
timer = 0
open_dock()
/obj/docking_port/mobile/emergency/proc/open_dock();
/obj/docking_port/mobile/emergency/proc/open_dock()
pass()
/*
for(var/obj/machinery/door/poddoor/shuttledock/D in airlocks)
var/turf/T = get_step(D, D.checkdir)
+16 -1
View File
@@ -160,6 +160,12 @@
var/lock_shuttle_doors = 0
// Preset for adding whiteship docks to ruins. Has widths preset which will auto-assign the shuttle
/obj/docking_port/stationary/whiteship
dwidth = 10
height = 35
width = 21
/obj/docking_port/stationary/register()
if(!SSshuttle)
throw EXCEPTION("docking port [src] could not initialize.")
@@ -863,7 +869,16 @@
desc = "Used to control the White Ship."
circuit = /obj/item/circuitboard/white_ship
shuttleId = "whiteship"
possible_destinations = "whiteship_away;whiteship_home"
possible_destinations = null // Set at runtime
/obj/machinery/computer/shuttle/white_ship/Initialize(mapload)
if(mapload)
return INITIALIZE_HINT_LATELOAD
return ..()
// Yes. This is disgusting, but the console needs to be loaded AFTER the docking ports load.
/obj/machinery/computer/shuttle/white_ship/LateInitialize()
Initialize()
/obj/machinery/computer/shuttle/engineering
name = "Engineering Shuttle Console"
-12
View File
@@ -3,18 +3,6 @@ GLOBAL_LIST_EMPTY(chargen_robolimbs)
GLOBAL_LIST_EMPTY(selectable_robolimbs)
GLOBAL_DATUM(basic_robolimb, /datum/robolimb)
/proc/populate_robolimb_list()
GLOB.basic_robolimb = new()
for(var/limb_type in typesof(/datum/robolimb))
var/datum/robolimb/R = new limb_type()
GLOB.all_robolimbs[R.company] = R
if(!R.unavailable_at_chargen)
if(R != "head" && R != "chest" && R != "groin" ) //Part of the method that ensures only IPCs can access head, chest and groin prosthetics.
if(R.has_subtypes) //Ensures solos get added to the list as well be incorporating has_subtypes == 1 and has_subtypes == 2.
GLOB.chargen_robolimbs[R.company] = R //List only main brands and solo parts.
if(R.selectable)
GLOB.selectable_robolimbs[R.company] = R
/datum/robolimb
var/company = "Unbranded" // Shown when selecting the limb.
var/desc = "A generic unbranded robotic prosthesis." // Seen when examining a limb.