code:
package classes.Scenes.Combat
{
	import classes.*;
	import classes.BodyParts.*;
	import classes.GlobalFlags.*;
	import classes.Items.*;
	import classes.Items.Weapons.WeaponWithPerk;
	import classes.lists.*;
	import classes.Scenes.Areas.Forest.Akbal;
	import classes.Scenes.Areas.Forest.AkbalUnsealed;
	import classes.Scenes.Areas.Forest.Dullahan;
	import classes.Scenes.Areas.Forest.DullahanHorse;
	import classes.Scenes.Areas.Forest.TentacleBeast;
	import classes.Scenes.Areas.GlacialRift.FrostGiant;
	import classes.Scenes.Areas.VolcanicCrag;
	import classes.Scenes.Dungeons.WizardTower.ArchInquisitorVilkus;
	import classes.Scenes.Areas.VolcanicCrag.VolcanicGolem;
	import classes.Scenes.Dungeons.DeepCave.*;
	import classes.Scenes.Dungeons.HelDungeon.*;
	import classes.Scenes.Dungeons.LethicesKeep.*;
	import classes.Scenes.Monsters.Mimic;
	import classes.Scenes.NPCs.*;
	import classes.StatusEffects.*;
	import classes.StatusEffects.Combat.*;

	import flash.events.TimerEvent;
	import flash.utils.Timer
	public class CombatAbilities extends BaseContent
	{
		public function CombatAbilities() {
		}

		public var allAbilities:Vector.<CombatAbility> = new Vector.<CombatAbility>;
		public var magicSpells:Vector.<CombatAbility> = new Vector.<CombatAbility>;
		public var physicalAbilities:Vector.<CombatAbility> = new Vector.<CombatAbility>;
		public var magicAbilities:Vector.<CombatAbility> = new Vector.<CombatAbility>;
		//------------
		// SPELLS
		//------------
		public var fireMagicLastTurn:int = -100;
		public var fireMagicCumulated:int = 0;
		public var currDamage:Number = 0; //making damage a public variable opens some possibilities.

		//UTILS
		public function canUseMagic():Boolean {
			if (player.isSilenced) return false;
			if (player.hasStatusEffect(StatusEffects.ThroatPunch)) return false;
			if (player.hasStatusEffect(StatusEffects.WebSilence)) return false;
			if (player.hasStatusEffect(StatusEffects.GooArmorSilence)) return false;
			if (player.hasStatusEffect(StatusEffects.SentinelOmniSilence)) return false;
			if (player.hasStatusEffect(StatusEffects.WhipSilence)) return false;
			return true;
		}

		/**
		 * remember that this function calculates whether or not the >monster< succeeded in avoiding damage. So for a success on the player's side, use combatAvoidDamage(def).failed.
		 * @param	doDodge
		 * @param	doParry
		 * @param	doBlock
		 * @param	doFatigue
		 * @param	toHitChance
		 * @param   customReactions an array with custom reactions for each possible avoidance case. Tag each string accordingly with [EVADE],[SPEED],[MISDIRECTION],[UNHANDLEDDODGE],[BLOCK],[PARRY], etc.
		 * @return
		 */
		public function combatAvoidDamage(def:*):Object{
			def.attacker = player;
			def.defender = monster;
			return combat.combatAvoidDamage(def);
		}

		public function canUseMAtk():Boolean {
			if (player.isUnfocused) return false;
			if (player.hasStatusEffect(StatusEffects.SentinelOmniSilence)) return false;
			return true;
		}

		public function canUsePAtk():Boolean{
			if (player.isCrippled) return false;
			if (player.hasStatusEffect(StatusEffects.SentinelPhysicalDisabled) || player.hasStatusEffect(StatusEffects.PhysicalDisabled)) return false;
			return true;
		}

		public function getWhiteMagicLustCap():Number {
			var whiteLustCap:Number = player.maxLust() * 0.75;
			if (player.findPerk(PerkLib.Enlightened) >= 0 && player.isPureEnough(10)) whiteLustCap += (player.maxLust() * 0.1);
			if (player.findPerk(PerkLib.FocusedMind) >= 0) whiteLustCap += (player.maxLust() * 0.1);
			return whiteLustCap;
		}

		public function isExhausted(cost:int):Boolean {
			if (player.findPerk(PerkLib.BloodMage) < 0 && player.fatigue + player.spellCost(cost) > player.maxFatigue()) {
				outputText("You are too tired to cast this spell.");
				doNext(magicMenu);
				return true;
			}
			else {
				return false;
			}
		}

		//MENU
		public function magicMenu():void {
			if (combat.inCombat && player.hasStatusEffect(StatusEffects.Sealed) && player.statusEffectv2(StatusEffects.Sealed) == 2) {
				clearOutput();
				outputText("You reach for your magic, but you just can't manage the focus necessary.  Your ability to use magic was sealed, and now you've wasted a chance to attack!\n\n");
				combat.startMonsterTurn();
				return;
			}
			menu();
			clearOutput();
			var btnData:Array = new Array();
			var tempData:*;
			outputText("What spell will you use?\n\n");
			for each (var ability:CombatAbility in magicSpells) {
				tempData = ability.makeButtonData()
				if (tempData != null) btnData.push(tempData);
			}
			output.generateMenu(btnData, curry(combat.combatMenu, false));
		}

		//WHITE SPELLS
		//(15) Charge Weapon – boosts your weapon attack value by 10 * player.spellMod till the end of combat.

		public function chargeWeaponCalc():Number{
			return Math.round(10 * player.spellMod() * (player.hasPerk(PerkLib.ArcaneSmithing) ? player.perkv1(PerkLib.ArcaneSmithing) : 1));
		}
		public function spellChargeWeapon(silent:Boolean = false):void {
			if (silent) {
				player.createStatusEffect(StatusEffects.ChargeWeapon,chargeWeaponCalc(),0,0,0);
				statScreenRefresh();
				return;
			}
			outputText("You utter words of power, summoning an electrical charge around your " + player.weaponName + ".  It crackles loudly, ensuring you'll do more damage with it for the rest of the fight.\n\n");
			var temp:int = chargeWeaponCalc();
			if (temp > 100) temp = 100;
			player.createStatusEffect(StatusEffects.ChargeWeapon, temp, 0, 0, 0);
			combat.startMonsterTurn();
		}

		//(20) Blind – reduces your opponent's accuracy, giving an additional 50% miss chance to physical attacks.
		public function spellBlind():void {
			outputText("You glare at " + monster.a + monster.short + " and point at " + monster.pronoun2 + ".  A bright flash erupts before " + monster.pronoun2 + "!\n");
			for each(var currMonster:Monster in monsterArray) spellBlindExec(currMonster);
		combat.startMonsterTurn();
		}

		public function spellBlindExec(target:Monster):void{
			if (!target.react(target.CON_BLINDED)) return;
			else if (rand(3) != 0) {
				outputText(" " + target.capitalA + target.short + " ");
				if (target.plural && target.short != "imp horde") outputText("are blinded!");
				else outputText("is blinded!");
                target.createStatusEffect(StatusEffects.Blind, 5 * player.spellMod(), 0, 0, 0);
			}
			else outputText(target.capitalA + target.short + " blinked!");
			outputText("\n\n");
		}
		//Adding this so I can use and increment the bonus with or without output text
		private function boostInferno(output:Boolean = true):void {
			if (player.findPerk(PerkLib.RagingInferno) >= 0) {
				if (combat.combatRound - fireMagicLastTurn == 1) {
					fireMagicCumulated++;
					if (output) outputText("Traces of your previously used fire magic are still here, and you use them to empower your spell!\n");
				}
				else {
					fireMagicCumulated = 1;
					if (output && fireMagicLastTurn > 0) outputText("Unfortunately, traces of your previously used fire magic are too weak to be used.\n");
				}
				fireMagicLastTurn = combat.combatRound;
			}
		}
		private function calcInfernoMod(damage:Number,display:Boolean = false):int {
			if (player.findPerk(PerkLib.RagingInferno) >= 0) {
				var multiplier:Number = 1;
				if (combat.combatRound - fireMagicLastTurn == 1) {
					if(!display) outputText("Traces of your previously used fire magic are still here, and you use them to empower your spell!");
					switch(fireMagicCumulated) {
						case 0:
						case 1:
							multiplier = 1.2;
							break;
						case 2:
							multiplier = 1.35;
							break;
						case 3:
							multiplier = 1.45;
							break;
						default:
							multiplier = 1.5 + ((fireMagicCumulated - 5) * 0.05); //Diminishing returns at max, add 0.05 to multiplier.
					}
					damage = Math.round(damage * multiplier);
					if (!display) fireMagicCumulated++;
					// XXX: Message?
				} else if (!display) {
					if (fireMagicLastTurn > 0) outputText("Unfortunately, traces of your previously used fire magic are too weak to be used.");
						fireMagicCumulated = 1;
				}
				if(!display)fireMagicLastTurn = combat.combatRound;
			}
			return damage;
		}

		//(30) Whitefire – burns the enemy for 10 + int/3 + rand(int/2) * player.spellMod.
		public function whiteFireDamage(display:Boolean = false,maxDamageDisplay:Boolean = false):Number{
			var damage:Number = int((10 + (player.inte/3 + (display ? 0 : rand(player.inte / 2))) + (maxDamageDisplay ? player.inte/2 : 0)) * player.spellMod());
			damage = calcInfernoMod(damage, display);
			damage = Math.round(damage * monster.fireRes);
			return combat.globalMod(damage);
		}

		public function spellWhitefire():void {
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			if (monster is Doppelganger)
			{
				(monster as Doppelganger).handleSpellResistance("whitefire");
				return;
			}
			outputText("You narrow your eyes, focusing your mind with deadly intent.  You snap your fingers and " + monster.a + monster.short + " is enveloped in a flash of white flames!\n");
			currDamage = whiteFireDamage();
			if (monster is ArchInquisitorVilkus && temp > 250 && (monster as ArchInquisitorVilkus).nextAction == 1 ){
				outputText("Your spell overpowers the Inquisitor's, and its magical energy is absorbed into yours, for an extremely effective attack!");
				(monster as ArchInquisitorVilkus).nextAction = 0;
				temp += rand(200);
			}
			if (monster.react(monster.CON_BURNED)) currDamage = combat.doDamage(currDamage,true,true);

			outputText("\n\n");
			combat.startMonsterTurn();

		}

		//BLACK SPELLS

		public function arouseCalc(display:Boolean = false,maxDamage:Boolean = false):Number{
			if (display){
				if (maxDamage) return Math.max(monster.lustVuln * (player.inte / 5 * player.spellMod() + (monster.lib - monster.inte * 2 + monster.cor) / 5),monster.lustVuln * (player.inte * player.spellMod())/5);
				else return Math.min(monster.lustVuln * (player.inte / 5 * player.spellMod() + (monster.lib - monster.inte * 2 + monster.cor) / 5),monster.lustVuln * (player.inte * player.spellMod())/5);
			}
			return monster.lustVuln * (player.inte / 5 * player.spellMod() + rand(monster.lib - monster.inte * 2 + monster.cor) / 5);
		}

		public function spellArouse():void {
			doNext(combat.combatMenu);
		//This is now automatic - newRound arg defaults to true:	menuLoc = 0;
			statScreenRefresh();
			outputText("You make a series of arcane gestures, drawing on your own lust to inflict it upon your foe!\n");
			//Worms be immune
			if (monster.short == "worms") {
				outputText("The worms appear to be unaffected by your magic!");
				outputText("\n\n");
				combat.startMonsterTurn();
				return;
			}
			if (monster.lustVuln == 0) {
				outputText("It has no effect!  Your foe clearly does not experience lust in the same way as you.\n\n");
				combat.startMonsterTurn();
				return;
			}
			var lustDmg:Number = arouseCalc();
			if (monster.lust100 < 30) outputText(monster.capitalA + monster.short + " squirms as the magic affects " + monster.pronoun2 + ".  ");
			if (monster.lust100 >= 30 && monster.lust100 < 60) {
				if (monster.plural) outputText(monster.capitalA + monster.short + " stagger, suddenly weak and having trouble focusing on staying upright.  ");
				else outputText(monster.capitalA + monster.short + " staggers, suddenly weak and having trouble focusing on staying upright.  ");
			}
			if (monster.lust100 >= 60) {
				if(!(monster is Dullahan)){
				outputText(monster.capitalA + monster.short + "'");
				if (!monster.plural) outputText("s");
				outputText(" eyes glaze over with desire for a moment.  ");
				}else{
				outputText("Oddly enough, while the Dullahan's gaze is still cold and focused, her body is trembling with desire.");
				}
			}
			if (monster.cocks.length > 0) {
				if (monster.lust100 >= 60 && monster.cocks.length > 0) outputText("You see " + monster.pronoun3 + " " + monster.multiCockDescriptLight() + " dribble pre-cum.  ");
				if (monster.lust100 >= 30 && monster.lust100 < 60 && monster.cocks.length == 1) outputText(monster.capitalA + monster.short + "'s " + monster.cockDescriptShort(0) + " hardens, distracting " + monster.pronoun2 + " further.  ");
				if (monster.lust100 >= 30 && monster.lust100 < 60 && monster.cocks.length > 1) outputText("You see " + monster.pronoun3 + " " + monster.multiCockDescriptLight() + " harden uncomfortably.  ");
			}
			if (monster.vaginas.length > 0) {
				if (monster.plural) {
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_NORMAL) outputText(monster.capitalA + monster.short + "'s " + monster.vaginaDescript() + "s dampen perceptibly.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_WET) outputText(monster.capitalA + monster.short + "'s crotches become sticky with girl-lust.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_SLICK) outputText(monster.capitalA + monster.short + "'s " + monster.vaginaDescript() + "s become sloppy and wet.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_DROOLING) outputText("Thick runners of girl-lube stream down the insides of " + monster.a + monster.short + "'s thighs.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_SLAVERING) outputText(monster.capitalA + monster.short + "'s " + monster.vaginaDescript() + "s instantly soak " + monster.pronoun2 + " groin.  ");
				}
				else {
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_NORMAL) outputText(monster.capitalA + monster.short + "'s " + monster.vaginaDescript() + " dampens perceptibly.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_WET) outputText(monster.capitalA + monster.short + "'s crotch becomes sticky with girl-lust.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_SLICK) outputText(monster.capitalA + monster.short + "'s " + monster.vaginaDescript() + " becomes sloppy and wet.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_DROOLING) outputText("Thick runners of girl-lube stream down the insides of " + monster.a + monster.short + "'s thighs.  ");
					if (monster.lust100 >= 60 && monster.vaginas[0].vaginalWetness == Vagina.WETNESS_SLAVERING) outputText(monster.capitalA + monster.short + "'s " + monster.vaginaDescript() + " instantly soaks her groin.  ");
				}
			}
			if (monster is ArchInquisitorVilkus && temp > 30 && (monster as ArchInquisitorVilkus).nextAction == 3){
				outputText("\nYour spell overpowers the Inquisitor's, and its magical energy is absorbed into yours, for an extremely effective attack!");
				(monster as ArchInquisitorVilkus).nextAction = 0;
				lustDmg += 5 + rand(20);
			}
			monster.teased(lustDmg);
			outputText("\n\n");
			combat.startMonsterTurn();
			return;
		}

		public function healCalc(display:Boolean = false, maxHeal:Boolean = false):Number{
			int((player.level + (player.inte / 1.5) + rand(player.inte)) * player.spellMod());
			if (display){
				if (maxHeal) return int((player.level + (player.inte / 1.5) + player.inte) * player.spellMod());
				else return int((player.level + (player.inte / 1.5)) * player.spellMod());
			}
			return int((player.level + (player.inte / 1.5) + rand(player.inte)) * player.spellMod());
		}
		public function spellHeal():void {
			clearOutput();
			outputText("You focus on your body and its desire to end pain, trying to draw on your arousal without enhancing it.\n");
			//25% backfire!
			var backfire:int = 25;
			if (player.findPerk(PerkLib.FocusedMind) >= 0) backfire = 15;
			if (rand(100) < backfire) {
				outputText("An errant sexual thought crosses your mind, and you lose control of the spell!  Your ");
				if (player.gender == 0) outputText(player.assholeDescript() + " tingles with a desire to be filled as your libido spins out of control.");
				if (player.gender == 1) {
					if (player.cockTotal() == 1) outputText(player.cockDescript(0) + " twitches obscenely and drips with pre-cum as your libido spins out of control.");
					else outputText(player.multiCockDescriptLight() + " twitch obscenely and drip with pre-cum as your libido spins out of control.");
				}
				if (player.gender == 2) outputText(player.vaginaDescript(0) + " becomes puffy, hot, and ready to be touched as the magic diverts into it.");
				if (player.gender == 3) outputText(player.vaginaDescript(0) + " and " + player.multiCockDescriptLight() + " overfill with blood, becoming puffy and incredibly sensitive as the magic focuses on them.");
				dynStats("lib", .25, "lus", 15);
			}
			else {
				temp = healCalc();
				outputText("You flush with success as your wounds begin to knit. ");
				player.HPChange(temp, true);
			}

			outputText("\n\n");
			combat.startMonsterTurn();
			return;
		}

		//(25) Might – increases strength/toughness by 5 * player.spellMod, up to a
		//maximum of 15, allows it to exceed the maximum.  Chance of backfiring
		//and increasing lust by 15.
		public function mightCalc(display:Boolean = false):Number{
			return Math.round(10 * player.spellMod());
		}

		public function spellMight(silent:Boolean = false):void {
			if (silent)	{ // for Battlemage
				player.createStatusEffect(StatusEffects.Might, mightCalc(), 0, 0, 0);
				return;
			}
			outputText("You flush, drawing on your body's desires to empower your muscles and toughen you up.\n\n");
			//25% backfire!
			var backfire:int = 25;
			if (player.findPerk(PerkLib.FocusedMind) >= 0) backfire = 15;
			if (rand(100) < backfire) {
				outputText("An errant sexual thought crosses your mind, and you lose control of the spell!  Your ");
				if (player.gender == 0) outputText(player.assholeDescript() + " tingles with a desire to be filled as your libido spins out of control.");
				if (player.gender == 1) {
					if (player.cockTotal() == 1) outputText(player.cockDescript(0) + " twitches obscenely and drips with pre-cum as your libido spins out of control.");
					else outputText(player.multiCockDescriptLight() + " twitch obscenely and drip with pre-cum as your libido spins out of control.");
				}
				if (player.gender == 2) outputText(player.vaginaDescript(0) + " becomes puffy, hot, and ready to be touched as the magic diverts into it.");
				if (player.gender == 3) outputText(player.vaginaDescript(0) + " and " + player.multiCockDescriptLight() + " overfill with blood, becoming puffy and incredibly sensitive as the magic focuses on them.");
				dynStats("lib", .25, "lus", 15);
			}
			else {
				outputText("The rush of success and power flows through your body.  You feel like you can do anything!");
				player.createStatusEffect(StatusEffects.Might, mightCalc(), 0, 0, 0);
			}
			outputText("\n\n");
			combat.startMonsterTurn();
			return;
		}

		//Blackfire. A stronger but more costly version of Whitefire.
		public function blackfireDamage(display:Boolean = false,maxDamageDisplay:Boolean = false):Number{
			var damage:Number = int((30 + (player.inte / 3 + (display ? 0 : rand(player.inte / 2))) + (maxDamageDisplay ? player.inte/2 : 0)) * player.spellMod());
			damage = calcInfernoMod(damage,display);
			damage = Math.round(damage * monster.fireRes);
			return combat.globalMod(damage);
		}

		public function spellBlackfire():void {
			clearOutput();
			doNext(combat.combatMenu);
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			if (monster is Doppelganger)
			{
				(monster as Doppelganger).handleSpellResistance("blackfire");
				return;
			}
			//Backfire calculation
			var backfire:int = 25;
			if (player.findPerk(PerkLib.FocusedMind) >= 0) backfire = 15;
			if (rand(100) < backfire) {
				clearOutput();
				outputText("You narrow your eyes, channeling your lust with deadly intent. An errant sexual thought crosses your mind, and you lose control of the spell! Your ");
				if (player.gender == 0) outputText(player.assholeDescript() + " tingles with a desire to be filled as your libido spins out of control.");
				if (player.gender == 1) {
					if (player.cockTotal() == 1) outputText(player.cockDescript(0) + " twitches obscenely and drips with pre-cum as your libido spins out of control.");
					else outputText(player.multiCockDescriptLight() + " twitch obscenely and drip with pre-cum as your libido spins out of control.");
				}
				if (player.gender == 2) outputText(player.vaginaDescript(0) + " becomes puffy, hot, and ready to be touched as the magic diverts into it.");
				if (player.gender == 3) outputText(player.vaginaDescript(0) + " and " + player.multiCockDescriptLight() + " overfill with blood, becoming puffy and incredibly sensitive as the magic focuses on them.");
				outputText("\n\n");
				dynStats("lib", 1, "lus", (rand(20) + 15)); //Git gud
			}
			else {
				clearOutput();
				outputText("You narrow your eyes, channeling your lust with deadly intent. You snap your fingers and " + monster.a + monster.short + " is enveloped in a flash of black and purple flames!\n");
				currDamage = int(blackfireDamage());
				if (monster is VolcanicGolem){
					outputText("The flames don't seem to bother the fiery golem too much, although the magical nature of your attack prevents it from being resisted entirely.\n\n");
				}
				if (monster is ArchInquisitorVilkus && temp > 250 && (monster as ArchInquisitorVilkus).nextAction == 1 ){
				outputText("Your spell overpowers the Inquisitor's, and its magical energy is absorbed into yours, for an extremely effective attack!");
				(monster as ArchInquisitorVilkus).nextAction = 0;
				currDamage += rand(200);
				}
				currDamage = combat.doDamage(currDamage,true,true);
				//Using fire attacks on the goo]
				if (monster.short == "goo-girl") {
					outputText("  Your flames lick the girl's body and she opens her mouth in pained protest as you evaporate much of her moisture. When the fire passes, she seems a bit smaller and her slimy " + monster.skin.tone + " skin has lost some of its shimmer.");
					if (monster.findPerk(PerkLib.Acid) < 0) monster.createPerk(PerkLib.Acid,0,0,0,0);
				}
				if (monster.short == "Holli" && !monster.hasStatusEffect(StatusEffects.HolliBurning)) (monster as Holli).lightHolliOnFireMagically();
				outputText("\n\n");
			}
			combat.startMonsterTurn();
		}

		//SPECIAL SPELLS
		public function calcGrayMagicMod():Number{//Gray magic gets more powerful the closer you are to exactly 50% lust. 30% more power at maximum.
			var coef:Number = -100 * (player.maxLust() ^ 2);
			var mult:Number = Math.pow(player.lust, 2) - (player.maxLust() * player.lust);
			mult *= 1 / coef;
			return 1 + int((mult)*100)/100;

		}

		public function tkBlastCalc(minDamage:Boolean = false, maxDamageDisplay:Boolean = false):Number{
			var damage:Number = int(15 + (player.inte / 2 + (minDamage ? 0 : rand(player.inte / 2)) + (maxDamageDisplay ? player.inte / 2 : 0)) * player.spellMod() * calcGrayMagicMod());
			damage = combat.globalMod(damage);
			if(minDamage) return monster.reduceDamageMin(damage);
			if(maxDamageDisplay) return monster.reduceDamageMax(damage);
 			return monster.reduceDamageCombat(damage);
		}

		public function spellTKBlast():void {
			clearOutput();
			doNext(combat.combatMenu);
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			outputText("You raise your hand, as if grasping some invisible orb. After a few moments, you swing your arm in a wide arc, unleashing a great wave of telekinetic force against your foe!\n");
			currDamage = tkBlastCalc();
			combat.doDamage(currDamage,true,true);
			outputText("\n\n");
			if (monster.stun(0,rand(player.inte),monster.str)){
				outputText("Your telekinetic blast proves too strong for your foe, leaving it staggered!\n\n");
			}
			combat.startMonsterTurn();
		}

		public function leechCalc():Number{
			 return 2 * player.spellMod() * calcGrayMagicMod() * (player.hasPerk(PerkLib.ArcaneSmithing) ? player.perkv1(PerkLib.ArcaneSmithing) : 1);
		}
		public function spellLeech():void {
			outputText("You whisper a series of arcane incantations while hovering one hand over your [weapon]. It glows with a faint green light, signaling that your spell worked.\n\n");
			player.createStatusEffect(StatusEffects.Leeching, leechCalc(), 4, 0, 0);
			combat.startMonsterTurn();
		}

		public function cleansingPalmCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			var corruptionMulti:Number = (monster.cor - 20) / 25;
			if (corruptionMulti > 1.5) {
				corruptionMulti = 1.5;
				corruptionMulti += ((monster.cor - 57.5) / 100); //The increase to multiplier is diminished.
			}

			if (display){
				if (maxDamage) return combat.globalMod((player.inte / 4 + (player.inte / 3)) * (player.spellMod() * corruptionMulti));
				else return combat.globalMod((player.inte / 4) * (player.spellMod() * corruptionMulti));
			}

			return combat.globalMod((player.inte / 4 + rand(player.inte / 3)) * (player.spellMod() * corruptionMulti));
		}

		public function spellCleansingPalm():void
		{
			doNext(combat.combatMenu);
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			if (monster.short == "Jojo")
			{
				// Not a completely corrupted monkmouse
				if (flags[kFLAGS.JOJO_STATUS] < 2)
				{
					outputText("You thrust your palm forward, sending a blast of pure energy towards Jojo. At the last second he sends a blast of his own against yours canceling it out.");
					player.masteryXP(MasteryLib.Casting, 2+rand(7));
					combat.startMonsterTurn();
					return;
				}
			}

			if (monster is LivingStatue)
			{
				outputText("You thrust your palm forward, causing a blast of pure energy to slam against the giant stone statue- to no effect!");
				combat.startMonsterTurn();
				return;
			}

			currDamage = cleansingPalmCalc();

			if (currDamage > 0)
			{
				outputText("You thrust your palm forward, causing a blast of pure energy to slam against " + monster.a + monster.short + ", tossing");
				if ((monster as Monster).plural == true) outputText(" them");
				else outputText((monster as Monster).mfn(" him", " her", " it"));
				outputText(" back a few feet.");
				//if (silly() && corruptionMulti >= 1.75) outputText("It's super effective!  ");
			}
			else
			{
				currDamage = 0;
				outputText("You thrust your palm forward, causing a blast of pure energy to slam against " + monster.a + monster.short + ", which they ignore. It is probably best you don’t use this technique against the pure.");
			}

			combat.doDamage(currDamage, true, true);
			outputText("\n\n");
			statScreenRefresh();
			combat.startMonsterTurn();
		}

		public function updateCooldowns():void{
			for each (var abilitySet:Vector.<CombatAbility> in [magicSpells, physicalAbilities, magicAbilities]){
				for each (var ability:CombatAbility in abilitySet){
					if ((ability.currCooldown < ability.cooldown) && ability.cooldown != 0) ability.currCooldown += 1;
				}
			}
		}

		public function setSpells():void{
		magicSpells = new Vector.<CombatAbility>;
		magicSpells.push(new CombatAbility({
				abilityFunc: spellChargeWeapon,
				cost: 15,
				tooltip: function ():String {
											return "The Charge Weapon spell will surround your weapon in electrical energy, causing it to deal " + chargeWeaponCalc()  + " extra damage.  The effect lasts for the entire combat.";
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsCharge);
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.ChargeWeapon);
										},
				disabledTooltip: "Charge weapon is already active and cannot be cast again.\n\n",
				spellName: "Charge Weapon",
				spellShort: "Charge W.",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.WHITE_MAGIC,
				color: BtnCol.MAGIC_WHITE
		}),
		new CombatAbility({
				abilityFunc: spellBlind,
				cost: 20,
				cooldown: 3,
				tooltip: "Blind is a fairly self-explanatory spell. It will create a bright flash just in front of the victim's eyes, blinding them for a time. However, it will be wasted if they blink.",
				availableWhen: function ():Boolean {
					return player.hasStatusEffect(StatusEffects.KnowsBlind);
					},
				disabledWhen: function ():Boolean{
					return monster.hasStatusEffect(StatusEffects.KnowsBlind);
					},
				disabledTooltip: "" + monster.capitalA + monster.short + " is already affected by blind.\n\n",
				spellName: "Blind",
				spellShort: "Blind",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.WHITE_MAGIC,
				color: BtnCol.MAGIC_WHITE
			}),
		new CombatAbility({
				abilityFunc: spellWhitefire,
				cost: 30,
				cooldown: 3,
				tooltip: function ():String {
							return "Whitefire is a potent fire based attack that will burn your foe with flickering white flames, ignoring their physical toughness and most armors. (" + Math.round(whiteFireDamage(true)) + "-" +Math.round(whiteFireDamage(true, true)) +  ")";
						},
				availableWhen: function ():Boolean {
					return player.hasStatusEffect(StatusEffects.KnowsWhitefire);
					},
				spellName: "Whitefire",
				spellShort: "Whitefire",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.WHITE_MAGIC,
				color: BtnCol.MAGIC_WHITE
			}),
		new CombatAbility({
				abilityFunc: spellArouse,
				cost: 15,
				cooldown: 3,
				tooltip: function ():String {
											return "The arouse spell draws on your own inner lust in order to enflame the enemy's passions.(" + Math.round(arouseCalc(true)) + "-" +Math.round(arouseCalc(true, true)) + ")";
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsArouse);
										},
				spellName: "Arouse",
				spellShort: "Arouse",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.BLACK_MAGIC,
				color: BtnCol.MAGIC_BLACK
		}),
		new CombatAbility({
				abilityFunc: spellHeal,
				cost: 20,
				cooldown: 3,
				tooltip: function ():String {
											return "Heal will attempt to use black magic to close your wounds and restore your body, however like all black magic used on yourself, it has a chance of backfiring and greatly arousing you.(" + Math.round(healCalc(true))  + "-" + Math.round(healCalc(true, true)) + ") \n\n";
				},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsHeal);
										},
				spellName: "Heal",
				spellShort: "Heal",
				isHeal: true,
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.BLACK_MAGIC,
				color: BtnCol.MAGIC_BLACK
		}),
		new CombatAbility({
				abilityFunc: spellMight,
				cost: 25,
				tooltip: function ():String {
											return "The Might spell draws upon your lust and uses it to fuel a temporary increase in muscle size and power, raising Strength and Toughness by " + mightCalc()  + ". It does carry the risk of backfiring and raising lust, like all black magic used on oneself.";
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsMight);
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.Might);
										},
				disabledTooltip: "Might is already active and cannot be cast again.\n\n",
				spellName: "Might",
				spellShort: "Might",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.BLACK_MAGIC,
				color: BtnCol.MAGIC_BLACK
		}),
		/*new CombatAbility({
				abilityFunc: spellBlackfire,
				cost: 40,
				cooldown: 4,
				tooltip: function ():String {
											return "Blackfire is the black magic variant of Whitefire. It is a potent fire based attack that will burn your foe with flickering black and purple flames, ignoring their physical toughness and most armors.("+ Math.round(blackfireDamage(true)) + "-" +Math.round(blackfireDamage(true,true)) + ") \n\n"
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsBlackfire);
										},
				spellName: "Blackfire",
				spellShort: "Blackfire",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.BLACK_MAGIC,
				color: BtnCol.MAGIC_BLACK
		}),*/
		new CombatAbility({
				abilityFunc: spellTKBlast,
				cost: 30,
				cooldown: 3,
				tooltip: function ():String {
											return "Unleash a telekinetic wave against your opponent. Deals physical" +
													" damage, and may cause the target to flinch this turn.("+ Math.round(tkBlastCalc(true)) + " - " +Math.round(tkBlastCalc(false,true)) + ") \n\n";
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsTKBlast);
										},
				spellName: "TK. Blast",
				spellShort: "TK. Blast",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.GRAY_MAGIC,
				color: BtnCol.MAGIC_GRAY
		}),
		new CombatAbility({
				abilityFunc: spellLeech,
				cost: 20,
				tooltip: function ():String {
											return "Enchant your weapon to drain (" + Math.round(leechCalc()) + "%) of your damage as health with every strike for a few turns.";
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsLeech);
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.Leeching);
										},
				disabledTooltip: "Your weapon is already enchanted.",
				spellName: "Leech",
				spellShort: "Leech",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.GRAY_MAGIC,
				color: BtnCol.MAGIC_GRAY
		}),
		new CombatAbility({
				abilityFunc: tfPlate,
				cost: tfFatigue(25,1),
				tooltip: function ():String {
											return "Cover yourself in shards of earth, granting " + tfPlateCalc() + " armor." + tfComboList("Plate");
										},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.TerrestrialFire) && !tfCombod("Plate");
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.TFPlate);
										},
				disabledTooltip: "You're already coated in earthen armor.",
				spellName: "Plate",
				spellShort: "Plate",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_EARTH
		}),
		new CombatAbility({
				abilityFunc: tfInflame,
				cost: tfFatigue(20,1),
				tooltip: function ():String {
											return "Infuse your physical attacks with fire, dealing " + tfInflameCalc("damage") + " extra damage but harming yourself in the process. " + tfComboList("Inflame");
										},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.TerrestrialFire) && !tfCombod("Inflame");
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.TFInflame);
										},
				disabledTooltip: "You're already on fire.",
				spellName: "Inflame",
				spellShort: "Inflame",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FIRE
		}),
		new CombatAbility({
				abilityFunc: tfMoltenPlate,
				cost: tfFatigue(20,2),
				tooltip: function ():String {
											return "Combo: Plate + Inflame\n" + tfMoltenPlateDesc();
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 1 && tfComboReady("Molten Plate") && !tfCombod("Molten Plate");
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.TFMoltenPlate);
										},
				disabledTooltip: "You're already coated in molten armor.",
				spellName: "Molten Plate",
				spellShort: "MoltenPlate",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: tfShell,
				cost: tfFatigue(20,3),
				cooldown: 4,
				tooltip: function ():String {
											return "Combo: Plate + Molten Armor\nHarden your molten armor to prevent all damage for one turn.";
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 2 && tfComboReady("Shell");
										},
				spellName: "Shell",
				spellShort: "Shell",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: tfQuake,
				cost: tfFatigue(30,2),
				cooldown: 4,
				tooltip: function ():String {
											return "Exert your magic on the earth, dealing light physical damage and causing foes to stumble. " + combat.fancifyDamageRange(tfQuakeCalc("min"),tfQuakeCalc("max"));
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 1;
										},
				spellName: "Quake",
				spellShort: "Quake",
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_EARTH
		}),
		new CombatAbility({
				abilityFunc: tfSpout,
				cost: tfFatigue(40,2),
				cooldown: 4,
				tooltip: function ():String {
											return "Launch flames up from the ground. " + combat.fancifyDamageRange(tfSpoutCalc("min"),tfSpoutCalc("max")) + tfComboList("Spout");
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 1 && !tfCombod("Spout");
										},
				spellName: "Spout",
				spellShort: "Spout",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FIRE
		}),
		new CombatAbility({
				abilityFunc: tfEruption,
				cost: tfFatigue(50,3),
				cooldown: 4,
				tooltip: function ():String {
											return "Combo: Quake + Spout\nTake advantage of the sundered earth to release flames over a wide area. " + combat.fancifyDamageRange(tfEruptionCalc("min"),tfEruptionCalc("max"));
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 2 && tfComboReady("Eruption");
										},
				spellName: "Eruption",
				spellShort: "Eruption",
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: tfStoneKnives,
				cost: tfFatigue(30,3),
				cooldown: 4,
				tooltip: function ():String {
											return "Channel your strength into earth, propelling shards of stone toward an enemy. (" + tfStoneKnivesCalc("min") + "-" + tfStoneKnivesCalc("max") + " per stone, " + tfStoneKnivesAccuracy() + "% chance to hit)" + tfComboList("Stone Knives");
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 2 && !tfCombod("Stone Knives");
										},
				spellName: "Stone Knives",
				spellShort: "StoneKnives",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_EARTH
		}),
		new CombatAbility({
				abilityFunc: tfMeteorShower,
				cost: tfFatigue(40,4),
				cooldown: 4,
				tooltip: function ():String {
											return "Combo: Stone Knives + Scorch\nLaunch a barrage of flaming stones at all enemies, grounding and dealing heavier damage to flying targets. (" + tfMeteorShowerCalc("min") + "-" + tfMeteorShowerCalc("max") + " per stone, " + tfMeteorShowerAccuracy() + "% chance to hit)";
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 3 && tfComboReady("Meteor Shower");
										},
				spellName: "Meteor Shower",
				spellShort: "MeteorShower",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: tfScorch,
				cost: tfFatigue(20,3),
				cooldown: 4,
				tooltip: function ():String {
											return "Burn the battlefield, causing damage to all moving enemies. " + combat.fancifyDamageRange(tfScorchCalc("min"),tfScorchCalc("max"));
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 2;
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.TFScorch);
										},
				disabledTooltip: "Scorch is already active.",
				spellName: "Scorch",
				spellShort: "Scorch",
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FIRE
		}),
		new CombatAbility({
				abilityFunc: tfGeodeKnuckle,
				cost: tfFatigue(30,4),
				cooldown: 4,
				tooltip: function ():String {
											return "Imbued with the might of earth, punch them.\nUses 10 gems to cast.";
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 3;
										},
				disabledWhen: function ():Boolean{
											return player.gems < 10;
										},
				disabledTooltip: "Requires 10 gems.",
				spellName: "Geode Knuckle",
				spellShort: "GeodeKnuckle",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_EARTH
		}),
		new CombatAbility({
				abilityFunc: tfGeodeKnuckleDispel,
				cost: 0,
				cooldown: 0,
				tooltip: function ():String {
											return "Dispel your equipped Geode Knuckle. Doesn't use up your turn.";
										},
				availableWhen: function ():Boolean {
											return player.weapon == weapons.G_KNUCKLE;
										},
				spellName: "Dispel Geode Knuckle",
				spellShort: "DispelKnuckle",
				isSelf: true,
				isFree: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_EARTH
		}),
		new CombatAbility({
				abilityFunc: tfCarnalBurn,
				cost: tfFatigue(80,4),
				cooldown: 4,
				tooltip: function ():String {
											return "Release the heat in your blood, converting lust into damage at the cost of health. (" + -tfCarnalBurnCalc("self") + ")(" + tfCarnalBurnCalc("damage") + ")";
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 3;
										},
				disabledWhen: function ():Boolean{
											return tfCarnalBurnCalc("self") >= player.HP;
										},
				disabledTooltip: "You wouldn't survive if you cast this now.",
				spellName: "Carnal Burn",
				spellShort: "CarnalBurn",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FIRE
		}),
		new CombatAbility({
				abilityFunc: tfTerraCore,
				cost: tfFatigue(70,6),
				cooldown: 5,
				tooltip: function ():String {
											return "In unified earth and flame, deal devastating damage. " + combat.fancifyDamageRange(tfTerraCoreCalc("min"),tfTerraCoreCalc("max")) + tfComboList("Terra Core");
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 4 && !tfCombod("Terra Core");
										},
				spellName: "Terra Core",
				spellShort: "TerraCore",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_EARTH
		}),
		new CombatAbility({
				abilityFunc: tfTerraFlames,
				cost: tfFatigue(70,6),
				cooldown: 5,
				tooltip: function ():String {
											return "Release the might of earth and flame to devastate the battlefield. " + combat.fancifyDamageRange(tfTerraFlamesCalc("min"),tfTerraFlamesCalc("max")) + tfComboList("Terra Flames");
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 4 && !tfCombod("Terra Flames");
										},
				spellName: "Terra Flames",
				spellShort: "TerraFlames",
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FIRE
		}),
		new CombatAbility({
				abilityFunc: tfTerraStar,
				cost: 0,
				tooltip: function ():String {
											return "Special Combo: Terra Core + Terra Flames + " + (achievements[kACHIEVEMENTS.NIGHT_SUN] > 0 ? "Quake + Scorch + Molten Plate" : "???") + "\nA perfect fusion of Earth and Fire, summon a miniature star to continuously assault your enemies. This pinnacle of your magic is incredibly draining and can't be used frequently.";
										},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 && tfComboReady("Terra Star") && !player.hasStatusEffect(StatusEffects.TFTerraStar);
										},
				disabledWhen: function ():Boolean{
											return player.fatigue100 > 40 || player.hasStatusEffect(StatusEffects.TFTerraStarCooldown);
										},
				disabledTooltip: function ():String {
											if (player.hasStatusEffect(StatusEffects.TFTerraStarCooldown)) {
												if (player.statusEffectv2(StatusEffects.TFTerraStarCooldown) > 0) return "It will take several days to recover from the supernova enough to cast this again.";
												else return "You can't cast this again so soon.";
											}
											if (player.fatigue100 > 40) return "Requires at least 60% fatigue remaining.";
											return "";
										},
				spellName: "Terrestrial Star",
				spellShort: "TerraStar",
				isFree: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: tfSupernova,
				cost: 0,
				tooltip: "Gather energy in your star, then unleash it in a titanic explosion of power to obliterate all who stand before you, entirely disregarding your own safety.\nTakes multiple turns to charge, during which you can do nothing else.",
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.TFTerraStar);
										},
				spellName: "Supernova",
				spellShort: "Supernova",
				isFree: true,
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: function ():void {},
				availableWhen: function ():Boolean {
											return player.masteryLevel(MasteryLib.TerrestrialFire) < 5 || achievements[kACHIEVEMENTS.NIGHT_SUN] <= 0;
										},
				disabledWhen: true,
				disabledTooltip:  function ():String {
											var tooltip:String = "You feel there's still more to be learned about Terrestrial Fire.";
											if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5) {
												tooltip += "\nYou should be able to fuse your spells into something amazing, but you aren't quite sure how.";
												if ((player.str + player.inte) < 150) tooltip += " You'll need to improve your mind and body to begin with.";
												else if (tfSpellMod() < 2) tooltip += " Your magic needs to be stronger to have a chance of succeeding.";
											}
											return tooltip;
										},
				spellName: "???",
				spellShort: "???",
				abilityType: CombatAbility.TERRESTRIAL_FIRE,
				color: BtnCol.TF_FUSION
		}),
		new CombatAbility({
				abilityFunc: spellCleansingPalm,
				cost: 30,
				cooldown: 3,
				tooltip: function ():String {
											return "Unleash the power of your cleansing aura! More effective against corrupted opponents. Doesn't work on the pure.(" + Math.round(cleansingPalmCalc(true)) + "-" +Math.round(cleansingPalmCalc(true, true)) + ")";
										},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.CleansingPalm);
										},
				disabledWhen: function ():Boolean{
											return !player.isPureEnough(10);
										},
				disabledTooltip: "You are too corrupt to use this spell.",
				spellName: "Cleansing Palm",
				spellShort: "C. Palm",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
                new CombatAbility({
                    abilityFunc: summonSword,
                    cost: 15,
                    cooldown: 1,
                    tooltip: function ():String {
                        return "Summon a living sword to aid you in combat. It will attack a random target for physical damage at the end of every turn. Damage is determined by spell power." + combat.fancifyDamageRange(summonedSwordDamage(true,false),summonedSwordDamage(false,true),summonedSwordChance());
                    },
                    availableWhen: player.hasStatusEffect(StatusEffects.KnowsCSS),
                    disabledWhen: function ():Boolean{
                        return player.statusEffectv1(StatusEffects.CirceSummonedScimitar) >= 3;
                    },
                    disabledTooltip: "You cannot focus on controlling any more scimitars.",
                    spellName: "Circe's Summoned Scimitars",
                    spellShort: "Summon Scim.",
                    range: CombatAttackData.RANGE_SELF,
                    abilityType: CombatAbility.MAGICAL
                }),
                new CombatAbility({
                    abilityFunc: wither,
                    cost: 20,
                    tooltip: "Cast a profane spell on your target, and cause any future healing to deal partial damage instead. Chance to hit is increased by Intelligence, and duration is determined" +
                    " by spell power." +
                    " (" + Math.round(witherChance()) + "%)",
                    availableWhen: player.hasStatusEffect(StatusEffects.KnowsWither),
					disabledWhen: function():Boolean{
						return monster.hasStatusEffect(StatusEffects.Withering);
					},
					disabledTooltip: "Your target is already Withered!",
                    spellName: "Withering Touch",
                    spellShort: "Wither. Touch",
                    cooldown: 3,
                    range: CombatAttackData.RANGE_MELEE,
                    abilityType: CombatAbility.MAGICAL
                }),
                new CombatAbility({
                    abilityFunc: divineWind,
                    cost: 20,
                    tooltip: "Summon and enchant the wind around the battlefield with pure energies, granting a 50% chance to heal each character every turn for 3 turns. Heal amount is determined" +
					" by spell power." + combat.fancifyHealRange(divineWindAmount(true,false),divineWindAmount(false,true)),
                    availableWhen: player.hasStatusEffect(StatusEffects.KnowsDivineWind),
                    disabledWhen: function():Boolean{
                        return player.hasStatusEffect(StatusEffects.DivineWind);
                    },
                    disabledTooltip: "The battlefield is already enchanted!",
                    spellName: "Divine Wind",
                    spellShort: "Divine Wind",
                    range: CombatAttackData.RANGE_RANGED,
                    abilityType: CombatAbility.WHITEBLACKGRAY
                }));

		magicAbilities = new Vector.<CombatAbility>;
		magicAbilities.push(new CombatAbility({
				abilityFunc: dispellingSpell,
				tooltip: "Remove most magical effects, positive or negative, from both you and the targeted enemy.",
				availableWhen: function ():Boolean {
											return player.keyItemv1("Arian's Charged Talisman") == 1;
										},
				spellName: "Arian's Talisman - Dispel",
				spellShort: "Dispel",
				isSelf: true,
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: healingSpell,
				tooltip: function ():String {
											return  "Use Arian's talisman to heal yourself. ("+ Math.round(talismanHealCalc(true)) + "-" +Math.round(talismanHealCalc(true,true)) + ")"
											},
				availableWhen: function ():Boolean {
											return player.keyItemv1("Arian's Charged Talisman") == 2;
										},
				spellName: "Arian's Talisman - Heal",
				spellShort: "Healing",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: immolationSpell,
				tooltip: function ():String {
											return  "Use Arian's talisman to immolate a target. ("+ Math.round(immolationDamageCalc(true)) + "-" +Math.round(immolationDamageCalc(true,true)) + ")"
											},
				availableWhen: function ():Boolean {
											return player.keyItemv1("Arian's Charged Talisman") == 3;
										},
				spellName: "Arian's Talisman - Immolation",
				spellShort: "Immolation",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: lustReductionSpell,
				tooltip: "Use Arian's talisman to calm yourself and reduce your lust.",
				availableWhen: function ():Boolean {
											return player.keyItemv1("Arian's Charged Talisman") == 4;
										},
				spellName: "Arian's Talisman - Lust",
				spellShort: "Lust Reduc.",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: nephilaStaffSpell,
				tooltip: "Use your nephila staff to channel fatigue into lust.",
				availableWhen: function ():Boolean {
											return player.weapon == weapons.NEPHSCEPT && player.hasPerk(PerkLib.NephilaArchQueen);
										},
				spellName: "Nephila Staff",
				spellShort: "\"Channel\" Staff",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: shieldingSpell,
				tooltip: "Use Arian's talisman to fortify yourself with a magical shield.",
				availableWhen: function ():Boolean {
											return player.keyItemv1("Arian's Charged Talisman") == 5;
										},
				spellName: "Arian's Talisman - Shield",
				spellShort: "Shielding",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: berzerk,
				tooltip: "Throw yourself into a rage!  Greatly increases the strength of your weapon and increases lust resistance, but your armor defense is reduced to zero!",
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.Berzerker);
										},
				spellName: "Berserk",
				spellShort: "Berserk",
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.Berzerking);
										},
				disabledTooltip: "You're already pretty goddamn mad!",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: lustzerk,
				tooltip: "Throw yourself into a lust rage!  Greatly increases the strength of your weapon and increases armor defense, but your lust resistance is halved!",
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.Lustzerker);
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.Lustzerking);
										},
				disabledTooltip: "You're already pretty goddamn mad!",
				spellName: "Lustserk",
				spellShort: "Lustserk",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: dragonBreath,
				cost: 20,
				tooltip: function ():String {
											return  "Unleash fire from your mouth. This can only be done once a day. (" + Math.round(dragonBreathCalc(true)) + "-" +Math.round(dragonBreathCalc(true, true)) + ")(" + dragonBreathChance() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.Dragonfire);
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.DragonBreathCooldown);
										},
				disabledTooltip: "Your burning throat reminds you that you're not yet ready to unleash dragonfire again.",
				spellName: "Dragon Breath",
				spellShort: "Dragon B.",
				isSelf: true,
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: fireballuuuuu,
				cost: 20,
				cooldown: 2,
				tooltip: function ():String {
											return  "Unleash terrestrial fire from your mouth. (" + Math.round(fireballCalc(true)) + "-" +Math.round(fireballCalc(true, true)) + ")(" + fireballChance() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.FireLord) || player.hasPerk(PerkLib.TerrestrialFire);
										},
				spellName: "Terra Fire",
				spellShort: "Terra Fire",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: hellFire,
				cost: 20,
				cooldown: 3,
				tooltip: function ():String {
											return  "Unleash hellfire from your mouth. (" + Math.round(firebreathCalc(true)) + "-" +Math.round(firebreathCalc(true, true)) + ")(" + fireballChance() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.Hellfire);
										},
				spellName: "Hellfire",
				spellShort: "Hellfire",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: possess,
				cooldown: 3,
				tooltip: function ():String {
											return  "Attempt to temporarily possess a foe and force them to raise their own lusts.(" + possessChance() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.Incorporeality);
										},
				spellName: "Possess",
				spellShort: "Possess",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: superWhisperAttack,
				cost: 10,
				cooldown: 3,
				tooltip: "Whisper and induce fear in your opponent.",
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.Whispered);
										},
				disabledWhen: function ():Boolean{
											return monster.hasStatusEffect(StatusEffects.Fear);
										},
				disabledTooltip: "Your target is already whispered!",
				spellName: "Whisper",
				spellShort: "Whisper",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: corruptedFoxFire,
				cost: 35,
				cooldown: 3,
				tooltip: function ():String {
											return "Unleash a corrupted purple flame at your opponent for high damage. Less effective against corrupted" +
													" enemies, deals more damage the higher your target's lust. (" + Math.round(corrFoxFireCalc(true)) + "-" +Math.round(corrFoxFireCalc(true, true)) + ")";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.CorruptedNinetails);
										},
				spellName: "Corrupted Foxfire",
				spellShort: "C. Foxfire",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: kitsuneTerror,
				cost: 20,
				cooldown: 3,
				tooltip: function ():String {
											return "Instill fear into your opponent with eldritch horrors. The more you cast this in a battle, the lesser effective it becomes.(" + kitsuneChanceCalc() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.CorruptedNinetails);
										},
				spellName: "Terror",
				spellShort: "Terror",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: foxFire,
				cost: 35,
				cooldown: 3,
				tooltip: function ():String {
											return "Unleash an ethereal blue flame at your opponent for high damage. More effective against corrupted enemies, heals you proportionately to your target's lust. (" + Math.round(foxFireCalc(true)) + "-" +Math.round(foxFireCalc(true, true)) + ") (" + Math.round(foxFireCalc(true, false, true)) + "-" +Math.round(foxFireCalc(true, true, true)) + ")";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.EnlightenedNinetails);
										},
				spellName: "Foxfire",
				spellShort: "Foxfire",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: kitsuneIllusion,
				cost: 25,
				cooldown: 3,
				tooltip: function ():String {
											return "Warp the reality around your opponent, lowering their speed. The more you cast this in a battle, the lesser effective it becomes.(" + kitsuneIllusionChance() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.EnlightenedNinetails);
										},
				spellName: "Illusion",
				spellShort: "Illusion",
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: paralyzingStare,
				cost: 20,
				cooldown: 3,
				tooltip: function ():String {
											return "Focus your gaze at your opponent, lowering their speed. The more you use this in a battle, the lesser effective it becomes.(" + paralyzingStareChance() + "%)";
											},
				availableWhen: function ():Boolean {
											return player.canUseStare();
										},
				spellName: "Paralyzing Stare",
				spellShort: "Stare",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: testResolve,
				tooltip: "Peer into the cursed talisman and test your own psyche.",
				availableWhen: function ():Boolean {
											return player.hasKeyItem("Family Talisman");
										},
				disabledWhen: function ():Boolean{
											return player.hasStatusEffect(StatusEffects.Resolve);
										},
				disabledTooltip: "Your mind is already tested!",
				spellName: "Test Resolve",
				spellShort: "Test Resolve",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: soulburst,
				cooldown: 5,
				tooltip: "Let your soul burn through, massively enhancing your spell power, but halving your health and removing all physical defense.",
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.KnowsSoulburst);
										},
				spellName: "Soulburst",
				spellShort: "Soulburst",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}),
		new CombatAbility({
				abilityFunc: overhealtest,
				tooltip: "Test",
				availableWhen: debug,
				spellName: "Soulburst",
				spellShort: "Soulburst",
				isSelf: true,
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.MAGICAL
		}));
		physicalAbilities = new Vector.<CombatAbility>;
		physicalAbilities.push(new CombatAbility({
				abilityFunc: anemoneSting,
				cooldown: 3,
				tooltip: function ():String {
											return "Attempt to strike an opponent with the stinging tentacles growing from your scalp. Increases enemy lust while reducing their speed. (" + Math.round(anemoneCalc(true)) + "-" + Math.round(anemoneCalc(true, true)) + ") (" + Math.round(anemoneCalc(true, false, true)) + "-" + Math.round(anemoneCalc(true, true, true)) + ")(" + anemoneChance() + "%)";
										},
				availableWhen: function ():Boolean {
											return player.hair.type == 4;
										},
				spellName: "Anemone Sting",
				spellShort: "AnemoneSting",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: unleashBrood,
				cost: 35,
				cooldown: 3,
				tooltip: function ():String {
											return "Unleash the brood of slimy tentacle monsters living in your womb. They will swarm you opponent, lowering their speed, damaging them, and potentially inflicting bleed. The more you use this in a battle, the less effective it becomes " +
													" bleeding.(" + Math.round(biteCalc(true)) + "-" +Math.round(biteCalc(false, true)) + ")";
											},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.NephilaArchQueen);
										},
				spellName: "Unleash Brood",
				spellShort: "Unleash",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: bite,
				cost: 25,
				cooldown: 2,
				tooltip: function ():String {
											return "Attempt to bite your opponent with your shark-teeth. May cause" +
													" bleeding.(" + Math.round(biteCalc(true)) + "-" +Math.round(biteCalc(false, true)) + ") ";
										},
				availableWhen: function ():Boolean {
											return player.face.type == Face.SHARK_TEETH;
										},
				spellName: "Shark Bite",
				spellShort: "SharkBite",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: nagaBiteAttack,
				cost: 10,
				cooldown: 2,
				tooltip: function ():String {
											return "Attempt to bite your opponent and inject venom, reducing Strength and Speed by (" + Math.round(nagaCalc(true)) + "-" + Math.round(nagaCalc(true, true)) + ")(" + nagaChance() + "%).";
										},
				availableWhen: function ():Boolean {
											return player.face.type == Face.SNAKE_FANGS;
										},
				spellName: "Naga Bite",
				spellShort: "Naga Bite",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: spiderBiteAttack,
				cost: 10,
				cooldown: 2,
				tooltip: function ():String {
											return "Attempt to bite your opponent and inject venom.(" + Math.round(spiderbiteCalc()) + "-" + Math.round(spiderbiteCalc()) + ")(" + spiderbiteChance() + "%)";
										},
				availableWhen: function ():Boolean {
											return player.face.type == Face.SPIDER_FANGS;
										},
				spellName: "Spider Bite",
				spellShort: "Sp. Bite",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: fireBow,
				cost: function ():Number {
											return (player.hasPerk(PerkLib.PracticedForm) ? 20 : 25) - Math.max(15,player.masteryLevel(MasteryLib.Bow)*5)
										},
				tooltip: function ():String {
											return  "Use a bow to fire an arrow at your opponent.(" + Math.round(fireBowCalc(true).finalDamage) + "-" +Math.round(fireBowCalc(true, true).finalDamage) + ")(" + fireBowChance() + "%) ";
										},
				availableWhen: function ():Boolean {
											return player.hasKeyItem("Bow") || player.hasKeyItem("Kelt's Bow");
										},
				spellName: "Fire Bow",
				spellShort: "Fire Bow",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: fanShot,
				cost: function ():Number {
											return (player.hasPerk(PerkLib.PracticedForm) ? 80 : 100) - player.masteryLevel(MasteryLib.Bow)*12;
										},
				tooltip: function ():String {
											return  "Use a bow to fire a fan of arrows at your opponent.(" + Math.round(fireBowCalc(true).finalDamage) + "-" +Math.round(fireBowCalc(true, true).finalDamage) + ") per arrow (low chance to hit per arrow) ";
										},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.FanShot) &&(player.hasKeyItem("Bow") || player.hasKeyItem("Kelt's Bow"));
										},
				spellName: "Fan Shot",
				spellShort: "Fan Shot",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: game.desert.nagaScene.nagaPlayerConstrict,
				cost: 10,
				tooltip: "Attempt to bind an enemy in your long snake-tail.",
				availableWhen: function ():Boolean {
											return player.lowerBody.type == LowerBody.NAGA;
										},
				spellName: "Constrict",
				spellShort: "Constrict",
				range: CombatAttackData.RANGE_MELEE_CHARGING,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc:kick,
				cost: 15,
				tooltip: function ():String {
											return  "Attempt to kick an enemy using your powerful lower" +
													" body.(" + Math.round(kickCalc(true)) + "-" + Math.round(kickCalc(false, true)) + ")(" + monster.standardDodgeFunc(player) + "%).";
										},
				availableWhen: function ():Boolean {
											return player.isTaur() || player.lowerBody.type == LowerBody.HOOFED || player.lowerBody.type == LowerBody.BUNNY || player.lowerBody.type == LowerBody.KANGAROO;
										},
				spellName: "Kick",
				spellShort: "Kick",
				range: CombatAttackData.RANGE_MELEE_CHARGING,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: goreAttack,
				cost: 15,
				tooltip: function ():String {
											return  "Lower your head and charge your opponent, attempting to gore" +
													" them on your horns.  This attack is stronger and easier to" +
													" land with large horns.(" + Math.round(goreCalc(true)) + "-" + Math.round(goreCalc(false, true)) + ")(" + goreChance() + "%).";
										},
				availableWhen: function ():Boolean {
											return player.horns.type == Horns.COW_MINOTAUR && player.horns.value >= 6;
										},
				spellName: "Gore",
				spellShort: "Gore",
				range: CombatAttackData.RANGE_MELEE_CHARGING,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: ramsStun,
				cost: 15,
				cooldown: 3,
				tooltip: function ():String {
											return  "Use a ramming headbutt to try and stun your foe.(" + Math.round(ramCalc(true)) + "-" + Math.round(ramCalc(false, true)) + ")(" + goreChance() + "%).";
										},
				availableWhen: function ():Boolean {
											return player.horns.type == Horns.RAM && player.horns.value >= 2;
										},
				spellName: "Horn Stun",
				spellShort: "Horn Stun",
				range: CombatAttackData.RANGE_MELEE_CHARGING,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: game.mountain.wormsScene.playerInfest,
				cost: 40,
				tooltip: function ():String {
											return  "The infest attack allows you to cum at will, launching a stream of semen and worms at your opponent in order to infest them.  Unless your foe is very aroused they are likely to simply avoid it.  Only works on males or herms. \n\nAlso great for reducing your lust.";
										},
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.Infested) && player.statusEffectv1(StatusEffects.Infested) == 5 && player.hasCock();
										},
				spellName: "Infest",
				spellShort: "Infest",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: parasiteReleaseMusk,
				isSelf: true,
				tooltip: "Permeate the air with the sweet musk being generated by your parasite, for a few turns. The scent raises the enemy's lust and yours, at a lower rate.",
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.ParasiteMusk);
										},
				disabledTooltip: "The air is already permeated with the parasite's musk!",
				disabledWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.ParasiteSlugMusk);
										},
				spellName: "Release Scent",
				spellShort: "Release Scent",
				range: CombatAttackData.RANGE_OMNI,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: parasiteQueen,
				isSelf: true,
				tooltip: function ():String {
											return  "Sacrifice one of your parasites and gain " + parasiteCalc() + " points to Strength, Toughness and Speed.";
										},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.ParasiteQueen);
										},
				disabledTooltip: function ():String {
											if (player.hasStatusEffect(StatusEffects.ParasiteQueen)) return "You are already invigorated by the sacrifice of one of your parasites!"
											else return "You don't have enough parasites, they won't obey you!"
										},
				disabledWhen: function ():Boolean {
											return player.statusEffectv1(StatusEffects.ParasiteEel) <= 5 || player.hasStatusEffect(StatusEffects.ParasiteQueen);
										},
				spellName: "Parasite Queen",
				spellShort: "Parasite Queen",
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: nephilaQueen,
				isSelf: true,
				tooltip: function ():String {
											return  "Sacrifice one of your parasites and gain " + nephilaCalc() + " increased intelligence.";
										},
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.NephilaQueen);
										},
				disabledTooltip: function ():String {
											if (player.hasStatusEffect(StatusEffects.NephilaQueen)) return "You are already invigorated by the sacrifice of one of your parasites!"
											else return "You don't have enough parasites, they won't obey you!"
										},
				disabledWhen: function ():Boolean {
											return player.statusEffectv1(StatusEffects.ParasiteNephila) <= 2 || player.hasStatusEffect(StatusEffects.NephilaQueen);
										},
				spellName: "Nephila Queen",
				spellShort: "Nephila Queen",
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: kissAttack,
				tooltip: "Attempt to kiss your foe on the lips with drugged lipstick.  It has no effect on those without a penis.",
				availableWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.LustStickApplied);
										},
				spellName: "Kiss",
				spellShort: "Kiss",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: playerStinger,
				cooldown: 3,
				tooltip: function ():String {
											return "Attempt to use your venomous bee stinger on an enemy.(" + Math.round(stingerCalc(true)) + "-" + Math.round(stingerCalc(true, true)) + ")(" + monster.standardDodgeFunc(player) + "%) Be aware it takes quite a while for your venom to build up, so depending on your abdomen's refractory period, you may have to wait quite a while between stings.  \n\nVenom: " + Math.floor(player.tail.venom) + "/100";
										},
				availableWhen: function ():Boolean {
											return player.tail.type == Tail.BEE_ABDOMEN;
										},
				disabledWhen: function ():Boolean{
					return player.tail.venom < 33;
				},
				disabledTooltip: "You do not have enough venom to sting right now!",
				spellName: "Sting",
				spellShort: "Sting",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: PCWebAttack,
				cooldown: 3,
				tooltip: function ():String {
											return "Attempt to use your abdomen to spray sticky webs at an enemy and reduce their Speed by 45.("+monster.standardDodgeFunc(player)+"%)  Be aware it takes a while for your webbing to build up.  \n\nWeb Amount: " + Math.floor(player.tail.venom) + "/100";
										},
				availableWhen: function ():Boolean {
											return player.tail.type == Tail.SPIDER_ABDOMEN;
										},
				disabledWhen: function ():Boolean{
					return player.tail.venom < 33;
				},
				disabledTooltip: "You do not have enough webbing to shoot right now!",
				spellName: "Web",
				spellShort: "Web",
				range: CombatAttackData.RANGE_RANGED,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: tailSlapAttack,
				cooldown: 3,
				cost: 30,
				tooltip: function ():String {
											return "Set your tail ablaze in red-hot flames to whip your foe with it" +
													" to hurt and burn them!(" + Math.round(tailSlapCalc(true)) + "-" +Math.round(tailSlapCalc(true, true)) + ")(" + monster.standardDodgeFunc(player) + "%) ";
										},
				availableWhen: function ():Boolean {
											return player.tail.type == Tail.SALAMANDER;
										},
				spellName: "Tail Slap",
				spellShort: "Tail Slap",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: tailWhipAttack,
				cooldown: 3,
				cost: 15,
				tooltip: "Whip your foe with your tail to enrage them and lower their defense! Reduces armor by 75%.",
				availableWhen: function ():Boolean {
											return player.tail.type == Tail.SHARK || player.tail.type == Tail.LIZARD || player.tail.type == Tail.KANGAROO || player.tail.type == Tail.RACCOON || player.tail.type == Tail.FERRET;
										},
				spellName: "Tail Whip",
				spellShort: "Tail Whip",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: tailSlamAttack,
				cooldown: 3,
				cost: 20,
				tooltip: function():String{
					return "Slam your foe with your mighty dragon tail! This attack causes grievous harm and can" +
							" stun your opponent or let it bleed. (" + Math.round(tailslamcalc(true)) + "-" +Math.round(tailslamcalc(false, true)) + ")(" + monster.standardDodgeFunc(player) + "%)  \n\nThe more you stun your opponent, the harder it is to stun them again.";
				},
				availableWhen: function ():Boolean {
											return player.tail.type == Tail.DRACONIC;
										},
				spellName: "Tail Slam",
				spellShort: "Tail Slam",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: shieldBash,
				cooldown: 3,
				cost: function ():Number {
											return (30 - 2*player.masteryLevel(MasteryLib.Shield));
										},
				tooltip: function():String{
					return "Bash your opponent with a shield. Has a chance to stun." +
							" (" + Math.round(bashCalc(true)) + "-" +Math.round(bashCalc(false, true)) + ")(" + monster.standardDodgeFunc(player) + "%)  \n\nThe more you stun your opponent, the harder it is to stun them again.";
				},
				availableWhen: function ():Boolean {
											return player.shield != ShieldLib.NOTHING && player.masteryLevel(MasteryLib.Shield) >= 1;
										},
				spellName: "Shield Bash",
				spellShort: "Shield Bash",
				range: CombatAttackData.RANGE_MELEE,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: counterAbility,
				tooltip: "Enter a special stance for a few turns, allowing you to counter enemy attacks.",
				availableWhen: function ():Boolean {
											return player.hasPerk(PerkLib.CounterAB);
										},
				disabledWhen: function ():Boolean {
											return player.hasStatusEffect(StatusEffects.CounterAB);
										},
				spellName: "Counter",
				isSelf: true,
				spellShort: "Counter",
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: reapDull,
				cost: 20,
				tooltip: function():String{
					return "Wield your scythe with unholy power, and attempt to reap the enemy. Deals massive" +
							" damage, but failure will cause damage to the user. (" + Math.round(reapCalc(true)) + "-" +Math.round(reapCalc(false, true)) + ")(" + reapChance() + "%)";
				},
				availableWhen: function ():Boolean {
											return player.weapon == weapons.DULLSC;
										},
				oneUse: true,
				spellName: "Reap",
				spellShort: "Reap",
				range: CombatAttackData.RANGE_MELEE_CHARGING,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: ironflesh,
				cost: 20,
				tooltip: "You're not supposed to see this. This ability grants a damage threshold equal to half your armor. Damage threshold reduces damage" +
				" directly, applied after damage resistance. ",
				availableWhen: debug,
				spellName: "Ironflesh",
				spellShort: "Ironflesh",
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.PHYSICAL
		}),
		new CombatAbility({
				abilityFunc: function():void{
					player.fly();
					combat.startMonsterTurn();
				},
				cost: 20,
				tooltip: "You're not supposed to see this. Test flying.",
				availableWhen: debug,
				spellName: "testfly",
				spellShort: "testfly",
				range: CombatAttackData.RANGE_SELF,
				abilityType: CombatAbility.PHYSICAL
		}),
            new CombatAbility({
                abilityFunc: grandThrust,
                cost: function ():Number { return 45 - 5*player.weapon.masteryLevel(); },
				disabledWhen: function():Boolean{ return monster.distance != CombatAttackData.DISTANCE_DISTANT},
                tooltip: function():String{
					return "Close the gap and pierce your foe with your spear with a powerful thrust that completely ignores armor and deals extra damage." + combat.fancifyDamageRange(grandThrustDamage(true),grandThrustDamage(true,false),grandThrustChance());
				},
				disabledTooltip: "You cannot execute this ability at melee range!",
                availableWhen: function():Boolean{return player.weapon.isSpear() && player.weapon.masteryLevel() >= 2},
				cooldown: 3,
                spellName: "Grand Thrust",
                spellShort: "Grand Thrust",
                range: CombatAttackData.RANGE_MELEE_CHARGING,
                abilityType: CombatAbility.PHYSICAL
			}),
                new CombatAbility({
                    abilityFunc: backstabStart,
                    cost: function ():Number { return 35 - 5*player.weapon.masteryLevel(); },
                    tooltip: function():String{
                        return "Skip your turn and slip into the shadows with bonus evasion chance. If you dodge an" +
                                " attack this turn, counter at the end of the turn with a powerful backstab!" + combat.fancifyDamageRange(backstabDamage(true),backstabDamage(false,true),monster.standardDodgeFunc(player));
                    },
                    availableWhen: function():Boolean{return player.weapon.isKnife() && player.weapon.masteryLevel() >= 2},
					cooldown:3,
                    spellName: "Backstab",
                    spellShort: "Backstab",
                    range: CombatAttackData.RANGE_MELEE,
                    abilityType: CombatAbility.PHYSICAL
                }),
                new CombatAbility({
                    abilityFunc: retributionStart,
                    cost: function ():Number { return 50 - 5*player.weapon.masteryLevel(); },
                    tooltip: function():String{
                        return "Position yourself to unleash a massive strike at the end of the turn. Damage increases based on how much punishment you take" +
								" this turn!";
                    },
                    availableWhen: function():Boolean{return player.weapon.isLarge() && player.weapon.masteryLevel() >= 2},
					cooldown:3,
                    spellName: "Arc of Retribution",
                    spellShort: "RetributionArc",
                    range: CombatAttackData.RANGE_MELEE,
                    abilityType: CombatAbility.PHYSICAL
                }),
				new CombatAbility({
					abilityFunc: endlessFlurry,
					cost: function ():Number { return (player.weapon == WeaponLib.FISTS ? 25 : 30) - 3*player.weapon.masteryLevel(); },
					tooltip: function():String{
						return "Unleash " + flurryAmount +" attacks for half damage. The number of attacks for the next Endless Flurry is increased by 1 for the" +
								" entire combat, up to a maximum of 5.";
					},
                    availableWhen: function():Boolean{return player.weapon.isOneHandedMelee() && player.weapon.masteryLevel() >= 2},
					spellName: "Endless Flurry",
					spellShort: "Endless Flurry",
					range: CombatAttackData.RANGE_MELEE,
					abilityType: CombatAbility.PHYSICAL
				}),
				new CombatAbility({
					abilityFunc: vineGrab,
					cost: 10,
					tooltip: "Attempt to bind an enemy with your whip-like vines.",
                    availableWhen: function():Boolean{return armors.VINARMR.saveContent.armorStage > 4 && !monster.hasStatusEffect(StatusEffects.Constricted)},
					spellName: "Vine Grab",
					spellShort: "Vine Grab",
					range: CombatAttackData.RANGE_RANGED,
					abilityType: CombatAbility.PHYSICAL
				})
		/*new CombatAbility({
				abilityFunc: function():void{
					clearOutput();
					outputText("testtest");
					player.addStatusEffect(new TimeWalk(3));
					combat.monsterAI();
				},
				cost: 20,
				tooltip: "You're not supposed to see this. This ability makes healing deal damage. Also applies Emphatic Agony - damage taken in your turn is
				 also applied to the currently targeted enemy.",
				availableWhen: debug,
				spellName: "TimeWalk",
				spellShort: "Wither",
				abilityType: CombatAbility.PHYSICAL
		})		/*,
		new CombatAbility({
				abilityFunc: onslaught,
				cost: 20,
				tooltip: "sure",
				availableWhen: true,
				oneUse: true,
				spellName: "Stuff",
				spellShort: "Stuff",
				abilityType: CombatAbility.PHYSICAL
		})	*/
		)
		allAbilities = magicSpells.concat(physicalAbilities, magicAbilities);
		}

		public function witherChance():Number{
            var baseChance:Number = Math.round((player.inte > monster.inte ? Math.abs(monster.inte /((player.inte+30) * 2) - 1) : (player.inte+30) / (monster.spe*2)) * 100);
			return baseChance;
		}
		public function wither():void{
			outputText("You raise a fist to your mouth and focus your mind, channeling healing energies within it. Your hand glows with clear, pure magic, but you whisper profane incantations into" +
					" it, warping the spell completely! Your hand glows with a purple and black aura as you launch the spell against [themonster]!");
			if(rand(100) <= witherChance()){
				outputText("\nThe spell hits your [themonster], and [monster.pronoun1] fails to resist! The profane hex courses through [monster.pronoun3]'s body, corrupting any healing into" +
						" damage!");
                monster.addStatusEffect(new WitheringDebuff(1 + Math.round(player.spellMod() * 3)));
			}else{
				outputText("\nThe spell hits [themonster], but [monster.pronoun2] manages to conjure enough spiritual fortitude to rebuke the effects, canceling them completely!");
			}

			//player.createStatusEffect(StatusEffects.EmpathicAgony, 0, 0, 0, 0);
			combat.startMonsterTurn();
		}

		public function dispellingSpell():void {
			clearOutput();
			outputText("You gather energy in your Talisman and unleash the spell contained within.  An orange light appears and flashes briefly before vanishing. \n");
			//Remove player's effects
			if (player.hasStatusEffect(StatusEffects.ChargeWeapon)) {
				outputText("\nYour weapon no longer glows as your spell is dispelled.");
				player.removeStatusEffect(StatusEffects.ChargeWeapon);
			}
			if (player.hasStatusEffect(StatusEffects.Leeching)){
					outputText("The incantation surrounding your [weapon] fades away.\n");
					player.removeStatusEffect(StatusEffects.Leeching);
			}
			if (player.hasStatusEffect(StatusEffects.TFInflame)) {
				outputText("\nThe fire surrounding you and your weapon fizzles out.");
				player.removeStatusEffect(StatusEffects.TFInflame);
			}
			if (player.hasStatusEffect(StatusEffects.TFPlate)) {
				outputText("\nYour earthen armor crumbles and falls to the ground.");
				player.removeStatusEffect(StatusEffects.TFPlate);
			}
			if (player.hasStatusEffect(StatusEffects.TFMoltenPlate)) {
				outputText("\nYou're no longer coated in molten rock.");
				player.removeStatusEffect(StatusEffects.TFMoltenPlate);
			}
			if (player.hasStatusEffect(StatusEffects.ParasiteQueen)){
				outputText("\nThe parasites are no longer boosting your energy.");
				showStatDown("str");
				showStatDown("tou");
				showStatDown("spe");
				statScreenRefresh();
				player.removeStatusEffect(StatusEffects.ParasiteQueen);
			}
			if (player.hasStatusEffect(StatusEffects.NephilaQueen)){
				outputText("\nThe parasites are no longer boosting your energy.");
				showStatDown("int");
				statScreenRefresh();
				player.removeStatusEffect(StatusEffects.NephilaQueen);
			}
			if (player.hasStatusEffect(StatusEffects.TrueWhispered)) {
				outputText("\nYour mind is now free of the horrible " + (player.statusEffectv2(StatusEffects.TrueWhispered) > 0 ? "screaming." : "whispering."));
				player.removeStatusEffect(StatusEffects.TrueWhispered);
			}
			if (player.hasStatusEffect(StatusEffects.Marked)){
				outputText("\nYou feel the Courtier's hex wear off - you're no longer cursed!");
				player.removeStatusEffect(StatusEffects.Marked);
			}

			if (player.hasStatusEffect(StatusEffects.Nothingness)){
				outputText("\nThe talisman successfully removes the creature's spell, restoring your existence!");
				player.removeStatusEffect(StatusEffects.Nothingness);
			}

			if (player.hasStatusEffect(StatusEffects.Might)) {
				outputText("\nYou feel a bit weaker as your strength-enhancing spell wears off.");
				player.removeStatusEffect(StatusEffects.Might);
			}
			//Remove opponent's effects
			if (monster.hasStatusEffect(StatusEffects.ChargeWeapon)) {
				outputText("\nThe glow around " + monster.a + monster.short + "'s " + monster.weaponName + " fades completely.");
				monster.weaponAttack -= monster.statusEffectv1(StatusEffects.ChargeWeapon);
				monster.removeStatusEffect(StatusEffects.ChargeWeapon);
			}
			if (monster.hasStatusEffect(StatusEffects.VolcanicUberHEAL)){
				outputText("\nThe golem's shimmering shield dissipates - he can be attacked again!");
				monster.removeStatusEffect(StatusEffects.VolcanicUberHEAL);
			}
			if (monster.hasStatusEffect(StatusEffects.Fear)) {
				outputText("\nThe dark illusion around " + monster.a + " " + monster.short + " finally dissipates, leaving " + monster.pronoun2 + " no longer fearful as " + monster.pronoun1 + " regains confidence.");
				monster.spe += monster.statusEffectv1(StatusEffects.Fear);
				monster.removeStatusEffect(StatusEffects.Fear);
			}
			if (monster.hasStatusEffect(StatusEffects.Illusion)) {
				outputText("\nThe reality around " + monster.a + " " + monster.short + " finally snaps back in place as " + monster.pronoun3 +" illusion spell fades.");
				monster.spe += monster.statusEffectv1(StatusEffects.Illusion);
				monster.removeStatusEffect(StatusEffects.Illusion);
			}

			if (player.hasStatusEffect(StatusEffects.Might)) {
				outputText("\nYou feel a bit weaker as your strength-enhancing spell wears off.");
				player.removeStatusEffect(StatusEffects.Might);
			}
			if (monster.hasStatusEffect(StatusEffects.Shell)) {
				outputText("\nThe magical shell around " + monster.a + " " + monster.short + " shatters!");
				monster.removeStatusEffect(StatusEffects.Shell);
			}
			outputText("\n");
			game.arianScene.clearTalisman();
			combat.startMonsterTurn();
		}

		public function talismanHealCalc(display:Boolean = false,maxHeal:Boolean = false):Number{
			if (display){
				if (maxHeal) return ((player.level * 5) + (player.inte / 1.5) + player.inte) * player.spellMod() * 1.5;
				else return ((player.level * 5) + (player.inte / 1.5)) * player.spellMod() * 1.5;
			}
			return ((player.level * 5) + (player.inte / 1.5) + rand(player.inte)) * player.spellMod() * 1.5;
		}

		public function healingSpell():void {
			clearOutput();
			outputText("You gather energy in your Talisman and unleash the spell contained within.  A green aura washes over you and your wounds begin to close quickly. By the time the aura fully fades, you feel much better. ");
			var temp:int = ((player.level * 5) + (player.inte / 1.5) + rand(player.inte)) * player.spellMod() * 1.5;
			player.HPChange(temp, true);
			game.arianScene.clearTalisman();
			combat.startMonsterTurn();
		}

		public function immolationDamageCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = int(75 + (player.inte / 2 + (display ? 0 : rand(player.inte)) + (maxDamage ? player.inte : 0)) * player.spellMod());
			damage = calcInfernoMod(damage,display);
			if (monster is VolcanicGolem) damage *= .2;
			return combat.globalMod(damage);

		}

		public function immolationSpell():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			outputText("You gather energy in your Talisman and unleash the spell contained within.  A wave of burning flames gathers around " + monster.a + monster.short + ", slowly burning " + monster.pronoun2 + ". ");
			currDamage = immolationDamageCalc();
			if (monster is VolcanicGolem) {
				outputText("\n\nThe Golem doesn't seem to care about the flames.\n\n");
				combat.startMonsterTurn();
				return;
			}
			if (monster is ArchInquisitorVilkus && temp > 300 && (monster as ArchInquisitorVilkus).nextAction == 1){
				outputText("Your spell overpowers the Inquisitor's, and its magical energy is absorbed into yours, for an extremely effective attack!");
				(monster as ArchInquisitorVilkus).nextAction = 0;
				temp += rand(200);
			}
			currDamage = combat.doDamage(currDamage, true, true);
			monster.createStatusEffect(StatusEffects.OnFire, 2 + rand(player.inte / 25), 0, 0, 0);
			if (monster.short == "goo girl") {
				outputText(" Your flames lick the girl's body and she opens her mouth in pained protest as you evaporate much of her moisture. When the fire passes, she seems a bit smaller and her slimy " + monster.skin.tone + " skin has lost some of its shimmer. ");
				if (monster.findPerk(PerkLib.Acid) < 0) monster.createPerk(PerkLib.Acid,0,0,0,0);
			}
			game.arianScene.clearTalisman();
			combat.startMonsterTurn();
		}

		public function lustReductionSpell():void {
			clearOutput();
			outputText("You gather energy in your Talisman and unleash the spell contained within.  A pink aura washes all over you and as soon as the aura fades, you feel much less horny.");
			var temp:int = 30 + rand(player.inte / 5) * player.spellMod();
			dynStats("lus", -temp);
			outputText(" (-" + temp + " lust)\n\n");
			game.arianScene.clearTalisman();
			combat.startMonsterTurn();
		}

		public function nephilaStaffSpell():void {
			clearOutput();
			outputText("You roll forward onto your obscene belly, flattening it slightly under the weight of the rest of your body, then hold your Nephila Queen's Scepter up into the air in front of you. Three long, slimy tendrils snake their way out of your quivering snatch and grab hold of the scepter, bringing it around to your back end to tease you with the pregnant looking gemstone at the scepter's end. As the tentacles roll the gemstone up and down the outer lips of your pussy, you can feel your exhaustion slowly leaking out of you. In response, the gemstone glows with soft purple energy, the faces reflected in its facets seeming to animate with lustful vigor. A corona of the violet lust expands outward, washing your [skin] with the feeling of pre-orgasm. Feeling rejuvenated, you hold one arm out and your tentacles deposit the staff gingerly into your outstretched palm. Back in command, you roll back into the closest approximation your replete body can manage of a combative stance.");
			var temp:int = 10 + int(player.statusEffectv1(StatusEffects.ParasiteNephila) / 2);
			var lustDmg:int = 10 + int(player.statusEffectv1(StatusEffects.ParasiteNephila) / 4);
			dynStats("lus", +temp / 2);
			player.changeFatigue(-temp);
			outputText(" (-" + temp + " fatigue and + " + temp / 2 + " lust)\n\n");
			combat.startMonsterTurn();
		}

		public function shieldingSpell():void {
			clearOutput();
			outputText("You gather energy in your Talisman and unleash the spell contained within.  A barrier of light engulfs you, before turning completely transparent.  Your defense has been increased.\n\n");
			player.createStatusEffect(StatusEffects.Shielding,0,0,0,0);
			game.arianScene.clearTalisman();
			combat.startMonsterTurn();
		}

		//------------
		// M. SPECIALS
		//------------
		public function magicalSpecials():void {
			if (combat.inCombat && player.hasStatusEffect(StatusEffects.Sealed) && player.statusEffectv2(StatusEffects.Sealed) == 6) {
				clearOutput();
				outputText("You try to ready a special ability, but wind up stumbling dizzily instead.  Your ability to use magical special attacks was sealed, and now you've wasted a chance to attack!\n\n");
				combat.startMonsterTurn();
				return;
			}
			menu();
			var button:int = 0;
			for each(var ability:CombatAbility in magicAbilities){
				button = ability.createButton(button);
			}

			addButton(14, "Back", combat.combatMenu, false);
		}

		public function berzerk():void {
			clearOutput();
			outputText("You roar and unleash your savage fury, forgetting about defense in order to destroy your foe!\n\n");
			player.createStatusEffect(StatusEffects.Berzerking, 0, 0, 0, 0);
			combat.startMonsterTurn();
		}

		public function lustzerk():void {
			clearOutput();
			//This is now automatic - newRound arg defaults to true:	menuLoc = 0;
			outputText("You roar and unleash your lustful fury, forgetting about defense from any sexual attacks in order to destroy your foe!\n\n");
			player.createStatusEffect(StatusEffects.Lustzerking,0,0,0,0);
			combat.startMonsterTurn();
		}

		public function overhealtest():void{
			clearOutput();
			outputText("If you're here, OtherCoCAnon was a moron that forgot to remove this test ability from the list. It grants 50% of any extra healing over your maximum HP as overheal, up to 50% higher max HP.\n");
			player.createStatusEffect(StatusEffects.Overhealing, 0, 0, 0, 0);
			combat.startMonsterTurn();
		}

		public function soulburst():void{
			clearOutput();
			outputText("You close your eyes and focus, tapping into the power hidden deep within yourself. Unparalleled power courses through your veins, and you tense your body, attempting to control it.");
			outputText("\nSuddenly, you open them, and burst with pure magical force!\n\n");
			if (player.hasStatusEffect(StatusEffects.Soulburst)) player.addStatusValue(StatusEffects.Soulburst, 1, 1);
			else player.createStatusEffect(StatusEffects.Soulburst, 1, 0, 0, 0);
			if (player.maxHP() < player.HP) player.HP = player.maxHP();
			player.takeDamage(1);
			combat.startMonsterTurn();
		}

		//Dragon Breath
		//Effect of attack: Damages and stuns the enemy for the turn you used this attack on, plus 2 more turns. High chance of success.
		public function dragonBreath():void {
			clearOutput();
			//Not Ready Yet:
			player.createStatusEffect(StatusEffects.DragonBreathCooldown, 0, 0, 0, 0);
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			outputText("Tapping into the power deep within you, you let loose a bellowing roar at your enemy, so forceful that even the environs crumble around " + monster.pronoun2 + "!\n\n");
			var oldMonster:Monster = monster;
			for each(var currMonster:Monster in monsterArray){
				monster = currMonster;
				dragonBreathExec();
            }
			monster = oldMonster;
			combat.startMonsterTurn();

		}

		public function dragonBreathCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = int(player.level * 8 + 25 + (display ? 0 : rand(10)) + (maxDamage ? 10 : 0));
			damage = calcInfernoMod(damage,display);
			if (player.hasStatusEffect(StatusEffects.DragonBreathBoost)) {
				damage *= 1.5;
			}
			if (monster.hasStatusEffect(StatusEffects.Sandstorm)) {
				damage = Math.round(0.2 * damage);
			}
			damage = monster.fireRes * damage;
			return combat.globalMod(damage);
		}

		public function dragonBreathChance():Number{
			return monster.standardDodgeFunc(player, 10);
		}

		public function dragonBreathExec():void{
			currDamage = dragonBreathCalc();
			if (player.hasStatusEffect(StatusEffects.DragonBreathBoost)) {
				player.removeStatusEffect(StatusEffects.DragonBreathBoost);
			}
			if (monster is LivingStatue)
			{
				outputText("The fire courses by the stone skin harmlessly. It does leave the surface of the statue glossier in its wake.");
				return;
			}
			if (monster is VolcanicGolem) {
				outputText("The Golem doesn't seem to care about the flames.");
				if (monster.hasStatusEffect(StatusEffects.VolcanicFistProblem))
				{
					if (!monster.hasStatusEffect(StatusEffects.VolcanicFrenzy)){
						outputText("\n\nUnable to cover itself,  the massive shockwave caused by the roar hits the golem, stunning and toppling him!\n\nThe golem's rock plates slide off, revealing its molten interior. This is your chance to attack!");
                        monster.createStatusEffect(StatusEffects.Stunned, 1, 0, 0, 0);
                        monster.armorDef = 0;
					}else{
						outputText("\n\nIn its anger, the Golem is able to power through the massive shockwave caused by your roar, losing a few rock plates in the process, but resisting the stun!");
						if (monster.hasStatusEffect(StatusEffects.VolcanicArmorRed))//if armor is already rent
						{
                            monster.addStatusValue(StatusEffects.VolcanicArmorRed, 1, 3);//prolong duration
                            monster.addStatusValue(StatusEffects.VolcanicArmorRed, 2, 1);//increase effect
                            monster.armorDef -= 150;
							if (monster.armorDef < 0) monster.armorDef = 0;
						}else{
                            monster.createStatusEffect(StatusEffects.VolcanicArmorRed, 3, 1, 0, 0);//otherwise, create effect
                            monster.armorDef -= -150;
							if (monster.armorDef < 0) monster.armorDef = 0;
						}

					}

				}
				return;
			}

			outputText(monster.capitalA + monster.short + " does " + monster.pronoun3 + " best to avoid it, but the wave of force is too fast.");
			if (monster.hasStatusEffect(StatusEffects.Sandstorm)) {
				outputText("  Your breath is massively dissipated by the swirling vortex, causing it to hit with far less force!");
			}
			//Miss:
			if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:dragonBreathChance()}).failed) {
				outputText("  Despite the heavy impact caused by your roar, " + monster.a + monster.short + " manages to take it at an angle and remain on " + monster.pronoun3 + " feet and focuses on you, ready to keep fighting.");
			}
			//Special enemy avoidances
			else if (monster.short == "Vala" && !monster.hasStatusEffect(StatusEffects.Stunned)) {
				outputText("Vala beats her wings with surprising strength, blowing the fireball back at you! ");
				if (player.findPerk(PerkLib.Evade) >= 0 && rand(2) == 0) {
					outputText("You dive out of the way and evade it!");
				}
				else if (player.findPerk(PerkLib.Flexibility) >= 0 && rand(4) == 0) {
					outputText("You use your flexibility to barely fold your body out of the way!");
				}
				//Determine if blocked!
				else if (combat.combatBlock(player,player,true)) {//fucking bizarre
					outputText("You manage to block your own fire with your " + player.shieldName + "!");
				}
				else {
					currDamage = player.takeDamage(currDamage);
					outputText("Your own fire smacks into your face! (" + currDamage + ")");
				}
				outputText("\n\n");
			}
			//Goos burn
			else if (monster.short == "goo-girl") {
				outputText(" Your flames lick the girl's body and she opens her mouth in pained protest as you evaporate much of her moisture. When the fire passes, she seems a bit smaller and her slimy " + monster.skin.tone + " skin has lost some of its shimmer. ");
				if (monster.findPerk(PerkLib.Acid) < 0) monster.createPerk(PerkLib.Acid,0,0,0,0);
				monster.createStatusEffect(StatusEffects.Stunned,0,0,0,0);
			}
			else {
				if (monster.stun(1,100)) {
					outputText("  " + monster.capitalA + monster.short + " reels as your wave of force slams into " + monster.pronoun2 + " like a ton of rock!  The impact sends " + monster.pronoun2 + " crashing to the ground, too dazed to strike back.");
				}
				else {
					outputText("  " + monster.capitalA + monster.short + " reels as your wave of force slams into " + monster.pronoun2 + " like a ton of rock!  The impact sends " + monster.pronoun2 + " staggering back, but " + monster.pronoun1 + " ");
					if (!monster.plural) outputText("is ");
					else outputText("are");
					outputText("too resolute to be stunned by your attack.");
				}

			}
			currDamage = combat.doDamage(currDamage,true,true);
			outputText("\n\n");
			if (monster.short == "Holli" && !monster.hasStatusEffect(StatusEffects.HolliBurning)) (monster as Holli).lightHolliOnFireMagically();
		}

		//* Terrestrial Fire
		public function fireballCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = int(player.level * 10 + 45 + (display ? 0 : rand(10)) + (maxDamage ? 10 : 0));
			damage = calcInfernoMod(damage,display);
			if (player.hasStatusEffect(StatusEffects.DragonBreathBoost)) {
				damage *= 1.5;
			}
			damage = monster.fireRes * damage;
			if (monster.hasStatusEffect(StatusEffects.Sandstorm)) {
				damage = Math.round(0.2 * damage);
			}

			if (player.hasStatusEffect(StatusEffects.GooArmorSilence)) {
				damage += 25;
			}
			return combat.globalMod(damage);
		}

		public function fireballChance():Number{
			if (player.hasStatusEffect(StatusEffects.WebSilence)) return 0;
			else return 80 - monster.getEvasionChance() + (player.chanceToHit() - 95);
		}

		public function fireballuuuuu():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			//[Failure]
			//(high damage to self, +10 fatigue on top of ability cost)
			if (combatAvoidDamage({doParry:false,doBlock:false,toHitChance:fireballChance()}).success) {
				if (player.hasStatusEffect(StatusEffects.WebSilence)) outputText("You reach for the terrestrial fire, but as you ready to release a torrent of flame, it backs up in your throat, blocked by the webbing across your mouth.  It causes you to cry out as the sudden, heated force explodes in your own throat. ");
				else if (player.hasStatusEffect(StatusEffects.GooArmorSilence)) outputText("You reach for the terrestrial fire but as you ready the torrent, it erupts prematurely, causing you to cry out as the sudden heated force explodes in your own throat.  The slime covering your mouth bubbles and pops, boiling away where the escaping flame opens small rents in it.  That wasn't as effective as you'd hoped, but you can at least speak now. ");
				else outputText("You reach for the terrestrial fire, but as you ready to release a torrent of flame, the fire inside erupts prematurely, causing you to cry out as the sudden heated force explodes in your own throat. ");
				player.changeFatigue(10);
				player.takeDamage(10 + rand(20), true);
				outputText("\n\n");
				combat.startMonsterTurn();
				return;
			}

			currDamage = fireballCalc();
			if (monster is AkbalUnsealed) {
				outputText("You summon flames from deep within your chest, unleashing them upon the greater demon. He makes no effort to dodge, instead baring his chest to the brunt of the fire.");
				outputText("\n[say: Did you forget who taught you this? You cannot kill me with my own flames, [name].]");
				combat.startMonsterTurn();
				return;
			}
			if (monster is LivingStatue)
			{
				outputText("The fire courses by the stone skin harmlessly. It does leave the surface of the statue glossier in its wake.");
				combat.startMonsterTurn();
				return;
			}
			if (monster is VolcanicGolem) {
				outputText("\n\nThe Golem doesn't seem to care about the flames.\n\n");
				combat.startMonsterTurn();
				return;
			}
			if (monster is Doppelganger)
			{
				(monster as Doppelganger).handleSpellResistance("fireball");
				return;
			}
			if (player.hasStatusEffect(StatusEffects.GooArmorSilence)) {
				outputText("A growl rumbles from deep within as you charge the terrestrial fire, and you force it from your chest and into the slime.  The goop bubbles and steams as it evaporates, drawing a curious look from your foe, who pauses in her onslaught to lean in and watch.  While the tension around your mouth lessens and your opponent forgets herself more and more, you bide your time.  When you can finally work your jaw enough to open your mouth, you expel the lion's - or jaguar's? share of the flame, inflating an enormous bubble of fire and evaporated slime that thins and finally pops to release a superheated cloud.  The armored girl screams and recoils as she's enveloped, flailing her arms. ");
				player.removeStatusEffect(StatusEffects.GooArmorSilence);
			}
			else outputText("A growl rumbles deep with your chest as you charge the terrestrial fire.  When you can hold it no longer, you release an ear splitting roar and hurl a giant green conflagration at your enemy. ");

			if (monster.short == "Isabella" && !monster.hasStatusEffect(StatusEffects.Stunned)) {
				outputText("Isabella shoulders her shield into the path of the emerald flames.  They burst over the wall of steel, splitting around the impenetrable obstruction and washing out harmlessly to the sides.\n\n");
				if (game.isabellaFollowerScene.isabellaAccent()) outputText("\"Is zat all you've got?  It'll take more than a flashy magic trick to beat Izabella!\" taunts the cow-girl.\n\n");
				else outputText("\"Is that all you've got?  It'll take more than a flashy magic trick to beat Isabella!\" taunts the cow-girl.\n\n");
				combat.startMonsterTurn();
				return;
			}
			else if (monster.short == "Vala" && !monster.hasStatusEffect(StatusEffects.Stunned)) {
				outputText("Vala beats her wings with surprising strength, blowing the fireball back at you! ");
				if (player.findPerk(PerkLib.Evade) >= 0 && rand(2) == 0) {
					outputText("You dive out of the way and evade it!");
				}
				else if (player.findPerk(PerkLib.Flexibility) >= 0 && rand(4) == 0) {
					outputText("You use your flexibility to barely fold your body out of the way!");
				}
				else {
					//Determine if blocked!
					if (combat.combatBlock(player,player,true)) {
						outputText("You manage to block your own fire with your " + player.shieldName + "!");
					}
					else {
					outputText("Your own fire smacks into your face! (" + currDamage + ")");
					player.takeDamage(currDamage);
				}
				}
				outputText("\n\n");
			}
			else {
				//Using fire attacks on the goo]
				if (monster.short == "goo-girl") {
					outputText(" Your flames lick the girl's body and she opens her mouth in pained protest as you evaporate much of her moisture. When the fire passes, she seems a bit smaller and her slimy " + monster.skin.tone + " skin has lost some of its shimmer. ");
					if (monster.findPerk(PerkLib.Acid) < 0) monster.createPerk(PerkLib.Acid,0,0,0,0);
				}
				if (monster.hasStatusEffect(StatusEffects.Sandstorm)) {
					outputText("Your breath is massively dissipated by the swirling vortex, causing it to hit with far less force!  ");
				}
				currDamage = combat.doDamage(currDamage, true, true);
				outputText("\n\n");
				if (monster.short == "Holli" && !monster.hasStatusEffect(StatusEffects.HolliBurning)) (monster as Holli).lightHolliOnFireMagically();
			}
			combat.startMonsterTurn();
		}

		//Hellfire deals physical damage to completely pure foes,
		//lust damage to completely corrupt foes, and a mix for those in between.  Its power is based on the PC's corruption and level.  Appearance is slightly changed to mention that the PC's eyes and mouth occasionally show flicks of fire from within them, text could possibly vary based on corruption.
		public function firebreathCalc(display:Boolean = false, maxDamage:Boolean = false, lust:Boolean = false):Number{
			var damage:Number = (player.level * 8 + (display ? 0 : rand(10)) + (maxDamage ? 10 : 0) + player.inte / 2 + player.cor / 5);
			damage = calcInfernoMod(damage,display);
			if (monster is LivingStatue) damage *= 0;
			if (player.hasStatusEffect(StatusEffects.GooArmorSilence)) {
				damage += 25;
			}
			if (lust) return (damage*monster.lustVuln) / 6;
			return combat.globalMod(damage);
		}

		public function hellFire():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			currDamage = firebreathCalc();
			if (monster is LivingStatue)
			{
				outputText("The fire courses over the stone behemoths skin harmlessly. It does leave the surface of the statue glossier in its wake.");
				combat.startMonsterTurn();
				return;
			}
			if (monster is AkbalUnsealed) {
				outputText("You take in a deep breath and unleash a wave of corrupt red flames from deep within. Akbal, in turn, unleashes a breath of his terrestrial fire, completely enveloping your scarlet flames.");
				outputText("\nAkbal chuckles, [say: You insult me with the flames of a lesser lord than I.]");
				combat.startMonsterTurn();
				return;
			}
			if (!player.hasStatusEffect(StatusEffects.GooArmorSilence)) outputText("You take in a deep breath and unleash a wave of corrupt red flames from deep within.");

			if (player.hasStatusEffect(StatusEffects.WebSilence)) {
				outputText("  The fire burns through the webs blocking your mouth!");
				player.removeStatusEffect(StatusEffects.WebSilence);
			}
			if (player.hasStatusEffect(StatusEffects.GooArmorSilence)) {
				outputText("  A growl rumbles from deep within as you charge the terrestrial fire, and you force it from your chest and into the slime.  The goop bubbles and steams as it evaporates, drawing a curious look from your foe, who pauses in her onslaught to lean in and watch.  While the tension around your mouth lessens and your opponent forgets herself more and more, you bide your time.  When you can finally work your jaw enough to open your mouth, you expel the lion's - or jaguar's? share of the flame, inflating an enormous bubble of fire and evaporated slime that thins and finally pops to release a superheated cloud.  The armored girl screams and recoils as she's enveloped, flailing her arms.");
				player.removeStatusEffect(StatusEffects.GooArmorSilence);
			}
			if (monster.short == "Isabella" && !monster.hasStatusEffect(StatusEffects.Stunned)) {
				outputText("  Isabella shoulders her shield into the path of the crimson flames.  They burst over the wall of steel, splitting around the impenetrable obstruction and washing out harmlessly to the sides.\n\n");
				if (game.isabellaFollowerScene.isabellaAccent()) outputText("\"Is zat all you've got?  It'll take more than a flashy magic trick to beat Izabella!\" taunts the cow-girl.\n\n");
				else outputText("\"Is that all you've got?  It'll take more than a flashy magic trick to beat Isabella!\" taunts the cow-girl.\n\n");
				combat.startMonsterTurn();
				return;
			}
			else if (monster.short == "Vala" && !monster.hasStatusEffect(StatusEffects.Stunned)) {
				outputText("  Vala beats her wings with surprising strength, blowing the fireball back at you!  ");
				if (player.getEvasionChance() > rand(100)) {
					outputText("You dive out of the way and evade it!");
				}
				else {
					currDamage = int(currDamage / 6);
					outputText("Your own fire smacks into your face, arousing you!");
					dynStats("lus", currDamage);
				}
				outputText("\n");
			}
			else {
				if (monster.inte < 10) {
					outputText("  Your foe lets out a shriek as their form is engulfed in the blistering flames.");
					currDamage = int(currDamage);
				}
				else {
					if (monster.lustVuln > 0) {
						outputText("  Your foe cries out in surprise and then gives a sensual moan as the flames of your passion surround them and fill their body with unnatural lust.");
						monster.teased(monster.lustVuln * currDamage / 6);
						outputText("\n");
					}
					else {
						outputText("  The corrupted fire doesn't seem to have effect on " + monster.a + monster.short + "!\n");
					}
				}
			}
			combat.doDamage(currDamage,true,true);
			outputText("\n");
			if (monster.short == "Holli" && !monster.hasStatusEffect(StatusEffects.HolliBurning)) (monster as Holli).lightHolliOnFireMagically();
			combat.startMonsterTurn();
		}

		//Possess
		public function possessCalc(display:Boolean = false,maxDamage:Boolean = false):Number{
			return Math.round((player.inte/5 + (display ? 0 : rand(player.level)) + (maxDamage ? player.level : 0) + player.level)*monster.lustVuln);
		}

		public function possessChance():Number{
			if ((!monster.hasCock() && !monster.hasVagina()) || monster.lustVuln == 0 || monster.inte == 0 || monster.inte > 100 || player.inte < monster.inte - 10) return 0;
			return Math.max(0,Math.round((player.inte+10 - monster.inte) * 4.76));
		}

		public function possess():void {
			clearOutput();
			if (monster.short == "plain girl" || monster.findPerk(PerkLib.Incorporeality) >= 0) {
				outputText("With a smile and a wink, your form becomes completely intangible, and you waste no time in throwing yourself toward the opponent's frame.  Sadly, it was doomed to fail, as you bounce right off your foe's ghostly form.");
			}
			else if (monster is Dullahan || monster is DullahanHorse){
				outputText("With a smile and a wink, your form becomes completely intangible, and you waste no time in throwing yourself toward the opponent's frame.  Oddly, you phase through as if there was nothing there at all.");
			}
			else if (monster is LivingStatue || monster is VolcanicGolem)
			{
				outputText("There is nothing to possess inside the golem.");
			}
			//Sample possession text (>79 int, perhaps?):
			else if ((!monster.hasCock() && !monster.hasVagina()) || monster.lustVuln == 0 || monster.inte == 0 || monster.inte > 100) {
				outputText("With a smile and a wink, your form becomes completely intangible, and you waste no time in throwing yourself into the opponent's frame.  Unfortunately, it seems ");
				if (monster.inte > 100) outputText("they were FAR more mentally prepared than anything you can handle, and you're summarily thrown out of their body before you're even able to have fun with them.  Darn, you muse.\n\n");
				else outputText("they have a body that's incompatible with any kind of possession.\n\n");
			}
			//Success!
			else if (possessChance() > rand(100)) {
				outputText("With a smile and a wink, your form becomes completely intangible, and you waste no time in throwing yourself into your opponent's frame. Before they can regain the initiative, you take control of one of their arms, vigorously masturbating for several seconds before you're finally thrown out. Recorporealizing, you notice your enemy's blush, and know your efforts were somewhat successful.");
				var damage:Number = possessCalc();
				monster.teased(damage);
				outputText("\n\n");
			}
			//Fail
			else {
				outputText("With a smile and a wink, your form becomes completely intangible, and you waste no time in throwing yourself into the opponent's frame. Unfortunately, it seems they were more mentally prepared than you hoped, and you're summarily thrown out of their body before you're even able to have fun with them. Darn, you muse. Gotta get smarter.\n\n");
			}
			combat.startMonsterTurn();
		}

		//Whisper
		public function superWhisperAttack():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.ThroatPunch) || player.hasStatusEffect(StatusEffects.WebSilence)) {
				outputText("You cannot focus to reach the enemy's mind while you're having so much difficult breathing.");
				doNext(curry(combat.combatMenu,false));
				return;
			}
			if (monster is Akbal && flags[kFLAGS.AKBAL_QUEST_STATUS] > 0) {
				if (rand(player.inte / 10) == 0) {
					outputText("You reach into your enemy's mind, only to find it completely shrugged off by Akbal's strong resolve.");
					if (rand(2) == 0) {
						outputText("\nTaking advantage of the mental connection you willingly formed, the demon counters with his own assault, ");
						if (player.stun(1,50)) outputText("leaving you stunned and ");
						outputText(" dulling your mind!");
						player.addCombatBuff("inte", -(player.inte / 5));
					}
					player.changeFatigue(10);
				}
				else {
					outputText("You reach into your enemy's mind, striking fear and stress deep into his psyche. You top it off with resounding messages psychically declaring your arrogant dominance over his own spells.\n\n");
					monster.createStatusEffect(StatusEffects.Fear,1,0,0,0);
				}
				combat.startMonsterTurn();
				return;
			}
			if (monster is AkbalUnsealed) {
				outputText("You focus your efforts on addling the demon's mind with your whispers, only to hear Akbal's voice resonating throughout your own mind.");
				outputText("\n[say: How flattering that you respect the skills I taught you. Bending over, time after time, to receive my cock was thanks enough, though.]");
				outputText("\nYour pride isn't happy about this, but a tingling inside you reminds you of the pleasure you felt.");
				player.takeLustDamage(5+rand(6), true);
				combat.startMonsterTurn();
				return;
			}
			if (monster.short == "pod" || monster.inte == 0) {
				outputText("You reach for the enemy's mind, but cannot find anything.  You frantically search around, but there is no consciousness as you know it in the room.\n\n");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			if (monster is LivingStatue || monster is VolcanicGolem)
			{
				outputText("There is nothing inside the golem to whisper to.");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			//player.changeFatigue(10, 1);
			if (monster.findPerk(PerkLib.Focused) >= 0) {
				if (!monster.plural) outputText(monster.capitalA + monster.short + " is too focused for your whispers to influence!\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Enemy too strong or multiplesI think you
			if (player.inte < monster.inte || monster.plural) {
				outputText("You reach for your enemy's mind, but can't break through.\n");
				player.changeFatigue(10);
				combat.startMonsterTurn();
				return;
			}
			//[Failure]
			if (rand(10) == 0) {
				outputText("As you reach for your enemy's mind, you are distracted and the chorus of voices screams out all at once within your mind. You're forced to hastily silence the voices to protect yourself.");
				player.changeFatigue(10);
				combat.startMonsterTurn();
				return;
			}
			outputText("You reach for your enemy's mind, watching as its sudden fear petrifies your foe.\n\n");
			monster.createStatusEffect(StatusEffects.Fear,1,0,0,0);
			combat.startMonsterTurn();
		}

		//Corrupted Fox Fire
		public function corrFoxFireCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			var dmg:int = int(10 + (player.inte / 3 + (display ? 0 : rand(player.inte / 2)) + (maxDamage ? player.inte / 2 : 0)) * player.spellMod());
			dmg = calcInfernoMod(dmg,display);
			if (monster.cor >= 66) dmg = Math.round(dmg * .66);
			else if (monster.cor >= 50) dmg = Math.round(dmg * .8);
			else if (monster.cor >= 25) dmg = Math.round(dmg * 1.0);
			else if (monster.cor >= 10) dmg = Math.round(dmg * 1.2);
			else dmg = Math.round(dmg * 1.3);
			dmg *= 1 + Math.round((monster.lust / monster.maxLust())*0.5);//up to 50% more damage for heavily lusted-up targets!
			dmg = Math.round(dmg * monster.fireRes);
			return combat.globalMod(dmg);
		}

		public function corruptedFoxFire():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.ThroatPunch) || player.hasStatusEffect(StatusEffects.WebSilence)) {
				outputText("You cannot focus to use this ability while you're having so much difficult breathing.");
				doNext(magicalSpecials);
				return;
			}
			currDamage = corrFoxFireCalc();
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			//Deals direct damage and lust regardless of enemy defenses.  Especially effective against non-corrupted targets.
			outputText("Holding out your palm, you conjure corrupted purple flame that dances across your fingertips.  You launch it at " + monster.a + monster.short + " with a ferocious throw, and it bursts on impact, showering dazzling lavender sparks everywhere.  ");
			//Using fire attacks on the goo]
			if (monster.short == "goo-girl") {
				outputText("Your flames lick the girl's body and she opens her mouth in pained protest as you evaporate much of her moisture. When the fire passes, she seems a bit smaller and her slimy " + monster.skin.tone + " skin has lost some of its shimmer.  ");
				if (monster.findPerk(PerkLib.Acid) < 0) monster.createPerk(PerkLib.Acid,0,0,0,0);
			}
			currDamage = combat.doDamage(currDamage, true, true);
			statScreenRefresh();
			outputText("\n\n");
			combat.startMonsterTurn();
		}

		//Fox Fire
		public function foxFireCalc(display:Boolean = false, maxDamage:Boolean = false, heal:Boolean = false):Number{
			var dmg:int = int(10 + (player.inte / 3 + (display ? 0 : rand(player.inte / 2)) + (maxDamage ? player.inte / 2 : 0)) * player.spellMod());
			dmg = calcInfernoMod(dmg,display);
			dmg = combat.globalMod(dmg);
			if (monster.cor >= 66) dmg = Math.round(dmg * 1.2);
			else if (monster.cor >= 50) dmg = Math.round(dmg * 1.0);
			else if (monster.cor >= 25) dmg = Math.round(dmg * 0.8);
			else if (monster.cor >= 10) dmg = Math.round(dmg * 0.66);
			else dmg = Math.round(dmg * 1.3);
			dmg = Math.round(dmg * monster.fireRes);
			if (heal) return (dmg * monster.lust / monster.maxLust()) * 0.6;
			else return dmg;

		}

		public function foxFire():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.ThroatPunch) || player.hasStatusEffect(StatusEffects.WebSilence)) {
				outputText("You cannot focus to use this ability while you're having so much difficult breathing.");
				doNext(magicalSpecials);
				return;
			}
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			//Deals direct damage and lust regardless of enemy defenses.  Especially effective against corrupted targets.
			outputText("Holding out your palm, you conjure an ethereal blue flame that dances across your fingertips.  You launch it at " + monster.a + monster.short + " with a ferocious throw, and it bursts on impact, showering dazzling azure sparks everywhere.  ");
			currDamage = foxFireCalc();
			//Using fire attacks on the goo]
			if (monster.short == "goo-girl") {
				outputText("Your flames lick the girl's body and she opens her mouth in pained protest as you evaporate much of her moisture. When the fire passes, she seems a bit smaller and her slimy " + monster.skin.tone + " skin has lost some of its shimmer.  ");
				if (monster.findPerk(PerkLib.Acid) < 0) monster.createPerk(PerkLib.Acid,0,0,0,0);
			}
			currDamage = combat.doDamage(currDamage, true, true);
			if(monster.lust >= 1){
			outputText("\nThe spell reacts to your target's lust, invigorating you! ");
			player.HPChange(Math.round((currDamage * monster.lust/monster.maxLust()) *0.6), true);
			}
			statScreenRefresh();
			outputText("\n\n");
			combat.startMonsterTurn();
		}
		//Terror
		public function kitsuneChanceCalc():Number{
			if(monster.hasStatusEffect(StatusEffects.Shell) || monster.short == "pod" || monster.inte == 0) return 0
			var chance:Number = Math.round((100 + (player.inte * .1 - monster.inte * .1 - 9 - monster.statusEffectv2(StatusEffects.Fear) * 2)*5));
			return Math.max(0,Math.min(100,chance));

		}

		public function kitsuneTerror():void {
			clearOutput();
			//Fatigue Cost: 25
			if (player.hasStatusEffect(StatusEffects.ThroatPunch) || player.hasStatusEffect(StatusEffects.WebSilence)) {
				outputText("You cannot focus to reach the enemy's mind while you're having so much difficult breathing.");
				doNext(magicalSpecials);
				return;
			}
			if (monster is AkbalUnsealed) {
				outputText("The world twists around as you attempt to addle the mind of the demon, only to find it has no effect.");
				outputText("\n[say: The mind is my weapon, and I had a lot of time to refine it when I was unable to speak.]");
				outputText("\nHis words echo in haughty arrogance.");
				combat.startMonsterTurn();
				return;
			}
			if (monster.short == "pod" || monster.inte == 0) {
				outputText("You reach for the enemy's mind, but cannot find anything.  You frantically search around, but there is no consciousness as you know it in the room.\n\n");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			//Inflicts fear and reduces enemy SPD.
			outputText("The world goes dark, an inky shadow blanketing everything in sight as you fill " + monster.a + monster.short + "'s mind with visions of otherworldly terror that defy description.");
			//(succeed)
			if (kitsuneChanceCalc() > rand(100)) {
				outputText("  They cower in horror as they succumb to your illusion, believing themselves beset by eldritch horrors beyond their wildest nightmares.\n\n");
				//Create status effect and increment.
				if (monster.statusEffectv2(StatusEffects.Fear) > 0)
					monster.addStatusValue(StatusEffects.Fear, 2, 1)
				else
					monster.createStatusEffect(StatusEffects.Fear, 0, 1, 0, 0);
				monster.addStatusValue(StatusEffects.Fear, 1, 5);
				monster.spe -= 5;
				if (monster.spe < 1) monster.spe = 1;
			}
			else {
				outputText("  The dark fog recedes as quickly as it rolled in as they push back your illusions, resisting your hypnotic influence.");
				if (monster.statusEffectv2(StatusEffects.Fear) >= 4) outputText(" Your foe might be resistant by now.");
				outputText("\n\n");
			}
			combat.startMonsterTurn();
		}
		//Illusion
		public function kitsuneIllusionChance():Number{
			if(monster.hasStatusEffect(StatusEffects.Shell) || monster.short == "pod" || monster.inte == 0) return 0
			var chance:Number = Math.round((100 + (player.inte * .1 - monster.inte * .1 - 9 - monster.statusEffectv1(StatusEffects.Illusion) * 2)*5));
			return Math.max(0,Math.min(100,chance));
		}

		public function kitsuneIllusion():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.ThroatPunch) || player.hasStatusEffect(StatusEffects.WebSilence)) {
				outputText("You cannot focus to use this ability while you're having so much difficult breathing.");
				doNext(magicalSpecials);
				return;
			}
            var oldMonster:Monster = monster;
			for each(var currMonster:Monster in monsterArray){
                monster = currMonster;
				kitsuneIllusionExec();
            }
			monster = oldMonster;
			combat.startMonsterTurn();
		}

		public function kitsuneIllusionExec():void{
			if (monster is AkbalUnsealed) {
				outputText("The world twists around as you attempt to addle the mind of the demon, only to find it has no effect.");
				outputText("\n[say: The mind is my weapon, and I had a lot of time to refine it when I was unable to speak.]");
				outputText("\nHis words echo in haughty arrogance.");
				return;
			}
				if (monster.short == "pod" || monster.inte == 0) {
					outputText("In the tight confines of this pod, there's no use making such an attack!\n\n");
					player.changeFatigue(1);
					return;
				}
				//Decrease enemy speed and increase their susceptibility to lust attacks if already 110% or more
				outputText("The world begins to twist and distort around you as reality bends to your will, " + monster.a + monster.short + "'s mind blanketed in the thick fog of your illusions.");
				//Check for success rate. Maximum 100% with over 90 Intelligence difference between PC and monster. There are diminishing returns. The more you cast, the harder it is to apply another layer of illusion.
				if (kitsuneIllusionChance() > rand(100)) {
				//Reduce speed down to -20. Um, are there many monsters with 110% lust vulnerability?
					outputText("  They stumble humorously to and fro, unable to keep pace with the shifting illusions that cloud their perceptions.\n\n");
					if (monster.statusEffectv1(StatusEffects.Illusion) > 0) monster.addStatusValue(StatusEffects.Illusion, 1, 1);
					else monster.createStatusEffect(StatusEffects.Illusion, 1, 0, 0, 0);
					if (monster.spe >= 0) monster.spe -= (20 - (monster.statusEffectv1(StatusEffects.Illusion) * 5));
					if (monster.lustVuln > 0) monster.lustVuln += .1;
					if (monster.spe < 1) monster.spe = 1;
				}
				else {
					outputText("  Like the snapping of a rubber band, reality falls back into its rightful place as they resist your illusory conjurations.\n\n");
				}
		}

		public function lightRailHitChance(numOfStrikes:int = 0):Number{
			if (numOfStrikes == 0) return 100;
			var toHitBonus:Number = 30 - 15*numOfStrikes;
			return monster.standardDodgeFunc(player, toHitBonus);
		}

		public function lightRailDamage(display:Boolean = false, maxDamage:Boolean = false):Number{
			return combat.globalMod(10 + (player.spe / 3 + (display ? 0 : rand(player.spe / 2)) + (maxDamage ? player.spe / 2 : 0)) * player.physMod());
		}

		public function lightRailAvenger(finish:Boolean = false, numOfStrikes:int = 0):void{
			clearOutput();
			if (!finish){
				outputText("You unsheathe your trusty blade in the blink of an eye, and position yourself, resting the blade on your fingers, your arm stretched.");
				outputText("\n[say: Sensei, onegaishimasu!]");
				outputText("\nTime itself stops to witness your unlabored flawlessness. You prepare to strike, faster than any living thing could hope to perceive.\n");
				menu();
				addButton(0, "Strike!", lightRailStrike).hint("Attempt to strike your foe. ("+ Math.round(lightRailDamage(true)) + "-" +Math.round(lightRailDamage(true,true)) + ")(" + lightRailHitChance() + "%)");
			}else{
				if (numOfStrikes > 0){
					player.weapon.weaponXP(2+rand(7));
					outputText("[say: It is over.]");
					outputText("\nYou twirl your trusty katana in your hands and being sheathing it, slowly.");
					outputText("\nYou slow down at the very last inch. You then finish swiftly, the hand guard making a clicking sound when it collides with the wood sheath.\n\n");
					for (var i:int = 0; i <= numOfStrikes; i++){
						outputText(monster.capitalA + monster.short + " gets hit by a phantom strike!");
						currDamage = combat.doDamage(lightRailDamage(), true, true, false);
						if (rand(2) == 0 && monster.bleed(player,3, 2)) outputText("\nYour precision strikes causes wounds to burst with blood in gruesome jets!");
						outputText("\n");
					}
				}
				outputText("[say: My greatest strength... my greatest curse.]\n\n");
				combat.startMonsterTurn();

			}
		}

		public function lightRailStrike(numOfStrikes:int = 0):void{
			menu();
			if (combatAvoidDamage({doParry:false,doBlock:false,toHitChance:lightRailHitChance(numOfStrikes)}).failed){
				switch(numOfStrikes){
					case 0:
						outputText("[say: Live for the blade!]");
						break;
					case 1:
						outputText("[say: Die for the blade!]");
						break;
					case 2:
						outputText("[say: It is me that I spite as I stand up and fight!]");
						break;
					case 3:
						outputText("[say: There will be bloodshed!]");
						break;
					case 4:
						outputText("[say: The only one left...]");
						break;
					case 5:
						outputText("[say: WILL RIDE UPON THE DRAGON'S BACK!]");
						numOfStrikes += 3;
						break;
				}
				outputText("\nYou strike again, blade cutting the air as fast as light itself!\n");
				numOfStrikes++;
				if(numOfStrikes < 7) addButton(0, "Strike!", lightRailStrike, numOfStrikes).hint("Attempt to strike your foe.("+ Math.round(lightRailDamage(true) * (numOfStrikes+1)) + "-" +Math.round(lightRailDamage(true,true) * (numOfStrikes+1)) + ")(" + lightRailHitChance(numOfStrikes) + "%)");
				addButton(1, "Owari desu.", lightRailAvenger, true,numOfStrikes).hint("It is finished.");
			}else{
				outputText("\nYou strike again, but miss your target!\n");
				outputText("The shame is too much for you to handle, and you hurt yourself in punishment!");
				player.takeDamage(100 + rand(100), true);
				doNext(curry(lightRailAvenger, true, 0));
			}

		}

		//Stare
		public function paralyzingStareChance(slowEffect:Number = 0,stareTraining:Number = 0):Number{
			if (monster is EncapsulationPod || monster.inte == 0 || monster.hasPerk(PerkLib.BasiliskResistance) || monster.hasStatusEffect(StatusEffects.Shell) || slowEffect >= 3) return 0;
			var chance:Number = Math.round(monster.inte + 110 - stareTraining * 30 + slowEffect * 10 - player.inte);
			return Math.max(0, Math.max(100, chance));
		}

		public function paralyzingStare():void
		{
			var theMonster:String      = monster.a + monster.short;
			var TheMonster:String      = monster.capitalA + monster.short;
			var stareTraining:Number   = Math.min(1, flags[kFLAGS.BASILISK_RESISTANCE_TRACKER] / 100);
			var magnitude:Number       = 16 + stareTraining * 8;
			var bse:BasiliskSlowDebuff = monster.createOrFindStatusEffect(StatusEffects.BasiliskSlow) as BasiliskSlowDebuff;
			var oldSpeed:Number        = monster.spe;
			var speedDiff:int          = 0;
			var message:String         = "";
			if (stareTraining > 1) stareTraining = 1;

			output.clear();
			//Fatigue Cost: 20
			if (player.hasStatusEffect(StatusEffects.ThroatPunch) || player.hasStatusEffect(StatusEffects.WebSilence)) {
				output.text("You cannot talk to keep up the compulsion while you're having so much difficulty breathing.");
				doNext(magicalSpecials);
				return;
			}
			if (monster is EncapsulationPod || monster.inte == 0) {
				output.text("In the tight confines of this pod, there's no use making such an attack!\n\n");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			if (monster is TentacleBeast) {
				output.text("You try to find the beast's eyes to stare at them, but you soon realize, that it has none at all!\n\n");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			if (monster.findPerk(PerkLib.BasiliskResistance) >= 0) {
				output.text("You attempt to apply your paralyzing stare at " + theMonster + ", but you soon realize, that " + monster.pronoun1
				           +" is immune to your eyes, so you quickly back up.\n\n");
				combat.startMonsterTurn();
				return;
			}
			if (monster.hasStatusEffect(StatusEffects.Shell)) {
				output.text("As soon as your magic touches the multicolored shell around " + theMonster + ", it sizzles and fades to nothing."
				           +"  Whatever that thing is, it completely blocks your magic!\n\n");
				combat.startMonsterTurn();
				return;
			}

			output.text("You open your mouth and, staring at " + theMonster + ", uttering calming words to soothe " + monster.pronoun3 + " mind."
			           +"  The sounds bore into " + theMonster + "'s mind, working and buzzing at the edges of " + monster.pronoun3 + " resolve,"
			           +" suggesting, compelling, then demanding " + monster.pronoun2 + " to look into your eyes.  ");

			if (!monster.hasStatusEffect(StatusEffects.BasiliskCompulsion) && (monster.inte + 110 - stareTraining * 30 - player.inte < rand(100))) {
			//Reduce speed down to -24 (no training) or -36 (full training).
				message = TheMonster + " can't help " + monster.pronoun2 + "self... " + monster.pronoun1 + " glimpses your eyes. " + monster.Pronoun1
				        + " looks away quickly, but " + monster.pronoun1 + " can picture them in " + monster.pronoun3 + " mind's eye, staring in at "
				        + monster.pronoun3 + " thoughts, making " + monster.pronoun2 + " feel sluggish and unable to coordinate. Something about the"
				        + " helplessness of it feels so good... " + monster.pronoun1 + " can't banish the feeling that really, " + monster.pronoun1
				        + " wants to look into your eyes forever, for you to have total control over " + monster.pronoun2 + ". ";
				bse.applyEffect(magnitude);
				monster.createStatusEffect(StatusEffects.BasiliskCompulsion, magnitude * 0.75, 0, 0, 0);
				flags[kFLAGS.BASILISK_RESISTANCE_TRACKER] += 4;
				speedDiff = Math.round(oldSpeed - monster.spe);
				output.text(message + combat.getDamageText(speedDiff) + "\n\n");
			} else {
				output.text("Like the snapping of a rubber band, reality falls back into its rightful place as " + monster.a + monster.short + " escapes your gaze.\n\n");
				flags[kFLAGS.BASILISK_RESISTANCE_TRACKER] += 2;
			}
			combat.startMonsterTurn();
		}

		//------------
		// P. SPECIALS
		//------------
		public function physicalSpecials():void {
			if (game.urtaQuest.isUrta()) {
				game.urtaQuest.urtaSpecials();
				return;
			}
			if (game.inCombat && player.hasStatusEffect(StatusEffects.Sealed) && player.statusEffectv2(StatusEffects.Sealed) == 5) {
				clearOutput();
				outputText("You try to ready a special attack, but wind up stumbling dizzily instead.  Your ability to use physical special attacks was sealed, and now you've wasted a chance to attack!\n\n");
				combat.startMonsterTurn();
				return;
			}
			menu();
			var button:int = 0;
			for each(var ability:CombatAbility in physicalAbilities){
				button = ability.createButton(button);
			}
			addButton(14, "Back", combat.combatMenu, false);
		}

		//Unleash Brood - Premise: Bleed/slow/physical damage attack. Can burst big speed hit if lucky, but only once. Once enemy is at min speed, the tentacles drag them under, doing increased damage. Single targets take especially high damage as you temporarily unbirth them in combat. Only available at high infestation levels and has a significant cooldown, to force players to combine with other attacks and make actually zeroing speed pretty rare. Some bits were borrowed from the foxfire and basilisk stare abilities, though I simplified the basilisk stuff a crud ton.
		public function broodBiteCalc(display:Boolean = false, minDamage:Boolean = false,maxDamage:Boolean = false):Number{
			//Toughness based, bleed inducing, physically oriented damage similar to foxfire. Boosted the numbers a bit since foxfire doesn't have to worry about physical resistance. Once speed drain caps, does increased damage, with significant boost against single targets.
			var dmg:int = int(10 + (player.tou / 3 + (display ? 0 : rand(player.inte / 2)) + (maxDamage ? player.inte / 2 : 0)) * player.spellMod());
			if (monster.spe < 1 && !monster.plural) dmg = Math.round(dmg * 5.0);
			else if (monster.spe < 1 && monster.plural) dmg = Math.round(dmg * 2.5);
			else dmg = Math.round(dmg * 1.0);
			//Deal damage and update based on perks
			if (dmg > 0) {
				dmg *= player.physMod();
				dmg = combat.globalMod(dmg);
			}
			if(minDamage) return monster.reduceDamageMin(dmg);
			if(maxDamage) return monster.reduceDamageMax(dmg);
			return  monster.reduceDamageCombat(dmg);
		}

		public function unleashBrood():void
		{
			var theMonster:String      = monster.a + monster.short;
			var TheMonster:String      = monster.capitalA + monster.short;

			output.clear();
			//If Can't Use/Doesn't Hit
			if (player.fatigue + player.spellCost(35) > player.maxFatigue()) {
				output.text("You are too tired to use this ability.");
				doNext(physicalSpecials);
				return;
			}
			if (monster is EncapsulationPod || monster.inte == 0) {
				output.text("In the tight confines of this pod, there's no use making such an attack!\n\n");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			if (monster is TentacleBeast) {
				output.text("The monstrous Tentacle Beast is grateful to you for providing it with such a delicious snack! It is currently too lively for this attack to be successful.\n\n");
				player.changeFatigue(1);
				combat.startMonsterTurn();
				return;
			}
			if (monster.hasStatusEffect(StatusEffects.Shell)) {
				output.text("As soon as your brood touches the multicolored shell around " + theMonster + ", they sizzles and bake, screaming in pain, then retreat back into you to nurse their wounds, having no effect."
				           +"  Whatever that thing is, it completely blocks your brood!\n\n");
				combat.startMonsterTurn();
				return;
			}

			//If Hits
			output.text("You spread your legs and a stream of feathered, slimy tentacles plop out of your " + player.vaginaDescript(0) + ", swarming " + theMonster + " and attempting to paralyze " + monster.pronoun3 + " so that they can pull " + monster.pronoun3 + " into your womb.");

			//Damage Description
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			currDamage = broodBiteCalc();
						if (currDamage <= 0) {
				currDamage = 0;
				outputText("Your brood's bites are deflected or blocked by " + monster.a + monster.short + ". ");
			}
			if (currDamage > 0 && currDamage < 10) {
				outputText("You brood's bites don't do much damage to " + monster.a + monster.short + "! ");
			}
			if (currDamage >= 10 && currDamage < 20) {
				outputText("You seriously wound " + monster.a + monster.short + " with your brood's bites! ");
			}
			if (currDamage >= 20 && currDamage < 30) {
				outputText("Your brood's bites stagger " + monster.a + monster.short + " with their force. ");
			}
			if (currDamage >= 30) {
				outputText("Your brood's powerful bites mutilate " + monster.a + monster.short + "! ");
			}
			currDamage = combat.doDamage(currDamage, true, true);
			outputText("\n\n");

			//Slow & Paralysis Description
			if (!monster.hasStatusEffect(StatusEffects.NephilaCompulsion)) {
			//Initial attack. -10 + twice player infestation level speed.
				outputText(TheMonster + " [if (monster.plural)struggle|struggles] to resist the wave of hungry slimes, but they are in a frenzy and [if (monster.plural)the monster is|the monsters are] significantly hindered.\n\n");
				monster.createStatusEffect(StatusEffects.NephilaCompulsion, -10 - int(player.statusEffectv1(StatusEffects.ParasiteNephila) * 5), 0, 0, 0);
				if (monster.spe < 0) monster.spe = 0;
			if (monster.bleed(player)) {
				outputText("\n" + monster.capitalA + monster.short + " [if (monster.plural)bleed|bleeds] profusely from the many bloody punctures your hungry children make as they seek to consume them alive.\n\n");
				} else {
				if (monster is LivingStatue) outputText("Despite the rents your swarming children have torn in its stony exterior, the statue does not bleed.\n\n");
			}
			//Final attack. Enables high damage.
			} else if (monster.spe < 1) {
				if (!monster.plural) outputText(monster.capitalA + monster.short + " is completely covered in parasites. Thrashing and wailing, they are dragged to the ground and hauled to your [vagina] on a wave of thrashing tentacles. The  tentacles shove them through your hyper-swollen kitty, causing your belly to swell tremendously with your new load. Whatever happens to your victim inside your tum, it involves massive damage! After, to prevent  its still energetic thrashing from hurting your precious womb, you eject it out your gaping love maw in a wave of ooze and tentacles.\n\n");
				else outputText(monster.capitalA + monster.short + " are completely covered in parasites. Thrashing and wailing, they can't prevent the squirming tentacles from doing massive damage!\n\n");
			if (monster.bleed(player)) {
				outputText("\n" + monster.capitalA + monster.short + " [if (monster.plural)bleed|bleeds] profusely from the many bloody punctures that your hungry children make as they seek to consume them alive.(" + Math.round(biteCalc(true)) + "-" +Math.round(biteCalc(false, true)) + ")");
				} else {
				if (monster is LivingStatue) outputText("Despite the rents your swarming children have torn in its stony exterior, the statue does not bleed.");
			}
			//Intermediate attacks. Less powerful speed drain.
			} else {
				if (!monster.plural) outputText(TheMonster + " struggles to resist the wave of hungry slimes. They are bowled over and dragged towards you for a moment, but ultimately manage to right themselves.\n\n");
				else outputText(monster.capitalA + monster.short + " struggle to resist the wave of hungry slimes. They are bowled over and dragged towards you for a moment, but ultimately manage to right themselves.\n\n");
				monster.spe -= 30;
				if (monster.spe < 0) monster.spe = 0;
			if (monster.bleed(player)) {
				outputText("\n" + monster.capitalA + monster.short + " [if (monster.plural)bleed|bleeds] profusely from the many bloody punctures that your hungry children make as they seek to consume them alive.(" + Math.round(biteCalc(true)) + "-" +Math.round(biteCalc(false, true)) + ")");
				} else {
				if (monster is LivingStatue) outputText("Despite the rents your swarming children have torn in its stony exterior, the statue does not bleed.");
			}

			}
			combat.startMonsterTurn();
		}

		public function anemoneCalc(display:Boolean = false, maxDamage:Boolean = false, speedDamage:Boolean = false):Number{
				var damage:Number = 0;
				var charges:int = Math.min(Math.round(player.hair.length/12), 3);
				var temp:Number = Math.round(charges + (display ? 0 : rand(Math.min(charges * 2, 4))) + (maxDamage ? Math.min(charges * 2, 4) : 0));
				damage += 5 * temp + (display ? 0 : rand(6 * temp)) + (maxDamage ? 6 * temp : 0);
				damage += player.level * 1.5;
				damage = monster.lustVuln * damage;
				if (speedDamage) return damage / 2;
				return damage;
		}

		public function anemoneChance():Number{
			return monster.standardDodgeFunc(player,-20 + player.hair.length);
		}
		public function anemoneSting():void {
			clearOutput();
			//-sting with hair (combines both bee-sting effects, but weaker than either one separately):
			//Fail!
			//25% base fail chance
			//Increased by 1% for every point over PC's speed
			//Decreased by 1% for every inch of hair the PC has
			if (!combatAvoidDamage({doParry:false,doBlock:false,toHitChance:anemoneChance()}).failed) {
				//-miss a sting
				if (monster.plural) outputText("You rush " + monster.a + monster.short + ", whipping your hair around to catch them with your tentacles, but " + monster.pronoun1 + " easily dodge.  Oy, you hope you didn't just give yourself whiplash.");
				else outputText("You rush " + monster.a + monster.short + ", whipping your hair around to catch it with your tentacles, but " + monster.pronoun1 + " easily dodges.  Oy, you hope you didn't just give yourself whiplash.");
			}
			//Success!
			else {
				outputText("You rush " + monster.a + monster.short + ", whipping your hair around like a genie");
				outputText(", and manage to land a few swipes with your tentacles.  ");
				if (monster.plural) outputText("As the venom infiltrates " + monster.pronoun3 + " bodies, " + monster.pronoun1 + " twitch and begin to move more slowly, hampered half by paralysis and half by arousal.");
				else outputText("As the venom infiltrates " + monster.pronoun3 + " body, " + monster.pronoun1 + " twitches and begins to move more slowly, hampered half by paralysis and half by arousal.");
				//(decrease speed/str, increase lust)
				//-venom capacity determined by hair length, 2-3 stings per level of length
				//Each sting does 5-10 lust damage and 2.5-5 speed damage
				var damage:Number = anemoneCalc();
                monster.spe -= damage/2;
				if (player.hair.length >= 12) temp += 1 + rand(2);
				if (player.hair.length >= 24) temp += 1 + rand(2);
				if (player.hair.length >= 36) temp += 1;
				//Clean up down to 1 decimal point
				damage = Math.round(damage*10)/10;
				monster.teased(damage);
			}
			//New lines and moving on!
			outputText("\n\n");
			doNext(combat.combatMenu);
			if (!combat.combatRoundOver()) combat.startMonsterTurn();
		}

		//Mouf Attack
		public function biteCalc(minDamage:Boolean = false,maxDamage:Boolean = false):Number{
			//Determine damage - str modified by enemy toughness!
			var damage:Number = player.str + 45;

			//Deal damage and update based on perks
			if (damage > 0) {
				damage *= player.physMod();
				damage = combat.globalMod(damage);
			}
			if(minDamage) return monster.reduceDamageMin(damage);
			if(maxDamage) return monster.reduceDamageMax(damage);
			return  monster.reduceDamageCombat(damage);
		}

		public function bite():void {
			clearOutput();
			//Worms are special
			if (monster.short == "worms") {
				outputText("There is no way those are going anywhere near your mouth!\n\n");
				menu();
				addButton(0, "Next", combat.combatMenu, false);
				return;
			}
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			outputText("You open your mouth wide, your shark teeth extending out. Snarling with hunger, you lunge at your opponent, set to bite right into them!  ");
			if (player.hasStatusEffect(StatusEffects.Blind)) outputText("In hindsight, trying to bite someone while blind was probably a bad idea... ");
			currDamage = biteCalc();
			//Determine if dodged!
			if (combatAvoidDamage({doDodge:true,doParry:false,doBlock:false}).success) {
				if (monster.spe - player.spe < 8) outputText(monster.capitalA + monster.short + " narrowly avoids your attack!");
				if (monster.spe - player.spe >= 8 && monster.spe-player.spe < 20) outputText(monster.capitalA + monster.short + " dodges your attack with superior quickness!");
				if (monster.spe - player.spe >= 20) outputText(monster.capitalA + monster.short + " deftly avoids your slow attack.");
				outputText("\n\n");
				combat.startMonsterTurn();
				return;
			}
			if (currDamage <= 0) {
				currDamage = 0;
				outputText("Your bite is deflected or blocked by " + monster.a + monster.short + ". ");
			}
			if (currDamage > 0 && currDamage < 10) {
				outputText("You bite doesn't do much damage to " + monster.a + monster.short + "! ");
			}
			if (currDamage >= 10 && currDamage < 20) {
				outputText("You seriously wound " + monster.a + monster.short + " with your bite! ");
			}
			if (currDamage >= 20 && currDamage < 30) {
				outputText("Your bite staggers " + monster.a + monster.short + " with its force. ");
			}
			if (currDamage >= 30) {
				outputText("Your powerful bite mutilates " + monster.a + monster.short + "! ");
			}
			if (currDamage > 0){
				if (monster.bleed(player)) outputText("\nAs you finish your bite, your sharp, serrated teeth leave lasting wounds in " + monster.a + monster.short + ", causing " + monster.pronoun2 + " to bleed profusely!");
			}
			currDamage = combat.doDamage(currDamage, true,true);
			outputText("\n\n");
			//Kick back to main if no damage occured!
			combat.startMonsterTurn();

		}

		public function nagaCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			return 5 + (display ? 0 : rand(5)) + (maxDamage ? 5 : 0);
		}

		public function nagaChance():Number{
			if (monster.hasPerk(PerkLib.PoisonImmune)) return 0;
			if (monster.hasStatusEffect(StatusEffects.Constricted)) return 100;
			var chance:Number = Math.round((1 + (20 - monster.spe / 1.5) / (player.spe / 2 + 40)) * 100) - monster.getEvasionChance() + player.chanceToHit() - 95;
			return Math.max(0, Math.min(chance, 100));
		}

		public function nagaBiteAttack():void {
			clearOutput();
			if (monster.findPerk(PerkLib.PoisonImmune) >= 0)
			{
				outputText(monster.capitalA + monster.short + " is immune to any type of poison! Your bite does nothing!\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Works similar to bee stinger, must be regenerated over time. Shares the same poison-meter
		    if (nagaChance() > rand(100)) {
				//(if monster = demons)
				if (monster.short == "demons") outputText("You look at the crowd for a moment, wondering which of their number you should bite. Your glance lands upon the leader of the group, easily spotted due to his snakeskin cloak. You quickly dart through the demon crowd as it closes in around you and lunge towards the broad form of the leader. You catch the demon off guard and sink your needle-like fangs deep into his flesh. You quickly release your venom and retreat before he, or the rest of the group manage to react.");
				//(Otherwise)
				else outputText("You lunge at the foe headfirst, fangs bared. You manage to catch " + monster.a + monster.short + " off guard, your needle-like fangs penetrating deep into " + monster.pronoun3 + " body. You quickly release your venom, and retreat before " + monster.pronoun1 + " manages to react.");
				//The following is how the enemy reacts over time to poison. It is displayed after the description paragraph,instead of lust
				var oldMonsterStrength:Number = monster.str;
				var oldMonsterSpeed:Number = monster.spe;
				var effectTexts:Array = [];
				var strengthDiff:Number = 0;
				var speedDiff:Number = 0;
				monster.str -= nagaCalc();
				monster.spe -= nagaCalc();
				if (monster.str < 1) monster.str = 1;
				if (monster.spe < 1) monster.spe = 1;

				strengthDiff = oldMonsterStrength - monster.str;
				speedDiff    = oldMonsterSpeed    - monster.spe;
				if (strengthDiff > 0)
					effectTexts.push(monster.pronoun3 + " strength by " + strengthDiff + "");
				if (speedDiff > 0)
					effectTexts.push(monster.pronoun3 + " speed by " + speedDiff + "");
				if (effectTexts.length > 0)
					outputText("\n\nThe poison reduced " + formatStringArray(effectTexts) + "!");
				if (monster.hasStatusEffect(StatusEffects.NagaVenom))
				{
					monster.addStatusValue(StatusEffects.NagaVenom,1,1);
				}else
					monster.createStatusEffect(StatusEffects.NagaVenom,1,0,0,0);
			}
			else {
		       outputText("You lunge headfirst, fangs bared. Your attempt fails horrendously, as " + monster.a + monster.short + " manages to counter your lunge, knocking your head away with enough force to make your ears ring.");
			}
			outputText("\n\n");
			combat.startMonsterTurn();
		}

		public function counterAbility():void {
			clearOutput();
			doNext(combat.combatMenu);
			player.createStatusEffect(StatusEffects.CounterAB, 0, 3, 0, 0);
			if(monster.distance == CombatAttackData.DISTANCE_MELEE) combat.attack();
			else {
                outputText("You move into the stance taught to you by the Dullahan. You'll not be able to strike as effectively, but you have a chance of countering enemy attacks!\n");
				combat.startMonsterTurn();
            }

		}

		public function testResolve():void{
			clearOutput();
			outputText("You take the talisman and peer deeply into it. You're granted a brief glimpse into terrible truths, of impending doom and of revelations beyond your comprehension. You stagger backwards as your mind is twisted, attempting to deal with the horrors you've just witnessed.\n\n");
			outputText("Your resolve is being tested...\n");
			doNext(testResolve2);
		}

		public function testResolve2():void{
			game.dungeons.manor.testResolve();
			outputText("\n\n");
			doNext(curry(combat.combatMenu, false));
			return;
		}

		public function parasiteCalc():Number{
			return Math.min(player.statusEffectv1(StatusEffects.ParasiteEel) * 2,20);
		}

		public function parasiteQueen():void {
			clearOutput();
			var parasites:int = parasiteCalc();
			player.createStatusEffect(StatusEffects.ParasiteQueen, parasites, 0, 0, 0);
			mainView.statsView.showStatUp('str');
			mainView.statsView.showStatUp('tou');
			mainView.statsView.showStatUp('spe');
			statScreenRefresh();

			doNext(combat.combatMenu);
			if (monster is FrostGiant && player.hasStatusEffect(StatusEffects.GiantBoulder)) {
				(monster as FrostGiant).giantBoulderHit(2);
				combat.startMonsterTurn();
				return;
			}
			outputText("You focus and send a mental order to your spawn to sacrifice themselves for the sake of their broodmother!\n\n");
			outputText("The parasites answer the call and sacrifice themselves for you. You feel your body grow with newfound power!");
			player.addStatusValue(StatusEffects.ParasiteEel, 1, -1);
			outputText("\n\n");
			combat.startMonsterTurn();
			return;
		}

		public function parasiteReleaseMusk():void {
			clearOutput();
			//Deal lust damage to the enemy and to the player every turn. The player receives less base damage.
			//Costs nothing due to double edge? Gotta think about it.
			if (player.cockTotal() == 1) outputText("You grab your " + player.cockDescript() + " and stroke it a few times, rapidly generating several strands of precum. You shake it around for a moment, and soon the entire battlefield is covered in the overwhelming musk your parasite generates.\n");
			if (player.cockTotal() > 1) outputText("You grab one of your" + player.multiCockDescript() + " and stroke it a few times, rapidly generating several strands of precum. You shake it around for a moment, and soon the entire battlefield is covered in the overwhelming musk your parasite generates.\n");
			outputText("Your head swims a bit, and you hope that your enemy is also affected by it.");
			player.createStatusEffect(StatusEffects.ParasiteSlugMusk, 4, 0, 0, 0);
			//New lines and moving on!
			outputText("\n\n");
			doNext(combat.combatMenu);
			if (!combat.combatRoundOver()) combat.startMonsterTurn();
		}

		public function nephilaCalc():Number{
			return Math.min(player.statusEffectv1(StatusEffects.ParasiteNephila) * 5,50);
		}

		public function nephilaQueen():void {
			clearOutput();
			var parasites:int = nephilaCalc();
			player.createStatusEffect(StatusEffects.NephilaQueen, parasites, 0, 0, 0);
			mainView.statsView.showStatUp('int');
			statScreenRefresh();

			doNext(combat.combatMenu);
			if (monster is FrostGiant && player.hasStatusEffect(StatusEffects.GiantBoulder)) {
				(monster as FrostGiant).giantBoulderHit(2);
				combat.startMonsterTurn();
				return;
			}
			outputText("You focus and send a mental order to your spawn to sacrifice themselves for the sake of their broodmother!\n\n");
			//outputText("The nephila tentacles answer the call and sacrifice themselves for you. You feel your body grow with newfound power!");
			player.addStatusValue(StatusEffects.ParasiteEel, 1, -1);
			outputText("\n\n");
			combat.startMonsterTurn();
			return;
		}

		public function spiderbiteCalc():Number{
			return 25 * monster.lustVuln;
		}

		public function spiderbiteChance():Number{
			if (monster.hasPerk(PerkLib.PoisonImmune)) return 0;
			if (monster.hasStatusEffect(StatusEffects.Constricted)) return 100;
			var chance:Number = Math.round((1 + (20 - monster.spe / 1.5) / (player.spe / 2 + 40)) * 100) - monster.getEvasionChance() + player.chanceToHit() - 95;
			return Math.max(0, Math.min(chance, 100));
		}

		public function spiderBiteAttack():void {
			clearOutput();
			if (monster.findPerk(PerkLib.PoisonImmune) >= 0)
			{
				outputText(monster.a + monster.short + " is immune to any type of poison! Your bite does nothing!\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Works similar to bee stinger, must be regenerated over time. Shares the same poison-meter
		    if (spiderbiteChance() > rand(100)) {
				//(if monster = demons)
				if (monster.short == "demons") outputText("You look at the crowd for a moment, wondering which of their number you should bite. Your glance lands upon the leader of the group, easily spotted due to his snakeskin cloak. You quickly dart through the demon crowd as it closes in around you and lunge towards the broad form of the leader. You catch the demon off guard and sink your needle-like fangs deep into his flesh. You quickly release your venom and retreat before he, or the rest of the group manage to react.");
				//(Otherwise)
				else {
					if (!monster.plural) outputText("You lunge at the foe headfirst, fangs bared. You manage to catch " + monster.a + monster.short + " off guard, your needle-like fangs penetrating deep into " + monster.pronoun3 + " body. You quickly release your venom, and retreat before " + monster.a + monster.pronoun1 + " manages to react.");
					else outputText("You lunge at the foes headfirst, fangs bared. You manage to catch one of " + monster.a + monster.short + " off guard, your needle-like fangs penetrating deep into " + monster.pronoun3 + " body. You quickly release your venom, and retreat before " + monster.a + monster.pronoun1 + " manage to react.");
				}
				//React
				if (monster.lustVuln == 0) outputText("  Your aphrodisiac toxin has no effect!");
				else {
					if (monster.plural) outputText("  The one you bit flushes hotly, though the entire group seems to become more aroused in sympathy to their now-lusty compatriot.");
					else outputText("  " + monster.mf("He","She") + " flushes hotly and " + monster.mf("touches his suddenly-stiff member, moaning lewdly for a moment.","touches a suddenly stiff nipple, moaning lewdly.  You can smell her arousal in the air."));
					var lustDmg:int = spiderbiteCalc();
					if (rand(5) == 0) lustDmg *= 2;
					monster.teased(lustDmg);
				}
			}
			else {
		       outputText("You lunge headfirst, fangs bared. Your attempt fails horrendously, as " + monster.a + monster.short + " manages to counter your lunge, pushing you back out of range.");
			}
			outputText("\n\n");
			combat.startMonsterTurn();
		}

		public function fireBowCalc(display:Boolean = false, maxDamage:Boolean = false):Object{
			//Hit!  Damage calc! 20 +
			var damage:Number = 0;
			var miniCrit:Boolean = false;
			var crit:Boolean = false;
			if (player.hasPerk(PerkLib.NoBaggage) && player.weapon == WeaponLib.FISTS && player.shield == ShieldLib.NOTHING && (player.armorPerk == "Light" || player.armorPerk == "Medium" || player.armor.name == "nothing" || player.armorPerk == "Medium"))
				damage = 20 + (player.str / 1.6) + player.masteryLevel(MasteryLib.Bow) * 30  + (player.spe / 1.6);
			else
				damage = ((20 + player.str / 3 + player.masteryLevel(MasteryLib.Bow) * 25) + player.spe / 3);
			//outputText("damage: " + damage + "\nplayer.str" + player.str + "\nplayer.spe" + player.spe + "\n\n\n"); //debug
			if (player.findPerk(PerkLib.StrongDraw) >= 0) damage += (player.str / 2);
			if (damage < 0) damage = 0;
			damage *= player.physMod();
			if (player.hasKeyItem("Kelt's Bow")) damage *= 1.3;
			if (monster.hasStatusEffect(StatusEffects.Stunned) && player.findPerk(PerkLib.KillerInstinct) > 0){
				miniCrit = true;
				damage *= 1.3; //Stunned targets have easy to hit weak spots.
			}
			if (player.findPerk(PerkLib.VitalAim) >= 0 && !display){
				//adjusted crit calculation copy since I can't just check for this perk and weapon used
				var critChance:Number = 10;
				if (monster is VolcanicGolem && monster.hasStatusEffect(StatusEffects.Stunned)) critChance += 40;
				if (player.findPerk(PerkLib.Tactician) >= 0 && player.inte >= 50) critChance += (player.inte - 50) / 10;
				if (player.findPerk(PerkLib.Cunning) >= 0) critChance += player.perkv1(PerkLib.Cunning);
				if (player.jewelry.effectId == JewelryLib.MODIFIER_CRITICAL) critChance += player.jewelry.effectMagnitude;
				//Focused. A moment of clarity in the eye of the storm...
				if (player.statusEffectv1(StatusEffects.Resolve) == 3) critChance += player.statusEffectv2(StatusEffects.Resolve);
				if (rand(100) <= critChance)
				{
					crit = true;
					damage *= 1.5;
				}
			}
			else if (player.findPerk(PerkLib.KillerInstinct) >= 0 && combat.combatCritical(player,monster) && !display){
				crit = true;
				damage *= 1.5;
			}
			damage = combat.globalMod(damage);
			if (display){
				if (maxDamage){
					return {finalDamage:int(damage *= monster.damagePercent(true, false, false, true) * 0.01),isCrit:crit};
				}
				return {finalDamage:int(damage *= (monster.damagePercent(true, false, false, true) - monster.damageToughnessModifier(true)) * 0.01),isCrit:crit};
			}
			return {finalDamage:int(monster.reduceDamage(damage,player)),isCrit:crit};

		}

		public function fireBowChance():Number{
			if (monster.short == "worms" || player.hasStatusEffect(StatusEffects.Blind) || (monster.short == "Isabella" && !monster.hasStatusEffect(StatusEffects.Blind))) return 0;
			if (monster.short == "Vala" && !monster.hasStatusEffect(StatusEffects.Stunned)) return 30;
			if (monster.short == "pod") return 100;
			var chance:Number = monster.standardDodgeFunc(player, player.spe / 10 + player.inte / 10 + player.masteryLevel(MasteryLib.Bow) * 6 - 35);
			return Math.round(Math.max(0, Math.min(100, chance)));
		}

		public function fanShot():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.BowDisabled)) {
				outputText("You can't use your bow right now!");
				menu();
				addButton(0, "Next", combat.combatMenu, false);
				return;
			}
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;

			// Practice makes perfect!
			player.masteryXP(MasteryLib.Bow, 5+rand(11));

			//single enemy combat
			if (monsterArray.length > 1) {
				//singular monster that is mob of enemies, increase chance to hit and adjust text
				if (monster.plural) {
					outputText("You ready and draw six arrows with great strength, loosing all simultaneously at " + monster.a + monster.short + "!\n\n");
					var crit:Boolean = false;
					var result:Object = null;
					for (var i:int = 0 ; i < 6 ; i++) {
						if (player.hasPerk(PerkLib.EagleEye) && fireBowChance() <= rand(79)) {
							outputText("The arrow goes wide, disappearing behind your foes.\n");
							//Learn more from failure than success
							player.masteryXP(MasteryLib.Bow, 1+rand(3));
						}
						else if (fireBowChance() <= rand(100)) {
							outputText("The arrow goes wide, disappearing behind your foes.\n");
							//Learn more from failure than success
							player.masteryXP(MasteryLib.Bow, 1+rand(3));
						}else { // didn't miss
							result = fireBowCalc();
							currDamage = result.finalDamage;
							crit = result.isCrit;
							if (currDamage == 0)
								outputText("The arrow bounces harmlessly off " + monster.a + monster.short + ". ")
							else
								outputText("The arrow strikes true, embedding itself in one of " + monster.a + monster.short + ". ");
							monster.lust -= 5;
							if (monster.lust < 0) monster.lust = 0;
							if (crit) outputText("Critical Hit!");
							currDamage = combat.doDamage(currDamage / 2, true, true);
							flags[kFLAGS.LAST_ATTACK_TYPE] == 1;
							outputText("\n");
						}
					}
				}
				else { // solo enemy
					outputText("You ready and draw six arrows with great strength, loosing all simultaneously at " + monster.a + monster.short + "!\n\n");
					var crit:Boolean = false;
					var result:Object = null;
					for (var i:int = 0 ; i < 6 ; i++) {
						if (player.hasPerk(PerkLib.EagleEye) && (fireBowChance() / 1.75) <= rand(79)) {
							outputText("The arrow goes wide, disappearing behind your foe.\n");
							//Learn more from failure than success
							player.masteryXP(MasteryLib.Bow, 1+rand(3));
						}
						else if ((fireBowChance() / 1.75) <= rand(100)) {
							outputText("The arrow goes wide, disappearing behind your foe.\n");
							//Learn more from failure than success
							player.masteryXP(MasteryLib.Bow, 1+rand(3));
						}else { // didn't miss
							result = fireBowCalc();
							currDamage = result.finalDamage;
							crit = result.isCrit;
							if (currDamage == 0)
								outputText("The arrow bounces harmlessly off " + monster.a + monster.short + ". ")
							else
								outputText("The arrow strikes true, embedding itself in " + monster.a + monster.short + ". ");
							monster.lust -= 5;
							if (monster.lust < 0) monster.lust = 0;
							if (crit) outputText("Critical Hit!");
							currDamage = combat.doDamage(currDamage / 2, true, true);
							flags[kFLAGS.LAST_ATTACK_TYPE] == 1;
							outputText("\n");
						}
					}
				}

			}
			else{ // multi mode
				var activeEnemies:int = 0;
				if (monsterArray.length > 1) {
					for (var i:int = 0; i < monsterArray.length; i++) {
						monster = monsterArray[i];
						if (monster.HP > 0 && monster.lust < monster.maxLust())
							activeEnemies += 1;
					}
				}
				else
					activeEnemies = 1;
				//multiple active targets - 3 each
				if (activeEnemies > 1) {
					var currEnemy:Number = combat.currEnemy;
					outputText("You ready and draw a multitude of arrows with tremendous strength, loosing all simultaneously at the many enemies before you!\n\n");
					for (var i:int = 0; i < monsterArray.length; i++) {
						monster = monsterArray[i];
						if (monster.HP > 0 && monster.lust < monster.maxLust()){
							for (var j:int = 0 ; j < 3; j++) {
								if (player.hasPerk(PerkLib.EagleEye) && (fireBowChance() / 1.3) <= rand(79)) {
									outputText("The arrow goes wide, disappearing behind one of your foes.\n");
									//Learn more from failure than success
									player.masteryXP(MasteryLib.Bow, 1+rand(3));
								}
								else if ((fireBowChance() / 1.3) <= rand(100)) {
									outputText("The arrow goes wide, disappearing behind one of your foes.\n");
									//Learn more from failure than success
									player.masteryXP(MasteryLib.Bow, 1+rand(3));
								}else { // didn't miss
									result = fireBowCalc();
									currDamage = result.finalDamage;
									crit = result.isCrit;
									if (currDamage == 0)
										outputText("The arrow bounces harmlessly off " + monster.a + monster.short + ". ")
									else
										outputText("The arrow strikes true, embedding itself in " + monster.a + monster.short + ". ");
									monster.lust -= 5;
									if (monster.lust < 0) monster.lust = 0;
									if (crit) outputText("Critical Hit!");
									currDamage = combat.doDamage(currDamage / 2, true, true);
									flags[kFLAGS.LAST_ATTACK_TYPE] == 1;
									outputText("\n");
								}
							}
						}
						monster = monsterArray[currEnemy];
					}
				}
				else { // one active target, 6 shot
					outputText("You ready and draw six arrows with great strength, loosing all simultaneously at " + monster.a + monster.short + "!\n\n");
					var crit:Boolean = false;
					var result:Object = null;
					for (var i:int = 0 ; i < 6 ; i++) {
						if (player.hasPerk(PerkLib.EagleEye) && (fireBowChance() / 1.75) <= rand(79)) {
							outputText("The arrow goes wide, disappearing behind your foe.\n");
							//Learn more from failure than success
							player.masteryXP(MasteryLib.Bow, 1+rand(3));
						}
						else if ((fireBowChance() / 1.75) <= rand(100)) {
							outputText("The arrow goes wide, disappearing behind your foe.\n");
							//Learn more from failure than success
							player.masteryXP(MasteryLib.Bow, 1+rand(3));
						}else { // didn't miss
							result = fireBowCalc();
							currDamage = result.finalDamage;
							crit = result.isCrit;
							if (currDamage == 0)
								outputText("The arrow bounces harmlessly off " + monster.a + monster.short + ". ")
							else
								outputText("The arrow strikes true, embedding itself in " + monster.a + monster.short + ". ");
							monster.lust -= 5;
							if (monster.lust < 0) monster.lust = 0;
							if (crit) outputText("Critical Hit!");
							currDamage = combat.doDamage(currDamage / 2, true, true);
							flags[kFLAGS.LAST_ATTACK_TYPE] == 1;
							outputText("\n");
						}
					}
				}

			}

			combat.startMonsterTurn();
		}

		public function fireBow():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.BowDisabled)) {
				outputText("You can't use your bow right now!");
				menu();
				addButton(0, "Next", combat.combatMenu, false);
				return;
			}
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			if (monster.distance == monster.DISTANCE_DISTANT && monster is Mimic) {
				outputText("You remember how Kelt told something like \"only fight massive targets that have no chance to dodge.\" Well, looks like you've found one.  ");
			}
			//Prep messages vary by skill.
			if (player.masteryLevel(MasteryLib.Bow) < 1) {
				outputText("Fumbling a bit, you nock an arrow and fire!\n");
			}
			else if (player.masteryLevel(MasteryLib.Bow) < 2) {
				outputText("You pull an arrow and fire it at " + monster.a + monster.short + "!\n");
			}
			else if (player.masteryLevel(MasteryLib.Bow) < 3) {
				outputText("With one smooth motion you draw, nock, and fire your deadly arrow at your opponent!\n");
			}
			else if (player.masteryLevel(MasteryLib.Bow) < 4) {
				outputText("In the blink of an eye you draw and fire your bow directly at " + monster.a + monster.short + ".\n");
			}
			else if (player.masteryLevel(MasteryLib.Bow) < 5) {
				outputText("You casually fire an arrow at " + monster.a + monster.short + " with supreme skill.\n");
			}
			else {
				outputText("With almost supernatural skill, you loose an arrow at " + monster.a + monster.short + ".\n");
			}

			player.masteryXP(MasteryLib.Bow, 5+rand(11));

			if (monster.hasStatusEffect(StatusEffects.Sandstorm)) {
				if (player.hasPerk(PerkLib.EagleEye) && rand(2) > 1) {
					outputText("Your shot is blown off target by the tornado of sand and wind.  Damn!\n\n");
					combat.startMonsterTurn();
					return;
				}
				else if (rand(10) > 1){
					outputText("Your shot is blown off target by the tornado of sand and wind.  Damn!\n\n");
					combat.startMonsterTurn();
					return;
				}
			}

			//[Bow Response]
			if (monster.short == "Isabella") {
				if (monster.hasStatusEffect(StatusEffects.Blind))
					outputText("Isabella hears the shot and turns her shield towards it, completely blocking it with her wall of steel.\n\n");
				else outputText("You arrow thunks into Isabella's shield, completely blocked by the wall of steel.\n\n");
				if (game.isabellaFollowerScene.isabellaAccent())
					outputText("\"You remind me of ze horse-people.  They cannot deal vith mein shield either!\" cheers Isabella.\n\n");
				else outputText("\"You remind me of the horse-people.  They cannot deal with my shield either!\" cheers Isabella.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//worms are immune
			if (monster.short == "worms") {
				outputText("The arrow slips between the worms, sticking into the ground.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Vala miss chance!
			if (monster.short == "Vala" && rand(10) < 7 && !monster.hasStatusEffect(StatusEffects.Stunned)) {
				outputText("Vala flaps her wings and twists her body. Between the sudden gust of wind and her shifting of position, the arrow goes wide.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Blind miss chance
			if (player.hasStatusEffect(StatusEffects.Blind)) {
				outputText("The arrow hits something, but blind as you are, you don't have a chance in hell of hitting anything specific with a bow.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Miss chance 10% based on speed + 10% based on int + 20% based on skill
			if (player.hasPerk(PerkLib.EagleEye) && fireBowChance() <= rand(79)) {
				outputText("The arrow goes wide, disappearing behind your foe.\n\n");
				//Learn more from failure than success
				player.masteryXP(MasteryLib.Bow, 5+rand(11));
				combat.startMonsterTurn();
				return;
			}
			else if (fireBowChance() <= rand(100)) {
				outputText("The arrow goes wide, disappearing behind your foe.\n\n");
				//Learn more from failure than success
				player.masteryXP(MasteryLib.Bow, 5+rand(11));
				combat.startMonsterTurn();
				return;
			}
			//Hit!  Damage calc! 20 +
			var crit:Boolean = false;
			var miniCrit:Boolean = false;
			var result:Object = fireBowCalc();
			currDamage = result.finalDamage;
			crit = result.isCrit;
			if (currDamage == 0) {
				if (monster.inte > 0)
					outputText(monster.capitalA + monster.short + " shrugs as the arrow bounces off them harmlessly.\n\n");
				else outputText("The arrow bounces harmlessly off " + monster.a + monster.short + ".\n\n");
				combat.startMonsterTurn();
				return;
			}
			if (monster.short == "pod")
				outputText("The arrow lodges deep into the pod's fleshy wall");
			else if (monster.plural)
				outputText(monster.capitalA + monster.short + " look down at the arrow that now protrudes from one of " + monster.pronoun3 + " bodies");
			else outputText(monster.capitalA + monster.short + " looks down at the arrow that now protrudes from " + monster.pronoun3 + " body");
			if (monster.hasStatusEffect(StatusEffects.Stunned) && player.findPerk(PerkLib.KillerInstinct) > 0){
				miniCrit = true;
			}
			monster.lust -= 20;
			if (monster.lust < 0) monster.lust = 0;
			if (monster.HP <= 0) {
				if (monster.short == "pod")
					outputText(". ");
				else if (monster.plural)
					outputText(" and stagger, collapsing onto each other from the wounds you've inflicted on " + monster.pronoun2 + ".");
				else outputText(" and staggers, collapsing from the wounds you've inflicted on " + monster.pronoun2 + ".");
			}
			else outputText(".  It's clearly very painful.");
			if (crit) outputText("\n\n Critical Hit! ");
			if (miniCrit) outputText("\n\n Opportunity Hit! ");
			currDamage = combat.doDamage(currDamage, true, true);
			outputText("\n\n");
			flags[kFLAGS.LAST_ATTACK_TYPE] = 1;
			combat.startMonsterTurn();
		}

		public function kickCalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			//Determine damage
			//Base:
			var damage:Number = player.str;
			//Leg bonus
			//Bunny - 20, Kangaroo - 35, 1 hoof = 30, 2 hooves = 40
			if (player.lowerBody.type == LowerBody.HOOFED || player.lowerBody.type == LowerBody.PONY || player.lowerBody.type == LowerBody.CLOVEN_HOOFED)
				damage += 30;
			else if (player.lowerBody.type == LowerBody.BUNNY) damage += 20;
			else if (player.lowerBody.type == LowerBody.KANGAROO) damage += 35;
			if (player.isTaur()) damage += 10;
			//Damage post processing!
			damage *= player.physMod();
			damage = combat.globalMod(damage);
			if(minDamage) return monster.reduceDamageMin(damage);
			if(maxDamage) return monster.reduceDamageMax(damage);
			return monster.reduceDamageCombat(damage);

		}

		public function kick():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			//Variant start messages!
			if (player.lowerBody.type== LowerBody.KANGAROO) {
				//(tail)
				if (player.tail.type == Tail.KANGAROO) outputText("You balance on your flexible kangaroo-tail, pulling both legs up before slamming them forward simultaneously in a brutal kick.  ");
				//(no tail)
				else outputText("You balance on one leg and cock your powerful, kangaroo-like leg before you slam it forward in a kick.  ");
			}
			//(bunbun kick)
			else if (player.lowerBody.type== LowerBody.BUNNY) outputText("You leap straight into the air and lash out with both your furred feet simultaneously, slamming forward in a strong kick.  ");
			//(centaur kick)
			else if (player.lowerBody.type== LowerBody.HOOFED || player.lowerBody.type== LowerBody.PONY || player.lowerBody.type== LowerBody.CLOVEN_HOOFED)
				if (player.isTaur()) outputText("You lurch up onto your backlegs, lifting your forelegs from the ground a split-second before you lash them out in a vicious kick.  ");
				//(bipedal hoof-kick)
				else outputText("You twist and lurch as you raise a leg and slam your hoof forward in a kick.  ");

			if (game.fetishManager.compare(FetishManager.FETISH_NO_COMBAT)) {
				outputText("You attempt to attack, but at the last moment your body wrenches away, preventing you from even coming close to landing a blow!  Ceraph's piercings have made normal attack impossible!  Maybe you could try something else?\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Blind
			if (player.hasStatusEffect(StatusEffects.Blind)) {
				outputText("You attempt to attack, but as blinded as you are right now, you doubt you'll have much luck!  ");
			}
			//Worms are special
			if (monster.short == "worms") {
				//50% chance of hit (int boost)
				if (rand(100) + player.inte/3 >= 50) {
					currDamage = int(player.str/5 - rand(5));
					if (currDamage == 0) currDamage = 1;
					outputText("You strike at the amalgamation, crushing countless worms into goo, dealing " + currDamage + " damage.\n\n");
					monster.HP -= currDamage;
					if (combat.totalHP() <= 0) {
						doNext(combat.endHpVictory);
						return;
					}
				}
				//Fail
				else {
					outputText("You attempt to crush the worms with your reprisal, only to have the collective move its individual members, creating a void at the point of impact, leaving you to attack only empty air.\n\n");
				}
				combat.startMonsterTurn();
				return;
			}
			var damage:Number;
			//Determine if dodged!
			if (combatAvoidDamage({doDodge:true,doParry:false,doBlock:false}).success) {
				//Akbal dodges special education
				if (monster.short == "Akbal") outputText("Akbal moves like lightning, weaving in and out of your furious attack with the speed and grace befitting his jaguar body.\n");
				else {
					outputText(monster.capitalA + monster.short + " manage");
					if (!monster.plural) outputText("s");
					outputText(" to dodge your kick!");
					outputText("\n\n");
				}
				combat.startMonsterTurn();
				return;
			}
			//Determine damage
			currDamage = kickCalc();

			//BLOCKED
			if (currDamage <= 0) {
				currDamage = 0;
				outputText(monster.capitalA + monster.short);
				if (monster.plural) outputText("'");
				else outputText("s");
				outputText(" defenses are too tough for your kick to penetrate!");
			}
			//LAND A HIT!
			else {
				outputText(monster.capitalA + monster.short);
				if (!monster.plural) outputText(" reels from the damaging impact!");
				else outputText(" reel from the damaging impact!");
			}
			if (currDamage > 0) {
				//Lust raised by anemone contact!
				if (monster.short == "anemone") {
					outputText("\nThough you managed to hit the anemone, several of the tentacles surrounding her body sent home jolts of venom when your swing brushed past them.");
					//(gain lust, temp lose str/spd)
					(monster as Anemone).applyVenom((1+rand(2)));
				}
			}
			currDamage = combat.doDamage(currDamage,true,true);
			outputText("\n\n");
			//Kick back to main if no damage occured!

			combat.startMonsterTurn();

		}

		public function goreCalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			var horns:Number = player.horns.value;
			if (player.horns.value > 40) player.horns.value = 40;
			//A little bit of a buff. If you're tall and fat, your charge is much more devastating. If you're short and thin, it barely does anything.
			var sizeBonus:Number = 1 + (player.tallness - 77) / (120 - 77);
			var thickBonus:Number = 0.5 + (player.thickness) / 100;
			var damage:Number = int((player.str + horns * 2) * sizeBonus * thickBonus); //As normal attack + horn length bonus
			//Bonus damage for rut!
			if (player.inRut && monster.cockTotal() > 0) damage += 5;
			//Bonus per level damage
			damage += player.level * 2;
			if (damage < 0) damage = 5;
			//CAP 'DAT SHIT
			if (damage > player.level * 10 + 100) damage = player.level * 10 + 100;
			if (damage > 0) {
				damage *= player.physMod();
				damage = combat.globalMod(damage);
			}
            if(minDamage) return monster.reduceDamageMin(damage);
            if(maxDamage) return monster.reduceDamageMax(damage);
            return monster.reduceDamageCombat(damage);
		}

		public function goreChance():Number{
			//Bigger horns = better success chance.
			//Small horns - 60% hit
			if (player.horns.value >= 6 && player.horns.value < 12) {
				temp = 60;
			}
			//bigger horns - 75% hit
			if (player.horns.value >= 12 && player.horns.value < 20) {
				temp = 75;
			}
			//huge horns - 90% hit
			if (player.horns.value >= 20) {
				temp = 80;
			}
			//Vala dodgy bitch!
			if (monster.short == "Vala") {
				temp = 20;
			}
			//Account for monster speed - up to -50%.
			temp -= monster.spe/2;
			//Account for player speed - up to +50%
			temp += player.spe / 2;
			return temp + player.chanceToHit() - 95 - monster.getEvasionChance();
		}

		//Gore Attack - uses 15 fatigue!
		public function goreAttack():void {
		clearOutput();
		//This is now automatic - newRound arg defaults to true:	menuLoc = 0;
			if (monster.short == "worms") {
				outputText("Taking advantage of your new natural weapons, you quickly charge at the freak of nature. Sensing impending danger, the creature willingly drops its cohesion, causing the mass of worms to fall to the ground with a sick, wet 'thud', leaving your horns to stab only at air.\n\n");
				combat.startMonsterTurn();
				return;
			}
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			//Hit & calculation
			if (goreChance() > rand(100)) {
				currDamage = goreCalc();
				//normal
				if (rand(4) > 0) {
					outputText("You lower your head and charge, skewering " + monster.a + monster.short + " on one of your bullhorns!  ");
				}
				//CRIT
				else {
					//doubles horn bonus damage
					currDamage *= 2;
					outputText("You lower your head and charge, slamming into " + monster.a + monster.short + " and burying both your horns into " + monster.pronoun2 + "! Critical hit!  ");
				}
				//Bonus damage for rut!
				if (player.inRut && monster.cockTotal() > 0) {
					outputText("The fury of your rut lent you strength, increasing the damage!  ");
				}
				//Different horn damage messages
				if (currDamage < 20) outputText("You pull yourself free.");
				if (currDamage >= 20 && currDamage < 40) outputText("You struggle to pull your horns free.");
				if (currDamage >= 40) outputText("With great difficulty you rip your horns free.");
				currDamage = combat.doDamage(currDamage,true,true);
			}
			//Miss
			else {
				//Special vala changes
				if (monster.short == "Vala") {
					outputText("You lower your head and charge Vala, but she just flutters up higher, grabs hold of your horns as you close the distance, and smears her juicy, fragrant cunt against your nose.  The sensual smell and her excited moans stun you for a second, allowing her to continue to use you as a masturbation aid, but she quickly tires of such foreplay and flutters back with a wink.\n\n");
					dynStats("lus", 5);
				}
				else outputText("You lower your head and charge " + monster.a + monster.short + ", only to be sidestepped at the last moment!");
			}
			//New line before monster attack
			outputText("\n\n");
			flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();

		}

		public function ramCalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = int(player.str + ((player.spe * 0.2) + (player.level * 2)) * 0.7);
			if (damage < 0) damage = 5;
				//Capping damage
				if (damage > player.level * 10 + 100) damage = player.level * 10 + 100;
				if (damage > 0) {
					damage *= player.physMod();
					//Rounding to a whole numbr
					damage = combat.globalMod(damage);
				}
            if(minDamage) return monster.reduceDamageMin(damage);
            if(maxDamage) return monster.reduceDamageMax(damage);
            return monster.reduceDamageCombat(damage);

		}

		 // Fingers crossed I did ram attack right -Foxwells
		public function ramsStun():void { // More or less copy/pasted from upheaval
			clearOutput();
			if (monster.short == "worms") {
				outputText("Taking advantage of your new natural weapon, you quickly charge at the freak of nature. Sensing impending danger, the creature willingly drops its cohesion, causing the mass of worms to fall to the ground with a sick, wet 'thud', leaving your horns to stab only at air.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Hit & calculation
			if (goreChance() > rand(100)) {
				currDamage = ramCalc();
				//Normal
				outputText("You lower your horns towards your opponent. With a quick charge, you catch them off guard, sending them sprawling to the ground! ");
				//Critical
				if (combat.combatCritical(player,monster)) {
					outputText("Critical hit! ");
					currDamage *= 1.75;
				}
                currDamage = combat.doDamage(currDamage,true,false);
			// How likely you'll stun
			// Uses the same roll as damage except ensured unique
			if (monster.stun(2,temp,99)) {
				outputText("Your impact also manages to stun " + monster.a + monster.short + "! ");
			}
				outputText("(" + currDamage + ")");
				outputText("\n\n");
			}
			//Miss
			else {
				//Special vala stuffs
				if (monster.short == "Vala") {
					outputText("You lower your head and charge Vala, but she just flutters up higher, grabs hold of your horns as you close the distance, and smears her juicy, fragrant cunt against your nose.  The sensual smell and her excited moans stun you for a second, allowing her to continue to use you as a masturbation aid, but she quickly tires of such foreplay and flutters back with a wink.\n\n");
					dynStats("lus", 5);
				}
				else outputText("You lower your horns towards your opponent. With a quick charge you attempt to knock them to the ground. They manage to dodge out of the way at the last minute, leaving you panting and annoyed.");
			}
			//We're done, enemy time
			outputText("\n\n");
			flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();

		}

		public function upheavalCalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = int(player.str + ((player.spe * 0.2) + (player.level * 2)));
			if (damage < 0) damage = 5;
				//Capping damage
				if (damage > player.level * 10 + 100) damage = player.level * 10 + 100;
				if (damage > 0) {
					damage *= player.physMod();
					//Rounding to a whole numbr
					damage = combat.globalMod(damage);
				}
            if(minDamage) return monster.reduceDamageMin(damage);
            if(maxDamage) return monster.reduceDamageMax(damage);
            return monster.reduceDamageCombat(damage);
		}

		//Upheaval Attack
		public function upheavalAttack():void {
			clearOutput();
			if (monster.short == "worms") {
				outputText("Taking advantage of your new natural weapon, you quickly charge at the freak of nature. Sensing impending danger, the creature willingly drops its cohesion, causing the mass of worms to fall to the ground with a sick, wet 'thud', leaving your horns to stab only at air.\n\n");
				combat.startMonsterTurn();
				return;
			}
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			//Hit & calculation
			if (goreChance() > rand(100)) {
				currDamage = upheavalCalc();
				//Normal
				outputText("You hurl yourself towards the foe with your head low and jerk your head upward, every muscle flexing as you send your enemy flying. ");
				//Critical
				if (combat.combatCritical(player,monster)) {
					outputText("Critical hit! ");
					currDamage *= 1.75;
				}
				//CAP 'DAT SHIT
				if (currDamage > 0) {
					currDamage = combat.doDamage(currDamage, true,true);
				}
				outputText("\n\n");
			}
			//Miss
			else {
				//Special vala changes
				if (monster.short == "Vala") {
					outputText("You lower your head and charge Vala, but she just flutters up higher, grabs hold of your horns as you close the distance, and smears her juicy, fragrant cunt against your nose.  The sensual smell and her excited moans stun you for a second, allowing her to continue to use you as a masturbation aid, but she quickly tires of such foreplay and flutters back with a wink.\n\n");
					dynStats("lus", 5);
				}
				else outputText("You hurl yourself towards the foe with your head low and snatch it upwards, hitting nothing but air.");
			}
			//New line before monster attack
			outputText("\n\n");
			flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
			 //Victory ORRRRR enemy turn.
			combat.startMonsterTurn();

		}

		//Player sting attack
		public function stingerCalc(display:Boolean = false,maxDamage:Boolean = false):Number{
			var damage:Number = 35 + (display ? 0 : rand(player.lib/10)) + (maxDamage ? player.lib/10 : 0);
			//Level adds more damage up to a point (level 30)
			if (player.level < 10) damage += player.level * 3;
			else if (player.level < 20) damage += 30 + (player.level - 10) * 2;
			else if (player.level < 30) damage += 50 + (player.level - 20) * 1;
			else damage += 60;
			return int(monster.lustVuln * damage);
		}

		public function playerStinger():void {
			clearOutput();
			if (player.tail.venom < 33) {
				outputText("You do not have enough venom to sting right now!");
				doNext(physicalSpecials);
				return;
			}
			//Worms are immune!
			if (monster.short == "worms") {
				outputText("Taking advantage of your new natural weapons, you quickly thrust your stinger at the freak of nature. Sensing impending danger, the creature willingly drops its cohesion, causing the mass of worms to fall to the ground with a sick, wet 'thud', leaving you to stab only at air.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Determine if dodged!
			var result:Object = combatAvoidDamage({doParry:false, doBlock:true, doFatigue:true});
			if (!result.failed) {
				if (result.dodge != null){
					switch(rand(2)){
					case 0:
						outputText(monster.capitalA + monster.short + " narrowly avoids your stinger!\n\n");
						break;
					case 1:
						outputText(monster.capitalA + monster.short + " dodges your stinger with superior quickness!\n\n");
						break;
					case 2:
						outputText(monster.capitalA + monster.short + " deftly avoids your slow attempts to sting " + monster.pronoun2 + ".\n\n");
						break;
					}
				}
				if (result.block){
					outputText(monster.capitalA + monster.short + " manages to raise " +monster.pronoun3 + " shield in time, blocking your sting!\n\n");
				}
				combat.startMonsterTurn();
				return;
			}
			//determine if avoided with armor.
			if (monster.armorDef - player.level >= 10 && rand(4) > 0) {
				outputText("Despite your best efforts, your sting attack can't penetrate " +  monster.a + monster.short + "'s defenses.\n\n");
				combat.startMonsterTurn();
				return;
			}
			//Sting successful!
			outputText("Searing pain lances through " + monster.a + monster.short + " as you manage to sting " + monster.pronoun2 + "!  ");
			if (monster.plural) outputText("You watch as " + monster.pronoun1 + " stagger back a step and nearly trip, flushing hotly.");
			else outputText("You watch as " + monster.pronoun1 + " staggers back a step and nearly trips, flushing hotly.");
			//Tabulate damage!
			var damage:Number = stingerCalc();
			monster.teased(damage);
			if (!monster.hasStatusEffect(StatusEffects.lustvenom)) monster.createStatusEffect(StatusEffects.lustvenom, 0, 0, 0, 0);
			//New line before monster attack
			outputText("\n\n");
			//Use tail mp
			player.tail.venom -= 25;
			combat.startMonsterTurn();

		}

		public function PCWebAttack():void {
			clearOutput();
			//Keep logic sane if this attack brings victory
			if (player.tail.venom < 33) {
				outputText("You do not have enough webbing to shoot right now!");
				doNext(physicalSpecials);
				return;
			}
			player.tail.venom-= 33;
			if (monster.short == "lizan rogue") {
				outputText("As your webbing flies at him the lizan flips back, slashing at the adhesive strands with the claws on his hands and feet with practiced ease.  It appears he's used to countering this tactic.");
				combat.startMonsterTurn();
				return;
			}
			//Blind
			if (player.hasStatusEffect(StatusEffects.Blind)) {
				outputText("You attempt to attack, but as blinded as you are right now, you doubt you'll have much luck!  ");
			}
			else outputText("Turning and clenching muscles that no human should have, you expel a spray of sticky webs at " + monster.a + monster.short + "!  ");
			//Determine if dodged!
			var result:Object = combatAvoidDamage({doParry:false, doBlock:true, doFatigue:true});
			if (!result.failed) {
				if (result.dodge != null){
					outputText("You miss " + monster.a + monster.short + " completely - ");
					if (monster.plural) outputText("they");
					else outputText(monster.mf("he","she") + " moved out of the way!\n\n");
					}
				if (result.block){
					outputText(monster.capitalA + monster.short + " manages to raise " +monster.pronoun3 + " shield in time, catching your sticky strands!\n\n");
				}
				combat.startMonsterTurn();
				return;
			}
			//Over-webbed
			if (monster.spe < 1) {
				if (!monster.plural) outputText(monster.capitalA + monster.short + " is completely covered in webbing, but you hose " + monster.mf("him","her") + " down again anyway.");
				else outputText(monster.capitalA + monster.short + " are completely covered in webbing, but you hose them down again anyway.");
			}
			//LAND A HIT!
			else {
				if (!monster.plural) outputText("The adhesive strands cover " + monster.a + monster.short + " with restrictive webbing, greatly slowing " + monster.mf("him","her") + ". ");
				else outputText("The adhesive strands cover " + monster.a + monster.short + " with restrictive webbing, greatly slowing " + monster.mf("him","her") + ". ");
				monster.spe -= 45;
				if (monster.spe < 0) monster.spe = 0;
			}
			awardAchievement("How Do I Shot Web?", kACHIEVEMENTS.COMBAT_SHOT_WEB);
			outputText("\n\n");
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();
		}

		public function kissAttack():void {
			clearOutput();
			if (player.hasStatusEffect(StatusEffects.Blind)) {
				outputText("There's no way you'd be able to find their lips while you're blind!");
				doNext(physicalSpecials);
				return;
			}
			var attack:Number = rand(6);
			switch(attack) {
				case 1:
					//Attack text 1:
					outputText("You hop up to " + monster.a + monster.short + " and attempt to plant a kiss on " + monster.pronoun3 + ".");
					break;
				//Attack text 2:
				case 2:
					outputText("You saunter up and dart forward, puckering your golden lips into a perfect kiss.");
					break;
				//Attack text 3:
				case 3:
					outputText("Swaying sensually, you wiggle up to " + monster.a + monster.short + " and attempt to plant a nice wet kiss on " + monster.pronoun2 + ".");
					break;
				//Attack text 4:
				case 4:
					outputText("Lunging forward, you fly through the air at " + monster.a + monster.short + " with your lips puckered and ready to smear drugs all over " + monster.pronoun2 + ".");
					break;
				//Attack text 5:
				case 5:
					outputText("You lean over, your lips swollen with lust, wet with your wanting slobber as you close in on " + monster.a + monster.short + ".");
					break;
				//Attack text 6:
				default:
					outputText("Pursing your drug-laced lips, you close on " + monster.a + monster.short + " and try to plant a nice, wet kiss on " + monster.pronoun2 + ".");
					break;
			}
			//Dodged!
			if (combatAvoidDamage({doParry:false,doBlock:false}).success) {
				attack = rand(3);
				switch(attack) {
					//Dodge 1:
					case 1:
						if (monster.plural) outputText("  " + monster.capitalA + monster.short + " sees it coming and moves out of the way in the nick of time!\n\n");
						break;
					//Dodge 2:
					case 2:
						if (monster.plural) outputText("  Unfortunately, you're too slow, and " + monster.a + monster.short + " slips out of the way before you can lay a wet one on one of them.\n\n");
						else outputText("  Unfortunately, you're too slow, and " + monster.a + monster.short + " slips out of the way before you can lay a wet one on " + monster.pronoun2 + ".\n\n");
						break;
					//Dodge 3:
					default:
						if (monster.plural) outputText("  Sadly, " + monster.a + monster.short + " moves aside, denying you the chance to give one of them a smooch.\n\n");
						else outputText("  Sadly, " + monster.a + monster.short + " moves aside, denying you the chance to give " + monster.pronoun2 + " a smooch.\n\n");
						break;
				}
				combat.startMonsterTurn();
				return;
			}
			//Success but no effect:
			if (monster.lustVuln <= 0 || !monster.hasCock()) {
				if (monster.plural) outputText("  Mouth presses against mouth, and you allow your tongue to stick out to taste the saliva of one of their number, making sure to give them a big dose.  Pulling back, you look at " + monster.a + monster.short + " and immediately regret wasting the time on the kiss.  It had no effect!\n\n");
				else outputText("  Mouth presses against mouth, and you allow your tongue to stick to taste " + monster.pronoun3 + "'s saliva as you make sure to give them a big dose.  Pulling back, you look at " + monster.a + monster.short + " and immediately regret wasting the time on the kiss.  It had no effect!\n\n");
				combat.startMonsterTurn();
				return;
			}
			attack = rand(4);
			var damage:Number = 0;
			switch(attack) {
				//Success 1:
				case 1:
					if (monster.plural) outputText("  Success!  A spit-soaked kiss lands right on one of their mouths.  The victim quickly melts into your embrace, allowing you to give them a nice, heavy dose of sloppy oral aphrodisiacs.");
					else outputText("  Success!  A spit-soaked kiss lands right on " + monster.a + monster.short + "'s mouth.  " + monster.mf("He","She") + " quickly melts into your embrace, allowing you to give them a nice, heavy dose of sloppy oral aphrodisiacs.");
					damage = 15;
					break;
				//Success 2:
				case 2:
					if (monster.plural) outputText("  Gold-gilt lips press into one of their mouths, the victim's lips melding with yours.  You take your time with your suddenly cooperative captive and make sure to cover every bit of their mouth with your lipstick before you let them go.");
					else outputText("  Gold-gilt lips press into " + monster.a + monster.short + ", " + monster.pronoun3 + " mouth melding with yours.  You take your time with your suddenly cooperative captive and make sure to cover every inch of " + monster.pronoun3 + " with your lipstick before you let " + monster.pronoun2 + " go.");
					damage = 20;
					break;
				//CRITICAL SUCCESS (3)
				case 3:
					if (monster.plural) outputText("  You slip past " + monster.a + monster.short + "'s guard and press your lips against one of them.  " + monster.mf("He","She") + " melts against you, " + monster.mf("his","her") + " tongue sliding into your mouth as " + monster.mf("he","she") + " quickly succumbs to the fiery, cock-swelling kiss.  It goes on for quite some time.  Once you're sure you've given a full dose to " + monster.mf("his","her") + " mouth, you break back and observe your handwork.  One of " + monster.a + monster.short + " is still standing there, licking " + monster.mf("his","her") + " his lips while " + monster.mf("his","her") + " dick is standing out, iron hard.  You feel a little daring and give the swollen meat another moist peck, glossing the tip in gold.  There's no way " + monster.mf("he","she") + " will go soft now.  Though you didn't drug the rest, they're probably a little 'heated up' from the show.");
					else outputText("  You slip past " + monster.a + monster.short + "'s guard and press your lips against " + monster.pronoun3 + ".  " + monster.mf("He","She") + " melts against you, " + monster.pronoun3 + " tongue sliding into your mouth as " + monster.pronoun1 + " quickly succumbs to the fiery, cock-swelling kiss.  It goes on for quite some time.  Once you're sure you've given a full dose to " + monster.pronoun3 + " mouth, you break back and observe your handwork.  " + monster.capitalA + monster.short + " is still standing there, licking " + monster.pronoun3 + " lips while " + monster.pronoun3 + " dick is standing out, iron hard.  You feel a little daring and give the swollen meat another moist peck, glossing the tip in gold.  There's no way " + monster.pronoun1 + " will go soft now.");
					damage = 30;
					break;
				//Success 4:
				default:
					outputText("  With great effort, you slip through an opening and compress their lips against your own, lust seeping through the oral embrace along with a heavy dose of drugs.");
					damage = 12;
					break;
			}
			//Add status if not already drugged
			if (!monster.hasStatusEffect(StatusEffects.LustStick)) monster.createStatusEffect(StatusEffects.LustStick,0,0,0,0);
			//Else add bonus to round damage
			else monster.addStatusValue(StatusEffects.LustStick,2,Math.round(damage/10));
			//Deal damage
			monster.teased(monster.lustVuln * damage);
			outputText("\n\n");
			//Sets up for end of combat, and if not, goes to AI.
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();

		}

		//special attack: tail whip? could unlock button for use by dagrons too
		//tiny damage and lower monster armor by ~75% for one turn
		//hit
		public function tailWhipAttack():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;

			if (monster is VolcanicGolem){
				if ((player.hasStatusEffect(StatusEffects.Blind) && rand(2) == 0) || (monster.spe - player.spe > 0 && int(Math.random()*(((monster.spe-player.spe)/4)+80)) > 80)) {
				outputText("Twirling like a top, you swing your tail, but connect with only empty air.");
				outputText("\n\n");
				combat.startMonsterTurn();
				return;
				}
			else {
				outputText("Twirling like a top, you hit the Golem, and manage to slap away a few of its armor plates before the heat becomes unbearable.");
				monster.createStatusEffect(StatusEffects.CoonWhip, 150, 2, 0, 0);
				monster.armorDef -= 150;
				outputText("\n\n");
				combat.startMonsterTurn();
				return;
			}
			}
			//miss
			if (combatAvoidDamage({doParry:false,doBlock:false}).success) {
				outputText("Twirling like a top, you swing your tail, but connect with only empty air.");
			}
			else {
				if (!monster.plural) outputText("Twirling like a top, you bat your opponent with your tail.  For a moment, " + monster.pronoun1 + " looks disbelieving, as if " + monster.pronoun3 + " world turned upside down, but " + monster.pronoun1 + " soon becomes irate and redoubles " + monster.pronoun3 + " offense, leaving large holes in " + monster.pronoun3 + " guard.  If you're going to take advantage, it had better be right away; " + monster.pronoun1 + "'ll probably cool off very quickly.");
				else outputText("Twirling like a top, you bat your opponent with your tail.  For a moment, " + monster.pronoun1 + " look disbelieving, as if " + monster.pronoun3 + " world turned upside down, but " + monster.pronoun1 + " soon become irate and redouble " + monster.pronoun3 + " offense, leaving large holes in " + monster.pronoun3 + " guard.  If you're going to take advantage, it had better be right away; " + monster.pronoun1 + "'ll probably cool off very quickly.");
				if (!monster.hasStatusEffect(StatusEffects.CoonWhip)) monster.createStatusEffect(StatusEffects.CoonWhip,0,0,0,0);
				temp = Math.round(monster.armorDef * .75);
				while(temp > 0 && monster.armorDef >= 1) {
					monster.armorDef--;
					monster.addStatusValue(StatusEffects.CoonWhip,1,1);
					temp--;
				}
				monster.addStatusValue(StatusEffects.CoonWhip,2,2);
				if (player.tail.type == Tail.RACCOON) monster.addStatusValue(StatusEffects.CoonWhip,2,2);
			}
			outputText("\n\n");
			combat.startMonsterTurn();
		}

		public function tailslamcalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = int(10 + player.str/1.1);
			if (damage < 0) damage = 5;
			if (damage > 0) {
					damage *= player.physMod();
					//Rounding to a whole numbr
					damage = combat.globalMod(damage);
				}
            if(minDamage) return monster.reduceDamageMin(damage);
            if(maxDamage) return monster.reduceDamageMax(damage);
            return monster.reduceDamageCombat(damage);
		}

		public function tailSlamAttack():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			//miss
			if (combatAvoidDamage({doParry:false,doBlock:false}).success) {
				outputText("You swing your mighty tail, but your attack finds purchase on naught but the air.\n\n");
				combat.startMonsterTurn();
				return;
			}

			outputText("With a great sweep, you slam your [if (monster.plural)opponents|opponent] with your powerful tail."
			          +" [monster.capitalA][monster.short] [if (monster.plural)reel|reels] from the impact, knocked flat on [monster.pronoun3] bum,"
			          +" battered and bruised.\n");

			currDamage = tailslamcalc();
			currDamage = combat.doDamage(currDamage, true);
			outputText("Your assault is nothing short of impressive, dealing " + currDamage + " damage! ");

			// Stun chance
			var chance:int = Math.floor(monster.statusEffectv1(StatusEffects.TimesBashed) + 1);
			if (chance > 10) chance = 10;
			if (monster.stun(1,chance)) {
				outputText("The harsh blow also manages to stun [monster.a][monster.short]! ");
				if (!monster.hasStatusEffect(StatusEffects.TimesBashed))
					monster.createStatusEffect(StatusEffects.TimesBashed, 1, 0, 0, 0);
				else
					monster.addStatusValue(StatusEffects.TimesBashed, 1, 1);
			}

			//50% Bleed chance
			if (monster.bleed(player)) {
				outputText("\n" + monster.capitalA + monster.short + " [if (monster.plural)bleed|bleeds] profusely from the many bloody punctures your tail spikes leave behind.");
				} else {
				if (monster is LivingStatue) outputText("Despite the rents you've torn in its stony exterior, the statue does not bleed.");
			}

			flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
			outputText("\n\n");
			combat.startMonsterTurn();
		}

		public function tailSlapCalc(display:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number = (player.str) - (maxDamage ? 0 : (display ? monster.tou : rand(monster.tou))) - monster.armorDef;
			return combat.globalMod(calcInfernoMod(damage,display));
		}

		public function tailSlapAttack():void {
			clearOutput();
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			outputText("With a simple thought you set your tail ablaze.");
			//miss
			if(combatAvoidDamage({doParry:false,doBlock:false}).success) {
				outputText(" Twirling like a top, you swing your tail, but connect with only empty air.");
			}
			else {
				if(!monster.plural) outputText(" Twirling like a top, you bat your opponent with your tail.");
				else outputText(" Twirling like a top, you bat your opponents with your tail.");
				currDamage = tailSlapCalc();
				currDamage = combat.doDamage(currDamage,true);
				outputText("  Your tail slams against " + monster.a + monster.short + ", dealing " + currDamage + " damage! ");
			}
			outputText("\n\n");
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();

		}

		public function bashCalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number =  10 + (player.str / 1.5) + (minDamage ? 0 : rand(player.str / 2)) + (maxDamage ? player.str/2 : 0) + (player.shieldBlock * 2 * player.masteryLevel(MasteryLib.Shield));
			if (player.findPerk(PerkLib.ShieldSlam) >= 0) damage *= 1.2;
			if (damage < 0) damage = 5;
			if (damage > 0) {
				damage *= player.physMod();
				//Rounding to a whole numbr
				damage = combat.globalMod(damage);
			}
            if(minDamage) return monster.reduceDamageMin(damage);
            if(maxDamage) return monster.reduceDamageMax(damage);
            return monster.reduceDamageCombat(damage);
		}

		public function shieldBash():void {
			clearOutput();
			outputText("You ready your [shield] and prepare to slam it towards " + monster.a + monster.short + ".  ");
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			if (combatAvoidDamage({doBlock:false,doParry:false}).success) {

				if (monster.spe - player.spe >= 8 && monster.spe-player.spe < 20) outputText(monster.capitalA + monster.short + " dodges your attack with superior quickness!");
				else if (monster.spe - player.spe >= 20) outputText(monster.capitalA + monster.short + " deftly avoids your slow attack.");
				else outputText(monster.capitalA + monster.short + " narrowly avoids your attack!");
				player.masteryXP(MasteryLib.Shield, 5+rand(31));
				combat.startMonsterTurn();
				return;
			}
			currDamage = bashCalc();
			var chance:int = Math.floor(monster.statusEffectv1(StatusEffects.TimesBashed) + 2);
			if (chance > 10) chance = 10;
			currDamage = combat.doDamage(currDamage,true);
			outputText("Your [shield] slams against " + monster.a + monster.short + ", dealing " + currDamage + " damage! ");
			if (monster is VolcanicGolem){
				if (monster.hasStatusEffect(StatusEffects.VolcanicFistProblem)){
					if (!monster.hasStatusEffect(StatusEffects.VolcanicFrenzy)){
						outputText("With the monster bent over trying to remove its fist from the ground, you manage to deal a devastatingly effective blow to its head, causing it to topple and fall.\n\nThe golem's rock plates slide off, revealing its molten interior. This is your chance to attack!");
						monster.createStatusEffect(StatusEffects.Stunned, 1, 0, 0, 0);
						monster.armorDef = 0;
					}else{
						outputText("With the monster bent over trying to remove its fist from the ground, you manage to deal a devastatingly effective blow to its head. However, in its frenzy, the Golem ignores the impact and retains focus!");
					if (monster.hasStatusEffect(StatusEffects.VolcanicArmorRed))//if armor is already rent
					{
						monster.addStatusValue(StatusEffects.VolcanicArmorRed, 1, 3);//prolong duration
						monster.addStatusValue(StatusEffects.VolcanicArmorRed, 2, 1);//increase effect
						monster.armorDef -= 150;
						if (monster.armorDef < 0) monster.armorDef = 0;
					}else{
						monster.createStatusEffect(StatusEffects.VolcanicArmorRed, 3, 1, 0, 0);//otherwise, create effect
						monster.armorDef -= 150;
						if (monster.armorDef < 0) monster.armorDef = 0;
						}

					}
					flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
					outputText("\n\n");
					combat.startMonsterTurn();
					return;
				}else{
					outputText("Your impact dissipates harmlessly against the impenetrable rock plates, and the Golem is not stunned.");
					flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
					outputText("\n\n");
					combat.startMonsterTurn();
					return;
				}
			}
			if (monster.stun(1,0,chance,true)) {
				outputText("Your impact also manages to stun " + monster.a + monster.short + "! ");
				if (!monster.hasStatusEffect(StatusEffects.TimesBashed)) monster.createStatusEffect(StatusEffects.TimesBashed, player.findPerk(PerkLib.ShieldSlam) >= 0 ? 0.5 : 1, 0, 0, 0);
				else monster.addStatusValue(StatusEffects.TimesBashed, 1, player.findPerk(PerkLib.ShieldSlam) >= 0 ? 0.5 : 1);
			}
			flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
			outputText("\n\n");
			player.masteryXP(MasteryLib.Shield, 5+rand(21));
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();

		}

		public function reapCalc(minDamage:Boolean = false, maxDamage:Boolean = false):Number{
			var damage:Number =  game.combat.calcDamage(false,false) * 2;
            if(minDamage) return monster.reduceDamageMin(damage,25,true);
            if(maxDamage) return monster.reduceDamageMax(damage,25,true);
            return monster.reduceDamageCombat(damage,25,true);
		}

		public function reapChance():Number{
			return monster.standardDodgeFunc(player, -15);
		}

		public function reapDull():void{
			clearOutput();
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			outputText("You twist your body, coiling and bringing the razor sharp edge of the Dullahan's scythe to your back,. You focus on its unholy power, and the world around you dims, enveloped by darkness.");
			outputText("\n\nAfter all light vanishes, you uncoil, and a single flash dashes past your foe. The overwhelming darkness dissipates like smoke, crawling back and converging on the glistening silver blade of your scythe.");
			if(combatAvoidDamage({doParry:false,doBlock:false, toHitChance:reapChance()}).success) {
				outputText("\nAs the battlefield lights up again, you notice you've failed to hit your foe!\n");
				outputText("\nYou failed to reap your foe, and the scythe's hunger for life damages you!");
				player.takeDamage(400 + rand(150), true);
				player.weapon.weaponXP(10+rand(11));
				combat.startMonsterTurn();
				return;
			}
			outputText("\n\nAs the battlefield lights up again, your foe's wound explodes with dark energy, heavily damaging " + monster.pronoun2 + "! ");
			currDamage = monster.takeDamage(reapCalc());
			outputText("(" + currDamage + ")");
			if (monster.HP > 0){
				outputText("\nYou failed to reap your foe, and the scythe's hunger for life damages you!");
				player.takeDamage(400 + rand(150), true);
			}else{
				outputText("\nWith your target defeated, your scythe's hunger vanishes, for now.");
			}
			flags[kFLAGS.LAST_ATTACK_TYPE] = 0;
			outputText("\n\n");
			player.weapon.weaponXP(5+rand(11));
			//Victory ORRRRR enemy turn.
			combat.startMonsterTurn();
		}

		public function ironflesh():void{
			outputText("sdfs");
			player.createStatusEffect(StatusEffects.Ironflesh, player.damagePercent(true) * 0.75, 0, 0, 0);
			combat.startMonsterTurn();
		}

		public function distanceSelf():void {
			outputText("You ready yourself and dash away, distancing yourself from the enemy!\n");
			for each (var currMonster:Monster in monsterArray) {
				if (!currMonster.react(currMonster.CON_DISTANCED)) {
					combat.startMonsterTurn();
					return;
				}
			}
			var oldMonster:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				if (player.movementChance(monster) > rand(100) && monster.shouldMove(CombatAttackData.DISTANCE_MELEE, true)) {
					outputText("\n[Themonster] stays hot on your heels and closes the distance immediately!\n");
					if (player.hasStatusEffect(StatusEffects.TFScorch)) {
						outputText("The scorching flames covering the battlefield burn [monster.pronoun2] as [monster.pronoun1] passes through. ");
						combat.doDamage(tfScorchCalc(), true, true);
					}
				} else {
					outputText("\nYou manage to distance yourself from [themonster].\n");
					combatAttackData.distance(monster,true);
				}
			}
			monster = oldMonster;
			combat.startMonsterTurn();
		}

		public function approach():void{
			outputText("You ready yourself and dash forward, closing the distance from the enemy!\n");
			for each (var currMonster:Monster in monsterArray) {
				if (!currMonster.react(currMonster.CON_APPROACHED)) {
					combat.startMonsterTurn();
					return;
				}
			}
			var oldMonster:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				if (player.movementChance(monster) > rand(100) && monster.shouldMove(CombatAttackData.DISTANCE_DISTANT, true)) {
					outputText("\n[Themonster] manages to dash back, keeping [monster.pronoun2]self distanced from you!\n");
					if (player.hasStatusEffect(StatusEffects.TFScorch)) {
						outputText("The scorching flames covering the battlefield burn [monster.pronoun2] as [monster.pronoun1] passes through. ");
						combat.doDamage(tfScorchCalc(), true, true);
					}
				} else {
					outputText("\nYou manage to close the distance between you and [themonster]!");
					combatAttackData.closeDistance(monster);
				}
			}
			monster = oldMonster;
			combat.startMonsterTurn();
		}

		public function onslaught():void{
			menu();
			var t:Timer = new Timer(400, 10);
			t.addEventListener(TimerEvent.TIMER, function():void {
				outputText("You hit!\n");
				output.flush();
				monster.takeDamage(100, true);
				statScreenRefresh();
				t.delay -= 5 * t.currentCount;
				if(t.currentCount == 10) outputText("\nowaridesu");
			});
			t.addEventListener(TimerEvent.TIMER_COMPLETE, function ():void {
				output.flush();
				combat.startMonsterTurn();
			});
			t.start();

		}

		public var abilityTarget:Monster;
		public function backstabDamage(minDamage:Boolean = false,maxDamage:Boolean = false):Number{
			var baseDamage:Number = 1.5*combat.calcDamage(true,false);
			if(minDamage) return monster.reduceDamageMin(baseDamage,40,true);
			if(maxDamage) return monster.reduceDamageMax(baseDamage,40,true);
			return monster.reduceDamageCombat(baseDamage,40,true);
		}
		public function backstabStart():void{
			abilityTarget = monster;
			outputText("You wield your dagger and attempt to move out of sight of [themonster], slinking into the" +
					" shadows.\n");
			player.addStatusEffect(new BackstabBuff());
            combat.startMonsterTurn();

		}

		public function backstabExec():void{
			var tempMonster:Monster = monster;
			monster = abilityTarget;
			outputText("[pg]You succeed in moving past " + abilityTarget.a + abilityTarget.short + "'s field of view." +
					" You emerge from" +
			" the shadows and plunge your [weapon] on "+abilityTarget.a + abilityTarget.short + "'s back," +
			" inflicting a grievous injury!");
			var damage:int = backstabDamage();
			player.weapon.weaponXP(10+rand(21));
            combat.doDamage(damage,true,true,false,true);
			monster = tempMonster;

		}

        public function grandThrustDamage(minDamage:Boolean = false,maxDamage:Boolean = false):Number{
            var baseDamage:Number = 1.30 * combat.calcDamage(true,false);
            if(minDamage) return monster.reduceDamageMin(baseDamage,100,true);
            if(maxDamage) return monster.reduceDamageMax(baseDamage,100,true);
            return monster.reduceDamageCombat(baseDamage,100,true);
        }

		public function grandThrustChance():Number{
			return monster.standardDodgeFunc(player,15);
		}
		public function grandThrust():void{
			outputText("You jump back, twirling your [weapon] around your arms before landing, your body ready to spring forward and the tip of your spear" +
					" pointed perfectly towards [themonster].\nYou narrow your eyes and charge, lunging towards your foe with incredible strength and speed!");
            if (combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:grandThrustChance()}).success) {
                outputText("\n\n[Themonster] is ready, and [monster.pronoun1] manages to twist its body out of the way just in time to" +
						" frustrate your fierce attack!");
				player.weapon.weaponXP(10+rand(11));
            }else{
				outputText("\n\nYour attack is successful, your [weapon] brutally and swiftly piercing through any defense [themonster] had and causing a" +
						" grievous wound. You quickly withdraw your weapon and ready yourself again!");
				combat.doDamage(grandThrustDamage(),true,true,true,true);
			}
			player.weapon.weaponXP(10+rand(11));
            combat.startMonsterTurn();
		}

		public function retributionDamage():Number{
			return monster.reduceDamageCombat(combat.globalMod(combat.damageTaken*2 + combat.calcDamage(true,false)),0,true);
		}

		public function retributionStart():void{
			abilityTarget = monster;
			outputText("You hold your [weapon] with both hands and hold it over your shoulder, intent on charging an extremely powerful attack." +
					"\nYou current stance and intent makes dodging or blocking impossible, but you're willing to grit through the pain!");
			player.addStatusEffect(new RetributionBuff());
            combat.startMonsterTurn();
		}
		public function retributionExec():void{
            var tempMonster:Monster = monster;
            monster = abilityTarget;
			outputText("You finish charging your attack and strike, fueled by the pain of the blows you've endured!\nYou twist your body to put extra force" +
					" behind your attack, swinging diagonally downwards, intent on cleaving " + abilityTarget.a + abilityTarget.short + " in half!\n\n" +
					"Your [weapon] strikes your foe with terrible force, knocking " +abilityTarget.pronoun2+ " down with the sheer weight of your blow. The" +
					" very ground cracks as your swing meets it, the sound absolutely deafening!");
            combat.doDamage(retributionDamage(),true,true,false,true);
			player.weapon.weaponXP(10+rand(21));
            monster = tempMonster;
		}

		public var flurryAmount:int = 1;
		public function endlessFlurry():void{
			outputText("You bring your [weapon] to readiness with a practiced flourish and narrow your eyes, focusing on your target. In a flash, you lash" +
					" out, attacking multiple times in quick succession!\n");
			for(var i:int = 0;i < flurryAmount;i++){
				combat.performAttack(combat.calcDamage(true,false)*0.5,i);
				outputText("\n");
			}
			flurryAmount++;
			flurryAmount = Math.min(flurryAmount,5);
            combat.startMonsterTurn();

		}

		public function whipTripChance():Number{
            return monster.standardDodgeFunc(player,-10);
		}

        public var whipTripFunc:CombatAbility = new CombatAbility({
            abilityFunc: whipTrip,
            cost: function ():Number { return 15 - player.weapon.masteryLevel(); },
            tooltip: function():String{
                return "Use your whip to trip your target! If successful, prevents movement and massively reduces speed for one turn." + combat.fancifyDamageRange(0,0,combat.combatAbilities.whipTripChance());
            },
            availableWhen: function():Boolean{return player.weapon.isWhip() && player.masteryLevel(MasteryLib.Whip) >= 2},
            spellName: "Whip Trip",
            spellShort: "Whip Trip",
            range: CombatAttackData.RANGE_MELEE,
            abilityType: CombatAbility.PHYSICAL
        })

		public function whipTrip():void{
			outputText("You react quickly to [themonster]'s attempt to flee, cracking your [weapon] on the ground and then swiftly lashing it towards" +
					" [themonster]!");
            if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:whipTripChance()}).failed) {
                outputText("\nYou catch [monster.pronoun3] legs, halting [monster.pronoun2] in [monster.pronoun3] tracks! With a mighty pull, you cause" +
                        " [monster.pronoun2] to trip, falling face-first on the ground! [monster.pronoun1caps] is quick to free [monster.pronoun2]self, but" +
                        " [monster.pronoun1] is clearly dazed and unbalanced!");
				monster.addStatusEffect(new Tripped());
            }else{
                outputText("\nYou fail to catch [themonster], and [monster.pronoun1] manages to distance [monster.pronoun2]self from you!");
				combatAttackData.distance(monster,false);
			}
            combat.execMonsterAI(combat.currMonsterIndex+1);
    }

		public function summonedSwordDamage(minDamage:Boolean = false,maxDamage:Boolean = false):Number{
			if(minDamage) return monster.reduceDamageMin(50 * (1+player.spellMod()/3));
			if(maxDamage) return monster.reduceDamageMax(80 * (1+player.spellMod()/3));
			return monster.reduceDamageCombat((50 + rand(30)) * (1+player.spellMod()/3));
		}
        public function summonSword():void{
            outputText("You hold your hands together and focus your magic on them. They crackle with energy as you spread them apart, molding sheer arcane power into the shape of a scimitar!" +
					"\n\nAfter finishing the tip and the pommel, the scimitar comes to life, levitating from your hand and pointing itself at your target!");
            player.createOrFindStatusEffect(StatusEffects.CirceSummonedScimitar).value1 += 1;
            combat.startMonsterTurn();
        }

		public function summonedSwordChance():Number{
			return 75 - monster.getEvasionChance();
		}
        public function summonedSwordSlash():void{
			monster = monsterArray[rand(monsterArray.length-1)];
            outputText("\nYour summoned sword is enveloped in blue energy as it flies towards [themonster] and attacks!");
            if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:summonedSwordChance()}).failed) {
				outputText(" The magical blade strikes true, landing a precise blow and dashing away before it could be attacked in return!");
				switch(rand(2)){
					case 0:
						outputText(" It spins and turns in mid-air, apparently excited over landing a blow.");
						break;
					case 1:
						outputText(" The blade points itself towards [themonster] and thrusts itself a couple of times, taunting its foe.")
						break;
					case 2:
						outputText(" The scimitar spins in a fancy flourish, as if it were being held by a practiced swordsman.");
						break;
				}
                combat.doDamage(summonedSwordDamage(),true,true,false,true);
            }else{
				outputText(" The scimitar fails to hit its target, and clumsily strikes the ground before floating away. It shakes and trembles, evidently irritated.");
			}
			outputText("\n\n");
        }

		public function divineWindAmount(min:Boolean = false,max:Boolean=false):Number{
			if(min) return player.maxHP() * (0.1) * player.spellMod()/1.75;
			if(max) return player.maxHP() * (0.25) * player.spellMod()/1.75;
			return player.maxHP() * (0.1 + Math.random()*0.15) * player.spellMod()/1.75;
		}

		public function divineWind():void{
			outputText("You hold your [weapon] close to your chest and close your eyes, focusing arcane energy within yourself." +
					"\nAfter a moment, you gently swipe your arms wide, magical energy spreading in waves from your fingers. Soon, the entire battlefield faintly glows, the wind itself enchanted to" +
					" heal all fighters!");
			player.addStatusEffect(new DivineWindBuff(4));
            combat.startMonsterTurn();
		}
		//Terrestrial Fire only gets partial benefit from spellmod, scaling with mastery
		public function tfSpellMod(ignoreSoulburst:Boolean = false):Number {
			return 1 + (player.spellMod(ignoreSoulburst) - 1) * player.masteryLevel(MasteryLib.TerrestrialFire) / 10;
		}

		public function tfXP(tier:int, multiplier:Number = 1):void {
			//Base xp
			var xp:int = Math.round((10/(1+Math.max(0, player.masteryLevel(MasteryLib.TerrestrialFire) - tier)) + tier*2) * multiplier);
			xp = randBetween(xp/2, xp*1.5);
			if (flags[kFLAGS.AKBAL_QUEST_STATUS] & 64 == 0) xp = Math.max(1,xp/5);
			player.masteryXP(MasteryLib.TerrestrialFire, xp);
		}

		public function tfFatigue(baseFatigue:Number, tier:int):Number {
			return baseFatigue * (1 - Math.max(0, 0.05 * (1 + player.masteryLevel(MasteryLib.TerrestrialFire) - tier)));
		}

		public function tfComboList(spell:String):String {
			var display:String = "\nSynergy: ";
			switch (spell) {
				case "Plate":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 1) {
						display += "Inflame";
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 2) display += ", Molten Plate";
					}
					else display = "";
					break;
				case "Inflame":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 1) display += "Plate";
					else display = "";
					break;
				case "Spout":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 2) display += "Quake";
					else display = "";
					break;
				case "Stone Knives":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 3) display += "Scorch";
					else display = "";
					break;
				case "Terra Core":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 && achievements[kACHIEVEMENTS.NIGHT_SUN] > 0) display = "\nSpecial synergy: Terra Flames + Quake + Scorch + Molten Plate";
					else display = "";
					break;
				case "Terra Flames":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 && achievements[kACHIEVEMENTS.NIGHT_SUN] > 0) display = "\nSpecial synergy: Terra Core + Quake + Scorch + Molten Plate";
					else display = "";
					break;
				default:
					display = "";
			}
			return display;
		}
		public function tfCombod(spell:String):Boolean {
			switch (spell) {
				case "Plate":
					if (tfComboReady("Molten Plate") || tfComboReady("Shell")) return true;
					break;
				case "Inflame":
					if (tfComboReady("Molten Plate") || tfComboReady("Shell")) return true;
					break;
				case "Molten Plate":
					if (tfComboReady("Shell")) return true;
					break;
				case "Spout":
					if (tfComboReady("Eruption")) return true;
					break;
				case "Stone Knives":
					if (tfComboReady("Meteor Shower")) return true;
					break;
				case "Terra Core":
					if (tfComboReady("Terra Star")) return true;
					break;
				case "Terra Flames":
					if (tfComboReady("Terra Star")) return true;
					break;
				default:
					return false;
			}
			return false;
		}
		public function tfComboReady(spell:String):Boolean {
			switch (spell) {
				case "Molten Plate":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 1 && (player.hasStatusEffect(StatusEffects.TFInflame) || player.hasStatusEffect(StatusEffects.TFPlate))) return true;
					break;
				case "Shell":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 2 && player.hasStatusEffect(StatusEffects.TFMoltenPlate)) return true;
					break;
				case "Eruption":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 2 && player.hasStatusEffect(StatusEffects.TFQuake)) return true;
					break;
				case "Meteor Shower":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 3 && player.hasStatusEffect(StatusEffects.TFScorch)) return true;
					break;
				case "Terra Star":
					if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 && player.hasStatusEffect(StatusEffects.TFMoltenPlate) && player.hasStatusEffect(StatusEffects.TFQuake) && player.hasStatusEffect(StatusEffects.TFScorch) && (player.str + player.inte) >= 150 && tfSpellMod() >= 2) return true;
					break;
				default:
			}
			return false;
		}

		public function tfPlateCalc():int {
			return Math.round((player.str / (25 - 2*player.masteryLevel(MasteryLib.TerrestrialFire))) * tfSpellMod());
		}
		public function tfPlate(silent:Boolean = false):void {
			player.createStatusEffect(StatusEffects.TFPlate,tfPlateCalc(),0,0,0);
			if (silent) return;
			clearOutput();
			tfXP(1);
			outputText("Your body attunes to the earth, summoning plates of rock around your flesh.\n\n");
			combat.startMonsterTurn();
		}

		public function tfInflameCalc(type:String="damage"):int {
			//Stronger than charge weapon unless you have low int with high spellmod for some reason. Gets super strong with crazy int, but the damage you take also scales with int so it can be dangerous
			var damage:Number = (12 + player.inte * player.masteryLevel(MasteryLib.TerrestrialFire) / 50) * tfSpellMod() * (player.hasPerk(PerkLib.ArcaneSmithing) ? player.perkv1(PerkLib.ArcaneSmithing) : 1);
			//Take percent-based damage so it doesn't become trivial at high levels
			var selfDamage:Number = Math.max(player.maxHP() * player.inte/5000, damage/2);
			//Self-damage reduced by toughness
			selfDamage *= 0.6 + 40/(100 + player.tou);

			if (type=="self") return Math.round(selfDamage);
			else return Math.round(damage);
		}
		public function tfInflame(auto:Boolean = false):void {
			player.createStatusEffect(StatusEffects.TFInflame,tfInflameCalc(),0,0,0);
			if (auto) return;
			clearOutput();
			tfXP(1);
			outputText("The fire in your eyes brightens for a moment. In an instant, wisps of emerald flame spill from the core of your form, igniting along the contours of your every muscle, until sliding over your [weapon].");
			combat.startMonsterTurn();
		}

		public function tfMoltenPlateDesc():String {
			var desc:String = "";
			if (player.hasStatusEffect(StatusEffects.TFPlate)) desc = "Infuse your weapon and earthen armor with flames, increasing your attack damage by " + tfInflameCalc("damage") + " and harming enemies that get too close to the molten rock.";
			else desc = "Coat your flaming body with stone, blending earth and fire to increase your armor by " + tfPlateCalc() + " and damage enemies that get too close to the molten rock.";
			desc += " Be warned that covering your body in lava does have its downsides. " + tfComboList("Molten Plate");
			return desc;
		}
		public function tfMoltenPlateCalc(type:String="damage"):int {
			var damage:Number = (10 + player.str * player.masteryLevel(MasteryLib.TerrestrialFire) / 50 + player.inte * player.masteryLevel(MasteryLib.TerrestrialFire) / 50) * tfSpellMod();
			var selfDamage:Number = damage/2;
			//Self-damage reduced by toughness
			selfDamage *= 0.4 + 60/(100 + player.tou);
			//Actual value returned is between 50% and 100% of base
			var mod:Number = 0.5+Math.random()*0.5;

			if (type=="self") return Math.round(mod*selfDamage);
			else return Math.round(mod*damage);
		}
		public function tfMoltenPlate(silent:Boolean = false):void {
			if (silent) {
				player.createOrFindStatusEffect(StatusEffects.TFPlate).value1 = tfPlateCalc();
				player.createOrFindStatusEffect(StatusEffects.TFInflame).value1 = tfInflameCalc();
				player.createStatusEffect(StatusEffects.TFMoltenPlate,0,0,0,0);
				return;
			}
			clearOutput();
			tfXP(2, 2);
			if (player.hasStatusEffect(StatusEffects.TFPlate)) outputText("Calling on the flames within, every crack between your armor plates begins to glow brilliant green until the flames spill out over your [weapon].");
			else outputText("Earthen plates grow around your flesh, compressing the emerald flames imbuing you. Hot, dark stones adorn you, deep green shining through the cracks between plates.");
			player.createOrFindStatusEffect(StatusEffects.TFPlate).value1 = tfPlateCalc();
			player.createOrFindStatusEffect(StatusEffects.TFInflame).value1 = tfInflameCalc();
			player.createStatusEffect(StatusEffects.TFMoltenPlate,0,0,0,0);
			combat.startMonsterTurn();
		}

		public function tfShell():void {
			player.createStatusEffect(StatusEffects.TFShell,1,0,0,0);
			clearOutput();
			tfXP(3);
			outputText("Crouching low, your rocky armor grows in density and weight, locking you down in a protective shell.");
			combat.startMonsterTurn();
		}

		public function tfQuakeCalc(type:String="default"):int {
			var finalDamage:int = 0;
			var damageLow:Number = player.str/10;
			var damageHigh:Number = Math.max(damageLow, combat.globalMod(5 * player.masteryLevel(MasteryLib.TerrestrialFire)) * tfSpellMod());
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh));
			}
			finalDamage = Math.round(finalDamage);
			return finalDamage;
		}
		public function tfQuakeExec(mainTarget:Monster = null, aftershocks:Boolean = true):Boolean {
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			currDamage = tfQuakeCalc();
			var stunChance:int = (5 + player.masteryLevel(MasteryLib.TerrestrialFire)) * (aftershocks ? 1 : 5);
			var stunned:Boolean = false;
			if (monster == mainTarget) {
				currDamage *= 1.5;
				stunChance = 100;
			}
			if (monster.stun(1, stunChance)) {
				outputText("[Themonster] is stunned by the quake! ");
				stunned = true;
			}
			else outputText("\n[Themonster] manages to retain [monster.pronoun3] footing. ");
			currDamage = combat.doDamage(currDamage,true,true);
			outputText("\n");
			return stunned;
		}
		public function tfQuakeAftershocks():void {
			outputText("[pg]");
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			var mainTarget:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				tfQuakeExec();
            }
			monster = mainTarget;
			outputText("Aftershocks of your quake rumble through the cracked earth.");
		}
		public function tfQuake():void {
			player.createStatusEffect(StatusEffects.TFQuake,3,0,0,0);
			clearOutput();
			tfXP(2);
			var didStun:Boolean = false;
			var mainTarget:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				didStun ||= tfQuakeExec(mainTarget, false);
            }
			monster = mainTarget;
			outputText("You slam your arms into the earth, sending tremors and a network of thin cracks across the battlefield, " + (didStun ? "toppling your foe" + (monsterArray.length > 1 ? "s as they stumble" : " as [monster.pronoun1] stumbles") + " down against the shattering ground." : "accomplishing little more than intimidation."));
			combat.startMonsterTurn();
		}

		public function tfSpoutCalc(type:String="default"):Number {
			var finalDamage:int = 0;
			var damageLow:Number = calcInfernoMod(combat.globalMod(5 * player.masteryLevel(MasteryLib.TerrestrialFire) + player.inte / 2),true) * tfSpellMod();
			var damageHigh:Number = damageLow + calcInfernoMod(combat.globalMod(player.inte * player.masteryLevel(MasteryLib.TerrestrialFire) / 10),true) * tfSpellMod();
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow, 90);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh, 90);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh), 90);
			}
			finalDamage = Math.round(finalDamage * monster.fireRes);
			return finalDamage;
		}
		public function tfSpout():void {
			clearOutput();
			tfXP(2);
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			currDamage = tfSpoutCalc();
			boostInferno();
			outputText("Your hands grip the ground, sending waves of light rippling through. Seconds later, spirals of emerald engulf [themonster]! ");
			if (monster.react(monster.CON_BURNED)) currDamage = combat.doDamage(currDamage, true, true);
			combat.startMonsterTurn();
		}

		public function tfEruptionCalc(type:String="default"):Number {
			var finalDamage:int = 0;
			var damageLow:Number = calcInfernoMod(combat.globalMod(5 * player.masteryLevel(MasteryLib.TerrestrialFire) + player.inte / 2),true) * tfSpellMod();
			var damageHigh:Number = damageLow + calcInfernoMod(combat.globalMod(player.inte * player.masteryLevel(MasteryLib.TerrestrialFire) / 10),true) * tfSpellMod();
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow, 90);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh, 90);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh), 90);
			}
			finalDamage = Math.round(finalDamage * monster.fireRes);
			return finalDamage;
		}
		public function tfEruptionExec():void {
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			currDamage = tfEruptionCalc();
			outputText("\n[Themonster] is engulfed in flames! ");
			if (monster.react(monster.CON_BURNED)) currDamage = combat.doDamage(currDamage, true, true);
		}
		public function tfEruption():void {
			clearOutput();
			tfXP(3, 2);
			outputText("Summoning great verdant light, the cracks across the earth shimmer as the battlefield is bathed in terrestrial fire!");
			var mainTarget:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				tfEruptionExec();
            }
			outputText("\n");
			monster = mainTarget;
			boostInferno();
			combat.startMonsterTurn();
		}

		public function tfStoneKnivesAccuracy():int {
			return monster.standardDodgeFunc(player, -35 + 5 * player.masteryLevel(MasteryLib.TerrestrialFire));
		}
		public function tfStoneKnivesCalc(type:String="default"):int {
			var finalDamage:int = 0;
			var damageLow:int = Math.round(combat.globalMod(1 + player.str / (30 - 2 * player.masteryLevel(MasteryLib.TerrestrialFire))) * tfSpellMod());
			var damageHigh:int = damageLow + Math.round(combat.globalMod(player.str / (30 - 2 * player.masteryLevel(MasteryLib.TerrestrialFire))) * tfSpellMod());
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh));
			}
			finalDamage = Math.round(finalDamage);
			return finalDamage;
		}
		public function tfStoneKnivesExec():int {
			var damage:int = tfStoneKnivesCalc();
			if (combatAvoidDamage({doDodge:true,doParry:true,doBlock:true,toHitChance:tfStoneKnivesAccuracy()}).failed) {
				currDamage += damage;
				return 1;
			}
			return 0;
		}
		public function tfStoneKnives():void {
			var stoneCount:int = randBetween(5 + 4 * player.masteryLevel(MasteryLib.TerrestrialFire), 25);
			var hitCount:int = 0;
			clearOutput();
			tfXP(3);
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			currDamage = 0;
			for (var i:int = 0; i < stoneCount; i++) hitCount += tfStoneKnivesExec();
			outputText("Your dive your hand into the ground, running it forward, then pulling up. Dozens of rocky shards fly out as your hand raises up, riddling your enemy with countless knives.\n");
			if (hitCount == 0) outputText("...But not a single one manages to hit [themonster].");
			else if (hitCount*2 < stoneCount) outputText("[Themonster] manages to avoid most of the shards, " + (currDamage > 5 ? "with only " + hitCount + " striking their target. " : "and the ones that do reach their mark don't seem to have done any real damage. "));
			else outputText("[Themonster] is battered by " + hitCount + " stone shards" + (currDamage > 5 ? ". " : ", but seems to be unharmed. "));
			currDamage = combat.doDamage(currDamage, true, true);
			combat.startMonsterTurn();
		}

		public function tfMeteorShowerAccuracy():int {
			return monster.standardDodgeFunc(player, -40 + 5 * player.masteryLevel(MasteryLib.TerrestrialFire));
		}
		public function tfMeteorShowerCalc(type:String="default"):Number {
			var finalDamage:int = 0;
			var damageLow:int = Math.round(combat.globalMod(1 + player.str / (30 - 2 * player.masteryLevel(MasteryLib.TerrestrialFire))) * tfSpellMod());
			var damageHigh:int = damageLow + Math.round(combat.globalMod(player.str / (30 - 2 * player.masteryLevel(MasteryLib.TerrestrialFire))) * tfSpellMod());
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow, 30);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh, 30);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh), 30);
			}
			finalDamage = Math.round(finalDamage);
			return finalDamage;
		}
		public function tfMeteorShowerExec(target:Monster, stoneCount:int):void {
			monster = target;
			var damage:int = 0;
			var hitCount:int = 0;
			var bonus:int = 0;
			var grounded:Boolean = false;
			currDamage = 0;
			for (var i:int = 0; i < stoneCount; i++) {
				if (combatAvoidDamage({doDodge:true,doParry:true,doBlock:true,toHitChance:tfMeteorShowerAccuracy()}).failed) {
					damage = tfMeteorShowerCalc();
					hitCount++;
					bonus = 0;
					if (monster.isFlying) {
						bonus = randBetween(1,3);
						if ((hitCount+bonus) > 4) grounded = true;
					}
					hitCount += bonus;
					currDamage += damage*(1+bonus);
				}
			}
			if (grounded && monster.stun(1, 100)) {
				//No actual grounding for now, just extra damage and stun. The only enemies that can actually fly are Lethice (who shouldn't be so easily taken down, it would defeat the entire gimmick of phase 1) and Akbal (who is already defeated if you have this).
				outputText("[Themonster] burns and breaks in the onslaught, careening down in a pained heap after being struck by " + hitCount + " stones. ");
			}
			else if (hitCount == 0) outputText("\n[Themonster] escaped the meteor shower completely untouched. ");
			else outputText("\n[Themonster] is struck by " + hitCount + " stones" + (currDamage > 5 ? ". " : ", but seems to be unharmed. "));
			currDamage = combat.doDamage(currDamage, true, true);
		}
		public function tfMeteorShower():void {
			var stoneCount:int = randBetween(10 * player.masteryLevel(MasteryLib.TerrestrialFire), 50);
			stoneCount -= monsterArray.length;
			clearOutput();
			tfXP(4, 2);
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			outputText("You slam your body into the flame-stricken earth, sinking your arms into it. With true confluence of earth and fire, you tear through and send hundreds of burning stones flying up into the sky.");
			var mainTarget:Monster = monster;
			var barrageArray:Array = [];
			for (var i:int = 0; i < monsterArray.length; i++) barrageArray[i] = 1;
			for (var i:int = 0; i < stoneCount; i++) barrageArray[rand(monsterArray.length)] += 1;
			for (var i:int = 0; i < barrageArray.length; i++) tfMeteorShowerExec(monsterArray[i], barrageArray[i]);
			monster = mainTarget;
			combat.startMonsterTurn();
		}

		public function tfScorchCalc(type:String="default"):int {
			var finalDamage:int = 0;
			var damageLow:Number = calcInfernoMod(combat.globalMod(5 + 2 * player.masteryLevel(MasteryLib.TerrestrialFire) + player.inte / 4),true) * tfSpellMod();
			var damageHigh:Number = damageLow + calcInfernoMod(combat.globalMod(player.inte * player.masteryLevel(MasteryLib.TerrestrialFire) / 15),true) * tfSpellMod();
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow, 90);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh, 90);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh), 90);
			}
			finalDamage = Math.round(finalDamage * monster.fireRes);
			return finalDamage;
		}
		public function tfScorch():void {
			clearOutput();
			tfXP(3);
			outputText("Arms aloft, the weaving of magical fire becomes an art; you paint swathes of scorching viridescent flames across the battlefield. All who dare step through your newly consecrated grounds shall burn and bow to your power!");
			player.createStatusEffect(StatusEffects.TFScorch, 0, 0, 0, 0);
			boostInferno(false);
			combat.startMonsterTurn();
		}

		public function tfGeodeKnuckleDispel():void {
			clearOutput();
			outputText("The earth falls away from your fists as you dismiss the spell.");
			player.setWeapon(WeaponLib.FISTS);
			menu();
			addButton(0, "Next", combat.combatMenu, false);
		}
		public function tfGeodeKnuckle():void {
			clearOutput();
			tfXP(4);
			player.gems -= 10;
			combat.damageType = combat.DAMAGE_PHYSICAL_MELEE;
			var mod:Number = 1.3 + 0.35 * (player.masteryLevel(MasteryLib.TerrestrialFire) - 3);
			outputText("Your arms become engulfed in stone and crystal, lining your knuckles in shards of gemstone. With earth-imbued strength, you lunge forward in furious might, mutilating the opponent with your might!\n");
			flags[kFLAGS.PLAYER_DISARMED_WEAPON_ID] = player.weapon.id;
			player.createStatusEffect(StatusEffects.TFGeodeKnuckle, 0, 0, 0, 0);
			player.setWeapon(weapons.G_KNUCKLE);
			combat.performAttack(combat.calcDamage(true,false) * mod);
			if (flags[kFLAGS.PLAYER_DISARMED_WEAPON_ID] != WeaponLib.FISTS.id) player.setWeapon(ItemType.lookupItem(flags[kFLAGS.PLAYER_DISARMED_WEAPON_ID]) as Weapon);
			combat.startMonsterTurn();
		}

		public function tfCarnalBurnCalc(type:String="damage"):int {
			var damage:Number = (player.lust100 / 2) * player.maxHP() / 100;
			if (type == "damage") {
				damage = calcInfernoMod(combat.globalMod(damage),true) * tfSpellMod();
				damage = Math.round(monster.reduceDamageCombat(damage * monster.fireRes, 100));
			}
			return damage;
		}
		public function tfCarnalBurnExec():void {
			currDamage = tfCarnalBurnCalc();
			outputText("\n[Themonster] is burnt by the flames of your lust! ");
			if (monster.react(monster.CON_BURNED)) currDamage = combat.doDamage(currDamage, true, true);
		}
		public function tfCarnalBurn():void {
			clearOutput();
			tfXP(4);
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			var aoe:Boolean = false;
			outputText("The heat of your loins distills through your blood as you call upon it like flames, becoming waves of emerald. The blaze tears through your flesh to escape, being directed out toward ");
			if (player.lust100 > 70) {
				aoe = true;
				outputText("any and all who dare stand against your power! ");
			}
			else outputText("[themonster] in a ball of fire! ");
			if (aoe) {
				var oldMonster:Monster = monster;
				for each (var currMonster:Monster in monsterArray) {
					monster = currMonster;
					tfCarnalBurnExec();
				}
				monster = oldMonster;
			}
			else if (monster.react(monster.CON_BURNED)) currDamage = combat.doDamage(tfCarnalBurnCalc(), true, true);
			boostInferno();
			combat.monsterDamageType = combat.DAMAGE_FIRE;
			player.takeDamage(tfCarnalBurnCalc("self"), false);
			dynStats("lus=", 0);
			combat.startMonsterTurn();
		}

		public function tfTerraCoreAccuracy():int {
			return monster.standardDodgeFunc(player, player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 ? 0 : -10);
		}
		public function tfTerraCoreCalc(type:String="default"):int {
			var level:int = Math.min(player.level, 30);
			var finalDamage:int = 0;
			var damageLow:Number = combat.globalMod(25 + player.inte/2 + player.str/2 + (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 ? level*3 : 0)) * tfSpellMod();
			var damageHigh:Number = damageLow + combat.globalMod(player.inte/3 + player.str/3) * tfSpellMod();
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(damageLow, 30);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(damageHigh, 30);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(randBetween(damageLow,damageHigh), 30);
			}
			//Apply partial fire resist/weakness
			var adjustedResist:Number = 1 + (monster.fireRes - 1) / 4;
			finalDamage = Math.round(finalDamage * adjustedResist);
			return finalDamage;
		}
		public function tfTerraCoreRetry():void {
			player.removeStatusEffect(StatusEffects.TFTerraCore);
			currDamage = tfTerraCoreCalc();
			outputText("\n\nThe molten core makes its second attempt as it streaks towards [themonster], ");
			if (combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:tfTerraCoreAccuracy()}).success) {
				outputText("missing yet again before it crashes harmlessly into the ground, no energy left for another pass.");
			}
			else {
				if (rand(2) == 0) {
					currDamage *= 0.5;
					outputText("bursting as it slams into [monster.pronoun2]! Unfortunately it lost some of its power after the long flight, hitting with less force than expected.");
				}
				else outputText("slamming into [monster.pronoun2] with incredible force!");
				currDamage = combat.doDamage(currDamage, true, true);
			}
		}
		public function tfTerraCore():void {
			clearOutput();
			tfXP(6, 1.5);
			combat.damageType = combat.DAMAGE_PHYSICAL_RANGED;
			currDamage = tfTerraCoreCalc();
			outputText("Emerald inferno spirals up from your hands. Your body's core is summoned forth in the form of indomitable rock, molten with spirit. A great heave of your arms sends the mighty terrestrial core flying ");
			if (combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:tfTerraCoreAccuracy()}).success) {
				outputText("towards [themonster], but it fails to hit its target. It continues flying, making a wide arc as it turns for another attempt.");
				player.createStatusEffect(StatusEffects.TFTerraCore,0,0,0,0);
			}
			else {
				outputText("into [themonster], knocking [monster.pronoun2] back with the incredible force of your fury! ");
				currDamage = combat.doDamage(currDamage, true, true);
			}
			combat.startMonsterTurn();
		}

		public function tfTerraFlamesCalc(type:String="default"):Number {
			var level:int = Math.min(player.level, 30);
			var finalDamage:int = combat.globalMod(25 + player.inte/2 + (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 ? level*3 : 0)) * tfSpellMod();
			switch (type) {
				case "min":
					finalDamage = monster.reduceDamageMin(finalDamage, 100);
					break;
				case "max":
					finalDamage = monster.reduceDamageMax(finalDamage, 100);
					break;
				default:
					finalDamage = monster.reduceDamageCombat(finalDamage, 100);
			}
			finalDamage = Math.round(finalDamage * monster.fireRes);
			return finalDamage;
		}
		public function tfTerraFlamesExec():void {
			currDamage = tfTerraFlamesCalc();
			outputText("\n[Themonster] is wreathed in emerald flames. ");
			if (monster.react(monster.CON_BURNED)) currDamage = combat.doDamage(currDamage, true, true);
		}
		public function tfTerraFlames():void {
			clearOutput();
			tfXP(6, 1.5);
			combat.damageType = combat.DAMAGE_MAGICAL_RANGED;
			outputText("You plant your feet firmly on the ground and direct your energy into the earth, emerald flames billowing out around your feet as the ground begins to rumble. An instant later, the entire battlefield shudders and an inferno of terrestrial fire surges up from beneath!");
			var oldMonster:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				tfTerraFlamesExec();
            }
			monster = oldMonster;
			boostInferno();
			combat.startMonsterTurn();
		}
		public function tfTerraStarCalc(type:String="default"):int {
			var level:int = Math.min(player.level, 20);
			var curve:Number = 3;
			var centre:Number = 600;
			//Yes, the harmonic mean is absolutely necessary. I don't make the rules.
			var damage:Number = 4/(1/(level*5) + 1/player.str + 1/player.inte + 1/(tfSpellMod(true)*50)) * player.masteryLevel(MasteryLib.TerrestrialFire);
			//Exaggerate the distance from a central value. Higher curve means faster divergence.
			damage = Math.pow(damage, curve)*Math.pow(centre,1-curve);
			switch (type) {
				case "min":
					damage *= 80/100;
					damage = monster.reduceDamageMin(damage, 70);
					break;
				case "max":
					damage *= 120/100;
					damage = monster.reduceDamageMax(damage, 70);
					break;
				default:
					damage *= randBetween(80,120)/100;
					damage = monster.reduceDamageCombat(damage, 70);
			}
			return Math.round(damage); //Fire resist to be applied later, since it can vary depending on attack outcome
		}
		public function tfTerraStarAccuracy(control:Boolean = false):int {
			return monster.standardDodgeFunc(player, control ? 10 : -10);
		}
		public function tfTerraStarAttack(control:Boolean = false):void {
			var oldTarget:Monster = monster;
			currDamage = tfTerraStarCalc();
			var bonusDamage:int = 0;
			var firePortion:Number = player.inte / (player.str + player.inte);
			var fatigueDamage:int = control ? 3 : 2;
			var bonusEffects:Array = ["nothing","nothing"];
			var weakened:Boolean = false;
			var bonusStun:int = 0;
			var doubleAttack:Boolean = false;
			if (control) {
				clearOutput();
				player.addStatusValue(StatusEffects.TFTerraStar, 1, 1);
				bonusEffects.push("stun","double","flare","pulse");
				outputText("You focus on guiding the movements of your miniature star.");
			}
			else {
				monster = monsterArray[rand(monsterArray.length)];
			}
 			var outcome:Object = combatAvoidDamage({doDodge:true,doParry:true,doBlock:true,toHitChance:tfTerraStarAccuracy(control)});
			if (outcome.dodge != null) { //dodged, roll dodge again to see how much damage is reduced
				if (rand(100) < tfTerraStarAccuracy(control)) {
					currDamage *= firePortion * 0.25;
					firePortion = 1;
					outputText("\nThe emerald star flies swiftly towards [themonster], just barely missing but leaving [monster.pronoun2] fatigued and pained from the heat. ");
				}
				else {
					currDamage *= 0;
					firePortion = 1;
					fatigueDamage -= 2;
					outputText("\nThe emerald star flies swiftly towards [themonster], but it's easily dodged. ");
				}
			}
			else if (outcome.parry) { //parried, reduced damage but drain more fatigue, chance to debuff strength
				currDamage *= firePortion * 0.4;
				firePortion = 1;
				fatigueDamage += 1;
				outputText("\n[Themonster] manage" + (monster.plural ? "" : "s") + " to deflect the star and avoid a direct hit, but the exertion and close contact with the flames still leaves [monster.pronoun2] drained. ");
				weakened = weakened || rand(100) < 50;
			}
			else if (outcome.block) { //blocked, reduced damage but drain more fatigue, chance to stun
				currDamage *= firePortion * 0.6;
				firePortion = 1;
				fatigueDamage += 2;
				outputText("\n[Themonster] raises [monster.pronoun3] shield and stands firm as the emerald star barrels towards [monster.pronoun2]. The shield absorbs most of the impact, but [themonster] is left staggered by the blow and the flames surge past the shield. ");
				if (control) bonusStun = 1;
				else if (monster.stun(1,50)) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " stunned!");
			}
			else { //hit
				outputText("\nThe emerald star streaks through the air, flames surging as it collides with [themonster] with bone-shattering force! ");
			}
			//Apply partial fire resist/weakness
			var adjustedResist:Number = 1 + (monster.fireRes - 1) * firePortion;
			currDamage = combat.doDamage(currDamage * adjustedResist, true, true);
			monster.changeFatigue(fatigueDamage);
			if (weakened) {
				(monster.createOrFindStatusEffect(StatusEffects.TFTerraStarWeaken) as TerraStarDebuff).increase();
				outputText("\n[Themonster] seem" + (monster.plural ? "" : "s") + " weaker after parrying the star.");
			}
			switch (bonusEffects[rand(bonusEffects.length)]) {
				case "stun":
					if (monster.stun(1+bonusStun,100)) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " stunned!");
					break;
				case "double":
					if (bonusStun > 0) { if (monster.stun(1,100)) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " stunned!"); }
					doubleAttack = true;
					break;
				case "flare":
					if (bonusStun > 0) { if (monster.stun(1,100)) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " stunned!"); }
					outputText("\nYour star suddenly flares with blistering heat before sending out countless filaments, resembling whips of flame, to bombard the entire area.");
					for each (var currMonster:Monster in monsterArray) {
						monster = currMonster;
						bonusDamage = tfTerraStarCalc() / 3;
						outputText("\n[Themonster] is struck by the brilliant flames. ");
						combat.doDamage(bonusDamage * monster.fireRes, true, true);
					}
					break;
				case "pulse":
					if (bonusStun > 0) { if (monster.stun(1,100)) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " stunned!"); }
					outputText("\nYour star briefly pulses with blinding light, the intense radiance bright enough to cause pain even through closed eyes.");
					for each (var currMonster:Monster in monsterArray) {
						monster = currMonster;
						if (!monster.react(monster.CON_BLINDED)) continue;
						outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " blinded!");
						monster.createStatusEffect(StatusEffects.Blind, 3, 0, 0, 0);
					}
 					break;
				case "nothing":
				default:
					if (bonusStun > 0) { if (monster.stun(1,100)) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " stunned!"); }
			}
			monster = oldTarget;
			if (doubleAttack) tfTerraStarAttack(false);
			if (control) combat.startMonsterTurn();
 		}
		public function tfTerraStar():void {
			clearOutput();
			tfXP(7, 3);
			outputText("You slit your palms with a jagged rock before slamming your hands into the ground, letting your blood soak into the quaking earth as you gather flames deep in your chest. A deep fissure opens up in front of you, and you pour all your energy into the ground, exhaling a torrent of emerald flames to fill the rift.");
			outputText("[pg]Blood is drained rapidly from your body and the fissure seals itself while you focus on compressing the energies trapped beneath the earth. The tremors die down and the flames criss-crossing the battlefield are absorbed back into the ground, causing a brief moment of peace, until a blazing sphere bursts out of the earth in front of you, a tightly-packed ball of brilliant emerald flames surrounding a solid earthen core.\n");
			player.fatigue = player.maxFatigue();
			player.HPChange(-player.HP/2, true, true);
			player.createStatusEffect(StatusEffects.TFTerraStar,1,0,0,0);
			player.createStatusEffect(StatusEffects.TFTerraStarCooldown,0,0,0,0);
			player.removeStatusEffect(StatusEffects.TFQuake);
			player.removeStatusEffect(StatusEffects.TFScorch);
			combat.startMonsterTurn();
		}
		public function tfSupernovaCalc():int {
			return tfTerraStarCalc() * (10 + rand(11));
		}
		public function tfSupercharge():void {
			clearOutput();
			if (player.statusEffectv1(StatusEffects.TFSupercharging) >= 2) tfSupernovaExec();
			else {
				outputText("The humming of your star gets louder, resonating with the earth, as you continue to focus.");
				player.addStatusValue(StatusEffects.TFSupercharging, 1, 1);
				combat.startMonsterTurn();
			}
		}
		public function tfSupernovaExec():void {
			tfXP(10, 4);
			(player.createStatusEffect(StatusEffects.TFTerraStarCooldown,0,0,0,0) as TerraStarCooldown).setDuration(120);
			player.addStatusValue(StatusEffects.TFTerraStarCooldown, 2, 1);
			player.addStatusValue(StatusEffects.TFSupercharging, 2, 1);
			if (silly()) outputText("You suddenly lift your heels and raise your arms at an angle with your palms out, a tear spilling from your eye as you gaze at your very own sun at the moment of its sacrifice. ");
			outputText("The star's humming reaches a climax. Slowly, it begins to expand, nearly doubling in diameter before suddenly exploding with a cataclysmic outburst of force. The earth is rent asunder by the shockwave and the entire area is blanketed by a storm of fire, lava, and solid shards of rock.");
			outputText("[pg]Unable to resist the force of the supernova, your charred and mangled body collapses to the ground, barely clinging to life. You can only hope that your " + ((monster.plural || monsterArray.length > 1) ? "enemies are" : "enemy is") + " worse off than you.");
			var oldMonster:Monster = monster;
			for each (var currMonster:Monster in monsterArray) {
				monster = currMonster;
				currDamage = tfSupernovaCalc();
				currDamage = combat.doDamage(currDamage, true, false);
				if (monster.HP > 0) outputText("\n[Themonster] " + (monster.plural ? "are" : "is") + " left badly injured, but regrettably not defeated. (" + currDamage + ")");
            }
			monster = oldMonster;
			player.HP = 0;
			combat.startMonsterTurn();
		}
		public function tfSupernova():void {
			clearOutput();
			outputText("You and your star both become still, the star emitting a gentle hum as you focus on gathering energy within it.");
			player.createStatusEffect(StatusEffects.TFSupercharging,0,0,0,0);
			combat.startMonsterTurn();
		}

		//Vine Armor Abilities
		public var vineTripFunc:CombatAbility = new CombatAbility({ //Stolen from whip trip
            abilityFunc: vineTrip,
            cost: function ():Number { return 10; },
            tooltip: function():String{
                return "Use your vines to trip your target! If successful, prevents movement and massively reduces speed for one turn." + combat.fancifyDamageRange(0,0,combat.combatAbilities.whipTripChance());
            },
            availableWhen: function():Boolean{return kGAMECLASS.armors.VINARMR.saveContent.armorStage > 3},
            spellName: "Vine Trip",
            spellShort: "Vine Trip",
            range: CombatAttackData.RANGE_MELEE,
            abilityType: CombatAbility.PHYSICAL
        })
		public function vineTrip():void{
			outputText("You react quickly to [themonster]'s attempt to flee, cracking your vines on the ground and then swiftly lashing them towards" +
					" [themonster]!");
            if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false,toHitChance:whipTripChance()}).failed) {
                outputText("\nYou catch [monster.pronoun3] legs, halting [monster.pronoun2] in [monster.pronoun3] tracks! With a mighty pull, you cause" +
                        " [monster.pronoun2] to trip, falling face-first on the ground! [monster.pronoun1caps] is quick to free [monster.pronoun2]self, but" +
                        " [monster.pronoun1] is clearly dazed and unbalanced!");
				monster.addStatusEffect(new Tripped());
				if (monster.bleed(player)) outputText("");
            }else{
                outputText("\nYou fail to catch [themonster], and [monster.pronoun1] manages to distance [monster.pronoun2]self from you!");
				combatAttackData.distance(monster,false);
			}
            combat.execMonsterAI(combat.currMonsterIndex+1);
		}
		public function vineGrab():void { //Stolen from the naga contrict
			clearOutput();
			//Cannot be used on plural enemies
			if (monster.plural) {
				outputText("There are too many enemies.");
				menu();
				addButton(0, "Next", combat.combatMenu, false);
				return;
			}
			if (monster.short == "pod") {
				outputText("You can't grab something you're trapped inside of!");
				//Gone		menuLoc = 1;
				menu();
				addButton(0, "Next", combat.combatMenu, false);
				return;
			}
			//Amily!
			if (monster.hasStatusEffect(StatusEffects.Concentration)) {
				outputText("Amily easily glides around your attack thanks to her complete concentration on your movements.");
				combat.startMonsterTurn();
				return;
			}
			if (monster is VolcanicGolem){
				if (monster.hasStatusEffect(StatusEffects.VolcanicFistProblem)){
				outputText("\nSeeing the golem's arm half buried in the ground, you decide to wrap your vines around it and pull with all your strength, cringing while you resist the searing heat.\n");
				if (player.str > 80 && !monster.hasStatusEffect(StatusEffects.VolcanicFrenzy)){
					outputText("\nUsing your inhuman strength, you manage to rip out the golem's arm! The construct stumbles back, magma spraying from its arm socket. It doesn't seem to bring him any pain, but you're sure his physical strikes will be a lot less powerful now!\n");
					monster.createStatusEffect(StatusEffects.VolcanicWeapRed, 3, 0, 0, 0);
					monster.weaponAttack -= 40;
					if (monster.weaponAttack <= 0) monster.weaponAttack = 10;
				}else outputText("\nYou're just not strong enough to beat the Golem's might. You unwrap your vines before the construct has a chance to strike you.");
			}else{
				outputText("The golem swats you away as you attempt to grab it.");
			}
				combat.startMonsterTurn();
				return;
			}
			//WRAP IT UPPP
			if (rand(player.spe + 40) > monster.spe && monster.findPerk(PerkLib.Juggernaut) < 0) {
				if (monster.short == "demons") {
					outputText("You look at the crowd for a moment, wondering which of their number you should wrap up. Your glance lands upon a random demon amongst the crowd. You quickly slither through the demon crowd as it closes in around you and launch your tendril towards your chosen prey. You grab him out of the sea of monsters, wrap your thorny vine around his form, and squeeze tightly, grinning as you hear his roars of pleasure turn to cries of distress.");
				}
				//(Otherwise)
				else {
					outputText("You sling your vines violently at [themonster], twirling their thorny length around [monster.pronoun3] form. Yanking, you jolt [monster.pronoun2] toward you.");
					if (monster is Dullahan){
						outputText("\n\nSeeing no way around it, the Dullahan rears back and whips itself forward while in your grasp. Her head is launched off her torso and lands straight on your shoulder, where it starts biting your flesh with all her might!");
						player.takeDamage(10, true);
						if (player.HP <= 0) {
							doNext(combat.endHpLoss);
							return;
						}
					}
				}
				monster.createStatusEffect(StatusEffects.Constricted, 1 + rand(3), 0, 0, 0);
				game.combatAttackData.closeDistance(monster);
				if (monster.bleed(player, 1, .5)) outputText("");
			}
			//Failure
			else {
				//Failure (-10 HPs) -
				if(monster.findPerk(PerkLib.Juggernaut) < 0) outputText("You launch your vines at your opponent and attempt to wrap them around " + monster.pronoun2 + ". Before you can even get close enough, " +monster.a + monster.short + " jumps out of the way, causing you to miss completely. You quickly retract the vine and ready yourself. ");
				else outputText("You launch your vines at your opponent and attempt to enwrap " + monster.pronoun2 + ". You try your hardest to contain " + monster.pronoun2 + " within your grasp, but " + monster.pronoun1 + " is too much of a juggernaut! " + monster.pronoun1 + " breaks free of your bind forcefully, causing you to reel back.");
				if (player.HP <= 0) {
					doNext(combat.endHpLoss);
					return;
				}
			}
			outputText("\n\n");
			combat.startMonsterTurn();
		}
		public function vineConstrict():void {
			if (player.fatigue + player.physicalCost(10) > player.maxFatigue()) {
				outputText("You are too tired to constrict [themonster].");
				addButton(0, "Next", combat.combatMenu, false);
				return;
			}
			player.changeFatigue(10, 2);
			var damage:int = monster.maxHP() * (.10 + rand(15) / 100);
			combat.doDamage(damage, true, true);
			outputText("Tensing up, the obsidian vines bite into [themonster]'s flesh. ");
			if (monster.bleed(player, 1, 1.5)) outputText("");
			//Enemy faints -
			if (monster.HP < 1) {
				outputText("You can feel [themonster]'s life signs beginning to fade, and before you crush all the life from [monster.pronoun2], you let go, dropping [monster.pronoun2] to the floor, unconscious but alive.  In no time, [monster.pronoun3] eyelids begin fluttering, and you've no doubt [monster.pronoun1]'ll regain consciousness soon.  ");
				if (monster.short == "demons")
					outputText("The others quickly back off, terrified at the idea of what you might do to them.");
				outputText("\n\n");
				doNext(combat.endHpVictory);
				return;
			}
			if (monster is Dullahan){
				outputText("\n\nDespite your best efforts, the Dullahan is still biting fiercely on your shoulder!");
				player.takeDamage(10, true);
				if (player.HP <= 0) {
				doNext(combat.endHpLoss);
				return;
				}
			}
			outputText("\n\n");
			combat.startMonsterTurn();
		}
}
}

license: unknown