Skip to content

Commit

Permalink
Merge pull request #3568 from X0-11/flamer-gamer
Browse files Browse the repository at this point in the history
Flamer Changes
  • Loading branch information
BDpuffy420 authored Jul 23, 2024
2 parents 7ea2288 + c50c850 commit 5307841
Showing 1 changed file with 32 additions and 9 deletions.
41 changes: 32 additions & 9 deletions code/modules/halo/weapons/flamethrowers.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//For whatever reason this wasn't defined here?

#define CLEAR_CASINGS 1
#define FLAMER_FIRE_LEVEL 10
#define FLAMER_FIRE_FUEL 5

//NA4 Defoliant Projector
/obj/item/weapon/gun/projectile/na4_dp
Expand All @@ -10,19 +12,24 @@
item_state = "na4"
slot_flags = SLOT_BACK
handle_casings = CLEAR_CASINGS
burst = 3
burst = 8
hud_bullet_usebar = 1
caliber="flamethrower"
fire_delay = 7
one_hand_penalty = 3
slowdown_general = 0.20
dispersion = list(0.4)
slowdown_general = 0.15
dispersion = list(2.5)
load_method = MAGAZINE
magazine_type = /obj/item/ammo_magazine/na4_tank
allowed_magazines = list(/obj/item/ammo_magazine/na4_tank)
wielded_item_state="na4_loaded"
fire_sound = 'sound/effects/extinguish.ogg'

firemodes = list(\
list(mode_name="wide spread", burst=8, dispersion=list(2.5)),
list(mode_name="accurate fire", burst=4, dispersion=list(0.4))
)

item_icons = list(
slot_l_hand_str = 'code/modules/halo/weapons/icons/Weapon_Inhands_left.dmi',
slot_r_hand_str = 'code/modules/halo/weapons/icons/Weapon_Inhands_right.dmi',
Expand All @@ -49,7 +56,8 @@
shield_damage =30
icon = 'icons/effects/fire.dmi'
icon_state = "fire"
kill_count = 6 //No sniping!
kill_count = 6 //We change this when launched anyway. Limits shooting to vis range.
var/kill_half = 0 //Automatically set on proj launch.

/obj/item/projectile/bullet/fire/attack_mob(var/mob/living/carbon/C)
damage_type = BURN
Expand All @@ -60,19 +68,32 @@
C.IgniteMob()
return ..()

/obj/item/projectile/bullet/fire/proc/spawn_fire(var/turf/targloc,var/created_firelevel = FLAMER_FIRE_LEVEL)
if(!ismob(targloc))
var/obj/effect/fire/f = locate() in targloc
if(f)
f.fire_fuel++ //Only a small increase if there's already a fire there.
else
f = new /obj/effect/fire/noheat(targloc)
f.firelevel = created_firelevel
f.fire_fuel = FLAMER_FIRE_FUEL

/obj/item/projectile/bullet/fire/on_impact(var/atom/impacted)
..()
var/impacted_loc = loc
if(!ismob(loc))
var/obj/effect/fire/f = new /obj/effect/fire/noheat(impacted_loc)
f.firelevel = 8
spawn_fire(impacted.loc)

/obj/item/projectile/bullet/fire/Move()
if(kill_count <= kill_half && !ismob(loc))
spawn_fire(loc)
.=..()

/obj/item/projectile/bullet/fire/launch_from_gun(var/atom/target)
. = ..()
var/targturf = target
if(!isturf(target))
targturf = get_turf(target)
kill_count = get_dist(loc,targturf)
kill_half = round(kill_count/2)


/obj/item/ammo_magazine/na4_tank
Expand All @@ -91,4 +112,6 @@
caliber = "flamethrower"
projectile_type = /obj/item/projectile/bullet/fire

#undef FLAMER_FIRE_LEVEL
#undef FLAMER_FIRE_FUEL
#undef CLEAR_CASINGS

0 comments on commit 5307841

Please sign in to comment.