Raycaster

Equine.java

Mar 1st, 2021
795
318 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.planet_ink.coffee_mud.Races;
  2. import com.planet_ink.coffee_mud.core.interfaces.*;
  3. import com.planet_ink.coffee_mud.core.*;
  4. import com.planet_ink.coffee_mud.core.collections.*;
  5. import com.planet_ink.coffee_mud.Abilities.interfaces.*;
  6. import com.planet_ink.coffee_mud.Areas.interfaces.*;
  7. import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
  8. import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
  9. import com.planet_ink.coffee_mud.Commands.interfaces.*;
  10. import com.planet_ink.coffee_mud.Common.interfaces.*;
  11. import com.planet_ink.coffee_mud.Exits.interfaces.*;
  12. import com.planet_ink.coffee_mud.Items.interfaces.*;
  13. import com.planet_ink.coffee_mud.Libraries.interfaces.*;
  14. import com.planet_ink.coffee_mud.Locales.interfaces.*;
  15. import com.planet_ink.coffee_mud.MOBS.interfaces.*;
  16. import com.planet_ink.coffee_mud.Races.interfaces.*;
  17.  
  18. import java.util.*;
  19.  
  20. /*
  21.    Copyright 2003-2021 Bo Zimmerman
  22.  
  23.    Licensed under the Apache License, Version 2.0 (the "License");
  24.    you may not use this file except in compliance with the License.
  25.    You may obtain a copy of the License at
  26.  
  27.        http://www.apache.org/licenses/LICENSE-2.0
  28.  
  29.    Unless required by applicable law or agreed to in writing, software
  30.    distributed under the License is distributed on an "AS IS" BASIS,
  31.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  32.    See the License for the specific language governing permissions and
  33.    limitations under the License.
  34. */
  35. public class Equine extends StdRace
  36. {
  37.     @Override
  38.     public String ID()
  39.     {
  40.         return "Equine";
  41.     }
  42.  
  43.     private final static String localizedStaticName = CMLib.lang().L("Equine");
  44.  
  45.     @Override
  46.     public String name()
  47.     {
  48.         return localizedStaticName;
  49.     }
  50.  
  51.     @Override
  52.     public int shortestMale()
  53.     {
  54.         return 60;
  55.     }
  56.  
  57.     @Override
  58.     public int shortestFemale()
  59.     {
  60.         return 60;
  61.     }
  62.  
  63.     @Override
  64.     public int heightVariance()
  65.     {
  66.         return 12;
  67.     }
  68.  
  69.     @Override
  70.     public int lightestWeight()
  71.     {
  72.         return 1250;
  73.     }
  74.  
  75.     @Override
  76.     public int weightVariance()
  77.     {
  78.         return 400;
  79.     }
  80.  
  81.     @Override
  82.     public long forbiddenWornBits()
  83.     {
  84.         return ~(Wearable.WORN_HEAD | Wearable.WORN_EARS | Wearable.WORN_EYES | Wearable.WORN_NECK);
  85.     }
  86.  
  87.     private final static String localizedStaticRacialCat = CMLib.lang().L("Equine");
  88.  
  89.     @Override
  90.     public String racialCategory()
  91.     {
  92.         return localizedStaticRacialCat;
  93.     }
  94.  
  95.     private final String[]  racialAbilityNames          = { "Fighter_Kick", "HorseSpeak", "Skill_Buck" };
  96.     private final int[]     racialAbilityLevels         = { 5, 1, 5 };
  97.     private final int[]     racialAbilityProficiencies  = { 40, 100, 50 };
  98.     private final boolean[] racialAbilityQuals          = { false, false, false };
  99.     private final String[]  racialAbilityParms          = { "", "", "" };
  100.  
  101.     @Override
  102.     protected String[] racialAbilityNames()
  103.     {
  104.         return racialAbilityNames;
  105.     }
  106.  
  107.     @Override
  108.     protected int[] racialAbilityLevels()
  109.     {
  110.         return racialAbilityLevels;
  111.     }
  112.  
  113.     @Override
  114.     protected int[] racialAbilityProficiencies()
  115.     {
  116.         return racialAbilityProficiencies;
  117.     }
  118.  
  119.     @Override
  120.     protected boolean[] racialAbilityQuals()
  121.     {
  122.         return racialAbilityQuals;
  123.     }
  124.  
  125.     @Override
  126.     public String[] racialAbilityParms()
  127.     {
  128.         return racialAbilityParms;
  129.     }
  130.  
  131.     @Override
  132.     public boolean useRideClass()
  133.     {
  134.         return true;
  135.     }
  136.  
  137.     //                                an ey ea he ne ar ha to le fo no gi mo wa ta wi
  138.     private static final int[] parts={0 ,2 ,2 ,1 ,1 ,0 ,0 ,1 ,4 ,4 ,1 ,0 ,1 ,1 ,1 ,0 };
  139.  
  140.     @Override
  141.     public int[] bodyMask()
  142.     {
  143.         return parts;
  144.     }
  145.  
  146.     private final int[] agingChart  = { 0, 1, 2, 6, 9, 18, 24, 28, 32 };
  147.  
  148.     @Override
  149.     public int[] getAgingChart()
  150.     {
  151.         return agingChart;
  152.     }
  153.  
  154.     private static Vector<RawMaterial>  resources   = new Vector<RawMaterial>();
  155.  
  156.     @Override
  157.     public int availabilityCode()
  158.     {
  159.         return Area.THEME_ALLTHEMES | Area.THEME_SKILLONLYMASK;
  160.     }
  161.  
  162.     @Override
  163.     public void affectCharStats(final MOB affectedMOB, final CharStats affectableStats)
  164.     {
  165.         super.affectCharStats(affectedMOB, affectableStats);
  166.         affectableStats.setRacialStat(CharStats.STAT_STRENGTH,18);
  167.         affectableStats.setRacialStat(CharStats.STAT_DEXTERITY,6);
  168.         affectableStats.setRacialStat(CharStats.STAT_INTELLIGENCE,1);
  169.     }
  170.  
  171.     @Override
  172.     public void unaffectCharStats(final MOB affectedMOB, final CharStats affectableStats)
  173.     {
  174.         super.unaffectCharStats(affectedMOB, affectableStats);
  175.         affectableStats.setStat(CharStats.STAT_STRENGTH,affectedMOB.baseCharStats().getStat(CharStats.STAT_STRENGTH));
  176.         affectableStats.setStat(CharStats.STAT_MAX_STRENGTH_ADJ,affectedMOB.baseCharStats().getStat(CharStats.STAT_MAX_STRENGTH_ADJ));
  177.         affectableStats.setStat(CharStats.STAT_DEXTERITY,affectedMOB.baseCharStats().getStat(CharStats.STAT_DEXTERITY));
  178.         affectableStats.setStat(CharStats.STAT_MAX_DEXTERITY_ADJ,affectedMOB.baseCharStats().getStat(CharStats.STAT_MAX_DEXTERITY_ADJ));
  179.         affectableStats.setStat(CharStats.STAT_INTELLIGENCE,affectedMOB.baseCharStats().getStat(CharStats.STAT_INTELLIGENCE));
  180.         affectableStats.setStat(CharStats.STAT_MAX_INTELLIGENCE_ADJ,affectedMOB.baseCharStats().getStat(CharStats.STAT_MAX_INTELLIGENCE_ADJ));
  181.     }
  182.  
  183.     @Override
  184.     public Weapon myNaturalWeapon()
  185.     {
  186.         if(naturalWeapon==null)
  187.         {
  188.             naturalWeapon=CMClass.getWeapon("StdWeapon");
  189.             naturalWeapon.setName(L("a pair of hooves"));
  190.             naturalWeapon.setMaterial(RawMaterial.RESOURCE_BONE);
  191.             naturalWeapon.setUsesRemaining(1000);
  192.             naturalWeapon.setWeaponDamageType(Weapon.TYPE_BASHING);
  193.         }
  194.         return naturalWeapon;
  195.     }
  196.  
  197.     @Override
  198.     public String makeMobName(final char gender, final int age)
  199.     {
  200.         switch(age)
  201.         {
  202.             case Race.AGE_INFANT:
  203.             case Race.AGE_TODDLER:
  204.                 return name().toLowerCase()+" foal";
  205.             case Race.AGE_CHILD:
  206.             case Race.AGE_YOUNGADULT:
  207.             {
  208.                 switch(gender)
  209.                 {
  210.                 case 'M':
  211.                 case 'm':
  212.                     return name().toLowerCase() + " colt";
  213.                 case 'F':
  214.                 case 'f':
  215.                     return name().toLowerCase() + " filly";
  216.                 default:
  217.                     return "young " + name().toLowerCase();
  218.                 }
  219.             }
  220.             case Race.AGE_MATURE:
  221.             case Race.AGE_MIDDLEAGED:
  222.             default:
  223.             {
  224.                 switch(gender)
  225.                 {
  226.                 case 'M':
  227.                 case 'm':
  228.                     return name().toLowerCase() + " stud";
  229.                 case 'F':
  230.                 case 'f':
  231.                     return name().toLowerCase() + " stallion";
  232.                 default:
  233.                     return name().toLowerCase();
  234.                 }
  235.             }
  236.             case Race.AGE_OLD:
  237.             case Race.AGE_VENERABLE:
  238.             case Race.AGE_ANCIENT:
  239.             {
  240.                 switch(gender)
  241.                 {
  242.                 case 'M':
  243.                 case 'm':
  244.                     return "old male " + name().toLowerCase();
  245.                 case 'F':
  246.                 case 'f':
  247.                     return "old female " + name().toLowerCase();
  248.                 default:
  249.                     return "old " + name().toLowerCase();
  250.                 }
  251.             }
  252.         }
  253.     }
  254.  
  255.     @Override
  256.     public String healthText(final MOB viewer, final MOB mob)
  257.     {
  258.         final double pct=(CMath.div(mob.curState().getHitPoints(),mob.maxState().getHitPoints()));
  259.  
  260.         if(pct<.10)
  261.             return L("^r@x1^r is hovering on deaths door!^N",mob.name(viewer));
  262.         else
  263.         if(pct<.20)
  264.             return L("^r@x1^r is covered in blood and matted hair.^N",mob.name(viewer));
  265.         else
  266.         if(pct<.30)
  267.             return L("^r@x1^r is bleeding badly from lots of wounds.^N",mob.name(viewer));
  268.         else
  269.         if(pct<.40)
  270.             return L("^y@x1^y has large patches of bloody matted fur.^N",mob.name(viewer));
  271.         else
  272.         if(pct<.50)
  273.             return L("^y@x1^y has some bloody matted fur.^N",mob.name(viewer));
  274.         else
  275.         if(pct<.60)
  276.             return L("^p@x1^p has a lot of cuts and gashes.^N",mob.name(viewer));
  277.         else
  278.         if(pct<.70)
  279.             return L("^p@x1^p has a few cut patches.^N",mob.name(viewer));
  280.         else
  281.         if(pct<.80)
  282.             return L("^g@x1^g has a cut patch of fur.^N",mob.name(viewer));
  283.         else
  284.         if(pct<.90)
  285.             return L("^g@x1^g has some disheveled fur.^N",mob.name(viewer));
  286.         else
  287.         if(pct<.99)
  288.             return L("^g@x1^g has some misplaced hairs.^N",mob.name(viewer));
  289.         else
  290.             return L("^c@x1^c is in perfect health.^N",mob.name(viewer));
  291.     }
  292.  
  293.     @Override
  294.     public List<RawMaterial> myResources()
  295.     {
  296.         synchronized(resources)
  297.         {
  298.             if(resources.size()==0)
  299.             {
  300.                 resources.addElement(makeResource
  301.                 (L("@x1 mane",name().toLowerCase()),RawMaterial.RESOURCE_FUR));
  302.                 for(int i=0;i<2;i++)
  303.                 {
  304.                     resources.addElement(makeResource
  305.                     (L("a strip of @x1 leather",name().toLowerCase()),RawMaterial.RESOURCE_LEATHER));
  306.                 }
  307.                 resources.addElement(makeResource
  308.                 (L("a pound of @x1 meat",name().toLowerCase()),RawMaterial.RESOURCE_BEEF));
  309.                 resources.addElement(makeResource
  310.                 (L("some @x1 blood",name().toLowerCase()),RawMaterial.RESOURCE_BLOOD));
  311.                 resources.addElement(makeResource
  312.                 (L("a pile of @x1 bones",name().toLowerCase()),RawMaterial.RESOURCE_BONE));
  313.             }
  314.         }
  315.         return resources;
  316.     }
  317. }
  318.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×