Skip to content

Commit

Permalink
Merge branch 'PvE-CMSS13:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirshbia committed Mar 26, 2024
2 parents f26359a + 11c2ec6 commit 1436aa3
Show file tree
Hide file tree
Showing 45 changed files with 659 additions and 264 deletions.
8 changes: 4 additions & 4 deletions code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

#define OPEN_TURF_PENALTY 1
#define DOOR_PENALTY 3
#define OBJECT_PENALTY 20
#define HUMAN_PENALTY 4
#define XENO_PENALTY 20
#define VEHICLE_PENALTY 25
#define OBJECT_PENALTY 20
#define FIRE_PENALTY 25
#define SENTRY_PENALTY 25
#define VEHICLE_PENALTY 25
#define WINDOW_FRAME_PENALTY 25
#define BARRICADE_PENALTY 50
#define WALL_PENALTY 50
#define FIRE_PENALTY 25

/*
PROBABILITY CALCULATIONS ARE HERE
Expand Down Expand Up @@ -90,7 +90,7 @@ PROBABILITY CALCULATIONS ARE HERE


/// Special blockers for pathfinding or obstacle handling
#define XENO_AI_SPECIAL_BLOCKERS list(/obj/flamer_fire, /obj/vehicle/multitile, /turf/open/space)
#define XENO_AI_SPECIAL_BLOCKERS list(/obj/flamer_fire, /obj/vehicle/multitile, /turf/open/space, /turf/open/gm/river)

// Friend-or-foe universal check
#define IS_SAME_HIVENUMBER(A,B) (A.hivenumber == B.hivenumber)
2 changes: 1 addition & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
var/obj/item/card/id/ID = A
if(ID.registered_name == oldname)
ID.registered_name = newname
ID.name = "[newname]'s ID Card ([ID.assignment])"
ID.name = "[newname]'s [ID.card_name] ([ID.assignment])"
if(!search_pda) break
search_id = 0
return 1
Expand Down
7 changes: 4 additions & 3 deletions code/controllers/subsystem/pathfinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ SUBSYSTEM_DEF(xeno_pathfinding)
/datum/controller/subsystem/xeno_pathfinding/proc/check_special_blockers(mob/living/carbon/xenomorph/xeno, turf/checking_turf)
var/list/pass_back = list()

pass_back += (checking_turf.type in XENO_AI_SPECIAL_BLOCKERS) ? checking_turf : list()
for(var/spec_blocker in XENO_AI_SPECIAL_BLOCKERS)
pass_back += istype(checking_turf, spec_blocker) ? checking_turf : list()

for(var/atom/checked_atom as anything in checking_turf)
pass_back += (checked_atom.type in XENO_AI_SPECIAL_BLOCKERS) ? checked_atom : list()
for(var/atom/checked_atom as anything in checking_turf)
pass_back += istype(checked_atom, spec_blocker) ? checked_atom : list()

return pass_back

Expand Down
7 changes: 4 additions & 3 deletions code/datums/ammo/bullet/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@

accuracy = HIT_ACCURACY_TIER_2
damage = 50
penetration = ARMOR_PENETRATION_TIER_4
shrapnel_chance = SHRAPNEL_CHANCE_TIER_2
damage_falloff = DAMAGE_FALLOFF_TIER_3 //"VP78 - the only pistol viable as a primary."-Vampmare, probably.
penetration = ARMOR_PENETRATION_TIER_2
shrapnel_chance = SHRAPNEL_CHANCE_TIER_1
effective_range_max = 3 //hopefully this fixes the damage woes.
damage_falloff = DAMAGE_FALLOFF_TIER_6

/datum/ammo/bullet/pistol/squash/toxin
name = "toxic squash-head pistol bullet"
Expand Down
6 changes: 3 additions & 3 deletions code/game/jobs/job/marine/squads.dm
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
continue

marine_card.assignment = "[new_name] [marine.job]"
marine_card.name = "[marine_card.registered_name]'s ID Card ([marine_card.assignment])"
marine_card.name = "[marine_card.registered_name]'s [marine_card.card_name] ([marine_card.assignment])"

/datum/squad/proc/setup_supply_drop_list()
SIGNAL_HANDLER
Expand Down Expand Up @@ -607,7 +607,7 @@

if(paygrade)
C.paygrade = paygrade
C.name = "[C.registered_name]'s ID Card ([C.assignment])"
C.name = "[C.registered_name]'s [C.card_name] ([C.assignment])"

var/obj/item/device/radio/headset/almayer/marine/headset = locate() in list(M.wear_l_ear, M.wear_r_ear)
if(headset && radio_freq)
Expand All @@ -629,7 +629,7 @@

C.access -= src.access
C.assignment = M.assigned_equipment_preset.assignment
C.name = "[C.registered_name]'s ID Card ([C.assignment])"
C.name = "[C.registered_name]'s [C.card_name] ([C.assignment])"

forget_marine_in_squad(M)

Expand Down
6 changes: 0 additions & 6 deletions code/game/machinery/doors/poddoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
var/base_icon_state = "pdoor"
id = 1
dir = NORTH
unslashable = TRUE
health = 0
layer = PODDOOR_CLOSED_LAYER
open_layer = PODDOOR_OPEN_LAYER
Expand Down Expand Up @@ -253,13 +252,11 @@
name = ""
icon = null
icon_state = ""
unslashable = TRUE
unacidable = TRUE

/obj/structure/machinery/door/poddoor/two_tile/four_tile/secure
icon = 'icons/obj/structures/doors/1x4blast_hor_secure.dmi'
openspeed = 17
unslashable = TRUE
unacidable = TRUE

/obj/structure/machinery/door/poddoor/two_tile/four_tile/secure/opened
Expand All @@ -268,7 +265,6 @@
/obj/structure/machinery/door/poddoor/two_tile/four_tile/vertical/secure
icon = 'icons/obj/structures/doors/1x4blast_vert_secure.dmi'
openspeed = 17
unslashable = TRUE
unacidable = TRUE

/obj/structure/machinery/door/poddoor/two_tile/four_tile/vertical/secure/open
Expand All @@ -286,7 +282,6 @@
/obj/structure/machinery/door/poddoor/two_tile/secure
icon = 'icons/obj/structures/doors/1x2blast_hor.dmi'
openspeed = 17
unslashable = TRUE
unacidable = TRUE

/obj/structure/machinery/door/poddoor/two_tile/vertical/secure
Expand Down Expand Up @@ -325,7 +320,6 @@
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, relativewall_neighbours)), 10)

/obj/structure/machinery/door/poddoor/almayer/locked
unslashable = TRUE
unacidable = TRUE

/obj/structure/machinery/door/poddoor/almayer/locked/attackby(obj/item/C as obj, mob/user as mob)
Expand Down
11 changes: 7 additions & 4 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@

var/modification_log = list()

var/card_name = "ID Card"

/obj/item/card/id/Initialize(mapload, ...)
. = ..()

Expand Down Expand Up @@ -132,7 +134,7 @@

/obj/item/card/id/proc/set_assignment(new_assignment)
assignment = new_assignment
name = "[registered_name]'s ID Card ([assignment])"
name = "[registered_name]'s [card_name] ([assignment])"

/obj/item/card/id/GetAccess()
return access
Expand Down Expand Up @@ -279,7 +281,7 @@
else
registered_name = "Agent Card"
assignment = "Agent"
name = "[registered_name]'s ID Card ([assignment])"
name = "[registered_name]'s [card_name] ([assignment])"

/obj/item/card/id/syndicate/afterattack(obj/item/O as obj, mob/user as mob, proximity)
if(!proximity) return
Expand All @@ -304,7 +306,7 @@
src.registered_name = ""
return
src.assignment = u
src.name = "[src.registered_name]'s ID Card ([src.assignment])"
src.name = "[src.registered_name]'s [card_name] ([src.assignment])"
to_chat(user, SPAN_NOTICE(" You successfully forge the ID card."))
registered_user = user
else if(!registered_user || registered_user == user)
Expand All @@ -324,7 +326,7 @@
alert("Invalid assignment.")
return
src.assignment = u
src.name = "[src.registered_name]'s ID Card ([src.assignment])"
src.name = "[src.registered_name]'s [card_name] ([src.assignment])"
to_chat(user, SPAN_NOTICE(" You successfully forge the ID card."))
return
if("Show")
Expand Down Expand Up @@ -387,6 +389,7 @@
item_state = "dogtag"
pinned_on_uniform = FALSE
var/dogtag_taken = FALSE
card_name = "dog tags"


/obj/item/card/id/dogtag/get_examine_text(mob/user)
Expand Down
28 changes: 26 additions & 2 deletions code/game/objects/items/weapons/blades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@
if(loc != user) //Only do unique stuff if you are holding it
return ..()

if(!do_after(user, interaction_time, INTERRUPT_INCAPACITATED, BUSY_ICON_HOSTILE))
return
playsound(user, 'sound/weapons/flipblade.ogg', 15, 1)
change_razor_state(!razor_opened)
to_chat(user, SPAN_NOTICE("You [razor_opened ? "reveal" : "hide"] [src]'s blade."))
Expand Down Expand Up @@ -375,3 +373,29 @@
human_user.apply_damage(rand(1,5), BRUTE, "head", src)
human_user.update_hair()

/obj/item/weapon/straight_razor/attack(mob/target, mob/user)
if((!ishuman(target)) || (user.a_intent == INTENT_HARM) || !razor_opened)
return ..()
var/mob/living/carbon/human/poor_bastard = target

var/timer = 10 SECONDS
var/message = "\The [user] begins to shave \the [poor_bastard]!"
if(skillcheck(user, SKILL_LEADERSHIP, SKILL_LEAD_EXPERT))
timer = 5 SECONDS
message = "\The [user] begins to <b>expertly</b> shave \the [poor_bastard]!"

user.visible_message(SPAN_WARNING(message))
if(!do_after(user, timer, INTERRUPT_ALL, BUSY_ICON_HOSTILE))
return

switch(user.zone_selected)
if("mouth")
poor_bastard.f_style = "Shaved"
user.visible_message(SPAN_WARNING("\The [user] shaves off \the [poor_bastard]'s facial hair!"))
if("head")
poor_bastard.h_style = pick("Skinhead", "Bald")
user.visible_message(SPAN_WARNING("\The [user] shaves off \the [poor_bastard]'s hair!"))

poor_bastard.apply_damage(rand(1,5), BRUTE, "head", src)
poor_bastard.update_hair()
return TRUE
1 change: 1 addition & 0 deletions code/modules/admin/game_master/game_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)
var/list/submenu_types = list(
/obj/structure/pipes/vents = /datum/game_master_submenu/ambush/vents,
/obj/structure/tunnel = /datum/game_master_submenu/ambush/tunnels,
/mob/living/carbon/human = /datum/game_master_submenu/infest,
)

/// List of current submenus
Expand Down
97 changes: 97 additions & 0 deletions code/modules/admin/game_master/game_master_submenu/infest.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#define DEFAULT_SPAWN_HIVE_STRING XENO_HIVE_NORMAL

/datum/game_master_submenu/infest
tgui_menu_name = "GameMasterSubmenuInfest"
tgui_menu_title = "Infest Control"

/// Current selected hive for the embryo
var/selected_hive = DEFAULT_SPAWN_HIVE_STRING

/// Target growth stage for the embryo
var/embryo_stage = 0

/datum/game_master_submenu/infest/ui_data(mob/user)
. = ..()

var/list/data = list()

data["selected_hive"] = selected_hive
data["embryo_stage"] = embryo_stage

return data

/datum/game_master_submenu/infest/ui_static_data(mob/user)
. = ..()

var/list/data = list()

data["selectable_hives"] = ALL_XENO_HIVES

return data

/datum/game_master_submenu/infest/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()

switch(action)
if("set_selected_hive")
selected_hive = params["new_hive"]
return TRUE

if("set_embryo_stage")
embryo_stage = params["stage"]
return TRUE

if("infest")
setup_embryo()
return TRUE

if("clear_infest")
remove_embryo()
return TRUE

if("burst")
force_burst()
return TRUE

/datum/game_master_submenu/infest/proc/setup_embryo()
var/obj/item/alien_embryo/infesting_embryo
for(var/obj/item/alien_embryo/embryo in referenced_atom) //if this hive's embryo already exists, convert to larva and use it
if(embryo.hivenumber == selected_hive)
infesting_embryo = embryo
else
qdel(embryo)

if(!infesting_embryo) //else, make a new one
infesting_embryo = new /obj/item/alien_embryo(referenced_atom)
infesting_embryo.hivenumber = selected_hive

var/mob/living/carbon/human/infested_host = referenced_atom
infested_host.species?.larva_impregnated(infesting_embryo) //Yautja handling

infesting_embryo.stage = embryo_stage

/datum/game_master_submenu/infest/proc/remove_embryo()
for(var/obj/item/alien_embryo/embryo in referenced_atom)
qdel(embryo)

/datum/game_master_submenu/infest/proc/force_burst()
var/mob/living/carbon/xenomorph/larva/infesting_larva = locate() in referenced_atom //if a larva already exists, use it
if(infesting_larva)
infesting_larva.chest_burst(referenced_atom)
return

for(var/obj/item/alien_embryo/embryo in referenced_atom) //else if this hive's embryo already exists, convert to larva and use it
if(embryo.hivenumber == selected_hive)
embryo.become_larva()
infesting_larva = locate() in referenced_atom
break
if(infesting_larva)
infesting_larva.chest_burst(referenced_atom)
return

infesting_larva = new /mob/living/carbon/xenomorph/larva(referenced_atom, null, selected_hive) //else, make a new larva
var/mob/living/carbon/human/infested_host = referenced_atom
infesting_larva.ckey = infested_host.ckey
infesting_larva.chest_burst(referenced_atom)

#undef DEFAULT_SPAWN_HIVE_STRING
4 changes: 2 additions & 2 deletions code/modules/admin/verbs/select_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
I.access = J.get_access()
I.rank = J.title
I.assignment = J.disp_title
I.name = "[I.registered_name]'s ID Card ([I.assignment])"
I.name = "[I.registered_name]'s [I.card_name] ([I.assignment])"
I.paygrade = J.get_paygrade()
if(H.w_uniform)
var/obj/item/clothing/C = H.w_uniform
Expand Down Expand Up @@ -81,7 +81,7 @@

I.rank = IDtitle
I.assignment = IDtitle
I.name = "[I.registered_name]'s ID Card ([I.assignment])"
I.name = "[I.registered_name]'s [I.card_name] ([I.assignment])"

var/new_faction = tgui_input_list(usr, "Select faction.", "Faction Choice", FACTION_LIST_HUMANOID)
if(!new_faction)
Expand Down
Loading

0 comments on commit 1436aa3

Please sign in to comment.