diff --git a/code/__DEFINES/ai.dm b/code/__DEFINES/ai.dm index fa482dc6103..9285fc4223b 100644 --- a/code/__DEFINES/ai.dm +++ b/code/__DEFINES/ai.dm @@ -28,8 +28,8 @@ ///AI flags /// Don't move if being pulled #define STOP_MOVING_WHEN_PULLED (1<<0) -/// Don't act if you're dead -#define STOP_ACTING_WHILE_DEAD (1<<1) +/// Continue processing even if dead +#define CAN_ACT_WHILE_DEAD (1<<1) //Base Subtree defines diff --git a/code/__DEFINES/basic_mobs.dm b/code/__DEFINES/basic_mobs.dm index c1a713aa858..00d84c7b56e 100644 --- a/code/__DEFINES/basic_mobs.dm +++ b/code/__DEFINES/basic_mobs.dm @@ -3,5 +3,5 @@ ///Basic mob flags #define DEL_ON_DEATH (1<<0) #define FLIP_ON_DEATH (1<<1) -#define UNDENSIFY_ON_DEATH (1<<2) +#define REMAIN_DENSE_WHILE_DEAD (1<<2) diff --git a/code/datums/ai/_ai_controller.dm b/code/datums/ai/_ai_controller.dm index 9b9646a70f9..4edd11ca3d8 100644 --- a/code/datums/ai/_ai_controller.dm +++ b/code/datums/ai/_ai_controller.dm @@ -8,7 +8,7 @@ multiple modular subtrees with behaviors ///The atom this controller is controlling var/atom/pawn ///Bitfield of traits for this AI to handle extra behavior - var/ai_traits = STOP_ACTING_WHILE_DEAD + var/ai_traits = NONE ///Current actions planned to be performed by the AI in the upcoming plan var/list/planned_behaviors ///Current actions being performed by the AI. @@ -120,10 +120,12 @@ multiple modular subtrees with behaviors if(!continue_processing_when_client && mob_pawn.client) final_status = AI_STATUS_OFF - if(ai_traits & STOP_ACTING_WHILE_DEAD) - RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_changed)) - if(mob_pawn.stat == DEAD) - final_status = AI_STATUS_OFF + if(ai_traits & CAN_ACT_WHILE_DEAD) + return final_status + + RegisterSignal(pawn, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_changed)) + if(mob_pawn.stat == DEAD) + final_status = AI_STATUS_OFF return final_status diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index 8ebc78dee06..9a2b1c210b7 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -149,7 +149,7 @@ icon_state = icon_dead if(basic_mob_flags & FLIP_ON_DEATH) transform = transform.Turn(180) - if(basic_mob_flags & UNDENSIFY_ON_DEATH) + if(!(basic_mob_flags & REMAIN_DENSE_WHILE_DEAD)) set_density(FALSE) /mob/living/basic/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE) @@ -163,7 +163,7 @@ icon_state = icon_living if(basic_mob_flags & FLIP_ON_DEATH) transform = transform.Turn(180) - if(basic_mob_flags & UNDENSIFY_ON_DEATH) + if(!(basic_mob_flags & REMAIN_DENSE_WHILE_DEAD)) set_density(initial(density)) /mob/living/basic/proc/melee_attack(atom/target, list/modifiers) diff --git a/code/modules/mob/living/basic/farm_animals/cow/cow_ai.dm b/code/modules/mob/living/basic/farm_animals/cow/cow_ai.dm index eeb11c1fbf1..81e1d722b01 100644 --- a/code/modules/mob/living/basic/farm_animals/cow/cow_ai.dm +++ b/code/modules/mob/living/basic/farm_animals/cow/cow_ai.dm @@ -5,7 +5,7 @@ BB_BASIC_MOB_TIPPER = null, ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( diff --git a/code/modules/mob/living/basic/farm_animals/pig.dm b/code/modules/mob/living/basic/farm_animals/pig.dm index f6f5983859e..fee809e43eb 100644 --- a/code/modules/mob/living/basic/farm_animals/pig.dm +++ b/code/modules/mob/living/basic/farm_animals/pig.dm @@ -51,7 +51,7 @@ BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction(), ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk diff --git a/code/modules/mob/living/basic/farm_animals/rabbit.dm b/code/modules/mob/living/basic/farm_animals/rabbit.dm index 1418786759a..071470264db 100644 --- a/code/modules/mob/living/basic/farm_animals/rabbit.dm +++ b/code/modules/mob/living/basic/farm_animals/rabbit.dm @@ -50,7 +50,7 @@ BB_BASIC_MOB_FLEEING = TRUE, BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction(), ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( diff --git a/code/modules/mob/living/basic/farm_animals/sheep.dm b/code/modules/mob/living/basic/farm_animals/sheep.dm index 94e37dc6f0b..95e1a6737df 100644 --- a/code/modules/mob/living/basic/farm_animals/sheep.dm +++ b/code/modules/mob/living/basic/farm_animals/sheep.dm @@ -85,7 +85,7 @@ BB_BASIC_MOB_FLEEING = TRUE, BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/ignore_faction(), ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( diff --git a/code/modules/mob/living/basic/vermin/axolotl.dm b/code/modules/mob/living/basic/vermin/axolotl.dm index 5a8b9d3c986..a56f1df5909 100644 --- a/code/modules/mob/living/basic/vermin/axolotl.dm +++ b/code/modules/mob/living/basic/vermin/axolotl.dm @@ -36,6 +36,6 @@ ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) /datum/ai_controller/basic_controller/axolotl - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk diff --git a/code/modules/mob/living/basic/vermin/cockroach.dm b/code/modules/mob/living/basic/vermin/cockroach.dm index 96557b86cc0..2abca82218c 100644 --- a/code/modules/mob/living/basic/vermin/cockroach.dm +++ b/code/modules/mob/living/basic/vermin/cockroach.dm @@ -57,7 +57,7 @@ BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/not_friends(), ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( diff --git a/code/modules/mob/living/basic/vermin/mothroach.dm b/code/modules/mob/living/basic/vermin/mothroach.dm index d9e765f239f..15f82d38f85 100644 --- a/code/modules/mob/living/basic/vermin/mothroach.dm +++ b/code/modules/mob/living/basic/vermin/mothroach.dm @@ -67,7 +67,7 @@ /datum/ai_controller/basic_controller/mothroach blackboard = list() - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( diff --git a/code/modules/mob/living/basic/vermin/mouse.dm b/code/modules/mob/living/basic/vermin/mouse.dm index 93f2a31542c..5962a39e9bd 100644 --- a/code/modules/mob/living/basic/vermin/mouse.dm +++ b/code/modules/mob/living/basic/vermin/mouse.dm @@ -357,7 +357,7 @@ BB_TARGETTING_DATUM = new /datum/targetting_datum/basic(), // Use this to find people to run away from ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( @@ -401,7 +401,7 @@ BB_LOW_PRIORITY_HUNTING_TARGET = null, // cable ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk planning_subtrees = list( diff --git a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm index 0fe1569e336..0c4ddd3457b 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/simple_animal/friendly/bumbles.dm @@ -120,7 +120,7 @@ BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/allow_items(), ) - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk diff --git a/modular_skyrat/modules/basic_mobs/code/kiwi.dm b/modular_skyrat/modules/basic_mobs/code/kiwi.dm index ecc4ee695a3..e7921514117 100644 --- a/modular_skyrat/modules/basic_mobs/code/kiwi.dm +++ b/modular_skyrat/modules/basic_mobs/code/kiwi.dm @@ -36,7 +36,7 @@ /datum/ai_controller/basic_controller/kiwi blackboard = list() - ai_traits = STOP_MOVING_WHEN_PULLED | STOP_ACTING_WHILE_DEAD + ai_traits = STOP_MOVING_WHEN_PULLED ai_movement = /datum/ai_movement/basic_avoidance idle_behavior = /datum/idle_behavior/idle_random_walk