private void StopEmoteFarmAnimal(string command, string[] args) { if (!Context.IsMainPlayer && !Config.AllowNonHostEmoteAnimalCommand) { this.Monitor.Log(I18n.Command_PermissionsDenied(), LogLevel.Info); return; } if (args.Length < 2) { this.Monitor.Log($"{I18n.Command_MissingParameters()}\n\n{I18n.Command_PlayEmoteAnimal_Usage()}", LogLevel.Info); return; } FarmAnimal farmAnimal = Game1.getFarm().getAllFarmAnimals().FirstOrDefault(x => x.Name == args[0]); if (farmAnimal == null) { this.Monitor.Log($"Could not find any FarmAnimal with \"{args[0]}\".", LogLevel.Info); return; } if (farmAnimal.IsEmoting) { this.Monitor.Log($"Stoping {args[0]} from playing emote...", LogLevel.Info); farmAnimal.IsEmoting = false; } else { this.Monitor.Log($"No emote is being played by {args[0]}.", LogLevel.Info); } }
private void StopEmoteNpc(string command, string[] args) { if (!Context.IsMainPlayer && !Config.AllowNonHostEmoteNpcCommand) { this.Monitor.Log(I18n.Command_PermissionsDenied(), LogLevel.Info); return; } if (args.Length < 2) { this.Monitor.Log($"{I18n.Command_MissingParameters()}\n\n{I18n.Command_StopEmoteNpc_Usage()}", LogLevel.Info); return; } NPC npc = Game1.getCharacterFromName(args[0], mustBeVillager: false); if (npc == null) { this.Monitor.Log($"Could not find any NPC with the name \"{args[0]}\".", LogLevel.Info); return; } if (npc.IsEmoting) { this.Monitor.Log($"Stoping {args[0]} from playing emote...", LogLevel.Info); npc.IsEmoting = false; } else { this.Monitor.Log($"No emote is being played by {args[0]}.", LogLevel.Info); } }
private void EmoteFarmAnimal(string command, string[] args) { if (!Context.IsMainPlayer && !Config.AllowNonHostEmoteAnimalCommand) { this.Monitor.Log(I18n.Command_PermissionsDenied(), LogLevel.Info); return; } if (args.Length < 2) { this.Monitor.Log($"{I18n.Command_MissingParameters()}\n\n{I18n.Command_PlayEmoteAnimal_Usage()}", LogLevel.Info); return; } FarmAnimal farmAnimal = Game1.getFarm().getAllFarmAnimals().FirstOrDefault(x => x.Name == args[0]); if (farmAnimal == null) { this.Monitor.Log($"Could not find any FarmAnimal with \"{args[0]}\".", LogLevel.Info); return; } if (!int.TryParse(args[1], out int id)) { this.Monitor.Log("The emote id must be a integer.", LogLevel.Info); return; } if (id <= 0) { this.Monitor.Log("The emote id value must be greater than 0.", LogLevel.Info); return; } farmAnimal.doEmote(id * 4); #if DEBUG this.Monitor.Log($"[id: {farmAnimal.myID.Value}, name: \"{farmAnimal.Name}\"] Playing emote: {id}", LogLevel.Info); #else this.Monitor.Log($"[\"{farmAnimal.Name}\"] Playing emote: {id}", LogLevel.Info); #endif }
private void EmoteNpc(string command, string[] args) { if (!Context.IsMainPlayer && !Config.AllowNonHostEmoteNpcCommand) { this.Monitor.Log(I18n.Command_PermissionsDenied(), LogLevel.Info); return; } if (args.Length < 2) { this.Monitor.Log($"{I18n.Command_MissingParameters()}\n\n{I18n.Command_PlayEmoteNpc_Usage()}", LogLevel.Info); return; } NPC npc = Game1.getCharacterFromName(args[0], mustBeVillager: false); if (npc == null) { this.Monitor.Log($"Could not find any NPC with the name \"{args[0]}\".", LogLevel.Info); return; } if (!int.TryParse(args[1], out int id)) { this.Monitor.Log("The emote id must be a integer.", LogLevel.Info); return; } if (id <= 0) { this.Monitor.Log("The emote id value must be greater than 0.", LogLevel.Info); return; } npc.doEmote(id * 4); #if DEBUG this.Monitor.Log($"[id: {npc.id}, name: \"{npc.Name}\"] Playing emote: {id}", LogLevel.Info); #else this.Monitor.Log($"[\"{npc.Name}\"] Playing emote: {id}", LogLevel.Info); #endif }