code:
/**
 * Created by aimozg on 09.01.14.
 */
package classes.Items
{
	import classes.BaseContent;
	import classes.ItemType;
	import classes.Player;
	import classes.PerkLib;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.internals.Utils;
	import classes.*;
	import classes.Scenes.Combat.CombatAttackData;

	public class WeaponEffects extends BaseContent//Equipable
	{
		public function WeaponEffects()
		{
		}
		public function none():void{//no effects.
			return;
		}

		public function dullahanDrain(drainAmount:int = 30,variation:int = 10):void{
					outputText("\nYou feel the scythe drain your life force.");
					player.takeDamage(drainAmount + rand(variation), true);
		}

		public function stun(chance:int = 10):void{
			if (monster.stun(rand(3),chance)) {
				outputText("\n" + monster.capitalA + monster.short + " reels from the brutal blow, stunned.");
			}
		}

		public function bleed(chance:int = 50):void{
			if (rand(100) <= chance && !monster.hasStatusEffect(StatusEffects.IzmaBleed))
				{
					if (!monster.bleed(player))
						{
							outputText("\n" + monster.capitalA + monster.short + " doesn't appear to be capable of bleeding!");
						}
						else
						{
							if (monster.plural) outputText("\n" + monster.capitalA + monster.short + " bleed profusely from the many bloody gashes left behind by your [weapon].");
							else outputText("\n" + monster.capitalA + monster.short + " bleeds profusely from the many bloody gashes left behind by your [weapon].");
						}
				}
		}

		public function stunAndBleed(chanceStun:int = 10, chanceBleed:int = 50):void{
			stun(chanceStun);
			bleed(chanceBleed);
		}

		public function corruptedTease(chance:int = 50, baseTease:int = 20, playerCorRatio:int = 15):void{
			if(rand(100) <= chance && monster.lustVuln > 0){
				if (player.cor < 60) dynStats("cor", .1);
				if (player.cor < 90) dynStats("cor", .05);
				if (!monster.plural) outputText("\n" + monster.capitalA + monster.short + " shivers and moans involuntarily from the whip's touches.");
				else outputText("\n" + monster.capitalA + monster.short + " shiver and moan involuntarily from the whip's touches.");
				monster.teased(monster.lustVuln * (baseTease + player.cor / playerCorRatio));
				if (rand(2) == 0) {
					outputText(" You get a sexual thrill from it. ");
					dynStats("lus", 1);
				}

			}
		}

		public function lustPoison(baseTease:int = 5, playerCorRatio:int = 10,type:String = "poison"):void{
			if (monster.lustVuln > 0) {
				if (type == "poison") outputText("\n" + monster.capitalA + monster.short + " shivers as your weapon's 'poison' goes to work.");
				if (type == "coiled"){
						if (!monster.plural) outputText("\n" + monster.capitalA + monster.short + " shivers and gets turned on from the whipping.");
						else outputText("\n" + monster.capitalA + monster.short + " shiver and get turned on from the whipping.");
				}
				monster.teased(monster.lustVuln * (baseTease + player.cor / playerCorRatio));
			}
		}

		public function strongRecoil():void{
			if (player.stun(0,150 - player.str)){
				outputText("\nThe weapon's recoil proves too strong for you! The firearm jumps and smacks you in the face, <b>stunning you!</b>");
			}
		}

		public function summonedDrain(cost:int = 5):void {
			player.changeFatigue(cost);
			if (player.fatigueLeft() <= 0) {
				outputText("\nUnable to maintain the spell, your [weapon] vanishes.");
				player.setWeapon(WeaponLib.FISTS);
			}
		}
	}

}


code:
/**
 * Created by aimozg on 09.01.14.
 */
package classes.Items
{
	import classes.BaseContent;
import classes.BonusDerivedStats;
import classes.ItemType;
	import classes.Items.Weapons.*;
	import classes.PerkLib;
	import classes.Items.WeaponEffects;
	import classes.internals.Utils;

import flash.utils.Dictionary;

import flash.utils.describeType;

import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;

public final class WeaponLib extends BaseContent
	{
		public static const DEFAULT_VALUE:Number = 6;

		public static const FISTS:Fists = new Fists();

		//public const JAGCLAW:Weapon = new JaguarClaws();
		public const B_SWORD:Weapon = new BeautifulSword();
		public const B_SCARB:Weapon = new Weapon("B.ScarB", "B.ScarBlade", "broken scarred blade", "a broken scarred blade", "slash", 12, 1000, "This saber, made from lethicite-imbued metal, seems" +
				" to no longer seek flesh; whatever demonic properties in this weapon is gone now but it's still an effective weapon.").addTags(WeaponTags.SWORD1H);
		public const BLUNDER:Blunderbuss = new Blunderbuss();
		public const CDAGGER:CursedDagger = new CursedDagger();
		public const CLAYMOR:Weapon = new LargeClaymore();
		public const CTSWRD:Weapon = new Weapon("CheatSword", "CheatSword", "CheatSword", "a sword for cheaters", "cheat", 9999999, 0, "This sword was made by" +
				" a modder that just wanted to kill things really fast so he could see if things were working. Most of the times, they are not.",[WeaponTags.SWORD1H,WeaponTags.RANGED], 0,null,0,99);
		public const CROSSBW:Weapon = new Weapon("Crossbw", "Crossbow", "crossbow", "a crossbow", "shot", 11, 200, "This weapon fires bolts at your enemies.").addTags(WeaponTags.CROSSBOW);
		public const DAGGER :Weapon = new Weapon("Dagger ","Dagger","dagger","a dagger","stab",4,40,"A small" +
				" blade. Preferred weapon for the rogues.",[WeaponTags.CUNNING,WeaponTags.KNIFE]);
		public const DULLSC:Weapon = new Weapon("Dullsc","DullahanScythe","dullahan scythe","a dullahan's scythe","slash",25,2500,"A gift from the Dullahan, this scythe boasts tremendous killing" +
				" potential, at a cost.", [WeaponTags.LARGE,WeaponTags.SCYTHE],1,[Weapon.WEAPONEFFECTS.dullahanDrain]);
		public const E_STAFF:EldritchStaff = new EldritchStaff();
		public const FINALARG:Weapon = new Weapon("Final Argument","Final Argument","Final Argument","Anne's rifle","shot",30,2000,"Anne Marie's favored weapon. This single fire, breech loaded rifle is massive, and boasts improvements in gunsmithing that won't be seen in Mareth in decades. It is deadly accurate, and a single shot is more than enough to kill anything that moves.",[WeaponTags.FIREARM],0.5,[Weapon.WEAPONEFFECTS.strongRecoil],1,15);
		public const FLAIL :Weapon = new Weapon("Flail  ","Flail","flail","a flail","smash",10,200,"This is a flail, a weapon consisting of a metal spiked" +
				" ball attached to a stick by chain. Be careful with this as you might end up injuring yourself.",[WeaponTags.BLUNT1H]);
		public const FLINTLK:Weapon = new Weapon("Flintlk","Flintlock","flintlock pistol","a flintlock pistol","shot",14,250,"A flintlock pistol. Pew pew pew. Speed has a factor in damage.", [WeaponTags.FIREARM],0.7,null,4,10);
		public const FLMHRTSPEAR:FlameheartSpear = new FlameheartSpear();
		public const G_KNUCKLE:GeodeKnuckle = new GeodeKnuckle();
		public const URTAHLB:Weapon = new Weapon("UrtaHlb","UrtaHlb","halberd","a halberd","slash",11,10,"Urta's halberd. How did you manage to get this?",[WeaponTags.POLEARM,WeaponTags.LARGE],1,null,0,25);
		public const H_GAUNT:Weapon = new Weapon("H.Gaunt", "H.Gaunt", "hooked gauntlets", "a set of hooked gauntlets", "clawing punch", 8, 300, "These" +
				" metal gauntlets are covered in nasty looking hooks that are sure to tear at your foes flesh and cause them harm.",[WeaponTags.FIST],1,[Weapon.WEAPONEFFECTS.stun,Weapon.WEAPONEFFECTS.bleed]);
		public const HNTCANE:HuntsmansCane = new HuntsmansCane();
		public const JRAPIER:JeweledRapier = new JeweledRapier();
		public const KATANA :Weapon = new Weapon("Katana ","Katana","katana","a katana","keen cut",10,500,"A curved bladed weapon that cuts through flesh" +
				" with the greatest of ease.",[WeaponTags.SWORD1H]);
		public const KIHAAXE:Weapon = new Weapon("KihaAxe","Greataxe","fiery double-bladed axe","a fiery double-bladed axe","fiery cleave",20,1000,"This large, double-bladed axe matches Kiha's" +
				" axe. It's constantly flaming.", [WeaponTags.AXE,WeaponTags.LARGE]);
		public const L__AXE :Weapon = new Weapon("L. Axe ","L. Axe","large axe","an axe large enough for a minotaur","cleave",20,100,"This massive axe once belonged to a minotaur.  It'd be hard" +
				" for anyone smaller than a giant to wield effectively.  The axe is double-bladed and deadly-looking.  Requires height of 6'6\" or 90 strength.",[WeaponTags.AXE,WeaponTags.LARGE],1,null,0,-10);
		public const L_DAGGR:Weapon = new Weapon("L.Daggr","L.Daggr","lust-enchanted dagger","an aphrodisiac-coated dagger","stab",3,150,"A dagger with a" +
				" short blade in a wavy pattern.  Its edge seems to have been enchanted to always be covered in a light aphrodisiac to arouse anything cut" +
				" with it.",[WeaponTags.APHRODISIAC,WeaponTags.KNIFE],1,[Weapon.WEAPONEFFECTS.lustPoison]);
		public const L_HAMMR:LargeHammer = new LargeHammer();
		public const LRAVENG:Weapon = new Weapon("L.Avngr", "L.Avngr", "Light Rail Avenger", "The Light Rail Avenger", "slash", 0, 0, "This beautiful katana" +
				" was said to be crafted by the gods themselves, at the beginning of time. Their chosen warrior fell to the demon menace, but they have" +
				" found a new one to take up the Way of the Blade. Ordinary men cannot wield the true power of this blade.",[WeaponTags.SWORD1H], 10);
		public const L_STAFF:LethiciteStaff = new LethiciteStaff();
		public const L_WHIP :Weapon = new Weapon("L. Whip", "L. Whip", "flaming whip", "a flaming whip", "whip-crack", 16, 2000, "This whip once belonged to Lethice, who was defeated at your hands. It gives off flames when you crack it.",[WeaponTags.WHIP],1,[curry(Weapon.WEAPONEFFECTS.corruptedTease,100,25,10)]);
		public const MACE   :Weapon = new Weapon("Mace   ", "Mace", "mace", "a mace", "smash", 9, 100, "This is a mace, designed to be able to crush against various defenses.",[WeaponTags.BLUNT1H],0.6);
		public const MRAPIER:MidnightRapier = new MidnightRapier();
		public const NEPHSCEPT:NephilaScepter = new NephilaScepter();
		public const PIPE   :Weapon = new Weapon("Pipe   ","Pipe","pipe","a pipe","smash",5,25,"This is a simple rusted pipe of unknown origins.  It's hefty" +
				" and could probably be used as an effective bludgeoning tool.",[WeaponTags.BLUNT1H]);
		public const PTCHFRK:Weapon = new Weapon("PtchFrk","Pitchfork","pitchfork","a pitchfork","stab",10,200,"This is a pitchfork.  Intended for farm work" +
				" but also useful as stabbing weapon.",[WeaponTags.SPEAR]);
		public const RIDINGC:Weapon = new Weapon("RidingC","RidingC","riding crop","a riding crop","whip-crack",5,50,"This riding crop appears to be made of" +
				" black leather, and could be quite a painful (or exciting) weapon.",[WeaponTags.BLUNT1H, WeaponTags.NOTBLUNT]);
		public const RRAPIER:RaphaelsRapier = new RaphaelsRapier();
		public const S_BLADE:Spellblade = new Spellblade();
		public const S_GAUNT:Weapon = new Weapon("S.Gaunt","S.Gauntlet","spiked gauntlet","a spiked gauntlet","spiked punch",5,400,"This single metal gauntlet has the knuckles tipped with metal spikes.  Though it lacks the damaging potential of other weapons, the sheer pain of its wounds has a chance of stunning your opponent.",[WeaponTags.FIST],1,[Weapon.WEAPONEFFECTS.bleed]);
		public const SCARBLD:Weapon = new ScarredBlade();
		public const SCIMITR:Weapon = new Weapon("Scimitr", "Scimitar", "scimitar", "a scimitar", "slash", 15, 500, "This curved sword is made for slashing." +
				"  No doubt it'll easily cut through flesh.",[WeaponTags.SWORD1H]);
		public const SPEAR  :Weapon = new Weapon("Spear  ","Spear","deadly spear","a deadly spear","piercing stab",8,450,"A staff with a sharp blade at the" +
				" tip designed to pierce through the toughest armor.  This would penetrate most armors.",[WeaponTags.SPEAR],0.6);
		public const SUCWHIP:Weapon = new Weapon("SucWhip","SucWhip","succubi whip","a succubi whip","sexy whipping",10,400,"This coiled length of" +
				" midnight-black leather practically exudes lust.  Though it looks like it could do a lot of damage, the feel of that slick leather impacting flesh is sure to inspire lust.  However, it might slowly warp the mind of wielder.",[WeaponTags.WHIP],1,[Weapon.WEAPONEFFECTS.corruptedTease]);
		public const W_STAFF:WizardsStaff = new WizardsStaff();
		public const WARHAMR:HugeWarhammer = new HugeWarhammer();
		public const WHIP   :Weapon = new Weapon("Whip   ","Whip","coiled whip","a coiled whip","whip-crack",5,500,"A coiled length of leather designed to" +
				" lash your foes into submission.  There's a chance the bondage inclined might enjoy it!",[WeaponTags.WHIP],1,[curry(Weapon.WEAPONEFFECTS.lustPoison,5,12,"coiled")]);
		public const U_SWORD:Weapon = new UglySword();

		/*
		private static function mk(id:String,shortName:String,name:String,longName:String,verb:String,attack:Number,value:Number,description:String,perk:String=""):Weapon {
			return new Weapon(id,shortName,name,longName,verb,attack,value,description,perk);
		}
		*/
        public static var BOOSTED_WEAPONS:Dictionary = new Dictionary();
		public function WeaponLib()
		{
			CROSSBW.setArmorPenetration(0.7);
			DAGGER.boostsCritChance(15).boostsCritDamage(0.7,true);
			//upgradeLib();

		}

        private function upgradeLib():void {
            var btnData:Array = new Array();
            var libClass:Class = Class(getDefinitionByName(getQualifiedClassName(this)));
            var xmlList:XMLList = describeType(libClass).factory.constant;
            for each (var item:XML in xmlList){
                var itype:* = this[item.@name];
                if(itype is Weapon){
                    var randWeapon:* = Utils.clone(itype);
                    randWeapon.id = itype.id + "extra";
                    randWeapon.description = itype._description + "\n\nThis weapon has been boosted yo";
					randWeapon.bonusStats = new BonusDerivedStats();
                    randWeapon.boostsWeaponDamage(6);
					BOOSTED_WEAPONS[randWeapon.id] = randWeapon;
                }
            }
        }
	}
}

license: unknown


code:
/**
 * Created by aimozg on 09.01.14.
 */
package classes.Items
{
	import classes.BaseContent;
	import classes.ItemType;
	import classes.Player;
	import classes.PerkLib;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.internals.Utils;
	import classes.*;

	public class WeaponTags extends BaseContent//Equipable
	{
		public function WeaponTags()
		{
		}
		public static const LARGE:String = "Large";
		public static const DUAL:String = "Dual Wield";
		public static const CUNNING:String = "Cunning";
		public static const APHRODISIAC:String = "Aphrodisiac Weapon";
		public static const HOLYSWORD:String = "holySword";
		public static const UGLYSWORD:String = "uglySword";
		public static const MAGIC:String = "Magic";
		public static const ATTACHED:String = "Attached"; //For weapons that can't be disarmed/removed, such as fists

		//Override tags - normally unneeded because the properties are determined by weapon type, but these tags can be used to force a specific property, or lack thereof. If you want a weapon to use the sword mastery but not be counted as bladed, for example
		public static const SHARP:String = "Sharp";
		public static const BLADED:String = "Bladed";
		public static const BLUNT:String = "Blunt";
		public static const RANGED:String = "Ranged";
		public static const NOTSHARP:String = "NotSharp";
		public static const NOTBLADED:String = "NotBladed";
		public static const NOTBLUNT:String = "NotBlunt";

		//Weapon type tags - used to determine mastery
		public static const FIST:String = "Fist";
		public static const FIREARM:String = "Firearm";
		public static const BOW:String = "Bow";
		public static const CROSSBOW:String = "Crossbow";
		public static const SWORD1H:String = "1H Sword";
		public static const SWORD2H:String = "2H Sword";
		public static const KNIFE:String = "Knife";
		public static const BLUNT1H:String = "1H Blunt";
		public static const BLUNT2H:String = "2H Blunt";
		public static const SPEAR:String = "Spear";
		public static const AXE:String = "Axe";
		public static const STAFF:String = "Staff";
		public static const POLEARM:String = "Polearm";
		public static const SCYTHE:String = "Scythe";
		public static const WHIP:String = "Whip";
	}

}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.CoC_Settings;
	import classes.Creature;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
	import classes.Player;
	import classes.GlobalFlags.kFLAGS;

	public class BeautifulSword extends Weapon {
		public function BeautifulSword() {
			super("B.Sword", "B.Sword", "beautiful sword", "a beautiful sword", "slash", 7, 400, "This sword, although rusted, is exquisitely beautiful." +
					" That it can cut anything at all in this state shows the flawless craftsmanship of its blade.  The pommel and guard are heavily decorated in gold and brass.  Some craftsman" +
					" clearly poured his heart and soul into this blade.", [WeaponTags.HOLYSWORD,WeaponTags.SWORD1H]);
		}

		override public function get attack():Number {
			var temp:int = 7 + flags[kFLAGS.BEAUTIFUL_SWORD_LEVEL] * 2;
			if (flags[kFLAGS.CORRUPTED_GLADES_DESTROYED] >= 50) temp += 2;
			if (flags[kFLAGS.CORRUPTED_GLADES_DESTROYED] >= 100) temp += 2;
			return temp;
		}

		override public function get description():String {
			if (flags[kFLAGS.BEAUTIFUL_SWORD_LEVEL] >= 2 && flags[kFLAGS.BEAUTIFUL_SWORD_LEVEL] < 4){
				_description = "This beautiful sword lost some of its rust, and found some of its holy power. It shines weakly in sunlight.  The pommel and guard are heavily decorated in gold and brass. Some craftsman clearly poured his heart and soul into this blade.\n";
			}
			else if (flags[kFLAGS.BEAUTIFUL_SWORD_LEVEL] >= 4 && flags[kFLAGS.BEAUTIFUL_SWORD_LEVEL] < 6){
				_description = "This beautiful sword looks pristine, having regained much of its former power. It shines brightly in sunlight, and merely holding it fills you with hope. The pommel and guard are heavily decorated in gold and brass.  Some craftsman clearly poured his heart and soul into this blade.\n";
			}
			else if (flags[kFLAGS.BEAUTIFUL_SWORD_LEVEL] >= 6){
				_description = "This beautiful sword glows brightly with life, a shining beacon of hope and purity for the people of Mareth. Holding it fills you with purpose, and focuses you on your goal. The pommel and guard are heavily decorated in gold and brass.  Some craftsman clearly poured his heart and soul into this blade.\n";
			}
			else _description = "This sword, although rusted, is exquisitely beautiful. That it can cut anything at all in this state shows the flawless craftsmanship of its blade.  The pommel and guard are heavily decorated in gold and brass.  Some craftsman clearly poured his heart and soul into this blade.\n";
			var desc:String = super.description;
			desc += "\nSpecial: Damage grows as unique corrupted foes are slain<b>(" + (attack - 7) + ")</b>";
			return desc;
		}

		override public function canUse():Boolean {
			if (player.isPureEnough(35)) return true;
			game.beautifulSwordScene.rebellingBeautifulSword(true);
			return false;
		}
	}
}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
	import classes.Player;

	public class Blunderbuss extends WeaponWithPerk {

		public function Blunderbuss() {
			super("Blunder", "Blunderbuss", "blunderbuss", "a blunderbuss", "shot", 22, 600, " A firearm designed by an expert, unknown craftsman. Its flared muzzle allows for a wide spread of" +
					" projectiles that is difficult to dodge.", [WeaponTags.FIREARM], PerkLib.Scattering, 0.25, 0, 0, 0); //Tags like "ranged" are auto-calculated now, no need to specify them unless an item doesn't match the expectations for its type (like a ranged sword or non-ranged firearm)
			this.ammoMax = 1;
		}

	}
}


code:
package classes.Items.Weapons
{
	import classes.Items.Weapon;

	public class BrokenBeautifulSword extends Weapon
	{

		public function BrokenBeautifulSword()
		{
			this.weightCategory = Weapon.WEIGHT_LIGHT;
			this.tier = 0;
			super("B.BSwrd", "B.B Sword", "broken beautiful sword", "a broken beautiful sword", "slash", 10, 500, "This sword was once a prime example of craftsmanship, now broken and no longer shining. The still-intact pommel and guard are heavily decorated in gold and brass. Some craftsman clearly poured his heart and soul into this blade. There might still be hope for this sword.");
		}

	}

}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.Player;
	import classes.PerkType;
	import classes.PerkLib;

	public class CursedDagger extends Weapon {

        public function CursedDagger() {
            super("Cursed Dagger ","Cursed Dagger","cursed dagger","a cursed dagger","stab",10,2500,"A thin, curved" +
                    " dark blade, rather long for a dagger. It is one solid piece of metal, with small intricate runic carvings along the flat of the blade and others on the hilt to make it easier" +
                    " to grip. It is unusually cold to the touch. ",[WeaponTags.CUNNING,WeaponTags.KNIFE],1);
            boostsCritDamage(1.2,true);
			boostsCritChance(25);
			boostsMaxHealth(0.8,true);
        }

		override public function useText():void {
			outputText("You wield the dagger, and immediately feel ill and weak. The worst of it vanishes after a while, but you're certain that while wielding this, your <b>health will be reduced!</b>");

		}

		override public function removeText():void {
			outputText("You feel your constitution return as you stop wielding the dagger.");
		}
	}
}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
	import classes.Player;
import classes.Scenes.Combat.CombatAttackData;

public class EldritchStaff extends Weapon {

		public function EldritchStaff() {
			this.weightCategory = Weapon.WEIGHT_MEDIUM;
			super("E.Staff", "E.Staff", "eldritch staff", "an eldritch staff", "thwack", 10, 1000, "This eldritch staff once belonged to the Harpy Queen, who was killed after her defeat at your hands.  It fairly sizzles with magical power.", [WeaponTags.MAGIC,WeaponTags.STAFF]);
			boostsSpellMod(60);
		}

		override public function get verb():String {
			return player.findPerk(PerkLib.StaffChanneling) >= 0 ? "shot" : "thwack";
		}

		override public function get armorMod():Number{
			return player.findPerk(PerkLib.StaffChanneling) >= 0 ? 0.3 : 1;
		}
	}
}


code:
/**
 * Created by aimozg on 09.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.WeaponTags;
	import classes.ItemType;
	import classes.Items.Weapon;
	import classes.Player;

	public class Fists extends Weapon {

		public function Fists() {
			this.weightCategory = Weapon.WEIGHT_LIGHT;
			super("Fists  ", "Fists", "fists", "your fists", "punch", 0, 0, null, [WeaponTags.FIST, WeaponTags.ATTACHED]);
		}

		override public function useText():void {} //No text for equipping fists

		override public function playerRemove():Weapon {
			return null;
		}

	}
}


code:
package classes.Items.Weapons
{
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;

public class FlameheartSpear extends Weapon {

		public function FlameheartSpear() {
			super("FlmHrtSpear", "FlmHrtSpear", "flameheart spear", "a flameheart spear", "piercing stab", 15, 1250, "This exquisite, gold and black spear" +
					" occasionally pulses with thin sprites of orange and red. This weapon deals more damage the closer you are to death.\n<i>Inquisitors" +
					" fought a hopeless war, and were taught that valor and courage shines brightest against a backdrop of despair.</i> ",[WeaponTags.SPEAR],0.3);
		}

		override public function get attack():Number {
			var boost:int = Math.round(30 * (1 - (player.HP / player.maxHP())));
			return (12 + boost);
		}

	}
}


code:
package classes.Items.Weapons
{
	import classes.MasteryLib;
	import classes.PerkLib;
	import classes.Items.Weapon;
	import classes.Items.WeaponTags;
	import classes.Player;
	import classes.StatusEffects;
	import classes.BonusDerivedStats;

	public class GeodeKnuckle extends Weapon {
		public function GeodeKnuckle() {
			super("Geode Knuckle", "GeodeKnuckle", "Geode Knuckle", "a crystalline fist", "punch", 15, 0, "Your fists are coated in a thick but somehow flexible layer of stone and crystal, with jagged shards of colorful gemstones jutting out of the knuckles.", [WeaponTags.FIST, WeaponTags.ATTACHED]);
		}

		override public function get attack():Number {
			var atk:int = 5 * player.masteryLevel(MasteryLib.TerrestrialFire);
			atk += player.str * 0.3;
			return atk;
		}

		override public function modifiedAttack():Number {
			var attackMod:Number = attack;
			//Apply unarmed perks at max mastery
			if (player.masteryLevel(MasteryLib.TerrestrialFire) >= 5) {
				if (player.hasPerk(PerkLib.IronFists) && player.str >= 50) attackMod += 5;
				if (player.hasPerk(PerkLib.IronFists2) && player.str >= 65) attackMod += 3;
				if (player.hasPerk(PerkLib.IronFists3) && player.str >= 80) attackMod += 3;
			}
			attackMod += player.getBonusStat(BonusDerivedStats.weaponDamage);
			attackMod *= player.getBonusStatMultiplicative(BonusDerivedStats.weaponDamage);
			return attackMod;
		}

		override public function get armorMod():Number {
			return 1 - 0.05 * (player.masteryLevel(MasteryLib.TerrestrialFire) - 3);
		}

		override public function get effects():Array {
			var chance:int = 5 * (player.masteryLevel(MasteryLib.TerrestrialFire) - 3);
			var drain:int = 15 - 5 * (player.masteryLevel(MasteryLib.TerrestrialFire) - 3);
			if (player.hasStatusEffect(StatusEffects.TFGeodeKnuckle)) drain = 0;
			return [curry(Weapon.WEAPONEFFECTS.stunAndBleed,chance,chance), curry(Weapon.WEAPONEFFECTS.summonedDrain,drain)];
		}

		override public function get accBonus():Number {
			return player.masteryLevel(MasteryLib.TerrestrialFire) >= 5 ? 5 : 0;
		}

		override public function useText():void {} //No text when equipping since it should only be equipped by the spell

		override public function playerRemove():Weapon { return null; } //Disappears when unequipped
	}
}


code:
package classes.Items.Weapons
{
	import classes.Items.Weapon;

	public class Halberd extends Weapon
	{

		public function Halberd(tier:int, degrades:Boolean = false)
		{
			var ids:Array = ["Halberd", "Halbrd1", "Halbrd2", degrades ? "HalbrdO" : "Halbrd3"];
			var eqptNames:Array = ["halberd", "fine halberd", "masterwork halberd", degrades ? "obsidian-bladed halberd" : "epic halberd"];
			var longNames:Array = ["a halberd", "a fine halberd", "a masterwork halberd", degrades ? "an obsidian-bladed halberd" : "an epic halberd"];
			this.weightCategory = Weapon.WEIGHT_HEAVY;
			this.tier = tier;
			super(ids[tier], "Halberd", eqptNames[tier], longNames[tier], "slash", 11, 750, "Resembling a spear with a blade at the end, it's a long-reach melee weapon that can hit from a reasonable distance.", [WeaponTags.POLEARM, WeaponTags.LARGE]);
		}

	}

}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.Player;
	import classes.Items.WeaponEffects;

	public class HugeWarhammer extends Weapon {

		public function HugeWarhammer() {
			super("Warhamr", "Warhammer", "huge warhammer", "a huge warhammer", "smash", 15, 1600, "A huge war-hammer made almost entirely of steel that only the strongest warriors could use." +
					"  Requires 80 strength to use.  Getting hit with this might stun the victim.", [WeaponTags.BLUNT2H],0.7,[Weapon.WEAPONEFFECTS.stun]);
		}

		override public function canUse():Boolean {
			if (player.str >= 80) return true;
			outputText("You aren't strong enough to handle such a heavy weapon!  ");
			return false;
		}

	}
}


code:
package classes.Items.Weapons
{
	import classes.Items.Weapon;
	import classes.Items.WeaponLib;
import classes.Items.WeaponTags;
import classes.PerkLib;
	import classes.Player;

	public class HuntsmansCane extends Weapon
	{

		public function HuntsmansCane() {
			//this.weightCategory = Weapon.WEIGHT_LIGHT;
			//this.tier = 0;
			super("H. Cane", "H. Cane", "huntsman's cane", "a cane that once belonged to Erlking", "thwack", 0, 400, "This ebony black cane is made of polished wood and topped with a golden cap in" +
					" the shape of a deer's head. This lightweight staff once belonged to the Erlking, but seems too light and delicate to be an effective weapon. You could but you might risk" +
					" breaking this.");
            addTags(WeaponTags.STAFF);
			boostsLustResistance(1.33,true);
		}

		override public function get shortName():String {
			return "H. Cane";
		}

		override public function useText():void {
			outputText("You equip the lightweight cane, wondering about the effectiveness of such a small stick. With the cane in your hand, though, you feel intensely focused, and you doubt anything could distract you from your goals. ");
		}

	}

}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;

public class JeweledRapier extends Weapon {

		public function JeweledRapier() {
			super("JRapier", "JRapier", "jeweled rapier", "a jeweled rapier", "slash", 13, 1400, "This jeweled rapier is ancient but untarnished.  The hilt" +
					" is wonderfully made, and fits your hand like a tailored glove.  The blade is shiny and perfectly designed for stabbing.",[WeaponTags.SWORD1H],0.7);
		}

		override public function get attack():Number {
			var boost:int = 0;
			if (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] < 2) boost += flags[kFLAGS.RAPHAEL_RAPIER_TRANING] * 2;
			else boost += 4 + (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] - 2);
			return (13 + boost);
		}
	}
}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.Player;

	public class LargeClaymore extends Weapon {

		public function LargeClaymore() {
			super("Claymor", "L.Claymore", "large claymore", "a large claymore", "cleaving sword-slash", 15, 1000, "A massive sword that a very strong warrior might use.  Requires 40 strength to" +
					" use.", [WeaponTags.SWORD2H]);
		}

		override public function canUse():Boolean {
			if (player.str >= 40) return true;
			outputText("You aren't strong enough to handle such a heavy weapon!  ");
			return false;
		}

	}
}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.CoC_Settings;
	import classes.Creature;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.Player;

	public class LargeHammer extends Weapon
	{
		public function LargeHammer() {
			super("L.Hammr", "L.Hammr", "large hammer", "Marble's large hammer", "smash", 16, 90, "This two-handed warhammer looks pretty devastating.  You took it from Marble after she refused" +
					" your advances.", [WeaponTags.BLUNT2H]);
		}

		override public function canUse():Boolean {
			if (player.tallness >= 60) return true;
			outputText("This hammer is too large for you to wield effectively. ");
			return false;
		}

	}
}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
import classes.Player;
import classes.Scenes.Combat.CombatAttackData;

public class LethiciteStaff extends Weapon {

    public function LethiciteStaff() {
        this.weightCategory = Weapon.WEIGHT_MEDIUM;
        super("L.Staff", "Lthc. Staff", "lethicite staff", "a lethicite staff", "smack", 14, 1337, "This staff is made of a dark material and seems to tingle to the touch. The top consists of a glowing lethicite orb. Somehow you know this will greatly empower your spellcasting abilities.", [WeaponTags.MAGIC,WeaponTags.STAFF]);
		boostsSpellMod(80);
    }

    override public function get verb():String {
        return player.findPerk(PerkLib.StaffChanneling) >= 0 ? "shot" : "smack";
    }

    override public function get armorMod():Number{
        return player.findPerk(PerkLib.StaffChanneling) >= 0 ? 0 : 1;
    }

}
}


code:
package classes.Items.Weapons
{
	import classes.Items.Weapon;

	public class LustDagger extends Weapon
	{
		public function LustDagger(tier:int)
		{
			var ids:Array = ["L.Daggr", "L.Dagr1", "L.Dagr2"];
			var eqptNames:Array = ["lust-enchanted dagger", "fine lust-enchanted dagger", "masterwork lust-enchanted dagger"];
			var longNames:Array = ["an aphrodisiac-coated dagger", "a fine aphrodisiac-coated dagger", "a masterwork aphrodisiac-coated dagger"];
			this.weightCategory = Weapon.WEIGHT_LIGHT;
			this.tier = tier;
			super(ids[tier], "L.Dagger", eqptNames[tier], longNames[tier], "stab", 3, 40, "A dagger with a short blade in a wavy pattern.  Its edge seems to have been enchanted to always be covered in a light aphrodisiac to arouse anything cut with it.", [WeaponTags.KNIFE, WeaponTags.APHRODISIAC]);
		}

	}

}


code:
package classes.Items.Weapons
{
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;

public class MidnightRapier extends Weapon {

		public function MidnightRapier() {
			super("MRapier", "MRapier", "midnight rapier", "a midnight rapier", "slash", 15, 1250, "This rapier is forged from a metal that is as dark as a" +
					" starless night. Its blade shows some signs of use, but its power is no less tremendous.", [WeaponTags.UGLYSWORD,WeaponTags.SWORD1H],0.7);
		}

		override public function get attack():Number {
			var boost:int = 0;
			if (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] < 2) boost += (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] * 2);
			else boost += 4 + (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] - 2);
			return (15 + boost);
		}

		override public function canUse():Boolean {
			if (player.isCorruptEnough(90)) return true;
			outputText("You grab hold of the handle of the rapier only to have it grow burning hot. You're forced to let it go lest you burn yourself. Something within the rapier must be disgusted. ");
			return false;
		}
	}
}


code:
/**
 * Created by A Non on 09.05.18.
 */
package classes.Items.Weapons
{
import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
import classes.Player;
import classes.Scenes.Combat.CombatAttackData;
import classes.*;

//Idea for making scepter unique: Give ability to convert fatigue into lust as an added combat thing. Conversion rate directly equivalent to parasite nephila level. Maybe drive up enemy lust like a tease (modded by infestation level?). Would help caster focused playthroughs of Nephila when the player can't bloodmage (because of armor). Scene idea (for in-combat use of ability): Player rolls on belly, then womb tentacles snake out of their vagina and take the scepter out of their hands. Tentacles ream them with the staff, drawing out tiredness but causing the belly in the scepter to glow with soft red light that fills them with lust even as they get off.
public class NephilaScepter extends Weapon {

		public function NephilaScepter() {
			this.weightCategory = Weapon.WEIGHT_HEAVY;
			super("N.Scepter", "N. Scepter", "nephila scepter", "the nephila scepter", "whallop", 8, 800, "A gilt wooden scepter. It's the length of a magus's staff, but much girthier, and carved" +
					" with reliefs of pregnant women in coitus with members of many different races. A carved sculpture of a hypermassively pregnant goddess crowns the scepter's top, her belly" +
					" represented by a single, fist sized ruby. Her legs are spread wide, and the other figures on the scepter are depicted swirling either into or out from her swollen puss. The" +
					" faces of the lovers reflect through the goddess's gemstone belly, their looks of ecstacy transformed to looks of torture within it. As you heft it, the scepter fills you with" +
					" power and a distinctly magical feeling of cold purpose",[WeaponTags.MAGIC,WeaponTags.STAFF,WeaponTags.BLUNT]);
			boostsSpellMod(getSpellBonus);

		}

		public function getSpellBonus():Number{
            // If player is hungering, spell bonus increases proportional to infestation level.
			return 45 + int(player.statusEffectv1(StatusEffects.ParasiteNephila) * 2);
		}

		override public function get verb():String {
				return player.findPerk(PerkLib.StaffChanneling) >= 0 ? "shot" : "smack";
		}

		override public function get armorMod():Number{
			return player.findPerk(PerkLib.StaffChanneling) >= 0 ? 0.5 : 1;
		}
	}
}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;

public class RaphaelsRapier extends Weapon {

		public function RaphaelsRapier() {
			super("RRapier", "RRapier", "vulpine rapier", "Raphael's vulpine rapier", "slash", 8, 1000, "He's bound it with his red sash around the length like a ribbon, as though he has now" +
					" gifted it to you.  Perhaps it is his way of congratulating you.",[WeaponTags.SWORD1H],0.7);
		}

		override public function get attack():Number {
			var boost:int = 0;
			if (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] < 2) boost += flags[kFLAGS.RAPHAEL_RAPIER_TRANING] * 2;
			else boost += 4 + (flags[kFLAGS.RAPHAEL_RAPIER_TRANING] - 2);
			return (8 + boost);
		}
	}
}


code:
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
	import classes.Player;
	import classes.GlobalFlags.*;

	public class ScarredBlade extends Weapon
	{

		public function ScarredBlade()
		{
			this.weightCategory = Weapon.WEIGHT_MEDIUM;
			super("ScarBld", "ScarBlade", "scarred blade", "a scarred blade", "slash", 10, 1000, "This saber, made from lethicite-imbued metal, eagerly" +
					" seeks flesh; it resonates with disdain and delivers deep, jagged wounds as it tries to bury itself in the bodies of others. It only" +
					" cooperates with the corrupt.",[WeaponTags.SWORD1H]);
		}

		override public function get attack():Number {
			var temp:int = 10 + int((player.corAdjustedUp() - 70) / 3)
			if (temp < 10) temp = 10;
			return temp;
		}

		override public function canUse():Boolean {
			if (player.isCorruptEnough(70)) return true;
			game.sheilaScene.rebellingScarredBlade(true);
			return false;
		}

	}

}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
	import classes.Player;

	public class Spellblade extends WeaponWithPerk {

		public function Spellblade() {
			super("S.Blade", "S.Blade", "inscribed spellblade", "a spellblade", "slash", 8, 500, "Forged not by a swordsmith but a sorceress, this" +
					" arcane-infused blade amplifies any effects applied to it.  Unlike the wizard staves it is based on, this weapon also has a sharp edge," +
					" a technological innovation which has proven historically useful in battle.", ["Arcane Smithing",WeaponTags.SWORD1H], PerkLib.ArcaneSmithing, 1.5, 0, 0, 0);
		}

	}
}


code:
package classes.Items.Weapons
{
	import classes.CoC_Settings;
	import classes.Creature;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.Player;

	public class UglySword extends Weapon {

		public function UglySword() {
			this.weightCategory = Weapon.WEIGHT_MEDIUM;
			super("U.Sword", "U.Sword", "ugly sword", "an ugly sword", "slash", 7, 400, "This ugly sword is jagged and chipped, yet somehow perfectly" +
					" balanced and unnaturally sharp. Its blade is black, and its material is of dubious origin.", [WeaponTags.UGLYSWORD,WeaponTags.SWORD1H]);
		}

		override public function get attack():Number {
			var temp:int = 7 + int((player.corAdjustedUp() - 70) / 3)
			if (temp < 5) temp = 5;
			return temp;
		}

		override public function canUse():Boolean {
			if (player.isCorruptEnough(70)) return true;
			outputText("You grab hold of the handle of the sword only to have it grow burning hot. You're forced to let it go lest you burn yourself. Something within the sword must be disgusted. ");
			return false;
		}
	}
}


code:
package classes.Items.Weapons
{
	import classes.Items.Weapon;
	import classes.Perk;
	import classes.PerkType;
	import classes.PerkLib;
	import classes.Player;

	public class WeaponWithPerk extends Weapon {
		private var playerPerk:PerkType;
		private var playerPerkV1:Number;
		private var playerPerkV2:Number;
		private var playerPerkV3:Number;
		private var playerPerkV4:Number;
		private var storedPerk:Perk;

		public function WeaponWithPerk(id:String, shortName:String, name:String, longName:String, verb:String, attack:Number, value:Number, description:String, perk:Array, playerPerk:PerkType, playerPerkV1:Number, playerPerkV2:Number, playerPerkV3:Number, playerPerkV4:Number, playerPerkDesc:String = "")
		{
			super(id, shortName, name, longName, verb, attack, value, description, perk);
			this.playerPerk = playerPerk;
			this.playerPerkV1 = playerPerkV1;
			this.playerPerkV2 = playerPerkV2;
			this.playerPerkV3 = playerPerkV3;
			this.playerPerkV4 = playerPerkV4;
			this.storedPerk = new Perk(playerPerk,playerPerkV1,playerPerkV2,playerPerkV3,playerPerkV4);
		}

		override public function playerEquip():Weapon { //This item is being equipped by the player. Add any perks, etc.
			while (player.findPerk(playerPerk) >= 0) player.removePerk(playerPerk);
			player.createPerk(playerPerk, playerPerkV1, playerPerkV2, playerPerkV3, playerPerkV4);
			return super.playerEquip();
		}

		override public function playerRemove():Weapon { //This item is being removed by the player. Remove any perks, etc.
			while (player.findPerk(playerPerk) >= 0) player.removePerk(playerPerk);
			return super.playerRemove();
		}

		override public function get description():String {
			var desc:String = super.description;
			desc += "\nSpecial: " + playerPerk.name + " - " + storedPerk.perkDesc;
			return desc;
		}

	}

}


code:
/**
 * Created by aimozg on 10.01.14.
 */
package classes.Items.Weapons
{
	import classes.Items.Weapon;
import classes.Items.WeaponTags;
import classes.PerkLib;
	import classes.Player;
import classes.Scenes.Combat.CombatAttackData;

public class WizardsStaff extends Weapon {

		public function WizardsStaff() {
			this.weightCategory = Weapon.WEIGHT_MEDIUM;
			super("W.Staff", "W. Staff", "wizard's staff", "a wizard's staff", "smack", 3, 350, "This staff is made of very old wood and seems to tingle to the touch.  The top has an odd zig-zag" +
					" shape to it, and the wood is worn smooth from lots of use.  It probably belonged to a wizard at some point and would aid magic use.",[WeaponTags.MAGIC,WeaponTags.STAFF]);
			boostsSpellMod(40);
		}

		override public function get verb():String {
				return player.findPerk(PerkLib.StaffChanneling) >= 0 ? "shot" : "smack";
		}

		override public function get armorMod():Number{
			return player.findPerk(PerkLib.StaffChanneling) >= 0 ? 0.5 : 1;
		}
	}
}


code:
package classes
{
	public class KeyItem extends Object
	{
		//constructor
		public function KeyItem()
		{
		}

		//data
		public var keyName:String = "";
		//v1-v4 for storing extra stuff.
		public var value1:Number = 0;
		public var value2:Number = 0;
		public var value3:Number = 0;
		public var value4:Number = 0;
	}
}


code:
package classes
{
	import classes.GlobalFlags.*;
	import coc.view.*;
	import flash.display.*;
	import flash.text.*;
	import flash.system.fscommand;

	public class MainMenu extends BaseContent
	{
		public function MainMenu() {}

		private var _mainMenu:Block;

		//------------
		// MAIN MENU
		//------------
		//MainMenu - kicks player out to the main menu
		public function mainMenu():void {
			clearOutput();
			hideStats();
			hideMenus();
			menu();
			//Sets game state to 3, used for determining back functionality of save/load menu.
			game.gameStateDirectSet(3);
			mainView.hideMainText();
			mainView.minimapView.hide();
			//mainView.creditsBox.visible = false;
			if (_mainMenu == null) {
				configureMainMenu();
			}
			else {
				var button:CoCButton = _mainMenu.getElementByName("mainmenu_button_0") as CoCButton;
				if (button != null) {
					if (player.str <= 0) button.disable("Please start a new game or load an existing save file."); //Dirty checking, WHYYYYY?
					else button.enable("Get back to gameplay?");
				}
				updateMainMenuTextColours();
				_mainMenu.visible = true;
			}
		}

		private function configureMainMenu():void {
			//Set up the buttons array
			var mainMenuButtons:Array = new Array(
				["Continue", playerMenu, "Get back to gameplay?"],
				["New Game", game.charCreation.newGameFromScratch, "Start a new game."],
				["Data", game.saves.saveLoad, "Load or manage saved games."],
				["Options", game.gameSettings.enterSettings, "Configure game settings and enable cheats."],
				["Achievements", game.achievementList.achievementsScreen, "View all achievements you have earned so far."],
				["Instructions", howToPlay, "How to play."],
				["Credits", creditsScreen, "See a list of all the disgusting perverts who have contributed content for this game."],
				["Quit", curry(fscommand, "quit"), "Quit the game."]
			);
			//Now set up the main menu.
			var mainMenuContent:Block = new Block( {
				name: "MainMenu",
				x: 0,
				y: 0,
				height: MainView.SCREEN_H,
				width: MainView.SCREEN_W
			});
			var cocLogo:BitmapDataSprite = new BitmapDataSprite({
				bitmapClass: MainView.GameLogo,
				stretch: true,
				x: Math.floor(MainView.SCREEN_W / 2) - 300,
				y: 1,
				height: 400,
				width: 600
			});
			var disclaimerBackground:BitmapDataSprite = new BitmapDataSprite({
				bitmapClass: MainView.DisclaimerBG,
				// alpha    : 0.4,
				// fillColor: '#FFFFFF',
				stretch: true,
				x: Math.floor(MainView.SCREEN_W / 2) - 310,
				y: Math.floor(MainView.SCREEN_H / 2) + 80,
				height: 90,
				width: 620
			});
			var disclaimerIcon:BitmapDataSprite = new BitmapDataSprite( {
				bitmapClass: MainView.Warning,
				stretch: true,
				x: disclaimerBackground.x + 10,
				y: disclaimerBackground.y + 15,
				height: 60,
				width: 60
			});
			var miniCredit:TextField = new TextField();
			miniCredit.name = "miniCredit";
			miniCredit.multiline = true;
			miniCredit.wordWrap = true;
			miniCredit.height = 80;
			miniCredit.width = 1000;
			miniCredit.x = Math.floor(MainView.SCREEN_W / 2) - (miniCredit.width / 2);
			miniCredit.y = Math.floor(MainView.SCREEN_H / 2) + 10;
			miniCredit.defaultTextFormat = new TextFormat("Palatino Linotype, serif", 16, mainViewManager.isDarkText() ? 0xc0c0c0 : 0, null, null, null, null, null, "center", null, null, null, -2);
			miniCredit.htmlText = "\n";
			miniCredit.htmlText += "Coded by: OtherCoCAnon, Koraeli, Anonymous\n";
			miniCredit.htmlText += "Contributions by: Satan, Chronicler, Anonymous";
			var disclaimerInfo:TextField = new TextField();
			disclaimerInfo.name = "disclaimerInfo";
			disclaimerInfo.multiline = true;
			disclaimerInfo.wordWrap = true;
			disclaimerInfo.height = disclaimerBackground.height;
			disclaimerInfo.width = 540;
			disclaimerInfo.x = disclaimerBackground.x + 80;
			disclaimerInfo.y = disclaimerBackground.y + 0;
			disclaimerInfo.selectable = false;
			disclaimerInfo.defaultTextFormat = new TextFormat("Palatino Linotype, serif", 16, null, null, null, null, null, null, "left", null, null, null, -2);
			disclaimerInfo.htmlText = "This is an adult game meant to be played by adults.\n";
			disclaimerInfo.htmlText += "Please don't play this game if you're under the age of 18 and certainly don't play if strange and exotic fetishes disgust you.\n";
			disclaimerInfo.htmlText += "You have been warned!"
			var versionInfo:TextField = new TextField();
			versionInfo.name = "versionInfo";
			versionInfo.multiline = true;
			versionInfo.height = 80;
			versionInfo.width = 600;
			versionInfo.x = MainView.SCREEN_W - versionInfo.width;
			versionInfo.y = MainView.SCREEN_H - 80;
			versionInfo.selectable = false;
			versionInfo.defaultTextFormat = new TextFormat("Palatino Linotype, serif", 16, mainViewManager.isDarkText() ? 0xc0c0c0 : 0, true, null, null, null, null, "right");
			versionInfo.htmlText = "Original Game by Fenoxo\nGame Mod by /hgg/, with content from Revamp/UEE\n";
			versionInfo.htmlText += game.version + ", " + (CoC_Settings.debugBuild ? "Debug" : "Release") + " Build";
			for (var i:int = 0; i < mainMenuButtons.length; i++) {
				var button:CoCButton = new CoCButton();
				button.name = "mainmenu_button_" + i;
				button.bitmapClass = MainView.ButtonBackground0;
				button.x = Math.floor(MainView.SCREEN_W / 2) - 310 + ((i % 4) * 155);
				button.y = Math.floor(MainView.SCREEN_H / 2) + 175 + (Math.floor(i / 4) * 45);
				button.labelText = mainMenuButtons[i][0];
				button.callback = mainMenuButtons[i][1];
				button.hint(mainMenuButtons[i][2]);
				mainView.hookButton(button as Sprite);
				mainMenuContent.addElement(button);
				if (i == 0) button.disableIf(player.str <= 0, "Please start a new game or load an existing save file.");
			}
			mainMenuContent.addElement(cocLogo);
			mainMenuContent.addElement(disclaimerBackground);
			// disclaimerBackground.graphics.lineStyle(1, 0x000000);
			// disclaimerBackground.graphics.beginFill(0x000000, 0);
			// disclaimerBackground.graphics.drawRect(0, 0, disclaimerBackground.width, disclaimerBackground.height);
			// disclaimerBackground.graphics.endFill();
			mainMenuContent.addElement(disclaimerIcon);
			mainMenuContent.addElement(disclaimerInfo);
			mainMenuContent.addElement(miniCredit);
			mainMenuContent.addElement(versionInfo);
			_mainMenu = mainMenuContent;
			mainView.addElementAt(_mainMenu, 2);
		}
		private function updateMainMenuTextColours():void {
			var elements:Array = ["miniCredit", "versionInfo"];
			for (var i:int = 0; i < elements.length; i++) {
				var fmt:TextFormat = new TextFormat();
				fmt.color = mainViewManager.isDarkText() ? 0xc0c0c0 : 0;
				var tf:TextField = _mainMenu.getElementByName(elements[i]) as TextField;
				tf.setTextFormat(fmt);
			}

		}
		public function hideMainMenu():void {
			if (_mainMenu !== null)
				_mainMenu.visible = false;
			mainView.showMainText();
			mainView.setTextBackground(flags[kFLAGS.TEXT_BACKGROUND_STYLE]);
			//mainView.creditsBox.visible = true;
		}

		//------------
		// INSTRUCTIONS
		//------------
		public function howToPlay():void {
			hideMainMenu();
			clearOutput();
			displayHeader("Instructions");
			outputText("[b: How To Play:]\nClick buttons. It's pretty self-explanatory.[pg]");
			outputText("[b: Exploration:]\nFind new areas to explore by choosing [b: Explore] from the camp menu and then [b: Explore] again in the explore menu. Explore those areas. Before long you'll unlock [b: Places] that you can visit at any time from the camp menu.[pg]");
			outputText("[b: Combat:]\nCombat is usually won by raising an opponent's lust to 100 or taking their HP to 0. You usually lose if your enemy does the same to you. Loss isn't game over, but it can have consequences.[pg]");
			outputText("[b: Controls:]\nThe game features numerous hotkeys to make playing quicker and easier. You can view and edit them in the options menu.[pg]");
			outputText("[b: Save to file] - It's more reliable than saving to a slot, less chance of losing a save.");
			menu();
			addButton(14, "Back", mainMenu);
		}

		//------------
		// CREDITS
		//------------
		public function creditsScreen(page:int = 0):void {
			hideMainMenu();
			clearOutput();
			switch (page) {
				case 0:
					hggCreditsScreen();
					break;
				case 1:
					ueeCreditsScreen();
					break;
				case 2:
					vanillaCreditsScreen();
					break;
			}
			menu();
			addButton(0, "/hgg/", creditsScreen, 0).hint("The mod you're playing now.");
			addButton(1, "UEE", creditsScreen, 1).hint("The mod this mod was based on. Previously known as Revamp.");
			addButton(2, "Vanilla", creditsScreen, 2).hint("The original game.");
			button(page).disable();
			addButton(14, "Back", mainMenu);
		}

		public function hggCreditsScreen():void {
			displayHeader("/hgg/ Credits");
			outputText("[bu: Coded by]:\n");
			outputText("
[b: aimozg]
");
			outputText("
[b: CoCanon]!tfhJbjUNbg
");
			outputText("
[b: Koraeli]!KMFMbbzuJw
");
			outputText("
[b: Mothman]
");
			outputText("
[b: OtherCoCAnon]!FDziEStfd2
");
			outputText("
[b: Anonymous]
");
			outputText("\n");
			outputText("[bu: Content Created by]:\n");
			outputText("[b: Baphomet]\n");
			outputText("
Telly's Toys & Treats (original draft)
");
			outputText("\n");
			outputText("[b: Chronicler]\n");
			outputText("
The Chronicles
");
			outputText("
Credits Menu Rewrite
");
			outputText("
/hgg/ Main Menu Logo
");
			outputText("
Thread OP Template
");
			outputText("
Obtaining the Ornate Chest Rewrite
");
			outputText("\n");
			outputText("[b: Conifer]\n");
			outputText("
Amily Watersports
");
			outputText("
Gargoyle Watersports
");
			outputText("
Hellhound Watersports
");
			outputText("
Satyr Watersports
");
			outputText("\n");
			outputText("[b: hpreganon]\n");
			outputText("
Nephila Parasites
");
			outputText("\n");
			outputText("[b: IxFa]!WrbZPxQ0rw\n");
			outputText("
Loli Player Intro
");
			outputText("
Loli Player Imp Scene
");
			outputText("
Shota Player Goblin Scene
");
			outputText("\n");
			outputText("[b: Koraeli]!KMFMbbzuJw\n");
			outputText("
Age System
");
			outputText("
Child Ember
");
			outputText("
Child Gargoyle
");
			outputText("
Child Shouldra
");
			outputText("
Gargoyle Relationship Talk
");
			outputText("
Loli Mode
");
			outputText("
Mastery System
");
			outputText("
NoFur Mode
");
			outputText("\n");
			outputText("[b: Lesbianon]\n");
			outputText("
Arian Lesbian Scenes
");
			rawOutputText("\t\u25E6  Cunnilingus");
			rawOutputText("\n\t\u25E6  Headpat Scene");
			rawOutputText("\n\t\u25E6  Facesitting");
			rawOutputText("\n\t\u25E6  Lesbian Transformation");
			rawOutputText("\n\t\u25E6  Tailriding");
			rawOutputText("\n\t\u25E6  Virgin Facesitting");
			outputText("
Black Velvet Alraune Additions
");
			rawOutputText("\t\u25E6  Cunnilingus");
			rawOutputText("\n\t\u25E6  Rimming");
			rawOutputText("\n\t\u25E6  Vine Victory");
			outputText("
Consensually Tailing an Alice
");
			outputText("
Dullahan Rimming Player
");
			outputText("
Hellmouth Watersports
");
			outputText("
Helspawn Additions
");
			rawOutputText("\t\u25E6  Facesitting");
			rawOutputText("\n\t\u25E6  Footjob");
			rawOutputText("\n\t\u25E6  Kissing");
			rawOutputText("\n\t\u25E6  Yuri Lovemaking Variation");
			outputText("
Kiha Loving
");
			rawOutputText("\t\u25E6  Cuddly Fingering");
			rawOutputText("\n\t\u25E6  Tribbing");
			outputText("
Sanura Pawfuck
");
			outputText("
Valeria Wearing Intro
");
			outputText("\n");
			outputText("[b: MissBlackThorne]\n");
			outputText("
Naughty Nun Outfit
");
			outputText("\n");
			outputText("[b: Mothman]\n");
			outputText("
Akky Bear Gifting
");
			outputText("
Alice Womb Deepthroat
");
			outputText("
Faerie Honey Feeding
");
			outputText("
Malnourished Masturbation
");
			outputText("
Proofreading/Editing
");
			outputText("
Rebecc Snuff
");
			outputText("
Sylvia, the Moth-Girl
");
			outputText("
Tamani Faceriding Followup
");
			outputText("
Vapula Vaginal
");
			outputText("\n");
			outputText("[b: OtherCoCAnon]!FDziEStfd2\n");
			outputText("
Circe
");
			outputText("
Corrupt Witches
");
			outputText("
The Dullahan
");
			outputText("
Deepwoods Manor Dungeon
");
			outputText("
Eel Parasites
");
			outputText("
Goblin Sharpshooter
");
			outputText("
Loppe High Player Libido Scene
");
			outputText("
Slug Parasites
");
			outputText("
Tower of Deception Dungeon
");
			outputText("
Volcanic Crag Golem
");
			outputText("\n");
			outputText("[b: Satan]!CoC666dcWI\n");
			outputText("
Alice, the Loli Succubi
");
			outputText("
Amily Additions
");
			rawOutputText("\t\u25E6  Cooking Lessons");
			rawOutputText("\n\t\u25E6  Herm Rewrite");
			rawOutputText("\n\t\u25E6  Winter Cuddle Scene");
			outputText("
Amarok Blowjob
");
			outputText("
Black Velvet Alraune
");
			outputText("
Eldritch Horror Blowjob
");
			outputText("
Ember Drake's Heart Gift
");
			outputText("
Faerie Additions
");
			rawOutputText("\t\u25E6  Codex");
			rawOutputText("\n\t\u25E6  Eating (NOT vore)");
			rawOutputText("\n\t\u25E6  Oral");
			outputText("
Fera Rewrite & Akbal's Quest
");
			outputText("
Goblin Womb Fuck
");
			outputText("
Hellmouths
");
			outputText("
Helspawn Additions
");
			rawOutputText("\t\u25E6  Chaste Lovemaking");
			rawOutputText("\n\t\u25E6  Childhood Bathing");
			rawOutputText("\n\t\u25E6  Piggyback Riding");
			rawOutputText("\n\t\u25E6  Slurping Anemone Water");
			rawOutputText("\n\t\u25E6  Spar Pranking");
			outputText("
Ifris Muscle Worship
");
			outputText("
Isabella's Babies
");
			outputText("
Izma Anal
");
			outputText("
Izumi Additions
");
			rawOutputText("\t\u25E6  Loss Hugging it Out");
			rawOutputText("\n\t\u25E6  Watersports");
			outputText("
Kid A Additions
");
			rawOutputText("\t\u25E6  Teaching Masturbation");
			rawOutputText("\n\t\u25E6  Teddy Guard");
			rawOutputText("\n\t\u25E6  Tigershark Wrestling");
			outputText("
Kiha Drake's Heart Gifting
");
			outputText("
Kitsune Drinking (silly mode)
");
			outputText("
Liddellium (currently disabled)
");
			outputText("
Lolipop Rewrite
");
			outputText("
Lovable Angel OC
");
			outputText("
Magic Codices
");
			outputText("
Manor Wine Rewrite
");
			outputText("
Minerva Celibacy Options
");
			outputText("
Phouka Codex & Drinking Rewrite
");
			outputText("
Shark Daughter Content
");
			rawOutputText("\t\u25E6  Dick Bullying");
			rawOutputText("\n\t\u25E6  Goblin Abuse");
			rawOutputText("\n\t\u25E6  Playtime");
			rawOutputText("\n\t\u25E6  Voyeurism");
			outputText("
Shouldra Additions
");
			rawOutputText("\t\u25E6  Appearance");
			rawOutputText("\n\t\u25E6  Chatting");
			rawOutputText("\n\t\u25E6  Ghostly Blowjob (silly mode)");
			rawOutputText("\n\t\u25E6  Mutual Masturbation");
			rawOutputText("\n\t\u25E6  Post-Fera Talk");
			outputText("
Sophie Female Sex Denial
");
			outputText("
Sprites
");
			rawOutputText("\t\u25E6  Benoit Edit and (((Benoit)))");
			rawOutputText("\n\t\u25E6  Corrected Akbal");
			rawOutputText("\n\t\u25E6  Pure Minerva Edit");
			outputText("
Tel'Adre Library Help
");
			outputText("
Telly's Toys & Treats Additions
");
			outputText("
Weapon Based Kill Scenes
");
			rawOutputText("\t\u25E6  Gwynn");
			rawOutputText("\n\t\u25E6  Imps");
			rawOutputText("\n\t\u25E6  Omnibus Overseer");
			rawOutputText("\n\t\u25E6  Zetaz");
			outputText("
Whitney's Farm Stables
");
			rawOutputText("\t\u25E6  Mare Fucking");
			rawOutputText("\n\t\u25E6  Stallion Sucking");
			outputText("
Many Shitposts
");
			outputText("\n");
			outputText("[b: Wombat]\n");
			outputText("
Alice Additions
");
			rawOutputText("\t\u25E6  Headpats");
			rawOutputText("\n\t\u25E6  Pantie Bow & Sniff");
			outputText("
Faerie Shouldra Dickception~
");
			outputText("
Glacial Rift Log Cabin
");
			outputText("
Rebecc Snuff Scene (yuri)
");
			outputText("
Tel'Adre Kittens Encounter
");
			outputText("
Vapula Force-Lick
");
			outputText("\n");
			outputText("[b: Yuribot]\n");
			outputText("
Aiko Rewrites
");
			rawOutputText("\t\u25E6  Talk Options");
			rawOutputText("\n\t\u25E6  Yamata Aftermath");
			outputText("
Bath Girl Talk Option
");
			outputText("
Gwynn No Sex Option
");
			outputText("
Hellmouth Cuddling
");
			outputText("
Kiha Children Firebreathing
");
			outputText("
Vapula Rebecc Yuri Threesome
");
			outputText("\n");
			outputText("[b: 2hufag]\n");
			outputText("
Amily Additions
");
			rawOutputText("\t\u25E6  Ring Gifting");
			rawOutputText("\n\t\u25E6  Snuggling/Morning Blowjob");
			outputText("
Leaving Rubi's House
");
			outputText("\n\n");
			outputText("[b: Anonymous]\n");
			outputText("
Bow Expansion
");
			outputText("
Kitsune Titfuck
");
			outputText("
Stables Additions
");
			rawOutputText("\t\u25E6  Bend Over");
			rawOutputText("\n\t\u25E6  Horse Strapon Fuck");
			outputText("
Various Sprites
");
			outputText("
Various Tooltips
");
			outputText("
Proofreading/Editing
");
			outputText("
Bug/Typo Reports
");
			outputText("
Complaining
");
			outputText("
A lot of things
");
			outputText("\n");
			outputText("[bu: Thread Special Thanks for]:\n");
			outputText("OP posters, thread archivists, and the writers guide.\n");
		}

		public function ueeCreditsScreen():void {
			displayHeader("Unofficially Expanded Edition Credits");
			outputText("[b: Mod Creator:]\n");
			outputText("
 Kitteh6660
");
			outputText("[b: Contributors:]\n");
			outputText("
 Parth37955 (Pure Jojo anal pitch scene)
");
			outputText("
 Liadri (Manticore and Dragonne suggestions)
");
			outputText("
 Warbird Zero (Replacement Ingnam descriptions)
");
			outputText("
 Matraia (Replacement Cabin construction texts)
");
			outputText("
 Stadler76 (New arm types, Code refactoring)
");
			outputText("[b: Supplementary Events:]\n");
			outputText("
 worldofdrakan (Pablo the Pseudo-Imp, Pigtail Truffles & Pig/Boar TFs)
");
			outputText("
 FeiFongWong (Prisoner Mod)
");
			outputText("
 Foxxling (Lizan Rogue, Skin Oils & Body Lotions, Black Cock)
");
			outputText("
 LukaDoc (Bimbo Jojo)
");
			outputText("
 Kitteh6660 (Cabin, Ingnam, Pure Jojo sex scenes.)
");
			outputText("
 Ormael (Salamander TFs)
");
			outputText("
 Coalsack (Anzu the Avian Deity)
");
			outputText("
 Nonesuch (Izmael)
");
			outputText("
 IxFa (Naga Tail Masturbation)
");
			outputText("[b: Bug Reporting:]\n");
			outputText("
 Wastarce
");
			outputText("
 Sorenant
");
			outputText("
 tadams857
");
			outputText("
 SirWolfie
");
			outputText("
 Atlas1965
");
			outputText("
 Elitist
");
			outputText("
 Bsword
");
			outputText("
 stationpass
");
			outputText("
 JDoraime
");
			outputText("
 Ramses
");
			outputText("
 OPenaz
");
			outputText("
 EternalDragon (github)
");
			outputText("
 PowerOfVoid (github)
");
			outputText("
 kalleangka (github)
");
			outputText("
 sworve (github)
");
			outputText("
 Netys (github)
");
			outputText("
 Drake713 (github)
");
			outputText("
 NineRed (github)
");
			outputText("
 Fergusson951 (github)
");
			outputText("
 aimozg (github)
");
			outputText("
 Stadler76 (github + bug fix coding)
");
		}

		public function vanillaCreditsScreen():void {
			displayHeader("Original Game Credits");
			outputText("[b: Coding and Main Events:]\n");
			outputText("
 Fenoxo
\n");
			outputText("[b: Typo Reporting]\n");
			outputText("
 SoS
");
			outputText("
 Prisoner416
");
			outputText("
 Chibodee
");
			outputText("[b: Graphical Prettiness:]");
			outputText("
 Dasutin (Background Images)
");
			outputText("
 Invader (Button Graphics, Font, and Other Hawtness)
");
			outputText("[b: Supplementary Events:]");
			outputText("
 Dxasmodeus (Tentacles, Worms, Giacomo)
");
			outputText("
 Kirbster (Christmas Bunny Trap)
");
			outputText("
 nRage (Kami the Christmas Roo)
");
			outputText("
 Abraxas (Alternate Naga Scenes w/Various Monsters, Tamani Anal, Female Shouldra Tongue Licking, Chameleon Girl, Christmas Harpy)
");
			outputText("
 Astronomy (Fetish Cultist Centaur Footjob Scene)
");
			outputText("
 Adjatha (Scylla the Cum Addicted Nun, Vala, Goo-girls, Bimbo Sophie Eggs, Ceraph Urta Roleplay, Gnoll with Balls Scene, Kiha futa scene, Goblin Web Fuck Scene, and 69 Bunny Scene)
");
			outputText("
 ComfyCushion (Muff Wrangler)
");
			outputText("
 B (Brooke)
");
			outputText("
 Quiet Browser (Half of Niamh, Ember, Amily The Mouse-girl Breeder, Katherine, Part of Katherine Employment Expansion, Urta's in-bar Dialogue Trees, some of Izma, Loppe)
");
			outputText("
 Indirect (Alternate Non-Scylla Katherine Recruitment, Part of Katherine Employment Expansion, Phouka, Coding of Bee Girl Expansion)
");
			outputText("
 Schpadoinkle (Victoria Sex)
");
			outputText("
 Donto (Ro'gar the Orc, Polar Pete)
");
			outputText("
 Angel (Additional Amily Scenes)
");
			outputText("
 Firedragon (Additional Amily Scenes)
");
			outputText("
 Danaume (Jojo masturbation texts)
");
			outputText("
 LimitLax (Sand-Witch Bad-End)
");
			outputText("
 KLN (Equinum Bad-End)
");
			outputText("
 TheDarkTemplar11111 (Canine Pepper Bad End)
");
			outputText("
 Silmarion (Canine Pepper Bad End)
");
			outputText("
 Soretu (Original Minotaur Rape)
");
			outputText("
 NinjArt (Small Male on Goblin Rape Variant)
");
			outputText("
 DoubleRedd (\"Too Big\" Corrupt Goblin Fuck)
");
			outputText("
 Nightshade (Additional Minotaur Rape)
");
			outputText("
 JCM (Imp Night Gangbang, Addition Minotaur Loss Rape - Oral)
");
			outputText("
 Xodin (Nipplefucking paragraph of Imp GangBang, Encumbered by Big Genitals Exploration Scene, Big Bits Run Encumbrance, Player Getting Beer Tits, Sand Witch Dungeon Misc Scenes)
");
			outputText("
 Blusox6 (Original Queen Bee Rape)
");
			outputText("
 Thrext (Additional Masturbation Code, Faerie, Ivory Succubus)
");
			outputText("
 XDumort (Genderless Anal Masturbation)
");
			outputText("
 Uldego (Slime Monster)
");
			outputText("
 Noogai, Reaper, and Numbers (Nipple-Fucking Victory vs Imp Rape)
");
			outputText("
 Verse and IAMurow (Bee-Girl MultiCock Rapes)
");
			outputText("
 Sombrero (Additional Imp Lust Loss Scene (Dick insertion ahoy!))
");
			outputText("
 The Dark Master (Marble, Fetish Cultist, Fetish Zealot, Hellhound, Lumi, Some Cat Transformations, LaBova, Ceraph's Cat-Slaves, a Cum Witch Scene, Mouse Dreams, Forced Nursing:Imps&Goblins, Bee Girl Expansion)
");
			outputText("
 Mr. Fleshcage (Cat Transformation/Masturbation)
");
			outputText("
 Spy (Cat Masturbation, Forced Nursing: Minotaur, Bee, & Cultist)
");
			outputText("
 PostNuclearMan (Some Cat TF)
");
			outputText("
 MiscChaos (Forced Nursing: Slime Monster)
");
			outputText("
 Ourakun (Kelt the Centaur)
");
			outputText("
 Rika_star25 (Desert Tribe Bad End)
");
			outputText("
 Versesai (Additional Bee Rape)
");
			outputText("
 Mallowman (Additional Bee Rape)
");
			outputText("
 HypnoKitten (Additional Centaur x Imp Rape)
");
			outputText("
 Ari (Minotaur Gloryhole Scene)
");
			outputText("
 SpectralTime (Aunt Nancy)
");
			outputText("
 Foxxling (Akbal)
");
			outputText("
 Elfensyne (Phylla)
");
			outputText("
 Radar (Dominating Sand Witches, Some Phylla)
");
			outputText("
 Jokester (Sharkgirls, Izma, & Additional Amily Scenes)
");
			outputText("
 Lukadoc (Additional Izma, Ceraph Followers Corrupting Gangbang, Satyrs, Ember)
");
			outputText("
 IxFa (Dildo Scene, Virgin Scene for Deluxe Dildo, Naga Tail Masturbation)
");
			outputText("
 Bob (Additional Izma)
");
			outputText("
 lh84 (Various Typos and Code-Suggestions)
");
			outputText("
 Dextersinister (Gnoll girl in the plains)
");
			outputText("
 ElAcechador, Bandichar, TheParanoidOne, Xoeleox (All Things Naga)
");
			outputText("
 Symphonie (Dominika the Fellatrix, Ceraph RPing as Dominika, Tel'Adre Library)
");
			outputText("
 Soulsemmer (Ifris)
");
			outputText("
 WedgeSkyrocket (Zetsuko, Pure Amily Anal, Kitsunes)
");
			outputText("
 Zeikfried (Anemone, Male Milker Bad End, Kanga TF, Raccoon TF, Minotaur Chef Dialogues, Sheila, and More)
");
			outputText("
 User21 (Additional Centaur/Naga Scenes)
");
			outputText("
 ~M~ (Bimbo + Imp loss scene)
");
			outputText("
 Grype (Raping Hellhounds)
");
			outputText("
 B-Side (Fentendo Entertainment Center Silly-Mode Scene)
");
			outputText("
 Not Important (Face-fucking a defeated minotaur)
");
			outputText("
 Third (Cotton, Rubi, Nieve, Urta Pet-play)
");
			outputText("
 Gurumash (Parts of Nieve)
");
			outputText("
 Kinathis (A Nieve Scene, Sophie Daughter Incest, Minerva)
");
			outputText("
 Jibajabroar (Jasun)
");
			outputText("
 Merauder (Raphael)
");
			outputText("
 EdgeofReality (Gym fucking machine)
");
			outputText("
 Bronycray (Heckel the Hyena)
");
			outputText("
 Sablegryphon (Gnoll spear-thrower)
");
			outputText("
 Nonesuch (Basilisk, Sandtraps, assisted with Owca/Vapula, Whitney Farm Corruption)
");
			outputText("
 Anonymous Individual (Lilium, PC Birthing Driders)
");
			outputText("
 PKD (Owca, Vapula, Fap Arena, Isabella Tentacle Sex, Lottie Tentacle Sex)
");
			outputText("
 Shamblesworth (Half of Niamh, Shouldra the Ghost-Girl, Ceraph Roleplaying As Marble, Yara Sex, Shouldra Follow Expansion)
");
			outputText("
 Kirbu (Exgartuan Expansion, Yara Sex, Shambles's Handler, Shouldra Follow Expansion)
");
			outputText("
 05095 (Shouldra Expansion, Tons of Editing)
");
			outputText("
 Smidgeums (Shouldra + Vala threesome)
");
			outputText("
 FC (Generic Shouldra talk scene)
");
			outputText("
 Oak (Bro + Bimbo TF, Isabella's ProBova Burps)
");
			outputText("
 Space (Victory Anal Sex vs Kiha)
");
			outputText("
 Venithil (LippleLock w/Scylla & Additional Urta Scenes)
");
			outputText("
 Butts McGee (Minotaur Hot-dogging PC loss, Tamani Lesbo Face-ride, Bimbo Sophie Mean/Nice Fucks)
");
			outputText("
 Savin (Hel the Salamander, Valeria, Spanking Drunk Urta, Tower of the Phoenix, Drider Anal Victory, Hel x Isabella 3Some, Centaur Sextoys, Thanksgiving Turkey, Uncorrupt Latexy Recruitment, Assert Path for Direct Feeding Latexy, Sanura the Sphinx)
");
			outputText("
 Gats (Lottie, Spirit & Soldier Xmas Event, Kiha forced masturbation, Goblin Doggystyle, Chicken Harpy Egg Vendor)
");
			outputText("
 Aeron the Demoness (Generic Goblin Anal, Disciplining the Eldest Minotaur)
");
			outputText("
 Gats, Shamblesworth, Symphonie, and Fenoxo (Corrupted Drider)
");
			outputText("
 Bagpuss (Female Thanksgiving Event, Harpy Scissoring, Drider Bondage Fuck)
");
			outputText("
 Frogapus (The Wild Hunt)
");
			outputText("
 Fenoxo (Everything Else)
");
			outputText("[b: Oviposition Update Credits - Names in Order Appearance in Oviposition Document]");
			outputText("
 DCR (Idea, Drider Transformation, and Drider Impreg of: Goblins, Beegirls, Nagas, Harpies, and Basilisks)
");
			outputText("
 Fenoxo (Bee Ovipositor Transformation, Bee Oviposition of Nagas and Jojo, Drider Oviposition of Tamani)
");
			outputText("
 Smokescreen (Bee Oviposition of Basilisks)
");
			outputText("
 Radar (Oviposition of Sand Witches)
");
			outputText("
 OutlawVee (Bee Oviposition of Goo-Girls)
");
			outputText("
 Zeikfried (Editing this mess, Oviposition of Anemones)
");
			outputText("
 Woodrobin (Oviposition of Minotaurs)
");
			outputText("
 Posthuman (Oviposition of Ceraph Follower)
");
			outputText("
 Slywyn (Bee Oviposition of Gigantic PC Dick)
");
			outputText("
 Shaxarok (Drider Oviposition of Large Breasted Nipplecunts)
");
			outputText("
 Quiet Browser (Bee Oviposition of Urta)
");
			outputText("
 Bagpuss (Laying Eggs In Pure Amily)
");
			outputText("
 Eliria (Bee Laying Eggs in Bunny-Girls)
");
			outputText("
 Gardeford (Helia x Bimbo Sophie Threesomes)
");
		}
	}
}


code:
//The code that is responsible for managing MainView.
package classes
{
	import classes.GlobalFlags.kFLAGS;

import coc.view.BoundClip;

import flash.filters.DropShadowFilter;

	import coc.view.BitmapDataSprite;
	import coc.view.MainView;
	import coc.view.StatsView;

	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Stage;
	import flash.events.KeyboardEvent;
	import flash.events.TimerEvent;
import flash.text.TextFormat;
import flash.ui.Keyboard;
	import flash.utils.Timer;
	import flash.utils.getQualifiedClassName;

	public class MainViewManager extends BaseContent
	{
		//Interface flags
		public var registeredShiftKey:Boolean = false;

		public static const textColorArray:Array = [0, 0, 0, 0xc0c0c0, 0, 0, 0, 0, 0, 0xc0c0c0];
		public static const darkThemes:Array = [false, false, false, false, false, false, false, false, false, true];
		public static const barAlphaArray:Array  = [0.4, 0.4, 0.5, 1, 0.35, 0.4, 0.4, 0.4, 1, 1];

		public var statsHidden:Boolean = false;
		public var buttonsTweened:Boolean = false;

		public function MainViewManager()
		{

		}

		//------------
		// SHOW/HIDE
		//------------
		public function isDarkTheme():Boolean {
			return darkThemes[flags[kFLAGS.BACKGROUND_STYLE]];
		}
		public function isDarkText():Boolean {
			return isDarkTheme() && !mainView.textBGTan.visible && !mainView.textBGWhite.visible;
		}
		public function colorHpMinus():String {
			return isDarkText() ? '#ff0000' : '#800000';
		}
		public function colorHpPlus():String {
			return isDarkText() ? '#00ff00' : '#008000';
		}

		public function setTheme():void {
			//Set background
			mainView.background.bitmapClass = MainView.Backgrounds[flags[kFLAGS.BACKGROUND_STYLE]];
			mainView.statsView.setBackground(StatsView.SidebarBackgrounds[flags[kFLAGS.BACKGROUND_STYLE]]);
			mainView.monsterStatsView.setBackground(StatsView.SidebarBackgrounds[flags[kFLAGS.BACKGROUND_STYLE]]);
			mainView.minimapView.setBackground(StatsView.SidebarBackgrounds[flags[kFLAGS.BACKGROUND_STYLE]]);
			//Set font
			mainView.monsterStatsView.setTheme((flags[kFLAGS.USE_OLD_FONT] > 0) ? StatsView.ValueFontOld : StatsView.ValueFont,
                    textColorArray[flags[kFLAGS.BACKGROUND_STYLE]],
                    barAlphaArray[flags[kFLAGS.BACKGROUND_STYLE]]);
			mainView.statsView.setTheme((flags[kFLAGS.USE_OLD_FONT] > 0) ? StatsView.ValueFontOld : StatsView.ValueFont,
					textColorArray[flags[kFLAGS.BACKGROUND_STYLE]],
					barAlphaArray[flags[kFLAGS.BACKGROUND_STYLE]]);
			mainView.minimapView.setTheme(textColorArray[flags[kFLAGS.BACKGROUND_STYLE]]);
			mainView.minimapView.setBackground(StatsView.SidebarBackgrounds[flags[kFLAGS.BACKGROUND_STYLE]]);
		}

		public function hideSprite():void {
			// Inlined from lib/src/coc/view/MainView.as
			mainView.sprite.visible = false;
		}
		public function showSpriteBitmap(bmp:BitmapData):void {
			if (!bmp) return;
			var element:BitmapDataSprite = mainView.sprite;
			element.visible = true;
			var scale:Number = 80 / bmp.height;
			element.scaleX = scale;
			element.scaleY = scale;
			element.graphics.clear();
			element.graphics.beginBitmapFill(bmp,null,false,false);
			element.graphics.drawRect(0, 0, bmp.width, bmp.height);
			element.graphics.endFill();
			var shadow:DropShadowFilter = new DropShadowFilter();
			shadow.strength = 0.4;
			if (!isDarkTheme()) {
				if (element.filters.length < 1) {
					element.filters = [shadow];
				}
			}
			else {
				element.filters = [];
			}
		}
		public function hideImage():void {
			// Inlined from lib/src/coc/view/MainView.as
			mainView.image.visible = false;
		}
		public function showImageBitmap(bmp:BitmapData, x:int = 0, y:int = 0):void {
			if (!bmp) return;
			mainView.image.x = x;
			mainView.image.y = y;
			var element:BitmapDataSprite = mainView.image;
			element.visible = true;
			element.graphics.clear();
			element.graphics.beginBitmapFill(bmp,null,false,false);
			element.graphics.drawRect(0, 0, bmp.width, bmp.height);
			element.graphics.endFill();
			var shadow:DropShadowFilter = new DropShadowFilter();
			shadow.strength = 0.4;
			if (!isDarkTheme()) {
				if (element.filters.length < 1) {
					element.filters = [shadow];
				}
			}
			else {
				element.filters = [];
			}
		}
		//------------
		// REFRESH
		//------------
		public function refreshStats():void {
			if ((flags[kFLAGS.HUNGER_ENABLED] > 0 || prison.inPrison) && flags[kFLAGS.URTA_QUEST_STATUS] != 0.75 && flags[kFLAGS.USE_OLD_INTERFACE] <= 0) {
				mainView.statsView.toggleHungerBar(true);
			} else {
				mainView.statsView.toggleHungerBar(false);
			}
			mainView.statsView.refreshStats(game);
			mainView.monsterStatsView.refreshStats(game);
            refreshMinimap();
			//Set theme!
			setTheme();
		}

		public function refreshMinimap():void{
            if(inDungeon || game.inRoomedDungeon){
                mainView.minimapView.show();
                mainView.minimapView.mapView.htmlText = game.dungeons.map.chooseRoomToDisplay();
            }else{
                mainView.minimapView.hide();
                mainView.minimapView.mapView.htmlText = "";
            }
            var newTf:TextFormat = mainView.minimapView.mapView.getTextFormat();
			while(mainView.minimapView.mapView.width < mainView.minimapView.mapView.textWidth){
                newTf.size = int(mainView.minimapView.mapView.getTextFormat().size) - 1;
                mainView.minimapView.mapView.setTextFormat(newTf);
			}
			if(mainView.minimapView.mapView.width > mainView.minimapView.mapView.textWidth){
                mainView.minimapView.mapView.x = (mainView.minimapView.mapView.width - mainView.minimapView.mapView.textWidth)/2;
			}
            mainView.minimapView.scrollBarMap.draw();
		}

		public function showPlayerDoll(reload:Boolean=false):void {
			tweenOutStats();
			if (reload) mainView.charView.reload("external");
			mainView.charView.setCharacter(player);
			mainView.charView.redraw();
			mainView.charView.visible = true;
			if(/*flags[kFLAGS.CHARVIEW_STYLE]*/0 < 1){
				mainView.charView.x = 0;
				mainView.charView.y = 0;
				BoundClip.nextContent = mainView.charView;
				outputText("<img src='coc.view::BoundClip' align='left' id='charview'/>");
			} else {
				mainView.charView.x = 208 + 796 + 4; //TEXTZONE_X + TEXTZONE_W + GAP
				mainView.charView.y = 52; // TEXTZONE_Y;
				mainView.addElement(mainView.charView);
			}
		}
		public function hidePlayerDoll():void {
			mainView.charView.visible = false;
			tweenInStats();
		}

		//Show/hide stats bars.
		public function tweenInStats():void {
			var t:Timer = new Timer(20, 21);
			if (!statsHidden) return;
			statsHidden = false;
			t.addEventListener(TimerEvent.TIMER, function():void {
				mainView.statsView.x += 10;
				mainView.statsView.alpha += 0.05;
			});
			t.addEventListener(TimerEvent.TIMER_COMPLETE, function ():void {
				mainView.statsView.x     = 0;
				mainView.statsView.alpha = 1;
			});
			t.start();
		}
		public function tweenOutStats():void {
			var t:Timer = new Timer(20, 21);
			if (statsHidden) return;
			statsHidden = true;
			t.addEventListener(TimerEvent.TIMER, function():void {
				mainView.statsView.x -= 10;
				mainView.statsView.alpha -= 0.05;
				if (mainView.statsView.alpha < 0) mainView.statsView.alpha = 0;
			});
			t.addEventListener(TimerEvent.TIMER_COMPLETE, function ():void {
				mainView.statsView.x     = -200;
				mainView.statsView.alpha = 0;
			});
			t.start();
		}

		//Animate buttons for startup!
		public function startUpButtons():void {
			if (buttonsTweened) return;
			buttonsTweened = true;
			for (var i:int = 0; i < 15; i++) {
				mainView.bottomButtons[i].y += 140;
			}
			var t:Timer = new Timer(1000, 1);
			t.addEventListener(TimerEvent.TIMER, tweenButtonsIn);
			t.start();
		}
		private function tweenButtonsIn(e:TimerEvent = null):void {
			var t:Timer = new Timer(20, 28);
			t.addEventListener(TimerEvent.TIMER, moveButtonsIn);
			t.start();
		}
		private function moveButtonsIn(e:TimerEvent):void {
			for (var i:int = 0; i < 15; i++) {
				mainView.bottomButtons[i].y -= 5;
			}
		}

		//Allows shift key.
		public function registerShiftKeys():void {
			if (!registeredShiftKey) {
				mainView.stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
				mainView.stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
				registeredShiftKey = true;
			}
		}

		public function keyPressed(event:KeyboardEvent):void {
			if (event.keyCode == Keyboard.SHIFT) {
				flags[kFLAGS.SHIFT_KEY_DOWN] = 1;
			}
		}
		public function keyReleased(event:KeyboardEvent):void {
			if (event.keyCode == Keyboard.SHIFT) {
				flags[kFLAGS.SHIFT_KEY_DOWN] = 0;
			}
		}
		public function traceSelf():String {
			function chdump(obj:DisplayObject, depth:int, alpha:Number, visible:Boolean, scaleX:Number, scaleY:Number):String {

				var s:String = repeatString("  ", depth);

				var className:String = getQualifiedClassName(obj)
						.replace("coc.view::", "<coc>::")
						.replace("spark.components::", "<s>::")
						.replace("spark.skins.spark::", "<spark>::")
						.replace("flash.display::", "<f>::")
						.replace("flash.text::", "<ft>::")
						.replace("flash.text.engine::", "<fte>::");
				s += className + " '" + obj.name + "' ";

				s += "xy=(" + (obj.x | 0) + "," + (obj.y | 0) + ") ";

				var smar:String = "";
				var spad:String = "";
				/*var uio:UIComponent = obj as UIComponent;
				 if (uio) {
				 spad = uio.getStyle("paddingTop") + "," + uio.getStyle("paddingRight") +
				 "," + uio.getStyle("paddingBottom") + "," + uio.getStyle("paddingLeft");
				 if (spad == "0,0,0,0") spad = ""; else spad = ", pad=[" + spad + "]";
				 /!*smar = uio.getStyle("marginTop")+","+uio.getStyle("marginRight")+
				 ","+uio.getStyle("marginBottom")+","+uio.getStyle("marginLeft");
				 if (smar == "0,0,0,0") smar = ""; else smar=", mar=["+smar+"]";*!/
				 }*/
				s += "sz=" + (obj.width | 0) + "x" + (obj.height | 0) + spad + smar;

				alpha             = alpha * obj.alpha;
				visible           = visible && obj.visible;
				scaleX            = scaleX * obj.scaleX;
				scaleY            = scaleY * obj.scaleY;
				var salpha:String = "";
				var svis:String   = "";
				var ssx:String    = "";
				var ssy:String    = "";
				if (alpha != 1.0) {
					salpha += ", a=" + obj.alpha;
					if (alpha != obj.alpha) salpha += "=" + alpha;
				}
				if (!visible) {
					svis += ", v=" + obj.visible;
					if (visible != obj.visible) svis += "=" + visible;
				}
				if (scaleX != 1.0 || obj.scaleX != 1.0) {
					ssx += ", sx=" + obj.scaleX;
					if (scaleX != obj.scaleX) ssx += "=" + scaleX;
				}
				if (scaleY != 1.0 || obj.scaleY != 1.0) {
					ssy += ", sy=" + obj.scaleY;
					if (scaleY != obj.scaleY) ssy += "=" + scaleY;
				}
				s += salpha + svis + ssx + ssy;

				/*var txt:IDisplayText = obj as IDisplayText;
				 if (txt) {
				 var ts:String = txt.text;
				 if (ts.length > 20) ts = ts.substr(0, 17) + "...";
				 s += ", txt='" + ts.replace(/[\r\n\t\0]/g, ' ') + "'";
				 }*/

				var doc:DisplayObjectContainer = obj as DisplayObjectContainer;
				if (doc /*&& !(obj is Label) && !(obj is ComboBox) && !(obj is TextArea) && !(obj is TextInput)*/) {
					var i:int, n:int = doc.numChildren, rslt:String;
					rslt             = "\n" + s;
					for (i = 0; i < n; i++) {
						var child:DisplayObject = doc.getChildAt(i);
						/*if (!(child is TextLine)) {*/
						rslt += chdump(child, depth + 1, alpha, visible, scaleX, scaleY);
						/*}*/
					}
					return rslt;
				} else {
					return "\n" + s;
				}
			}
			var obj:Stage = game.stage;
			return chdump(obj, 0, obj.alpha, obj.visible, obj.scaleX, obj.scaleY);
		}
		public function setText(_currentText:String):void {
			mainView.resetTextFormat();
			mainView.setOutputText(_currentText);
		}
	}
}


code:
package classes.Masteries
{
	import classes.Mastery;
	import classes.MasteryType;
	import classes.PerkLib;

	public class BowMastery extends MasteryType {

		public function BowMastery() {
			super("Bow", "Bow", "Weapon", "Bow mastery");
		}

		override public function onLevel(level:int, output:Boolean = true):void {
			super.onLevel(level, output);
			var text:String = "Damage and accuracy increased, fatigue cost reduced."; //damage, fatigue
			switch (level) {
				case 1:
				case 2:
				case 3:
				case 4:
				case 5:
				default:
			}
			if (output && text != "") outputText(text + "[pg]");
		}
	}
}


code:
package classes.Masteries
{
	import classes.Mastery;
	import classes.MasteryLib;
	import classes.MasteryType;
	import classes.PerkLib;

	public class CastingMastery extends MasteryType {

		public function CastingMastery() {
			super("Casting", "Casting", "General", "Casting mastery");
			boostsSpellCost(costReduction);
		}

		override public function onLevel(level:int, output:Boolean = true):void {
			super.onLevel(level, output);
			var text:String;
			switch (level) {
				case 1:
				case 2:
				case 3:
				case 4:
				case 5:
					text = "Spell costs are reduced.";
				default:
			}
			if (output && text != "") outputText(text + "[pg]");
		}

		public function costReduction():Number {
			return -10 * player.masteryLevel(MasteryLib.Casting);
		}
	}
}


code:
package classes.Masteries
{
	import classes.Mastery;
	import classes.MasteryType;
	import classes.PerkLib;

	public class FistMastery extends MasteryType {

		public function FistMastery() {
			super("Fist", "Fist", "Weapon", "Fist mastery");
		}

		override public function onLevel(level:int, output:Boolean = true):void {
			super.onLevel(level, output);
			var text:String = "Damage and accuracy slightly increased.";
			switch (level) {
				case 1:
					break;
				case 2:
					text += "\n<b>Endless Flurry</b> unlocked!";
					break;
				case 3:
					break;
				case 4:
					text += "You can now parry attacks with your bare hands.";
					break;
				case 5:
				default:
			}
			if (player.weapon.isHybrid()) text += "\n(You're currently wielding a hybrid weapon, which uses the average level of all applicable masteries)";
			if (output && text != "") outputText(text + "[pg]");
		}
	}
}


code:
package classes.Masteries
{
	import classes.Mastery;
	import classes.MasteryType;
	import classes.PerkLib;

	public class ShieldMastery extends MasteryType {

		public function ShieldMastery() {
			super("Shield", "Shield", "General", "Shield mastery");
		}

		override public function onLevel(level:int, output:Boolean = true):void {
			super.onLevel(level, output);
			var text:String = "";
			switch (level) {
				case 1:
					text = "\n<b>Shield Bash</b> unlocked!";
					break;
				case 2:
				case 3:
				case 4:
					text = "Bash damage increased and fatigue cost reduced.";
					break;
				case 5:
					text = "Bash damage increased and fatigue cost reduced.";
					text += "\nBlock chance increased.";
				default:
			}
			if (output && text != "") outputText(text + "[pg]");
		}
	}
}


code:
package classes.Masteries
{
	import classes.Mastery;
	import classes.MasteryType;
	import classes.PerkLib;

	public class TerrestrialFireMastery extends MasteryType {

		public function TerrestrialFireMastery() {
			super("Terrestrial Fire", "Terrestrial Fire", "General", "Terresterial Fire mastery", 1.5, 5, false);
		}

		override public function onAttach(output:Boolean = true):void {
			return;
		}

		override public function onLevel(level:int, output:Boolean = true):void {
			super.onLevel(level, output);
			var text:String = "You have unlocked ";
			switch (level) {
				case 1:
					text += "spell synergy, and a new tier of spells!";
					break;
				case 2:
					text += "a new tier of spells!";
					if (player.hasPerk(PerkLib.Spellsword)) text += "\nYour Spellsword perk will now work with Inflame."
					break;
				case 3:
					text += "a new tier of spells!";
					break;
				case 4:
					text += "a new tier of spells!";
					break;
				case 5:
					text = "\nYou feel that you could fuse your spells into something amazing, but you aren't quite sure how.";
					break;
				default:
					text = "";
			}
			if (output && text != "") outputText(text + "[pg]");
		}
	}

}


code:
package classes.Masteries
{
	import classes.Mastery;
	import classes.MasteryType;

	public class WeaponMastery extends MasteryType {

		public function WeaponMastery(id:String, name:String, category:String = "Weapon", desc:String = "", xpCurve:Number = 1.5, maxLevel:int = 5, permable:Boolean = true) {
			super(id, name, "Weapon", desc, xpCurve, maxLevel, permable);
		}

		override public function onLevel(level:int, output:Boolean = true):void {
			super.onLevel(level, output);
			var text:String = "Damage and accuracy slightly increased.";
			switch (level) {
				case 1:
					break;
				case 2: //spear/grand thrust
					if (player.weapon.isWhip()) text += "\nWhip Trip unlocked!";
					if (player.weapon.isOneHandedMelee()) text += "\nEndless Flurry unlocked!";
					if (player.weapon.isLarge()) text += "\nArc of Retribution unlocked!";
					if (player.weapon.isKnife()) text += "\nBackstab unlocked!";
					if (player.weapon.isSpear()) text += "\nGrand Thrust unlocked!";
					break;
				case 3:
				case 4:
					text += " Special ability fatigue cost reduced."
					break;
				case 5: //regen 1 fatigue with normal attacks
					text += " Special ability fatigue cost reduced."
					text += "\nYou've reached such a high level of skill that basic attacks are almost effortless, allowing you to recover more fatigue while attacking.";
					break;
				default:
			}
			if (player.weapon.isHybrid()) text += "\n(You're currently wielding a hybrid weapon, which uses the average level of all applicable masteries)";
			if (output && text != "") outputText(text + "[pg]");
		}
	}
}


code:
package classes {

	public class Mastery extends BaseContent implements TimeAwareInterface {

		public function Mastery(mastery:MasteryType, level:int = 0, xp:int = 0, permed:Boolean = false) {
			this._mtype = mastery;
			this._level = level;
			this._xp = xp;
			this._permed = permed;
			CoC.timeAwareClassAdd(this);
		}

		public function timeChangeLarge():Boolean { return false; }
		public function timeChange():Boolean {
			return xpFix(); //Check periodically if xp is enough for levelup. Ideally this should never do anything, just adding it as a precaution.
		}

		private var _mtype:MasteryType;
		private var _level:int;
		private var _xp:int;
		private var _permed:Boolean;

		public function get mtype():MasteryType {
			return _mtype;
		}

		public function get level():int {
			return _level;
		}

		public function set level(value:int):void {
			_level = value;
		}

		public function get xp():int {
			return _xp;
		}

		public function set xp(value:int):void {
			_xp = value;
		}

		public function get maxXP():int {
			return 100*Math.pow(xpCurve, level);
		}

		//make mastery permanent and return true, or return false if mastery can't be permed
		public function perm():Boolean {
			if (mtype.permable) _permed = true;
			return _permed;
		}

		public function get isPermed():Boolean {
			return _permed;
		}

		public function get name():String {
			return _mtype.name;
		}

		public function get desc():String {
			return _mtype.desc;
		}

		public function get category():String {
			return _mtype.category;
		}

		public function get maxLevel():int {
			return _mtype.maxLevel;
		}

		public function get xpCurve():Number {
			return _mtype.xpCurve;
		}

		public function xpGain(change:int, announce:Boolean = false):Boolean {
			if (_level >= maxLevel) return false;
			var temp:int = _level;
			_xp += change;
			while (_xp >= maxXP) {
				levelGain(1, false, announce);
			}
			if (_xp < 0) levelGain(-1, false, announce);
			if (temp != _level) return true;
			else return false;
		}

		public function levelGain(change:int, keepXP:Boolean = false, announce:Boolean = false):Boolean {
			var temp:int = _level;
			if (_level >= maxLevel && change >= 0) {
				if (_xp >= maxXP) _xp = maxXP - 1;
				if (_xp < 0) _xp = 0;
				return false;
			}
			if (change > 0) {
				for (var i:int = 0; i < Math.abs(change); i++) {
					if (!keepXP) _xp -= maxXP;
					_level++;
					onLevel(announce);
				}
			}
			else if (change < 0) {
				if (!keepXP) _xp = 0;
				_level -= change;
				onLevel(announce);
			}
			if (_xp < 0) _xp = 0;
			if (_level < 0) _level = 0;
			if (_level > maxLevel) _level = maxLevel;
			if (temp != _level) return true;
			return false;
		}

		public function xpFix():Boolean {
			if (_xp < maxXP) return false;
			while (_xp >= maxXP) {
				levelGain(1);
			}
			return true;
		}

		//Run when first gaining the mastery
		public function onAttach(output:Boolean = true):void {
			_mtype.onAttach(output);
		}

		//Run on levelup
		public function onLevel(output:Boolean = true):void {
			_mtype.onLevel(_level, output);
		}
	}
}


code:
package classes {
	import classes.Masteries.*;

	public class MasteryLib extends BaseContent {

		/*
 		Constructor for reference:
		MasteryType(id:String, name:String, category:String = "General", desc:String = "", xpCurve:Number = 1.5, maxLevel:int = 5)
		*/

		//General Masteries
		public static const Tease:MasteryType = new MasteryType("Tease", "Tease", "General", "Tease mastery");
		public static const Shield:ShieldMastery = new ShieldMastery();
		public static const Casting:CastingMastery = new CastingMastery();
		public static const TerrestrialFire:TerrestrialFireMastery = new TerrestrialFireMastery();
		//public static const Necromancy:MasteryType = new MasteryType("Necromancy", "Necromancy", "General", "");
		//public static const Pickpocket:MasteryType = new MasteryType("Pickpocket", "Pickpocket", "General", "");

		//Weapon Masteries
		public static const Fist:FistMastery = new FistMastery();
		public static const Bow:BowMastery = new BowMastery();
		public static const Sword1H:WeaponMastery = new WeaponMastery("1H Sword", "1H Sword", "One-handed sword mastery");
		public static const Sword2H:WeaponMastery = new WeaponMastery("2H Sword", "2H Sword", "Two-handed sword mastery");
		public static const Knife:WeaponMastery = new WeaponMastery("Knife", "Knife", "Knife mastery");
		public static const Blunt1H:WeaponMastery = new WeaponMastery("1H Blunt", "1H Blunt", "One-handed blunt weapon mastery");
		public static const Blunt2H:WeaponMastery = new WeaponMastery("2H Blunt", "2H Blunt", "Two-handed blunt weapon mastery");
		public static const Spear:WeaponMastery = new WeaponMastery("Spear", "Spear", "Spear mastery");
		public static const Axe:WeaponMastery = new WeaponMastery("Axe", "Axe", "Axe mastery");
		public static const Staff:WeaponMastery = new WeaponMastery("Staff", "Staff", "Melee staff mastery");
		public static const Polearm:WeaponMastery = new WeaponMastery("Polearm", "Polearm", "Polearm mastery");
		public static const Scythe:WeaponMastery = new WeaponMastery("Scythe", "Scythe", "Scythe mastery");
		public static const Whip:WeaponMastery = new WeaponMastery("Whip", "Whip", "Whip mastery");
		public static const Crossbow:WeaponMastery = new WeaponMastery("Crossbow", "Crossbow", "Crossbow mastery");
		public static const Firearm:WeaponMastery = new WeaponMastery("Firearm", "Firearm", "Firearm mastery");

		//Crafting Masteries
		public static const Gathering:MasteryType = new MasteryType("Gathering", "Gathering", "Crafting", "");
		public static const BasicCrafting:MasteryType = new MasteryType("Basic Crafting", "Basic Crafting", "Crafting", "");
		public static const Alchemy:MasteryType = new MasteryType("Alchemy", "Alchemy", "Crafting", "");
		public static const Cooking:MasteryType = new MasteryType("Cooking", "Cooking", "Crafting", "");
		public static const Weaponcrafting:MasteryType = new MasteryType("Weaponcrafting", "Weaponcrafting", "Crafting", "");
		public static const Armourcrafting:MasteryType = new MasteryType("Armourcrafting", "Armourcrafting", "Crafting", "");
		public static const Enchantment:MasteryType = new MasteryType("Enchantment", "Enchantment", "Crafting", "");
		public static const Constructs:MasteryType = new MasteryType("Constructs", "Constructs", "Crafting", "");

		//Using these to define display order, among other things. Seemed neater than sorting the player's mastery array, like perks do.
		public static var MASTERY_GENERAL:Vector.<MasteryType> = new Vector.<MasteryType>();
			MASTERY_GENERAL.push(Tease, Shield, Casting, TerrestrialFire); //I don't even know what I'm doing here. This is completely stupid. Why is it only working when I do this? How did I even get the idea to try this? WTF. But it's working now, and I'm already half asleep, so fuck it. -Koraeli
		public static var MASTERY_WEAPONS:Vector.<MasteryType> = new Vector.<MasteryType>();
			MASTERY_WEAPONS.push(Fist, Bow, Sword1H, Sword2H, Knife, Blunt1H, Blunt2H, Spear, Axe, Staff, Polearm, Scythe, Whip, Crossbow, Firearm);
		public static var MASTERY_CRAFTING:Vector.<MasteryType> = new Vector.<MasteryType>();
			MASTERY_CRAFTING.push(Gathering, BasicCrafting, Alchemy, Cooking, Weaponcrafting, Armourcrafting, Enchantment, Constructs);

	}
}


code:
package classes {

	public class MasteryPerk extends BaseContent {

		public function MasteryPerk(def:*) {
			_perk = def.perk;
			_unlockIf = def.unlockIf;
			_displayText = def.displayText || ("Through the results of your practice, you've developed a new perk.\n(<b>Gained Perk: " + _perk.name + "!</b>)\n\n");
			_perkv1 = def.value1 || 0;
			_perkv2 = def.value2 || 0;
			_perkv3 = def.value3 || 0;
			_perkv4 = def.value4 || 0;
		}

		private var _perk:PerkType;
		private var _perkv1:Number = 0;
		private var _perkv2:Number = 0;
		private var _perkv3:Number = 0;
		private var _perkv4:Number = 0;
		private var _unlockIf:*;
		private var _displayText:String;

		public function unlockIf():Boolean {
			return _unlockIf is Function ? _unlockIf() : _unlockIf;
		}

		public function unlock():Boolean {
			if (unlockIf()) {
				if (player.createPerkIfNotHasPerk(_perk, _perkv1, _perkv2, _perkv3, _perkv4)) {
					outputText(_displayText + "\n\n");
					return true;
				}
			}
			return false;
		}
	}
}