示例#1
0
        public void ReadyRollVantage(int playerId, VantageKind vantage)
        {
            CreatureStats playerState = GetPlayerStats(playerId);

            playerState.ReadyToRollDice = true;
            if (playerState.DiceStack.Count == 0)
            {
                playerState.AddD20();
            }
            playerState.Vantage = vantage;
        }
示例#2
0
        public void SetReadyRollDice(int playerId, bool newValue, DieRollDetails dieRollDetails)
        {
            CreatureStats playerState = GetPlayerStats(playerId);

            playerState.ReadyToRollDice = newValue;
            playerState.ClearDiceStack();
            foreach (Roll roll in dieRollDetails.Rolls)
            {
                playerState.AddRoll(roll);
            }
        }
 public static void ApplyToCreature(Creature targetCreature, string spellId, Conditions conditions)
 {
     targetCreature.AddSpellCondition(spellId, conditions);
     if (targetCreature is Character player)
     {
         CreatureStats playerStats = PlayerStatManager.GetPlayerStats(player.playerID);
         if (playerStats != null)
         {
             playerStats.Conditions = player.AllConditions;
         }
     }
 }
示例#4
0
        public void ToggleCondition(int playerId, Conditions conditions)
        {
            CreatureStats playerStats = GetPlayerStats(playerId);

            if (playerStats.Conditions.HasFlag(conditions))             // Bit is set.
            {
                playerStats.Conditions &= ~conditions;                  // clear the bit
            }
            else
            {
                playerStats.Conditions |= conditions;
            }
        }
示例#5
0
        public CreatureStats GetPlayerStats(int creatureId)
        {
            CreatureStats foundPlayer = Players.FirstOrDefault(x => x.CreatureId == creatureId);

            if (foundPlayer != null)
            {
                return(foundPlayer);
            }

            CreatureStats playerState = new CreatureStats(creatureId);

            Players.Add(playerState);
            return(playerState);
        }
示例#6
0
        public void ToggleReadyRollD20(int playerId)
        {
            CreatureStats playerStats = GetPlayerStats(playerId);

            playerStats.DiceStack.Clear();
            playerStats.AddD20();

            if (playerStats.Vantage == VantageKind.Normal || !playerStats.ReadyToRollDice)
            {
                playerStats.ReadyToRollDice = !playerStats.ReadyToRollDice;
            }
            else
            {
                playerStats.Vantage = VantageKind.Normal;
            }
        }
示例#7
0
        public void ClearConditions(int playerId)
        {
            CreatureStats playerStats = GetPlayerStats(playerId);

            playerStats.Conditions = Conditions.None;
        }
示例#8
0
        public void ToggleTarget(int playerId)
        {
            CreatureStats playerStats = GetPlayerStats(playerId);

            playerStats.IsTargeted = !playerStats.IsTargeted;
        }