Exemplo n.º 1
0
        /// <summary>
        /// Load the TalentSheet from the database.
        /// </summary>
        /// <param name="client"></param>
        /// <returns></returns>
        public static TalentScoresheet LoadTalentSheet(Client client)
        {
            TalentScoresheet talentScoresheet = Database.Get(client.Name);

            talentScoresheet.AddSheetToPlayer(client);
            return(talentScoresheet);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Setup a new sheet for the player. If you want to randomize it set the last parameter to true and the others to 0s.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="strength"></param>
        /// <param name="intelligence"></param>
        /// <param name="endurance"></param>
        /// <param name="charisma"></param>
        /// <param name="randomize"></param>
        /// <returns></returns>
        public static TalentScoresheet SetupNewSheet(Client client, int strength, int intelligence, int endurance, int charisma, bool randomize = false, bool save = true)
        {
            TalentScoresheet sheet = new TalentScoresheet(client);

            if (randomize)
            {
                sheet.Strength     = GenerateModifier();
                sheet.Intelligence = GenerateModifier();
                sheet.Endurance    = GenerateModifier();
                sheet.Charisma     = GenerateModifier();
            }
            else
            {
                sheet.Strength     = strength;
                sheet.Intelligence = intelligence;
                sheet.Endurance    = endurance;
                sheet.Charisma     = charisma;
            }

            if (save)
            {
                sheet.SaveScoresheet();
            }

            return(sheet);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Checks if the player's Endurance beats the score required.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="scoreToBeat"></param>
        /// <returns></returns>
        public static bool CheckCharisma(Client client, int scoreToBeat = 10, int impact = 0)
        {
            TalentScoresheet scoresheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            if (scoresheet.GetChaScore() + Dice.RollDice() > scoreToBeat)
            {
                return(true);
            }

            scoresheet.CharismaModifier += impact;
            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Will return true if the client wins. False is the target wins.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public static bool CheckStrAgainstOpponent(Client client, Client target, int impact = 0)
        {
            TalentScoresheet clientSheet = client.GetData("TalentScoresheet") as TalentScoresheet;
            TalentScoresheet targetSheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            if (clientSheet.GetStrScore() + Dice.RollDice() > targetSheet.GetStrScore() + Dice.RollDice())
            {
                return(true);
            }

            clientSheet.StrengthModifier += impact;
            return(false);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Will return true if the client wins. False is the target wins.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="target"></param>
        /// <returns></returns>
        public static bool CheckChaAgainstPlayer(Client client, Client target, int impact = 0)
        {
            TalentScoresheet clientSheet = client.GetData("TalentScoresheet") as TalentScoresheet;
            TalentScoresheet targetSheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            if (clientSheet.GetChaScore() + Dice.RollDice() > targetSheet.GetChaScore() + Dice.RollDice())
            {
                return(true);
            }

            clientSheet.CharismaModifier += impact;
            return(false);
        }
Exemplo n.º 6
0
        public void SaveTalentSheet(Client client)
        {
            if (Settings.DisableCommands)
            {
                return;
            }

            if (!client.HasData("TalentScoresheet"))
            {
                return;
            }

            TalentScoresheet sheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            sheet.SaveScoresheet();
            client.SendChatMessage("[Talent] Saved. Use /checksheet");
        }
Exemplo n.º 7
0
        public void RestoreDebuffs(Client client)
        {
            if (Settings.DisableCommands)
            {
                return;
            }

            if (!client.HasData("TalentScoresheet"))
            {
                return;
            }

            TalentScoresheet sheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            sheet.RestoreModifiers();

            client.SendChatMessage("~g~Debuffs have been cleared.");
        }
Exemplo n.º 8
0
        public void DebuffCheck(Client client)
        {
            if (Settings.DisableCommands)
            {
                return;
            }

            if (!client.HasData("TalentScoresheet"))
            {
                return;
            }

            TalentScoresheet sheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            client.SendChatMessage($"=== ~b~Debuffs ~w~===");
            client.SendChatMessage($"~g~END: ~w~{sheet.EnduranceModifier}");
            client.SendChatMessage($"~r~STR: ~w~{sheet.StrengthModifier}");
            client.SendChatMessage($"~b~INT: ~w~{sheet.IntelligenceModifier}");
            client.SendChatMessage($"~o~CHA: ~w~{sheet.CharismaModifier}");
        }
Exemplo n.º 9
0
        public void SkillCheck(Client client)
        {
            if (Settings.DisableCommands)
            {
                return;
            }

            if (!client.HasData("TalentScoresheet"))
            {
                return;
            }

            TalentScoresheet sheet = client.GetData("TalentScoresheet") as TalentScoresheet;

            client.SendChatMessage($"=== ~b~SHEET ~w~===");
            client.SendChatMessage($"~g~END: ~w~{sheet.Endurance} > +{sheet.GetEndScore()} Modifier");
            client.SendChatMessage($"~r~STR: ~w~{sheet.Strength} > +{sheet.GetStrScore()} Modifier");
            client.SendChatMessage($"~b~INT: ~w~{sheet.Intelligence} > +{sheet.GetIntScore()} Modifier");
            client.SendChatMessage($"~o~CHA: ~w~{sheet.Charisma} > +{sheet.GetChaScore()} Modifier");
        }
Exemplo n.º 10
0
        public void OnPlayerSpawn(Client client)
        {
            // Load player sheets.
            if (!Settings.LoadSheetsOnJoin)
            {
                return;
            }

            // Create a new sheet for the client.
            TalentScoresheet sheet = new TalentScoresheet(client);

            if (!Settings.AssignRandomStats)
            {
                return;
            }

            // Setup randomized stats for the player and save it to the database.
            sheet.Charisma     = CharacterGen.GenerateModifier();
            sheet.Strength     = CharacterGen.GenerateModifier();
            sheet.Intelligence = CharacterGen.GenerateModifier();
            sheet.Endurance    = CharacterGen.GenerateModifier();
            sheet.SaveScoresheet();
        }