public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
        {
            const bool verbose        = false;
            int        playerId       = dungeonMasterApp.GetPlayerIdFromName(TargetPlayer);
            string     valueUppercase = valueAsStr.ToUpper().Trim();

            if (valueUppercase == "TRUE" || valueUppercase == "FALSE")
            {
                string firstName     = dungeonMasterApp.GetPlayFirstNameFromId(playerId);
                bool   newValue      = valueUppercase == "TRUE";
                bool   previousValue = dungeonMasterApp.GetBoolProperty(playerId, propertyName);
                if (previousValue == newValue)
                {
                    if (verbose)
                    {
                        dungeonMasterApp.TellDungeonMaster($"{firstName}'s {propertyName} is already {valueAsStr.Trim()}.");
                    }
                    return;
                }

                dungeonMasterApp.SetBoolProperty(playerId, propertyName, newValue);
                bool newlySetValue = dungeonMasterApp.GetBoolProperty(playerId, propertyName);
                if (newlySetValue == previousValue)
                {
                    dungeonMasterApp.TellDungeonMaster($"Error. Unable to set {firstName}'s {propertyName} to {valueAsStr.Trim()}.");
                }
                else if (verbose)
                {
                    dungeonMasterApp.TellDungeonMaster($"{firstName}'s {propertyName} = {valueAsStr.Trim()}.");
                }
            }
            //bool GetBoolProperty(int playerId, string propertyName);
        }
Exemple #2
0
 public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
 {
     SetCreatureId(dungeonMasterApp);
     if (creatureId == int.MinValue && playerName != null)
     {
         int playerId = dungeonMasterApp.GetPlayerIdFromName(playerName);
         dungeonMasterApp.CardCommand(cardCommandType, playerId, cardId);
     }
     else
     {
         dungeonMasterApp.CardCommand(cardCommandType, creatureId, cardId);
     }
 }
Exemple #3
0
        protected List <int> GetPlayerIds(IDungeonMasterApp dungeonMasterApp, bool testAllPlayers)
        {
            List <int> playerIds = new List <int>();

            if (testAllPlayers)
            {
                playerIds.Add(int.MaxValue);
            }
            else if (TargetPlayer == null)
            {
                playerIds.Add(dungeonMasterApp.GetActivePlayerId());
            }
            else
            {
                playerIds.Add(dungeonMasterApp.GetPlayerIdFromName(TargetPlayer));
            }
            return(playerIds);
        }
        public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
        {
            DamageHealthChange damageHealthChange = new DamageHealthChange();

            damageHealthChange.DamageHealth = healthDamageValue;
            if (TargetPlayer == null)
            {
                damageHealthChange.PlayerIds.Add(int.MaxValue);
            }
            else
            {
                int playerId = dungeonMasterApp.GetPlayerIdFromName(TargetPlayer);
                if (playerId != -1)
                {
                    damageHealthChange.PlayerIds.Add(playerId);
                }
            }
            dungeonMasterApp.ApplyDamageHealthChange(damageHealthChange);
        }
Exemple #5
0
 private void SetCreatureId(IDungeonMasterApp dungeonMasterApp)
 {
     if (targetOverride != null)
     {
         if (targetOverride == STR_LastNpcCreatureId)
         {
             creatureId = lastNpcCreatureId;
         }
         else
         {
             int playerId = dungeonMasterApp.GetPlayerIdFromName(targetOverride);
             if (playerId >= 0)
             {
                 creatureId = playerId;
             }
             else
             {
                 System.Diagnostics.Debugger.Break();
             }
         }
     }
 }
Exemple #6
0
 public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
 {
     dungeonMasterApp.SelectCharacter(dungeonMasterApp.GetPlayerIdFromName(playerInitial));
 }
 public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
 {
     dungeonMasterApp.SetVantage(vantageKind, dungeonMasterApp.GetPlayerIdFromName(playerInitial));
 }
Exemple #8
0
 public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
 {
     dungeonMasterApp.SelectPlayerShortcut(shortcutName, dungeonMasterApp.GetPlayerIdFromName(playerInitial));
 }
 public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
 {
     dungeonMasterApp.BreakConcentration(dungeonMasterApp.GetPlayerIdFromName(playerInitial));
 }