public static void ParseCommand(string msg, string user, string color, string customRewardId) { if (!Config.generalParams.enableTwitchModifiers) { return; } if (customRewardId.Length == 0 && Config.generalParams.useChannelPoints) { MelonLogger.Msg("No channel points redeemed."); return; } if (msg.Substring(0, 1) == "!") { string command = msg.Replace("!", "").Split(" ".ToCharArray())[0]; string arguments = msg.Replace("!" + command + " ", ""); if (color.Length == 0) { color = "\"white\""; } float amount = ParseAmount(arguments) / 100; if (amount < 0 && command != "zoffset") { return; } if (amount > 0 || (amount < 0 && command == "zoffset")) { if (command == "speed") { if (amount == 1f) { return; } CommandManager.RegisterModifier(ModifierType.Speed, amount, user, color); } else if (command == "aa") { CommandManager.RegisterModifier(ModifierType.AA, amount, user, color); } else if (command == "psy") { CommandManager.RegisterModifier(ModifierType.Psychedelia, amount, user, color); } else if (command == "womble") { if (amount == 1f) { return; } CommandManager.RegisterModifier(ModifierType.Wobble, amount, user, color); } else if (command == "particles") { CommandManager.RegisterModifier(ModifierType.Particles, amount, user, color); } else if (command == "zoffset") { if (amount == 0) { return; } CommandManager.RegisterModifier(ModifierType.ZOffset, amount, user, color); } else if (command == "scale") { CommandManager.RegisterModifier(ModifierType.Scale, amount, user, color); } else if (command == "stutterchains") { CommandManager.RegisterModifier(ModifierType.StutterChains, amount, user, color); } } else { if (command == "mines") { CommandManager.RegisterModifier(ModifierType.Mines, user, color); } else if (command == "invisguns") { CommandManager.RegisterModifier(ModifierType.InvisGuns, user, color); } else if (command == "wobble") { CommandManager.RegisterModifier(ModifierType.Wobble, user, color); } else if (command == "wooble") { CommandManager.RegisterModifier(ModifierType.Wobble, -2, user, color); } else if (command == "wrobl") { CommandManager.RegisterModifier(ModifierType.Wobble, -3, user, color); } else if (command == "randomoffset") { CommandManager.RegisterModifier(ModifierType.RandomOffset, user, color); } else if (command == "bettermelees") { CommandManager.RegisterModifier(ModifierType.BetterMelees, user, color); } else if (command == "randomcolors") { CommandManager.RegisterModifier(ModifierType.RandomColors, user, color); } else if (command == "colorswap") { CommandManager.RegisterModifier(ModifierType.ColorSwap, user, color); } else if (command == "streammode") { CommandManager.RegisterModifier(ModifierType.StreamMode, user, color); } else if (command == "hiddenteles") { CommandManager.RegisterModifier(ModifierType.HiddenTelegraphs, user, color); } else if (command == "unifycolors") { CommandManager.RegisterModifier(ModifierType.UnifyColors, user, color); } else if (command == "rtxon") { CommandManager.RegisterModifier(ModifierType.TimingAttack, user, color); } else if (command == "dropnuke") { //CommandManager.RegisterModifier(ModifierType.Nuke, user, color); } else if (command == "lightshow") { //CommandManager.RegisterModifier(ModifierType.BopMode, user, color); } } } }
public static void ParseCommand(string msg, string user, string color) { if (!Config.generalParams.enableTwitchModifiers) { return; } if (msg.Substring(0, 1) == "!") { string command = msg.Replace("!", "").Split(" ".ToCharArray())[0]; string arguments = msg.Replace("!" + command + " ", ""); float amount = ParseAmount(arguments) / 100; if (amount < 0 && command != "zoffset") { return; } if (amount > 0) { if (command == "speed") { CommandManager.RegisterModifier(ModifierType.Speed, amount, user, color); } else if (command == "aa") { CommandManager.RegisterModifier(ModifierType.AA, amount, user, color); } else if (command == "psy") { CommandManager.RegisterModifier(ModifierType.Psychedelia, amount, user, color); } else if (command == "womble") { CommandManager.RegisterModifier(ModifierType.Wobble, amount, user, color); } else if (command == "particles") { CommandManager.RegisterModifier(ModifierType.Particles, amount, user, color); } else if (command == "zoffset") { CommandManager.RegisterModifier(ModifierType.ZOffset, amount, user, color); } else if (command == "scale") { CommandManager.RegisterModifier(ModifierType.Scale, amount, user, color); } } else { if (command == "mines") { CommandManager.RegisterModifier(ModifierType.Mines, user, color); } else if (command == "invisguns") { CommandManager.RegisterModifier(ModifierType.InvisGuns, user, color); } else if (command == "wobble") { CommandManager.RegisterModifier(ModifierType.Wobble, user, color); } else if (command == "wooble") { CommandManager.RegisterModifier(ModifierType.Wobble, -2, user, color); } else if (command == "wrobl") { CommandManager.RegisterModifier(ModifierType.Wobble, -3, user, color); } else if (command == "randomoffset") { CommandManager.RegisterModifier(ModifierType.RandomOffset, user, color); } else if (command == "bettermelees") { CommandManager.RegisterModifier(ModifierType.BetterMelees, user, color); } else if (command == "randomcolors") { CommandManager.RegisterModifier(ModifierType.RandomColors, user, color); } else if (command == "colorswap") { CommandManager.RegisterModifier(ModifierType.ColorSwap, user, color); } else if (command == "streammode") { CommandManager.RegisterModifier(ModifierType.StreamMode, amount, user, color); } else if (command == "hiddenteles") { CommandManager.RegisterModifier(ModifierType.HiddenTelegraphs, user, color); } else if (command == "unifycolors") { CommandManager.RegisterModifier(ModifierType.UnifyColors, user, color); } else if (command == "rtxon") { CommandManager.RegisterModifier(ModifierType.TimingAttack, user, color); } else if (command == "dropnuke") { CommandManager.RegisterModifier(ModifierType.Nuke, user, color); } } } }