コード例 #1
0
ファイル: PlayerAi.cs プロジェクト: CadeLaRen/TeraEmulator
        public override void Action()
        {
            if (Player.Controller is DeathController)
                return;

            if (UsedCampfire != null)
            {
                if (UsedCampfire.Instance != Player.Instance ||
                    UsedCampfire.Position.FastDistanceTo(Player.Position) > (UsedCampfire.Type == 4 ? 200 : 100))
                {
                    UsedCampfire = null;

                    if (Player.PlayerMode == PlayerMode.Relax)
                    {
                        Player.PlayerMode = PlayerMode.Normal;
                        Global.VisibleService.Send(Player, new SpCharacterState(Player));
                    }
                }
                else if (Player.PlayerMode == PlayerMode.Normal)
                {
                    Player.PlayerMode = PlayerMode.Relax;
                    Global.VisibleService.Send(Player, new SpCharacterState(Player));
                }
            }

            long now = Funcs.GetCurrentMilliseconds();

            if (Player.Controller is BattleController)
                LastBattleUts = now;

            while (now >= NextRegenUts)
            {
                Regenerate();
                NextRegenUts += Player.Controller is BattleController ? 5000 : 2000;
            }

            while (now > NextDistressUts)
            {
                int timeout = (Player.LifeStats.Stamina > 100) ? 90000 : 60000;

                if(Player.Controller is BattleController)
                    timeout -= 30000;

                Distress();
                NextDistressUts += timeout;
            }
        }
コード例 #2
0
ファイル: SpCampfire.cs プロジェクト: ZettaZero/TeraEmulator
 public SpCampfire(Campfire campfire)
 {
     Campfire = campfire;
 }
コード例 #3
0
 public SpRemoveCampfire(Campfire campfire, byte type = 0)
 {
     Campfire = campfire;
     Type = type;
 }
コード例 #4
0
ファイル: PlayerAi.cs プロジェクト: CadeLaRen/TeraEmulator
 private void DistanceToCampfireRecalculated(Campfire campfire, double distance)
 {
     if (distance <= (campfire.Type == 4 ? 200 : 100))
         UsedCampfire = campfire;
 }
コード例 #5
0
ファイル: Visible.cs プロジェクト: ZettaZero/TeraEmulator
 private void CheckCampfire(Campfire campfire)
 {
     if (IsVisible(Player, campfire))
     {
         if (!Player.VisibleCampfires.Contains(campfire))
         {
             Player.VisibleCampfires.Add(campfire);
             campfire.VisiblePlayers.Add(Player);
             PlayerLogic.InTheVision(Player, campfire);
         }
     }
     else
     {
         if (Player.VisibleCampfires.Contains(campfire))
         {
             Player.VisibleCampfires.Remove(campfire);
             campfire.VisiblePlayers.Remove(Player);
             PlayerLogic.OutOfVision(Player, campfire);
         }
     }
 }