Beispiel #1
0
 public PlayerStatesInterface[] GetAllEffects(EBodyPart bodyPart)
 {
     return(new PlayerStatesInterface[] { });
 }
Beispiel #2
0
 public bool IsBodyPartDestroyed(EBodyPart bodyPart)
 {
     return(false);
 }
Beispiel #3
0
 public TEffect FindActiveEffect <TEffect>(EBodyPart bodyPart = EBodyPart.Common) where TEffect : PlayerStatesInterface
 {
     return((TEffect)(object)null);
 }
Beispiel #4
0
        public static void SetPlayerDamageInfoS(PlayerEntity source, PlayerEntity target, float damage, EBodyPart part)
        {
            if (!source.hasPosition)
            {
                Logger.Error("damage source player has no position");
                return;
            }
            if (!source.hasEntityKey)
            {
                Logger.Error("damage source has no entity key");
                return;
            }
            if (!target.hasNetwork)
            {
                Logger.Error("damage target has no network component");
                return;
            }
            var pos = source.position.Value;

            var msg = PlayerDamageInfoMessage.Allocate();

            msg.EntityId = source.entityKey.Value.EntityId;
            msg.Damage   = damage;
            msg.PosX     = pos.x;
            msg.PosZ     = pos.z;
            SendMessage(msg, target);
        }
        public static void OnBodyPartDestroyedEvent(EBodyPart bodyPart, EDamageType damageType)
        {
            var requestData = new { type = "BodyPartDestroyed", bodyPart, damageType };

            SendRequest(requestData);
        }
Beispiel #6
0
 public bool IsBodyPartBroken(EBodyPart bodyPart)
 {
     return(false);
 }
Beispiel #7
0
 public static void SetPlayerDamageInfoC(PlayerEntity source, PlayerEntity target, float damage, EBodyPart part)
 {
     if (Logger.IsDebugEnabled)
     {
         Logger.DebugFormat("SetPlayerDamageInfo {0} in {1}", damage, part);
     }
     if (!source.isFlagSelf)
     {
         return;
     }
     if (!source.hasAttackDamage)
     {
         source.AddAttackDamage(part, damage);
     }
     else
     {
         source.attackDamage.HitPart = part;
         source.attackDamage.Damage  = damage;
     }
 }
Beispiel #8
0
 public void ApplyItem(Item item, EBodyPart bodyPart, float?amount = null)
 {
 }
Beispiel #9
0
 public BodyPartStruct GetBodyPartHealth(EBodyPart bodyPart, bool rounded = false)
 {
     return(new BodyPartStruct {
         Current = float.MaxValue, Maximum = float.MaxValue
     });
 }
Beispiel #10
0
 public IEnumerable <TEffect> FindActiveEffects <TEffect>(EBodyPart bodyPart = EBodyPart.Common)
     where TEffect : PlayerStatesInterface
 {
     return(new List <TEffect>());
 }
Beispiel #11
0
 public EBodyPart?CanApplyItem(Item item, EBodyPart bodyPart)
 {
     return(null);
 }
 public static void DoPlayerDamage(Contexts contexts, PlayerEntity sourcePlayer, PlayerEntity targetPlayer, float damage, EUIDeadType hitType = EUIDeadType.VehicleHit, EBodyPart hitPart = EBodyPart.Chest, int weaponId = 0)
 {
     BulletPlayerUtility.ProcessPlayerHealthDamage(contexts, _damager, sourcePlayer, targetPlayer, new PlayerDamageInfo(damage, (int)hitType, (int)hitPart, weaponId));
 }
Beispiel #13
0
        public static float GetPlayerFactor(RaycastHit hit, MeleeFireLogicConfig config, EBodyPart part)
        {
            var factor = 1f;

            for (int i = 0; i < config.DamageFactor.Length; i++)
            {
                if (config.DamageFactor[i].BodyPart == part)
                {
                    factor = config.DamageFactor[i].Factor;
                    break;
                }
            }
            return(factor);
        }
Beispiel #14
0
        public void OnHealthChangedEvent(EBodyPart bodyPart, float diff, StDamage effect)
        {
            CurrentHealth.Health[bodyPart].ChangeHealth(diff);

            _simpleTimer.isHealthSynchronized = false;
        }
Beispiel #15
0
        private void SetCurrentHealth(IHealthController healthController, IReadOnlyDictionary <EBodyPart, BodyPartHealth> dictionary, EBodyPart bodyPart)
        {
            var bodyPartHealth = healthController.GetBodyPartHealth(bodyPart);

            dictionary[bodyPart].Initialize(bodyPartHealth.Current, bodyPartHealth.Maximum);

            // set effects
            if (healthController.IsBodyPartBroken(bodyPart))
            {
                dictionary[bodyPart].AddEffect(BodyPartEffect.BreakPart);
            }
            else
            {
                dictionary[bodyPart].RemoveEffect(BodyPartEffect.BreakPart);
            }
        }
Beispiel #16
0
 public Equipable(EItemID id, string name, List <IItemEffect> onUseEffects, EBodyPart bodyPart)
     : base(id, name, onUseEffects)
 {
     BodyPart = bodyPart;
 }