Skip to content

Commit

Permalink
j
Browse files Browse the repository at this point in the history
  • Loading branch information
MLGTASTICa committed Jan 20, 2024
1 parent 018afed commit 18f07fa
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 17 deletions.
1 change: 0 additions & 1 deletion code/__DEFINES/subsystems-priority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ var/list/bitflags = list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
#define FIRE_PRIORITY_TGUI 110
#define FIRE_PRIORITY_EXPLOSIONS 105 // Explosions!
#define FIRE_PRIORITY_THROWING 106 // Throwing! after explosions since they influence throw direction
#define FIRE_PRIORITY_PROJECTILES 107
#define SS_PRIORITY_HUMAN 101 // Human Life().
#define SS_PRIORITY_MOB 100 // Non-human Mob Life().
#define SS_PRIORITY_CHAT 100 // Chat subsystem.
Expand Down
6 changes: 0 additions & 6 deletions code/controllers/subsystems/processing/projectiles.dm

This file was deleted.

56 changes: 46 additions & 10 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ GLOBAL_LIST(projectileDamageConstants)
spawn_tags = null
/// Ammo is heavy
weight = 10
/// Location & movement vars
var/curPx = 0
var/curPy = 0
var/multX = 0
var/multY = 0
var/offsetX = 16
var/offsetY = 16
var/angle = 0
var/turfsPerTick = 1
///
var/bumped = FALSE //Prevents it from hitting more than one guy at once
var/hitsound_wall = "ricochet"
var/list/mob_hit_sound = list('sound/effects/gore/bullethit2.ogg', 'sound/effects/gore/bullethit3.ogg') //Sound it makes when it hits a mob. It's a list so you can put multiple hit sounds there.
Expand Down Expand Up @@ -111,6 +101,7 @@ GLOBAL_LIST(projectileDamageConstants)
var/matrix/effect_transform // matrix to rotate and scale projectile effects - putting it here so it doesn't
// have to be recreated multiple times

<<<<<<< HEAD


////Tile coordinates (x, y) to absolute coordinates (in number of pixels). Center of a tile is generally assumed to be (16,16), but can be offset.
Expand Down Expand Up @@ -164,6 +155,8 @@ GLOBAL_LIST(projectileDamageConstants)
if(hitscan && !QDELETED(src))
goto hitloop

=======
>>>>>>> parent of fc25366b5 (hhh)
/// This is done to save a lot of memory from duplicated damage lists.
/// The list is also copied whenever PrepareForLaunch is called and modified as needs to be
/obj/item/projectile/Initialize()
Expand Down Expand Up @@ -635,6 +628,49 @@ GLOBAL_LIST(projectileDamageConstants)
/obj/item/projectile/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
return TRUE

/obj/item/projectile/Process()
var/first_step = TRUE

spawn while(src && src.loc)
if(kill_count-- < 1)
on_impact(src.loc) //for any final impact behaviours
qdel(src)
return
if((!( current ) || loc == current))
current = locate(min(max(x + xo, 1), world.maxx), min(max(y + yo, 1), world.maxy), z)
if((x == 1 || x == world.maxx || y == 1 || y == world.maxy))
qdel(src)
return

trajectory.increment() // increment the current location
location = trajectory.return_location(location) // update the locally stored location data

if(!location)
qdel(src) // if it's left the world... kill it
return

before_move()
Move(location.return_turf())
pixel_x = location.pixel_x
pixel_y = location.pixel_y

if(!bumped && !QDELETED(original) && !isturf(original))
// this used to be loc == get_turf(original) , but this would break incase the original was inside something and hit them without hitting the outside
if(loc == original.loc)
if(!(original in permutated))
if(Bump(original))
return

if(first_step)
muzzle_effect(effect_transform)
first_step = FALSE
else if(!bumped)
tracer_effect(effect_transform)
luminosity_effect()

if(!hitscan)
sleep(step_delay) //add delay between movement iterations if it's not a hitscan weapon

/obj/item/projectile/proc/before_move()
return FALSE

Expand Down

0 comments on commit 18f07fa

Please sign in to comment.