<commit_before>package com.planet_ink.coffee_mud.CharClasses;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.StdAbility;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.TimeClock.MoonPhase;
import com.planet_ink.coffee_mud.Common.interfaces.TimeClock.TidePhase;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;


/*
   Copyright 2016-2016 <NAME>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

	   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

public class Pirate extends Thief
{
	@Override
	public String ID()
	{
		return "Pirate";
	}

	private final static String localizedStaticName = CMLib.lang().L("Pirate");

	@Override
	public String name()
	{
		return localizedStaticName;
	}

	public Pirate()
	{
		super();
		maxStatAdj[CharStats.STAT_DEXTERITY]=4;
		maxStatAdj[CharStats.STAT_CHARISMA]=4;
	}
	
	@Override
	public int availabilityCode()
	{
		return Area.THEME_FANTASY;
	}

	private final String[] raceRequiredList=new String[]{"All","-Equine"};

	@Override
	public String[] getRequiredRaceList()
	{
		return raceRequiredList;
	}

	@SuppressWarnings("unchecked")
	private final Pair<String, Integer>[] minimumStatRequirements = new Pair[] 
	{ 
		new Pair<String, Integer>("Dexterity", Integer.valueOf(5)), 
		new Pair<String, Integer>("Charisma", Integer.valueOf(5)) 
	};

	@Override
	public Pair<String, Integer>[] getMinimumStatRequirements()
	{
		return minimumStatRequirements;
	}

	@Override
	public String getOtherBonusDesc()
	{
		return L("Bonus XP in ship combat, and combat bonus for each fake limb.");
	}

	@Override
	public String getOtherLimitsDesc()
	{
		return L("Get less leniency from the law, and can be paid to leave combat.");
	}

	@Override
	public void initializeClass()
	{
		super.initializeClass();
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Write",0,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Specialization_Ranged",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Specialization_EdgedWeapon",50,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Specialization_Sword",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"ThievesCant",50,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Recall",50,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Swim",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Climb",0,false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Thief_Superstition",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Thief_RopeSwing",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Thief_ImprovedBoarding",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),2,"Thief_LocateAlcohol",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),2,"Thief_HoldYourLiquor",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),3,"Thief_Belay",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),3,"Thief_Hide",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),4,"Thief_RideTheRigging",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),4,"Thief_Sneak",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),4,"Skill_SeaLegs",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),5,"Thief_BuriedTreasure",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),5,"Skill_WandUse",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),6,"Thief_Wenching",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),6,"Skill_Dodge",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),7,"Thief_TreasureMap",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),7,"Thief_Peek",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Thief_WalkThePlank",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Skill_SeaMapping",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Skill_Disarm",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),9,"Thief_Plunder",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),9,"Skill_Parry",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),10,"Skill_SeaCharting",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),10,"Thief_BackStab",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Skill_DeadReckoning",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Thief_Steal",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Skill_Trip",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),12,"Skill_SeaNavigation",false,new XVector<String>("Skill_SeaCharting"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),12,"Skill_TwoWeaponFighting",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),12,"Thief_Listen",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Thief_Scuttle",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Thief_Bind",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Thief_FenceLoot",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Prayer_Curse",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Song_PirateShanty",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Thief_PiecesOfEight",false,new XVector<String>("Thief_BuriedTreasure"));

		CMLib.ableMapper().addCharAbilityMapping(ID(),15,"Thief_PirateFamiliar",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),15,"Thief_ConcealItem",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),16,"Thief_PubContacts",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),16,"Skill_Stability",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),17,"Thief_PetSpy",false,new XVector<String>("Thief_PirateFamiliar"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),17,"Skill_Attack2",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Skill_CombatRepairs",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Thief_SilentLoot",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Thief_WarningShot",true);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Skill_FoulWeatherSailing",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Thief_Distract",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Thief_PayOff",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),20,"Thief_PetSteal",false,new XVector<String>("Thief_PirateFamiliar"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),20,"Thief_Alertness",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),21,"Thief_MerchantFlag",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),21,"Thief_Articles",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),22,"Thief_RammingSpeed",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),22,"Thief_SmugglersHold",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),23,"Skill_InterceptShip",false,new XVector<String>("Skill_SeaCharting"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),23,"Thief_MastShot",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),24,"Thief_HideShip",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),24,"Skill_AttackHalf",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),25,"Skill_AwaitShip",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),30,"Thief_SilentRunning",true);
	}

	@Override
	public boolean okMessage(final Environmental myHost, final CMMsg msg)
	{
		if(!super.okMessage(myHost, msg))
			return false;
		if (msg.amITarget(myHost)
		&& (msg.targetMinor() == CMMsg.TYP_GIVE)
		&& (msg.source() != myHost)
		&& (msg.tool() instanceof Coins)
		&& (myHost instanceof MOB)
		&& (((MOB)myHost).getVictim()==msg.source()))
		{
			final double amt = ((Coins)msg.tool()).getTotalValue();
			final double min = (50.0 * ((MOB)myHost).phyStats().level()); 
			if(amt >= min)<commit_msg>Pirates no longer regain limbs upon death.<commit_after>package com.planet_ink.coffee_mud.CharClasses;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.StdAbility;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.TimeClock.MoonPhase;
import com.planet_ink.coffee_mud.Common.interfaces.TimeClock.TidePhase;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

import java.util.*;


/*
   Copyright 2016-2016 <NAME>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

	   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

public class Pirate extends Thief
{
	@Override
	public String ID()
	{
		return "Pirate";
	}

	private final static String localizedStaticName = CMLib.lang().L("Pirate");

	@Override
	public String name()
	{
		return localizedStaticName;
	}

	public Pirate()
	{
		super();
		maxStatAdj[CharStats.STAT_DEXTERITY]=4;
		maxStatAdj[CharStats.STAT_CHARISMA]=4;
	}
	
	@Override
	public int availabilityCode()
	{
		return Area.THEME_FANTASY;
	}

	private final String[] raceRequiredList=new String[]{"All","-Equine"};

	@Override
	public String[] getRequiredRaceList()
	{
		return raceRequiredList;
	}

	@SuppressWarnings("unchecked")
	private final Pair<String, Integer>[] minimumStatRequirements = new Pair[] 
	{ 
		new Pair<String, Integer>("Dexterity", Integer.valueOf(5)), 
		new Pair<String, Integer>("Charisma", Integer.valueOf(5)) 
	};

	@Override
	public Pair<String, Integer>[] getMinimumStatRequirements()
	{
		return minimumStatRequirements;
	}

	@Override
	public String getOtherBonusDesc()
	{
		return L("Bonus XP in ship combat, and combat bonus for each fake limb.");
	}

	@Override
	public String getOtherLimitsDesc()
	{
		return L("Get less leniency from the law, no limb recovery after death, and can be paid to leave combat.");
	}

	@Override
	public void initializeClass()
	{
		super.initializeClass();
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Write",0,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Specialization_Ranged",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Specialization_EdgedWeapon",50,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Specialization_Sword",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"ThievesCant",50,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Recall",50,true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Swim",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Skill_Climb",0,false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Thief_Superstition",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Thief_RopeSwing",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Thief_ImprovedBoarding",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),2,"Thief_LocateAlcohol",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),2,"Thief_HoldYourLiquor",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),3,"Thief_Belay",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),3,"Thief_Hide",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),4,"Thief_RideTheRigging",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),4,"Thief_Sneak",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),4,"Skill_SeaLegs",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),5,"Thief_BuriedTreasure",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),5,"Skill_WandUse",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),6,"Thief_Wenching",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),6,"Skill_Dodge",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),7,"Thief_TreasureMap",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),7,"Thief_Peek",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Thief_WalkThePlank",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Skill_SeaMapping",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Skill_Disarm",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),9,"Thief_Plunder",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),9,"Skill_Parry",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),10,"Skill_SeaCharting",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),10,"Thief_BackStab",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Skill_DeadReckoning",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Thief_Steal",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Skill_Trip",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),12,"Skill_SeaNavigation",false,new XVector<String>("Skill_SeaCharting"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),12,"Skill_TwoWeaponFighting",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),12,"Thief_Listen",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Thief_Scuttle",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Thief_Bind",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Thief_FenceLoot",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Prayer_Curse",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Song_PirateShanty",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),14,"Thief_PiecesOfEight",false,new XVector<String>("Thief_BuriedTreasure"));

		CMLib.ableMapper().addCharAbilityMapping(ID(),15,"Thief_PirateFamiliar",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),15,"Thief_ConcealItem",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),16,"Thief_PubContacts",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),16,"Skill_Stability",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),17,"Thief_PetSpy",false,new XVector<String>("Thief_PirateFamiliar"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),17,"Skill_Attack2",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Skill_CombatRepairs",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Thief_SilentLoot",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),18,"Thief_WarningShot",true);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Skill_FoulWeatherSailing",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Thief_Distract",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Thief_PayOff",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),20,"Thief_PetSteal",false,new XVector<String>("Thief_PirateFamiliar"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),20,"Thief_Alertness",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),21,"Thief_MerchantFlag",true);
		CMLib.ableMapper().addCharAbilityMapping(ID(),21,"Thief_Articles",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),22,"Thief_RammingSpeed",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),22,"Thief_SmugglersHold",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),23,"Skill_InterceptShip",false,new XVector<String>("Skill_SeaCharting"));
		CMLib.ableMapper().addCharAbilityMapping(ID(),23,"Thief_MastShot",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),24,"Thief_HideShip",false);
		CMLib.ableMapper().addCharAbilityMapping(ID(),24,"Skill_AttackHalf",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),25,"Skill_AwaitShip",false);
		
		CMLib.ableMapper().addCharAbilityMapping(ID(),30,"Thief_SilentRunning",true);
	}

	@Override
	public boolean okMessage(final Environmental myHost, final CMMsg msg)
	{
		if(!super.okMessage(myHost, msg))
			return false;

		if((msg.source() == myHost) && (msg.sourceMinor()==CMMsg.TYP_DEATH))
		{
			final Ability A=msg.source().fetchEffect("Amputation");
			msg.addTrailerRunnable(new Runnable()
			{
				private final String amuText = A.text();
				private final MOB mob=msg.source();
				@Override
				public void run()
				{
					if(mob.fetchEffect("Amputation")==null)
					{
						final Ability A=CMClass.getAbility("Amputation");
						mob.addNonUninvokableEffect(A);
						A.setMiscText(amuText);
						mob.recoverCharStats();
						mob.recoverMaxState();
						mob.recoverPhyStats();
					}
				}
			});
		}

		if (msg.amITarget(myHost)
		&& (msg.targetMinor() == CMMsg.TYP_GIVE)
		&& (msg.source() != myHost)
		&& (msg.tool() instanceof Coins)
		&& (myHost instanceof MOB)
		&& (((MOB)myHost).getVictim()==msg.source()))
		{
			final double amt = ((Coins)msg.tool()).getTotalValue();
			final double min = (50.0 * ((MOB)myHost).phyStats().level()); 
			if(amt >= min)
{'fraction_non_alphanumeric': 0.1557837837837838, 'fraction_numerical': 0.014378378378378378, 'mean_word_length': 7.494490358126722, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5100904', 'n_tokens_mistral': 7126, 'n_tokens_neox': 6440, 'n_words': 716}