Example #1
0
 public static void OnPlayerConnectedLate(Players.Player p)
 {
     if (p.IsConnected)
     {
         Colony      colony = Colony.Get(p);
         PlayerState state  = PlayerState.GetPlayerState(p);
         GameDifficultyChatCommand.PossibleCommands(p, ChatColor.grey);
         UpdateFoodUse(p);
     }
 }
        public static void OnPlayerConnectedLate(Players.Player p)
        {
            if (Configuration.DifficutlyCanBeChanged)
            {
                GameDifficultyChatCommand.PossibleCommands(p, ChatColor.grey);
            }

            if (Configuration.GetorDefault("SettlersEnabled", true) &&
                Configuration.GetorDefault("MaxSettlersToggle", 4) > 0)
            {
                var ps = PlayerState.GetPlayerState(p);

                if (ps.SettlersEnabled && Configuration.GetorDefault("ColonistsRecruitment", true))
                {
                    PandaChat.Send(p,
                                   string
                                   .Format("Recruiting over {0} colonists will cost the base food cost plus a compounding {1} food. This compounding value resets once per in game day. If you build it... they will come.",
                                           MAX_BUYABLE,
                                           Configuration.GetorDefault("CompoundingFoodRecruitmentCost", 5)),
                                   ChatColor.orange);
                }

                if (ps.SettlersToggledTimes < Configuration.GetorDefault("MaxSettlersToggle", 4))
                {
                    var settlers = ps.SettlersEnabled ? "on" : "off";

                    if (Configuration.GetorDefault("MaxSettlersToggle", 4) > 0)
                    {
                        PandaChat.Send(p,
                                       $"To disable/enable gaining random settlers type '/settlers off' Note: this can only be used {Configuration.GetorDefault("MaxSettlersToggle", 4)} times.",
                                       ChatColor.orange);
                    }
                    else
                    {
                        PandaChat.Send(p, $"To disable/enable gaining random settlers type '/settlers off'",
                                       ChatColor.orange);
                    }

                    PandaChat.Send(p, $"Random Settlers are currently {settlers}.", ChatColor.orange);
                }
            }

            UpdateFoodUse(p);

            Colony.Get(p).SendUpdate();
            Colony.SendColonistCount(p);
        }