public void SetVoting(bool isVoting, int duration, string durationText, AbstractEffect enabledEffect = null, string username = null) { IsVoting = isVoting; if (IsVoting) { SendMessage($"Voting has started! [{durationText}] [D:{duration}]"); effectVoting.Clear(); } else { if (enabledEffect != null) { string effectText = enabledEffect.GetDescription(); if (!string.IsNullOrEmpty(enabledEffect.Word)) { effectText = $"{ enabledEffect.Word} ({ enabledEffect.GetDescription() })"; } SendMessage($"Cooldown has started! [{durationText}] [D:{duration}] - Enabled effect [ID:{enabledEffect.Id}]: {effectText} voted by {(username ?? "GTA:SA Chaos")}"); } else { SendMessage($"Cooldown has started! [{durationText}] [D:{duration}]"); } } }
public void SetVoting(int votingMode, int untilRapidFire = -1, VotingElement votingElement = null, string username = null) { VotingMode = votingMode; if (VotingMode == 1) { effectVoting.Clear(); effectVoting.GenerateRandomEffects(); overrideEffectChoice = -1; lastChoice = -1; SendMessage("Voting has started! Type 1, 2 or 3 (or #1, #2, #3) to vote for one of the effects!"); foreach (VotingElement element in effectVoting.VotingElements) { SendMessage($"#{element.Id + 1}: {element.Effect.GetDescription()}"); } } else if (VotingMode == 2) { rapidFireVoters.Clear(); SendMessage("ATTENTION, ALL GAMERS! RAPID-FIRE HAS BEGUN! VALID EFFECTS WILL BE ENABLED FOR 15 SECONDS!"); } else { if (votingElement != null) { SendEffectVotingToGame(false); AbstractEffect effect = votingElement.Effect; string effectText = effect.GetDescription(); SendMessage($"Cooldown has started! ({untilRapidFire} until Rapid-Fire) - Enabled effect: {effectText} voted by {(username ?? "GTA:SA Chaos")}"); if (untilRapidFire == 1) { SendMessage("Rapid-Fire is coming up! Get your cheats ready! - List of all effects: https://bit.ly/gta-sa-chaos-mod"); } } else { SendMessage($"Cooldown has started! ({untilRapidFire} until Rapid-Fire)"); } } }
public void AddEffectToListBox(AbstractEffect effect) { string Description = "Invalid"; if (effect != null) { Description = effect.GetDescription(); if (!string.IsNullOrEmpty(effect.Word)) { Description += " (" + effect.Word + ")"; } } ListBox listBox = Config.Instance.IsTwitchMode ? listLastEffectsTwitch : listLastEffectsMain; listBox.Items.Insert(0, Description); if (listBox.Items.Count > 7) { listBox.Items.RemoveAt(7); } }
public bool ContainsEffect(AbstractEffect effect) { return(VotingElements.Any(e => e.Effect.GetDescription().Equals(effect.GetDescription()))); }
public EffectTreeNode(AbstractEffect effect) { Effect = effect; Name = Text = effect.GetDescription(); }