internal void DoDamage( BaseEntity ent, TriggerHurtEx.HurtType type, List <DamageTypeEntry> damage, GameObjectRef effect, float multiply = 1f) { if (!this.damageEnabled) { return; } using (TimeWarning.New("TriggerHurtEx.DoDamage", 0.1f)) { if (damage != null && damage.Count > 0) { BaseCombatEntity baseCombatEntity = ent as BaseCombatEntity; if (Object.op_Implicit((Object)baseCombatEntity)) { HitInfo info = new HitInfo(); info.damageTypes.Add(damage); info.damageTypes.ScaleAll(multiply); info.DoHitEffects = true; info.DidHit = true; info.Initiator = ((Component)this).get_gameObject().ToBaseEntity(); info.PointStart = ((Component)this).get_transform().get_position(); info.PointEnd = ((Component)baseCombatEntity).get_transform().get_position(); if (type == TriggerHurtEx.HurtType.Simple) { baseCombatEntity.Hurt(info); } else { baseCombatEntity.OnAttacked(info); } } } if (!effect.isValid) { return; } Effect.server.Run(effect.resourcePath, ent, StringPool.closest, ((Component)this).get_transform().get_position(), Vector3.get_up(), (Connection)null, false); } }
internal void DoDamage(BaseEntity ent, TriggerHurtEx.HurtType type, List <DamageTypeEntry> damage, GameObjectRef effect, float multiply = 1f) { if (!this.damageEnabled) { return; } using (TimeWarning timeWarning = TimeWarning.New("TriggerHurtEx.DoDamage", 0.1f)) { if (damage != null && damage.Count > 0) { BaseCombatEntity baseCombatEntity = ent as BaseCombatEntity; if (baseCombatEntity) { HitInfo hitInfo = new HitInfo(); hitInfo.damageTypes.Add(damage); hitInfo.damageTypes.ScaleAll(multiply); hitInfo.DoHitEffects = true; hitInfo.DidHit = true; hitInfo.Initiator = base.gameObject.ToBaseEntity(); hitInfo.PointStart = base.transform.position; hitInfo.PointEnd = baseCombatEntity.transform.position; if (type != TriggerHurtEx.HurtType.Simple) { baseCombatEntity.OnAttacked(hitInfo); } else { baseCombatEntity.Hurt(hitInfo); } } } if (effect.isValid) { Effect.server.Run(effect.resourcePath, ent, StringPool.closest, base.transform.position, Vector3.up, null, false); } } }