Replaces some var values with defines

This commit is contained in:
Jordan Brown
2018-02-10 12:10:40 -05:00
committed by CitadelStationBot
parent 9986038318
commit fd479e7128
36 changed files with 200 additions and 129 deletions
+2 -2
View File
@@ -108,7 +108,7 @@ Class Procs:
var/list/occupant_typecache //if set, turned into typecache in Initialize, other wise, defaults to mob/living typecache
var/atom/movable/occupant = null
var/interact_open = FALSE // Can the machine be interacted with when in maint/when the panel is open.
var/interact_offline = 0 // Can the machine be interacted with while de-powered.
var/interact_offline = FALSE // Can the machine be interacted with while de-powered.
var/speed_process = FALSE // Process as fast as possible?
var/obj/item/circuitboard/circuit // Circuit to be created and inserted when the machinery is created
@@ -479,7 +479,7 @@ Class Procs:
/obj/machinery/tesla_act(power, explosive = FALSE)
..()
if(prob(85) && explosive)
explosion(src.loc,1,2,4,flame_range = 2, adminlog = 0, smoke = 0)
explosion(src.loc, 1, 2, 4, flame_range = 2, adminlog = FALSE, smoke = FALSE)
else if(prob(50))
emp_act(EMP_LIGHT)
else
+47 -45
View File
@@ -6,6 +6,11 @@ GLOBAL_LIST_EMPTY(req_console_supplies)
GLOBAL_LIST_EMPTY(req_console_information)
GLOBAL_LIST_EMPTY(allConsoles)
#define NO_NEW_MESSAGE 0
#define NORMAL_MESSAGE_PRIORITY 1
#define HIGH_MESSAGE_PRIORITY 2
#define EXTREME_MESSAGE_PRIORITY 3 // not implemented, will probably require some hacking... everything needs to have a hidden feature in this game.
/obj/machinery/requests_console
name = "requests console"
desc = "A console intended to send requests to different departments on the station."
@@ -23,11 +28,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
// 5 = ass + info
// 6 = sup + info
// 7 = ass + sup + info
var/newmessagepriority = 0
// 0 = no new message
// 1 = normal priority
// 2 = high priority
// 3 = extreme priority - not implemented, will probably require some hacking... everything needs to have a hidden feature in this game.
var/newmessagepriority = NO_NEW_MESSAGE
var/screen = 0
// 0 = main menu,
// 1 = req. assistance,
@@ -40,15 +41,11 @@ GLOBAL_LIST_EMPTY(allConsoles)
// 8 = view messages
// 9 = authentication before sending
// 10 = send announcement
var/silent = 0 // set to 1 for it not to beep all the time
var/hackState = 0
// 0 = not hacked
// 1 = hacked
var/announcementConsole = 0
// 0 = This console cannot be used to send department announcements
// 1 = This console can send department announcements
var/open = FALSE // 1 if open
var/announceAuth = 0 //Will be set to 1 when you authenticate yourself for announcements
var/silent = FALSE // set to 1 for it not to beep all the time
var/hackState = FALSE
var/announcementConsole = FALSE // FALSE = This console cannot be used to send department announcements, TRUE = This console can send department announcements
var/open = FALSE // TRUE if open
var/announceAuth = FALSE //Will be set to 1 when you authenticate yourself for announcements
var/msgVerified = "" //Will contain the name of the person who verified it
var/msgStamped = "" //If a message is stamped, this will contain the stamp name
var/message = "";
@@ -78,11 +75,11 @@ GLOBAL_LIST_EMPTY(allConsoles)
if(icon_state != "req_comp_off")
icon_state = "req_comp_off"
else
if(emergency || (newmessagepriority == 3))
if(emergency || (newmessagepriority == EXTREME_MESSAGE_PRIORITY))
icon_state = "req_comp3"
else if(newmessagepriority == 2)
else if(newmessagepriority == HIGH_MESSAGE_PRIORITY)
icon_state = "req_comp2"
else if(newmessagepriority == 1)
else if(newmessagepriority == NORMAL_MESSAGE_PRIORITY)
icon_state = "req_comp1"
else
icon_state = "req_comp0"
@@ -194,10 +191,10 @@ GLOBAL_LIST_EMPTY(allConsoles)
if(8) //view messages
for (var/obj/machinery/requests_console/Console in GLOB.allConsoles)
if (Console.department == department)
Console.newmessagepriority = 0
Console.newmessagepriority = NO_NEW_MESSAGE
Console.update_icon()
newmessagepriority = 0
newmessagepriority = NO_NEW_MESSAGE
update_icon()
var/messageComposite = ""
for(var/msg in messages) // This puts more recent messages at the *top*, where they belong.
@@ -230,12 +227,12 @@ GLOBAL_LIST_EMPTY(allConsoles)
else //main menu
screen = 0
announceAuth = 0
if (newmessagepriority == 1)
announceAuth = FALSE
if (newmessagepriority == NORMAL_MESSAGE_PRIORITY)
dat += "<div class='notice'>There are new messages</div><BR>"
if (newmessagepriority == 2)
if (newmessagepriority == HIGH_MESSAGE_PRIORITY)
dat += "<div class='notice'>There are new <b>PRIORITY</b> messages</div><BR>"
if (newmessagepriority == 3)
if (newmessagepriority == EXTREME_MESSAGE_PRIORITY)
dat += "<div class='notice'>There are new <b>EXTREME PRIORITY</b> messages</div><BR>"
dat += "<A href='?src=[REF(src)];setScreen=8'>View Messages</A><BR><BR>"
@@ -296,7 +293,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
priority = text2num(href_list["priority"])
else
message = ""
announceAuth = 0
announceAuth = FALSE
screen = 0
if(href_list["sendAnnouncement"])
@@ -309,7 +306,7 @@ GLOBAL_LIST_EMPTY(allConsoles)
GLOB.news_network.SubmitArticle(message, department, "Station Announcements", null)
log_talk(usr,"[key_name(usr)] has made a station announcement: [message]",LOGSAY)
message_admins("[key_name_admin(usr)] has made a station announcement.")
announceAuth = 0
announceAuth = FALSE
message = ""
screen = 0
@@ -435,9 +432,9 @@ GLOBAL_LIST_EMPTY(allConsoles)
switch( href_list["setSilent"] )
if(null) //skip
if("1")
silent = 1
silent = TRUE
else
silent = 0
silent = FALSE
updateUsrDialog()
return
@@ -464,31 +461,31 @@ GLOBAL_LIST_EMPTY(allConsoles)
capitalize(title)
switch(priority)
if(2) //High priority
if(src.newmessagepriority < 2)
src.newmessagepriority = 2
src.update_icon()
if(!src.silent)
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
if(newmessagepriority < HIGH_MESSAGE_PRIORITY)
newmessagepriority = HIGH_MESSAGE_PRIORITY
update_icon()
if(!silent)
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
say(title)
src.messages += "<span class='bad'>High Priority</span><BR><b>From:</b> [linkedsender]<BR>[message]"
messages += "<span class='bad'>High Priority</span><BR><b>From:</b> [linkedsender]<BR>[message]"
if(3) // Extreme Priority
if(src.newmessagepriority < 3)
src.newmessagepriority = 3
src.update_icon()
if(newmessagepriority < EXTREME_MESSAGE_PRIORITY)
newmessagepriority = EXTREME_MESSAGE_PRIORITY
update_icon()
if(1)
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
say(title)
src.messages += "<span class='bad'>!!!Extreme Priority!!!</span><BR><b>From:</b> [linkedsender]<BR>[message]"
messages += "<span class='bad'>!!!Extreme Priority!!!</span><BR><b>From:</b> [linkedsender]<BR>[message]"
else // Normal priority
if(src.newmessagepriority < 1)
src.newmessagepriority = 1
src.update_icon()
if(newmessagepriority < NORMAL_MESSAGE_PRIORITY)
newmessagepriority = NORMAL_MESSAGE_PRIORITY
update_icon()
if(!src.silent)
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
say(title)
src.messages += "<b>From:</b> [linkedsender]<BR>[message]"
messages += "<b>From:</b> [linkedsender]<BR>[message]"
/obj/machinery/requests_console/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/crowbar))
@@ -519,9 +516,9 @@ GLOBAL_LIST_EMPTY(allConsoles)
updateUsrDialog()
if(screen == 10)
if (ACCESS_RC_ANNOUNCE in ID.access)
announceAuth = 1
announceAuth = TRUE
else
announceAuth = 0
announceAuth = FALSE
to_chat(user, "<span class='warning'>You are not authorized to send announcements!</span>")
updateUsrDialog()
return
@@ -532,3 +529,8 @@ GLOBAL_LIST_EMPTY(allConsoles)
updateUsrDialog()
return
return ..()
#undef NO_NEW_MESSAGE
#undef NORMAL_MESSAGE_PRIORITY
#undef HIGH_MESSAGE_PRIORITY
#undef EXTREME_MESSAGE_PRIORITY
@@ -265,7 +265,7 @@
chemholder = null
return ..()
/datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = 0)
/datum/effect_system/smoke_spread/chem/set_up(datum/reagents/carry = null, radius = 1, loca, silent = FALSE)
if(isturf(loca))
location = loca
else
+40 -31
View File
@@ -3,6 +3,12 @@
GLOBAL_LIST_EMPTY(PDAs)
#define PDA_SCANNER_NONE 0
#define PDA_SCANNER_MEDICAL 1
#define PDA_SCANNER_FORENSICS 2 //unused
#define PDA_SCANNER_REAGENT 3
#define PDA_SCANNER_HALOGEN 4
#define PDA_SCANNER_GAS 5
/obj/item/device/pda
name = "\improper PDA"
@@ -39,11 +45,11 @@ GLOBAL_LIST_EMPTY(PDAs)
#define MODE_VT 3
//Secondary variables
var/scanmode = 0 //1 is medical scanner, 2 is forensics, 3 is reagent scanner.
var/fon = 0 //Is the flashlight function on?
var/scanmode = PDA_SCANNER_NONE
var/fon = FALSE //Is the flashlight function on?
var/f_lum = 2.3 //Luminosity for the flashlight function
var/silent = 0 //To beep or not to beep, that is the question
var/toff = 0 //If 1, messenger disabled
var/silent = FALSE //To beep or not to beep, that is the question
var/toff = FALSE //If TRUE, messenger disabled
var/tnote = null //Current Texts
var/last_text //No text spamming
var/last_noise //Also no honk spamming that's bad too
@@ -53,10 +59,10 @@ GLOBAL_LIST_EMPTY(PDAs)
var/mimeamt = 0 //How many silence left when infected with mime.exe
var/note = "Congratulations, your station has chosen the Thinktronic 5230 Personal Data Assistant!" //Current note in the notepad function
var/notehtml = ""
var/notescanned = 0 // True if what is in the notekeeper was from a paper.
var/notescanned = FALSE // True if what is in the notekeeper was from a paper.
var/detonatable = TRUE // Can the PDA be blown up?
var/hidden = 0 // Is the PDA hidden from the PDA list?
var/emped = 0
var/hidden = FALSE // Is the PDA hidden from the PDA list?
var/emped = FALSE
var/equipped = FALSE //used here to determine if this is the first time its been picked up
var/obj/item/card/id/id = null //Making it possible to slot an ID card into the PDA so it can function as both.
@@ -415,7 +421,7 @@ GLOBAL_LIST_EMPTY(PDAs)
if (!isnull(cartridge))
U.put_in_hands(cartridge)
to_chat(U, "<span class='notice'>You remove [cartridge] from [src].</span>")
scanmode = 0
scanmode = PDA_SCANNER_NONE
cartridge.host_pda = null
cartridge = null
update_icon()
@@ -440,40 +446,40 @@ GLOBAL_LIST_EMPTY(PDAs)
if("Light")
if(fon)
fon = 0
fon = FALSE
set_light(0)
else if(f_lum)
fon = 1
fon = TRUE
set_light(f_lum)
update_icon()
if("Medical Scan")
if(scanmode == 1)
scanmode = 0
if(scanmode == PDA_SCANNER_MEDICAL)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_MEDICAL))
scanmode = 1
scanmode = PDA_SCANNER_MEDICAL
if("Reagent Scan")
if(scanmode == 3)
scanmode = 0
if(scanmode == PDA_SCANNER_REAGENT)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_REAGENT_SCANNER))
scanmode = 3
scanmode = PDA_SCANNER_REAGENT
if("Halogen Counter")
if(scanmode == 4)
scanmode = 0
if(scanmode == PDA_SCANNER_HALOGEN)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_ENGINE))
scanmode = 4
scanmode = PDA_SCANNER_HALOGEN
if("Honk")
if ( !(last_noise && world.time < last_noise + 20) )
playsound(loc, 'sound/items/bikehorn.ogg', 50, 1)
playsound(src, 'sound/items/bikehorn.ogg', 50, 1)
last_noise = world.time
if("Trombone")
if ( !(last_noise && world.time < last_noise + 20) )
playsound(loc, 'sound/misc/sadtrombone.ogg', 50, 1)
playsound(src, 'sound/misc/sadtrombone.ogg', 50, 1)
last_noise = world.time
if("Gas Scan")
if(scanmode == 5)
scanmode = 0
if(scanmode == PDA_SCANNER_GAS)
scanmode = PDA_SCANNER_NONE
else if((!isnull(cartridge)) && (cartridge.access & CART_ATMOS))
scanmode = 5
scanmode = PDA_SCANNER_GAS
if("Drone Phone")
var/alert_s = input(U,"Alert severity level","Ping Drones",null) as null|anything in list("Low","Medium","High","Critical")
var/area/A = get_area(U)
@@ -491,7 +497,7 @@ GLOBAL_LIST_EMPTY(PDAs)
if (mode == 1 && n)
note = n
notehtml = parsemarkdown(n, U)
notescanned = 0
notescanned = FALSE
else
U << browse(null, "window=pda")
return
@@ -571,7 +577,7 @@ GLOBAL_LIST_EMPTY(PDAs)
if ((honkamt > 0) && (prob(60)))//For clown virus.
honkamt--
playsound(loc, 'sound/items/bikehorn.ogg', 30, 1)
playsound(src, 'sound/items/bikehorn.ogg', 30, 1)
if(U.machine == src && href_list["skiprefresh"]!="1")//Final safety.
attack_self(U)//It auto-closes the menu prior if the user is not in range and so on.
@@ -656,7 +662,7 @@ GLOBAL_LIST_EMPTY(PDAs)
tnote += "<i><b>&larr; From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i><br>[signal.format_message()]<br>"
if (!silent)
playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
//Search for holder of the PDA.
var/mob/living/L = null
@@ -816,9 +822,6 @@ GLOBAL_LIST_EMPTY(PDAs)
healthscan(user, C, 1)
add_fingerprint(user)
if(2)
// Unused
if(4)
C.visible_message("<span class='warning'>[user] has analyzed [C]'s radiation levels!</span>")
@@ -875,7 +878,7 @@ GLOBAL_LIST_EMPTY(PDAs)
note = replacetext(note, "<ul>", "\[list\]")
note = replacetext(note, "</ul>", "\[/list\]")
note = html_encode(note)
notescanned = 1
notescanned = TRUE
to_chat(user, "<span class='notice'>Paper scanned. Saved to PDA's notekeeper.</span>" )
@@ -996,3 +999,9 @@ GLOBAL_LIST_EMPTY(PDAs)
if(!P.owner || P.toff || P.hidden)
continue
. += P
#undef PDA_SCANNER_NONE
#undef PDA_SCANNER_MEDICAL
#undef PDA_SCANNER_REAGENT
#undef PDA_SCANNER_HALOGEN
#undef PDA_SCANNER_GAS
@@ -23,7 +23,7 @@
/obj/item/device/pda/ai
icon_state = "NONE"
ttone = "data"
fon = 0
fon = FALSE
detonatable = FALSE
/obj/item/device/pda/ai/attack_self(mob/user)
@@ -84,7 +84,7 @@
default_cartridge = /obj/item/cartridge/virus/mime
inserted_item = /obj/item/toy/crayon/mime
icon_state = "pda-mime"
silent = 1
silent = TRUE
ttone = "silence"
/obj/item/device/pda/heads
@@ -176,7 +176,7 @@
inserted_item = /obj/item/pen/fountain
desc = "A portable microcomputer by Thinktronic Systems, LTD. This model is a WGW-11 series e-reader."
note = "Congratulations, your station has chosen the Thinktronic 5290 WGW-11 Series E-reader and Personal Data Assistant!"
silent = 1 //Quiet in the library!
silent = TRUE //Quiet in the library!
overlays_x_offset = -3
/obj/item/device/pda/clear
@@ -46,7 +46,7 @@
if(!isnull(target) && !target.toff)
charges--
to_chat(U, "<span class='notice'>Virus Sent!</span>")
target.silent = 1
target.silent = TRUE
target.ttone = "silence"
else
to_chat(U, "PDA not found.")
+2 -2
View File
@@ -40,7 +40,7 @@
//What does the implant do upon injection?
//return 1 if the implant injects
//return 0 if there is no room for implant / it fails
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = 0)
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = FALSE)
LAZYINITLIST(target.implants)
if(!target.can_be_implanted() || !can_be_implanted_in(target))
return 0
@@ -74,7 +74,7 @@
return 1
/obj/item/implant/proc/removed(mob/living/source, silent = 0, special = 0)
/obj/item/implant/proc/removed(mob/living/source, silent = FALSE, special = 0)
moveToNullspace()
imp_in = null
source.implants -= src
@@ -16,7 +16,7 @@
return dat
/obj/item/implant/mindshield/implant(mob/living/target, mob/user, silent = 0)
/obj/item/implant/mindshield/implant(mob/living/target, mob/user, silent = FALSE)
if(..())
if(!target.mind)
return TRUE
@@ -38,7 +38,7 @@
return TRUE
return FALSE
/obj/item/implant/mindshield/removed(mob/target, silent = 0, special = 0)
/obj/item/implant/mindshield/removed(mob/target, silent = FALSE, special = 0)
if(..())
if(target.stat != DEAD && !silent)
to_chat(target, "<span class='boldnotice'>Your mind suddenly feels terribly vulnerable. You are no longer safe from brainwashing.</span>")
@@ -3,7 +3,7 @@
max_w_class = WEIGHT_CLASS_NORMAL
max_combined_w_class = 6
cant_hold = list(/obj/item/disk/nuclear)
silent = 1
silent = TRUE
/obj/item/implant/storage
@@ -20,7 +20,7 @@
/obj/item/implant/storage/activate()
storage.MouseDrop(imp_in)
/obj/item/implant/storage/removed(source, silent = 0, special = 0)
/obj/item/implant/storage/removed(source, silent = FALSE, special = 0)
if(..())
if(!special)
storage.close_all()
@@ -28,7 +28,7 @@
storage.remove_from_storage(I, get_turf(source))
return 1
/obj/item/implant/storage/implant(mob/living/target, mob/user, silent = 0)
/obj/item/implant/storage/implant(mob/living/target, mob/user, silent = FALSE)
for(var/X in target.implants)
if(istype(X, type))
var/obj/item/implant/storage/imp_e = X
@@ -11,7 +11,7 @@
. = ..()
AddComponent(/datum/component/uplink, _owner, TRUE, FALSE, null, starting_tc)
/obj/item/implant/uplink/implant(mob/living/target, mob/user, silent = 0)
/obj/item/implant/uplink/implant(mob/living/target, mob/user, silent = FALSE)
GET_COMPONENT(hidden_uplink, /datum/component/uplink)
if(hidden_uplink)
for(var/X in target.implants)
-2
View File
@@ -404,7 +404,6 @@
storage_slots = 50
max_combined_w_class = 200
w_class = WEIGHT_CLASS_TINY
preposition = "in"
can_hold = list(/obj/item/reagent_containers/pill, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle)
resistance_flags = FLAMMABLE
@@ -420,6 +419,5 @@
storage_slots = 25
max_combined_w_class = 200
w_class = WEIGHT_CLASS_TINY
preposition = "in"
can_hold = list(/obj/item/slime_extract, /obj/item/reagent_containers/syringe, /obj/item/reagent_containers/glass/beaker, /obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/blood, /obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/food/snacks/deadmouse, /obj/item/reagent_containers/food/snacks/monkeycube)
resistance_flags = FLAMMABLE
-2
View File
@@ -1088,8 +1088,6 @@
item_state = "cultdagger"
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
inhand_x_dimension = 32
inhand_y_dimension = 32
w_class = WEIGHT_CLASS_SMALL
/*