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 15 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
9 changes: 7 additions & 2 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
var/opened = 0
var/welded = 0
var/wall_mounted = 0 //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 @@ -63,17 +64,21 @@
return 1

/obj/structure/closet/proc/can_close()
for(var/mob/living/carbon/xenomorph/xeno in get_turf(src))
return 0
AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
if(can_be_stacked)
return 1
AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
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

/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 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 sill 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)
95 changes: 94 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,10 @@
load_gear(new_human, mob_client)
load_id(new_human, mob_client)
load_status(new_human, mob_client)
load_vanity(new_human, mob_client)
if(is_ground_level(new_human.z))
AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
load_vanity(new_human, mob_client)
else
spawn_vanity_in_personal_lockers(new_human, mob_client)
load_traits(new_human, mob_client)
if(round_statistics && count_participant)
round_statistics.track_new_participant(faction)
Expand Down Expand Up @@ -246,6 +249,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 || !new_human.client.prefs || !new_human.client.prefs.gear)
AndroBetel marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -1306,6 +1306,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