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 Apr 1, 2024
2 parents 9f5f222 + 897af44 commit 8628bff
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 52 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define VEHICLE_PENALTY 25
#define WINDOW_FRAME_PENALTY 25
#define BARRICADE_PENALTY 50
#define WALL_PENALTY 50
#define WALL_PENALTY 100

/*
PROBABILITY CALCULATIONS ARE HERE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,19 @@
qdel(src)
return FALSE

if(locate(/obj/structure/mineral_door/resin) in location)
qdel(src)
return FALSE

var/area/current_area = get_area(location)
if(!current_area.is_resin_allowed)
for(var/client/game_master in GLOB.game_masters)
to_chat(game_master, SPAN_XENOBOLDNOTICE("This area doesn't allow xenos to build here"))
to_chat(game_master, SPAN_XENOBOLDNOTICE("[current_area] doesn't allow xenos to build here"))

qdel(src)
return FALSE

if(distance > 10)
if(locate(/obj/structure/mineral_door/resin) in location)
qdel(src)
return FALSE

if(checked_xeno.current_target)
if(distance > 10)
return FALSE

if(!locate(/datum/action/xeno_action/activable/secrete_resin) in checked_xeno.actions)
Expand All @@ -55,7 +52,7 @@
if(checked_xeno.get_plasma_percentage() < PLASMA_RETREAT_PERCENTAGE)
var/turf/xeno_loc = get_turf(checked_xeno)
if(xeno_loc.weeds)
checked_xeno.set_resting(TRUE, FALSE, TRUE)
checked_xeno.set_resting(TRUE, FALSE)

return FALSE

Expand All @@ -75,19 +72,21 @@
var/turf/parent_turf = get_turf(parent)
var/distance = get_dist(processing_xeno, parent)

var/list/turfs_around = xeno_loc.AdjacentTurfs()
if(turfs_around && distance < 1) // We are gonna be stuck after building at our loc, let's step away
return processing_xeno.move_to_next_turf(pick(turfs_around))

var/is_diagonal = (get_dir(processing_xeno, parent_turf) in diagonals)
if(is_diagonal || distance > 1)
/// Is xeno adjacent to parent_turf?
if(distance > 1)
return processing_xeno.move_to_next_turf(parent_turf)

/// Xeno will be stuck after building at its loc, if so - we command droney to step away
if(distance < 1)
return processing_xeno.move_to_next_turf(pick(GLOB.cardinals))

/// If there is something that might block our resin - slash it
for(var/obj/structure/blocker in parent_turf.contents)
if(!blocker.unslashable && blocker.density || istype(blocker, /obj/structure/bed))
if(!blocker.unslashable && (blocker.density || istype(blocker, /obj/structure/bed)))
INVOKE_ASYNC(processing_xeno, TYPE_PROC_REF(/mob, do_click), blocker, "", list())
return TRUE

/// If no ground weeds present - command our xeno to plant one
if(!parent_turf.weeds)
var/datum/action/xeno_action/onclick/plant_weeds/weeds_action = locate() in processing_xeno.actions
INVOKE_ASYNC(weeds_action, TYPE_PROC_REF(/datum/action/xeno_action/onclick/plant_weeds, use_ability_wrapper))
Expand All @@ -96,24 +95,30 @@
var/list/resin_types = processing_xeno.resin_build_order
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_turf/wall) in resin_types

var/wall_nearby = FALSE
var/blocked_turfs = 0
for(var/turf/blocked_turf in orange(1, parent_turf) - parent_turf.AdjacentTurfs())
blocked_turfs++
/// Let's decide whenever we are building a door or naw
var/build_door = FALSE
for(var/turf/blocked_turf in RANGE_TURFS(1, parent_turf) - parent_turf)
var/direction = get_dir(parent_turf, blocked_turf)
if(direction in diagonals)
continue

if(get_dir(blocked_turf, parent_turf) in diagonals)
if(!blocked_turf.density)
continue

if(blocked_turf.density)
wall_nearby = TRUE
/// Checking for any opposite walls on angles 135, 180, 225 respectfully
for(var/opposite_dir in reverse_nearby_direction(direction))
var/turf/opposite_turf = get_step(parent_turf, opposite_dir)
if(opposite_turf.density)
build_door = TRUE
break

var/obj/effect/alien/weeds/turf_weeds = blocked_turf.weeds
if(turf_weeds && turf_weeds.secreting)
wall_nearby = TRUE // Something is being constructed nearby, let's bet this is a new resin wall
var/obj/effect/alien/weeds/opposite_weeds = opposite_turf.weeds
if(opposite_weeds && opposite_weeds.secreting)
/// Something is being constructed nearby, let's bet this is a new resin wall
build_door = TRUE

if(wall_nearby)
if(prob(XENO_DOOR_BUILDING_CHANCE) || (wall_nearby && blocked_turfs > 1))
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types
if(build_door || prob(XENO_DOOR_BUILDING_CHANCE))
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types

var/datum/action/xeno_action/activable/secrete_resin/build_action = locate() in processing_xeno.actions
INVOKE_ASYNC(build_action, TYPE_PROC_REF(/datum/action/xeno_action/activable/secrete_resin, use_ability_wrapper), parent_turf)
Expand Down
14 changes: 0 additions & 14 deletions code/datums/skills/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ United States Colonial Marines
name = "Private"
//same as default

/datum/skills/pfc/crafty
name = "Crafty Private"
skills = list(
SKILL_CONSTRUCTION = SKILL_CONSTRUCTION_TRAINED,
SKILL_ENGINEER = SKILL_ENGINEER_TRAINED,
)

/datum/skills/combat_medic
name = "Combat Medic"
skills = list(
Expand All @@ -23,13 +16,6 @@ United States Colonial Marines
SKILL_JTAC = SKILL_JTAC_BEGINNER,
)

/datum/skills/combat_medic/crafty
name = "Crafty Combat Medic"
skills = list(
SKILL_CONSTRUCTION = SKILL_CONSTRUCTION_TRAINED,
SKILL_ENGINEER = SKILL_ENGINEER_TRAINED,
)

/datum/skills/combat_engineer
name = "Combat Engineer"
skills = list(
Expand Down
6 changes: 1 addition & 5 deletions code/modules/gear_presets/cmb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@
rank = JOB_SQUAD_MARINE
paygrade = "ME2"
role_comm_title = "A-RFN"
skills = /datum/skills/pfc/crafty
skills = /datum/skills/pfc
faction = FACTION_MARSHAL
faction_group = list(FACTION_MARSHAL, FACTION_MARINE)

Expand Down Expand Up @@ -590,10 +590,6 @@
new_human.equip_to_slot_or_del(new /obj/item/reagent_container/hypospray/autoinjector/emergency, WEAR_IN_BELT)
new_human.equip_to_slot_or_del(new /obj/item/reagent_container/hypospray/autoinjector/emergency, WEAR_IN_BELT)
new_human.equip_to_slot_or_del(new /obj/item/bodybag/cryobag, WEAR_IN_BELT)
if(new_human.disabilities & NEARSIGHTED)
new_human.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/health/prescription, WEAR_EYES)
else
new_human.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/health, WEAR_EYES)
new_human.equip_to_slot_or_del(new /obj/item/clothing/gloves/marine, WEAR_HANDS)
new_human.equip_to_slot_or_del(new /obj/item/clothing/shoes/marine/knife, WEAR_FEET)
new_human.equip_to_slot_or_del(new /obj/item/storage/box/MRE, WEAR_IN_BACK)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/gear_presets/dust_raider.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
rank = JOB_SQUAD_MARINE
paygrade = "ME2"
role_comm_title = "RFN"
skills = /datum/skills/pfc/crafty
skills = /datum/skills/pfc

/datum/equipment_preset/dust_raider/private/load_gear(mob/living/carbon/human/new_human)
//TODO: add backpacks and satchels
Expand Down
4 changes: 2 additions & 2 deletions code/modules/gear_presets/fun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
flags = EQUIPMENT_PRESET_EXTRA
faction = FACTION_PIRATE

skills = /datum/skills/pfc/crafty
skills = /datum/skills/pfc

/datum/equipment_preset/fun/pirate/load_gear(mob/living/carbon/human/new_human)
new_human.equip_to_slot_or_del(new /obj/item/storage/backpack/satchel(new_human), WEAR_BACK)
Expand Down Expand Up @@ -417,7 +417,7 @@

uses_special_name = TRUE

skills = /datum/skills/pfc/crafty // about equivalent to a marine
skills = /datum/skills/pfc // about equivalent to a marine

assignment = "Monkey"
rank = "Monkey"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/gear_presets/uscm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@
rank = JOB_SQUAD_MARINE
paygrade = "ME2"
role_comm_title = "RFN"
skills = /datum/skills/pfc/crafty
skills = /datum/skills/pfc

minimap_icon = "private"

Expand Down
Binary file modified icons/mob/humans/onmob/suit_slot.dmi
Binary file not shown.
Binary file modified icons/mob/humans/onmob/uniform_0.dmi
Binary file not shown.

0 comments on commit 8628bff

Please sign in to comment.