public static void Yell(Player player, string text) { if (player == null) { throw new ArgumentNullException($"{MethodBase.GetCurrentMethod().ReflectedType.Name}, null player"); } if (text == null) { throw new ArgumentNullException($"{MethodBase.GetCurrentMethod().ReflectedType.Name}, null string"); } // text.Length == 0 OK if (player.IsAlive) { text = TextUtils.CurateDialogue(text); if (text == "") { GameEngine.SayToLocation(player.Location, $"{player.Name} yells loudly."); GameEngine.SayToAdjacent(player.Location, $"There is a sound of somebody yelling coming from {player.Location}."); } else { GameEngine.SayToLocation(player.Location, $"{player.Name} yells, \"{text}\""); GameEngine.SayToAdjacent(player.Location, $"Somebody is yelling from {player.Location}, \"{text}\""); } } }
private static void DoIdle(Player player) { if (player == null) { throw new ArgumentNullException($"{MethodBase.GetCurrentMethod().ReflectedType.Name}, null player"); } if (player.IsAlive) { switch (rng.Next(6)) { case 0: GameEngine.SayToLocation(player.Location, $"{player.Name} wanders about."); break; case 1: GameEngine.SayToLocation(player.Location, $"{player.Name} stands around doing nothing."); break; case 2: GameEngine.SayToLocation(player.Location, $"{player.Name} waits patiently."); break; case 3: GameEngine.SayToLocation(player.Location, $"{player.Name} shifts {player.Genderize("his", "her", "its")} weight from side to side."); break; case 4: if (player.HasState(EffectClass.Dysentery)) { GameEngine.SayToLocation(player.Location, $"{player.Name} prominently farts."); GameEngine.SayToAdjacent(player.Location, $"There is a sound of somebody farting coming from {player.Location}."); } else { GameEngine.SayToLocation(player.Location, $"{player.Name} sighs."); } break; case 5: if (player.HasState(EffectClass.Dysentery)) { GameEngine.SayToLocation(player.Location, $"{player.Name} coughs a wet cough."); GameEngine.SayToAdjacent(player.Location, $"There is a wet coughing sound coming from from {player.Location}."); } else { GameEngine.SayToLocation(player.Location, $"{player.Name} has a hiccup."); } break; default: break; } } }