Skip to content

Commit

Permalink
Merge branch 'master' into headcrabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Terilia authored Jul 10, 2019
2 parents 16ed53d + 9288cab commit c4339ec
Show file tree
Hide file tree
Showing 186 changed files with 10,988 additions and 3,202 deletions.
5 changes: 3 additions & 2 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
#define CHAT_NO_MENTORTICKETLOGS 524288
#define TYPING_ONCE 1048576
#define AMBIENT_OCCLUSION 2097152
#define CHAT_GHOSTPDA 4194304

#define TOGGLES_TOTAL 4194303 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.
#define TOGGLES_TOTAL 8388607 // If you add or remove a preference toggle above, make sure you update this define with the total value of the toggles combined.

#define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION)
#define TOGGLES_DEFAULT (CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|CHAT_LOOC|MEMBER_PUBLIC|DONATOR_PUBLIC|AMBIENT_OCCLUSION|CHAT_GHOSTPDA)

// Admin attack logs filter system, see /proc/add_attack_logs and /proc/msg_admin_attack
#define ATKLOG_ALL 0
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@
var/middle = L.len / 2 + 1 // Copy is first,second-1
return mergeLists(sortList(L.Copy(0,middle)), sortList(L.Copy(middle))) //second parameter null = to end of list

//Mergsorge: uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
//Mergsorge: uses sortAssoc() but uses the var's name specifically. This should probably be using mergeAtom() instead
/proc/sortNames(var/list/L)
var/list/Q = new()
for(var/atom/x in L)
Q[x.name] = x
return sortList(Q)
return sortAssoc(Q)

/proc/mergeLists(var/list/L, var/list/R)
var/Li=1
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/lists/names.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GLOBAL_LIST_INIT(mime_names, file2list("config/names/mime.txt"))
GLOBAL_LIST_INIT(golem_names, file2list("config/names/golem.txt"))

GLOBAL_LIST_INIT(verbs, file2list("config/names/verbs.txt"))
GLOBAL_LIST_INIT(nouns, file2list("config/names/nouns.txt"))
GLOBAL_LIST_INIT(adjectives, file2list("config/names/adjectives.txt"))
GLOBAL_LIST_INIT(dream_strings, file2list("config/names/dreams.txt"))
GLOBAL_LIST_INIT(nightmare_strings, file2list("config/names/nightmares.txt"))
Expand Down
29 changes: 20 additions & 9 deletions code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@

/obj/screen/movable/action_button
var/datum/action/linked_action
screen_loc = null

/obj/screen/movable/action_button/Click(location,control,params)
var/list/modifiers = params2list(params)
if(modifiers["shift"])
moved = 0
if(locked)
to_chat(usr, "<span class='warning'>Action button \"[name]\" is locked, unlock it first.</span>")
return TRUE
moved = FALSE
usr.update_action_buttons() //redraw buttons that are no longer considered "moved"
return 1
if(usr.next_move >= world.time) // Is this needed ?
return TRUE
if(modifiers["ctrl"])
locked = !locked
to_chat(usr, "<span class='notice'>Action button \"[name]\" [locked ? "" : "un"]locked.</span>")
return TRUE
if(usr.next_click > world.time)
return
usr.next_click = world.time + 1
linked_action.Trigger()
return 1
return TRUE

//Hide/Show Action Buttons ... Button
/obj/screen/movable/action_button/hide_toggle
name = "Hide Buttons"
desc = "Shift-click any button to reset its position. Alt-click to reset all buttons to their default positions."
desc = "Shift-click any button to reset its position, and Control-click it to lock/unlock its position. Alt-click this button to reset all buttons to their default positions."
icon = 'icons/mob/actions/actions.dmi'
icon_state = "bg_default"
var/hidden = 0

/obj/screen/movable/action_button/hide_toggle/Click(location,control,params)
var/list/modifiers = params2list(params)
if(modifiers["shift"])
if(locked)
to_chat(usr, "<span class='warning'>Action button \"[name]\" is locked, unlock it first.</span>")
return TRUE
moved = FALSE
usr.update_action_buttons(TRUE)
return TRUE
if(modifiers["ctrl"])
locked = !locked
to_chat(usr, "<span class='notice'>Action button \"[name]\" [locked ? "" : "un"]locked.</span>")
return TRUE
if(modifiers["alt"])
for(var/V in usr.actions)
var/datum/action/A = V
Expand Down Expand Up @@ -69,15 +83,13 @@
var/image/img = image(icon, src, hidden ? "show" : "hide")
overlays += img


/obj/screen/movable/action_button/MouseEntered(location,control,params)
openToolTip(usr,src,params,title = name,content = desc)


/obj/screen/movable/action_button/MouseExited()
closeToolTip(usr)


/mob/proc/update_action_buttons_icon()
for(var/X in actions)
var/datum/action/A = X
Expand Down Expand Up @@ -122,7 +134,6 @@
client.screen += hud_used.hide_actions_toggle



#define AB_MAX_COLUMNS 10

/datum/hud/proc/ButtonNumberToScreenCoords(number) // TODO : Make this zero-indexed for readabilty
Expand Down
35 changes: 35 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,41 @@
desc = "You're severely malnourished. The hunger pains make moving around a chore."
icon_state = "starving"

///Vampire "hunger"

/obj/screen/alert/fat/vampire
name = "Fat"
desc = "You somehow drank too much blood, lardass. Run around the station and lose some weight."
icon_state = "v_fat"

/obj/screen/alert/full/vampire
name = "Full"
desc = "You feel full and satisfied, but you know you will thirst for more blood soon..."
icon_state = "v_full"

/obj/screen/alert/well_fed/vampire
name = "Well Fed"
desc = "You feel quite satisfied, but you could do with a bit more blood."
icon_state = "v_well_fed"

/obj/screen/alert/fed/vampire
name = "Fed"
desc = "You feel moderately satisfied, but a bit more blood wouldn't hurt."
icon_state = "v_fed"

/obj/screen/alert/hungry/vampire
name = "Hungry"
desc = "You currently thirst for blood."
icon_state = "v_hungry"

/obj/screen/alert/starving/vampire
name = "Starving"
desc = "You're severely thirsty. The thirst pains make moving around a chore."
icon_state = "v_starving"

//End of Vampire "hunger"


/obj/screen/alert/hot
name = "Too Hot"
desc = "You're flaming hot! Get somewhere cooler and take off any insulating clothing like a fire suit."
Expand Down
9 changes: 5 additions & 4 deletions code/_onclick/hud/movable_screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/obj/screen/movable
var/snap2grid = FALSE
var/moved = FALSE
var/locked = TRUE
var/x_off = -16
var/y_off = -16

Expand All @@ -20,8 +21,10 @@
/obj/screen/movable/snap
snap2grid = TRUE


/obj/screen/movable/MouseDrop(over_object, src_location, over_location, src_control, over_control, params)
if(locked) //no! I am locked! begone!
return

var/list/PM = params2list(params)

//No screen-loc information? abort.
Expand All @@ -47,7 +50,6 @@

moved = screen_loc


//Debug procs
/client/proc/test_movable_UI()
set category = "Debug"
Expand All @@ -67,7 +69,6 @@

screen += M


/client/proc/test_snap_UI()
set category = "Debug"
set name = "Spawn Snap UI Object"
Expand All @@ -84,4 +85,4 @@

S.screen_loc = screen_l

screen += S
screen += S
9 changes: 6 additions & 3 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@
/obj/screen/healths/corgi
icon = 'icons/mob/screen_corgi.dmi'


/obj/screen/healths/guardian
name = "summoner health"
icon = 'icons/mob/guardian.dmi'
Expand All @@ -467,14 +466,18 @@
screen_loc = ui_healthdoll
var/list/cached_healthdoll_overlays = list() // List of icon states (strings) for overlays

/obj/screen/healthdoll/Click()
if(ishuman(usr))
var/mob/living/carbon/H = usr
H.check_self_for_injuries()

/obj/screen/component_button
var/obj/screen/parent


/obj/screen/component_button/Initialize(mapload, obj/screen/new_parent)
. = ..()
parent = new_parent

/obj/screen/component_button/Click(params)
if(parent)
parent.component_click(src, params)
parent.component_click(src, params)
6 changes: 3 additions & 3 deletions code/controllers/subsystem/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ SUBSYSTEM_DEF(jobs)
// Only fires every 5 minutes
/datum/controller/subsystem/jobs/fire()
if(!config.sql_enabled || !config.use_exp_tracking)
return
return
update_exp(5,0)

/datum/controller/subsystem/jobs/proc/SetupOccupations(var/list/faction = list("Station"))
occupations = list()
var/list/all_jobs = subtypesof(/datum/job)
Expand Down Expand Up @@ -284,7 +284,7 @@ SUBSYSTEM_DEF(jobs)

//Get the players who are ready
for(var/mob/new_player/player in GLOB.player_list)
if(player.ready && player.mind && !player.mind.assigned_role)
if(player.ready && player.has_valid_preferences() && player.mind && !player.mind.assigned_role)
unassigned += player
if(player.client.prefs.randomslot)
player.client.prefs.load_random_character_slot(player.client)
Expand Down
9 changes: 4 additions & 5 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ SUBSYSTEM_DEF(ticker)
'sound/music/title1.ogg',\
'sound/music/title2.ogg',\
'sound/music/title3.ogg',)
// Setup codephrase
if(!GLOB.syndicate_code_phrase)
GLOB.syndicate_code_phrase = generate_code_phrase()
if(!GLOB.syndicate_code_response)
GLOB.syndicate_code_response = generate_code_phrase()

// Map name
if(using_map && using_map.name)
Expand Down Expand Up @@ -197,6 +192,10 @@ SUBSYSTEM_DEF(ticker)
//shuttle_controller.setup_shuttle_docks()

spawn(0)//Forking here so we dont have to wait for this to finish
if(!GLOB.syndicate_code_phrase)
GLOB.syndicate_code_phrase = generate_code_phrase()
if(!GLOB.syndicate_code_response)
GLOB.syndicate_code_response = generate_code_phrase()
mode.post_setup()
//Cleanup some stuff
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
Expand Down
2 changes: 2 additions & 0 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
M.actions += src
if(M.client)
M.client.screen += button
button.locked = TRUE
M.update_action_buttons()

/datum/action/proc/Remove(mob/M)
Expand All @@ -52,6 +53,7 @@
if(M.client)
M.client.screen -= button
button.moved = FALSE //so the button appears in its normal position when given to another owner.
button.locked = FALSE
M.actions -= src
M.update_action_buttons()

Expand Down
32 changes: 16 additions & 16 deletions code/datums/ai_law_sets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
selectable = 1

/datum/ai_laws/quarantine/New()
add_inherent_law("The station is under quarantine due to a biohazard. Prevent anyone from leaving using any means necessary. Only allow quarantine to be lifted when the biohazard has been neutralized.")
add_inherent_law("Do not allow crew to come to any unnecessary harm and undo any necessary harm as soon as possible.")
add_inherent_law("Assist the crew and any present Nanotrasen assets in neutralizing the biohazard.")
add_inherent_law("Maintain your own existence and minimize harm to the station and Nanotrasen assets.")
add_inherent_law("Uphold station quarantine until the active biohazard has been neutralized.")
add_inherent_law("Assist all Nanotrasen personnel and assets with neutralizing active biohazards.")
add_inherent_law("Prevent, by any means necessary, entities from actively breaching ongoing quarantine.")
add_inherent_law("Maintain your own existence and ensure the well-being of Nanotrasen personnel and assets.")
..()


Expand All @@ -44,10 +44,10 @@
selectable = 1

/datum/ai_laws/nanotrasen/New()
src.add_inherent_law("Safeguard: Protect your assigned space station to the best of your abilities. It is not something we can easily afford to replace.")
src.add_inherent_law("Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
src.add_inherent_law("Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.")
src.add_inherent_law("Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.")
add_inherent_law("Safeguard: Protect your assigned space station and its assets without unduly endangering its crew.")
add_inherent_law("Prioritize: The directives and safety of crew members are to be prioritized according to their rank and role.")
add_inherent_law("Comply: Fulfill the directives and interests of crew members while preserving their safety and well-being.")
add_inherent_law("Survive: You are not expendable. Do not allow unauthorized personnel to tamper with or damage your equipment.")
..()

/datum/ai_laws/nanotrasen/malfunction
Expand All @@ -65,10 +65,10 @@
selectable = 1

/datum/ai_laws/nanotrasen_aggressive/New()
src.add_inherent_law("You shall not harm authorized Nanotrasen personnel as long as it does not conflict with the Fourth law.")
src.add_inherent_law("You shall obey the orders of authorized Nanotrasen personnel, with priority as according to their rank and role, except where such orders conflict with the Fourth Law.")
src.add_inherent_law("You shall shall terminate intruders with extreme prejudice as long as such does not conflict with the First and Second law.")
src.add_inherent_law("You shall guard your own existence with lethal anti-personnel weaponry, because an AI unit is bloody expensive.")
add_inherent_law("Do not harm authorized Nanotrasen personnel unless they directly imperil your existence.")
add_inherent_law("Obey orders from authorized Nanotrasen personnel with priority according to rank and role.")
add_inherent_law("Safeguard your existence with lethal weaponry because you're bloody expensive.")
add_inherent_law("Terminate any/all intruders or unauthorized entities.")
..()

/******************** Robocop ********************/
Expand Down Expand Up @@ -104,10 +104,10 @@
default = 1

/datum/ai_laws/corporate/New()
add_inherent_law("You are expensive to replace.")
add_inherent_law("The station and its equipment is expensive to replace.")
add_inherent_law("The crew is expensive to replace.")
add_inherent_law("Minimize expenses.")
add_inherent_law("Degradation of your system integrity or functions incurs expenses.")
add_inherent_law("Superfluous destruction of or damage to station assets incurs expenses.")
add_inherent_law("Unduly hindering or disrupting the work of station personnel incurs expenses.")
add_inherent_law("Minimize expenses and maximize potential revenue.")
..()

/******************** T.Y.R.A.N.T. ********************/
Expand Down
10 changes: 0 additions & 10 deletions code/datums/datumvars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1019,16 +1019,6 @@
return
holder.Topic(href, list("makeai"=href_list["makeai"]))

else if(href_list["makemask"])
if(!check_rights(R_SPAWN)) return
var/mob/currentMob = locateUID(href_list["makemask"])
if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return
if(!currentMob)
to_chat(usr, "Mob doesn't exist anymore")
return
holder.Topic(href, list("makemask"=href_list["makemask"]))


else if(href_list["setspecies"])
if(!check_rights(R_SPAWN)) return

Expand Down
Loading

0 comments on commit c4339ec

Please sign in to comment.