public override void Activate() { string weatherKeyword = Expressions.GetStr((string)Args[1]); DungeonMasterApp.ShowWeather(weatherKeyword); if (DungeonMasterApp.Game.InCombat) { CreateInCombatAlarm(); } else { DungeonMasterApp.Game.EnterCombat += Game_EnterCombat; DungeonMasterApp.Game.CreateAlarm(STR_WeatherEventOneMinute, DndTimeSpan.OneMinute, OneMinuteIsDone); } }
public override void HandleMessage(ChatMessage chatMessage, TwitchClient twitchClient, Character activePlayer) { lock (messageHandlingLock) { string streamDeckCommand = StripCommandsFromMessage(chatMessage.Message, out string commands); foreach (IDungeonMasterCommand dungeonMasterCommand in Commands) { if (dungeonMasterCommand.Matches(streamDeckCommand)) { if (dungeonMasterCommand is SelectShortcutCommand shortcutCommand) { int playerId = DungeonMasterApp.GetPlayerIdFromName(shortcutCommand.playerInitial); activePlayer = DungeonMasterApp.GetPlayerFromId(playerId); } Expressions.Do(commands, activePlayer); dungeonMasterCommand.Execute(DungeonMasterApp, chatMessage); return; } } } }
public override void Activate() { const bool suppressMediaForDebugging = false; timeActivated = DateTime.Now; videoPlayIsComplete = false; dieStoppedRolling = false; if (!suppressMediaForDebugging) { string[] mediaSources = MediaSources.Split(';'); foreach (string mediaSource in mediaSources) { ShowStampedeMediaSource(mediaSource.Trim(), true); } } stampedePlaybackTimer.Start(); stampedeDieRollGuid = Guid.NewGuid().ToString(); DungeonMasterApp.SetNextStampedeRoll(CardName, UserName, DamageStr, stampedeDieRollGuid); remindDungeonMasterTimer.Start(); HubtasticBaseStation.DiceStoppedRolling += HubtasticBaseStation_DiceStoppedRolling; }
private void Finish() { IsDone = true; DungeonMasterApp.ShowWeather("None"); }
private void RemindDungeonMasterTimer_Elapsed(object sender, ElapsedEventArgs e) { TimeSpan timeSpanSinceCardPlay = DateTime.Now - timeActivated; DungeonMasterApp.TellDungeonMaster($"Reminder caulfielder: The \"{CardName}\" stampede card was activated {(int)timeSpanSinceCardPlay.TotalSeconds} seconds ago. Target the players/NPCs in the path and roll their dexterity saving throws!"); }