SPLURT Station 13 - Modules - TypesVar Details - Proc Details

projectile

Vars

embed_falloff_tileHow much we want to drop the embed_chance value, if we can embed, per tile, for falloff purposes
force_hitIf the object being hit can pass ths damage on to something else, it should not do it for this bullet
hit_stunned_targetsIf TRUE, hit mobs even if they're on the floor and not our target
hit_threshholdIf objects are below this layer, we pass through them
hitscan_effect_generationUsed in generate_hitscan_tracers to determine which "cycle" we're on.
hitscan_movement_decisecond_equivalencyHow many deciseconds are each hitscan movement considered. Used for homing and other things that use seconds for timing rather than ticks.
homing_turn_speedHow fast the projectile turns towards its homing targets, in angle per second.
ignore_source_checkIf TRUE, we can hit our firer.
impactedWe already impacted these things, do not impact them again. Used to make sure we can pierce things we want to pierce. Lazylist, typecache style (object = TRUE) for performance.
pass_flags
phasing_ignore_direct_targetIf FALSE, allow us to hit something directly targeted/clicked/whatnot even if we're able to phase through it
piercesnumber of times we've pierced something. Incremented BEFORE bullet_act and on_hit proc!
pixel_increment_amountThe number of pixels we increment by. THIS IS NOT SPEED, DO NOT TOUCH THIS UNLESS YOU KNOW WHAT YOU ARE DOING. In general, lower values means more linetrace accuracy up to a point at cost of performance.
pixel_move_interruptedUsed to detect jumps in the middle of a pixel_move. Yes, this is ugly as sin code-wise but it works.
pixels_per_secondPixels moved per second.
pixels_range_leftover"leftover" pixels for Range() calculation as pixel_move() was moved to simulated semi-pixel movement and Range() is in tiles.
pixels_tick_leftover"leftover" tick pixels and stuff yeah, so we don't round off things and introducing tracing inaccuracy.
projectile_phasingBitflag for things the projectile should just phase through entirely - No hitting unless direct target and [phasing_ignore_direct_target] is FALSE. Uses pass_flags flags.
projectile_piercingBitflag for things the projectile should hit, but pierce through without deleting itself. Defers to projectile_phasing. Uses pass_flags flags.
rangeRange of the projectile, de-incrementing every step. The projectile deletes itself at 0. This is in tiles.
ricochet_auto_aim_angleOn ricochet, if ricochet_auto_aim_range is nonzero, we'll consider any mobs within this range of the normal angle of incidence to home in on, higher = more auto aim
ricochet_auto_aim_rangeOn ricochet, if nonzero, we consider all mobs within this range of our projectile at the time of ricochet to home in on like Revolver Ocelot, as governed by ricochet_auto_aim_angle
ricochet_chance0-100, the base chance of ricocheting, before being modified by the atom we shoot and our chance decay
ricochet_decay_chance0-1 (or more, I guess) multiplier, the ricochet_chance is modified by multiplying this after each ricochet
ricochet_decay_damage0-1 (or more, I guess) multiplier, the projectile's damage is modified by multiplying this after each ricochet
ricochet_incidence_leewaythe angle of impact must be within this many degrees of the struck surface, set to 0 to allow any angle
ricochetshow many times we've ricochet'd so far (instance variable, not a stat)
ricochets_maxhow many times we can ricochet max
sharpnessFor telling whether we want to roll for bone breaking or lacerations if we're bothering with wounds
shrapnel_typeIf defined, on hit we create an item of this type then call hitby() on the hit target with this, mainly used for embedding items (bullets) in targets
temporary_unstoppable_movementWe are flagged PHASING temporarily to not stop moving when we Bump something but want to keep going anyways.
wound_falloff_tileHow much we want to drop both wound_bonus and bare_wound_bonus (to a minimum of 0 for the latter) per tile, for falloff purposes
zone_accuracy_factorfactor to multiply by for zone accuracy percent.

Procs

CanPassThroughProjectile can pass through Used to not even attempt to Bump() or fail to Cross() anything we already hit.
CrossedProjectile crossed: When something enters a projectile's tile, make sure the projectile hits it if it should be hitting it.
ImpactCalled when the projectile hits something This can either be from it bumping something, or it passing over a turf/being crossed and scanning that there is infact a valid target it needs to hit. This target isn't however necessarily WHAT it hits that is determined by process_hit and select_target.
MovedProjectile moved:
RangeArtificially modified to be called at around every world.icon_size pixels of movement. WARNING: Range() can only be called once per pixel_increment_amount pixels.
pixel_moveThe proc to make the projectile go, using a simulated pixel movement line trace. Note: deciseconds_equivalent is currently only used for homing, times is the number of times to move pixel_increment_amount. Trajectory multiplier directly modifies the factor of pixel_increment_amount to go per time. It's complicated, so probably just don't mess with this unless you know what you're doing.
prehit_pierceChecks if we should pierce something.
process_hitThe primary workhorse proc of projectile impacts. This is a RECURSIVE call - process_hit is called on the first selected target, and then repeatedly called if the projectile still hasn't been deleted.
return_predicted_turf_after_movesone move is a tile.
scan_crossed_hitScan if we should hit something and hit it if we need to The difference between this and handling in Impact is In this we strictly check if we need to Impact() something in specific If we do, we do We don't even check if it got hit already - Impact() does that In impact there's more code for selecting WHAT to hit So this proc is more of checking if we should hit something at all BY having an atom cross us.
scan_moved_turfScans if we should hit something on the turf we just moved to if we haven't already
select_targetSelects a target to hit from a turf

Var Details

embed_falloff_tile

How much we want to drop the embed_chance value, if we can embed, per tile, for falloff purposes

force_hit

If the object being hit can pass ths damage on to something else, it should not do it for this bullet

hit_stunned_targets

If TRUE, hit mobs even if they're on the floor and not our target

hit_threshhold

If objects are below this layer, we pass through them

hitscan_effect_generation

Used in generate_hitscan_tracers to determine which "cycle" we're on.

hitscan_movement_decisecond_equivalency

How many deciseconds are each hitscan movement considered. Used for homing and other things that use seconds for timing rather than ticks.

homing_turn_speed

How fast the projectile turns towards its homing targets, in angle per second.

ignore_source_check

If TRUE, we can hit our firer.

impacted

We already impacted these things, do not impact them again. Used to make sure we can pierce things we want to pierce. Lazylist, typecache style (object = TRUE) for performance.

pass_flags

The "usual" flags of pass_flags is used in that can_hit_target ignores these unless they're specifically targeted/clicked on. This behavior entirely bypasses process_hit if triggered, rather than phasing which uses prehit_pierce() to check.

phasing_ignore_direct_target

If FALSE, allow us to hit something directly targeted/clicked/whatnot even if we're able to phase through it

pierces

number of times we've pierced something. Incremented BEFORE bullet_act and on_hit proc!

pixel_increment_amount

The number of pixels we increment by. THIS IS NOT SPEED, DO NOT TOUCH THIS UNLESS YOU KNOW WHAT YOU ARE DOING. In general, lower values means more linetrace accuracy up to a point at cost of performance.

pixel_move_interrupted

Used to detect jumps in the middle of a pixel_move. Yes, this is ugly as sin code-wise but it works.

pixels_per_second

Pixels moved per second.

pixels_range_leftover

"leftover" pixels for Range() calculation as pixel_move() was moved to simulated semi-pixel movement and Range() is in tiles.

pixels_tick_leftover

"leftover" tick pixels and stuff yeah, so we don't round off things and introducing tracing inaccuracy.

projectile_phasing

Bitflag for things the projectile should just phase through entirely - No hitting unless direct target and [phasing_ignore_direct_target] is FALSE. Uses pass_flags flags.

projectile_piercing

Bitflag for things the projectile should hit, but pierce through without deleting itself. Defers to projectile_phasing. Uses pass_flags flags.

range

Range of the projectile, de-incrementing every step. The projectile deletes itself at 0. This is in tiles.

ricochet_auto_aim_angle

On ricochet, if ricochet_auto_aim_range is nonzero, we'll consider any mobs within this range of the normal angle of incidence to home in on, higher = more auto aim

ricochet_auto_aim_range

On ricochet, if nonzero, we consider all mobs within this range of our projectile at the time of ricochet to home in on like Revolver Ocelot, as governed by ricochet_auto_aim_angle

ricochet_chance

0-100, the base chance of ricocheting, before being modified by the atom we shoot and our chance decay

ricochet_decay_chance

0-1 (or more, I guess) multiplier, the ricochet_chance is modified by multiplying this after each ricochet

ricochet_decay_damage

0-1 (or more, I guess) multiplier, the projectile's damage is modified by multiplying this after each ricochet

ricochet_incidence_leeway

the angle of impact must be within this many degrees of the struck surface, set to 0 to allow any angle

ricochets

how many times we've ricochet'd so far (instance variable, not a stat)

ricochets_max

how many times we can ricochet max

sharpness

For telling whether we want to roll for bone breaking or lacerations if we're bothering with wounds

shrapnel_type

If defined, on hit we create an item of this type then call hitby() on the hit target with this, mainly used for embedding items (bullets) in targets

temporary_unstoppable_movement

We are flagged PHASING temporarily to not stop moving when we Bump something but want to keep going anyways.

wound_falloff_tile

How much we want to drop both wound_bonus and bare_wound_bonus (to a minimum of 0 for the latter) per tile, for falloff purposes

zone_accuracy_factor

factor to multiply by for zone accuracy percent.

Proc Details

CanPassThrough

Projectile can pass through Used to not even attempt to Bump() or fail to Cross() anything we already hit.

Crossed

Projectile crossed: When something enters a projectile's tile, make sure the projectile hits it if it should be hitting it.

Impact

Called when the projectile hits something This can either be from it bumping something, or it passing over a turf/being crossed and scanning that there is infact a valid target it needs to hit. This target isn't however necessarily WHAT it hits that is determined by process_hit and select_target.

Furthermore, this proc shouldn't check can_hit_target - this should only be called if can hit target is already checked. Also, we select_target to find what to process_hit first.

Moved

Projectile moved:

If not fired yet, do not do anything. Else,

If temporary unstoppable movement used for piercing through things we already hit (impacted list) is set, unset it. Scan turf we're now in for anything we can/should hit. This is useful for hitting non dense objects the user directly clicks on, as well as for PHASING projectiles to be able to hit things at all as they don't ever Bump().

Range

Artificially modified to be called at around every world.icon_size pixels of movement. WARNING: Range() can only be called once per pixel_increment_amount pixels.

pixel_move

The proc to make the projectile go, using a simulated pixel movement line trace. Note: deciseconds_equivalent is currently only used for homing, times is the number of times to move pixel_increment_amount. Trajectory multiplier directly modifies the factor of pixel_increment_amount to go per time. It's complicated, so probably just don't mess with this unless you know what you're doing.

prehit_pierce

Checks if we should pierce something.

NOT meant to be a pure proc, since this replaces prehit() which was used to do things. Return PROJECTILE_DELETE_WITHOUT_HITTING to delete projectile without hitting at all!

process_hit

The primary workhorse proc of projectile impacts. This is a RECURSIVE call - process_hit is called on the first selected target, and then repeatedly called if the projectile still hasn't been deleted.

Order of operations:

  1. Checks if we are deleted, or if we're somehow trying to hit a null, in which case, bail out
  2. Adds the thing we're hitting to impacted so we can make sure we don't doublehit
  3. Checks piercing - stores this. Afterwards: Hit and delete, hit without deleting and pass through, pass through without hitting, or delete without hitting depending on result If we're going through without hitting, find something else to hit if possible and recurse, set unstoppable movement to true If we're deleting without hitting, delete and return Otherwise, send signal of COMSIG_PROJECTILE_PREHIT to target Then, hit, deleting ourselves if necessary. @params T - Turf we're on/supposedly hitting target - target we're hitting bumped - target we originally bumped. it's here to ensure that if something blocks our projectile by means of Cross() failure, we hit it even if it is not dense. hit_something - only should be set by recursive calling by this proc - tracks if we hit something already

Returns if we hit something.

return_predicted_turf_after_moves

one move is a tile.

scan_crossed_hit

Scan if we should hit something and hit it if we need to The difference between this and handling in Impact is In this we strictly check if we need to Impact() something in specific If we do, we do We don't even check if it got hit already - Impact() does that In impact there's more code for selecting WHAT to hit So this proc is more of checking if we should hit something at all BY having an atom cross us.

scan_moved_turf

Scans if we should hit something on the turf we just moved to if we haven't already

This proc is a little high in overhead but allows us to not snowflake CanPass in living and other things.

select_target

Selects a target to hit from a turf

@params T - The turf target - The "preferred" atom to hit, usually what we Bumped() first. bumped - used to track if something is the reason we impacted in the first place. If set, this atom is always treated as dense by can_hit_target.

Priority: 0. Anything that is already in impacted is ignored no matter what. Furthermore, in any bracket, if the target atom parameter is in it, that's hit first. Furthermore, can_hit_target is always checked. This (entire proc) is PERFORMANCE OVERHEAD!! But, it shouldn't be ""too"" bad and I frankly don't have a better generic non snowflakey way that I can think of right now at 3 AM. FURTHERMORE, mobs/objs have a density check from can_hit_target - to hit non dense objects over a turf, you must click on them, same for mobs that usually wouldn't get hit.

  1. The thing originally aimed at/clicked on
  2. Mobs - picks lowest buckled mob to prevent scarp piggybacking memes
  3. Objs
  4. Turf
  5. Nothing