Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into port-ability-to-change-AI/Robot-laws

This commit is contained in:
Lex
2023-02-26 03:31:15 +03:00
97 changed files with 3077 additions and 1149 deletions
@@ -311,14 +311,6 @@
InsertAll("", each, GLOB.alldirs)
..()
/datum/asset/spritesheet/decals
name = "decals"
/datum/asset/spritesheet/decals/register()
for(var/each in list('icons/turf/decals.dmi'))
InsertAll("", each, GLOB.alldirs)
..()
/datum/asset/spritesheet/supplypods
name = "supplypods"
+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
+11 -3
View File
@@ -62,8 +62,9 @@ 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/screentip_allow_images = FALSE
var/buttons_locked = FALSE
var/hotkeys = FALSE
@@ -827,8 +828,11 @@ 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 += "<font style='border-bottom:2px dotted white; cursor:help;'\
title=\"This is an accessibility preference, if disabled, fallbacks to only text which colorblind people can understand better\">\
<b>Screentip context with images:</b></font> <a href='?_src_=prefs;preference=screentip_allow_images'>[screentip_allow_images ? "Allowed" : "Disallowed"]</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>"
dat += "<b>Show Runechat Chat Bubbles:</b> <a href='?_src_=prefs;preference=chat_on_map'>[chat_on_map ? "Enabled" : "Disabled"]</a><br>"
@@ -2913,11 +2917,15 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(pickedOutlineColor != pickedOutlineColor)
outline_color = pickedOutlineColor // nullable
if("screentip_pref")
screentip_pref = !screentip_pref
var/choice = input(user, "Choose your screentip preference", "Screentipping?", screentip_pref) as null|anything in GLOB.screentip_pref_options
if(choice)
screentip_pref = choice
if("screentip_color")
var/pickedScreentipColor = input(user, "Choose your screentip color.", "General Preference", screentip_color) as color|null
if(pickedScreentipColor)
screentip_color = pickedScreentipColor
if("screentip_allow_images")
screentip_allow_images = !screentip_allow_images
if("tgui_lock")
tgui_lock = !tgui_lock
if("winflash")
+11 -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)
@@ -417,6 +423,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["outline_enabled"] >> outline_enabled
S["screentip_pref"] >> screentip_pref
S["screentip_color"] >> screentip_color
S["screentip_allow_images"] >> screentip_allow_images
S["hotkeys"] >> hotkeys
S["chat_on_map"] >> chat_on_map
S["max_chat_length"] >> max_chat_length
@@ -535,6 +542,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
key_bindings = sanitize_islist(key_bindings, list())
modless_key_bindings = sanitize_islist(modless_key_bindings, list())
favorite_outfits = SANITIZE_LIST(favorite_outfits)
screentip_color = sanitize_hexcolor(screentip_color, 6, 1, initial(screentip_color))
screentip_pref = sanitize_inlist(screentip_pref, GLOB.screentip_pref_options, SCREENTIP_PREFERENCE_ENABLED)
verify_keybindings_valid() // one of these days this will runtime and you'll be glad that i put it in a different proc so no one gets their saves wiped
@@ -605,6 +614,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["outline_color"], outline_color)
WRITE_FILE(S["screentip_pref"], screentip_pref)
WRITE_FILE(S["screentip_color"], screentip_color)
WRITE_FILE(S["screentip_allow_images"], screentip_allow_images)
WRITE_FILE(S["hotkeys"], hotkeys)
WRITE_FILE(S["chat_on_map"], chat_on_map)
WRITE_FILE(S["max_chat_length"], max_chat_length)
+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
@@ -4,6 +4,8 @@
status_flags = 0
unique_name = 0
pixel_x = -16
maptext_height = 64
maptext_width = 64
bubble_icon = "alienroyal"
mob_size = MOB_SIZE_LARGE
layer = LARGE_MOB_LAYER //above most mobs, but below speechbubbles
+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)
@@ -49,6 +49,8 @@ Difficulty: Hard
melee_queue_distance = 20 // as far as possible really, need this because of blood warp
ranged = 1
pixel_x = -32
maptext_height = 96
maptext_width = 96
gender = MALE
del_on_death = 1
crusher_loot = list(/obj/structure/closet/crate/necropolis/bubblegum/crusher)
@@ -44,6 +44,8 @@ Difficulty: Very Hard
move_to_delay = 10
ranged = 1
pixel_x = -32
maptext_height = 96
maptext_width = 96
del_on_death = TRUE
achievement_type = /datum/award/achievement/boss/colossus_kill
crusher_achievement_type = /datum/award/achievement/boss/colossus_crusher
@@ -59,6 +59,8 @@ Difficulty: Medium
move_to_delay = 5
ranged = 1
pixel_x = -16
maptext_height = 64
maptext_width = 64
crusher_loot = list(/obj/structure/closet/crate/necropolis/dragon/crusher)
loot = list(/obj/structure/closet/crate/necropolis/dragon)
butcher_results = list(/obj/item/stack/ore/diamond = 5, /obj/item/stack/sheet/sinew = 5, /obj/item/stack/sheet/bone = 30, /obj/item/reagent_containers/food/snacks/meat/slab/dragon = 5)
@@ -48,6 +48,8 @@ SHITCODE AHEAD. BE ADVISED. Also comment extravaganza
score_achievement_type = /datum/award/score/legion_score
pixel_y = -16
pixel_x = -32
maptext_height = 96
maptext_width = 96
loot = list(/obj/item/stack/sheet/bone = 3)
vision_range = 10
wander = FALSE
@@ -49,6 +49,8 @@
mob_size = MOB_SIZE_LARGE
armour_penetration = 30
pixel_x = -16
maptext_height = 64
maptext_width = 64
turns_per_move = 5
movement_type = FLYING
health_doll_icon = "spacedragon"
+1 -1
View File
@@ -388,7 +388,7 @@ All the important duct code:
singular_name = "duct"
icon = 'icons/obj/plumbing/fluid_ducts.dmi'
icon_state = "ducts"
custom_materials = list(/datum/material/iron=500)
custom_materials = list(/datum/material/plastic = 400)
w_class = WEIGHT_CLASS_TINY
novariants = FALSE
max_amount = 50
+1
View File
@@ -245,6 +245,7 @@
S = S.split_stack(amount=2)
if(S)
glass_type = S
S.moveToNullspace()
playsound(src.loc, 'sound/machines/click.ogg', 50, TRUE)
user.visible_message("<span class='notice'>[user] places the glass on the solar assembly.</span>", "<span class='notice'>You place the glass on the solar assembly.</span>")
if(tracker)
@@ -92,6 +92,11 @@
category = list("initial","Tools","Tool Designs")
departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING | DEPARTMENTAL_FLAG_SERVICE
/datum/design/airlock_painter/decal/tile
name = "Tile Sprayer"
id = "tile_sprayer"
build_path = /obj/item/airlock_painter/decal/tile
/datum/design/cultivator
name = "Cultivator"
id = "cultivator"
@@ -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."
@@ -120,7 +120,7 @@
return round(A / max(1, all_materials[mat] * ef))
/obj/machinery/rnd/production/proc/efficient_with(path)
return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal)
return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal) && !ispath(path, /obj/item/stack/ducts)
/obj/machinery/rnd/production/proc/user_try_print_id(id, amount)
if((!istype(linked_console) && requires_console) || !id)
@@ -5,7 +5,7 @@
display_name = "Basic Tools"
description = "Basic mechanical, electronic, surgical and botanical tools."
prereq_ids = list("base")
design_ids = list("screwdriver", "wrench", "wirecutters", "crowbar", "multitool", "welding_tool", "tscanner", "analyzer", "cable_coil", "pipe_painter", "airlock_painter", "decal_painter", "scalpel", "circular_saw", "surgicaldrill", "retractor", "cautery", "hemostat", "cultivator", "plant_analyzer", "shovel", "spade", "hatchet", "mop", "broom", "normtrash", "spraycan")
design_ids = list("screwdriver", "wrench", "wirecutters", "crowbar", "multitool", "welding_tool", "tscanner", "analyzer", "cable_coil", "pipe_painter", "airlock_painter", "decal_painter", "tile_sprayer", "scalpel", "circular_saw", "surgicaldrill", "retractor", "cautery", "hemostat", "cultivator", "plant_analyzer", "shovel", "spade", "hatchet", "mop", "broom", "normtrash", "spraycan")
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 500)
/datum/techweb_node/basic_mining
@@ -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)