Example #1
0
 public void Handle(TakeDamageEvent arg)
 {
     if (!arg.Target.Entity.HasComponent <FloatingText>())
     {
         return;
     }
     UIFloatingText.WorldSpawn(arg.Amount.ToString("F0"), arg.Target.Tr.position, Color.red);
 }
Example #2
0
 public void Handle(TakeDamageEvent arg)
 {
     if (!arg.Target.Entity.HasComponent <FloatingText>())
     {
         return;
     }
     if (arg.Impact.Hit == CollisionResult.CriticalHit)
     {
         UIFloatingText.WorldSpawn(arg.Amount.ToString("F0") + "!", arg.Target.Tr.position, new Color(1f, 0.6f, 0.14f));
     }
     else
     {
         UIFloatingText.WorldSpawn(arg.Amount.ToString("F0"), arg.Target.Tr.position, Color.red);
     }
 }
Example #3
0
        public void Handle(TakeDamageEvent arg)
        {
            if (arg.Amount <= 0)
            {
                return;
            }
            var hurtAnimation = arg.Target.Entity.Get <HurtAnimation>();

            if (hurtAnimation != null)
            {
                arg.Target.Animator.Value.PlayAnimation(hurtAnimation.Clip, hurtAnimation.PauseDuring, null);
                if (hurtAnimation.PauseDuring)
                {
                    arg.Target.Tags.Add(EntityTags.CantMove);
                    _moveClips.Add(new PauseMovementForClip(arg.Target.Animator, hurtAnimation.Clip));
                }
            }
        }
Example #4
0
 public static bool GodModeDamage(TakeDamageEvent dmg)
 {
     return(true);
 }
Example #5
0
 public CausedDamageEvent(float amount, TakeDamageEvent damageEvent)
 {
     TakeDamage = damageEvent;
     Amount     = amount;
 }
 public ReceivedDamageEvent(float amount, TakeDamageEvent damageEvent)
 {
     TakeDamage = damageEvent;
     Amount     = amount;
 }
Example #7
0
 private bool BlockDamageFlat(TakeDamageEvent dmgEvent)
 {
     return(true);
 }