Skip to content

Commit

Permalink
Merge branch 'game-master-panel-pt1' of https://github.com/PvE-CMSS13…
Browse files Browse the repository at this point in the history
…/PvE-CMSS13 into game-master-panel-pt1
  • Loading branch information
morrowwolf committed Oct 12, 2023
2 parents 73d07d3 + 8379597 commit 7d65c16
Show file tree
Hide file tree
Showing 59 changed files with 1,176 additions and 5,582 deletions.
2 changes: 1 addition & 1 deletion code/controllers/subsystem/pathfinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ SUBSYSTEM_DEF(xeno_pathfinding)
SSxeno_pathfinding.current_processing -= src

#ifdef TESTING
addtimer(CALLBACK(src, .proc/clear_colors, distances), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(clear_colors), distances), 5 SECONDS)
#endif

start = null
Expand Down
136 changes: 0 additions & 136 deletions code/controllers/subsystem/xeno_ai.dm
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
/datum/config_entry/number/eval_weight_marine
config_entry_value = 8

/datum/config_entry/number/eval_weight_xeno_t1
config_entry_value = -1

/datum/config_entry/number/eval_weight_xeno_t2
config_entry_value = -2

/datum/config_entry/number/eval_weight_xeno_t3
config_entry_value = -3

/datum/config_entry/number/eval_weight_xeno_queen
config_entry_value = -5

/datum/config_entry/number/eval_weight_offset
config_entry_value = 0

/*
/datum/config_entry/number/eval_distance_per_marine_from_hive
config_entry_value = 0.1
/datum/config_entry/number/eval_distance_per_xeno_from_hive
config_entry_value = -0.1
*/

SUBSYSTEM_DEF(xeno_ai)
name = "Xeno AI"
Expand Down Expand Up @@ -57,7 +32,6 @@ SUBSYSTEM_DEF(xeno_ai)
return

if(!resumed)
//calculate_eval()
src.current_run = ai_mobs.Copy()
// Cache for sanic speed (lists are references anyways)
var/list/current_run = src.current_run
Expand All @@ -72,35 +46,6 @@ SUBSYSTEM_DEF(xeno_ai)
if(MC_TICK_CHECK)
return


/datum/controller/subsystem/xeno_ai/proc/calculate_eval()
game_evaluation = CONFIG_GET(number/eval_weight_offset)

for(var/i in GLOB.alive_human_list)
var/mob/living/carbon/human/H = i
if(H.client && is_ground_level(H.z) && !H.is_mob_incapacitated())
game_evaluation += CONFIG_GET(number/eval_weight_marine)

for(var/i in GLOB.xeno_mob_list)
var/mob/living/carbon/xenomorph/X = i
if(X.stat)
return

switch(X.tier)
if(1)
game_evaluation += CONFIG_GET(number/eval_weight_xeno_t1)
if(2)
game_evaluation += CONFIG_GET(number/eval_weight_xeno_t1)
if(3)
game_evaluation += CONFIG_GET(number/eval_weight_xeno_t1)

if(isqueen(X))
game_evaluation += CONFIG_GET(number/eval_weight_xeno_queen)

for(var/i in GLOB.evaluation_landmarks)
var/obj/effect/landmark/eval/E = i
E.calculate_eval()

/datum/controller/subsystem/xeno_ai/proc/add_ai(mob/living/carbon/xenomorph/X)
if(X.mob_flags & AI_CONTROLLED)
return
Expand All @@ -110,84 +55,3 @@ SUBSYSTEM_DEF(xeno_ai)
/datum/controller/subsystem/xeno_ai/proc/remove_ai(mob/living/carbon/xenomorph/X)
X.mob_flags &= ~AI_CONTROLLED
ai_mobs -= X


// I'm not a good enough mapper to properly lay these out on the maps, so they'll stay like this
GLOBAL_LIST_EMPTY(evaluation_landmarks)

/area
var/list/eval_landmarks

/obj/effect/landmark/eval
name = "Evaluation Landmark"

/obj/effect/landmark/eval/Initialize(mapload, ...)
. = ..()
GLOB.evaluation_landmarks += src
var/area/A = get_area(src)
A.eval_landmarks += src

/obj/effect/landmark/eval/Destroy()
var/area/A = get_area(src)
A.eval_landmarks -= src
GLOB.evaluation_landmarks -= src
return ..()

/// Calculates the evaluation
/obj/effect/landmark/eval/proc/calculate_eval()
return 0

/obj/effect/landmark/eval/proc/calculate_eval_for_mob(mob/M)

/// A landmark that calculates evaluation depending on the marines in an area
/obj/effect/landmark/eval/marine
name = "Marine Eval Landmark"
var/eval_per_marine = 0

/obj/effect/landmark/eval/marine/calculate_eval_for_mob(mob/M)
if(ishuman(M) && M.client && !M.is_mob_incapacitated())
return eval_per_marine

/obj/effect/landmark/eval/marine/calculate_eval()
var/area/A = get_area(src)
var/eval_amount = 0
for(var/mob/living/carbon/human/H in A)
if(H.client && !H.is_mob_incapacitated())
eval_amount += eval_per_marine

return eval_amount

/obj/effect/landmark/eval/marine/bad
eval_per_marine = 0.5

/obj/effect/landmark/eval/marine/good
eval_per_marine = -0.5

/obj/effect/landmark/eval/marine/very_good
eval_per_marine = -1

/obj/effect/landmark/eval/xeno
name = "Xeno Eval Landmark"
var/eval_per_xeno

/obj/effect/landmark/eval/xeno/calculate_eval_for_mob(mob/M)
if(isxeno(M) && !M.stat)
return eval_per_xeno

/obj/effect/landmark/eval/xeno/calculate_eval()
var/area/A = get_area(src)
var/eval_amount = 0
for(var/mob/living/carbon/xenomorph/X in A)
if(!X.stat)
eval_amount += eval_per_xeno

return eval_amount

/obj/effect/landmark/eval/xeno/bad
eval_per_xeno = -0.5

/obj/effect/landmark/eval/xeno/good
eval_per_xeno = 0.5

/obj/effect/landmark/eval/xeno/very_good
eval_per_xeno = 1
11 changes: 0 additions & 11 deletions code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,6 @@
/obj/structure/machinery/door/xeno_ai_act(mob/living/carbon/xenomorph/X)
X.do_click(src, "", list())

/*
// WALLS
/turf/closed/wall/xeno_ai_obstacle(var/mob/living/carbon/xenomorph/X)
if(hull || claws_minimum > X.claw_type)
return ..()
return ((damage_cap - damage)/damage_cap)*WALL_PENALTY
/turf/closed/wall/xeno_ai_act(var/mob/living/carbon/xenomorph/X)
X.do_click(src)
*/

// OBJECTS
/obj/structure/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction)
if(!density)
Expand Down
Loading

0 comments on commit 7d65c16

Please sign in to comment.