Skip to content

Commit

Permalink
Yautja Armory and Ship access changes (#3877)
Browse files Browse the repository at this point in the history
# About the pull request
- Adds locks on the gladiator doors in Yautja Ship, and adds a plasma
rifle armory to the ship locked to Ancient Yautja.
- Reduces amount of healing herbs in the Yautja Ship arena, and makes it
clear they're supposed to stay on the ship. Moving most of them to the
plasma armory.
- Fixes the "consoles" in the Yautja flight deck being the wrong way
around.
- Adds access defines for Yautja ship doors, requiring display of a
bracer ID chip.
- Updates /datum/rank to /datum/yautja_rank to make it clearer what it's
for.
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Limits access to powerful gear, but also makes it so equipment usually
admin spawned for abomination hunts is automatically available.

# Testing Photographs and Procedure
I have confirmed my changes work as intended, and particularly
experimented around my change to /obj/proc/allowed() and found no errors
or issues.

# Changelog
:cl:
code: Changes /datum/rank to /datum/yautja_rank to be clearer on what it
is used for.
add: Added access defines for Yautja ship.
add: Added rank identifiers on Yautja equipment presets to help set
access levels on their bracer chips.
maptweak: Changed the doors on the Yautja ship to be their own subtypes,
with certain ones being locked to Yautja or certain Yautja Ranks.
code: Slightly modernised obj/proc/allowed, and also made it check for
access on bracer chips if present.
maptweak: Replaced the unworthy prey section of the Yautja Ship with a
secondary armory for plasma rifles, however the door is inaccessible to
most Yautja. Intended to make it a bit less obvious admins are spawning
them in for the rare times they're used/necessary.
maptweak: Above armory will automatically open if an Abomination is
detected.
maptweak: Reduces amount of herbs on the Yautja Ship.
maptweak: Fixes the "Consoles" orientation in the Yautja flight deck.
/:cl:

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
realforest2001 and harryob authored Jul 24, 2023
1 parent 6d78241 commit 35d4275
Show file tree
Hide file tree
Showing 13 changed files with 358 additions and 176 deletions.
8 changes: 8 additions & 0 deletions code/__DEFINES/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ most of them are tied into map-placed objects. This should be reworked in the fu
#define ACCESS_WY_CORPORATE_DS 202
#define ACCESS_PRESS 203
//=================================================

// Yautja Access Levels
/// Requires a visible ID chip to open
#define ACCESS_YAUTJA_SECURE 250
/// Elders+ only
#define ACCESS_YAUTJA_ELDER 251
/// Ancients only
#define ACCESS_YAUTJA_ANCIENT 252
16 changes: 8 additions & 8 deletions code/__DEFINES/clans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
/// Scales with clan size
#define CLAN_LIMIT_SIZE 2

var/global/list/datum/rank/clan_ranks = list(
CLAN_RANK_UNBLOODED = new /datum/rank/unblooded(),
CLAN_RANK_YOUNG = new /datum/rank/young(),
CLAN_RANK_BLOODED = new /datum/rank/blooded(),
CLAN_RANK_ELITE = new /datum/rank/elite(),
CLAN_RANK_ELDER = new /datum/rank/elder(),
CLAN_RANK_LEADER = new /datum/rank/leader(),
CLAN_RANK_ADMIN = new /datum/rank/ancient()
var/global/list/datum/yautja_rank/clan_ranks = list(
CLAN_RANK_UNBLOODED = new /datum/yautja_rank/unblooded(),
CLAN_RANK_YOUNG = new /datum/yautja_rank/young(),
CLAN_RANK_BLOODED = new /datum/yautja_rank/blooded(),
CLAN_RANK_ELITE = new /datum/yautja_rank/elite(),
CLAN_RANK_ELDER = new /datum/yautja_rank/elder(),
CLAN_RANK_LEADER = new /datum/yautja_rank/leader(),
CLAN_RANK_ADMIN = new /datum/yautja_rank/ancient()
)

var/global/list/clan_ranks_ordered = list(
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals/signals_global.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@

/// From /datum/game_mode/colonialmarines/proc/check_ground_humans()
#define COMSIG_GLOB_GROUNDSIDE_FORSAKEN_HANDLING "!groundside_forsaken_handling"

/// From
#define COMSIG_GLOB_YAUTJA_ARMORY_OPENED "yautja_armory_opened"
25 changes: 18 additions & 7 deletions code/game/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,28 @@
//returns FALSE otherwise
/obj/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(check_access()) return TRUE
if(isRemoteControlling(M)) return TRUE //AI can do whatever he wants
if(check_access() || isRemoteControlling(M))
return TRUE

else if(ishuman(M))
if(ishuman(M))
var/mob/living/carbon/human/H = M
//if they are holding or wearing a card that has access, that works
if(check_access(H.get_active_hand()) || check_access(H.wear_id)) return TRUE
else if(istype(M, /mob/living/carbon/xenomorph))
if(check_access(H.get_active_hand()) || check_access(H.wear_id))
return TRUE
return check_yautja_access(H)
if(istype(M, /mob/living/carbon/xenomorph))
var/mob/living/carbon/C = M
if(check_access(C.get_active_hand())) return TRUE
return FALSE
if(check_access(C.get_active_hand()))
return TRUE
return FALSE

/obj/proc/check_yautja_access(mob/living/carbon/human/yautja)
if(!istype(yautja))
return FALSE
var/obj/item/clothing/gloves/yautja/hunter/bracer = yautja.gloves
if(!istype(bracer) || !bracer.embedded_id || !check_access(bracer.embedded_id))
return FALSE
return TRUE

/obj/item/proc/GetAccess() return list()

Expand Down
30 changes: 30 additions & 0 deletions code/game/machinery/doors/airlock_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,36 @@
/obj/structure/machinery/door/airlock/strata/mining/autoname
autoname = TRUE

//YAUTJA SHIP - CURRENTLY USES STRATA DOORS
/obj/structure/machinery/door/airlock/yautja
name = "\improper Airlock"
icon = 'icons/obj/structures/doors/strata/strata_doors.dmi'
openspeed = 5
req_access = null
req_one_access = null
tiles_with = list(
/obj/structure/window/framed/strata,
/obj/structure/machinery/door/airlock,
)
masterkey_resist = TRUE
no_panel = TRUE
not_weldable = TRUE
unacidable = TRUE

/obj/structure/machinery/door/airlock/yautja/autoname
autoname = TRUE

/obj/structure/machinery/door/airlock/yautja/secure
heavy = TRUE
req_one_access = list(ACCESS_YAUTJA_SECURE, ACCESS_YAUTJA_ELDER, ACCESS_YAUTJA_ANCIENT)

/obj/structure/machinery/door/airlock/yautja/secure/elder
req_one_access = list(ACCESS_YAUTJA_ELDER, ACCESS_YAUTJA_ANCIENT)

/obj/structure/machinery/door/airlock/yautja/secure/ancient
req_one_access = list(ACCESS_YAUTJA_ANCIENT)
unslashable = TRUE

//FIORINA PENITENTIARY (PRISON_FOP) MAINTENANCE HATCHES

/obj/structure/machinery/door/airlock/prison_hatch
Expand Down
11 changes: 11 additions & 0 deletions code/game/machinery/doors/shutters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@
. = ..()
relativewall_neighbours()

/obj/structure/machinery/door/poddoor/shutters/almayer/yautja
name = "Armory Shutter"
id = "Yautja Armory"
needs_power = FALSE
unacidable = TRUE
indestructible = TRUE

/obj/structure/machinery/door/poddoor/shutters/almayer/yautja/Initialize()
. = ..()
RegisterSignal(SSdcs, COMSIG_GLOB_YAUTJA_ARMORY_OPENED, PROC_REF(open))

/obj/structure/machinery/door/poddoor/shutters/almayer/containment
unacidable = TRUE

Expand Down
4 changes: 2 additions & 2 deletions code/modules/clans/client.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@
to_chat(src, SPAN_WARNING("This player doesn't belong to a clan!"))
return

var/list/datum/rank/ranks = clan_ranks.Copy()
var/list/datum/yautja_rank/ranks = clan_ranks.Copy()
ranks -= CLAN_RANK_ADMIN // Admin rank should not and cannot be obtained from here

var/datum/rank/chosen_rank
var/datum/yautja_rank/chosen_rank
if(has_clan_permission(CLAN_PERMISSION_ADMIN_MODIFY, warn = FALSE))
var/input = tgui_input_list(src, "Select the rank to change this user to.", "Select Rank", ranks)

Expand Down
16 changes: 8 additions & 8 deletions code/modules/clans/rank.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/rank
/datum/yautja_rank
var/name

var/limit_type
Expand All @@ -7,37 +7,37 @@
var/permissions = CLAN_PERMISSION_USER_VIEW
var/permission_required = CLAN_PERMISSION_USER_MODIFY

/datum/rank/unblooded
/datum/yautja_rank/unblooded
name = CLAN_RANK_UNBLOODED
permission_required = CLAN_PERMISSION_ADMIN_MODIFY

/datum/rank/young
/datum/yautja_rank/young
name = CLAN_RANK_YOUNG

/datum/rank/blooded
/datum/yautja_rank/blooded
name = CLAN_RANK_BLOODED

/datum/rank/elite
/datum/yautja_rank/elite
name = CLAN_RANK_ELITE

limit_type = CLAN_LIMIT_SIZE
limit = 5

/datum/rank/elder
/datum/yautja_rank/elder
name = CLAN_RANK_ELDER

limit_type = CLAN_LIMIT_SIZE
limit = 12

/datum/rank/leader
/datum/yautja_rank/leader
name = CLAN_RANK_LEADER

permissions = CLAN_PERMISSION_USER_ALL
permission_required = CLAN_PERMISSION_ADMIN_MODIFY
limit_type = CLAN_LIMIT_NUMBER
limit = 1

/datum/rank/ancient
/datum/yautja_rank/ancient
name = CLAN_RANK_ADMIN

permission_required = CLAN_PERMISSION_ADMIN_MANAGER
Expand Down
6 changes: 4 additions & 2 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
var/caster_material = "ebony"

var/obj/item/card/id/bracer_chip/embedded_id

var/owner_rank = CLAN_RANK_UNBLOODED_INT

var/caster_deployed = FALSE
var/obj/item/weapon/gun/energy/yautja/plasma_caster/caster
Expand All @@ -232,8 +232,10 @@
var/obj/item/weapon/wristblades/left_wristblades
var/obj/item/weapon/wristblades/right_wristblades

/obj/item/clothing/gloves/yautja/hunter/Initialize(mapload, new_translator_type, new_caster_material)
/obj/item/clothing/gloves/yautja/hunter/Initialize(mapload, new_translator_type, new_caster_material, new_owner_rank)
. = ..()
if(new_owner_rank)
owner_rank = new_owner_rank
embedded_id = new(src)
if(new_translator_type)
translator_type = new_translator_type
Expand Down
20 changes: 20 additions & 0 deletions code/modules/cm_preds/yaut_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,31 @@
desc = "A complex cypher chip embedded within a set of clan bracers."
icon = 'icons/obj/items/radio.dmi'
icon_state = "upp_key"
access = list(ACCESS_YAUTJA_SECURE)
w_class = SIZE_TINY
flags_equip_slot = SLOT_ID
flags_item = ITEM_PREDATOR|DELONDROP|NODROP
paygrade = null

/obj/item/card/id/bracer_chip/set_user_data(mob/living/carbon/human/human_user)
if(!istype(human_user))
return

registered_name = human_user.real_name
registered_ref = WEAKREF(human_user)
registered_gid = human_user.gid
blood_type = human_user.blood_type

var/list/new_access = list(ACCESS_YAUTJA_SECURE)
var/obj/item/clothing/gloves/yautja/hunter/bracer = loc
if(istype(bracer) && bracer.owner_rank)
switch(bracer.owner_rank)
if(CLAN_RANK_ELDER_INT, CLAN_RANK_LEADER_INT)
new_access = list(ACCESS_YAUTJA_SECURE, ACCESS_YAUTJA_ELDER)
if(CLAN_RANK_ADMIN_INT)
new_access = list(ACCESS_YAUTJA_SECURE, ACCESS_YAUTJA_ELDER, ACCESS_YAUTJA_ANCIENT)
access = new_access

/obj/item/storage/medicomp
name = "medicomp"
desc = "A complex kit of alien tools and medicines."
Expand Down
9 changes: 8 additions & 1 deletion code/modules/gear_presets/yautja.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
skills = /datum/skills/yautja/warrior

var/default_cape_type = "None"
var/clan_rank

/datum/equipment_preset/yautja/load_race(mob/living/carbon/human/new_human, client/mob_client)
new_human.set_species(SPECIES_YAUTJA)
Expand Down Expand Up @@ -53,7 +54,7 @@
cape_color = mob_client.prefs.predator_cape_color

new_human.equip_to_slot_or_del(new /obj/item/clothing/under/chainshirt/hunter(new_human), WEAR_BODY)
new_human.equip_to_slot_or_del(new /obj/item/clothing/gloves/yautja/hunter(new_human, translator_type, caster_material), WEAR_HANDS)
new_human.equip_to_slot_or_del(new /obj/item/clothing/gloves/yautja/hunter(new_human, translator_type, caster_material, clan_rank), WEAR_HANDS)
new_human.equip_to_slot_or_del(new /obj/item/device/radio/headset/yautja(new_human), WEAR_L_EAR)
new_human.equip_to_slot_or_del(new /obj/item/device/flashlight/lantern(new_human), WEAR_R_STORE)
new_human.equip_to_slot_or_del(new /obj/item/device/yautja_teleporter(new_human), WEAR_L_STORE)
Expand Down Expand Up @@ -89,6 +90,7 @@
/datum/equipment_preset/yautja/youngblood
name = "Yautja Young"
flags = EQUIPMENT_PRESET_START_OF_ROUND
clan_rank = CLAN_RANK_UNBLOODED_INT

/datum/equipment_preset/yautja/youngblood/load_name(mob/living/carbon/human/new_human, randomise)
. = ..()
Expand All @@ -100,12 +102,14 @@
name = "Yautja Blooded"
flags = EQUIPMENT_PRESET_START_OF_ROUND
default_cape_type = PRED_YAUTJA_QUARTER_CAPE
clan_rank = CLAN_RANK_BLOODED_INT

// ELITE
/datum/equipment_preset/yautja/elite
name = "Yautja Elite"
flags = EQUIPMENT_PRESET_START_OF_ROUND
default_cape_type = PRED_YAUTJA_HALF_CAPE
clan_rank = CLAN_RANK_ELITE_INT

/datum/equipment_preset/yautja/elite/load_name(mob/living/carbon/human/new_human, randomise)
. = ..()
Expand All @@ -117,6 +121,7 @@
name = "Yautja Elder"
flags = EQUIPMENT_PRESET_START_OF_ROUND
default_cape_type = PRED_YAUTJA_THIRD_CAPE
clan_rank = CLAN_RANK_ELDER_INT

/datum/equipment_preset/yautja/elder/load_name(mob/living/carbon/human/new_human, randomise)
. = ..()
Expand All @@ -132,6 +137,7 @@
name = "Yautja Leader"
flags = EQUIPMENT_PRESET_START_OF_ROUND
default_cape_type = PRED_YAUTJA_CAPE
clan_rank = CLAN_RANK_LEADER_INT

/datum/equipment_preset/yautja/leader/load_name(mob/living/carbon/human/new_human, randomise)
. = ..()
Expand All @@ -147,6 +153,7 @@
name = "Yautja Ancient"
flags = EQUIPMENT_PRESET_START_OF_ROUND
default_cape_type = PRED_YAUTJA_PONCHO
clan_rank = CLAN_RANK_ADMIN_INT

/datum/equipment_preset/yautja/ancient/load_name(mob/living/carbon/human/new_human, randomise)
. = ..()
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/Embryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@

if(isyautja(affected_mob) || (flags_embryo & FLAG_EMBRYO_PREDATOR))
new_xeno = new /mob/living/carbon/xenomorph/larva/predalien(affected_mob)
yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nAn abomination has been detected at [get_area_name(new_xeno)]. It is a stain upon our purity and is unfit for life. Exterminate it immediately"))
yautja_announcement(SPAN_YAUTJABOLDBIG("WARNING!\n\nAn abomination has been detected at [get_area_name(new_xeno)]. It is a stain upon our purity and is unfit for life. Exterminate it immediately.\n\nHeavy Armory unlocked."))
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_YAUTJA_ARMORY_OPENED)
else
new_xeno = new(affected_mob)

Expand Down
Loading

0 comments on commit 35d4275

Please sign in to comment.