Example #1
0
        public sealed override void ModifyBullet <T>(ExpandableBulletAttack bullet, SnipeState <T> state, Ray aim)
        {
            base.ModifyBullet(bullet, state, aim);
            var bul = bullet as ExpandableBulletAttack <TData>;

            bul.onHit  = this.onHit;
            bul.onStop = this.onStop;
            bul.data   = this.InitData();
            this.InitBullet(bul, state);
        }
Example #2
0
 public override void InitBullet <T>(ExpandableBulletAttack <RicochetData> bullet, SnipeState <T> state)
 {
     base.InitBullet(bullet, state);
     bullet.damage *= state.reloadBoost;
     bullet.damage *= (1f + state.chargeBoost);
     if (bullet.isCrit)
     {
         bullet.damage *= 1f + (state.chargeBoost / 20f);
     }
 }
        internal void ModifyBullet(ExpandableBulletAttack bulletAttack)
        {
            if (bulletAttack.isCrit)
            {
                bulletAttack.damage *= this.onCritDamageMultiplier;
            }

            bulletAttack.sniper = this.canHeadshot;
            this.bulletModifier.Apply(bulletAttack);
        }
Example #4
0
        private IEnumerator Ricochet(ExpandableBulletAttack <RicochetData> bullet, UInt32 frameDelay)
        {
            for (UInt32 i = 0u; i < frameDelay; ++i)
            {
                yield return(new WaitForFixedUpdate());
            }
            var data = new EffectData
            {
                origin = bullet.weapon.transform.position,
                start  = bullet.weapon.transform.position,
            };

            EffectManager.SpawnEffect(ricochetIndex, data, true);
            bullet.Fire();
            Destroy(bullet.weapon);
        }
Example #5
0
        public ExpandableBulletAttack <TData> Clone()
        {
            var res = new ExpandableBulletAttack <TData>
            {
                aimVector               = this.aimVector,
                attackerBody            = this.attackerBody,
                bulletCount             = this.bulletCount,
                damage                  = this.damage,
                damageColorIndex        = this.damageColorIndex,
                damageType              = this.damageType,
                falloffModel            = this.falloffModel,
                filterCallback          = this.filterCallback,
                force                   = this.force,
                HitEffectNormal         = this.HitEffectNormal,
                hitEffectPrefab         = this.hitEffectPrefab,
                hitMask                 = this.hitMask,
                isCrit                  = this.isCrit,
                maxSpread               = this.maxSpread,
                maxDistance             = this.maxDistance,
                minSpread               = this.minSpread,
                muzzleName              = this.muzzleName,
                origin                  = this.origin,
                owner                   = this.owner,
                procChainMask           = this.procChainMask,
                procCoefficient         = this.procCoefficient,
                queryTriggerInteraction = this.queryTriggerInteraction,
                radius                  = this.radius,
                smartCollision          = this.smartCollision,
                sniper                  = this.sniper,
                spreadPitchScale        = this.spreadPitchScale,
                spreadYawScale          = this.spreadYawScale,
                stopperMask             = this.stopperMask,
                tracerEffectPrefab      = this.tracerEffectPrefab,
                weapon                  = this.weapon,
                data = this.data,
            };

            res.onHit  = this.onHit;
            res.onStop = this.onStop;

            return(res);
        }
Example #6
0
        internal void ModifyBullet(ExpandableBulletAttack bullet, ReloadTier tier)
        {
            switch (tier)
            {
            default:
#if ASSERT
                Log.Error("Unknown reload tier");
#endif
                bullet.damage *= this.badMult;
                break;

            case ReloadTier.Bad:
                bullet.damage *= this.badMult;
                break;

            case ReloadTier.Good:
                bullet.damage *= this.goodMult;
                break;

            case ReloadTier.Perfect:
                bullet.damage *= this.perfectMult;
                break;
            }
        }
Example #7
0
 internal static void QueueRicochet(ExpandableBulletAttack <RicochetData> bullet, UInt32 delay)
 {
     instance?.StartCoroutine(instance.Ricochet(bullet, delay));
 }
Example #8
0
        internal void Apply(ExpandableBulletAttack bullet)
        {
            bullet.chargeLevel = this.charge < 0f ? this.charge : Mathf.Max(bullet.chargeLevel, this.charge);
            if (this.applyCountMultiplier)
            {
                bullet.bulletCount = (UInt32)(bullet.bulletCount * this.countMultiplier);
            }

            if (this.applyDamageMultiplier)
            {
                bullet.damage *= this.damageMultiplier;
            }

            if (this.applyDamageColor)
            {
                bullet.damageColorIndex = this.damageColor;
            }

            if (this.applyDamageTypeRemove)
            {
                bullet.damageType &= ~this.damageTypeRemove;
            }

            if (this.applyDamageTypeAdd)
            {
                bullet.damageType |= this.damageTypeAdd;
            }

            if (this.applyForceMultiplier)
            {
                bullet.force *= this.forceMultiplier;
            }

            if (this.applyHitMaskRemove)
            {
                bullet.hitMask &= ~this.hitMaskRemove;
            }

            if (this.applyHitMaskAdd)
            {
                bullet.hitMask |= this.hitMaskAdd;
            }

            if (this.applyMaxSpread)
            {
                bullet.maxSpread *= this.maxSpread;
            }

            if (this.applyMinSpread)
            {
                bullet.minSpread *= this.minSpread;
            }

            if (this.applyProcMultiplier)
            {
                bullet.procCoefficient *= this.procMultiplier;
            }

            if (this.applyRadiusMultiplier)
            {
                bullet.radius = (bullet.radius == 0f) ? this.radiusMultiplier : bullet.radius * this.radiusMultiplier;
            }

            if (this.applySpreadPitch)
            {
                bullet.spreadPitchScale = (bullet.spreadPitchScale == 0f) ? this.spreadPitch : bullet.spreadPitchScale * this.spreadPitch;
            }

            if (this.applySpreadYaw)
            {
                bullet.spreadYawScale = (bullet.spreadYawScale == 0f) ? this.spreadYaw : bullet.spreadYawScale * this.spreadYaw;
            }

            if (this.applyStopperMaskRemove)
            {
                bullet.stopperMask &= ~this.stopperMaskRemove;
            }

            if (this.applyStopperMaskAdd)
            {
                bullet.stopperMask |= this.stopperMaskAdd;
            }
        }
Example #9
0
 public override void InitBullet <T>(ExpandableBulletAttack <NoData> bullet, SnipeState <T> state)
 {
     base.InitBullet(bullet, state);
     bullet.damage *= state.reloadBoost;
     bullet.damage *= (1f + Mathf.Sqrt(state.chargeBoost));
 }
Example #10
0
 public override void ModifyBullet <T>(ExpandableBulletAttack bullet, SnipeState <T> state, Ray aimRay)
 {
     base.ModifyBullet(bullet, state, aimRay);
     bullet.damage *= state.reloadBoost;
 }
Example #11
0
 public virtual void InitBullet <T>(ExpandableBulletAttack <TData> bullet, SnipeState <T> state)
     where T : struct, ISniperPrimaryDataProvider
 {
 }