Exemplo n.º 1
0
        void EntityHurt_Test()
        {
            try
            {
                Entity Ent = null;
                if (World.GetWorld().Entities.ToArray().Length > 2)
                {
                    Ent = World.GetWorld().Entities.ToArray()[2];
                }
                if (Ent == null)
                {
                    Log("EntityHurt_Test: Ent == null!");
                }

                DamageEvent damageEvent = new DamageEvent();
                damageEvent.amount = 50f;

                Log("EntityHurt_Test: Test 1");
                Hooks.EntityHurt(Ent, ref damageEvent);

                Fougerite.Player player = null;
                Ent.ChangeOwner(player);
                Log("EntityHurt_Test: Test 2");
                Hooks.EntityHurt(Ent, ref damageEvent);

                Log("EntityHurt_Test: Test 3");
                Hooks.EntityHurt(null, ref damageEvent);

                Ent = new Entity(new object());
                Log("EntityHurt_Test: Test 4");
                Hooks.EntityHurt(Ent, ref damageEvent);
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }