@Override public void loadImages() { if (redImages == null) redImages = Assets.loadImages(imageFormatInfo.getRedId(), 0, 0, 1, 1); if (orangeImages == null) orangeImages = Assets.loadImages(imageFormatInfo.getOrangeId(), 0, 0, 1, 1); if (blueImages == null) blueImages = Assets.loadImages(imageFormatInfo.getBlueId(), 0, 0, 1, 1); if (greenImages == null) greenImages = Assets.loadImages(imageFormatInfo.getGreenId(), 0, 0, 1, 1); if (whiteImages == null) whiteImages = Assets.loadImages(imageFormatInfo.getWhiteId(), 0, 0, 1, 1); }
public static Image[] getWhiteImages() { if (whiteImages == null) { whiteImages = Assets.loadImages(imageFormatInfo.getWhiteId(), 3, 4, 0, 0, 1, 1); } return whiteImages; }
public static Image[] getOrangeImages() { if (orangeImages == null) { orangeImages = Assets.loadImages(imageFormatInfo.getOrangeId(), 3, 4, 0, 0, 1, 1); } return orangeImages; }
public static Image[] getGreenImages() { if (greenImages == null) { greenImages = Assets.loadImages(imageFormatInfo.getGreenId(), 3, 4, 0, 0, 1, 1); } return greenImages; }
public static Image[] getBlueImages() { if (blueImages == null) { blueImages = Assets.loadImages(imageFormatInfo.getBlueId(), 3, 4, 0, 0, 1, 1); } return blueImages; }
public static Image[] getRedImages() { if (redImages == null) { redImages = Assets.loadImages(imageFormatInfo.getRedId(), 3, 4, 0, 0, 1, 1); } return redImages; }
public class DarkKnight extends MeleeSoldier { private static ImageFormatInfo imageFormatInfo; private static Image[] images = Assets.loadImages(R.drawable.darkknight, 0, 0, 1, 1); private static final AttackerQualities staticAttackerQualities; @Override protected AttackerQualities getStaticAQ() { return staticAttackerQualities; } private static final LivingQualities staticLivingQualities; @Override protected LivingQualities getStaticLQ() { return staticLivingQualities; } private static Cost cost = new Cost(4000, 4000, 0, 2); static { float dp = Rpg.getDp(); imageFormatInfo = new ImageFormatInfo(0, 0, 0, 0, 1, 1); staticAttackerQualities = new AttackerQualities(); staticAttackerQualities.setStaysAtDistanceSquared(0); staticAttackerQualities.setFocusRangeSquared(5000 * dp * dp); staticAttackerQualities.setAttackRangeSquared(Rpg.getMeleeAttackRangeSquared()); staticAttackerQualities.setDamage(60); staticAttackerQualities.setdDamageAge(0); staticAttackerQualities.setdDamageLvl(5); staticAttackerQualities.setROF(1000); staticLivingQualities = new LivingQualities(); staticLivingQualities.setRequiresBLvl(10); staticLivingQualities.setRequiresAge(Age.STEEL); staticLivingQualities.setRequiresTcLvl(16); staticLivingQualities.setLevel(1); staticLivingQualities.setFullHealth(800); staticLivingQualities.setHealth(800); staticLivingQualities.setdHealthAge(0); staticLivingQualities.setdHealthLvl(30); staticLivingQualities.setFullMana(0); staticLivingQualities.setMana(0); staticLivingQualities.setHpRegenAmount(1); staticLivingQualities.setRegenRate(1000); staticLivingQualities.setArmor(10); staticLivingQualities.setdArmorAge(0); staticLivingQualities.setdArmorLvl(2); staticLivingQualities.setSpeed(2.3f * dp); } { setAQ(new AttackerQualities(staticAttackerQualities, getLQ().getBonuses())); } public DarkKnight(vector loc, Teams team) { super(team); setLoc(loc); setTeam(team); } public DarkKnight() {} @Override public void finalInit(MM mm) { super.finalInit(mm); if (hasFinalInited) return; hasFinalInited = true; } @Override public Image[] getImages() { loadImages(); Teams teamName = getTeamName(); if (teamName == null) { teamName = Teams.BLUE; } return images; } @Override public void loadImages() {} /** @return the imageFormatInfo */ @Override public ImageFormatInfo getImageFormatInfo() { return imageFormatInfo; } /** @param imageFormatInfo the imageFormatInfo to set */ public void setImageFormatInfo(ImageFormatInfo imageFormatInfo) { DarkKnight.imageFormatInfo = imageFormatInfo; } /** * DO NOT LOAD THE IMAGES, USE GETIMAGES() to make sure they are not null. * * @return the staticImages */ @Override public Image[] getStaticImages() { return null; } /** @param staticImages the staticImages to set */ @Override public void setStaticImages(Image[] staticImages) {} @Override public RectF getStaticPerceivedArea() { return Rpg.getNormalPerceivedArea(); } @Override public void setStaticPerceivedArea(RectF staticPercArea) {} @Override public LivingQualities getNewLivingQualities() { return new LivingQualities(staticLivingQualities); } @Override public Cost getCosts() { return cost; } public static void setCost(Cost cost) { DarkKnight.cost = cost; } private static final String TAG = "Knight"; @Override public String toString() { return TAG; } @Override public String getName() { return TAG; } }