Skip to content

Commit

Permalink
Merge branch 'master' into Spawn_Nuke_Decypted
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben10083 authored Jul 15, 2023
2 parents 57546b0 + 885b70b commit 16ad011
Show file tree
Hide file tree
Showing 39 changed files with 229 additions and 179 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
#define XENO_LEAVE_TIMER_LARVA 80 //80 seconds
/// The time against away_timer when an AFK xeno (not larva) can be replaced
#define XENO_LEAVE_TIMER 300 //300 seconds
/// The time against away_timer when an AFK facehugger converts to a npc
#define XENO_FACEHUGGER_LEAVE_TIMER 420 //420 seconds
/// The time against away_timer when an AFK xeno gets listed in the available list so ghosts can get ready
#define XENO_AVAILABLE_TIMER 60 //60 seconds

Expand Down
31 changes: 18 additions & 13 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,23 +333,28 @@ Additional game mode variables.
/datum/game_mode/proc/check_xeno_late_join(mob/xeno_candidate)
if(jobban_isbanned(xeno_candidate, JOB_XENOMORPH)) // User is jobbanned
to_chat(xeno_candidate, SPAN_WARNING("You are banned from playing aliens and cannot spawn as a xenomorph."))
return
return 1
return FALSE
return TRUE

/datum/game_mode/proc/attempt_to_join_as_xeno(mob/xeno_candidate, instant_join = 0)
/datum/game_mode/proc/attempt_to_join_as_xeno(mob/xeno_candidate, instant_join = FALSE)
var/list/available_xenos = list()
var/list/available_xenos_non_ssd = list()

for(var/mob/living/carbon/xenomorph/X in GLOB.living_xeno_list)
var/area/A = get_area(X)
if(is_admin_level(X.z) && (!A || !(A.flags_area & AREA_ALLOW_XENO_JOIN)) || X.aghosted)
continue //xenos on admin z level and aghosted ones don't count
if(istype(X) && ((!islarva(X) && (XENO_LEAVE_TIMER - X.away_timer < XENO_AVAILABLE_TIMER)) || (islarva(X) && (XENO_LEAVE_TIMER_LARVA - X.away_timer < XENO_AVAILABLE_TIMER))))
if(!X.client)
available_xenos += X
else
available_xenos_non_ssd += X

for(var/mob/living/carbon/xenomorph/cur_xeno as anything in GLOB.living_xeno_list)
if(cur_xeno.aghosted)
continue //aghosted xenos don't count
var/area/area = get_area(cur_xeno)
if(is_admin_level(cur_xeno.z) && (!area || !(area.flags_area & AREA_ALLOW_XENO_JOIN)))
continue //xenos on admin z level don't count
if(!istype(cur_xeno))
continue
var/required_time = islarva(cur_xeno) ? XENO_LEAVE_TIMER_LARVA - cur_xeno.away_timer : XENO_LEAVE_TIMER - cur_xeno.away_timer
if(required_time > XENO_AVAILABLE_TIMER)
continue
if(!cur_xeno.client)
available_xenos += cur_xeno
else
available_xenos_non_ssd += cur_xeno

var/datum/hive_status/hive
for(var/hivenumber in GLOB.hive_datum)
Expand Down
10 changes: 10 additions & 0 deletions code/game/machinery/vending/vendor_types/crew/staff_officer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@

GLOBAL_LIST_INIT(cm_vending_clothing_staff_officer, list(
list("STANDARD EQUIPMENT (TAKE ALL)", 0, null, null, null),
list("Uniform", 0, /obj/item/clothing/under/marine/officer/bridge, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Boots", 0, /obj/item/clothing/shoes/marine/knife, MARINE_CAN_BUY_SHOES, VENDOR_ITEM_MANDATORY),
list("Headset", 0, /obj/item/device/radio/headset/almayer/mcom, MARINE_CAN_BUY_EAR, VENDOR_ITEM_MANDATORY),
list("Helmet", 0, /obj/item/clothing/head/helmet/marine/MP/SO, MARINE_CAN_BUY_HELMET, VENDOR_ITEM_MANDATORY),
list("MRE", 0, /obj/item/storage/box/MRE, MARINE_CAN_BUY_MRE, VENDOR_ITEM_MANDATORY),

list("JACKET (CHOOSE 1)", 0, null, null, null),
list("Service Jacket", 0, /obj/item/clothing/suit/storage/jacket/marine/service, MARINE_CAN_BUY_ARMOR, VENDOR_ITEM_RECOMMENDED),

list("HAT (CHOOSE 1)", 0, null, null, null),
list("Beret, Green", 0, /obj/item/clothing/head/beret/cm, MARINE_CAN_BUY_HELMET, VENDOR_ITEM_RECOMMENDED),
list("Beret, Tan", 0, /obj/item/clothing/head/beret/cm/tan, MARINE_CAN_BUY_HELMET, VENDOR_ITEM_RECOMMENDED),
list("Patrol Cap", 0, /obj/item/clothing/head/cmcap, MARINE_CAN_BUY_HELMET, VENDOR_ITEM_RECOMMENDED),


list("PERSONAL SIDEARM (CHOOSE 1)", 0, null, null, null),
list("M44 Revolver", 0, /obj/item/storage/belt/gun/m44/mp, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
list("M4A3 Pistol", 0, /obj/item/storage/belt/gun/m4a3/commander, MARINE_CAN_BUY_BELT, VENDOR_ITEM_RECOMMENDED),
Expand Down
14 changes: 8 additions & 6 deletions code/game/objects/effects/landmarks/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,25 @@

/obj/effect/landmark/yautja_teleport
name = "yautja_teleport"
/// The index we registered as in mainship_yautja_desc or yautja_teleport_descs
var/desc_index

/obj/effect/landmark/yautja_teleport/Initialize(mapload, ...)
. = ..()
var/turf/T = get_turf(src)
var/turf/turf = get_turf(src)
desc_index = turf.loc.name + turf.loc_to_string()
if(is_mainship_level(z))
GLOB.mainship_yautja_teleports += src
GLOB.mainship_yautja_desc[T.loc.name + T.loc_to_string()] = src
GLOB.mainship_yautja_desc[desc_index] = src
else
GLOB.yautja_teleports += src
GLOB.yautja_teleport_descs[T.loc.name + T.loc_to_string()] = src
GLOB.yautja_teleport_descs[desc_index] = src

/obj/effect/landmark/yautja_teleport/Destroy()
var/turf/T = get_turf(src)
GLOB.mainship_yautja_teleports -= src
GLOB.yautja_teleports -= src
GLOB.mainship_yautja_desc -= T.loc.name + T.loc_to_string()
GLOB.yautja_teleport_descs -= T.loc.name + T.loc_to_string()
GLOB.mainship_yautja_desc -= desc_index
GLOB.yautja_teleport_descs -= desc_index
return ..()


Expand Down
12 changes: 8 additions & 4 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@
/// Checks whether a table is a straight line along a given axis
/obj/structure/surface/table/proc/straight_table_check(direction)
var/obj/structure/surface/table/table = src
while(table)
var/obj/structure/surface/table/side_table
var/tables_count = 7 // Lazy extra safety against infinite loops. If table big, can't flip, i guess.
while(--tables_count)
// Check whether there are connected tables perpendicular to the axis
for(var/angle in list(-90, 90))
table = locate() in get_step(loc, turn(direction, angle))
if(table && !table.flipped)
side_table = locate() in get_step(table, turn(direction, angle))
if(side_table && !side_table.flipped)
return FALSE
table = locate() in get_step(table, direction)
if(!table || table.flipped)
Expand All @@ -339,6 +341,8 @@
var/obj/structure/surface/table/reinforced/reinforced_table = table
if(reinforced_table.status == RTABLE_NORMAL)
return FALSE
if(!tables_count)
return FALSE
return TRUE

/obj/structure/surface/table/verb/do_flip()
Expand Down Expand Up @@ -421,7 +425,7 @@
to_chat(usr, SPAN_WARNING("You have moved a table too recently."))
return FALSE

if(!skip_straight_check && (!straight_table_check(turn(direction, 90)) || !straight_table_check(turn(direction, -90))))
if(!skip_straight_check && !(straight_table_check(turn(direction, 90)) && straight_table_check(turn(direction, -90))))
to_chat(usr, SPAN_WARNING("[src] is too wide to be flipped."))
return FALSE

Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
PF.flags_can_pass_all = PASS_ALL^PASS_OVER_THROW_ITEM

/mob/living/carbon/xenomorph/facehugger/Life(delta_time)
if(!client && !aghosted && away_timer > XENO_FACEHUGGER_LEAVE_TIMER)
// Become a npc once again
new /obj/item/clothing/mask/facehugger(loc, hivenumber)
qdel(src)
return
if(stat != DEAD && !lying && !(locate(/obj/effect/alien/weeds) in get_turf(src)))
adjustBruteLoss(1)
return ..()
Expand Down
Loading

0 comments on commit 16ad011

Please sign in to comment.