Ok made an update:
New weapon prefs:isSupersonic - If true, bullets will create a cracking noise when they pass by players. If false, they'll create a whizzing sound as they pass by.
isSuppressive - Enable/disable suppression effects, basically just small amounts of whiteout and vignette that occurs and fades out over time when a bullet passes by you.
suppressionRadius - How close the player has to be to the bullet in order to experience a suppression effect, including the near-miss sound.
allowRicochet - Enable/Disable ricochet. If enabled, when a bullet hits a surface, it will determine whether or not it should ricochet. If it does, it will look for a projectileData function called
projectileData::onRicochet(%this, %obj, %pos, %reflectVec) which allows you to give custom functionality to the projectile when it ricochets. If this function doesn't exist but you still have this field set to true, it'll just do another hitscan using the ricochet vector.
ricoMinimumAngle - The maximum angle that a bullet can ricochet off of. For example, setting this to 40 will mean a bullet can only ricochet if it hits a surface at 40 degrees or less.
ricoChanceCurve - A coefficient that scales how less likely a bullet is to ricochet the greater the angle
ricoRarity - A value that flat decreases the chance for a ricochet to occur.
Weapon_hitscanGun has been updated with new comments and includes an example of how to create a ricochet system with custom ricochet projectiles
New server prefs:$Pref::Suppression::Vignette - Enable/Disable vignette effect when suppressed, default true
$Pref::Suppression::VignetteColor - Color of the vignette when suppressed, default "1 0 0" (red)
$Pref::Suppression::Whiteout - Enable/Disable whiteout effect when suppressed, default true
$Pref::Suppression::WhiteoutIntensity - Strength of the whiteout effect at the epicenter, default 0.25
$Pref::Suppression::IgnoresWalls - Determines whether or not you can be suppressed through walls. default false.
Functions:I added a new function called
Player::onSuppressed(%player, %mag) that does nothing, it's purpose is that you can package it with your add-on and give custom suppression effects if you're not happy with the default ones. This will be called if isSuppressive is set to true regardless of whether or not whiteout and vignette is enabled. The %mag is a 0 - 1 value based on how close the player is to the epicenter vs the projectiles suppression radius.
NOTE: The gravityMod field for projectiles has been changed to gravityScale as to not conflict with default game functionality. You'll have to update your addons to work with this version.
Support_FastProjectiles