Ejemplo n.º 1
0
        public static bool ChangeDifficulty(Players.Player player, ColonyState state, string difficulty)
        {
            if (SettlersConfiguration.DifficutlyCanBeChanged)
            {
                if (!GameDifficulty.GameDifficulties.ContainsKey(difficulty))
                {
                    UnknownCommand(player, difficulty);
                    return(true);
                }

                var newDiff = GameDifficulty.GameDifficulties[difficulty];

                if (newDiff.Rank >= SettlersConfiguration.MinDifficulty.Rank)
                {
                    state.Difficulty = newDiff;
                    SettlerManager.UpdateFoodUse(state);
                    state.Difficulty.Print(player);

                    PandaChat.Send(player, "Settlers! Mod difficulty set to {0}.", ChatColor.green,
                                   state.Difficulty.Name);

                    NetworkUI.NetworkMenuManager.SendColonySettingsUI(player);
                    return(true);
                }

                NetworkUI.NetworkMenuManager.SendColonySettingsUI(player);
                PandaChat.Send(player, "The server administrator had disabled setting your difficulty below {0}.",
                               ChatColor.green, SettlersConfiguration.MinDifficulty.Name);
            }

            return(true);
        }
Ejemplo n.º 2
0
 private static void ReducedWaste_ResearchComplete(object sender, ResearchCompleteEventArgs e)
 {
     SettlerManager.UpdateFoodUse(e.Manager.Player);
 }
Ejemplo n.º 3
0
 public void ResearchComplete(object sender, ResearchCompleteEventArgs e)
 {
     SettlerManager.UpdateFoodUse(ColonyState.GetColonyState(e.Manager.Colony));
 }