private void RPCHandleServerDamage(NetworkUser arg1, ServerDamageContainer arg2) { // deal the DAMAGES try { arg2.DealDamage(); } catch (Exception ex) { } // not very important if this fails }
private bool ColliderDamage(Collider[] array, float damageMulti, float coeff) { // now that we have our enemies, only get the ones within the Y dimension var hurtboxes = array.Where(x => x.GetComponent <HurtBox>() != null); List <HurtBoxGroup> allReadyDamaged = new List <HurtBoxGroup>(); HurtBox hitSoundObj = null; foreach (var hurtBox in hurtboxes) { var hurtBox2 = hurtBox.GetComponentInChildren <HurtBox>(); if (hurtBox2 == null) { continue; } if (hurtBox2.healthComponent == base.healthComponent) { continue; } if (allReadyDamaged.Where(x => x == hurtBox2.hurtBoxGroup).Count() > 0) { continue; // already hit them } if (hurtBox2.teamIndex == base.teamComponent.teamIndex) { continue; // dont hit teammates LUL } hitSoundObj = hurtBox2; allReadyDamaged.Add(hurtBox2.hurtBoxGroup); DamageInfo damageInfo = new DamageInfo(); damageInfo.damage = damageStat * damageMulti; damageInfo.attacker = base.gameObject; damageInfo.procCoefficient = coeff; damageInfo.position = hurtBox2.transform.position; damageInfo.crit = base.RollCrit(); // WEB HANDLE ServerDamageContainer container = new ServerDamageContainer(damageInfo, hurtBox2.healthComponent.gameObject); NetRequestDoDamage.Invoke(container); // play hit fx! Vector3 hitPos = hurtBox2.collider.ClosestPoint(base.transform.position); PlayFx(Assets.SephHitFx, hitPos, Quaternion.identity, 1f); } if (allReadyDamaged == null) { return(false); } return(allReadyDamaged.Count() > 0); }