Skip to content

Commit

Permalink
Flamer movement considerations plus buff
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 14, 2023
1 parent 74f9301 commit b3a8c4d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 14 additions & 0 deletions code/controllers/subsystem/pathfinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 8 additions & 3 deletions code/modules/projectiles/guns/flamer/flamer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
. = ..()
Expand All @@ -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()
Expand Down

0 comments on commit b3a8c4d

Please sign in to comment.