diff --git a/code/__DEFINES/xeno_ai.dm b/code/__DEFINES/xeno_ai.dm index 17f120ccfd..f67cb3f6dd 100644 --- a/code/__DEFINES/xeno_ai.dm +++ b/code/__DEFINES/xeno_ai.dm @@ -13,6 +13,7 @@ #define WINDOW_FRAME_PENALTY 25 #define BARRICADE_PENALTY 50 #define WALL_PENALTY 50 +#define FIRE_PENALTY 25 // Xeno AI flags #define XENO_AI_NO_DESPAWN (1<<0) diff --git a/code/controllers/subsystem/pathfinding.dm b/code/controllers/subsystem/pathfinding.dm index e006fdeb05..552da1fb8a 100644 --- a/code/controllers/subsystem/pathfinding.dm +++ b/code/controllers/subsystem/pathfinding.dm @@ -11,6 +11,9 @@ SUBSYSTEM_DEF(xeno_pathfinding) var/list/hash_path = list() var/current_position = 1 + /// Any special blockers we want to account for that do not normally block movement + var/list/special_blockers = list(/obj/flamer_fire) + /datum/controller/subsystem/xeno_pathfinding/stat_entry(msg) msg = "P:[length(paths_to_calculate)]" return ..() @@ -62,6 +65,7 @@ SUBSYSTEM_DEF(xeno_pathfinding) distance_between += A.object_weight var/list/L = LinkBlocked(X, current_run.current_node, neighbor, current_run.ignore, TRUE) + L += check_special_blockers(X, neighbor) if(length(L)) for(var/i in L) var/atom/A = i @@ -125,6 +129,16 @@ SUBSYSTEM_DEF(xeno_pathfinding) current_run.to_return.Invoke(path) QDEL_NULL(current_run) +/datum/controller/subsystem/xeno_pathfinding/proc/check_special_blockers(mob/living/carbon/xenomorph/xeno, turf/checking_turf) + var/list/pass_back = list() + + for(var/atom/checked_atom as anything in checking_turf) + for(var/special_block in special_blockers) + if(istype(checked_atom, special_block)) + pass_back += checked_atom + + return pass_back + /datum/controller/subsystem/xeno_pathfinding/proc/stop_calculating_path(mob/living/carbon/xenomorph/X) var/datum/xeno_pathinfo/data = hash_path[X] qdel(data) diff --git a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm index 141220f056..6ab988988a 100644 --- a/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm +++ b/code/modules/mob/living/carbon/xenomorph/xeno_ai_interaction.dm @@ -75,3 +75,10 @@ // Avoid barricades if possible. /obj/structure/barricade/xeno_ai_obstacle(mob/living/carbon/xenomorph/X, direction) return BARRICADE_PENALTY + +// FIRE +/obj/flamer_fire/xeno_ai_obstacle(mob/living/carbon/xenomorph/xeno, direction) + if(xeno.caste?.fire_immunity & (FIRE_IMMUNITY_NO_IGNITE|FIRE_IMMUNITY_NO_DAMAGE)) + return 0 + + return FIRE_PENALTY diff --git a/code/modules/projectiles/guns/flamer/flamer.dm b/code/modules/projectiles/guns/flamer/flamer.dm index 13ccd03c3e..42a0e2ce03 100644 --- a/code/modules/projectiles/guns/flamer/flamer.dm +++ b/code/modules/projectiles/guns/flamer/flamer.dm @@ -17,8 +17,7 @@ reload_sound = 'sound/weapons/handling/flamer_reload.ogg' aim_slowdown = SLOWDOWN_ADS_INCINERATOR current_mag = /obj/item/ammo_magazine/flamer_tank - var/fuel_pressure = 1 //Pressure setting of the attached fueltank, controls how much fuel is used per tile - var/max_range = 9 //9 tiles, 7 is screen range, controlled by the type of napalm in the canister. We max at 9 since diagonal bullshit. + start_automatic = TRUE attachable_allowed = list( //give it some flexibility. /obj/item/attachable/flashlight, @@ -29,6 +28,12 @@ flags_gun_features = GUN_UNUSUAL_DESIGN|GUN_WIELDED_FIRING_ONLY|GUN_TRIGGER_SAFETY gun_category = GUN_CATEGORY_HEAVY + //Pressure setting of the attached fueltank, controls how much fuel is used per tile + var/fuel_pressure = 1 + + //max range of flames that can fire, can change depending on fueling + var/max_range = 9 + /obj/item/weapon/gun/flamer/Initialize(mapload, spawn_empty) . = ..() @@ -51,7 +56,7 @@ /obj/item/weapon/gun/flamer/set_gun_config_values() ..() - set_fire_delay(FIRE_DELAY_TIER_5 * 5) + set_fire_delay(FIRE_DELAY_TIER_11) /obj/item/weapon/gun/flamer/unique_action(mob/user) toggle_gun_safety()