private static void AddSomeBattles() { var context = new SamuraiContext(); var battleEvents = new List <BattleEvent> { new BattleEvent { Description = "The tribe GoronsFTW initiated the first attack", Summary = "The tribe GoronsFTW won this event", TimeOfEvent = new DateTime(1430, 3, 20) } }; var battleLog = new BattleLog { Name = "Goron War log", BattleEvents = battleEvents }; var battle1 = new Battle { Name = "The Goron War", Description = "The disagreements between the leaders of the Gorons eventually led to the civil war of the Gorons", Brutal = true, StartDate = new DateTime(1430, 3, 16), EndDate = new DateTime(1432, 5, 20), BattleLog = battleLog }; context.Battles.Add(battle1); context.SaveChanges(); }
public IEnumerator Begin() { BattleLog.Write($"Card Resolution Began"); yield return(ui.BeginResolutionPhase()); ResolveNext(); }
//解析技能行为 private AbilityInput CreateAbilityInput(Ability ability) { // 非指向性技能,妲己一技能 AbilityBehavior abilityBehavior = ability.GetAbilityBehavior(); if ((abilityBehavior & AbilityBehavior.ABILITY_BEHAVIOR_NO_TARGET) != 0) { return(CreateAbilityNoTargetInput(abilityBehavior)); } // 指向性技能:妲己二技能 if ((abilityBehavior & AbilityBehavior.ABILITY_BEHAVIOR_UNIT_TARGET) != 0) { return(CreateAbilityTargetInput(abilityBehavior)); } // 点施法类型,王昭君大招 if ((abilityBehavior & AbilityBehavior.ABILITY_BEHAVIOR_POINT) != 0) { return(CreateAbilityPointInput(abilityBehavior)); } BattleLog.LogError("技能[%s]中有未定义的Input类型", ability.GetConfigName()); return(null); }
/// <summary> /// Log data about the character to the battle log, /// in case the character is still alive. /// </summary> public void LogSurvivor() { if (!Dead) { BattleLog.Save(Name + " survived with " + _hitPoints + " hit points left"); } }
public void Absorb(float bladeDamage = 0, float bluntDamage = 0, float handToHandDamage = 0, float marksmanDamage = 0, float lightningDamage = 0, float fireDamage = 0, float poisonDamage = 0, float magicDamage = 0) { var dmg = bladeDamage + bluntDamage + handToHandDamage + marksmanDamage + lightningDamage + fireDamage + poisonDamage + magicDamage; // skill experience based on damage multiplied by challenge var armorXP = Chest.TotalResistance * dmg; if (Chest.Type == ArmorType.HeavyArmor) { HeavyArmorXP += armorXP; } else if (Chest.Type == ArmorType.LightArmor) { LightArmorXP += armorXP; } Experience += (armorXP / Level) * 5; if (dmg > 0 && BattleLog != null) { BattleLog.WriteLine($"{Name} took {dmg} damage."); } HP -= dmg; if (HP < 0) { HP = 0; BattleLog?.WriteLine($"{Name} is dead!"); Dead = true; } }
public List <Enemy> Generate(int difficulty) { BattleLog.Write($"Started generating encounter of difficulty {difficulty}"); var currentDifficulty = 0; var numRemainingMustIncludes = numMustIncludes; var enemies = new List <Enemy>(); while (numRemainingMustIncludes > 0) { var nextEnemy = mustIncludePossibilities.Random(); enemies.Add(nextEnemy); BattleLog.Write($"Added \"Must Include\" {nextEnemy.Name} to Encounter"); numRemainingMustIncludes--; currentDifficulty = currentDifficulty + Math.Max(nextEnemy.PowerLevel, 1); } while (currentDifficulty < difficulty && enemies.Count < 7) { var maximum = difficulty - currentDifficulty; var nextEnemy = possible.Where( enemy => enemy.PowerLevel <= maximum ).Random(); enemies.Add(nextEnemy); BattleLog.Write($"Added {nextEnemy.Name} to Encounter"); currentDifficulty = currentDifficulty + Math.Max(nextEnemy.PowerLevel, 1); } BattleLog.Write("Finished generating encounter"); return(enemies); }
public static void AddOneBattle() { // Console.WriteLine("Starting the process of adding a battle to the database!"); const string battleName = "An Added Battle"; const string battleDescription = "Was added via the 'AddOneBattle' function in the BattleCreator Class"; const bool isBrutal = false; var today = DateTime.Now; var yesterday = today.AddDays(-1); const int numberOfBattleEvents = 10; var newBattleLog = BattleLog.CreateInstance("Battle Log Of: \n " + battleName, numberOfBattleEvents); var newBattle = Battle.CreateInstance(battleName, battleDescription, isBrutal, yesterday); newBattle.EndDate = today; newBattle.BattleLog = newBattleLog; using (var context = new SuperHeroDbContext()) { context.Battles.Add(newBattle); context.SaveChanges(); } // Console.WriteLine("Finalized the process of adding a battle to the database!"); }
public override int GetHashCode() { int hash = 1; if (Result != 0) { hash ^= Result.GetHashCode(); } if (BattleStartTimestampMs != 0L) { hash ^= BattleStartTimestampMs.GetHashCode(); } if (BattleEndTimestampMs != 0L) { hash ^= BattleEndTimestampMs.GetHashCode(); } if (BattleId.Length != 0) { hash ^= BattleId.GetHashCode(); } if (defender_ != null) { hash ^= Defender.GetHashCode(); } if (battleLog_ != null) { hash ^= BattleLog.GetHashCode(); } if (attacker_ != null) { hash ^= Attacker.GetHashCode(); } return(hash); }
public async Task <IActionResult> Edit(int id, [Bind("ID,klasa,role,log")] BattleLog battleLog) { if (id != battleLog.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(battleLog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BattleLogExists(battleLog.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(battleLog)); }
/// <summary> /// Creates the battle log in the database. /// </summary> public static async Task <BattleDb> Save(BattleLog BattleLog) { var UpdatedEntity = await GameDb.Battles.FindOneAndUpdateAsync(BattleDb => BattleDb.HighId == BattleLog.HighId && BattleDb.LowId == BattleLog.LowId, Builders <BattleDb> .Update.Set(BattleDb => BattleDb.Profile, BsonDocument.Parse(JsonConvert.SerializeObject(BattleLog, BattleDb.JsonSettings))) ); if (UpdatedEntity != null) { if (UpdatedEntity.HighId == BattleLog.HighId && UpdatedEntity.LowId == BattleLog.LowId) { return(UpdatedEntity); } else { Logging.Error(typeof(PlayerDb), "UpdatedEntity.Ids != this.Ids at Save()."); } } else { Logging.Error(typeof(PlayerDb), "UpdatedEntity == null at Save()."); } return(null); }
private static void AddSomeBattles() { var Darkwarevents = new List <BattleEvents>(); var BattleofMongolia = new BattleEvents { Description = "The final battle for the Mongolian Empire" }; Darkwarevents.Add(BattleofMongolia); var DarkwarLog = new BattleLog { Name = "Dark War Battlelog", BattleEvents = Darkwarevents }; DateTime darkwartimestart = DateTime.Parse("1573/10/12"); DateTime darkwartimesend = DateTime.Parse("1575/03/19"); var Darkwar = new Battle { Name = "The Dark War", Description = "The bloodiest war in histoy", Brutal = true, Startdate = darkwartimestart, Enddate = darkwartimesend, BattleLog = DarkwarLog }; using (var context = new SamuraiContext()) { context.Battles.Add(Darkwar); context.SaveChanges(); } }
public BattleState Init() { var id = 1; var heroes = Party.Heroes; memberNames = new string[EnemyStartingIndex + enemies.Enemies.Length + 3]; _uiTransformsById = new Dictionary <int, Transform>(); _enemiesById = new Dictionary <int, Enemy>(); for (var i = 0; i < enemies.Enemies.Length; i++) { id++; _enemiesById[id] = enemies.Enemies[i]; _uiTransformsById[id] = enemies.EnemyUiPositions[i]; memberNames[id] = enemies.Enemies[i].name; } _heroesById = new Dictionary <int, Hero>(); for (var i = 0; i < 3; i++) { id++; _heroesById[id] = heroes[i]; _uiTransformsById[id] = partyArea.UiPositions[i]; memberNames[id] = heroes[i].name; } _membersById = _heroesById.Select(h => new Member(h.Key, h.Value.name, h.Value.ClassName.Value, TeamType.Party, h.Value.Stats)) .Concat(_enemiesById.Select(e => e.Value.AsMember(e.Key))) .ToDictionary(x => x.Id, x => x); uiPositions = _uiTransformsById.Values.Select(x => x.position).ToArray(); BattleLog.Write("Finished Battle State Init"); return(this); }
public override int GetHashCode() { int hash = 1; if (Result != 0) { hash ^= Result.GetHashCode(); } if (battleLog_ != null) { hash ^= BattleLog.GetHashCode(); } if (BattleId.Length != 0) { hash ^= BattleId.GetHashCode(); } if (activeDefender_ != null) { hash ^= ActiveDefender.GetHashCode(); } if (activeAttacker_ != null) { hash ^= ActiveAttacker.GetHashCode(); } if (battleUpdate_ != null) { hash ^= BattleUpdate.GetHashCode(); } return(hash); }
public override void ReceiveDamage(int points) { int percentRoll = NumberGenerator.Next(0, 100); if (percentRoll < 50) { // Reduced damage int reducedPoints = points * 60 / 100; // Reduce by 40 % _hitPoints = _hitPoints - reducedPoints; string message = Name + " receives " + reducedPoints + " damage (REDUCED), and is down to " + _hitPoints + " hit points"; BattleLog.Save(message); } else { // Normal damage _hitPoints = _hitPoints - points; string message = Name + " receives " + points + " damage, and is down to " + _hitPoints + " hit points"; BattleLog.Save(message); } if (Dead) { BattleLog.Save(Name + " died!"); } }
private void LogProcessStep(string message) { if (logProcessSteps) { BattleLog.Write(message); } }
private void SetupEnemyEncounter() { BattleLog.Write("Setting Up Enemies"); if (state.HasCustomEnemyEncounter) { BattleLog.Write("Setting Up Custom Encounter"); state.SetupEnemyEncounter(); } if (enemyArea.Enemies.Length == 0) { BattleLog.Write("Setting Up Fallback Random Encounter"); enemyArea = enemyArea.Initialized(encounterBuilder.Generate(3)); } foreach (var enemy in enemyArea.Enemies) { if (!enemy.IsReadyForPlay) { throw new Exception($"{enemy.Name}'s is not ready for play."); } if (enemy.Deck.Cards.All(c => c.Cost.Amount > 0)) { throw new Exception($"{enemy.Name}'s Deck does not contain a 0-Cost Card."); } } }
private void StartResolvingOneCard(IPlayedCard played) { BattleLog.Write($"Began resolving {played.Card.Name}"); if (physicalZone.Count == 0) { Log.Info($"Weird Physical Zone Draw bug."); } else { physicalZone.DrawOneCard(); } var card = played.Card; if (card.Owner.IsStunnedForCard()) { BattleLog.Write($"{card.Owner.Name} was stunned, so {card.Name} does not resolve."); card.Owner.Apply(m => m.ApplyTemporaryAdditive(AdjustedStats.CreateIndefinite(new StatAddends().With(TemporalStatType.CardStun, -1), true))); WrapupCard(played, card); Message.Publish(new CardResolutionFinished()); } else { AllConditions.InitCardPlaying(battleState.GetSnapshot()); played.Perform(); WrapupCard(played, card); } }
void takeKineticDamage(int _damage) { var Shields = state.shields; var armourType = state.armourType; float shieldDefense = 0.5f; float lightArmourDefense = 1f; float mediumArmourDefense = 0.9f; float heavyArmourDefense = 0.6f; int shieldDamage = 0; int armourDamage = 0; #region Shields Remaininag if (Shields > 0) { shieldDamage = (int)(_damage * shieldDefense); state.shields = state.shields - shieldDamage; } #endregion #region No Shields Remaining else { switch (armourType) { case ArmourType.light: { armourDamage = (int)(_damage * lightArmourDefense); if (armourDamage > 0) { state.armour = state.armour - armourDamage; } } break; case ArmourType.medium: { armourDamage = (int)(_damage * mediumArmourDefense); if (armourDamage > 0) { state.armour = state.armour - armourDamage; } } break; case ArmourType.heavy: { armourDamage = (int)(_damage * heavyArmourDefense); if (armourDamage > 0) { state.armour = state.armour - armourDamage; } } break; } } #endregion BattleLog.Damage(this, "Kinetic", _damage, shieldDamage, armourDamage); }
//Starting a fight,, and determing who is winner and loser in dance off IEnumerator DoRound() { yield return(new WaitForSeconds(battlePrepTime)); //checking for no dancers on either team if (TeamA.activeDancers.Count > 0 && TeamB.activeDancers.Count > 0) { int i = Random.Range(0, TeamA.activeDancers.Count); int j = Random.Range(0, TeamB.activeDancers.Count); Character characterA = TeamA.activeDancers[i]; Character characterB = TeamB.activeDancers[j]; GameEvents.RequestFight(new FightEventData(characterA, characterB)); } else { DanceTeam winner; winner = TeamA.activeDancers.Count <= 0 ? TeamB : TeamA; GameEvents.BattleFinished(winner); winner.EnableWinEffects(); BattleLog.Log(new DefaultLogMessage("the winning team is: " + winner.troupeNameText, winner.teamColor)); //log it battlelog also //Debug.Log("DoRound called, but we have a winner so Game Over"); } }
private static void ParseModifierAura(JsonData json, AbilityData abilityData, ModifierData modifier) { modifier.Aura = GetStringValue(json, "Aura"); if (modifier.Aura != null) { modifier.Aura_Teams = GetEnumValue <MultipleTargetsTeam>(json, "Aura_Teams"); if (modifier.Aura_Teams == default) { BattleLog.LogError("技能[{0}]的Modifier[{1}]中配置了光环类型,但是Aura_Teams未找到或者配置有错误", abilityData.configFileName, modifier.Name); return; } modifier.Aura_Types = GetEnumValue <MultipleTargetsType>(json, "Aura_Types"); if (modifier.Aura_Teams == default) { BattleLog.LogError("技能[{0}]的Modifier[{1}]中配置了光环类型,但是Aura_Types未找到或者配置有错误", abilityData.configFileName, modifier.Name); return; } modifier.Aura_Radius = GetFloatValue(json, "Aura_Radius"); if (modifier.Aura_Teams == default) { BattleLog.LogError("技能[{0}]的Modifier[{1}]中配置了光环类型,但是Aura_Radius未配置", abilityData.configFileName, modifier.Name); return; } } }
// 吟唱阶段 private void OnAbilityPhaseStart() { BattleLog.Log("【吟唱阶段】OnAbilityPhaseStart" + m_AbilityData.configFileName); abilityState = AbilityState.CastPoint; ExecuteEvent(AbilityEvent.OnAbilityPhaseStart); }
public static void Apply(EffectData effectData, EffectContext ctx) { var effect = Create(effectData); BattleLog.Write($"Applying Effect of {effectData.EffectType} to {ctx.Target.MembersDescriptions()}"); effect.Apply(ctx); }
public static void AddSomeBattles() { Program.WriteHighlightedLine("Starting the process of adding multiple battle to the database!"); const int numberOfBattles = 10; const int numberOfBattleEvents = 10; using (var context = new SuperHeroDbContext()) { for (var i = 0; i < numberOfBattles; i++) { var name = $"Battle #{i}"; var description = $"Description for battle #{i}"; var isBrutal = (i % 2 == 0); var battleLog = BattleLog.CreateInstance("Battle Log Of: \n " + name, numberOfBattleEvents); var startDate = DateTime.Now; var endDate = DateTime.Now.AddDays(-1); var newBattle = Battle.CreateInstance(name, description, isBrutal, startDate); newBattle.EndDate = endDate; newBattle.BattleLog = battleLog; context.Battles.Add(newBattle); } context.SaveChanges(); } Program.WriteHighlightedLine("Finalized the process of adding a battle to the database!"); }
/// <summary> /// save the battle result to the db /// </summary> /// <param name="userHeroId"></param> /// <param name="opponentHeroId"></param> /// <param name="winnerId"></param> public void SaveDuelBattelog(int userHeroId, int opponentHeroId, int?winnerId, string userId) { var newLog = new BattleLog(); try { //mapping newLog.UserHeroId = userHeroId; newLog.OpponentHeroId = opponentHeroId; newLog.WinnerHeroId = winnerId; newLog.UserId = userId; //insert record to the db using (SuperHeroDBEntities db = new SuperHeroDBEntities()) { using (var transaction = db.Database.BeginTransaction()) { db.BattleLog.Add(newLog); db.SaveChanges(); transaction.Commit(); } } } catch (Exception) { throw; } }
private IEnumerator AwaitAnimationFinish(BattleVFX f) { yield return(new WaitForSeconds(f.DurationSeconds)); BattleLog.Write($"Finished {f.EffectName} in {f.DurationSeconds} seconds."); Message.Publish(new Finished <BattleEffectAnimationRequested>()); }
public void MyCode() { // The FIRST line of code should be BELOW this line NumberGenerator theNumberGenerator = new NumberGenerator(); BattleLog theLog = new BattleLog(); // Original battle logic (1-on-1) #region 1-on-1 battle logic Hero theHero = new Hero(theNumberGenerator, theLog, 100, 10, 30); Beast theBeast = new Beast(theNumberGenerator, theLog, 90, 10, 25); while (!theHero.Dead && !theBeast.Dead) { int damageByHero = theHero.DealDamage(); theBeast.ReceiveDamage(damageByHero); if (!theBeast.Dead) { int damageByBeast = theBeast.DealDamage(); theHero.ReceiveDamage(damageByBeast); } } theLog.PrintLog(); #endregion // New battle logic (1-on-many) #region 1-on-many battle logic theHero.Reset(); theLog.Reset(); BeastArmy theArmy = new BeastArmy(); Beast theBeast1 = new Beast(theNumberGenerator, theLog, 40, 10, 25); Beast theBeast2 = new Beast(theNumberGenerator, theLog, 20, 5, 15); Beast theBeast3 = new Beast(theNumberGenerator, theLog, 30, 8, 12); theArmy.AddBeast(theBeast1); theArmy.AddBeast(theBeast2); theArmy.AddBeast(theBeast3); while (!theHero.Dead && !theArmy.Dead) { int damageByHero = theHero.DealDamage(); theArmy.ReceiveDamage(damageByHero); if (!theArmy.Dead) { int damageByArmy = theArmy.DealDamage(); theHero.ReceiveDamage(damageByArmy); } } theLog.PrintLog(); #endregion // The LAST line of code should be ABOVE this line }
// Use this for initialization void Start() { log = GetComponent <BattleLog>(); log.setInformation(new string[] { "相手は吸血鬼だった!!", "あなたはどうする?" }); BattleSerif(); ItemSerif(); EscapeSerif(); }
/// <summary> /// Returns the amount of points a Character deals in damage. /// This damage could then be received by another character. /// Note that there is a chance that the damage is modified. /// </summary> public int DealDamage() { int damage = RandomNumberGenerator.RandomNumber(_minDamage, _maxDamage); string message = $"{Name} dealt {damage} in damage"; BattleLog.Save(message); return(damage); }
public Round(Character pc, Character npc, ArenaModifier arenaModifier, BattleLog battleLog) { this.pc = pc; this.npc = npc; this.arenaModifier = arenaModifier; this.battleLog = battleLog; dice = new Dice(); }
public static BattleLog GetInstance() { if (instance == null) { instance = new BattleLog(); } return(instance); }
public Unit(int identification, int health, int minAttack, int maxAttack, int defense, int dodgeChance, int criticalStrikeChance, int moveRange, int attackRange) { teamID = identification; isInitialized = true; unitHealth = health; unitMaxHealth = health; unitMinAttack = minAttack; unitMaxAttack = maxAttack; unitDefense = defense; unitDodgeChance = dodgeChance; unitCriticalStrikeChance = criticalStrikeChance; history = new Stack(); unitMoveRange = moveRange; unitAttackRange = attackRange; myVector = transform.position;// used for positioning. targetVector = transform.position; ratio = 0; //used for movement. healthScript = HealthBarR.GetComponent<Health>(); battleLog = GameObject.Find("BattleLog"); log = battleLog.GetComponent<BattleLog>(); }
public InsaneBalancer() { utc = DateTime.Now; startRoundTime = utc; blog = new BattleLog(this); this.maps = new Dictionary<string, string>(); //Stock maps maps.Add("mp_001", "grand_bazaar"); maps.Add("mp_003", "teheran_highway"); maps.Add("mp_007", "caspian_border"); maps.Add("mp_011", "seine_crossing"); maps.Add("mp_012", "operation_firestorm"); maps.Add("mp_013", "damavand_peak"); maps.Add("mp_017", "noshahar_canals"); maps.Add("mp_018", "kharg_island"); maps.Add("mp_subway", "operation_metro"); //Back to Karkand maps maps.Add("xp1_001", "strike_karkand"); maps.Add("xp1_002", "gulf_oman"); maps.Add("xp1_003", "sharqi_peninsula"); maps.Add("xp1_004", "wake_island"); //Close Quarters maps maps.Add("xp2_factory", "scrap_metal"); maps.Add("xp2_office", "operation_925"); maps.Add("xp2_palace", "donya_fortress"); maps.Add("xp2_skybar", "ziba_tower"); // Armoured Kill maps maps.Add("xp3_Desert", "bandar_desert"); maps.Add("xp3_Alborz", "alborz_mountain"); maps.Add("xp3_Valley", "death_valley"); maps.Add("xp3_Shield", "armoured_shield"); this.modes = new Dictionary<string, string>(); //Stock modes modes.Add("conquestlarge0", "cl"); modes.Add("conquestsmall0", "cs"); modes.Add("rushlarge0", "rl"); modes.Add("squadrush0", "sr"); modes.Add("squaddeathmatch0", "sqdm"); modes.Add("teamdeathmatch0", "tdm"); //Back to Karkand modes modes.Add("conquestassaultlarge0", "cal"); modes.Add("conquestassaultsmall0", "cas"); modes.Add("conquestassaultsmall1", "cas1"); //Close Quarters modes modes.Add("domination0", "dom"); modes.Add("gunmaster0", "gun"); modes.Add("teamdeathmatchc0", "tdmcq"); //Armored kill modes modes.Add("tanksuperiority0", "tanks"); this.players = new Dictionary<string, PlayerProfile>(); this.new_player_queue = new Dictionary<string, CPunkbusterInfo>(); this.booleanVariables = new Dictionary<string, bool>(); this.booleanVariables.Add("auto_start", true); this.booleanVariables.Add("keep_squads_live", true); this.booleanVariables.Add("keep_squads_round", true); this.booleanVariables.Add("keep_clans_live", false); this.booleanVariables.Add("keep_clans_round", false); this.booleanVariables.Add("use_white_list", false); this.booleanVariables.Add("use_extra_white_lists", false); this.booleanVariables.Add("virtual_mode", false); this.booleanVariables.Add("warn_say", true); this.booleanVariables.Add("balance_round", true); this.booleanVariables.Add("balance_live", true); this.booleanVariables.Add("kick_idle", true); this.booleanVariables.Add("wait_death", false); this.booleanVariables.Add("quiet_mode", false); this.booleanVariables.Add("advanced_mode", false); this.booleanVariables.Add("disable_team_change", false); this.integerVariables = new Dictionary<string, int>(); this.integerVariables.Add("wait_death_count", 6); this.integerVariables.Add("balance_threshold", 1); this.integerVariables.Add("debug_level", 3); this.integerVariables.Add("live_interval_time", 15); this.integerVariables.Add("round_interval", 1); this.integerVariables.Add("round_wait_time", 3); this.integerVariables.Add("warn_msg_interval_time", 15); this.integerVariables.Add("warn_msg_total_time", 15); this.integerVariables.Add("warn_msg_countdown_time", 3); this.integerVariables.Add("warn_msg_display_time", 5); this.integerVariables.Add("last_kill_time", 300); this.integerVariables.Add("last_death_time", 300); this.integerVariables.Add("last_spawn_time", 300); this.integerVariables.Add("last_chat_time", 300); this.integerVariables.Add("last_score_time", 300); this.integerVariables.Add("ticket_threshold_percent", 25); this.integerVariables.Add("ticket_threshold_max", 200); this.integerVarValidators = new Dictionary<string, integerVariableValidator>(); this.integerVarValidators.Add("warn_msg_interval_time", integerValidator); this.integerVarValidators.Add("warn_msg_total_time", integerValidator); this.integerVarValidators.Add("warn_msg_display_time", integerValidator); this.integerVarValidators.Add("warn_msg_countdown_time", integerValidator); this.integerVarValidators.Add("balance_threshold", integerValidator); this.integerVarValidators.Add("round_interval", integerValidator); this.integerVarValidators.Add("live_interval_time", integerValidator); this.integerVarValidators.Add("debug_level", integerValidator); this.integerVarValidators.Add("last_kill_time", integerValidator); this.integerVarValidators.Add("last_death_time", integerValidator); this.integerVarValidators.Add("last_spawn_time", integerValidator); this.integerVarValidators.Add("last_chat_time", integerValidator); this.integerVarValidators.Add("last_score_time", integerValidator); this.integerVarValidators.Add("ticket_threshold_percent", integerValidator); this.integerVarValidators.Add("ticket_threshold_max", integerValidator); this.integerVarValidators.Add("wait_death_count", integerValidator); /* set up per-map intervals */ List<String> map_interval = new List<string>(); foreach (KeyValuePair<String, String> mode_pair in modes) foreach (KeyValuePair<String, String> map_pair in maps) //new filter logic if (mode_pair.Value.Equals("sqdm") || mode_pair.Value.Equals("tdm") && !map_pair.Key.Contains("xp2") || mode_pair.Value.Equals("cal") && map_pair.Key.Contains("xp1") || (mode_pair.Value.Equals("sr") || mode_pair.Value.Equals("rl")) && !map_pair.Key.Contains("xp2") || (mode_pair.Value.Equals("cl") || mode_pair.Value.Equals("cs")) && !map_pair.Key.Contains("xp2") && (!map_pair.Key.Contains("xp1") || map_pair.Key.Equals("xp1_002")) || (mode_pair.Value.Equals("dom") || mode_pair.Value.Equals("gun") || mode_pair.Value.Equals("tdmcq")) && map_pair.Key.Contains("xp2") || (mode_pair.Value.Equals("tanks") && map_pair.Key.Contains("xp3")) || (mode_pair.Value.Equals("cas") || mode_pair.Value.Equals("cas1")) && map_pair.Key.Contains("xp1") && !map_pair.Key.Equals("xp1_002") ) map_interval.Add(mode_pair.Value + "_" + map_pair.Value); foreach (String name in map_interval) { this.integerVariables.Add(name, 0); this.integerVarValidators.Add(name, integerValidator); } this.booleanVarValidators = new Dictionary<string, booleanVariableValidator>(); this.booleanVarValidators.Add("keep_squads_live", booleanValidator); this.booleanVarValidators.Add("keep_squads_round", booleanValidator); this.booleanVarValidators.Add("keep_clan_live", booleanValidator); this.booleanVarValidators.Add("keep_clans_round", booleanValidator); this.booleanVarValidators.Add("use_white_list", booleanValidator); this.booleanVarValidators.Add("use_extra_white_lists", booleanValidator); this.booleanVarValidators.Add("virtual_mode", booleanValidator); this.booleanVarValidators.Add("kick_idle", booleanValidator); this.booleanVarValidators.Add("wait_death", booleanValidator); this.stringVarValidators = new Dictionary<string, stringVariableValidator>(); this.stringVarValidators.Add("round_sort", stringValidator); this.stringVarValidators.Add("live_sort", stringValidator); this.stringVarValidators.Add("console", commandValidator); this.floatVariables = new Dictionary<string, float>(); this.stringListVariables = new Dictionary<string, string>(); this.stringListVariables.Add("admin_list", @"micovery, admin2, admin3"); this.stringListVariables.Add("player_kick_wlist", "list of players that should not kicked when idle"); this.stringListVariables.Add("player_move_wlist", "list of players that should not be moved"); this.stringListVariables.Add("player_safe_wlist", "list of players that should not be kicked or moved "); this.stringListVariables.Add("clan_kick_wlist", "list of clans that should not be kicked when idle"); this.stringListVariables.Add("clan_move_wlist", "list of clans that should not be moved"); this.stringListVariables.Add("clan_safe_wlist", "list of clans that should not be kicked or moved"); this.stringVariables = new Dictionary<string, string>(); this.stringVariables.Add("round_sort", "spm_desc_round"); this.stringVariables.Add("live_sort", "time_desc_round"); this.stringVariables.Add("console", "Type a command here to test"); this.hiddenVariables = new List<string>(); //this.hiddenVariables.Add("advanced_mode"); this.hiddenVariables.Add("warn_msg_total_time"); this.hiddenVariables.Add("warn_msg_countdown_time"); this.hiddenVariables.Add("warn_msg_interval_time"); this.hiddenVariables.Add("warn_msg_display_time"); this.hiddenVariables.Add("quiet_mode"); this.hiddenVariables.Add("auto_start"); this.hiddenVariables.Add("virtual_mode"); /* Grouping settings */ this.settings_group = new Dictionary<string, List<string>>(); List<String> whitelist_group = new List<string>(); whitelist_group.Add("use_extra_white_lists"); whitelist_group.Add("player_move_wlist"); whitelist_group.Add("player_kick_wlist"); whitelist_group.Add("player_safe_wlist"); whitelist_group.Add("clan_move_wlist"); whitelist_group.Add("clan_kick_wlist"); whitelist_group.Add("clan_safe_wlist"); List<String> round_balancer_group = new List<string>(); round_balancer_group.Add("keep_clans_round"); round_balancer_group.Add("keep_squads_round"); round_balancer_group.Add("round_interval"); round_balancer_group.Add("round_wait_time"); round_balancer_group.Add("round_sort"); round_balancer_group.Add("kick_idle"); List<String> idle_watch_group = new List<string>(); idle_watch_group.Add("last_kill_time"); idle_watch_group.Add("last_death_time"); idle_watch_group.Add("last_spawn_time"); idle_watch_group.Add("last_chat_time"); idle_watch_group.Add("last_score_time"); List<String> live_balancer_group = new List<string>(); live_balancer_group.Add("keep_clans_live"); live_balancer_group.Add("keep_squads_live"); live_balancer_group.Add("live_sort"); live_balancer_group.Add("live_interval_time"); live_balancer_group.Add("warn_say"); live_balancer_group.Add("wait_death"); live_balancer_group.Add("wait_death_count"); live_balancer_group.Add("balance_threshold"); live_balancer_group.Add("ticket_threshold_percent"); live_balancer_group.Add("ticket_threshold_max"); live_balancer_group.Add("disable_team_change"); settings_group.Add("Round Interval", map_interval); settings_group.Add("Whitelist", whitelist_group); settings_group.Add("Live Balancer", live_balancer_group); settings_group.Add("Round Balancer", round_balancer_group); settings_group.Add("Idle Watch", idle_watch_group); settings_group_order = new Dictionary<string, int>(); settings_group_order.Add("Settings", 1); settings_group_order.Add("Live Balancer", 2); settings_group_order.Add("Round Balancer", 3); settings_group_order.Add("Whitelist", 4); settings_group_order.Add("Idle Watch", 5); settings_group_order.Add("Round Interval", 6); }