Ejemplo n.º 1
0
 /// <summary>
 /// stops an adventure for a player
 /// </summary>
 /// <param name="playerid">id of player to remove</param>
 public void RemoveAdventurer(long playerid)
 {
     lock (adventurerlock) {
         activeplayers.Remove(playerid);
         if (adventurers.RemoveAll(p => p.Player == playerid) > 0)
         {
             PlayerActiveChanged?.Invoke(playerid, false);
             context.GetModule <RPGMessageModule>().Create().User(playerid).Text(" stopped adventuring.").Send();
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// sends a player on adventure
        /// </summary>
        /// <param name="player"></param>
        public void AddAdventurer(Player player)
        {
            lock (adventurerlock) {
                if (activeplayers.Contains(player.UserID))
                {
                    return;
                }

                Adventure adventure = new Adventure(player.UserID)
                {
                    AdventureLogic = player.CurrentHP > 0 ? (IAdventureLogic)explorationlogic : new SpiritRealmLogic(context)
                };
                adventure.Reset();

                adventurers.Add(adventure);
                activeplayers.Add(player.UserID);

                PlayerActiveChanged?.Invoke(player.UserID, true);
                context.GetModule <RPGMessageModule>().Create().User(player.UserID).Text(" went out to adventure.").Send();
            }
        }