예제 #1
0
        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
 public SpCampfire(Campfire campfire)
 {
     Campfire = campfire;
 }
예제 #3
0
 public SpRemoveCampfire(Campfire campfire, byte type = 0)
 {
     Campfire = campfire;
     Type = type;
 }
예제 #4
0
 private void DistanceToCampfireRecalculated(Campfire campfire, double distance)
 {
     if (distance <= (campfire.Type == 4 ? 200 : 100))
         UsedCampfire = campfire;
 }
예제 #5
0
 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);
         }
     }
 }