Goonstation 13 - Modules - TypesVar Details

projectile

This file is not good Fucked up var names lie ahead Caution, traveler

General cleanup todo: Go through undocumented math and document it Remove bad vars, fill in gaps then created Deduplicate info between this and proj_data

Vars

angleAngle of this shot. For reference @see setup()
armor_ignoredDoes this projectile pierce armor?
called_targetTarget for called shots behavior - by default does not affect projectile behaviour
called_target_turfTurf of the called_target during projectile initialization
collide_with_other_projectilesBelow stuff but also this is dumb and only used for frost bats and I don't even know why it's used there. TODO remove
crossingThe list of precalculated turfs this projectile will try to cross, along with the tick count(?) when each turf should be crossed. The structure of this list is pure Byond demon magic: it's an indexed list of key-value pairs that can be accessed like: var/turf/T = crossed[i] OR var/value = crossed[T] where T is a turf in the list and value is the aforesaid tick count. a thousand year curse on whoever thought this was a good idea, and Lummox for enabling them.
curr_tFor precalculated projectiles, how far along the crossing list have we reached
dataArbitrary projectile data. Currently only used to hold an object that a projectile is seeking for a singular type. TODO remove
facing_dirDefault dir, set to in do_step()
goes_through_mobsWhether this projectile can freely pass through mobs
goes_through_wallsWhether this projectile can freely pass through dense turfs
has_diedFor disabling collision when a projectile has died but hasn't been disposed yet, e.g. under on_end effects
hitlistList of atoms collided with this tick
implantedWhat kind of implant this projectile leaves in impacted mobs
incidenceReflection normal on the current tile (NORTH if projectile came from the north, etc.) TODO can maybe be replaced with a single dir check when relevant? not 100% sure why we need to track this always. Might be crucial, dunno
initial_powerTODO this var also feels dumb. convert to initial() prolly (on data not on this)
is_processingYeah this sucks. TODO remove. I don't care bring the bug back so we can actually fix it
max_rangeMaximum range this projectile can travel before impacting a (non-dense) turf
mob_shooterMob-typed copy of shooter var to save time on casts later
orig_turfOriginal turf this projectiles was fired from
pierces_leftNumber of impassable atoms this projectile can pierce. Decremented on pierce. Can probably be axed in favor of the component. TODO remove
powerOne of the two below vars needs to be renamed or removed. Fucking confusing I don't know why this var is here it just stores the result of a proc called on the proj data. TODO revisit
proj_dataProjectile data; almost all specific projectile information and functionality lives here
reflectcountNumber of times this projectile has been reflected off of things. Used to cap reflections
shooterThe mob/thing that fired this projectile
special_dataBullshit var for storing special data for niche cases. Sucks, is probably necessary nonetheless
targetsList of all targets this projectile can go after; useful for homing projectiles and the like
ticks_until_can_hit_mobTracks the number of steps before a piercing projectile is allowed to hit a mob after hitting another one. Scarcely used. TODO remove?
travelledNumber of tiles this projectile has travelled
was_pointblankWhether this projectile was shot point-blank style (clicking an adjacent mob). Adjusts the log entry accordingly
was_setupTODO axe this after testing. Used very infrequently, looks redundant
wxOffset within a tile, separate to pixel_x/y due to animation things probably?
xox component of the projectile's direction vector. EAST is positive, WEST is negative.
yoy component of the projectile's direction vector. NORTH is positive, SOUTH is negative.

Var Details

angle

Angle of this shot. For reference @see setup()

armor_ignored

Does this projectile pierce armor?

called_target

Target for called shots behavior - by default does not affect projectile behaviour

called_target_turf

Turf of the called_target during projectile initialization

collide_with_other_projectiles

Below stuff but also this is dumb and only used for frost bats and I don't even know why it's used there. TODO remove

crossing

The list of precalculated turfs this projectile will try to cross, along with the tick count(?) when each turf should be crossed. The structure of this list is pure Byond demon magic: it's an indexed list of key-value pairs that can be accessed like: var/turf/T = crossed[i] OR var/value = crossed[T] where T is a turf in the list and value is the aforesaid tick count. a thousand year curse on whoever thought this was a good idea, and Lummox for enabling them.

curr_t

For precalculated projectiles, how far along the crossing list have we reached

data

Arbitrary projectile data. Currently only used to hold an object that a projectile is seeking for a singular type. TODO remove

facing_dir

Default dir, set to in do_step()

goes_through_mobs

Whether this projectile can freely pass through mobs

goes_through_walls

Whether this projectile can freely pass through dense turfs

has_died

For disabling collision when a projectile has died but hasn't been disposed yet, e.g. under on_end effects

hitlist

List of atoms collided with this tick

implanted

What kind of implant this projectile leaves in impacted mobs

incidence

Reflection normal on the current tile (NORTH if projectile came from the north, etc.) TODO can maybe be replaced with a single dir check when relevant? not 100% sure why we need to track this always. Might be crucial, dunno

initial_power

TODO this var also feels dumb. convert to initial() prolly (on data not on this)

is_processing

Yeah this sucks. TODO remove. I don't care bring the bug back so we can actually fix it

max_range

Maximum range this projectile can travel before impacting a (non-dense) turf

mob_shooter

Mob-typed copy of shooter var to save time on casts later

orig_turf

Original turf this projectiles was fired from

pierces_left

Number of impassable atoms this projectile can pierce. Decremented on pierce. Can probably be axed in favor of the component. TODO remove

power

One of the two below vars needs to be renamed or removed. Fucking confusing I don't know why this var is here it just stores the result of a proc called on the proj data. TODO revisit

proj_data

Projectile data; almost all specific projectile information and functionality lives here

reflectcount

Number of times this projectile has been reflected off of things. Used to cap reflections

shooter

The mob/thing that fired this projectile

special_data

Bullshit var for storing special data for niche cases. Sucks, is probably necessary nonetheless

targets

List of all targets this projectile can go after; useful for homing projectiles and the like

ticks_until_can_hit_mob

Tracks the number of steps before a piercing projectile is allowed to hit a mob after hitting another one. Scarcely used. TODO remove?

travelled

Number of tiles this projectile has travelled

was_pointblank

Whether this projectile was shot point-blank style (clicking an adjacent mob). Adjusts the log entry accordingly

was_setup

TODO axe this after testing. Used very infrequently, looks redundant

wx

Offset within a tile, separate to pixel_x/y due to animation things probably?

xo

x component of the projectile's direction vector. EAST is positive, WEST is negative.

yo

y component of the projectile's direction vector. NORTH is positive, SOUTH is negative.