// Token: 0x060017D8 RID: 6104 RVA: 0x00067B08 File Offset: 0x00065D08
 private static void PerformDamage(GameObject attacker, GameObject inflictor, float damage, bool isCrit, ProcChainMask procChainMask, float procCoefficient, DamageColorIndex damageColorIndex, DamageType damageType, Vector3 forceVector, float pushAwayForce, List <OverlapAttack.OverlapInfo> hitList)
 {
     for (int i = 0; i < hitList.Count; i++)
     {
         OverlapAttack.OverlapInfo overlapInfo = hitList[i];
         if (overlapInfo.hurtBox)
         {
             HealthComponent healthComponent = overlapInfo.hurtBox.healthComponent;
             if (healthComponent)
             {
                 DamageInfo damageInfo = new DamageInfo();
                 damageInfo.attacker         = attacker;
                 damageInfo.inflictor        = inflictor;
                 damageInfo.force            = forceVector + pushAwayForce * overlapInfo.pushDirection;
                 damageInfo.damage           = damage;
                 damageInfo.crit             = isCrit;
                 damageInfo.position         = overlapInfo.hitPosition;
                 damageInfo.procChainMask    = procChainMask;
                 damageInfo.procCoefficient  = procCoefficient;
                 damageInfo.damageColorIndex = damageColorIndex;
                 damageInfo.damageType       = damageType;
                 damageInfo.ModifyDamageInfo(overlapInfo.hurtBox.damageModifier);
                 healthComponent.TakeDamage(damageInfo);
                 GlobalEventManager.instance.OnHitEnemy(damageInfo, healthComponent.gameObject);
                 GlobalEventManager.instance.OnHitAll(damageInfo, healthComponent.gameObject);
             }
         }
     }
 }
            // Token: 0x060017DD RID: 6109 RVA: 0x00067D84 File Offset: 0x00065F84
            public override void Deserialize(NetworkReader reader)
            {
                base.Deserialize(reader);
                this.attacker         = reader.ReadGameObject();
                this.inflictor        = reader.ReadGameObject();
                this.damage           = reader.ReadSingle();
                this.isCrit           = reader.ReadBoolean();
                this.procChainMask    = reader.ReadProcChainMask();
                this.procCoefficient  = reader.ReadSingle();
                this.damageColorIndex = reader.ReadDamageColorIndex();
                this.damageType       = reader.ReadDamageType();
                this.forceVector      = reader.ReadVector3();
                this.pushAwayForce    = reader.ReadSingle();
                this.overlapInfoList.Clear();
                int i   = 0;
                int num = (int)reader.ReadPackedUInt32();

                while (i < num)
                {
                    OverlapAttack.OverlapInfo item = default(OverlapAttack.OverlapInfo);
                    GameObject gameObject          = reader.ReadHurtBoxReference().ResolveGameObject();
                    item.hurtBox       = ((gameObject != null) ? gameObject.GetComponent <HurtBox>() : null);
                    item.hitPosition   = reader.ReadVector3();
                    item.pushDirection = reader.ReadVector3();
                    this.overlapInfoList.Add(item);
                    i++;
                }
            }
Ejemplo n.º 3
0
 // Token: 0x060018FC RID: 6396 RVA: 0x00077EF8 File Offset: 0x000760F8
 private void ProcessHits(List <OverlapAttack.OverlapInfo> hitList)
 {
     if (hitList.Count == 0)
     {
         return;
     }
     for (int i = 0; i < hitList.Count; i++)
     {
         OverlapAttack.OverlapInfo overlapInfo = hitList[i];
         if (this.hitEffectPrefab)
         {
             EffectManager.instance.SimpleImpactEffect(this.hitEffectPrefab, overlapInfo.hitPosition, -hitList[i].pushDirection, true);
         }
         SurfaceDefProvider component = hitList[i].hurtBox.GetComponent <SurfaceDefProvider>();
         if (component && component.surfaceDef)
         {
             SurfaceDef objectSurfaceDef = SurfaceDefProvider.GetObjectSurfaceDef(hitList[i].hurtBox.collider, hitList[i].hitPosition);
             if (objectSurfaceDef)
             {
                 if (objectSurfaceDef.impactEffectPrefab)
                 {
                     EffectManager.instance.SpawnEffect(objectSurfaceDef.impactEffectPrefab, new EffectData
                     {
                         origin   = overlapInfo.hitPosition,
                         rotation = ((overlapInfo.pushDirection == Vector3.zero) ? Quaternion.identity : Util.QuaternionSafeLookRotation(overlapInfo.pushDirection)),
                         color    = objectSurfaceDef.approximateColor,
                         scale    = 2f
                     }, true);
                 }
                 if (objectSurfaceDef.impactSoundString != null && objectSurfaceDef.impactSoundString.Length != 0)
                 {
                     Util.PlaySound(objectSurfaceDef.impactSoundString, hitList[i].hurtBox.gameObject);
                 }
             }
         }
     }
     if (NetworkServer.active)
     {
         OverlapAttack.PerformDamage(this.attacker, this.inflictor, this.damage, this.isCrit, this.procChainMask, this.procCoefficient, this.damageColorIndex, this.damageType, this.forceVector, this.pushAwayForce, hitList);
         return;
     }
     OverlapAttack.outgoingMessage.attacker         = this.attacker;
     OverlapAttack.outgoingMessage.inflictor        = this.inflictor;
     OverlapAttack.outgoingMessage.damage           = this.damage;
     OverlapAttack.outgoingMessage.isCrit           = this.isCrit;
     OverlapAttack.outgoingMessage.procChainMask    = this.procChainMask;
     OverlapAttack.outgoingMessage.procCoefficient  = this.procCoefficient;
     OverlapAttack.outgoingMessage.damageColorIndex = this.damageColorIndex;
     OverlapAttack.outgoingMessage.damageType       = this.damageType;
     OverlapAttack.outgoingMessage.forceVector      = this.forceVector;
     OverlapAttack.outgoingMessage.pushAwayForce    = this.pushAwayForce;
     Util.CopyList <OverlapAttack.OverlapInfo>(hitList, OverlapAttack.outgoingMessage.overlapInfoList);
     GameNetworkManager.singleton.client.connection.SendByChannel(71, OverlapAttack.outgoingMessage, QosChannelIndex.defaultReliable.intVal);
 }