private void FireBullet(GameObject weapon, float damage, float force, Ray aimRay, string targetMuzzle, float maxDistance)
 {
     if (isAuthority)
     {
         new BulletAttack
         {
             owner           = gameObject,
             weapon          = weapon,
             origin          = aimRay.origin,
             aimVector       = aimRay.direction,
             minSpread       = minSpread,
             maxSpread       = maxSpread,
             bulletCount     = 1U,
             damage          = damage,
             force           = force,
             muzzleName      = targetMuzzle,
             hitEffectPrefab = hitEffectPrefab,
             isCrit          = Util.CheckRoll(critStat, characterBody.master),
             procCoefficient = procCoefficientPerTick,
             HitEffectNormal = false,
             radius          = 0f,
             maxDistance     = maxDistance
         }.Fire();
         if (ChensClassicItems.enabled)
         {
             ChensClassicItems.TriggerArtillery(characterBody, damage, Util.CheckRoll(critStat, characterBody.master));
         }
     }
 }
예제 #2
0
 private void GenerateLaser(Ray aimRay, Vector3 vector, float damage, float computedForce)
 {
     if (Physics.Raycast(aimRay, out RaycastHit raycastHit, maxDistance,
                         LayerIndex.world.mask | LayerIndex.defaultLayer.mask | LayerIndex.entityPrecise.mask))
     {
         vector = raycastHit.point;
     }
     new BlastAttack
     {
         attacker     = gameObject,
         inflictor    = gameObject,
         teamIndex    = teamComponent.teamIndex,
         baseDamage   = damage,
         baseForce    = computedForce,
         position     = vector,
         radius       = blastRadius,
         falloffModel = BlastAttack.FalloffModel.Linear,
         bonusForce   = computedForce * aimRay.direction
     }.Fire();
     if (tracerEffectPrefab && hitEffectPrefab)
     {
         EffectData effectData = new EffectData
         {
             origin = vector,
             start  = aimRay.origin + (aimRay.direction.normalized * 2f)
         };
         EffectManager.SpawnEffect(tracerEffectPrefab, effectData, true);
         EffectManager.SpawnEffect(hitEffectPrefab, effectData, true);
     }
     if (ChensClassicItems.enabled)
     {
         ChensClassicItems.TriggerArtillery(characterBody, damage, Util.CheckRoll(critStat, characterBody.master));
     }
 }
예제 #3
0
 public static void TriggerArmsRace(CharacterBody catalyst, float damage)
 {
     if (ChensClassicItems.enabled)
     {
         ChensClassicItems.TriggerArtillery(catalyst, damage, catalyst.RollCrit());
     }
 }