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 | |
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_atmosphere | Simulate standard atmos for any mobs inside |
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 |
impact_x | X position of the projectile impact, used for particles and bullet impacts |
impact_y | y position of the projectile impact, used for particles and bullet impacts |
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 |
spread | Degree of spread this projectile was fired with. Note that this informational, and doesn't affect the projectile's trajectory |
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. |
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_atmosphere 
Simulate standard atmos for any mobs inside
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
impact_x 
X position of the projectile impact, used for particles and bullet impacts
impact_y 
y position of the projectile impact, used for particles and bullet impacts
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
spread 
Degree of spread this projectile was fired with. Note that this informational, and doesn't affect the projectile's trajectory
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.