Ejemplo n.º 1
0
 /// <summary>
 /// Handles an entity turning into a zombie when they die or go into crit
 /// </summary>
 private void OnDamageChanged(EntityUid uid, ZombifyOnDeathComponent component, MobStateChangedEvent args)
 {
     if (args.CurrentMobState == DamageState.Dead ||
         args.CurrentMobState == DamageState.Critical)
     {
         ZombifyEntity(uid);
     }
 }
        /// <summary>
        /// Handles an entity turning into a zombie when they die or go into crit
        /// </summary>
        private void OnDamageChanged(EntityUid uid, ZombifyOnDeathComponent component, MobStateChangedEvent args)
        {
            if (!TryComp <MobStateComponent>(uid, out var mobstate))
            {
                return;
            }

            if (mobstate.IsDead() ||
                mobstate.IsCritical())
            {
                ZombifyEntity(uid);
            }
        }