Merge branch 'master' into new-decal-painter

This commit is contained in:
SandPoot
2023-02-15 20:06:29 -03:00
committed by GitHub
58 changed files with 1483 additions and 57 deletions
+67
View File
@@ -0,0 +1,67 @@
#define PRINTER_TIMEOUT 10
/obj/machinery/computer/bounty
name = "\improper Nanotrasen bounty console"
desc = "Used to check and claim bounties offered by Nanotrasen"
icon_screen = "bounty"
circuit = /obj/item/circuitboard/computer/bounty
light_color = "#E2853D"//orange
var/printer_ready = 0 //cooldown var
var/static/datum/bank_account/cargocash
/obj/machinery/computer/bounty/Initialize(mapload)
. = ..()
printer_ready = world.time + PRINTER_TIMEOUT
cargocash = SSeconomy.get_dep_account(ACCOUNT_CAR)
/obj/machinery/computer/bounty/proc/print_paper()
new /obj/item/paper/bounty_printout(loc)
/obj/item/paper/bounty_printout
name = "paper - Bounties"
/obj/item/paper/bounty_printout/Initialize(mapload)
. = ..()
info = "<h2>Nanotrasen Cargo Bounties</h2></br>"
update_icon()
for(var/datum/bounty/B in GLOB.bounties_list)
if(B.claimed)
continue
info += {"<h3>[B.name]</h3>
<ul><li>Reward: [B.reward_string()]</li>
<li>Completed: [B.completion_string()]</li></ul>"}
/obj/machinery/computer/bounty/ui_interact(mob/user, datum/tgui/ui)
if(!GLOB.bounties_list.len)
setup_bounties()
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "CargoBountyConsole", name)
ui.open()
/obj/machinery/computer/bounty/ui_data(mob/user)
var/list/data = list()
var/list/bountyinfo = list()
for(var/datum/bounty/B in GLOB.bounties_list)
bountyinfo += list(list("name" = B.name, "description" = B.description, "reward_string" = B.reward_string(), "completion_string" = B.completion_string() , "claimed" = B.claimed, "can_claim" = B.can_claim(), "priority" = B.high_priority, "bounty_ref" = REF(B)))
data["stored_cash"] = cargocash.account_balance
data["bountydata"] = bountyinfo
return data
/obj/machinery/computer/bounty/ui_act(action,params)
if(..())
return
switch(action)
if("ClaimBounty")
var/datum/bounty/cashmoney = locate(params["bounty"]) in GLOB.bounties_list
if(cashmoney)
cashmoney.claim()
return TRUE
if("Print")
if(printer_ready < world.time)
printer_ready = world.time + PRINTER_TIMEOUT
print_paper()
return
+10 -3
View File
@@ -62,7 +62,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/UI_style = null
var/outline_enabled = TRUE
var/outline_color = COLOR_THEME_MIDNIGHT
var/screentip_pref = TRUE
var/screentip_pref = SCREENTIP_PREFERENCE_ENABLED
var/screentip_color = "#ffd391"
var/buttons_locked = FALSE
var/hotkeys = FALSE
@@ -827,7 +827,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<b>UI Style:</b> <a href='?_src_=prefs;task=input;preference=ui'>[UI_style]</a><br>"
dat += "<b>Outline:</b> <a href='?_src_=prefs;preference=outline_enabled'>[outline_enabled ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Outline Color:</b> [outline_color ? "<span style='border:1px solid #161616; background-color: [outline_color];'>" : "Theme-based (null)"]&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=outline_color'>Change</a><BR>"
dat += "<b>Screentip:</b> <a href='?_src_=prefs;preference=screentip_pref'>[screentip_pref ? "Enabled" : "Disabled"]</a><br>"
dat += "<b>Screentip:</b> <a href='?_src_=prefs;preference=screentip_pref'>[screentip_pref]</a><br>"
dat += "<b>Screentip Color:</b> <span style='border:1px solid #161616; background-color: [screentip_color];'>&nbsp;&nbsp;&nbsp;</span> <a href='?_src_=prefs;preference=screentip_color'>Change</a><BR>"
dat += "<b>tgui Monitors:</b> <a href='?_src_=prefs;preference=tgui_lock'>[(tgui_lock) ? "Primary" : "All"]</a><br>"
dat += "<b>tgui Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(tgui_fancy) ? "Fancy" : "No Frills"]</a><br>"
@@ -2913,7 +2913,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(pickedOutlineColor != pickedOutlineColor)
outline_color = pickedOutlineColor // nullable
if("screentip_pref")
screentip_pref = !screentip_pref
var/choice = tgalert(user, "Choose your screentip preference", "Screentipping?", "Yes", "Context Only", "No")
switch(choice)
if("Yes")
screentip_pref = SCREENTIP_PREFERENCE_ENABLED
if("Context Only")
screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY
else
screentip_pref = SCREENTIP_PREFERENCE_DISABLED
if("screentip_color")
var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null
if(pickedScreentipColor)
+7 -1
View File
@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 56
#define SAVEFILE_VERSION_MAX 57
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -56,6 +56,12 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
be_special -= "NO_ANTAGS"
for(var/be_special_type in be_special)
be_special[be_special_type] = 1
if(current_version < 57)
if(screentip_pref)
screentip_pref = SCREENTIP_PREFERENCE_ENABLED
else
// Let's give it a little chance okay, change if you don't like still.
screentip_pref = SCREENTIP_PREFERENCE_CONTEXT_ONLY
/datum/preferences/proc/update_character(current_version, savefile/S)
if(current_version < 19)
+2 -1
View File
@@ -4,7 +4,8 @@
icon = 'icons/obj/clothing/accessories.dmi'
icon_state = "plasma"
item_state = "" //no inhands
slot_flags = 0
slot_flags = ITEM_SLOT_ACCESSORY
slot_equipment_priority = list(ITEM_SLOT_ACCESSORY)
w_class = WEIGHT_CLASS_SMALL
var/above_suit = FALSE
var/minimize_when_attached = TRUE // TRUE if shown as a small icon in corner, FALSE if overlayed
@@ -9,6 +9,8 @@
/datum/round_event_control/shuttle_catastrophe/canSpawnEvent(players, gamemode)
if(SSshuttle.emergency.name == "Build your own shuttle kit")
return FALSE //don't undo manual player engineering, it also would unload people and ghost them, there's just a lot of problems
if(SSshuttle.emergency.in_flight())
return FALSE //ditto, problems
return ..()
@@ -51,7 +51,8 @@
if(current_tab == LOADOUT_TAB)
//give it its loadout if not on the appearance tab
SSjob.equip_loadout(parent.mob, mannequin, FALSE, bypass_prereqs = TRUE, can_drop = FALSE)
SSjob.equip_loadout(parent.mob, mannequin, bypass_prereqs = TRUE, can_drop = FALSE)
SSjob.post_equip_loadout(parent.mob, mannequin, bypass_prereqs = TRUE, can_drop = FALSE)
else
if(previewJob && equip_job)
mannequin.job = previewJob.title
+1
View File
@@ -8,6 +8,7 @@
GLOB.carbon_list += src
blood_volume = (BLOOD_VOLUME_NORMAL * blood_ratio)
add_movespeed_modifier(/datum/movespeed_modifier/carbon_crawling)
register_context()
/mob/living/carbon/Destroy()
//This must be done first, so the mob ghosts correctly before DNA etc is nulled
@@ -0,0 +1,48 @@
/mob/living/carbon/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if (!isnull(held_item))
return .
if (!ishuman(user))
return .
var/combat_mode = SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_ACTIVE)
if(user == src)
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "Check injuries")
else if(!lying)
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "Comfort")
else if (health >= 0 && !HAS_TRAIT(src, TRAIT_FAKEDEATH))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "Shake")
else
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HELP, "CPR")
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_DISARM, "Disarm")
if(combat_mode && (src != user))
LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_DISARM, "Shove")
if(src != user)
if (pulledby == user)
switch (user.grab_state)
if (GRAB_PASSIVE)
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Grip")
if (GRAB_AGGRESSIVE)
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Choke")
if (GRAB_NECK)
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Strangle")
else
return .
else
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_GRAB, "Pull")
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_HARM, "Attack")
// Monkeys cannot be grabbed harder using ctrl-click, don't ask.
if((pulledby != user) && (src != user))
LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Pull")
// Happens on any intent i believe
if((user == src) && combat_mode && lying)
LAZYSET(context[SCREENTIP_CONTEXT_RMB], INTENT_ANY, "Force to get up")
return CONTEXTUAL_SCREENTIP_SET
@@ -0,0 +1,36 @@
/mob/living/carbon/human/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
if (!ishuman(user))
return .
var/aim_for_mouth = user.zone_selected == "mouth"
var/target_on_help = a_intent == INTENT_HELP
var/target_aiming_for_mouth = zone_selected == "mouth"
var/target_restrained = restrained()
var/same_dir = (dir & user.dir)
var/aim_for_groin = user.zone_selected == "groin"
var/target_aiming_for_groin = zone_selected == "groin"
if(aim_for_mouth && (target_on_help || target_restrained || target_aiming_for_mouth))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_DISARM, "Slap face")
else if(aim_for_groin && (src == user || lying || same_dir) && (target_on_help || target_restrained || target_aiming_for_groin))
LAZYSET(context[SCREENTIP_CONTEXT_LMB], INTENT_DISARM, "Slap ass")
// Humans can actually be upgrade grabbed using ctrl-click
if(src != user)
if (pulledby == user)
switch (user.grab_state)
if (GRAB_PASSIVE)
LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Grip")
if (GRAB_AGGRESSIVE)
LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Choke")
if (GRAB_NECK)
LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Strangle")
else
return .
else
LAZYSET(context[SCREENTIP_CONTEXT_CTRL_LMB], INTENT_ANY, "Pull")
return CONTEXTUAL_SCREENTIP_SET
@@ -148,6 +148,10 @@
if(ITEM_SLOT_SUITSTORE)
s_store = I
update_inv_s_store()
if(ITEM_SLOT_ACCESSORY)
var/obj/item/clothing/under/attach_target = w_uniform
attach_target.attach_accessory(I, src, TRUE)
// updates handled by attach_accessory
else
to_chat(src, "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>")
not_handled = TRUE
@@ -1454,6 +1454,22 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(SEND_SIGNAL(H.back, COMSIG_TRY_STORAGE_CAN_INSERT, I, H, TRUE))
return TRUE
return FALSE
if(ITEM_SLOT_ACCESSORY)
if(istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/attaching_target = H.w_uniform
if(attaching_target.attached_accessory)
if(return_warning)
return_warning[1] = "\The [attaching_target] already has an accessory."
return FALSE
if(attaching_target.dummy_thick)
if(return_warning)
return_warning[1] = "\The [attaching_target] is too bulky and cannot have accessories attached to it!"
return FALSE
else
return TRUE
else if(return_warning)
return_warning[1] = "\The [H.w_uniform] cannot have any attachments."
return FALSE
return FALSE //Unsupported slot
/datum/species/proc/equip_delay_self_check(obj/item/I, mob/living/carbon/human/H, bypass_equip_delay_self)
@@ -17,7 +17,15 @@
build_path = /obj/item/circuitboard/computer/cargo/request
category = list("Computer Boards")
departmental_flags = DEPARTMENTAL_FLAG_CARGO
/datum/design/board/bounty
name = "Computer Design (Bounty Console)"
desc = "Allows for the construction of circuit boards used to build a Bounty Console."
id = "bounty"
build_path = /obj/item/circuitboard/computer/bounty
category = list("Computer Boards")
departmental_flags = DEPARTMENTAL_FLAG_CARGO
/datum/design/board/mining
name = "Computer Design (Outpost Status Display)"
desc = "Allows for the construction of circuit boards used to build an outpost status display console."
@@ -3,6 +3,8 @@
return
/mob/living/carbon/get_bodypart(zone)
RETURN_TYPE(/obj/item/bodypart)
if(!zone)
zone = BODY_ZONE_CHEST
for(var/X in bodyparts)