code:
package classes.Scenes.Areas.VolcanicCrag
{
	import classes.*;
	import classes.internals.WeightedDrop;
	import classes.GlobalFlags.kFLAGS;

	public class VolcanicGolem extends Monster
	{

		override public function defeated(hpVictory:Boolean):void {
			game.volcanicCrag.volcanicGolemScene.winAgainstGolem();
		}

		override public function won(hpVictory:Boolean, pcCameWorms:Boolean = false):void {
			flags[kFLAGS.VOLCANICGOLEMHP] = this.HP - 50;
			if (pcCameWorms){
				outputText("\n\nYour opponent doesn't seem to care.");
				doNext(game.volcanicCrag.volcanicGolemScene.loseToGolem);
			} else {
				game.volcanicCrag.volcanicGolemScene.loseToGolem();
			}
		}

		override public function react(context:int):Boolean{
			switch(context){
				case CON_AFTERATTACKED:
					if (game.combat.damageType == game.combat.DAMAGE_PHYSICAL_MELEE){
						game.combat.monsterDamageType = game.combat.DAMAGE_FIRE;
						var thornsDamage:int = player.reduceDamage(rand(30) + 15,this);
						player.takeDamage(thornsDamage);
						outputText("\nMagma spills from between the rock plates and hits you, burning intensely.(" + thornsDamage + ")");
					}
					break;
				case CON_BLINDED:
					outputText("\n\nThe golem doesn't seem to be affected! Its magically animated eyes aren't affected by spells!\n\n");
					return false;
				case CON_BURNED:
					outputText("The flames don't seem to bother the fiery golem too much, although the magical nature of your attack prevents it from being resisted entirely.\n\n");
					break;

			}
			return true;
		}

		override public function shouldMove(newPos:int, forceAction:Boolean = false):Boolean {
			return false;
		}

		/*override public function afterAttacked():Boolean{//Handles any special effects that might occur the moment this monster is attacked by a regular attack. Used mainly to clean up Combat.as, since it's getting rather cluttered.
			if(game.combat.damageType == game.combat.DAMAGE_PHYSICAL_MELEE){
			var thornsDamage:Number = player.reduceDamage(rand(30) + 15,this);
			player.takeDamage(thornsDamage);
			outputText("\nMagma spills from between the rock plates and hits you, burning intensely.(" + thornsDamage + ")");
			}
			return true;

		}*/
		public function distanceAnger():void{
				game.combatAttackData.closeDistance(this);
				if (!hasStatusEffect(StatusEffects.Uber) && !hasStatusEffect(StatusEffects.VolcanicUberHEAL)){
					if (player.spe < 70 && rand(4) == 0 || player.spe >= 70 && rand(2) == 0){
						clearOutput();
						outputText("You decide to get some distance instead of attacking. The slow golem charges and attacks the ground you stood on seconds ago, digging a massive hole in the scorched earth and impaling his own fist in the ground. Whew!\n");
						outputText("\nThe construct seems to struggle to remove its fist from the ground. If you act immediately with the proper attack, you might be able to exploit the golem's mistake!\n");
						createStatusEffect(StatusEffects.VolcanicFistProblem, 2, 0, 0, 0);
						volcanicStatus();

					}else{
						volcanicGolemWait();
					}
				}else{
					clearOutput();
					outputText("The golem doesn't care about your retreat, and continues to glow brighter.");
					if (!hasStatusEffect(StatusEffects.VolcanicUberHEAL)) nuke();
					else heal();
				}
			}

		override public function handleDamaged(damage:Number, apply:Boolean = true):Number{
			if (hasStatusEffect(StatusEffects.Uber))
			{
				if (damage >= 150){
					if(apply) outputText("\nYour attack is so strong it knocks the Golem out of its charging spell! It falls to the ground, stunned!\n");
					armorDef = 0;
					createStatusEffect(StatusEffects.Stunned, 1, 0, 0, 0);
					removeStatusEffect(StatusEffects.Uber);
				}
			}

			if (hasStatusEffect(StatusEffects.VolcanicUberHEAL))
			{
				if (damage < 100){
					if(apply) outputText("\nYour attack is absorbed by the shimmering shield and deals minor damage to it.\n");
					damage = Math.round(damage * 0.3);
					flags[kFLAGS.VOLCANICGOLEMSHIELDHP] -= damage;
					if (flags[kFLAGS.VOLCANICGOLEMSHIELDHP] == 0){
					if(apply) outputText("You manage to break through the shield, stopping the golem's ability!");
					armorDef = 0;
					removeStatusEffect(StatusEffects.VolcanicUberHEAL);
					}
					damage = 1; //If it's 0, you'll get a message about the attack being deflected or blocked
				}else{
					if (apply){
						outputText("Your mighty attack completely shatters the shimmering shield, stunning the golem in the process!\n");
					}
					armorDef = 0;
					removeStatusEffect(StatusEffects.VolcanicUberHEAL);
					createStatusEffect(StatusEffects.Stunned, 2, 0, 0, 0);
					damage = 1; //If it's 0, you'll get a message about the attack being deflected or blocked
				}

			}
			return damage;
		}

		public function volcanicGolemWait():void{
			clearOutput();
			outputText("Furious over your fleeing, the golem rips a few pieces of rock and magma from itself and hurls it at you! ");
			if (!combatAvoidDamage({doDodge:true,doParry:false,doBlock:false}).failed)  {
				outputText("You manage to roll out of the way as the ball of rock and lava crashes into the ground, dispersing into fizzling red-hot pebbles.\n");
			}
			else {
				outputText("The boulder crashes into you, burning and crushing your body before exploding and dispersing into fizzling red-hot pebbles.");
				game.combat.monsterDamageType = game.combat.DAMAGE_FIRE;
				var damage:int = str + 200;
				damage = player.reduceDamage(damage,this)
				player.takeDamage(damage, true);
			}
			outputText("\nYou notice more of the golem's core is now visible. The Golem's defense has decreased!");
			if (hasStatusEffect(StatusEffects.VolcanicArmorRed))//if armor is already rent
				{
					addStatusValue(StatusEffects.VolcanicArmorRed, 1, 3);//prolong duration
					addStatusValue(StatusEffects.VolcanicArmorRed, 2, 1);//increase effect
					this.armorDef -= 150;
					if (this.armorDef < 0) this.armorDef = 0;
				}else{
					createStatusEffect(StatusEffects.VolcanicArmorRed, 3, 1, 0, 0);//otherwise, create effect
					this.armorDef -= 150;
					if (this.armorDef < 0) this.armorDef = 0;
				}

			return;
		}

		public function volcanicStatus():void{//handles the status fuckery this enemy has to account for.
			if (hasStatusEffect(StatusEffects.VolcanicWeapRed)){
				addStatusValue(StatusEffects.VolcanicWeapRed, 1, -1);
				if (statusEffectv1(StatusEffects.VolcanicWeapRed) < 0)
				{
					outputText("\nThe golem's arm fully regrows. Its damage is back to normal!\n");
					this.weaponAttack += 40;
					if (this.weaponAttack > 120 && !hasStatusEffect(StatusEffects.VolcanicFrenzy)) this.weaponAttack = 120;
					else if(this.weaponAttack > 400) this.weaponAttack = 400;
				}
			}
			if (hasStatusEffect(StatusEffects.VolcanicArmorRed)){

				addStatusValue(StatusEffects.VolcanicArmorRed, 1, -1);

				if (statusEffectv1(StatusEffects.VolcanicArmorRed) < 0) removeStatusEffect(StatusEffects.VolcanicArmorRed);
	            if (statusEffectv1(StatusEffects.VolcanicArmorRed) % 3 == 0 && hasStatusEffect(StatusEffects.VolcanicArmorRed)){
					addStatusValue(StatusEffects.VolcanicArmorRed, 2, -1);//reduce potency every 3 turns
					this.armorDef += 150;
					outputText("\nSome of the missing rock plates slide back up to the golem's exterior, defying gravity. Some of its defense has returned!\n");
				}
				if (statusEffectv1(StatusEffects.VolcanicArmorRed) < 0)
				{
					outputText("\nThe missing rock plates slide back up to the golem's exterior, defying gravity. Its defense has returned to normal.\n");
					removeStatusEffect.(StatusEffects.VolcanicArmorRed);
				}
			}

		    if (hasStatusEffect(StatusEffects.VolcanicFrenzy)) {
				addStatusValue(StatusEffects.VolcanicFrenzy, 1, -1);
				if (statusEffectv1(StatusEffects.VolcanicFrenzy) < 0)
				{
					removeStatusEffect(StatusEffects.VolcanicFrenzy);
					outputText("\nThe golem seems to calm down a bit, and the glow between the rock plates returns to their regular brightness.\n");
					this.weaponAttack = 120;
				}
			}

			if (hasStatusEffect(StatusEffects.Stunned)) {
				outputText("\nThe golem stands still, and the rock plates slowly slide back over the molten interior, defying gravity.\n");
				this.armorDef = 0;
				if (statusEffectv1(StatusEffects.Stunned) < 0)
				{
					removeStatusEffect(StatusEffects.Stunned);
					outputText("\nThe golem's armor fully envelops its body again, and the construct doesn't seem too happy over being stunned like that! The red hot glow between the rock plates grows even brighter, and the golem seems to become stronger!\n");
					createStatusEffect(StatusEffects.VolcanicFrenzy, 3, 0, 0, 0);
					this.weaponAttack = 400;
					this.armorDef = 300;
				}
				else addStatusValue(StatusEffects.Stunned, 1, -1);
				return;
			}

			if (hasStatusEffect(StatusEffects.VolcanicFistProblem))
			{
				if (findPerk(PerkLib.Resolute) >= 0) removePerk(PerkLib.Resolute);
				addStatusValue(StatusEffects.VolcanicFistProblem,1, -1);
			}else{
				removeStatusEffect(StatusEffects.VolcanicFistProblem);
				if (findPerk(PerkLib.Resolute) < 0) createPerk(PerkLib.Resolute, 0, 0, 0, 0);
			}

			if (this.armorDef < 0) this.armorDef = 0;
		}

	override public function doAI():void{
			volcanicStatus();
			if (distance != DISTANCE_MELEE){
				distanceAnger();
			}
			else if (!hasStatusEffect(StatusEffects.Stunned)){
				if (!hasStatusEffect(StatusEffects.Uber) && !hasStatusEffect(StatusEffects.VolcanicUberHEAL)){
				if (Math.round(flags[kFLAGS.VOLCANICGOLEMHP]/this.HP) >= 3 && rand(4) == 0) heal();
				else if (this.armorDef < 50 && rand(3) == 0) reinforce();
				else if ((rand(3) == 0 && !player.hasStatusEffect(StatusEffects.Stunned) && player.findPerk(PerkLib.Resolute) < 0) || (rand(5) == 0 && player.findPerk(PerkLib.Resolute) >= 0)) earthshatter();
				else if ((rand(10) == 0 && Math.round(flags[kFLAGS.VOLCANICGOLEMHP]/this.HP) >= 2) || rand(20) == 0 ) nuke();
				else eAttack();
				return;
				}else if (!hasStatusEffect(StatusEffects.VolcanicUberHEAL)) nuke();
				else heal();
			}

		}

		public function reinforce():void{
			outputText("\nThe Golem lets out a deafening roar and flashes brightly, turning pure white for a moment. After a brief moment, it returns to its previous glow, and you notice its armor is completely restored. ");
			this.armorDef = 300;

		}

		public function nuke():void {
			if (!hasStatusEffect(StatusEffects.Uber)) {
			    outputText("The golem curls up into a ball and starts glowing brightly. Maybe it's charging something.\n\n");
				createStatusEffect(StatusEffects.Uber, 0, 0, 0, 0);

				return;
			} else {
				//(Next Round)
				switch(statusEffectv1(StatusEffects.Uber)){
				case 0:
					addStatusValue(StatusEffects.Uber, 1, 1);
					outputText("\n\nThe monster grows even brighter, and you can barely manage to stand near it without being scorched by the extreme heat.");
					if (player.inte > 50) outputText("\nYou're not sure about continuing to fight.");

				    break;
				case 1:
					addStatusValue(StatusEffects.Uber, 1, 1);
					outputText("\n\nThe monster grows even brighter, and the light around him distorts massively due to the unthinkable heat.");
					if (player.inte > 50) outputText("\nYou should probably flee!");

				    break;
				case 2:
					//(AUTO-LOSE)
					outputText("\nThe golem suddenly rises with a mighty bellow, and the heat grows to a deadly level. A devastating heat wave expands outwards from the construct. It's too fast and too wide for you to dodge.\n\nYou're hit in full, but you don't have time to feel any pain. You're vaporized in less than a second, completely eliminated. The only thing that remains is your shadow, painted in the earth by the extreme thermal radiation that emanated from the golem.\n");
					outputText("The golem, somehow unfazed by its own attack, continues to wander aimlessly through the Volcanic Crag.\n");
					game.combat.monsterDamageType = game.combat.DAMAGE_FIRE;
					player.takeDamage(9999);
					game.volcanicCrag.volcanicGolemScene.volcanicGolemDead();
					break;
					}
				}
			}

		public function heal():void {
			if (!hasStatusEffect(StatusEffects.VolcanicUberHEAL)) {
			    outputText("The golem curls up into a ball and creates a shimmering shield around it. It seems to be preparing a lengthy spell of some kind.\n\n");
				createStatusEffect(StatusEffects.VolcanicUberHEAL, 2, 0, 0, 0);
				flags[kFLAGS.VOLCANICGOLEMSHIELDHP] = 100;

				return;
			} else {
				//(Next Round)
				if (statusEffectv1(StatusEffects.VolcanicUberHEAL) != 0) {
					addStatusValue(StatusEffects.VolcanicUberHEAL, 1, -1);
					outputText("\n\nThe shimmering shield continues to block your attacks\n");
					if (player.inte > 70) outputText("\nThe shield can absorb weaker strikes, but perhaps a single, strong enough strike will overpower it.");

				    return;
				} else {
					removeStatusEffect(StatusEffects.VolcanicUberHEAL);
					outputText("\nThe golem glows momentarily with a golden aura, and the shimmering shield dissipates. It seems to have healed itself!\n");
					this.HP += 2000;
					if (this.HP > flags[kFLAGS.VOLCANICGOLEMHP]) this.HP = flags[kFLAGS.VOLCANICGOLEMHP];

					return;
					}
				}
			}

		public function earthshatter():void {
			outputText("The fearsome golem unleashes a mighty bellow and stomps the ground with uncanny force! The earth cracks in your direction as the blast wave of its roar approaches quickly.\n");
			if (combatBlock(true)) {
				outputText("\nYou quickly position your [shield] in front of you and block most of the attack, only suffering a minor stumble.\n");

				return;
			}else if (player.stun(1,50)){
				outputText("\nNo amount of agility can help you dodge this enormous shockwave. You're hit, thrown forcefully to the ground, dazed and reeling. You are stunned.\n");

				return;
			}
			else {
				//Get hit
				var damage:int = str/2 + rand(10);
				damage = player.reduceDamage(damage,this);
				if (damage < 10) damage = 10;
				outputText("You're hit by the shockwave in full, but manage to balance yourself to not be thrown to the ground.");
				player.takeDamage(damage, true);
			}

		}

		public function VolcanicGolem()
		{
			this.a = "the ";
			this.short = "Volcanic Golem";
			this.imageName = "vgolem";
			this.long = "Before you stands a colossal construct of stone, easily 5 meters tall and almost two meters wide from shoulder to shoulder. Its body is composed of several rock plates of differing shapes and sizes. In the gap between the plates, you can see into the golem's interior, which is red hot, filled with what appears to be molten lava. Whenever it moves or attacks, magma spills from between the gaps, a result of the incredible pressure and weight  in every movement it performs.";
			// this.plural = false;
			initGenderless();
			createBreastRow(0);
			this.tallness = 9*12;
			this.skin.tone = "black";
			initStrTouSpeInte(125, 100, 80, 105);
			initLibSensCor(0, 0, 0);
			this.weaponName = "Stone Fists";
			this.weaponVerb="crush";
			this.weaponAttack = 120;
			this.armorName = "Rock Plates";
			this.armorDef = 300;
			this.fireRes = 0.2;
			this.bonusHP = flags[kFLAGS.VOLCANICGOLEMHP];
			this.lust = 0;
			this.lustVuln = 0;
			this.temperment = TEMPERMENT_LUSTY_GRAPPLES;
			this.level = 50;
			this.gems = 60 + rand(30);
			this.drop = NO_DROP;
			this.additionalXP = 2500;
			this.createPerk(PerkLib.PoisonImmune, 0, 0, 0, 0);
			this.createPerk(PerkLib.BleedImmune, 0, 0, 0, 0);
			this.createPerk(PerkLib.Resolute, 0, 0, 0, 0);
			//this.special3 = aerialRave;
			checkMonster();
		}

	}

}


code:
package classes.Scenes.Areas.VolcanicCrag
{
	import classes.*;
	import classes.GlobalFlags.kFLAGS;
	import classes.GlobalFlags.kGAMECLASS;
	import classes.GlobalFlags.kACHIEVEMENTS;

	public class VolcanicGolemScene extends BaseContent
	{

		public function VolcanicGolemScene()
		{
		}

		private function volcanicGolemMenu():void {
			menu();
			addButton(0, "Fight", startFight).hint("Challenge the colossus.");
			addButton(1, "Flee!", camp.returnToCampUseOneHour).hint("Those who fight and flee live to fight another day.");
		}

		public function volcanicGolemDead():void {
			game.gameOver();
		}

		public function volcanicGolemIntro():void {
			clearOutput();
			if (flags[kFLAGS.METVOLCANICGOLEM] <= 0) {
				flags[kFLAGS.VOLCANICGOLEMHP] = 10000;
				outputText("While traversing the desolate and swelting landscape of the volcanic crag, you feel the earth beneath your feet quake, and you almost fall to the ground. After regaining your balance, you look at the horizon, and notice a massive boulder that wasn't there moments ago.\n\n You decide to investigate. As you approach, you notice that it isn't a boulder at all, but a statue. You wonder how you could possibly have missed this curious piece of art, and, after another tremor, your question is answered. The monstrosity lights up with molten lava, turns around, and looks straight at you!\n\n Invader, the golem murmurs on a stoic tone, with a gravely voice. Obliterate.\n\n Looks like you have a fight on your hands!");
				flags[kFLAGS.METVOLCANICGOLEM] = 1;
				startCombat(new VolcanicGolem());
			}
			else {
				outputText("The ground beneath your [feet] shakes, and you know the Golem is nearby. Looking at the horizon, you see the lumbering monstrosity, cracking the earth with each of its massive steps.  You could try to finish it off, but it might be better to just hide from it.");
				volcanicGolemMenu();

		}
	}

		//Talk

		//Combat
		private function startFight():void {
			clearOutput();
			flags[kFLAGS.VOLCANICGOLEMHP] += 1000;
			if (flags[kFLAGS.VOLCANICGOLEMHP] > 10000) flags[kFLAGS.VOLCANICGOLEMHP] = 10000;//golem regains 1k health per encounter.
			outputText("Such a dangerous monster can't be allowed to roam free! You ready your [weapon] and charge the colossal foe.");
			startCombat(new VolcanicGolem());
		}

		public function winAgainstGolem():void {
			clearOutput();
			outputText("The Golem falls to its knees, and the magma inside its core cools down and turns pitch black, turning the construct into a black, smoking statue. You stay in combat stance for a few moments, but after a while, it looks like you have finally beaten the monster.\n");
			outputText("\n As you approach the now-paralyzed golem, it lights up again! Cannot function. Self Destructing. Wait, self destruct? You sprint away from the construct as fast as you can, and are thrown into the ground as the golem detonates in a massive, deafening burst of rock and lava.\n\nYou're thankfully intact, and as you look into the epicenter of the explosion, you see a huge, radiant ruby. Golden wisps shift and move within the gem, giving it an otherwordly look. Well, this may be worth something!");
			player.createKeyItem("Golem's Heart", 0, 0, 0, 0);
			flags[kFLAGS.DESTROYEDVOLCANICGOLEM] = 1;
			combat.cleanupAfterCombat();
		}

		public function loseToGolem():void {
			clearOutput();
			outputText("You fall to your knees, looking towards the ground, too weak to continue. Some part of you hopes that the construct may be able to grant you mercy, but reality approaches quickly. You feel its heat grows as it approaches you. You breathe one last time before the golem crushes you with a mighty, merciless stomp. You are dead.");
			game.gameOver();
		}

	}

}

license: unknown