code:
var Remtairy = Remtairy || {};
Remtairy.Version = Remtairy.Version || {};

//=============================================================================
 /*:
 * @plugindesc Version
 * @author Remtairy
 *
 * @help
 * This is a private plugin.
 * Do not redistribute, use, or modify this plugin
 * without explicit written permission from Remtairy.
 *
 */
//=============================================================================

const KARRYN_PRISON_GAME_VERSION = 49;

///////////
// Game Party
////////////////

//Game Version
Game_Party.prototype.getGameVersion = function() {
	return this._karrynPrisonVersion;
};

//Called at start of game in Common Event 2:Initialization
Game_Party.prototype.setCurrentGameVersion = function() {
	this._karrynPrisonVersion = KARRYN_PRISON_GAME_VERSION;
	this._karrynPrisonVersion36_TachieUpdated = true;
};

//Called when loading game by Common Event 3:Load Game
Game_Party.prototype.updateGameVersion = function() {
	let actor = $gameActors.actor(ACTOR_KARRYN_ID);
	actor._emoteMasterManagerIsRunning = false;

	if(this._karrynPrisonVersion < 2) {
		actor.resetParamExp();
		actor._paramExp[PARAM_MAXSTAMINA_ID] = Math.round(actor._paramExp[PARAM_MAXSTAMINA_ID] * 0.6);
		actor._paramExp[PARAM_MIND_ID] = Math.round(actor._paramExp[PARAM_MIND_ID] * 1.2);
		actor.calculateParamLvlsGained();
		actor.calculateMainLvlsGained();
		actor.clearParamExp();
	}

	if(this._karrynPrisonVersion < 3) {
		actor._firstAnalSexBeforePussySex = false;
	}

	if(this._karrynPrisonVersion < 5) {
		$gameParty.increaseCorruption(actor.totalAccessoriesOwnedCount());
		$gameSelfSwitches.setValue([MAP_ID_MODE_SELECT, 7, "A"], false);
		$gameSelfSwitches.setValue([MAP_ID_MODE_SELECT, 7, "B"], false);
		actor._flagNeverUnequippedDisappointmentTitle = true;
	}

	if(this._karrynPrisonVersion < 6) {
		if(actor._clothingType === CLOTHING_ID_NAKED && actor._clothingMaxStage === 1) {
			actor.changeToWardenClothing();
			actor.restoreClothingDurability();
		}
		if($gameParty._difficulty === 0) {
			if($gameSwitches.value(SWITCH_EASY_MODE_ID)) $gameParty.setDifficultyToEasy();
			else if($gameSwitches.value(SWITCH_NORMAL_MODE_ID)) $gameParty.setDifficultyToNormal();
			else if($gameSwitches.value(SWITCH_HARD_MODE_ID)) $gameParty.setDifficultyToHard();
		}
	}

	if(this._karrynPrisonVersion < 7) {
		let disTitle = $dataArmors[TITLE_ID_DISAPPOINTMENT];
		let numOfExtraDT = $gameParty.numItems(disTitle) - 1;
		if(numOfExtraDT > 0) {
			$gameParty.gainItem(disTitle, -1 * numOfExtraDT, false);
		}
	}

	if(this._karrynPrisonVersion < 14) {
		this.setMapForceCenter(false);
		actor.removeAllToys();
		actor._firstPussySexWasToy = false;

		actor.setupPlaythroughRecords();
		actor.recalculateSkillLvls();
		actor.recalculateBodySensitivities();
		actor.resetArtisanMeal();
		actor.cleanUpLiquids();

		this._playthroughRecordGuardBattleCount = this._recordGuardBattleCount;
		this.setBarReputation(0);
		this.initializeReceptionistSettings();
		this._wantedId_Tonkin = -1;
		this._wantedId_Yasu = -1;
		this._wantedId_Cargill = -1;

		actor._firstKissMapID = -1;
		actor._firstKissWasAnus = false;
		actor._firstPussySexMapID = -1;
		actor._firstAnalSexMapID = -1;
		actor._firstHandjobMapID = -1;
		actor._firstBlowjobMapID = -1;
		actor._firstTittyFuckMapID = -1;
		actor._firstCunnilingusMapID = -1;
		actor._firstButtSpankedMapID = -1;
		actor._firstSwallowMapID = -1;
		actor._firstBukkakeMapID = -1;
		actor._firstPussyCreampieMapID = -1;
		actor._firstAnalCreampieMapID = -1;
		actor._lastKissMapID = -1;
		actor._lastHandjobMapID = -1;
		actor._lastBlowjobMapID = -1;
		actor._lastTittyFuckMapID = -1;
		actor._lastCunnilingusMapID = -1;
		actor._lastButtSpankedMapID = -1;
		actor._lastPussySexMapID = -1;
		actor._lastAnalSexMapID = -1;
		actor._lastBukkakeMapID = -1;
		actor._lastSwallowMapID = -1;
		actor._lastPussyCreampieMapID = -1;
		actor._lastAnalCreampieMapID = -1;

		actor._firstRimjobWantedID = -1;
		actor._firstRimjobDate = false;
		actor._firstRimjobName = false;
		actor._firstRimjobMapID = -1;
		actor._lastRimjobName = false;
		actor._lastRimjobDate = false;
		actor._lastRimjobMapID = -1;
		actor._recordRimjobCount = 0;
		actor._recordRimjobPeople = 0;

		actor._firstFootjobWantedID = -1;
		actor._firstFootjobDate = false;
		actor._firstFootjobName = false;
		actor._firstFootjobMapID = -1;
		actor._lastFootjobName = false;
		actor._lastFootjobDate = false;
		actor._lastFootjobMapID = -1;
		actor._recordFootjobCount = 0;
		actor._recordFootjobPeople = 0;
		actor._recordBukkakeLegsML = 0;

		actor._recordManuallyRemovedToysTotalCount = 0;
		actor._recordManuallyRemovedClitToyCount = 0;
		actor._recordManuallyRemovedPussyToyCount = 0;
		actor._recordManuallyRemovedAnalToyCount = 0;
		actor._recordTotalToysInsertedCount = 0;
		actor._recordClitToyInsertedCount = 0;
		actor._recordPussyToyInsertedCount = 0;
		actor._recordAnalToyInsertedCount = 0;
		actor._recordTotalToysUsedByEnemyCount = 0;
		actor._recordClitToyUsedByEnemyCount = 0;
		actor._recordPussyToyUsedByEnemyCount = 0;
		actor._recordAnalToyUsedByEnemyCount = 0;
		actor._baseToyLvl = 1;
		actor._recordToysPleasure = 0;
		actor._recordToysInsertedByPeople = 0;
		actor._recordOrgasmFromToysCount = 0;
		actor._recordDebuffOffBalancedCount = 0;
		actor._recordDebuffFallenCount = 0;
		actor._recordDebuffDisarmedCount = 0;
		actor._recordDebuffDownStaminaCount = 0;
		actor._recordHornyCount = 0;
		actor._recordFixClothesUsageCount = 0;
		actor._recordCockKickUsageCount = 0;
		actor._recordKissUsageCount = 0;
		actor._recordCockPetUsageCount = 0;
		actor._recordHandjobUsageCount = 0;
		actor._recordBlowjobUsageCount = 0;
		actor._recordRimjobUsageCount = 0;
		actor._recordFootjobUsageCount = 0;
		actor._recordTittyFuckUsageCount = 0;
		actor._recordPussySexUsageCount = 0;
		actor._recordAnalSexUsageCount = 0;
		actor._recordFlauntCount = 0;
		actor._recordFlauntPeople = 0;
		actor._recordSexPose_KickCounterCount = 0;
		actor._recordBarWaitressBattleCount = 0;
		actor._recordBarWaitressSexCount = 0;
		actor._recordCockinessGainedValue = 0;
		actor._recordVirginitiesTakenTotal = 0;
		actor._recordVirginitiesTakenViaPussy = 0;
		actor._recordVirginitiesTakenViaAnal = 0;
		actor._recordSexPose_SlimePiledriverCount = 0;
		actor._recordSexualPartnersNerd = 0;
		actor._recordSexualPartnersRogue = 0;
		actor._recordSexualPartnersSlime = 0;

		actor._recordSexualPartnersTotal = actor._recordSexualPartnersThug + actor._recordSexualPartnersPrisoner + actor._recordSexualPartnersGuard + actor._recordSexualPartnersOrc + actor._recordSexualPartnersGoblin;

		actor._flagEquippedHellWardenOneTitleForWholeDay = false;
		actor._flagEquippedHellWardenTwoTitleForWholeDay = false;

		actor.setTachieHatInFrontOfBody(true);

		for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
			$gameParty._wantedEnemies[i]._disabled = false;
		}
		while(this.fixDuplicateWanted());

		this.fixWantedWithUndefinedBattlernum();
		this.update_addToAllWanted_Records_v8();
		this.update_setActorPassivesObtainedOnArray();
		this.update_removeOffAndDefHalberdEdicts();

		actor.forgetSkill(PASSIVES_TITLE_LEFT_ID);
		actor.forgetSkill(PASSIVES_TITLE_CENTER_ID);
		actor.forgetSkill(PASSIVES_TITLE_RIGHT_ID);
		actor.learnSkill(SKILL_DEBUG_SURRENDER_ID);
		actor.learnSkill(SKILL_DEBUG_DEFEAT_ALL_ID);
		actor.learnSkill(SKILL_DEBUG_STRIP_CLOTHES_ID);
		actor.learnSkill(SKILL_KARRYN_KISS_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_KARRYN_HANDJOB_SELECTOR_CANT_ID);
		actor.learnSkill(63);
		actor.learnSkill(64);
		actor.learnSkill(103);
		actor.learnSkill(104);
		actor.learnSkill(SKILL_KARRYN_FLAUNT_ID);
		actor.learnSkill(SKILL_FALLEN_REST_ID);
		actor.learnSkill(SKILL_KARRYN_KICK_STRIKE_ID);
		actor.learnSkill(SKILL_KARRYN_KICK_SLASH_ID);
		actor.learnSkill(SKILL_KARRYN_KICK_THRUST_ID);
		actor.learnSkill(SKILL_KARRYN_PICK_UP_HALBERD_ID);
		actor.learnSkill(SKILL_KARRYN_GET_CLOSER_TO_HALBERD_ID);
		actor.learnSkill(SKILL_GIVE_UP_ID);
		actor.learnSkill(SKILL_SURRENDER_ID);
		actor.learnSkill(SKILL_KARRYN_REMOVE_TOY_ID);
		actor.learnSkill(SKILL_KARRYN_COCK_PETTING_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_COCK_PETTING_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_KARRYN_RIMJOB_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_RIMJOB_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_KARRYN_FOOTJOB_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_FOOTJOB_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_KARRYN_BLOWJOB_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_BLOWJOB_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_KARRYN_TITTYFUCK_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_TITTYFUCK_SELECTOR_CANT_ID);

		if($gameSwitches.value(SWITCH_WON_BOSS_BATTLE_LV1_ID) && Prison.prisonLevelOneIsAnarchy()) {
			Prison.firstSubjugationPrisonLevelOne();
		}
		this._prisonLevelOne_workshopRioting = false;
		this._prisonLevelOne_dishwashingRioting = false;
		this._prisonLevelOne_laundryRioting = false;
		this._prisonLevelOne_receptionRioting = false;

	}

	if(this._karrynPrisonVersion < 15) {
		this._wantedEnemies.unshift(new Wanted_Enemy(false));

		if(this._wantedId_Tonkin === -1 || this._wantedId_Tonkin === undefined) {
			let foundWanted = -1;
			if(TextManager.isJapanese) {
				foundWanted = $gameParty.isThisNameAlreadyInWanted_onlyNameMatters("トンキン");
			}
			else if(TextManager.isEnglish) {
				foundWanted = $gameParty.isThisNameAlreadyInWanted_onlyNameMatters("Tonkin");
			}
			this._wantedId_Tonkin = foundWanted;
		}
		if(this._wantedId_Yasu === -1 || this._wantedId_Yasu === undefined) {
			let foundWanted = -1;
			if(TextManager.isJapanese) {
				foundWanted = $gameParty.isThisNameAlreadyInWanted_onlyNameMatters("ヤス");
			}
			else if(TextManager.isEnglish) {
				foundWanted = $gameParty.isThisNameAlreadyInWanted_onlyNameMatters("Yasu");
			}
			this._wantedId_Yasu = foundWanted;
		}
		if(this._wantedId_Cargill === -1 || this._wantedId_Cargill === undefined) {
			let foundWanted = -1;
			if(TextManager.isJapanese) {
				foundWanted = $gameParty.isThisNameAlreadyInWanted_onlyNameMatters("カーギル");
			}
			else if(TextManager.isEnglish) {
				foundWanted = $gameParty.isThisNameAlreadyInWanted_onlyNameMatters("Cargill");
			}
			this._wantedId_Cargill = foundWanted;
		}
	}

	if(this._karrynPrisonVersion < 16) {
		for(let i = 1; i < this._wantedEnemies.length; i++) {
			let wantedEnemy = this._wantedEnemies[i];
			wantedEnemy._wantedId += 1;
		}
	}

	if(this._karrynPrisonVersion < 17) {
		actor._recordSeenAnalCount = 0;
		if($gameVariables.value(VARIABLE_BEAT_LEVEL_ID) === 1 && $gameSwitches.value(SWITCH_WON_BOSS_BATTLE_LV1_ID)) {
			$gameSelfSwitches.setValue([MAP_ID_RECEPTION, 32, "A"], true);
		}
		for(let i = WAITRESS_SKILL_START; i <= WAITRESS_SKILL_END; i++) {
			actor.learnSkill(i);
		}

	}

	if(this._karrynPrisonVersion < 18) {
		actor.learnSkill(SKILL_GIVE_UP_ID);
		actor.learnSkill(SKILL_SURRENDER_ID);
	}

	if(this._karrynPrisonVersion < 18) {
		actor.learnSkill(SKILL_GIVE_UP_ID);
		actor.learnSkill(SKILL_SURRENDER_ID);
	}

	if(this._karrynPrisonVersion < 19) {
		for(let i = 1; i < this._wantedEnemies.length; i++) {
			let wantedEnemy = this._wantedEnemies[i];
			if(!wantedEnemy._enemyType) wantedEnemy._disabled = true;
		}
	}

	if(this._karrynPrisonVersion < 21) {
		if(this.order === null) {
			this.setOrder(50);
		}
	}

	if(this._karrynPrisonVersion < 22) {
		this._prisonLevelOne_riotingDays = 0;
		this._prisonLevelTwo_riotingDays = 0;
		this._prisonLevelThree_riotingDays = 0;
		this._prisonLevelFour_riotingDays = 0;
		this._prisonLevelFive_riotingDays = 0;
	}

	if(this._karrynPrisonVersion < 23) {
		actor.resetTachieCockAnal();
		actor._dontResetSexPose = false;
	}

	if(this._karrynPrisonVersion < 24) {

		$gameSelfSwitches.setValue([MAP_ID_OFFICE_FLOODED, 12, "A"], true);
	}

	if(this._karrynPrisonVersion < 25) {
		actor.cleanUpLiquids();
	}

	if(this._karrynPrisonVersion < 26) {
		if($gameSwitches.value(SWITCH_GIFT_EMPEROR_LV2_ID)) {
			$gameSelfSwitches.setValue([MAP_ID_OFFICE_FLOODED, 12, "A"], true);
			$gameSwitches.setValue(SWITCH_WON_BOSS_BATTLE_LV2_ID, true);
		}
		else {
			$gameSelfSwitches.setValue([MAP_ID_OFFICE_FLOODED, 12, "A"], false);
			$gameSwitches.setValue(SWITCH_WON_BOSS_BATTLE_LV2_ID, false);
		}

	}

	if(this._karrynPrisonVersion < 27) {
		$gameSystem.setAutosave(true);
	}

	if(this._karrynPrisonVersion < 28) {
		if(Karryn.hasEdict(EDICT_THE_GOBLIN_PROBLEM))
			this.increaseOrderChangePerDay(-2);
		if(Karryn.hasEdict(EDICT_ANTI_GOBLIN_SQUAD))
			this.increaseOrderChangePerDay(2);
		if(Karryn.hasEdict(EDICT_BAIT_GOBLINS))
			this.increaseOrderChangePerDay(2);
	}

	if(this._karrynPrisonVersion < 29) {
		actor._firstPussySexWasToyWantedID = -1;
		actor._firstPussySexWasToyDate = false;
		actor._firstPussySexWasToyName = false;
		actor._firstPussySexWasToyMapID = -1;
	}

	if(this._karrynPrisonVersion < 30) {
		if(Karryn.hasEdict(EDICT_REPAIR_KITCHEN_AND_MESS_HALL))
			this.increaseOrderChangePerDay(2);
	}

	if(this._karrynPrisonVersion < 31) {
		this._daysWithoutDoingWaitressBar = 0;
		actor.calculateMainLvlsGained();
		actor.clearParamExp();
		this.fix_setActorPassivesObtainedOnArray_missingCharacterCreators();
	}

	if(this._karrynPrisonVersion < 32) {
		actor._hasTachiePubic = true;
	}

	if(this._karrynPrisonVersion < 33) {
		if(actor._obtainedTitles) {
			if(!$gameParty.hasItem($dataArmors[TITLE_ID_EFFICIENT_ADMINSTRATOR], true) && actor._obtainedTitles[TITLE_ID_EFFICIENT_ADMINSTRATOR])
				actor._obtainedTitles[TITLE_ID_EFFICIENT_ADMINSTRATOR] = false;
			if(!$gameParty.hasItem($dataArmors[TITLE_ID_CORRUPTED_OFFICIAL], true) && actor._obtainedTitles[TITLE_ID_CORRUPTED_OFFICIAL])
				actor._obtainedTitles[TITLE_ID_CORRUPTED_OFFICIAL] = false;
			if(!$gameParty.hasItem($dataArmors[TITLE_ID_CORPORAL_PUNISHER], true) && actor._obtainedTitles[TITLE_ID_CORPORAL_PUNISHER])
				actor._obtainedTitles[TITLE_ID_CORPORAL_PUNISHER] = false;
			if(!$gameParty.hasItem($dataArmors[TITLE_ID_CAREFUL_SUPERVISOR], true) && actor._obtainedTitles[TITLE_ID_CAREFUL_SUPERVISOR])
				actor._obtainedTitles[TITLE_ID_CAREFUL_SUPERVISOR] = false;
			if(!$gameParty.hasItem($dataArmors[TITLE_ID_WORKAHOLIC], true) && actor._obtainedTitles[TITLE_ID_WORKAHOLIC])
				actor._obtainedTitles[TITLE_ID_WORKAHOLIC] = false;
			if(!$gameParty.hasItem($dataArmors[TITLE_ID_CORNERCUTTING_EMPLOYER], true) && actor._obtainedTitles[TITLE_ID_CORNERCUTTING_EMPLOYER])
				actor._obtainedTitles[TITLE_ID_CORNERCUTTING_EMPLOYER] = false;
		}
	}

	if(this._karrynPrisonVersion < 34) {
		actor._liquidBukkakeButtTopRight = 0;
		actor._liquidBukkakeButtTopLeft = 0;
		actor._liquidBukkakeButtBottomRight = 0;
		actor._liquidBukkakeButtBottomLeft = 0;
		actor._recordUrinalCount = 0;
		actor._tempRecordUrinal = false;
		actor.resetTachieSemenCockMouthExtension();
		actor.resetTachieSemenCockPussyExtension();
		actor.resetTachieSemenCockAnalExtension();
		actor.resetTachieSemenFrontAExtension();
		actor.resetTachieSemenFrontBExtension();
		actor.resetTachieSemenFrontCExtension();
		actor.resetTachieSemenFrontDExtension();
		actor.resetTachieSemenFrontEExtension();
		this.recalculateBaseIncomeAndExpense();
	}

	if(this._karrynPrisonVersion < 35) {
		actor.resetTachieClothes();
		actor.resetTachieSkirt();
		actor._toyValue_clitToy = 0;
		actor._toyValue_pussyToy = 0;
		actor._toyValue_analToy = 0;
		actor.setMaxTachieSemenDeskId(0);
		actor._liquidOnDesk = 0;

		actor._recordSexPose_GuardGangbangCount = 0;
		actor._flagEquippedFullOrderTwoTitleForWholeDay = false;
		actor._lastMentalBattleSkill = new Game_Item();

		for(let i = 1059; i <= 1064; i++) {
			actor.learnSkill(i);
		}
		actor.forgetSkill(64);
		actor.forgetSkill(65);
		actor.forgetSkill(66);
		actor.forgetSkill(67);
		actor.forgetSkill(68);

		actor._firstKissWasVisitor = false;
		actor._recordVisitorReceptionistBattleCount = 0;
		actor._playthroughRecordVisitorReceptionistBattleCount = 0;
		actor._playthroughRecordReceptionistBattleTotalShiftsCount = 0;
		actor._recordSexualPartnersVisitor = 0;
		actor._playthroughRecordReceptionistHandshakePeople = 0;
		actor._playthroughRecordReceptionistBoobshakePeople = 0;
		actor._recordVisitorReceptionistHandshakeCount = 0;
		actor._recordVisitorReceptionistHandshakePeople = 0;
		actor._playthroughRecordReceptionistHandjobPeople = 0;
		actor._playthroughRecordReceptionistBlowjobPeople = 0;
		actor._recordVisitorReceptionistKissPeople = 0;
		actor._playthroughRecordReceptionistKissPeople = 0;
		actor._recordVisitorReceptionistBoobshakeCount = 0;
		actor._recordVisitorReceptionistBoobshakePeople = 0;
		actor._recordVisitorReceptionistHandjobPeople = 0;
		actor._recordVisitorReceptionistBlowjobPeople = 0;
		actor._playthroughRecordVisitorSwallowML = 0;
		actor._playthroughRecordReceptionistGoblinCreampieML = 0;

		this.initializeReceptionistSettings();
		this._daysWithoutDoingVisitorReceptionist = 0;

		actor.putOnGlovesAndHat();
		if(actor.isInMapPose()) {
			actor.setWardenMapPose();
		}

		for(let i = RECEPTIONIST_SKILL_START; i <= RECEPTIONIST_SKILL_END; i++) {
			actor.learnSkill(i);
		}
	}

	if(this._karrynPrisonVersion < 36) {
		actor.recalculateBodySensitivities();
		actor.recalculateSkillLvls();
		actor.setHalberdAsDefiled(false);

		actor.learnSkill(SKILL_KARRYN_COCK_STARE_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_COCK_STARE_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_FEMALE_ORGASM_ONE_ID);
		actor.learnSkill(SKILL_FEMALE_ORGASM_TWO_ID);

		actor._playthroughRecordReceptionistPagesProcessedCount = 0;
		actor._playthroughRecordReceptionistHandshakeWhileSexPeople = 0;
		actor._playthroughRecordReceptionistOrgasmWhileCallingCount = 0;
		actor._playthroughRecordWaitressServingPettedCount = 0;
		actor._playthroughRecordWaitressServingOrgasmCount = 0;
		actor._playthroughRecordWaitressBattleDrankSemenMugML = 0;

		actor._recordPettedWhileWorkingCount = 0;
		actor._recordWaitressFlashedCount = 0;
		actor._recordSeeEnemyTalkCockCount = 0;
		actor._recordSeeJerkOffPeople = 0;
		actor._recordSeeEnemyTalkCockPeople = 0;
		actor._recordCockStareUsageCount = 0;
		actor._recordOrgasmFromSpankingCount = 0;

		actor._recordSubduedMetalEnemies = 0;
		actor._recordMetalSexualPartnersCount = 0;

		actor.resetTodayVariables();

		this.update_addToAllWanted_Records_v36();

		if(actor.isInMapPose()) actor.emoteMapPose();
		this._karrynPrisonVersion36_TachieUpdated = true;
	}

	if(this._karrynPrisonVersion < 37) {
		actor.learnSkill(1579);
		actor.learnSkill(SKILL_RESTORE_MIND_ID);
		if(this._dayCount % 2 === 1) {
			$gameSwitches.setValue(SWITCH_ODD_DAY_ID, true);
			$gameSwitches.setValue(SWITCH_EVEN_DAY_ID, false);
		}
		else {
			$gameSwitches.setValue(SWITCH_EVEN_DAY_ID, true);
			$gameSwitches.setValue(SWITCH_ODD_DAY_ID, false);
		}
		if(Karryn.hasEdict(EDICT_RECEPTIONIST_OUTFIT_I))
			$gameSwitches.setValue(SWITCH_EDICT_RECEPTIONIST_OUTFIT_ID, true);

	}

	if(this._karrynPrisonVersion < 38) {
		actor.learnSkill(SKILL_SKEWER_2_ID);
		actor.learnSkill(SKILL_SLAM_2_ID);
		actor._flagEquippedRadioOrgasmTitleForWholeDay = false;

	}

	if(this._karrynPrisonVersion < 39) {
		if(Karryn.isInReceptionistPose()) {
			actor.setWardenMapPose();
			actor.setKarrynWardenSprite();
		}
	}

	if(this._karrynPrisonVersion < 40) {
		actor._flagEquippedJadeNecklaceForWholeDay = false;
	}

	if(this._karrynPrisonVersion < 41) {
		for(let i = GLORY_SKILL_START; i <= GLORY_SKILL_END; i++) {
			actor.learnSkill(i);
		}

		actor.resetTachieTie();
		actor.resetTachieLeftHole();
		actor.resetTachieRightHole();
		actor.resetTachieLegs();
		actor.resetTachiePubicExtension();
		actor.resetTachieSemenMouthExtension();
		actor.resetStoreItem();

		if(!Prison.prisonLevelOneIsRioting()) {
			Karryn.learnSkill(EDICT_LEVEL_ONE_IS_NOT_RIOTING);
		}

		actor.learnSkill(SKILL_LIGHT_KICK_ID);
		actor.learnSkill(SKILL_KARRYN_ANALSEX_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_ANALSEX_SELECTOR_CANT_ID);
		actor.learnSkill(SKILL_KARRYN_PUSSYSEX_SELECTOR_ID);
		actor.learnSkill(SKILL_KARRYN_PUSSYSEX_SELECTOR_CANT_ID);
		actor.learnSkill(EDICT_SPECIALIZATION_EXPLANATION);
		actor.learnSkill(EDICT_INSURANCE_EXPLANATION_1);
		actor.learnSkill(EDICT_INSURANCE_EXPLANATION_2);
		actor.learnSkill(EDICT_NO_CLASSES);
		actor.learnSkill(EDICT_RECEPTION_POLICY_NEUTRAL);

		this.setGloryReputation(0);
		this._daysWithoutVisitingGlory = 0;
		this._enableResearchEdicts = false;
		this._daysSinceLastPrisonRiot = 0;
		this._daysSinceLastLevelOneRiot = 0;
		this._daysSinceLastLevelTwoRiot = 0;
		this._daysSinceLastLevelThreeRiot = 0;
		this._daysSinceLastLevelFourRiot = 0;
		this._daysSinceLastLevelFiveRiot = 0;
		this._prisonLevelTwo_meetingRoomRioting = false;
		this._prisonLevelTwo_researchRioting = false;
		this._prisonLevelTwo_staffLoungeRioting = false;
		this._prisonLevelTwo_classroomRioting = false;
		this._prisonLevelTwo_readingRoomRioting = false;
		this._wantedId_Aron = -1;

		actor._baseSemenLvl = 0;
		actor._baseStripLvl = 0;
		actor._recordSexualPartnersLizardman = 0;
		actor._recordSexualPartnersHomeless = 0;
		actor._recordSexPose_OrcPaizuriCount = 0;
		actor._recordSexPose_LizardmanCowgirlCount = 0;
		actor._recordGloryBattleCockHandledCount = 0;
		actor._recordGloryBattleCockEjaculationCount = 0;
		actor._playthroughRecordGloryCocksAppearedCount = 0;
		actor._playthroughRecordGloryCocksServed = 0;
		actor._playthroughRecordGloryOrgasmWhileGuestEatingCount = 0;
		actor._playthroughRecordGloryCreampieML = 0;
		actor._playthroughRecordGlorySwallowML = 0;
		actor._recordPreLevelFourOldSexualPartners = 0;
		actor._recordPostLevelThreeNewSexualPartners = 0;

		actor._recordSexPose_KickCounterCount = Math.min(actor._recordSexPose_KickCounterCount,LIMIT_KICK_COUNTER_SEX_COUNT);

		this.update_addToAllWanted_Records_v41();

		if($gameSwitches.value(SWITCH_WON_BOSS_BATTLE_LV2_ID) && Prison.prisonLevelTwoIsAnarchy()) {
			Prison.firstSubjugationPrisonLevelTwo();
		}

		if(actor._firstPussySexWantedID === -1) {
			$gameSwitches.setValue(SWITCH_IS_VIRGIN_ID, true);
			$gameSwitches.setValue(SWITCH_IS_NON_VIRGIN_ID, false);
		}
		else {
			$gameSwitches.setValue(SWITCH_IS_VIRGIN_ID, false);
			$gameSwitches.setValue(SWITCH_IS_NON_VIRGIN_ID, true);
		}

		if(Karryn.hasEdict(EDICT_REPAIR_OFFICE)) {
			$gameSwitches.setValue(SWITCH_EDICT_FIX_OFFICE_ID, true);
		}
		if(Karryn.hasEdict(EDICT_REPAIR_STORE)) {
			$gameSwitches.setValue(SWITCH_EDICT_FIX_STORE_ID, true);
		}
	}

	if(this._karrynPrisonVersion < 42) {
		if(Prison.prisonLevelTwoIsRioting()) {
			this.setPrisonLevelTwoSubjugated();
			this._prisonLevelTwo_riotingDays = 0;
		}
	}

	if(this._karrynPrisonVersion < 43) {
		if(Karryn.hasEdict(EDICT_SPEC_CLEAVE_POWER) && Karryn.hasEdict(EDICT_SPEC_CLEAVE_TECH)) {
			actor.forgetSkill(EDICT_SPEC_CLEAVE_POWER);
			actor.forgetSkill(EDICT_SPEC_CLEAVE_TECH);
		}
	}

	if(this._karrynPrisonVersion < 44) {
		actor.setMaxTachieSemenMouthId(0);
	}

	if(this._karrynPrisonVersion < 45) {
		actor.forgetPassive(241);
		actor.forgetPassive(243);
	}

	if(this._karrynPrisonVersion < 46) {
		$gameParty.postRiotBattleCleanup();
		this._prisonLevelOne_anarchyDays = 0;
		this._prisonLevelTwo_anarchyDays = 0;
		this._prisonLevelThree_anarchyDays = 0;
		this._prisonLevelFour_anarchyDays = 0;
		this._prisonLevelFive_anarchyDays = 0;
	}

	if(this._karrynPrisonVersion < 47) {
		if(Karryn.hasEdict(EDICT_RESEARCH_LAUNDRY_PRODUCT_CONTRACT))
			$gameSwitches.setValue(82, true);
	}

	if(this._karrynPrisonVersion < 48) {
		actor.forgetPassive(241);
		actor.forgetPassive(243);
		actor.forgetPassive(844);
		actor._recordPussyPettedCount = Math.min(actor._recordPussyPettedCount, LIMIT_PUSSY_PETTED_COUNT);
		actor._recordDebuffFallenCount = Math.min(actor._recordDebuffFallenCount, LIMIT_DEBUFF_FALLEN_COUNT);

		this._levelOneBonusGracePeriod = 0;
		this._levelTwoBonusGracePeriod = 0;
		this._levelThreeBonusGracePeriod = 0;
		this._levelFourBonusGracePeriod = 0;
		this._levelFiveBonusGracePeriod = 0;

		this.recalculateBaseOrderChange();
	}

	if(this._karrynPrisonVersion < 49) {
		this.recalculateBaseOrderChange();
	}

	this.setCurrentGameVersion();
};

//Called when loading game
Game_Party.prototype.emergencyGameVersionFix = function() {

	if(this._karrynPrisonVersion < 43) {
		if(Karryn.hasEdict(EDICT_OFFICE_BED_UPGRADE_THREE)) {
			let mapId = $gameMap._mapId;
			if(mapId === MAP_ID_KARRYN_OFFICE && $gameSwitches.value(SWITCH_WON_BOSS_BATTLE_LV3_ID) && !$gameSwitches.value(SWITCH_GIFT_EMPEROR_LV3_ID)) {
				$gamePlayer.reserveTransfer(MAP_ID_KARRYN_OFFICE, 11, 8, 0, 0);
			}
		}
	}

};

/////////
// Fixes
///////////

Game_Party.prototype.fixDuplicateWanted = function() {
	let actor = $gameActors.actor(ACTOR_KARRYN_ID);
	let namesCount = this.putAllWantedNamesToNamesCountArray();
	//console.log(namesCount);
	//console.log($gameParty._wantedEnemies);
	let dupeName = false;
	for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
		let wanted = $gameParty._wantedEnemies[i];
		let name = wanted._enemyName;
		if(namesCount[name] > 1) {
			dupeName = name;
			break;
		}
	}

	//console.log(dupeName);
	if(dupeName) {
		let dupeIds = [];
		for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
			let wanted = $gameParty._wantedEnemies[i];
			let name = wanted._enemyName;
			if(name == dupeName) {
				dupeIds.push(wanted._wantedId);
			}
		}

		let masterId = dupeIds[0];
		for(let i = 1; i < dupeIds.length; ++i) {
			let dupedId = dupeIds[i];
			if(actor._firstKissWantedID === dupedId) actor._firstKissWantedID = masterId;
			if(actor._firstPussySexWantedID === dupedId) actor._firstPussySexWantedID = masterId;
			if(actor._firstAnalSexWantedID === dupedId) actor._firstAnalSexWantedID = masterId;
			if(actor._firstHandjobWantedID === dupedId) actor._firstHandjobWantedID = masterId;
			if(actor._firstBlowjobWantedID === dupedId) actor._firstBlowjobWantedID = masterId;
			if(actor._firstTittyFuckWantedID === dupedId) actor._firstTittyFuckWantedID = masterId;
			if(actor._firstCunnilingusWantedID === dupedId) actor._firstCunnilingusWantedID = masterId;
			if(actor._firstButtSpankedWantedID === dupedId) actor._firstButtSpankedWantedID = masterId;
			if(actor._firstSwallowWantedID === dupedId) actor._firstSwallowWantedID = masterId;
			if(actor._firstBukkakeWantedID === dupedId) actor._firstBukkakeWantedID = masterId;
			if(actor._firstPussyCreampieWantedID === dupedId) actor._firstPussyCreampieWantedID = masterId;
			if(actor._firstAnalCreampieWantedID === dupedId) actor._firstAnalCreampieWantedID = masterId;

			$gameParty._wantedEnemies[dupedId]._disabled = true;
		}

	}

	if(dupeName) return true;
	else return false;
};

Game_Party.prototype.fixWantedWithUndefinedBattlernum = function() {
	for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
		let wanted = $gameParty._wantedEnemies[i];

		if(wanted && wanted._battlerName && wanted._battlerName.includes('undefined')) {
			wanted._disabled = true;
		}
	}

};

Game_Party.prototype.fixCharacterCreatorSwitches = function() {
	console.log('fixCharacterCreatorSwitches');
	let actor = $gameActors.actor(ACTOR_KARRYN_ID);

	if(!actor.hasSkill(CHARA_CREATE_TWO_BOOBS_ID) && !actor.hasSkill(CHARA_CREATE_TWO_NIPPLES_ID) && !actor.hasSkill(CHARA_CREATE_TWO_CLIT_ID) && !actor.hasSkill(CHARA_CREATE_TWO_PUSSY_ID) && !actor.hasSkill(CHARA_CREATE_TWO_BUTT_ID) && !actor.hasSkill(CHARA_CREATE_TWO_ANAL_ID) && !actor.hasSkill(CHARA_CREATE_TWO_MOUTH_ID) && !actor.hasSkill(CHARA_CREATE_TWO_PETTING_ID)) {
		$gameSwitches.setValue(SWITCH_CREATOR_STEP_2_COMPLETED_ID, false);
	}
	else {
		console.log(actor.hasSkill(CHARA_CREATE_TWO_BOOBS_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_NIPPLES_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_CLIT_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_PUSSY_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_BUTT_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_ANAL_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_MOUTH_ID));
		console.log(actor.hasSkill(CHARA_CREATE_TWO_PETTING_ID));
	}

	if(!actor.hasSkill(CHARA_CREATE_THREE_MOUTH_ID) && !actor.hasSkill(CHARA_CREATE_THREE_BOOBS_ID) && !actor.hasSkill(CHARA_CREATE_THREE_PUSSY_ID) && !actor.hasSkill(CHARA_CREATE_THREE_BUTT_ID) && !actor.hasSkill(CHARA_CREATE_THREE_ONANI_ID) && !actor.hasSkill(CHARA_CREATE_THREE_SADO_ID) && !actor.hasSkill(CHARA_CREATE_THREE_MAZO_ID)) {
		$gameSwitches.setValue(SWITCH_CREATOR_STEP_3_COMPLETED_ID, false);
		console.log('call 2');
	}
	else {
		console.log(actor.hasSkill(CHARA_CREATE_THREE_MOUTH_ID));
		console.log(actor.hasSkill(CHARA_CREATE_THREE_BOOBS_ID));
		console.log(actor.hasSkill(CHARA_CREATE_THREE_PUSSY_ID));
		console.log(actor.hasSkill(CHARA_CREATE_THREE_BUTT_ID));
		console.log(actor.hasSkill(CHARA_CREATE_THREE_ONANI_ID));
		console.log(actor.hasSkill(CHARA_CREATE_THREE_SADO_ID));
		console.log(actor.hasSkill(CHARA_CREATE_THREE_MAZO_ID));
	}
};

// Updates
Game_Party.prototype.update_addToAllWanted_Records_v8 = function() {
	for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
		let wanted = $gameParty._wantedEnemies[i];
		if(!wanted._enemyRecordToysInsertedCount)
			wanted._enemyRecordToysInsertedCount = 0;
		if(!wanted._enemyRecordFlauntedCount)
			wanted._enemyRecordFlauntedCount = 0;
		if(!wanted._enemyRecordRimmedCount)
			wanted._enemyRecordRimmedCount = 0;
		if(!wanted._enemyRecordFootjobCount)
			wanted._enemyRecordFootjobCount = 0;

	}
};

Game_Party.prototype.update_addToAllWanted_Records_v36 = function() {
	for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
		let wanted = $gameParty._wantedEnemies[i];
		if(!wanted._enemyRecordTalkCockCount)
			wanted._enemyRecordTalkCockCount = 0;
		if(!wanted._enemyRecordHandshakeCount)
			wanted._enemyRecordHandshakeCount = 0;
		if(!wanted._enemyRecordBoobshakeCount)
			wanted._enemyRecordBoobshakeCount = 0;
		if(!wanted._enemyRecordSawCount)
			wanted._enemyRecordSawCount = 0;
		if(!wanted._enemyRecordTalkedCount)
			wanted._enemyRecordTalkedCount = 0;
		if(!wanted._enemyRecordJerkoffCount)
			wanted._enemyRecordJerkoffCount = 0;
		if(!wanted._enemyRecordTauntedCount)
			wanted._enemyRecordTauntedCount = 0;
		if(!wanted._enemyRecordFingerSuckedCount)
			wanted._enemyRecordFingerSuckedCount = 0;
		if(!wanted._enemyRecordCockPettedCount)
			wanted._enemyRecordCockPettedCount = 0;
		if(!wanted._enemyRecordHandshakeWhileSexCount)
			wanted._enemyRecordHandshakeWhileSexCount = 0;
	}
};

Game_Party.prototype.update_addToAllWanted_Records_v41 = function() {
	for(let i = 0; i < $gameParty._wantedEnemies.length; ++i) {
		let wanted = $gameParty._wantedEnemies[i];
		if(!wanted._enemyRecordGloryBattleEjaculationCount)
			wanted._enemyRecordGloryBattleEjaculationCount = 0;
		if(!wanted._enemyRecordBoobshakeCount)
			wanted._enemyRecordBoobshakeCount = 0;
	}
};

Game_Party.prototype.update_setActorPassivesObtainedOnArray = function() {
	let actor = $gameActors.actor(ACTOR_KARRYN_ID);
	let date = Prison.date;

	actor._passivesObtainedOn_keyDate_valueSkillID = [];
	actor._passivesObtainedOn_keyDate_valueSkillID[date] = [];
	actor._passivesObtainedOn_keySkillID_valueDate = [];

	for(let i = PASSIVES_LIST_START_ID; i <= PASSIVES_LIST_END_ID; i++) {
		if(actor.hasPassive(i)) {
			actor._passivesObtainedOn_keySkillID_valueDate[i] = date;
			actor._passivesObtainedOn_keyDate_valueSkillID[date].push(i);
		}

	}
	for(let i = PASSIVES_LIST_TWO_START_ID; i <= PASSIVES_LIST_TWO_END_ID; i++) {
		if(actor.hasPassive(i)) {
			actor._passivesObtainedOn_keySkillID_valueDate[i] = date;
			actor._passivesObtainedOn_keyDate_valueSkillID[date].push(i);
		}
	}

	for(let i = PASSIVES_LIST_CC1_START_ID; i <= PASSIVES_LIST_CC1_END_ID; i++) {
		if(actor.hasPassive(i)) {
			actor._passivesObtainedOn_keySkillID_valueDate[i] = date;
			actor._passivesObtainedOn_keyDate_valueSkillID[date].push(i);
		}
	}

	for(let i = PASSIVES_LIST_CC2_START_ID; i <= PASSIVES_LIST_CC2_END_ID; i++) {
		if(actor.hasPassive(i)) {
			actor._passivesObtainedOn_keySkillID_valueDate[i] = date;
			actor._passivesObtainedOn_keyDate_valueSkillID[date].push(i);
		}
	}
};

Game_Party.prototype.fix_setActorPassivesObtainedOnArray_missingCharacterCreators = function() {
	let actor = $gameActors.actor(ACTOR_KARRYN_ID);
	let date = Prison.date;

	if(!actor._passivesObtainedOn_keyDate_valueSkillID[date])
		actor._passivesObtainedOn_keyDate_valueSkillID[date] = [];

	for(let i = PASSIVES_LIST_CC1_START_ID; i <= PASSIVES_LIST_CC1_END_ID; i++) {
		if(actor.hasPassive(i) && !actor._passivesObtainedOn_keySkillID_valueDate[i]) {
			actor._passivesObtainedOn_keySkillID_valueDate[i] = date;
			actor._passivesObtainedOn_keyDate_valueSkillID[date].push(i);
		}
	}
	for(let i = PASSIVES_LIST_CC2_START_ID; i <= PASSIVES_LIST_CC2_END_ID; i++) {
		if(actor.hasPassive(i) && !actor._passivesObtainedOn_keySkillID_valueDate[i]) {
			actor._passivesObtainedOn_keySkillID_valueDate[i] = date;
			actor._passivesObtainedOn_keyDate_valueSkillID[date].push(i);
		}
	}
};

Game_Party.prototype.update_removeOffAndDefHalberdEdicts = function() {
	let actor = $gameActors.actor(ACTOR_KARRYN_ID);
	if(actor.hasEdict(EDICT_HALBERD_OFFENSIVE_SPECIALIZATION) && actor.hasEdict(EDICT_HALBERD_DEFENSIVE_SPECIALIZATION)) {
		actor.forgetSkill(EDICT_HALBERD_OFFENSIVE_SPECIALIZATION);
        actor.resetStsSkill(EDICT_HALBERD_OFFENSIVE_SPECIALIZATION);
		actor.forgetSkill(EDICT_HALBERD_DEFENSIVE_SPECIALIZATION);
        actor.resetStsSkill(EDICT_HALBERD_DEFENSIVE_SPECIALIZATION);
	}
};

repo_name: Rexhunk/karryn

license: unknown


code:
var Remtairy = Remtairy || {};
Remtairy.Wanted = Remtairy.Wanted || {};

const WANTED_APPEARANCE_BASE_CHANCE = 0.03;
const WANTED_APPEARANCE_ADDED_CHANCE = 0.01;

const WANTED_APPEARANCE_BASE_CHANCE_BY_LENGTH = 0.008;
const WANTED_APPEARANCE_ADDED_CHANCE_BY_LENGTH = 0.006;

const WANTED_CHANCE_MULTIPLER_RIOT_BATTLE = 2;
const WANTED_CHANCE_MULTIPLER_RECEPTIONIST_BATTLE = 3;
const WANTED_CHANCE_MULTIPLER_GLORY_BATTLE = 2;

const WANTED_MINIMUM_DAYS_SINCE_DEFEATED = 2;
const WANTED_LVL_INCREASE_BY_DEFEAT = 1;
const WANTED_LVL_INCREASE_BY_DEFEAT_HALF_LVL = 2; //For when wanted lvl is half of karryn's level

const WANTED_POINTS_NEEDED_PER_TYPE = 450;
const WANTED_POINTS_NEEDED_PER_TYPE_OVER_TWO = 1000;
const WANTED_POINTS_NEEDED_PER_TYPE_OVER_FOUR = 10000;
const WANTED_POINTS_NEEDED_PER_TOTAL_WANTED_SIZE = 300; //For Wanted with more than two of type
const WANTED_POINTS_BASE_REQ = 150;
const WANTED_POINTS_STAMINA_DMG_MULTIPLER = 1;
const WANTED_POINTS_PLEASURE_DMG_MULTIPLER = 10;

//=============================================================================
 /*:
 * @plugindesc Wanted
 * @author Remtairy
 *
 * @help
 * This is a private plugin.
 * Do not redistribute, use, or modify this plugin
 * without explicit written permission from Remtairy.
 *
 */
//=============================================================================

//////////////////////
///// Wanted Enemy
///////////////////////

function Wanted_Enemy() {
    this.initialize.apply(this, arguments);
}

Wanted_Enemy.prototype.constructor = Wanted_Enemy;

Wanted_Enemy.prototype.initialize = function(enemy, date, wantedListId) {
	if(!enemy) {
		this._disabled = true;
		return;
	}

	if(enemy.enemy().dataTransferWantedEnemyId)
		this._enemyId = enemy.enemy().dataTransferWantedEnemyId;
	else this._enemyId = enemy.enemyId();

    this._enemyType = enemy.enemyType();
	this._enemyCock = enemy.enemyCock();
    this._enemyName = enemy._randomEnemyName;
	if(enemy.isUnique || enemy.isBossType) {
		this._battlerName = enemy.enemy().battlerName;
	}
	else this._battlerName = enemy.enemyType() + '_' + enemy.battlerNameNum();
    this._enemyPrefixName = enemy.getNamePrefix();
	this._enemyPrefixType = enemy.getNamePrefixType();
	this._hasPrefix = enemy.hasNamePrefix();
    this._firstAppearance = date;
	this._recentAppearance = date;
	this._lastDefeated = date;
	this._appearances = 0;
	this._wantedId = wantedListId;
	this._wantedLvl = enemy._enemyBaseLvl - enemy.enemyLvl_difficultyDays();

	this._disabled = false;

	this._enemyRecordSexualPartner = enemy._enemyRecordSexualPartner;
	this._enemyRecordHandshakeCount = enemy._enemyRecordHandshakeCount;
	this._enemyRecordHandshakeWhileSexCount = enemy._enemyRecordHandshakeWhileSexCount;
	this._enemyRecordBoobshakeCount = enemy._enemyRecordBoobshakeCount;
	this._enemyRecordKissedCount = enemy._enemyRecordKissedCount;
	this._enemyRecordHandjobCount = enemy._enemyRecordHandjobCount;
	this._enemyRecordBlowjobCount = enemy._enemyRecordBlowjobCount;
	this._enemyRecordTittyFuckCount = enemy._enemyRecordTittyFuckCount;
	this._enemyRecordCunnilingusCount = enemy._enemyRecordCunnilingusCount;
	this._enemyRecordRimmedCount = enemy._enemyRecordRimmedCount;
	this._enemyRecordFootjobCount = enemy._enemyRecordFootjobCount;
	this._enemyRecordSpankCount = enemy._enemyRecordSpankCount;
	this._enemyRecordPussyFuckedCount = enemy._enemyRecordPussyFuckedCount;
	this._enemyRecordAnalFuckedCount = enemy._enemyRecordAnalFuckedCount;
	this._enemyRecordBoobsPettedCount = enemy._enemyRecordBoobsPettedCount;
	this._enemyRecordNipplesPettedCount = enemy._enemyRecordNipplesPettedCount;
	this._enemyRecordButtPettedCount = enemy._enemyRecordButtPettedCount;
	this._enemyRecordAnalPettedCount = enemy._enemyRecordAnalPettedCount;
	this._enemyRecordClitPettedCount = enemy._enemyRecordClitPettedCount;
	this._enemyRecordPussyPettedCount = enemy._enemyRecordPussyPettedCount;
	this._enemyRecordCockPettedCount = enemy._enemyRecordCockPettedCount;
	this._enemyRecordFingerSuckedCount = enemy._enemyRecordFingerSuckedCount;

	this._enemyRecordTalkedCount = enemy._enemyRecordTalkedCount;
	this._enemyRecordSawCount = enemy._enemyRecordSawCount;
	this._enemyRecordTalkCockCount = enemy._enemyRecordTalkCockCount;
	this._enemyRecordJerkoffCount = enemy._enemyRecordJerkoffCount;
	this._enemyRecordTauntedCount = enemy._enemyRecordTauntedCount;
	this._enemyRecordFlauntedCount = enemy._enemyRecordFlauntedCount;
	this._enemyRecordGotDogezaCount = enemy._enemyRecordGotDogezaCount;
	this._enemyRecordToysInsertedCount = enemy._enemyRecordToysInsertedCount;
	this._enemyRecordBukkakeTotalCount = enemy._enemyRecordBukkakeTotalCount;
	this._enemyRecordSwallowCount = enemy._enemyRecordSwallowCount;
	this._enemyRecordPussyCreampieCount = enemy._enemyRecordPussyCreampieCount;
	this._enemyRecordAnalCreampieCount = enemy._enemyRecordAnalCreampieCount;
	this._enemyRecordGloryBattleEjaculationCount = enemy._enemyRecordGloryBattleEjaculationCount;
	this._enemyRecordTotalEjaculationCount = enemy._enemyRecordTotalEjaculationCount;
	this._enemyRecordOrgasmPresenceCount = enemy._enemyRecordOrgasmPresenceCount;

	if(enemy.isVisitorType) {
		this._visitor_walkingSpeed = enemy._visitor_walkingSpeed;
		this._visitor_writingSpeed = enemy._visitor_writingSpeed;
		this._visitor_dissatisfactionMultipler = enemy._visitor_dissatisfactionMultipler;
		this._visitor_tachieNum = enemy._visitor_tachieNum;
		this._visitor_isFan = enemy._visitor_isFan;
		this._visitor_isPervert = enemy._visitor_isPervert;
		this._visitor_pervPromoteChance = enemy._visitor_pervPromoteChance;
	}
};

Wanted_Enemy.prototype.enemyTypeIsBoss = function() {
	return this._enemyType === ENEMYTYPE_YASU_TAG ||
	this._enemyType === ENEMYTYPE_TONKIN_TAG ||
	this._enemyType === ENEMYTYPE_CARGILL_TAG ||
	this._enemyType === ENEMYTYPE_ARON_TAG;
};

Wanted_Enemy.prototype.enemyTypeIsVisitor = function() {
	return this._enemyType === ENEMYTYPE_VISITOR_MALE_TAG ||
	this._enemyType === ENEMYTYPE_VISITOR_FEMALE_TAG;
};

Wanted_Enemy.prototype.enemyTypeIsNotForMorphing = function() {
	return this.enemyTypeIsBoss() || this.enemyTypeIsVisitor();
};

////////
// Game BattlerBase
///////////////

Game_BattlerBase.prototype.getWantedPoints = function() { return this._wantedPoints; };
Game_BattlerBase.prototype.addWantedPoints = function(num) { this._wantedPoints += num; };

//////
///////////
// Game Enemy
////////////
////////

Object.defineProperty(Game_Enemy.prototype, "isWanted", {
	get: function () { return this._isWanted; }, configurable: true
});

Game_Enemy.prototype.setupWanted = function(wantedStatus) {
	if(!wantedStatus) {
		this._isWanted = false;
		this._wantedBattlerName = false;
		this._wantedLvl = 0;
		this._wantedId = -1;
		this._justBecameWanted = false;
	}
	else {
		this.checkWantedVirginityStatus(wantedStatus);

		this._isWanted = true;
		this._wantedLvl = wantedStatus._wantedLvl;
		this._wantedBattlerName = wantedStatus._battlerName;
		this._enemyType = wantedStatus._enemyType;
		this._enemyCock = wantedStatus._enemyCock;
		this._randomEnemyName = wantedStatus._enemyName
		this._hasEnemyNamePrefix = wantedStatus._hasPrefix;
		this._enemyNamePrefix = wantedStatus._enemyPrefixName;
	    this._enemyNamePrefixType = wantedStatus._enemyPrefixType;
		this._wantedId = wantedStatus._wantedId;
		this._justBecameWanted = false;

		this._enemyRecordSexualPartner = wantedStatus._enemyRecordSexualPartner;
		this._enemyRecordHandshakeCount = wantedStatus._enemyRecordHandshakeCount;
		this._enemyRecordHandshakeWhileSexCount = wantedStatus._enemyRecordHandshakeWhileSexCount;
		this._enemyRecordBoobshakeCount = wantedStatus._enemyRecordBoobshakeCount;
		this._enemyRecordKissedCount = wantedStatus._enemyRecordKissedCount;
		this._enemyRecordHandjobCount = wantedStatus._enemyRecordHandjobCount;
		this._enemyRecordBlowjobCount = wantedStatus._enemyRecordBlowjobCount;
		this._enemyRecordTittyFuckCount = wantedStatus._enemyRecordTittyFuckCount;
		this._enemyRecordCunnilingusCount = wantedStatus._enemyRecordCunnilingusCount;
		this._enemyRecordRimmedCount = wantedStatus._enemyRecordRimmedCount;
		this._enemyRecordFootjobCount = wantedStatus._enemyRecordFootjobCount;
		this._enemyRecordSpankCount = wantedStatus._enemyRecordSpankCount;
		this._enemyRecordPussyFuckedCount = wantedStatus._enemyRecordPussyFuckedCount;
		this._enemyRecordAnalFuckedCount = wantedStatus._enemyRecordAnalFuckedCount;
		this._enemyRecordBoobsPettedCount = wantedStatus._enemyRecordBoobsPettedCount;
		this._enemyRecordNipplesPettedCount = wantedStatus._enemyRecordNipplesPettedCount;
		this._enemyRecordButtPettedCount = wantedStatus._enemyRecordButtPettedCount;
		this._enemyRecordAnalPettedCount = wantedStatus._enemyRecordAnalPettedCount;
		this._enemyRecordClitPettedCount = wantedStatus._enemyRecordClitPettedCount;
		this._enemyRecordPussyPettedCount = wantedStatus._enemyRecordPussyPettedCount;
		this._enemyRecordCockPettedCount = wantedStatus._enemyRecordCockPettedCount;
		this._enemyRecordFingerSuckedCount = wantedStatus._enemyRecordFingerSuckedCount;

		this._enemyRecordTalkedCount = wantedStatus._enemyRecordTalkedCount;
		this._enemyRecordSawCount = wantedStatus._enemyRecordSawCount;
		this._enemyRecordTalkCockCount = wantedStatus._enemyRecordTalkCockCount;
		this._enemyRecordJerkoffCount = wantedStatus._enemyRecordJerkoffCount;
		this._enemyRecordTauntedCount = wantedStatus._enemyRecordTauntedCount;
		this._enemyRecordFlauntedCount = wantedStatus._enemyRecordFlauntedCount;
		this._enemyRecordGotDogezaCount = wantedStatus._enemyRecordGotDogezaCount;
		this._enemyRecordToysInsertedCount = wantedStatus._enemyRecordToysInsertedCount;
		this._enemyRecordBukkakeTotalCount = wantedStatus._enemyRecordBukkakeTotalCount;
		this._enemyRecordSwallowCount = wantedStatus._enemyRecordSwallowCount;
		this._enemyRecordPussyCreampieCount = wantedStatus._enemyRecordPussyCreampieCount;
		this._enemyRecordAnalCreampieCount = wantedStatus._enemyRecordAnalCreampieCount;
		this._enemyRecordGloryBattleEjaculationCount = wantedStatus._enemyRecordGloryBattleEjaculationCount;
		this._enemyRecordTotalEjaculationCount = wantedStatus._enemyRecordTotalEjaculationCount;
		this._enemyRecordOrgasmPresenceCount = wantedStatus._enemyRecordOrgasmPresenceCount;

		this.setupEnemyLvl();
		this.setupWantedGuardSkills();
	}
};

Game_Enemy.prototype.checkWantedVirginityStatus = function(wantedStatus) {
	if(wantedStatus._hasPrefix && wantedStatus._enemyPrefixType == ENEMY_PREFIX_VIRGIN) {
		if(wantedStatus._enemyRecordPussyFuckedCount > 0 || wantedStatus._enemyRecordAnalFuckedCount > 0) {
			let availablePrefixSet = [ ENEMY_PREFIX_GOOD, ENEMY_PREFIX_STRONG, ENEMY_PREFIX_DEXTEROUS, ENEMY_PREFIX_AGILE, ENEMY_PREFIX_ENDURING, ENEMY_PREFIX_HORNY, ENEMY_PREFIX_HORNY];
			$gameTroop.setPrefixTypeAndName(this, availablePrefixSet);
			wantedStatus._enemyPrefixName = this.getNamePrefix();
			wantedStatus._enemyPrefixType = this.getNamePrefixType();
		}
	}
};

Game_Enemy.prototype.setupWantedGuardSkills = function() {
	if(this.isGuardType && !this.isCargill && !this.isYasu) {
		let guardAggression = Prison.guardAggression;
		let currentGuardID = ENEMY_ID_GUARD_LV1;

		//Find current guard ID
		if(guardAggression < 3) currentGuardID = ENEMY_ID_GUARD_LV1;
		else if(guardAggression < 6) currentGuardID = ENEMY_ID_GUARD_LV2;
		else if(guardAggression < 12) currentGuardID = ENEMY_ID_GUARD_LV3;
		else if(guardAggression < 20) currentGuardID = ENEMY_ID_GUARD_LV4;

		else currentGuardID = ENEMY_ID_GUARD_LV4;

		//If this guard ID is not current, add current guard's skills
		if(this._enemyId != currentGuardID) {
			this._aiPettingSkills.concat($dataEnemies[currentGuardID].dataAIPettingSkills.slice(0));
			this._aiTalkSightSkills.concat($dataEnemies[currentGuardID].dataAITalkSightSkills.slice(0));
			this._aiPoseStartSkills.concat($dataEnemies[currentGuardID].dataAIPoseStartSkills.slice(0));
			this._aiPoseJoinSkills.concat($dataEnemies[currentGuardID].dataAIPoseJoinSkills.slice(0));
		}
	}
};

Game_Enemy.prototype.getWantedLvl = function() { return this._wantedLvl; };
Game_Enemy.prototype.getWantedId = function() { return this._wantedId; };

///////
// Enemy Records
//////////////////

Game_Enemy.prototype.setupEnemyRecords = function() {
    this._enemyRecordSexualPartner = false;

	this._enemyRecordHandshakeCount = 0;
	this._enemyRecordHandshakeWhileSexCount = 0;
	this._enemyRecordBoobshakeCount = 0;
	this._enemyRecordKissedCount = 0;
	this._enemyRecordHandjobCount = 0;
	this._enemyRecordBlowjobCount = 0;
	this._enemyRecordTittyFuckCount = 0;
	this._enemyRecordCunnilingusCount = 0;
	this._enemyRecordRimmedCount = 0;
	this._enemyRecordFootjobCount = 0;
	this._enemyRecordSpankCount = 0;
	this._enemyRecordPussyFuckedCount = 0;
	this._enemyRecordAnalFuckedCount = 0;
	this._enemyRecordBoobsPettedCount = 0;
	this._enemyRecordNipplesPettedCount = 0;
	this._enemyRecordButtPettedCount = 0;
	this._enemyRecordAnalPettedCount = 0;
	this._enemyRecordClitPettedCount = 0;
	this._enemyRecordPussyPettedCount = 0;
	this._enemyRecordCockPettedCount = 0;
	this._enemyRecordFingerSuckedCount = 0;
	this._enemyRecordTalkedCount = 0;
	this._enemyRecordSawCount = 0;
	this._enemyRecordJerkoffCount = 0;
	this._enemyRecordTalkCockCount = 0;
	this._enemyRecordTauntedCount = 0;
	this._enemyRecordFlauntedCount = 0;
	this._enemyRecordGotDogezaCount = 0;
	this._enemyRecordToysInsertedCount = 0;

	this._enemyRecordBukkakeTotalCount = 0;
	this._enemyRecordSwallowCount = 0;
	this._enemyRecordPussyCreampieCount = 0;
	this._enemyRecordAnalCreampieCount = 0;
	this._enemyRecordGloryBattleEjaculationCount = 0;
	this._enemyRecordTotalEjaculationCount = 0;
	this._enemyRecordOrgasmPresenceCount = 0;

	this._enemyTempRecordTotalEjaculationCount = 0;
};

Game_Enemy.prototype.setAsActorSexualPartner = function(actor) {
    if(!this._enemyRecordSexualPartner) {
		actor.addEnemySexualPartner(this);
		this._enemyRecordSexualPartner = true;
		if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordSexualPartner = true;
		}
	}
};

Game_Enemy.prototype.addToEnemyHandshakeCountRecord = function(actor) {
	this._enemyRecordHandshakeCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordHandshakeCount = this._enemyRecordHandshakeCount;
	}
	let firstCount = false;
    if(this._enemyRecordHandshakeCount == 1) {
		firstCount = true;
	}
	actor.addToActorHandshakeRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyHandshakeWhileSexCountRecord = function(actor) {
	if(actor.receptionistBattle_isHavingSexBehind()) {
		this._enemyRecordHandshakeWhileSexCount++;
		let firstCount = false;
		if(this._enemyRecordHandshakeWhileSexCount == 1) {
			firstCount = true;
		}
		actor.addToActorHandshakeWhileSexRecord(firstCount, this);
	}
};

Game_Enemy.prototype.addToEnemyBoobshakeCountRecord = function(actor) {
	this._enemyRecordBoobshakeCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordBoobshakeCount = this._enemyRecordBoobshakeCount;
	}
	let firstCount = false;
    if(this._enemyRecordBoobshakeCount == 1) {
		firstCount = true;
	}
	actor.addToActorBoobshakeRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyKissedCountRecord = function(actor) {
	this._enemyRecordKissedCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordKissedCount = this._enemyRecordKissedCount;
	}
	let firstCount = false;
    if(this._enemyRecordKissedCount == 1) {
		firstCount = true;
	}
	actor.addToActorKissedRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyHandjobCountRecord = function(actor) {
	this._enemyRecordHandjobCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordHandjobCount = this._enemyRecordHandjobCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordHandjobCount == 1) {
		firstCount = true;
	}
	actor.addToActorHandjobRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyBlowjobCountRecord = function(actor) {
	this._enemyRecordBlowjobCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordBlowjobCount = this._enemyRecordBlowjobCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordBlowjobCount == 1) {
		firstCount = true;
	}
	actor.addToActorBlowjobRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyTittyFuckCountRecord = function(actor) {
	this._enemyRecordTittyFuckCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordTittyFuckCount = this._enemyRecordTittyFuckCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordTittyFuckCount == 1) {
		firstCount = true;
	}
	actor.addToActorTittyFuckRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyCunnilingusCountRecord = function(actor) {
	this._enemyRecordCunnilingusCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordCunnilingusCount = this._enemyRecordCunnilingusCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordCunnilingusCount == 1) {
		firstCount = true;
	}
	actor.addToActorCunnilingusRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyRimmedCountRecord = function(actor) {
	this._enemyRecordRimmedCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordRimmedCount = this._enemyRecordRimmedCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordRimmedCount == 1) {
		firstCount = true;
	}
	actor.addToActorRimjobRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyFootjobCountRecord = function(actor) {
	this._enemyRecordFootjobCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordFootjobCount = this._enemyRecordFootjobCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordFootjobCount == 1) {
		firstCount = true;
	}
	actor.addToActorFootjobRecord(firstCount, this);
};

Game_Enemy.prototype.addToEnemySpankCountRecord = function(actor) {
	this._enemyRecordSpankCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordSpankCount = this._enemyRecordSpankCount;
	}
	let firstCount = false;
    if(this._enemyRecordSpankCount == 1) {
		firstCount = true;
	}
	actor.addToActorButtSpankedRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyPussyFuckedCountRecord = function(actor) {
	this._enemyRecordPussyFuckedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordPussyFuckedCount = this._enemyRecordPussyFuckedCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordPussyFuckedCount == 1) {
		firstCount = true;
	}
	actor.addToActorPussyFuckedRecord(firstCount, this);

	if(firstCount && this._enemyRecordAnalFuckedCount === 0 && this.hasVirginPrefix()) {
		actor.addToVirginityTakenViaPussyRecord();
	}
};
Game_Enemy.prototype.addToEnemyAnalFuckedCountRecord = function(actor) {
	this._enemyRecordAnalFuckedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordAnalFuckedCount = this._enemyRecordAnalFuckedCount;
	}
	this.setAsActorSexualPartner(actor);
	let firstCount = false;
    if(this._enemyRecordAnalFuckedCount == 1) {
		firstCount = true;
	}
	actor.addToActorAnalFuckedRecord(firstCount, this);

	if(firstCount && this._enemyRecordPussyFuckedCount === 0 && this.hasVirginPrefix()) {
		actor.addToVirginityTakenViaAnalRecord();
	}
};

Game_Enemy.prototype.addToEnemyBukkakeCountRecord = function(actor) {
	this._enemyRecordBukkakeTotalCount++;
	this._enemyRecordTotalEjaculationCount++;
	this._enemyTempRecordTotalEjaculationCount++;
	this.addToEnemyGloryBattleEjaculationCountRecord(actor);

	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordBukkakeTotalCount = this._enemyRecordBukkakeTotalCount;
			wantedStatus._enemyRecordTotalEjaculationCount = this._enemyRecordTotalEjaculationCount;
	}
	let firstCount = false;
    if(this._enemyRecordBukkakeTotalCount == 1) {
		firstCount = true;
	}
	actor.addToActorBukkakeTotalRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemySwallowCountRecord = function(actor) {
	this._enemyRecordSwallowCount++;
	this._enemyRecordTotalEjaculationCount++;
	this._enemyTempRecordTotalEjaculationCount++;
	this.addToEnemyGloryBattleEjaculationCountRecord(actor);

	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordSwallowCount = this._enemyRecordSwallowCount;
			wantedStatus._enemyRecordTotalEjaculationCount = this._enemyRecordTotalEjaculationCount;
	}
	let firstCount = false;
    if(this._enemyRecordSwallowCount == 1) {
		firstCount = true;
	}
	actor.addToActorSwallowRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyPussyCreampieCountRecord = function(actor) {
	this._enemyRecordPussyCreampieCount++;
	this._enemyRecordTotalEjaculationCount++;
	this._enemyTempRecordTotalEjaculationCount++;
	this.addToEnemyGloryBattleEjaculationCountRecord(actor);

	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordPussyCreampieCount = this._enemyRecordPussyCreampieCount;
			wantedStatus._enemyRecordTotalEjaculationCount = this._enemyRecordTotalEjaculationCount;
	}
	let firstCount = false;
    if(this._enemyRecordPussyCreampieCount == 1) {
		firstCount = true;
	}
	actor.addToActorPussyCreampieRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyAnalCreampieCountRecord = function(actor) {
	this._enemyRecordAnalCreampieCount++;
	this._enemyRecordTotalEjaculationCount++;
	this._enemyTempRecordTotalEjaculationCount++;
	this.addToEnemyGloryBattleEjaculationCountRecord(actor);

	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordAnalCreampieCount = this._enemyRecordAnalCreampieCount;
			wantedStatus._enemyRecordTotalEjaculationCount = this._enemyRecordTotalEjaculationCount;
	}
	let firstCount = false;
    if(this._enemyRecordAnalCreampieCount == 1) {
		firstCount = true;
	}
	actor.addToActorAnalCreampieRecord(firstCount, this);
};

Game_Enemy.prototype.addToEnemyGloryBattleEjaculationCountRecord = function(actor) {
	if($gameParty.isInGloryBattle) {
		this._enemyRecordGloryBattleEjaculationCount++;
		actor._recordGloryBattleCockEjaculationCount++;
		if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordGloryBattleEjaculationCount = this._enemyRecordGloryBattleEjaculationCount;
		}
	}
};

Game_Enemy.prototype.addToEnemyOrgasmPresenceCountRecord = function(actor) {
	this._enemyRecordOrgasmPresenceCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordOrgasmPresenceCount = this._enemyRecordOrgasmPresenceCount;
	}
	let firstCount = false;
    if(this._enemyRecordOrgasmPresenceCount == 1) {
		firstCount = true;
	}
	actor.addToActorOrgasmPresenceRecord(firstCount);
};

Game_Enemy.prototype.addToEnemyBoobsPettedCountRecord = function(actor) {
	this._enemyRecordBoobsPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordBoobsPettedCount = this._enemyRecordBoobsPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordBoobsPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorBoobsPettedRecord(firstCount);
};
Game_Enemy.prototype.addToEnemyNipplesPettedCountRecord = function(actor) {
	this._enemyRecordNipplesPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordNipplesPettedCount = this._enemyRecordNipplesPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordNipplesPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorNipplesPettedRecord(firstCount);
};
Game_Enemy.prototype.addToEnemyButtPettedCountRecord = function(actor) {
	this._enemyRecordButtPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordButtPettedCount = this._enemyRecordButtPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordButtPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorButtPettedRecord(firstCount);
};
Game_Enemy.prototype.addToEnemyAnalPettedCountRecord = function(actor) {
	this._enemyRecordAnalPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordAnalPettedCount = this._enemyRecordAnalPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordAnalPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorAnalPettedRecord(firstCount);
};
Game_Enemy.prototype.addToEnemyClitPettedCountRecord = function(actor) {
	this._enemyRecordClitPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordClitPettedCount = this._enemyRecordClitPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordClitPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorClitPettedRecord(firstCount);
};
Game_Enemy.prototype.addToEnemyPussyPettedCountRecord = function(actor) {
	this._enemyRecordPussyPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordPussyPettedCount = this._enemyRecordPussyPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordPussyPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorPussyPettedRecord(firstCount);
};

Game_Enemy.prototype.addToEnemyCockPettedCountRecord = function(actor) {
	this._enemyRecordCockPettedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordCockPettedCount = this._enemyRecordCockPettedCount;
	}
	let firstCount = false;
    if(this._enemyRecordCockPettedCount == 1) {
		firstCount = true;
	}
	actor.addToActorCockPettedRecord(firstCount);
};

Game_Enemy.prototype.addToEnemyFingerSuckedCountRecord = function(actor) {
	this._enemyRecordFingerSuckedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordFingerSuckedCount = this._enemyRecordFingerSuckedCount;
	}
	let firstCount = false;
    if(this._enemyRecordFingerSuckedCount == 1) {
		firstCount = true;
	}
	actor.addToActorFingersSuckedRecord(firstCount);
};

Game_Enemy.prototype.addToEnemyTalkedCountRecord = function(actor) {
	this._enemyRecordTalkedCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordTalkedCount = this._enemyRecordTalkedCount;
	}
	let firstCount = false;
    if(this._enemyRecordTalkedCount == 1) {
		firstCount = true;
	}
	actor.addToActorTalkedAtRecord(firstCount);
};

Game_Enemy.prototype.addToEnemySawCountRecord = function(actor) {
	this._enemyRecordSawCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordSawCount = this._enemyRecordSawCount;
	}
	let firstCount = false;
    if(this._enemyRecordSawCount == 1) {
		firstCount = true;
	}
	actor.addToActorSeenRecord(firstCount);
};

Game_Enemy.prototype.addToEnemyTalkedCockRecord = function(actor) {
	this._enemyRecordTalkCockCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordTalkCockCount = this._enemyRecordTalkCockCount;
	}
	let firstCount = false;
    if(this._enemyRecordTalkCockCount == 1) {
		firstCount = true;
	}
	actor.addToActorEnemyTalkCockRecord(firstCount);
};

Game_Enemy.prototype.addToEnemyJerkOffCountRecord = function(actor) {
	this._enemyRecordJerkoffCount++;
	if(this.isWanted) {
		let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
		wantedStatus._enemyRecordJerkoffCount = this._enemyRecordJerkoffCount;
	}
	let firstCount = false;
    if(this._enemyRecordJerkoffCount == 1) {
		firstCount = true;
	}
	actor.addToActorSeeJerkOffRecord(firstCount);
};
Game_Enemy.prototype.addToEnemyTauntedCountRecord = function(actor) {
	this._enemyRecordTauntedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordTauntedCount = this._enemyRecordTauntedCount;
	}
	let firstCount = false;
    if(this._enemyRecordTauntedCount == 1) {
		firstCount = true;
	}
	actor.addToActorTauntPeopleRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyFlauntedCountRecord = function(actor) {
	this._enemyRecordFlauntedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordFlauntedCount = this._enemyRecordFlauntedCount;
	}
	let firstCount = false;
    if(this._enemyRecordFlauntedCount == 1) {
		firstCount = true;
	}
	actor.addToActorFlauntPeopleRecord(firstCount, this);
};
Game_Enemy.prototype.addToEnemyGotDogezaCountRecord = function(actor) {
	this._enemyRecordGotDogezaCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordGotDogezaCount = this._enemyRecordGotDogezaCount;
	}
	let firstCount = false;
    if(this._enemyRecordGotDogezaCount == 1) {
		firstCount = true;
	}
	actor.addToActorDogezaPeopleRecord(firstCount, this);
};

Game_Enemy.prototype.addToEnemyToysInsertedCountRecord = function(actor) {
	this._enemyRecordToysInsertedCount++;
	if(this.isWanted) {
			let wantedStatus = Prison.getWantedEnemyById(this.getWantedId());
			wantedStatus._enemyRecordToysInsertedCount = this._enemyRecordToysInsertedCount;
	}
	let firstCount = false;
    if(this._enemyRecordToysInsertedCount == 1) {
		firstCount = true;
	}
	actor.addToActorToysInsertedByPeopleRecord(firstCount, this);
};

////////
// Game Troop
/////////////////

Game_Troop.prototype.addToEnemyOrgasmPresenceCountRecord = function(actor) {
	this.members().forEach(function(enemy) {
		if(enemy.isAlive()) {
			enemy.addToEnemyOrgasmPresenceCountRecord(actor);
		}
	}, this);
};

//////
///////////
// Game Party
////////////
////////

Game_Party.prototype.setupWantedList = function() {
	this._wantedEnemies = [];
	this._wantedEnemies.push(new Wanted_Enemy(false));
	this._wantedId_Tonkin = -1;
	this._wantedId_Yasu = -1;
	this._wantedId_Cargill = -1;
	this._wantedId_Aron = -1;
};
Game_Party.prototype.getWantedEnemyById = function(id) {
	return this._wantedEnemies[id];
};

Game_Party.prototype.wantedEnemyListLength = function() {
	let nonDisabledCount = 0;

	for(let i = 0; i < this._wantedEnemies.length; ++i) {
		if(!this._wantedEnemies[i]._disabled) nonDisabledCount++;
	}

	return nonDisabledCount;
};

Game_Party.prototype.resetWantedAppearanceChance = function() {
	this._currentWantedChance = WANTED_APPEARANCE_BASE_CHANCE + WANTED_APPEARANCE_BASE_CHANCE_BY_LENGTH * this.wantedEnemyListLength();
};
Game_Party.prototype.addWantedAppearanceChance = function() {
	this._currentWantedChance += WANTED_APPEARANCE_ADDED_CHANCE + WANTED_APPEARANCE_ADDED_CHANCE_BY_LENGTH * this.wantedEnemyListLength();
};

Game_Party.prototype.setWantedIdAsAppeared = function(id) {
	this.getWantedEnemyById(id)._recentAppearance = Prison.date;
	if(!this.getWantedEnemyById(id)._appearances) this.getWantedEnemyById(id)._appearances = 0;
	this.getWantedEnemyById(id)._appearances++;
};
Game_Party.prototype.setWantedIdAsDefeated = function(id) {
	if(this.getWantedEnemyById(id)._lastDefeated === Prison.date) return;
	this.getWantedEnemyById(id)._lastDefeated = Prison.date;
	if(this.getWantedEnemyById(id).enemyTypeIsBoss()) return;

	let levelLimitMulti = 1;
	if(Prison.hardMode()) levelLimitMulti = 1.1;
	else if(Prison.easyMode()) levelLimitMulti = 0.9;

	let currentWantedLevelLimit = Karryn.getWardenLevelLimit() * levelLimitMulti;

	if(this.getWantedEnemyById(id)._wantedLvl <= currentWantedLevelLimit) {
		let levelDifference = Karryn.level - this.getWantedEnemyById(id)._wantedLvl;
		if(levelDifference < 5) {
			this.getWantedEnemyById(id)._wantedLvl += 1;
		}
		else {
			this.getWantedEnemyById(id)._wantedLvl += Math.round(levelDifference * 0.3);
		}
	}
};

Game_Party.prototype.checkPotentialNewWanted = function(enemy) {
	if(!$gameParty.isThisEnemyOrNameAlreadyWanted(enemy)) {
		if(enemy.isBossType) {
			let bossWantedId = $gameParty.addNewWanted(enemy);
			if(enemy.isYasu) $gameParty._wantedId_Yasu = bossWantedId;
			else if(enemy.isTonkin) $gameParty._wantedId_Tonkin = bossWantedId;
			else if(enemy.isCargill) $gameParty._wantedId_Cargill = bossWantedId;
			else if(enemy.isAron) $gameParty._wantedId_Aron = bossWantedId;

			return;
		}

		let wantedPoints = enemy.getWantedPoints();
		let typeCount = $gameParty.getHeadcountOfWantedType(enemy.enemyType());
		let prisonWantedCount = $gameParty.getHeadcountOfAllPrisonWanted();
		let noAdditionalWantedPointsAfterTwoNeededTypes = enemy.isVisitorMaleType;

		let reqWantedPoints = WANTED_POINTS_BASE_REQ;
		reqWantedPoints += WANTED_POINTS_NEEDED_PER_TYPE * typeCount;

		if(typeCount >= 2 && !noAdditionalWantedPointsAfterTwoNeededTypes) {
			reqWantedPoints += WANTED_POINTS_NEEDED_PER_TOTAL_WANTED_SIZE * prisonWantedCount;
			reqWantedPoints += WANTED_POINTS_NEEDED_PER_TYPE_OVER_TWO * (typeCount - 1);
		}
		if(typeCount >= 4) {
			reqWantedPoints += WANTED_POINTS_NEEDED_PER_TYPE_OVER_FOUR * (typeCount - 3);
		}

		if(wantedPoints >= reqWantedPoints && !enemy._tagDontAddWanted) {
			$gameParty.addNewWanted(enemy);
		}
	}
};

Game_Party.prototype.addNewWanted = function(enemy) {
	let newWantedId = this._wantedEnemies.length;
	let wanted = new Wanted_Enemy(enemy, Prison.date, newWantedId);
	this._wantedEnemies.push(wanted);
	enemy._isWanted = true;
	enemy._wantedBattlerName = wanted._battlerName;
	enemy._wantedLvl = wanted._wantedLvl;
	enemy._wantedId = wanted._wantedId;
	enemy._justBecameWanted = true;
	if(enemy._tagDontAddWanted) wanted._disabled = true;
	return newWantedId;
};

Game_Party.prototype.isThisEnemyOrNameAlreadyWanted = function(enemy) {
	return enemy.isWanted || this.isThisNameAlreadyInWanted_onlyNameMatters(enemy._randomEnemyName) !== -1;
};

Game_Party.prototype.putAllWantedNamesToNamesCountArray = function() {
	let namesArray = {};
	if(!this._wantedEnemies) return namesArray;
	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wanted = this._wantedEnemies[i];

		if(wanted._disabled) continue;

		if(!namesArray[wanted._enemyName]) namesArray[wanted._enemyName] = 1;
		else namesArray[wanted._enemyName] += 1;
	}
	return namesArray;
};

//for exact name
//returns true or false only
Game_Party.prototype.isThisNameAlreadyInWanted = function(enemyName, enemyType, enemyPrefixName) {
	//let nameFound = -1;
	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wanted = this._wantedEnemies[i];
		if(!wanted._disabled && wanted._enemyName == enemyName && wanted._enemyType == enemyType && wanted._enemyPrefixName == enemyPrefixName) {
			//nameFound = i;
			//break;
			return true;
		}
	}
	return false;

	//if(nameFound >= 0) return true;
	//else return false;
};

//For only the name part
Game_Party.prototype.isThisNameAlreadyInWanted_onlyNameMatters = function(enemyName) {
	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wanted = this._wantedEnemies[i];
		if(!wanted._disabled && wanted._enemyName == enemyName) {
			return i;
		}
	}
	return -1;
};

Game_Party.prototype.findAvailableWanted = function(enemy, maxPrisonerMorphHeight) {
	if(!enemy) return false;

	let enemyIsBossType = enemy.dataEnemyType === ENEMYTYPE_YASU_TAG || enemy.dataEnemyType === ENEMYTYPE_TONKIN_TAG || enemy.dataEnemyType === ENEMYTYPE_CARGILL_TAG || enemy.dataEnemyType === ENEMYTYPE_ARON_TAG;

	let availableIds = this.findAvailableWantedIds(enemy, maxPrisonerMorphHeight);
	let wantedChance = this._currentWantedChance;
	if(this.isRiotBattle()) wantedChance *= WANTED_CHANCE_MULTIPLER_RIOT_BATTLE;
	else if(Karryn.isInReceptionistPose()) wantedChance *= WANTED_CHANCE_MULTIPLER_RECEPTIONIST_BATTLE;
	else if(this.isInGloryBattle) wantedChance *= WANTED_CHANCE_MULTIPLER_GLORY_BATTLE;
	else if($gameMap._mapId === MAP_ID_TESTING) return false;
	if(availableIds.length > 0 &&
	((!enemy.hasTag(TAG_UNIQUE_ENEMY) && Math.random() < wantedChance) || (enemyIsBossType))) {
		let id = availableIds[0];
		if(availableIds.length > 1) {
			let num = Math.randomInt(availableIds.length);
			id = availableIds[num];
		}

		this.setWantedIdAsAppeared(id);
		if(!enemyIsBossType) this.resetWantedAppearanceChance();

		return this.getWantedEnemyById(id);
	}
	else {
		this.addWantedAppearanceChance();
		return false;
	}
};

Game_Party.prototype.findAvailableWantedIds = function(enemy, maxPrisonerMorphHeight) {
	let type = enemy.dataEnemyType;
	let availableWantedIds = [];

	if(type == ENEMYTYPE_YASU_TAG) {
		if(this._wantedId_Yasu !== -1) {
			availableWantedIds.push(this._wantedId_Yasu);
			return availableWantedIds;
		}
		else return [];
	}
	else if(type == ENEMYTYPE_TONKIN_TAG) {
		if(this._wantedId_Tonkin !== -1) {
			availableWantedIds.push(this._wantedId_Tonkin);
			return availableWantedIds;
		}
		else return [];
	}
	else if(type == ENEMYTYPE_CARGILL_TAG) {
		if(this._wantedId_Cargill !== -1) {
			availableWantedIds.push(this._wantedId_Cargill);
			return availableWantedIds;
		}
		else return [];
	}
	else if(type == ENEMYTYPE_ARON_TAG) {
		if(this._wantedId_Aron !== -1) {
			availableWantedIds.push(this._wantedId_Aron);
			return availableWantedIds;
		}
		else return [];
	}

	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wantedEnemy = this._wantedEnemies[i];
		if(wantedEnemy._disabled) continue;

		if(
		(wantedEnemy._enemyType == type ||
		(type == ENEMYTYPE_PRISONER_TAG && !enemy._tagDontMorph && !wantedEnemy.enemyTypeIsNotForMorphing() && $dataEnemies[wantedEnemy._enemyId].dataRowHeight <= maxPrisonerMorphHeight)
		) &&
		Prison.date + WANTED_MINIMUM_DAYS_SINCE_DEFEATED > wantedEnemy._lastDefeated &&
		Prison.date > wantedEnemy._recentAppearance) {
			availableWantedIds.push(wantedEnemy._wantedId);
		}
	}
	return availableWantedIds;
};

Game_Party.prototype.getHeadcountOfWantedType = function(type) {
	let count = 0;
	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wantedEnemy = this._wantedEnemies[i];
		if(!wantedEnemy._disabled && wantedEnemy._enemyType == type) {
			count++;
		}
	}
	return count;
};

//Except Visitor Center and Bosses
Game_Party.prototype.getHeadcountOfAllPrisonWanted = function() {
	let count = 0;
	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wantedEnemy = this._wantedEnemies[i];
		if(!wantedEnemy._disabled && !wantedEnemy._visitor_isFan && !wantedEnemy._visitor_isPervert && !wantedEnemy.enemyTypeIsBoss()) {
		//todo: don't count assist
			count++;
		}
	}
	return count;
};

Game_Party.prototype.disableAllWanted = function() {
	for(let i = 0; i < this._wantedEnemies.length; i++) {
		let wantedEnemy = this._wantedEnemies[i];
		wantedEnemy._disabled = true;
	}
	this._wantedId_Tonkin = -1;
	this._wantedId_Yasu = -1;
	this._wantedId_Cargill = -1;
	this._wantedId_Aron = -1;
};

///////
// Scene Battle
///////////

Remtairy.Wanted.Scene_Battle_terminate = Scene_Battle.prototype.terminate;
Scene_Battle.prototype.terminate = function() {
	$gameTroop.aliveMembers().forEach(function(member) {
		$gameParty.checkPotentialNewWanted(member);
    });

	Remtairy.Wanted.Scene_Battle_terminate.call(this);
};


code:
var Remtairy = Remtairy || {};
Remtairy.Willpower = Remtairy.Willpower || {};

//=============================================================================
 /*:
 * @plugindesc Willpower
 * @author Remtairy
 *
 * @help
 * This is a private plugin.
 * Do not redistribute, use, or modify this plugin
 * without explicit written permission from Remtairy.
 *
 */
//=============================================================================

const WILLPOWER_BASE_WP = 38;
const ITEM_WILL_COST_ID = 1; //Item Id of the Willpower item
const WILLPOWER_PER_MIND = 0.8;
const WILLPOWER_PER_MIND_PLVL = 0.8;

const WILLPOWER_SKILL_START = 81;
const WILLPOWER_SKILL_END = 105;

const WILLPOWER_REJECT_ALCOHOL_COST = 15;

/////////
// Window SkillList
////////////////////

Window_SkillList.prototype.drawSkillItemCost = function(skill, wx, wy, dw) {
    if (Yanfly.Param.SCICostStyle === 0) return dw;
    let array = this._actor.skillItemCost(skill);
    let max = array.length;
    if (max <= 0) return dw;
    this.contents.fontSize = Yanfly.Param.SCIFontSize;
    dw -= 2;
    for (let i = 0; i < max; ++i) {
      let arr = array[max - i - 1];
      let item = arr[0];
      let cost = arr[1];
      dw = this.drawSoloItemCost(item, cost, wx, wy, dw, skill);
    }
    let returnWidth = dw - Yanfly.Param.SCCCostPadding;
    this.resetFontSettings();
    return returnWidth;
};

//willpower cost
Window_SkillList.prototype.drawSoloItemCost = function(item, cost, wx, wy, dw, skill) {
    let x = wx + dw - Window_Base._iconWidth;
    this.drawIcon(item.iconIndex, x + 2, wy + REM_Y_ICON_PADDING);

	if(item.id === ITEM_WILL_COST_ID) {
		cost = this._actor.calculateWillSkillCost(cost, skill);
	}
	else if(item.id === ITEM_SECOND_COST_ID) {
		if(this._actor.isDeadDrunk) cost += 5;
		else if(this._actor.isDrunk) cost += 3;
		else if(this._actor.isTipsy) cost += 1;

		if(this._actor.isAroused()) cost += 1;
		if(this._actor.isWet) cost += 1;
		if(this._actor.isHorny) cost += 1;

		if(this._actor.hasThisTitle(TITLE_ID_EXPERIENCED_WAITRESS)) cost -= 1;
		if(this._actor.isUsingThisTitle(TITLE_ID_EXPERIENCED_WAITRESS)) cost -= 2;
	}

    let amt1 = Yanfly.Util.toGroup(cost);
    let amt2 = Yanfly.Util.toGroup(this._actor.numItems(item));
    let fmt = Yanfly.Param.SCIAmountFmt;
    let text = fmt.format(amt1, amt2);
    if (Yanfly.Param.SCICostStyle === 1) {
      let iconWidth = Window_Base._iconWidth + 4;
      this.drawText(text, wx, wy + Yanfly.Param.SCIYBuffer, dw, 'right');
      dw -= Math.max(iconWidth, this.textWidth(text));
    } else if (Yanfly.Param.SCICostStyle === 2) {
		if(item.id === ITEM_WILL_COST_ID) {
			//text += ' ' + item.name;
			if(TextManager.isEnglish && item.hasRemNameEN) text += ' ' + item.remNameEN;
			else if(TextManager.isJapanese && item.hasRemNameJP) text += ' ' + item.remNameJP;
			else if(TextManager.isSChinese && item.hasRemNameSCH) text += ' ' + item.remNameSCH;
			else if(TextManager.isTChinese && item.hasRemNameTCH) text += ' ' + item.remNameTCH;
			else if(TextManager.isKorean && item.hasRemNameKR) text += ' ' + item.remNameKR;
			else text += ' ' + item.name;
		}
		else if(item.id === ITEM_SECOND_COST_ID) {
			//text += ' ' + item.name;
			if(TextManager.isEnglish && item.hasRemNameEN) text += '' + item.remNameEN;
			else if(TextManager.isJapanese && item.hasRemNameJP) text += '' + item.remNameJP;
			else if(TextManager.isSChinese && item.hasRemNameSCH) text += '' + item.remNameSCH;
			else if(TextManager.isTChinese && item.hasRemNameTCH) text += '' + item.remNameTCH;
			else if(TextManager.isKorean && item.hasRemNameKR) text += '' + item.remNameKR;
			else text += ' ' + item.name;
		}
		else {
			let iconWidth = Window_Base._iconWidth;
			dw -= iconWidth;
		}
		if(item.id === ITEM_WILL_COST_ID) this.changeTextColor(this.textColor(24));
		else if(item.id === ITEM_SECOND_COST_ID) this.changeTextColor(this.textColor(6));
		this.drawText(text, wx, wy + Yanfly.Param.SCIYBuffer, dw, 'right');
		this.changeTextColor(this.normalColor());
		dw -= this.textWidth(text);
    }
    return dw;
};

Window_SkillList.prototype.costWidth = function() {
    return WINDOW_SKILLLIST_SKILLCOST_WIDTH;
};

////////////
//////////////
// Game Actor
//////////////
////////////

Game_Actor.prototype.resetWillpowerCosts = function() {
	this._tempHealingThoughtsExtraCooldown = 0;
	this._tempMindOverMatterExtraCooldown = 0;
};

/////////
// Phases
/////////

//Mental Phase
Game_Actor.prototype.enterMentalPhase = function() {
	if(this.isMentalPhaseDisabled()) return;
	this.clearWillSkillsUsedCount();
	this._mentalPhase = true;
};

//Action Phase
Game_Actor.prototype.enterActionPhase = function() {
	this._mentalPhase = false;
	if(!this.isDontGainFatiguePerTurnPose()) {
		if(this.isInCombatPose()) {
			$gameParty.increaseFatigueGain(PRISON_FATIGUE_PER_TURN_COMBAT);
		}
		else if($gameParty.isInGloryBattle) {
			this.gloryBattle_fatigueGainPerTurn();
		}
		else {
			$gameParty.increaseFatigueGain(PRISON_FATIGUE_PER_TURN_OTHER);
		}
	}

	if(this.isStateAffected(STATE_KARRYN_RESIST_ORGASM_ID) &&
	this._stateTurns[STATE_KARRYN_RESIST_ORGASM_ID] === 1) {
		 this.removeState(STATE_KARRYN_RESIST_ORGASM_ID);
	}
};

Game_Actor.prototype.disableMentalPhase = function() {
	this._disableMentalPhase = true;
	this.enterActionPhase();
};
Game_Actor.prototype.enableMentalPhase = function() {
	this._disableMentalPhase = false;
};
Game_Actor.prototype.isMentalPhaseDisabled = function() {
	return this._disableMentalPhase;
};

Game_Actor.prototype.lastMentalCommandSymbol = function() {
    return this._lastMentalCommandSymbol;
};

Game_Actor.prototype.setLastMentalCommandSymbol = function(symbol) {
    this._lastMentalCommandSymbol = symbol;
};

Game_Actor.prototype.lastBattleSkill = function() {
	if(this.actionPhase)
		return this._lastBattleSkill.object();
	else if(this.mentalPhase)
		return this._lastMentalBattleSkill.object();
};

Game_Actor.prototype.setLastBattleSkill = function(skill) {
	if(this.actionPhase)
		this._lastBattleSkill.setObject(skill);
	else if(this.mentalPhase)
		this._lastMentalBattleSkill.setObject(skill);
};

Game_Actor.prototype.onTurnEnd = function() {
    this.clearResult();
	//this.resetSpriteBattlerPos();
    this.regenerateAll();

	if(!$gameScreen.isMapMode()) {
		this.checkForOrgasm();
		this.checkDisarmStateAtTurnEnd();
		this.checkJustOrgasmStateAtTurnEnd();
		this.emoteMasterManager();
		this.enterMentalPhase();
	}

    this.removeStatesAuto(2);

	if(!$gameScreen.isMapMode()) {
		$gameParty.onTurnEndSpecial();
	}
};

//New Wave
Game_Actor.prototype.onStartOfConBat = function() {
	//this.resetSpriteBattlerPos();
	this._dontResetSexPose = false;
    this.regenerateAll();
	this.checkForOrgasm();
	this.resetTauntAndConfidentOnNewWave();
	this.removeStatesOnNewWave();
	this.addState(STATE_KARRYN_FIRST_TURN_ID);
	this.enterMentalPhase();
};

//////////
// Willpower
////////////

Game_Actor.prototype.maxWill = function() {
	let value = WILLPOWER_BASE_WP;
	value += Math.round(this.mind * WILLPOWER_PER_MIND + this._paramLvl[PARAM_MIND_ID] * WILLPOWER_PER_MIND_PLVL);
	return value;
};

Game_Actor.prototype.willRegenMultipler = function() {
	var percentToOrgasm = this.currentPercentOfOrgasm(true) / 100;
	var multipler = 1 - (percentToOrgasm * 0.5);
	return multipler;
};

Game_Actor.prototype.clearWillSkillsUsedCount = function() {
    this._willSkillsUsed = 0;
};

Game_BattlerBase.prototype.paySkillItemCost = function(skill) {
    var array = this.skillItemCost(skill);
    var max = array.length;
    for (var i = 0; i < max; ++i) {
      var item = array[i][0];
      var cost = array[i][1];
      this.payIndividualSkillItemCost(item, cost, skill);
    }
};

Game_Actor.prototype.canPaySkillItemCost = function(skill) {
    let array = this.skillItemCost(skill);
    let max = array.length;
    for (let i = 0; i < max; ++i) {
		let item = array[i][0];
		let cost = array[i][1];
		if(item.id === ITEM_WILL_COST_ID) {
			return (this.will >= this.calculateWillSkillCost(cost, skill));
		}
		else if(item.id === ITEM_SECOND_COST_ID) {
			return true;
		}
    }
    return Game_BattlerBase.prototype.canPaySkillItemCost.call(this, skill);
};

Game_Actor.prototype.payIndividualSkillItemCost = function(item, cost, skill) {
    if(item.id === ITEM_WILL_COST_ID) {
		this.gainWill(-this.calculateWillSkillCost(cost, skill));
		this._willSkillsUsed++;
	}
	else if(item.id === ITEM_SECOND_COST_ID) {
		this.advanceTimeBySeconds(cost);
	}
	else $gameParty.loseItem(item, cost, false);
};

Game_Actor.prototype.calculateWillSkillCost = function(baseCost, skill) {
	let count = this._willSkillsUsed;
	let cost = baseCost;
	let skillId = skill.id;

	if(skillId === SKILL_RESTORE_MIND_ID) {
		return Math.round(cost * this.wsc);
	}

	if(count === 0 && !$gameParty._showTopRightTimeNumberFlag) {
		cost = Math.min(cost, this.will);
		cost = Math.max(1,cost);
	}
	else {
		cost += 5 * count;
	}

	if(this.isHorny && this.hasPassive(PASSIVE_HORNY_COUNT_TWO_ID)) {
		if(skillId === SKILL_SUPPRESS_MOUTH_DESIRE_ID || skillId === SKILL_SUPPRESS_BOOBS_DESIRE_ID ||
		skillId === SKILL_SUPPRESS_PUSSY_DESIRE_ID || skillId === SKILL_SUPPRESS_BUTT_DESIRE_ID ||
		skillId === SKILL_SUPPRESS_COCK_DESIRE_ID)
			cost += 10;
	}

	return Math.round(cost * this.wsc);
};

/////////
// Param
////////////

Game_Actor.prototype.willpowerParamRate = function(paramId) {
	let wpParamRate = 1;
	if(paramId === PARAM_CHARM_ID && this.isStateAffected(STATE_REALITY_MARBLE_ID))
		wpParamRate += this.willpowerRealityMarbleEffect();

    return wpParamRate;
};

Game_Actor.prototype.willpowerXParamPlus = function(id) {
	let wpXParamPlus = 0;

	if(id === XPARAM_CNT_ID && this.isStateAffected(STATE_FOCUS_ID))
		wpXParamPlus += this.willpowerFocusXParamEffect();
	if(this.isStateAffected(STATE_EYE_OF_THE_MIND_ID) && (id === XPARAM_HIT_ID || id === XPARAM_EVA_ID || id === XPARAM_CRIT_ID))
		wpXParamPlus += this.willpowerEyeOfTheMindXParamEffect();
	return wpXParamPlus;
};

Game_Actor.prototype.willpowerSParamRate = function(id) {
	let wpSParamRate = 1;

	if(id === SPARAM_WPATK_ID && this.isStateAffected(STATE_KI_ID))
		wpSParamRate += this.willpowerKiSParamEffect();

	return wpSParamRate;
};

////////
// Element Rate
//////////////

Game_Actor.prototype.willpowerElementRate = function(elementId) {
	let willpowerElementRate = 0;

	if(elementId === ELEMENT_TALK_ID) {
		if(this.isStateAffected(STATE_HEAR_NO_EVIL_ID)) willpowerElementRate += this.willpowerSeeHearNoEvilEffect();
	}
	else if(elementId === ELEMENT_SIGHT_ID) {
		if(this.isStateAffected(STATE_SEE_NO_EVIL_ID)) willpowerElementRate += this.willpowerSeeHearNoEvilEffect();
	}
	else if(elementId === ELEMENT_STRIP_ID) {
		if(this.isStateAffected(STATE_EMPRESS_CLOTHES_ID)) willpowerElementRate += this.willpowerEmpressClothesEffect();
		if(this.isStateAffected(STATE_EMPRESS_MAJESTY_ID)) willpowerElementRate += this.willpowerEmpressMajestyEffect();
	}

	return willpowerElementRate;
};

/////////////
// Suppress Desires
///////////////

Game_Actor.prototype.showEval_suppressDesires = function(area) {
	if(!DEBUG_MODE || this.justOrgasmed()) return false;
	if(this.isInSexPose()) {
		if(area == AREA_COCK &&
		(this.isBodySlotPenis(MOUTH_ID) || this.isBodySlotPenis(BOOBS_ID) || this.isBodySlotPenis(PUSSY_ID) || this.isBodySlotPenis(ANAL_ID) || this.isBodySlotPenis(LEFT_HAND_ID) || this.isBodySlotPenis(RIGHT_HAND_ID)) )
			return false;
		else if(area == AREA_MOUTH && (this.isBodySlotPenis(MOUTH_ID) || this.isBodySlotAnus(MOUTH_ID))) return false;
		else if(area == AREA_BOOBS && this.isBodySlotPenis(BOOBS_ID)) return false;
		else if(area == AREA_PUSSY && (this.isBodySlotPenis(PUSSY_ID) || this.isBodySlotTongue(PUSSY_ID))) return false;
		else if(area == AREA_BUTT && (this.isBodySlotPenis(ANAL_ID))) return false;
	}

	if(area == AREA_PUSSY && (this.isWearingClitToy() || this.isWearingPussyToy())) return false;
	else if(area == AREA_BUTT && (this.isWearingAnalToy())) return false;

	if(area == AREA_COCK) return this.cockDesire > 0;
	else if(area == AREA_MOUTH) return this.mouthDesire > 0;
	else if(area == AREA_BOOBS) return this.boobsDesire > 0;
	else if(area == AREA_PUSSY) return this.pussyDesire > 0;
	else if(area == AREA_BUTT) return this.buttDesire > 0;

	return false;
};

Game_Actor.prototype.afterEval_suppressDesires = function(area) {
	let baseValue = 15;
	baseValue += this.mind / 3;

	this.gainMindExp(35, $gameTroop.getAverageEnemyExperienceLvl());

	if(area == AREA_COCK) return this.gainCockDesire(-baseValue);
	else if(area == AREA_MOUTH) return this.gainMouthDesire(-baseValue);
	else if(area == AREA_BOOBS) return this.gainBoobsDesire(-baseValue);
	else if(area == AREA_PUSSY) return this.gainPussyDesire(-baseValue);
	else if(area == AREA_BUTT) return this.gainButtDesire(-baseValue);
	else console.log('afterEval_suppressDesires area error');
};

/////////////
// Conscious Desires
///////////////

Game_Actor.prototype.showEval_consciousDesires = function(area) {
	if(!DEBUG_MODE || this.justOrgasmed()) return false;

	if($gameParty.isInWaitressBattle) {
		if(!this.hasPassive(PASSIVE_BAR_WAITRESS_SEX_COUNT_ONE_ID)) return;
	}
	else if(this.isInReceptionistPose()) {
		if(!this.hasPassive(PASSIVE_RECEPTIONIST_VISITOR_SEX_COUNT_ONE_ID)) return;
	}

	if(area == AREA_COCK) return this.hasEdict(EDICT_RELEASE_COCK_DESIRE) && this.cockDesire < this.maxCockDesire();
	else if(area == AREA_MOUTH) return this.hasEdict(EDICT_RELEASE_DESIRES) && this.mouthDesire < this.maxMouthDesire();
	else if(area == AREA_BOOBS) return this.hasEdict(EDICT_RELEASE_DESIRES) && this.boobsDesire < this.maxBoobsDesire();
	else if(area == AREA_PUSSY) return this.hasEdict(EDICT_RELEASE_DESIRES) && this.pussyDesire < this.maxPussyDesire();
	else if(area == AREA_BUTT) return this.hasEdict(EDICT_RELEASE_DESIRES) && this.buttDesire < this.maxButtDesire();

	return false;
};

Game_Actor.prototype.afterEval_consciousDesires = function(area) {
	let baseValue = 10;
	baseValue += this.mind / 4;

	this.gainMindExp(35, $gameTroop.getAverageEnemyExperienceLvl());

	if(area == AREA_COCK) return this.gainCockDesire(baseValue);
	else if(area == AREA_MOUTH) return this.gainMouthDesire(baseValue);
	else if(area == AREA_BOOBS) return this.gainBoobsDesire(baseValue);
	else if(area == AREA_PUSSY) return this.gainPussyDesire(baseValue);
	else if(area == AREA_BUTT) return this.gainButtDesire(baseValue);
	else console.log('afterEval_consciousDesires area error');
};

///////////////
// Healing Thoughts
/////////////

Game_Actor.prototype.showEval_healingThoughts = function() {
	if(this.justOrgasmed()) return false;
	return this.hasEdict(EDICT_HEALING_THOUGHTS_ONE);
};
Game_Actor.prototype.dmgFormula_healingThoughts = function() {
	let percent = 0.15;
	percent += this.mind / 300
	if(this.hasEdict(EDICT_HEALING_THOUGHTS_TWO)) percent *= 1.3;

	let dmg = this.maxenergy * percent;

	this.gainMindExp(40, $gameTroop.getAverageEnemyExperienceLvl());
	return Math.round(dmg);
};

Game_Actor.prototype.cooldownEval_healingThoughts = function() {
	let baseCD = 3;
	if(this.hasEdict(EDICT_SPEC_DEFENSIVE_MIND_HEALING)) baseCD--;
	let currentCD = baseCD + Math.floor(this._tempHealingThoughtsExtraCooldown);
	this._tempHealingThoughtsExtraCooldown += 0.5;
	return currentCD;
};

///////////////
// Mind Over Matter
/////////////

Game_Actor.prototype.showEval_mindOverMatter = function() {
	if(this.justOrgasmed()) return false;
	return this.hasEdict(EDICT_MIND_OVER_MATTER);
};

Game_Actor.prototype.dmgFormula_mindOverMatter = function() {
	let percent = 0.5;
	percent += this.mind / 200
	let dmg = this.maxenergy * percent;

	this.gainMindExp(65, $gameTroop.getAverageEnemyExperienceLvl());
	return Math.round(dmg);
};

Game_Actor.prototype.cooldownEval_mindOverMatter = function() {
	let baseCD = 8;
	let currentCD = baseCD + this._tempMindOverMatterExtraCooldown;
	this._tempMindOverMatterExtraCooldown++;
	return currentCD;
};

////////////////////////////////////
// See No Evil, Hear No Evil, Speak No Evil
/////////////////////////////////////////

Game_Actor.prototype.showEval_seeNoEvil = function() {
	if(this.justOrgasmed()) return false;
	if(!DEBUG_MODE) return false;
	if(this.isInSexPose()) return false;
	return this.hasEdict(EDICT_SEE_NO_EVIL);
};
Game_Actor.prototype.showEval_hearNoEvil = function() {
	if(this.justOrgasmed()) return false;
	if(!DEBUG_MODE) return false;
	if(this.isInSexPose()) return false;
	return this.hasEdict(EDICT_HEAR_NO_EVIL);
};

Game_Actor.prototype.afterEval_seeNoEvil = function() {
	this.gainMindExp(40, $gameTroop.getAverageEnemyExperienceLvl());

	this.addState(STATE_SEE_NO_EVIL_ID);

	if(Karryn.isInReceptionistPose()) {
		this.setStateTurns(STATE_SEE_NO_EVIL_ID, RECEPTIONIST_MENTAL_PHASE_COOLDOWN);
	}
	else if($gameParty.isInGloryBattle) {
		this.setStateTurns(STATE_SEE_NO_EVIL_ID, GLORY_MENTAL_PHASE_COOLDOWN);
	}
};
Game_Actor.prototype.afterEval_hearNoEvil = function() {
	this.gainMindExp(40, $gameTroop.getAverageEnemyExperienceLvl());

	this.addState(STATE_HEAR_NO_EVIL_ID);

	if(Karryn.isInReceptionistPose()) {
		this.setStateTurns(STATE_HEAR_NO_EVIL_ID, RECEPTIONIST_MENTAL_PHASE_COOLDOWN);
	}
	else if($gameParty.isInGloryBattle) {
		this.setStateTurns(STATE_HEAR_NO_EVIL_ID, GLORY_MENTAL_PHASE_COOLDOWN);
	}
};

Game_Actor.prototype.willpowerSeeHearNoEvilEffect = function() {
	return -1 * (30 + this.mind) / 100;
};

Game_Actor.prototype.showEval_speakNoEvil = function() {
	if(this.justOrgasmed()) return false;
	if(!DEBUG_MODE) return false;
	if(this.isInSexPose()) return false;
	if(this.isStateAffected(STATE_SEE_NO_EVIL_ID) && this.isStateAffected(STATE_HEAR_NO_EVIL_ID))
		return this.hasEdict(EDICT_SPEAK_NO_EVIL);
};
Game_Actor.prototype.showEval_speakNoEvilGray = function() {
	if(this.isInSexPose() || !this.hasEdict(EDICT_SPEAK_NO_EVIL)  || !DEBUG_MODE) return false;
	if(this.isStateAffected(STATE_SEE_NO_EVIL_ID) && this.isStateAffected(STATE_HEAR_NO_EVIL_ID)) return false;
	return true;
};

Game_Actor.prototype.afterEval_speakNoEvil = function() {
	let baseValue = 20;
	baseValue += this.mind / 3;

	this.gainCockDesire(-baseValue);
	this.gainMouthDesire(-baseValue);
	this.gainBoobsDesire(-baseValue);
	this.gainPussyDesire(-baseValue);
	this.gainButtDesire(-baseValue);

	this.gainMindExp(45, $gameTroop.getAverageEnemyExperienceLvl());
};

/////////////
// Empress's Majesty
///////////////

Game_Actor.prototype.showEval_empressMajesty = function() {
	if(this.justOrgasmed()) return false;
	if(this.isInSexPose() || this.isClothingMaxDamaged() || !DEBUG_MODE) return false;
	return this.hasEdict(EDICT_EMPRESS_MAJESTY);
};

Game_Actor.prototype.afterEval_empressMajesty = function() {
	this.gainMindExp(35, $gameTroop.getAverageEnemyExperienceLvl());
};

Game_Actor.prototype.willpowerEmpressMajestyEffect = function() {
	return -1 * (25 + this.mind) / 100;
};

/////////////
// Empress's Clothes
///////////////

Game_Actor.prototype.showEval_empressClothes = function() {
	if(this.justOrgasmed()) return false;
	if(this.isInSexPose() || this.isClothingMaxDamaged() || !DEBUG_MODE) return false;
	return this.hasEdict(EDICT_EMPRESS_CLOTHES);
};

Game_Actor.prototype.afterEval_empressClothes = function() {
	this.gainMindExp(40, $gameTroop.getAverageEnemyExperienceLvl());
};

Game_Actor.prototype.willpowerEmpressClothesEffect = function() {
	return (15 + this.mind * 1.5) / 100;
};

/////////////
// Reality Marble
///////////////

Game_Actor.prototype.showEval_realityMarble = function() {
	if(this.justOrgasmed()) return false;
	if(this.isInWaitressServingPose() || this.isInReceptionistPose() || $gameParty.isInGloryBattle) return false;
	return this.hasEdict(EDICT_REALITY_MARBLE);
};

Game_Actor.prototype.afterEval_realityMarble = function() {
	this.gainMindExp(40, $gameTroop.getAverageEnemyExperienceLvl());
};

Game_Actor.prototype.willpowerRealityMarbleEffect = function() {
	return (this.mind) / 100;
};

/////////////
// Eye of the Mind
///////////////

Game_Actor.prototype.showEval_eyeOfTheMind = function() {
	if(this.justOrgasmed()) return false;

	return this.hasEdict(EDICT_EYE_OF_THE_MIND) &&
	(this.isInCombatPose() || (this.hasEdict(EDICT_SPEC_SENSUAL_MIND_EOTM) && this.isInSexPose()));
};
Game_Actor.prototype.afterEval_eyeOfTheMind = function() {
	this.gainMindExp(40, $gameTroop.getAverageEnemyExperienceLvl());

	this.addState(STATE_EYE_OF_THE_MIND_ID);

	if(Karryn.isInReceptionistPose()) {
		this.setStateTurns(STATE_EYE_OF_THE_MIND_ID, RECEPTIONIST_MENTAL_PHASE_COOLDOWN);
	}
	else if($gameParty.isInGloryBattle) {
		this.setStateTurns(STATE_EYE_OF_THE_MIND_ID, GLORY_MENTAL_PHASE_COOLDOWN);
	}
};
Game_Actor.prototype.willpowerEyeOfTheMindXParamEffect = function() {
	return this.mind / 100;
};
Game_Actor.prototype.willpowerEyeOfTheMindCritDmgEffect = function() {
	return this.mind / 150;
};

/////////////
// Ki and Focus
///////////////

Game_Actor.prototype.showEval_ki = function() {
	if(this.justOrgasmed()) return false;
	return this.isInCombatPose();
};
Game_Actor.prototype.afterEval_ki = function() {
	this.gainMindExp(35, $gameTroop.getAverageEnemyExperienceLvl());
};
Game_Actor.prototype.willpowerKiSParamEffect = function() {
	return (30 + this.mind) / 100;
};
Game_Actor.prototype.willpowerKiCritDmgEffect = function() {
	return this.mind / 100;
};

Game_Actor.prototype.showEval_focus = function() {
	if(this.justOrgasmed()) return false;
	return this.isInCombatPose();
};
Game_Actor.prototype.afterEval_focus = function() {
	this.gainMindExp(35, $gameTroop.getAverageEnemyExperienceLvl());
};
Game_Actor.prototype.willpowerFocusXParamEffect = function() {
	if(!this.isInCombatPose()) return 0;
	return (20 + this.mind / 2) / 100;
};
Game_Actor.prototype.willpowerFocusOverblowProtectionEffect = function() {
	if(!this.isInCombatPose()) return 0;
	return this.mind / 1000;
};

/////////////
// Edging Control
///////////////

Game_Actor.prototype.showEval_edgingControl = function() {
	if(this.justOrgasmed()) return false;
	if(!DEBUG_MODE) return false;
	if(this.isInWaitressServingPose()) return false;
	return this.hasEdict(EDICT_EDGING_CONTROL) && !this.isInDownPose();
};
Game_Actor.prototype.afterEval_edgingControl = function() {
	this.gainMindExp(30, $gameTroop.getAverageEnemyExperienceLvl());

	this.addState(STATE_KARRYN_EDGING_CONTROL_ID);

	if(Karryn.isInReceptionistPose()) {
		this.setStateTurns(STATE_KARRYN_EDGING_CONTROL_ID, RECEPTIONIST_MENTAL_PHASE_COOLDOWN);
	}
	else if($gameParty.isInGloryBattle) {
		this.setStateTurns(STATE_KARRYN_EDGING_CONTROL_ID, GLORY_MENTAL_PHASE_COOLDOWN);
	}
};
Game_Actor.prototype.willpowerEdgingControlEffect = function() {
	return 1 + ((10 + this.mind * 2) / 100);
};
Game_Actor.prototype.addEnemyEdgingControlStateToTarget = function(target) {
	if(this.isStateAffected(STATE_KARRYN_EDGING_CONTROL_ID) && target.isEnemy()) {
		target.addState(STATE_ENEMY_EDGING_CONTROL_ID);
	}
};

/////////////
// Resist Orgasm
///////////////

Game_Actor.prototype.showEval_resistOrgasm = function() {
	if(this.justOrgasmed()) return false;
	return DEBUG_MODE && this.hasEdict(EDICT_RESIST_ORGASM);
};
Game_Actor.prototype.afterEval_resistOrgasm = function() {
	this.gainMindExp(45, $gameTroop.getAverageEnemyExperienceLvl());

	this.addState(STATE_KARRYN_RESIST_ORGASM_ID);
	this.addState(STATE_KARRYN_RESIST_ORGASM_ICON_ID);

	if(Karryn.isInReceptionistPose()) {
		this.setStateTurns(STATE_KARRYN_RESIST_ORGASM_ID, RECEPTIONIST_MENTAL_PHASE_COOLDOWN);
		this.setStateTurns(STATE_KARRYN_RESIST_ORGASM_ICON_ID, RECEPTIONIST_MENTAL_PHASE_COOLDOWN);
	}
	else if($gameParty.isInGloryBattle) {
		this.setStateTurns(STATE_KARRYN_RESIST_ORGASM_ID, GLORY_MENTAL_PHASE_COOLDOWN);
		this.setStateTurns(STATE_KARRYN_RESIST_ORGASM_ICON_ID, GLORY_MENTAL_PHASE_COOLDOWN);
	}
};
Game_Actor.prototype.willpowerResistOrgasmEffect = function() {
	return 1 + ((20 + this.mind * 2) / 100);
};

////////
// Restore Mind

Game_Actor.prototype.showEval_restoreMind = function() {
	return this.justOrgasmed() && !this.isInMasturbationLevel1Pose();
};
Game_Actor.prototype.afterEval_restoreMind = function() {
	let chance = this.mind * 2.5;
	let reduction = 1;

	if(chance > 90) {
		if(Math.randomInt(100) < (chance - 90))
			reduction++;
	}
	if(Math.randomInt(100) < chance) {
		if($gameParty._showTopRightTimeNumberFlag) {
			reduction *= 2;
		}

		if(this.stamina === 0 && this.getJustOrgasmedStateTurns() <= reduction) {
			this._remLine_skipNextDownStamina = true;
		}

		this.increaseJustOrgasmedStateTurns(-1 * reduction);

		if(!this.justOrgasmed()) {
			BattleManager._logWindow.push('addText', TextManager.restoreMindFullSuccess.format(this.name()));
			this.emoteMasterManager();
		}
		else {
			BattleManager._logWindow.push('addText', TextManager.restoreMindPartialSuccess.format(this.name()));
		}

		this.gainMindExp(35, $gameTroop.getAverageEnemyExperienceLvl());
	}
	else {
		BattleManager._logWindow.push('addText', TextManager.restoreMindFailure.format(this.name()));
		this.gainMindExp(25, $gameTroop.getAverageEnemyExperienceLvl());
	}
	if(!this.hasEdict(EDICT_SPEC_SENSUAL_MIND_RESTORE)) this.enterActionPhase();
};

//unused
Game_Actor.prototype.tachieHalberdTone = function() {
	var WILLPOWER_KI_HALBERD_COLOR_RED = 0;
	var WILLPOWER_KI_HALBERD_COLOR_GREEN = -10;
	var WILLPOWER_KI_HALBERD_COLOR_BLUE = -45;

	var tone = [0, 0, 0];
	if(this.isStateAffected(STATE_KI_ID)) {
		tone = [WILLPOWER_KI_HALBERD_COLOR_RED, WILLPOWER_KI_HALBERD_COLOR_GREEN, WILLPOWER_KI_HALBERD_COLOR_BLUE];
	}
	return tone;
};