Example #1
0
 private void OpenCombo()
 {
     if (Movement != NPCMovement.Stand && FightAnimation != null)
     {
         // so the npc can instantly stop the attack and run into a direction
         ModelInst.StopAnimation(FightAnimation, false);
     }
     else
     {
         CanCombo = true;
     }
 }
Example #2
0
        private void ChangePosDir(Vec3f oldPos, Angles oldAng, NPCMovement oldMovement)
        {
            Vec3f pos = GetPosition();

            var env = Environment;

            if (env.InAir)
            {
                if (pos.Y > highestY)
                {
                    highestY = pos.Y;
                }
            }
            else if (highestY != 0)
            {
                float dmg = 0.14f * (highestY - pos.Y) - 135;
                if (dmg > 0)
                {
                    Logger.Log("Damage: " + dmg);
                    //this.SetHealth(this.HP - (int)dmg);
                    highestY = 0;
                }
            }


            if (lastRegPos.GetDistance(pos) > 30.0f)
            {
                LastHitMove = GameTime.Ticks;
                lastRegPos  = pos;
            }

            if (FightAnimation != null && CanCombo && Movement != NPCMovement.Stand)
            {
                // so the npc can instantly stop the attack and run into a direction
                ModelInst.StopAnimation(FightAnimation, false);
            }


            if (env.WaterLevel > 0.7f)
            {
                if (IsPlayer)
                {
                    //var client = ((Arena.ArenaClient)this.Client);
                    //client.KillCharacter();
                    //if (Arena.GameModes.Horde.HordeMode.IsActive && this.TeamID >= 0)
                    //{
                    //    Arena.GameModes.Horde.HordeMode.ActiveMode.RespawnClient(client);
                    //}
                }
                else
                {
                    SetHealth(0);
                }
            }

            if (env.InAir && !IsClimbing)
            {
                var aa = ModelInst.GetActiveAniFromLayer(1);
                if (aa != null)
                {
                    ModelInst.StopAnimation(aa, false);
                }
            }


            CheckUnconsciousness();
        }