public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
        {
            if (applyToTargetedCreatures)
            {
                dungeonMasterApp.ApplyToTargetedCreatures(applyCommand);
                return;
            }
            decimal value = GetValue();

            if (value == decimal.MinValue)
            {
                dungeonMasterApp.TellDungeonMaster($"Set numeric value first before applying {applyCommand}.");
                return;
            }
            dungeonMasterApp.Apply(applyCommand, value, GetPlayerIds(dungeonMasterApp, applyToAllPlayers));
            ResetValue();
        }
Exemple #2
0
        public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
        {
            if (applyToTargetedCreatures)
            {
                dungeonMasterApp.ApplyToTargetedCreatures(applyCommand);
                return;
            }

            string  keyword = GetActiveKeyword();
            decimal value   = DigitManager.GetValue(keyword);

            if (value > 10000)
            {
                System.Diagnostics.Debugger.Break();
                dungeonMasterApp.TellDungeonMaster($"{keyword} value unreasonably high - {value}. Resetting it to zero. Please try again.");
                DigitManager.SetValue(keyword, 0);
                return;
            }

            if (applyToOnScreenCreatures && value != decimal.MinValue)
            {
                dungeonMasterApp.ApplyToOnScreenCreatures(applyCommand, (int)value);
                return;
            }

            if (applyToSelectedCreature && value != decimal.MinValue)
            {
                dungeonMasterApp.ApplyToSelectedCreature(applyCommand, (int)value);
                return;
            }

            if (value == decimal.MinValue)
            {
                dungeonMasterApp.TellDungeonMaster($"Set numeric value first before applying {applyCommand}.");
                return;
            }
            dungeonMasterApp.Apply(applyCommand, value, GetPlayerIds(dungeonMasterApp, applyToAllPlayers));
            DigitManager.ResetValue(keyword);
        }
 public void Execute(IDungeonMasterApp dungeonMasterApp, ChatMessage chatMessage)
 {
     dungeonMasterApp.Apply("LastDamage", 0, GetPlayerIds(dungeonMasterApp, applyToAllPlayers));
 }