Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadout items now spawn in lockers in dorms + persistent GM medals !!!NEED TESTING!!! #123

Merged
merged 30 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
5057a9c
1
AndroBetel Feb 24, 2024
732ff39
erm
AndroBetel Feb 24, 2024
6aa87e7
2
AndroBetel Feb 24, 2024
096af42
Merge branch 'master' into lockers
AndroBetel Feb 24, 2024
8f0b29d
Update _select_equipment.dm
AndroBetel Feb 24, 2024
ed19759
Merge branch 'lockers' of https://github.com/AndroBetel/PvE-CMSS13 in…
AndroBetel Feb 24, 2024
ab464bf
Update marine_personal.dm
AndroBetel Feb 25, 2024
d58f908
wrong thinking
AndroBetel Feb 25, 2024
f5e5605
Merge branch 'lockers' of https://github.com/AndroBetel/PvE-CMSS13 in…
AndroBetel Feb 25, 2024
4be0f30
uhmm?
AndroBetel Feb 29, 2024
0d9aacc
Update _select_equipment.dm
AndroBetel Feb 29, 2024
39c5744
Update _select_equipment.dm
AndroBetel Feb 29, 2024
4894746
remap
AndroBetel Feb 29, 2024
77cbefa
tweaks
AndroBetel Feb 29, 2024
3aa7416
Update golden_arrow.dmm
AndroBetel Feb 29, 2024
d56c84f
closets
AndroBetel Mar 5, 2024
51364b6
?!??!
AndroBetel Mar 5, 2024
9eb64f3
is_mainship_level()
AndroBetel Mar 5, 2024
f251702
Revert "is_mainship_level()"
AndroBetel Mar 5, 2024
9213f01
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13 int…
AndroBetel Mar 5, 2024
389d890
upp_ship
AndroBetel Mar 5, 2024
f8ef865
chapaev2
AndroBetel Mar 5, 2024
04b5f4c
silly
AndroBetel Mar 8, 2024
b59187b
ided
AndroBetel Mar 11, 2024
e6250b4
Merge branch 'master' of https://github.com/PvE-CMSS13/PvE-CMSS13 int…
AndroBetel Mar 11, 2024
daefc16
Update _select_equipment.dm
AndroBetel Mar 11, 2024
8abfec4
AAAAAAAAA
AndroBetel Mar 11, 2024
e2a2571
Merge branch 'lockers' of https://github.com/AndroBetel/PvE-CMSS13 in…
AndroBetel Mar 11, 2024
5195ea3
Update _select_equipment.dm
AndroBetel Mar 11, 2024
b3752ff
Update job_closets.dm
AndroBetel Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_medic, list(
list("Essential Medical Set", 0, /obj/effect/essentials_set/medic, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),

list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Standard Marine Apparel", 0, list(/obj/item/clothing/under/marine/medic, /obj/item/clothing/shoes/marine/knife, /obj/item/clothing/gloves/marine, /obj/item/device/radio/headset/almayer/marine, /obj/item/clothing/head/helmet/marine/medic), MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Standard Marine Apparel", 0, list(/obj/item/clothing/gloves/marine, /obj/item/clothing/head/helmet/marine/medic), MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Combat Sterile Gloves", 0, /obj/item/clothing/gloves/marine/medical, MARINE_CAN_BUY_KIT, VENDOR_ITEM_REGULAR),
list("MRE", 0, /obj/item/storage/box/MRE, MARINE_CAN_BUY_MRE, VENDOR_ITEM_MANDATORY),

Expand Down Expand Up @@ -221,7 +221,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_upp_medic, list(
list("Essential Medical Set", 0, /obj/effect/essentials_set/medic, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),

list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Standard Apparel", 0, list(/obj/item/clothing/under/marine/veteran/UPP/medic, /obj/item/clothing/shoes/marine/upp, /obj/item/clothing/gloves/marine/veteran/upp, /obj/item/device/radio/headset/distress/UPP, /obj/item/clothing/head/helmet/marine/veteran/UPP), MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Standard Apparel", 0, list(/obj/item/clothing/gloves/marine/veteran/upp, /obj/item/clothing/head/helmet/marine/veteran/UPP), MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Combat Sterile Gloves", 0, /obj/item/clothing/gloves/marine/medical, MARINE_CAN_BUY_KIT, VENDOR_ITEM_REGULAR),
list("Ration", 0, /obj/item/reagent_container/food/snacks/upp, MARINE_CAN_BUY_MRE, VENDOR_ITEM_MANDATORY),

Expand Down Expand Up @@ -283,7 +283,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_forecon_medic, list(
list("Essential Medical Set", 0, /obj/effect/essentials_set/medic, MARINE_CAN_BUY_ESSENTIALS, VENDOR_ITEM_MANDATORY),

list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Standard Marine Apparel", 0, list(/obj/item/clothing/under/marine/medic/standard, /obj/item/clothing/shoes/marine/jungle/knife, /obj/item/clothing/gloves/marine, /obj/item/device/radio/headset/almayer/sof/survivor_forecon), MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Standard Marine Apparel", 0, list(/obj/item/clothing/gloves/marine), MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Combat Sterile Gloves", 0, /obj/item/clothing/gloves/marine/medical, MARINE_CAN_BUY_KIT, VENDOR_ITEM_REGULAR),
list("MRE", 0, /obj/item/storage/box/MRE, MARINE_CAN_BUY_MRE, VENDOR_ITEM_MANDATORY),

Expand Down
43 changes: 24 additions & 19 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
layer = BELOW_OBJ_LAYER
var/icon_closed = "closed"
var/icon_opened = "open"
var/opened = 0
var/welded = 0
var/wall_mounted = 0 //never solid (You can always pass over it)
var/opened = FALSE
var/welded = FALSE
var/wall_mounted = FALSE //never solid (You can always pass over it)
var/can_be_stacked = FALSE
health = 100
var/lastbang
var/storage_capacity = 30 //This is so that someone can't pack hundreds of items in a locker/crate
Expand Down Expand Up @@ -59,21 +60,25 @@

/obj/structure/closet/proc/can_open()
if(src.welded)
return 0
return 1
return FALSE
return TRUE

/obj/structure/closet/proc/can_close()
for(var/mob/living/carbon/xenomorph/xeno in get_turf(src))
return FALSE
if(can_be_stacked)
return TRUE
for(var/obj/structure/closet/closet in get_turf(src))
if(closet != src && !closet.wall_mounted)
return 0
for(var/mob/living/carbon/xenomorph/xeno in get_turf(src))
return 0
return 1
return FALSE
return TRUE

/obj/structure/closet/proc/dump_contents()

for(var/obj/I in src)
I.forceMove(loc)
I.pixel_x = pixel_x
I.pixel_y = pixel_y

for(var/mob/M in src)
M.forceMove(loc)
Expand All @@ -87,25 +92,25 @@

/obj/structure/closet/proc/open()
if(opened)
return 0
return FALSE

if(!can_open())
return 0
return FALSE

dump_contents()

UnregisterSignal(src, COMSIG_CLOSET_FLASHBANGED)
opened = 1
opened = TRUE
update_icon()
playsound(src.loc, open_sound, 15, 1)
density = FALSE
return 1
return TRUE

/obj/structure/closet/proc/close()
if(!src.opened)
return 0
return FALSE
if(!src.can_close())
return 0
return FALSE

var/stored_units = 0
if(store_items)
Expand All @@ -114,12 +119,12 @@
stored_units = store_mobs(stored_units)
RegisterSignal(src, COMSIG_CLOSET_FLASHBANGED, PROC_REF(flashbang))

opened = 0
opened = FALSE
update_icon()

playsound(src.loc, close_sound, 15, 1)
density = TRUE
return 1
return TRUE

/obj/structure/closet/proc/store_items(stored_units)
for(var/obj/item/I in src.loc)
Expand Down Expand Up @@ -209,7 +214,7 @@
src.MouseDrop_T(G.grabbed_thing, user) //act like they were dragged onto the closet
return
if(W.flags_item & ITEM_ABSTRACT)
return 0
return FALSE
if(material == MATERIAL_METAL)
if(iswelder(W))
if(!HAS_TRAIT(W, TRAIT_TOOL_BLOWTORCH))
Expand Down Expand Up @@ -369,5 +374,5 @@

/obj/structure/closet/proc/break_open()
if(!opened)
welded = 0
welded = FALSE
open()
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
desc = "A secure storage unit for an assistant squad leader."
req_one_access = list(ACCESS_MARINE_LEADER, ACCESS_MARINE_TL_PREP)

/obj/structure/closet/secure_closet/squad_sergeant/Initialize()
/obj/structure/closet/secure_closet/squad_sergeant_forecon/Initialize()
. = ..()
new /obj/item/device/binoculars/range/designator(src)
new /obj/item/device/whistle(src)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/obj/structure/closet/secure_closet/marine_personal
name = "personal locker"
desc = "It's an immobile card-locked storage unit."
icon_state = "secure1"
can_be_stacked = TRUE
var/owner
var/job = "Rifleman"
var/has_cryo_gear = TRUE

/obj/structure/closet/secure_closet/marine_personal/get_examine_text(mob/user)
. = ..()
. += SPAN_NOTICE("It has a name tag[owner ? ": [owner]." : ". They are still in hypersleep..."]")

/obj/structure/closet/secure_closet/marine_personal/Initialize(mapload, ...)
. = ..()
GLOB.personal_closets += src

/obj/structure/closet/secure_closet/marine_personal/Destroy()
GLOB.personal_closets -= src
return ..()

/obj/structure/closet/secure_closet/marine_personal/allowed(mob/M)
if(owner == M.name)
return TRUE
return FALSE

/obj/structure/closet/secure_closet/marine_personal/Initialize()
. = ..()
if(has_cryo_gear)
new /obj/item/clothing/under/marine(src)
new /obj/item/clothing/shoes/marine/knife(src)
new /obj/item/device/radio/headset/almayer/marine(src)
102 changes: 101 additions & 1 deletion code/modules/gear_presets/_select_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
load_gear(new_human, mob_client)
load_id(new_human, mob_client)
load_status(new_human, mob_client)
load_vanity(new_human, mob_client)
INVOKE_NEXT_TICK(src, PROC_REF(do_vanity), new_human, mob_client)

load_traits(new_human, mob_client)
if(round_statistics && count_participant)
round_statistics.track_new_participant(faction)
Expand All @@ -168,6 +169,15 @@
new_human.hud_set_squad()
new_human.add_to_all_mob_huds()

/datum/equipment_preset/proc/do_vanity(mob/living/carbon/human/new_human, client/mob_client)
var/turf/T = get_turf(new_human)
if(!T)
return
if(is_mainship_level(T.z))
spawn_vanity_in_personal_lockers(new_human, mob_client)
else
load_vanity(new_human, mob_client)

/datum/equipment_preset/proc/load_vanity(mob/living/carbon/human/new_human, client/mob_client)
if(!new_human.client || !new_human.client.prefs || !new_human.client.prefs.gear)
return//We want to equip them with custom stuff second, after they are equipped with everything else.
Expand Down Expand Up @@ -246,6 +256,96 @@
if(!new_human.equip_to_slot_if_possible(P, WEAR_R_HAND))
P.forceMove(new_human.loc)

GLOBAL_LIST_EMPTY(personal_closets)

/datum/equipment_preset/proc/spawn_vanity_in_personal_lockers(mob/living/carbon/human/new_human, client/mob_client)
var/obj/structure/closet/secure_closet/marine_personal/closet_to_spawn_in
if(!new_human?.client?.prefs?.gear)
return//We want to equip them with custom stuff second, after they are equipped with everything else.
for(var/obj/structure/closet/secure_closet/marine_personal/closet in GLOB.personal_closets)
if(closet.owner)
continue
if(new_human.job != closet.job)
continue
closet.owner = new_human.real_name
closet_to_spawn_in = closet
closet_to_spawn_in.name = "[closet_to_spawn_in.owner]'s personal locker"
break
if(!closet_to_spawn_in)
load_vanity(new_human, mob_client)
return

for(var/gear_name in new_human.client.prefs.gear)
var/datum/gear/current_gear = gear_datums_by_name[gear_name]
if(current_gear)
if(current_gear.allowed_roles && !(assignment in current_gear.allowed_roles))
to_chat(new_human, SPAN_WARNING("Custom gear [current_gear.display_name] cannot be equipped: Invalid Role"))
return
if(current_gear.allowed_origins && !(new_human.origin in current_gear.allowed_origins))
to_chat(new_human, SPAN_WARNING("Custom gear [current_gear.display_name] cannot be equipped: Invalid Origin"))
return
new current_gear.path(closet_to_spawn_in)

//Gives ranks to the ranked
var/current_rank = paygrade
var/obj/item/card/id/I = new_human.get_idcard()
if(I)
current_rank = I.paygrade
if(current_rank)
var/rankpath = get_rank_pins(current_rank)
if(rankpath)
new rankpath(closet_to_spawn_in)

if(flags & EQUIPMENT_PRESET_MARINE)
var/playtime = get_job_playtime(new_human.client, assignment)
var/medal_type

switch(playtime)
if(JOB_PLAYTIME_TIER_1 to JOB_PLAYTIME_TIER_2)
medal_type = /obj/item/clothing/accessory/medal/bronze/service
if(JOB_PLAYTIME_TIER_2 to JOB_PLAYTIME_TIER_3)
medal_type = /obj/item/clothing/accessory/medal/silver/service
if(JOB_PLAYTIME_TIER_3 to JOB_PLAYTIME_TIER_4)
medal_type = /obj/item/clothing/accessory/medal/gold/service
if(JOB_PLAYTIME_TIER_4 to INFINITY)
medal_type = /obj/item/clothing/accessory/medal/platinum/service

if(!new_human.client.prefs.playtime_perks)
medal_type = null

if(medal_type)
var/obj/item/clothing/accessory/medal/medal = new medal_type(closet_to_spawn_in)
medal.recipient_name = new_human.real_name
medal.recipient_rank = current_rank


//Gives glasses to the vision impaired
if(new_human.disabilities & NEARSIGHTED)
new /obj/item/clothing/glasses/regular(closet_to_spawn_in)

for(var/datum/view_record/medal_view/medal as anything in DB_VIEW(/datum/view_record/medal_view, DB_COMP("player_id", DB_EQUALS, new_human.client.player_data.id)))
morrowwolf marked this conversation as resolved.
Show resolved Hide resolved
if(!medal)
return
if(medal.recipient_name != new_human.real_name)
continue
if(medal.recipient_role != new_human.job)
continue
var/obj/item/clothing/accessory/medal/given_medal
switch(medal.medal_type)
if(MARINE_CONDUCT_MEDAL)
given_medal = new /obj/item/clothing/accessory/medal/bronze/conduct(closet_to_spawn_in)
if(MARINE_BRONZE_HEART_MEDAL)
given_medal = new /obj/item/clothing/accessory/medal/bronze/heart(closet_to_spawn_in)
if(MARINE_VALOR_MEDAL)
given_medal = new /obj/item/clothing/accessory/medal/silver/valor(closet_to_spawn_in)
if(MARINE_HEROISM_MEDAL)
given_medal = new /obj/item/clothing/accessory/medal/gold/heroism(closet_to_spawn_in)
else
return FALSE
given_medal.recipient_name = medal.recipient_name
given_medal.recipient_rank = medal.recipient_role
given_medal.medal_citation = medal.citation

/datum/equipment_preset/proc/load_traits(mob/living/carbon/human/new_human, client/mob_client)
var/client/real_client = mob_client || new_human.client
if(!real_client?.prefs?.traits)
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,7 @@
#include "code\game\objects\structures\crates_lockers\closets\secure\engineering.dm"
#include "code\game\objects\structures\crates_lockers\closets\secure\freezer.dm"
#include "code\game\objects\structures\crates_lockers\closets\secure\hydroponics.dm"
#include "code\game\objects\structures\crates_lockers\closets\secure\marine_personal.dm"
#include "code\game\objects\structures\crates_lockers\closets\secure\medical.dm"
#include "code\game\objects\structures\crates_lockers\closets\secure\personal.dm"
#include "code\game\objects\structures\crates_lockers\closets\secure\scientist.dm"
Expand Down
Loading
Loading