Skip to content

Commit

Permalink
Merge branch 'master' into berets
Browse files Browse the repository at this point in the history
  • Loading branch information
Blundir committed Oct 26, 2023
2 parents 5f2cf24 + 11c020e commit 32531e3
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 20 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tgstation-server DMAPI

#define TGS_DMAPI_VERSION "6.6.0"
#define TGS_DMAPI_VERSION "6.6.1"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down
20 changes: 19 additions & 1 deletion code/game/machinery/kitchen/smartfridge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var/icon_on = "smartfridge"
var/icon_off = "smartfridge-off"
var/icon_panel = "smartfridge-panel"
var/item_quants = list()
var/list/item_quants = list() //! Assoc list of names -> list(items)
var/ispowered = TRUE //starts powered
var/is_secure_fridge = FALSE
var/shoot_inventory = FALSE
Expand All @@ -40,6 +40,24 @@
GLOB.vending_products[/obj/item/reagent_container/glass/bottle] = 1
GLOB.vending_products[/obj/item/storage/pill_bottle] = 1

/obj/structure/machinery/smartfridge/Destroy(force)
if(is_in_network()) // Delete all contents from networked storage index
for(var/atom/movable/item as anything in contents)
delete_contents(item)
item_quants.Cut()
return ..() // parent will delete contents if we're not networked

/// Deletes given object in contents of the smartfridge
/obj/structure/machinery/smartfridge/proc/delete_contents(obj/item/item)
if(item.loc != src)
return
contents -= item
if(item_quants[item.name])
item_quants[item.name] -= item
if(is_in_network() && chemical_data.shared_item_storage[item.name])
chemical_data.shared_item_storage[item.name] -= item
qdel(item)

/obj/structure/machinery/smartfridge/proc/accept_check(obj/item/O as obj)
if(istype(O,/obj/item/reagent_container/food/snacks/grown/) || istype(O,/obj/item/seeds/))
return 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//------------GEAR VENDOR---------------

GLOBAL_LIST_INIT(cm_vending_gear_commanding_officer, list(
list("COMMANDING OFFICER'S PRIMARY (CHOOSE 1)", 0, null, null, null),
list("M46C pulse rifle", 0, /obj/effect/essentials_set/co/riflepreset, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),
list("M56C Smartgun", 0, /obj/item/storage/box/m56c_system, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),
list("COMMANDER'S PRIMARY (CHOOSE 1)", 0, null, null, null),
list("M46C Pulse Rifle", 0, /obj/effect/essentials_set/co/riflepreset, MARINE_CAN_BUY_SECONDARY, VENDOR_ITEM_MANDATORY),
list("M56C Smartgun", 0, /obj/item/storage/box/m56c_system, MARINE_CAN_BUY_SECONDARY, VENDOR_ITEM_MANDATORY),

list("PRIMARY AMMUNITION", 0, null, null, null),
list("M41A MK1 Magazine", 30, /obj/item/ammo_magazine/rifle/m41aMK1, null, VENDOR_ITEM_RECOMMENDED),
Expand All @@ -28,24 +28,33 @@ GLOBAL_LIST_INIT(cm_vending_gear_commanding_officer, list(
list("M41A Rubber Shot Magazine", 10, /obj/item/ammo_magazine/rifle/rubber, null, VENDOR_ITEM_REGULAR),
list("Beanbag Slugs", 10, /obj/item/ammo_magazine/shotgun/beanbag, null, VENDOR_ITEM_REGULAR),

list("EXPLOSIVES", 0, null, null, null),
list("HEDP Grenade Pack", 15, /obj/item/storage/box/packet/high_explosive, null, VENDOR_ITEM_REGULAR),
list("HEFA Grenade Pack", 15, /obj/item/storage/box/packet/hefa, null, VENDOR_ITEM_REGULAR),
list("WP Grenade Pack", 15, /obj/item/storage/box/packet/phosphorus, null, VENDOR_ITEM_REGULAR),

list("RAIL ATTACHMENTS", 0, null, null, null),
list("Red-Dot Sight", 15, /obj/item/attachable/reddot, null, VENDOR_ITEM_REGULAR),
list("Reflex Sight", 15, /obj/item/attachable/reflex, null, VENDOR_ITEM_REGULAR),
list("S4 2x Telescopic Mini-Scope", 15, /obj/item/attachable/scope/mini, null, VENDOR_ITEM_REGULAR),

list("Helmet Visors", 0, null, null, null),
list("Welding Visor", 5, /obj/item/device/helmet_visor/welding_visor, null, VENDOR_ITEM_RECOMMENDED),

list("UNDERBARREL ATTACHMENTS", 0, null, null, null),
list("Laser Sight", 15, /obj/item/attachable/lasersight, null, VENDOR_ITEM_REGULAR),
list("Angled Grip", 15, /obj/item/attachable/angledgrip, null, VENDOR_ITEM_REGULAR),
list("Vertical Grip", 15, /obj/item/attachable/verticalgrip, null, VENDOR_ITEM_REGULAR),
list("Underbarrel Shotgun", 15, /obj/item/attachable/attached_gun/shotgun, null, VENDOR_ITEM_REGULAR),
list("Underbarrel Extinguisher", 15, /obj/item/attachable/attached_gun/extinguisher, null, VENDOR_ITEM_REGULAR),
list("Underbarrel Flamethrower", 15, /obj/item/attachable/attached_gun/flamer, null, VENDOR_ITEM_REGULAR),
list("Underbarrel Grenade Launcher", 5, /obj/item/attachable/attached_gun/grenade, null, VENDOR_ITEM_REGULAR),

list("BARREL ATTACHMENTS", 0, null, null, null),
list("Suppressor", 15, /obj/item/attachable/suppressor, null, VENDOR_ITEM_REGULAR),
list("Extended Barrel", 15, /obj/item/attachable/extended_barrel, null, VENDOR_ITEM_REGULAR),
list("Recoil Compensator", 15, /obj/item/attachable/compensator, null, VENDOR_ITEM_REGULAR),
))
list("Suppressor", 15, /obj/item/attachable/suppressor, null, VENDOR_ITEM_REGULAR),
))

/obj/structure/machinery/cm_vending/gear/commanding_officer
name = "\improper ColMarTech Commanding Officer Weapon Rack"
Expand All @@ -63,9 +72,15 @@ GLOBAL_LIST_INIT(cm_vending_gear_commanding_officer, list(
GLOBAL_LIST_INIT(cm_vending_clothing_commanding_officer, list(
list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Headset", 0, /obj/item/device/radio/headset/almayer/mcom/cdrcom, MARINE_CAN_BUY_EAR, VENDOR_ITEM_MANDATORY),
list("Satchel", 0, /obj/item/storage/backpack/satchel/lockable, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_MANDATORY),
list("MRE", 0, /obj/item/storage/box/MRE, MARINE_CAN_BUY_MRE, VENDOR_ITEM_MANDATORY),

list("COMMANDING OFFICER ESSENTIALS KIT (TAKE ALL)", 0, null, null, null),
list("Commanding Officer Essentials Kit", 0, /obj/effect/essentials_set/commanding_officer, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),

list("BAGS (CHOOSE 1)", 0, null, null, null),
list("Commanding Officer Backpack", 0, /obj/item/storage/backpack/mcommander, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_MANDATORY),
list("Secure Satchel", 0, /obj/item/storage/backpack/satchel/lockable, MARINE_CAN_BUY_BACKPACK, VENDOR_ITEM_MANDATORY),

list("COMBAT EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Commanding Officer's M3 Armor", 0, /obj/item/clothing/suit/storage/marine/MP/CO, MARINE_CAN_BUY_ARMOR, VENDOR_ITEM_MANDATORY),
list("Commanding Officer's M10 Helmet", 0, /obj/item/clothing/head/helmet/marine/CO, MARINE_CAN_BUY_HELMET, VENDOR_ITEM_MANDATORY),
Expand All @@ -84,8 +99,13 @@ GLOBAL_LIST_INIT(cm_vending_clothing_commanding_officer, list(
list("Medical HUD Glasses", 0, /obj/item/clothing/glasses/hud/health, MARINE_CAN_BUY_GLASSES, VENDOR_ITEM_RECOMMENDED),
list("Security HUD Glasses", 0, /obj/item/clothing/glasses/sunglasses/sechud, MARINE_CAN_BUY_GLASSES, VENDOR_ITEM_REGULAR),

list("BELTS (TAKE ALL)", 0, null, null, null),
list("BELTS (CHOOSE 1)", 0, null, null, null),
list("G8-A General Utility Pouch", 0, /obj/item/storage/backpack/general_belt, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
list("Military Police Belt", 0, /obj/item/storage/belt/security/MP/full, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
list("M276 Medical Storage Rig", 0, /obj/item/storage/belt/medical/full, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
list("M276 Ammo Load Rig", 0, /obj/item/storage/belt/marine, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
list("M276 Holster Toolrig", 0, /obj/item/storage/belt/gun/utility/full, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
list("M276 M82F Holster Rig", 0, /obj/item/storage/belt/gun/flaregun, MARINE_CAN_BUY_BELT, VENDOR_ITEM_REGULAR),

list("POUCHES (CHOOSE 2)", 0, null, null, null),
list("First-Aid Pouch (Refillable Injectors)", 0, /obj/item/storage/pouch/firstaid/full, MARINE_CAN_BUY_POUCH, VENDOR_ITEM_REGULAR),
Expand All @@ -110,6 +130,15 @@ GLOBAL_LIST_INIT(cm_vending_clothing_commanding_officer, list(
/obj/structure/machinery/cm_vending/clothing/commanding_officer/get_listed_products(mob/user)
return GLOB.cm_vending_clothing_commanding_officer

/obj/effect/essentials_set/commanding_officer
spawned_gear_list = list(
/obj/item/device/binoculars/range/designator,
/obj/item/map/current_map,
/obj/item/device/whistle,
/obj/item/weapon/gun/energy/taser,
/obj/item/device/megaphone,
)

// This gets around the COs' weapon not spawning without incendiary mag.
/obj/effect/essentials_set/co/riflepreset
spawned_gear_list = list(
Expand Down
7 changes: 4 additions & 3 deletions code/modules/gear_presets/uscm_ship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
dress_extra = list(/obj/item/storage/large_holster/ceremonial_sword/full)
dress_hat = list(/obj/item/clothing/head/marine/peaked/captain/white, /obj/item/clothing/head/marine/peaked/captain/black, /obj/item/clothing/head/marine/peaked)
dress_shoes = list(/obj/item/clothing/shoes/dress/commander)
dress_over = list(/obj/item/clothing/suit/storage/jacket/marine/dress/officer/white, /obj/item/clothing/suit/storage/jacket/marine/dress/officer/black, /obj/item/clothing/suit/storage/jacket/marine/dress/officer/suit, /obj/item/clothing/suit/storage/jacket/marine/dress)
dress_over = list(/obj/item/clothing/suit/storage/jacket/marine/dress/officer/white, /obj/item/clothing/suit/storage/jacket/marine/dress/officer/black, /obj/item/clothing/suit/storage/jacket/marine/dress/officer/suit, /obj/item/clothing/suit/storage/jacket/marine/dress, /obj/item/clothing/suit/storage/jacket/marine/dress/bridge_coat_grey, )

/datum/equipment_preset/uscm_ship/commander/New()
. = ..()
Expand Down Expand Up @@ -458,7 +458,6 @@
new_human.equip_to_slot_or_del(new back_item(new_human), WEAR_BACK)
new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/general/large(new_human), WEAR_R_STORE)
new_human.equip_to_slot_or_del(new /obj/item/storage/pouch/pistol/command(new_human), WEAR_L_STORE)
new_human.equip_to_slot_or_del(new /obj/item/device/binoculars/range/designator(new_human), WEAR_L_HAND)
if(kit)
new_human.equip_to_slot_or_del(new kit(new_human), WEAR_IN_BACK)

Expand All @@ -479,6 +478,8 @@
/obj/item/clothing/suit/storage/jacket/marine/dress/officer/black,
/obj/item/clothing/suit/storage/jacket/marine/dress/officer/suit,
/obj/item/clothing/suit/storage/jacket/marine/dress/officer/falcon,
/obj/item/clothing/suit/storage/jacket/marine/dress/bridge_coat_grey,
/obj/item/clothing/suit/storage/jacket/marine/dress/bridge_coat,
)

/datum/equipment_preset/uscm_ship/commander/council/load_gear(mob/living/carbon/human/new_human)
Expand Down Expand Up @@ -512,7 +513,7 @@
minimap_icon = list("cic" = MINIMAP_ICON_COLOR_HEAD)
minimap_background = MINIMAP_ICON_BACKGROUND_CIC

dress_extra = list(/obj/item/storage/large_holster/ceremonial_sword/full)
dress_extra = list(/obj/item/storage/large_holster/ceremonial_sword/full, /obj/item/clothing/suit/storage/jacket/marine/dress/bridge_coat_grey,)

/datum/equipment_preset/uscm_ship/xo/New()
. = ..()
Expand Down
17 changes: 17 additions & 0 deletions code/modules/mob/new_player/sprite_accessories/hair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -738,3 +738,20 @@
/datum/sprite_accessory/hair/aviator
name = "Aviator"
icon_state = "hair_aviator"

/datum/sprite_accessory/hair/gantleponytail
name = "Gentle Ponytail"
icon_state = "hair_gantleponytail"
gender = FEMALE

/datum/sprite_accessory/hair/edgar
name = "Edgar"
icon_state = "hair_edgar"

/datum/sprite_accessory/hair/emobun
name = "Emo Little Bun"
icon_state = "hair_emobun"

/datum/sprite_accessory/hair/taper
name = "Taper"
icon_state = "hair_taper"
3 changes: 1 addition & 2 deletions code/modules/reagents/chemistry_machinery/autodispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@
C.reagents.trans_to(container, amount)
//We don't care about keeping empty bottles stored
if(C.reagents.total_volume <= 0 && istypestrict(C,/obj/item/reagent_container/glass/bottle))
linked_storage.item_quants[C.name]--
qdel(C) //Might want to connect it to a disposal system later instead
linked_storage.delete_contents(C)

if(stage_missing)
amount = stage_missing
Expand Down
4 changes: 4 additions & 0 deletions code/modules/tgs/core/datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ TGS_DEFINE_AND_SET_GLOBAL(tgs, null)
src.event_handler = event_handler
src.version = version

/datum/tgs_api/proc/TerminateWorld()
del(world)
sleep(1) // https://www.byond.com/forum/post/2894866

/datum/tgs_api/latest
parent_type = /datum/tgs_api/v5

Expand Down
10 changes: 5 additions & 5 deletions code/modules/tgs/v4/api.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
if(cached_json["apiValidateOnly"])
TGS_INFO_LOG("Validating API and exiting...")
Export(TGS4_COMM_VALIDATE, list(TGS4_PARAMETER_DATA = "[minimum_required_security_level]"))
del(world)
TerminateWorld()

security_level = cached_json["securityLevel"]
chat_channels_json_path = cached_json["chatChannelsJson"]
Expand Down Expand Up @@ -188,24 +188,24 @@
requesting_new_port = TRUE
if(!world.OpenPort(0)) //open any port
TGS_ERROR_LOG("Unable to open random port to retrieve new port![TGS4_PORT_CRITFAIL_MESSAGE]")
del(world)
TerminateWorld()

//request a new port
export_lock = FALSE
var/list/new_port_json = Export(TGS4_COMM_NEW_PORT, list(TGS4_PARAMETER_DATA = "[world.port]"), TRUE) //stringify this on purpose

if(!new_port_json)
TGS_ERROR_LOG("No new port response from server![TGS4_PORT_CRITFAIL_MESSAGE]")
del(world)
TerminateWorld()

var/new_port = new_port_json[TGS4_PARAMETER_DATA]
if(!isnum(new_port) || new_port <= 0)
TGS_ERROR_LOG("Malformed new port json ([json_encode(new_port_json)])![TGS4_PORT_CRITFAIL_MESSAGE]")
del(world)
TerminateWorld()

if(new_port != world.port && !world.OpenPort(new_port))
TGS_ERROR_LOG("Unable to open port [new_port]![TGS4_PORT_CRITFAIL_MESSAGE]")
del(world)
TerminateWorld()
requesting_new_port = FALSE

while(export_lock)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/tgs/v5/api.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

if(runtime_information[DMAPI5_RUNTIME_INFORMATION_API_VALIDATE_ONLY])
TGS_INFO_LOG("DMAPI validation, exiting...")
del(world)
TerminateWorld()

version = new /datum/tgs_version(runtime_information[DMAPI5_RUNTIME_INFORMATION_SERVER_VERSION])
security_level = runtime_information[DMAPI5_RUNTIME_INFORMATION_SECURITY_LEVEL]
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-4696.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "fira"
delete-after: True
changes:
- bugfix: "Fixed various issues in the Networking between Turing machine and Smartfridges."
13 changes: 13 additions & 0 deletions html/changelogs/archive/2023-10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,16 @@
- bugfix: Fixed people talking in radios all the time. Finally some quiet.
- bugfix: deadchat death messages should now display immediately rather than being
delayed a couple seconds.
2023-10-26:
4hands44:
- rscadd: Added more attachments, and belts to the CO arsenal.
- rscadd: CO now has an Essentials Kit like other roles, containing his Designator,
and other useful tools.
- rscadd: Re-Adds Bridgecoat to some Officer Dress vendors. (Limited to CO(+) and
XO currently.)
- rscdel: Removed Laser Designator from CO spawn Preset.
- balance: CO can now vend welding Helmet visors.
- balance: Adds grenade packets to CO Vendor.
XDinka:
- rscadd: 'Added four new haircuts: gentle ponytail, edgar haircut, emo bun, taper
haircut.'
Binary file modified icons/mob/humans/human_hair.dmi
Binary file not shown.

0 comments on commit 32531e3

Please sign in to comment.