private void FOLLOWTHETACO_Click(object sender, EventArgs e)
        {
            List <AttackOutcome> followedTacos = new List <AttackOutcome>();

            foreach (AttackOutcome tacoToFollow in allAttacks)
            {
                AttackOutcome followedTaco = CombatScripts.RunCombat(tacoToFollow.Attacker, tacoToFollow.Defender, tacoToFollow.attackRoll, tacoToFollow.defendRoll, null);


                followedTaco.Attacker.CombatStuff.AttackNotes = followedTaco.Notes;
                followedTaco.Defender.CombatStuff.DefendNotes = followedTaco.Notes;

                followedTacos.Add(followedTaco);
            }

            CombatScripts.fatigueCharactersAndRecordCombat(followedTacos);

            foreach (AttackOutcome Whack in followedTacos)
            {
                CombatScripts.applyAttackOutcome(Whack);
            }

            EffectHolder.ClearUselessEffects();
            CombatHolder.MoveAttackingCharsToHasAttackedChars();
            if (CombatHolder._masterOfDeclarations != null)
            {
                CombatHolder._masterOfDeclarations.UpdateRTB();
            }
            CombatHolder.updateCombatDeclarations();
            AfterCrits frmCreator = new AfterCrits();

            frmCreator.Show();

            Master_Attacker frmCloser = this;

            frmCloser.Hide();
        }
        private void resolveSpells(bool updateboxes)
        {
            foreach (SpellToCast stc in spells)
            {
                foreach (Effect eff in stc.effectResult.Keys)
                {
                    EffectHolder.CreateEffect(eff, stc.effectResult[eff], false);
                }
                foreach (AttackOutcome ao in stc.weaponResult)
                {
                    CombatScripts.applyAttackOutcome(ao);
                }
                stc.caster.Stamina -= stc.spell.SpellCost;
                attemptToAddResult(stc.caster, stc);
                foreach (Character c in stc.targets)
                {
                    attemptToAddResult(c, stc);
                }
                stc.targets.Clear();
                stc.spellPower = 0;
            }
            EffectHolder.ClearUselessEffects();

            if (updateboxes)
            {
                if (CombatHolder._masterOfDeclarations != null)
                {
                    CombatHolder._masterOfDeclarations.UpdateRTB();
                }
                CombatHolder.updateCombatDeclarations();
            }

            SpellResults frmCloser = this;

            frmCloser.Hide();
        }
        private void runSingleAttack()
        {
            clearDedPeople();
            if (leftSide.Count == 0 || rightSide.Count == 0)
            {
                return;
            }
            Character attackingChar = new Character();
            Character toAttackChar  = new Character();
            bool      thereIsACharThatHasNotAttacked = false;
            bool      thereIsAnAttackingChar         = false;

            ifThisThenLeftAttacksNext = !ifThisThenLeftAttacksNext;
            foreach (Character c in leftSide.Keys)
            {
                if (!leftSide[c])
                {
                    thereIsACharThatHasNotAttacked = true;
                    break;
                }
            }
            foreach (Character c in rightSide.Keys)
            {
                if (!rightSide[c])
                {
                    thereIsACharThatHasNotAttacked = true;
                    break;
                }
            }
            if (!thereIsACharThatHasNotAttacked)
            {
                EffectHolder.ProcAndDecayEffectsForSingleChar(rightSide.Keys.Last());
                EffectHolder.ProcAndDecayEffectsForSingleChar(leftSide.Keys.Last());
                clearDedPeople();
                //c# really does make you do it this way. Iteration through a dictionary is hard for some reason
                List <Character> temp = new List <Character>();
                foreach (Character c in leftSide.Keys)
                {
                    temp.Add(c);
                }
                foreach (Character c in temp)
                {
                    leftSide[c] = false;
                }
                temp.Clear();
                foreach (Character c in rightSide.Keys)
                {
                    temp.Add(c);
                }
                foreach (Character c in temp)
                {
                    rightSide[c] = false;
                }
                if (leftSide.Count == 0 || rightSide.Count == 0)
                {
                    return;
                }
            }
            if (ifThisThenLeftAttacksNext)
            {
                foreach (Character c in leftSide.Keys)
                {
                    if (!leftSide[c])
                    {
                        attackingChar          = c;
                        thereIsAnAttackingChar = true;
                        leftSide[c]            = true;
                        break;
                    }
                }
                toAttackChar = rightSide.Keys.Last();
            }
            else
            {
                foreach (Character c in rightSide.Keys)
                {
                    if (!rightSide[c])
                    {
                        attackingChar          = c;
                        thereIsAnAttackingChar = true;
                        rightSide[c]           = true;
                        break;
                    }
                }
                toAttackChar = leftSide.Keys.Last();
            }
            if (!thereIsAnAttackingChar)
            {
                return;
            }
            AttackOutcome ao = CombatScripts.RunCombat(attackingChar, toAttackChar, Math.Round(r.NextDouble() * 20), Math.Round(r.NextDouble() * 20), null);


            if (ao.Othertext.ToString() == "Hit")
            {
                toAttackChar.HitPoints = toAttackChar.HitPoints - ao.harm;
                Effect bleed        = new Effect(EffectHolder.EffectType.Regeneration, ao.bleed * -1, -1, 0);
                Effect focus        = new Effect(EffectHolder.EffectType.Focus, ao.trauma * -1, -1, 0);
                Effect impairmentOB = new Effect(EffectHolder.EffectType.OB, ao.impairment * -1, -1, 0);
                Effect impairmentDB = new Effect(EffectHolder.EffectType.DB, ao.impairment * -1, -1, 0);
                Effect OB           = new Effect(EffectHolder.EffectType.OB, ao.disorientation * -1, ao.disorientation, 1);
                Effect DB           = new Effect(EffectHolder.EffectType.DB, ao.disorientation * -1, ao.disorientation, 1);
                EffectHolder.CreateEffect(OB, toAttackChar, false);
                EffectHolder.CreateEffect(DB, toAttackChar, false);
                EffectHolder.CreateEffect(bleed, toAttackChar, false);
                EffectHolder.CreateEffect(focus, toAttackChar, false);
                EffectHolder.CreateEffect(impairmentOB, toAttackChar, false);
                EffectHolder.CreateEffect(impairmentDB, toAttackChar, false);
                EffectHolder.ClearUselessEffects();
            }

            if (doPrinting)
            {
                richTextBoxBig.Text += attackingChar.CombatStuff.CombatName + " -> " + toAttackChar.CombatStuff.CombatName + " " + " " + ao.Othertext.ToString() + "\n";
            }

            clearDedPeople();
        }
        private void btnCastSpell_Click(object sender, EventArgs e)
        {
            if (!Utilities.ValidateComboBox(cboBoxChars.Text) || !Utilities.ValidateComboBox(cboBoxSpells.Text))
            {
                return;
            }
            if (chkBoxSecurity.Checked)
            {
                chkBoxSecurity.Checked = false;
            }
            else
            {
                return;
            }
            richTextBox1.Text = "";
            double spellPower = 0.0;

            Double.TryParse(txtBoxSpellPower.Text, out spellPower);
            double defensePower = 0.0;

            Double.TryParse(txtBoxDefenseRoll.Text, out defensePower);

            // Character c = Utilities.GetCharByName(cboBoxChars.Text); something like this needs to work eventually
            Character target = CombatHolder._inCombatChars.Find(A => A.CombatStuff.CombatName == cboBoxChars.Text);

            Character caster = new Character();

            if (cboBoxCaster.Text.Equals("Nobody"))
            {
                caster = Utilities.GetCharByName("Nobody");
                caster.CombatStuff.CombatShield = caster.Shields.First();
                caster.Stamina = CombatScripts.GetBaseStamina(caster);
                caster.CombatStuff.CombatName = "Nobody";
            }
            else
            {
                caster = CombatHolder._inCombatChars.Find(A => A.CombatStuff.CombatName == cboBoxCaster.Text);
            }


            if (target == null)  //fail
            {
                Utilities.ValidateComboBox("");
            }
            Spell s = Utilities.GetSpellByName(cboBoxSpells.Text);


            caster.Stamina -= s.SpellCost;

            Tuple <List <AttackOutcome>, List <Effect> > results = SpellScripts.castSpell(caster, target, s, spellPower, defensePower);

            foreach (Effect effMultiplied in results.Item2)
            {
                richTextBox1.Text += effMultiplied.getDisplayString();

                EffectHolder.CreateEffect(effMultiplied, target, false);
            }

            foreach (AttackOutcome outcome in results.Item1)
            {
                richTextBox1.Text += outcome.Attacker.CombatStuff.CombatName + " against " + outcome.Defender.CombatStuff.CombatName + " with " + outcome.Attacker.CombatStuff.CombatWeapon.ItemName + "\n";
                richTextBox1.Text += "Attackroll: " + outcome.attackRoll.ToString() + "\n";
                richTextBox1.Text += "Defendroll: " + outcome.defendRoll.ToString() + "\n";
                richTextBox1.Text += "Result: " + outcome.Othertext.ToString() + "\n";
                if (outcome.Othertext == Utilities.AttackResultType.Hit)
                {
                    richTextBox1.Text += "Location: " + outcome.HitLocation + "\n";
                    richTextBox1.Text += "Hit Caliber: " + Convert.ToString(outcome.HitCaliber) + "\n";
                    richTextBox1.Text += "Hit Strength: " + Convert.ToString(outcome.HitStrength) + "\n";
                    richTextBox1.Text += "Strike Power: " + Convert.ToString(outcome.TotalStrikeAmountFromAllTypes()) + "\n\n";
                    richTextBox1.Text += "Harm: " + Convert.ToString(outcome.harm) + "\n" + "Bleed: " + Convert.ToString(outcome.bleed) + "\n" + "Disorientation: " + Convert.ToString(outcome.disorientation) + "\n" + "Impairment: " + Convert.ToString(outcome.impairment) + "\n" + "Trauma: " + Convert.ToString(outcome.trauma) + "\n" + "KO: " + Convert.ToString(outcome.ko) + "\n";
                }
                richTextBox1.Text += outcome.HitLocation.ToString() + "\n\n";
                CombatScripts.applyAttackOutcome(outcome);
                EffectHolder.ClearUselessEffects();
            }
        }