SHARE
TWEET

Ability Inferno Punch

a guest May 11th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class AbilityInfernoPunch extends Ability {
  2.     public AbilityInfernoPunch() {
  3.         super(Firebending.ID, "inferno_punch");
  4.     }
  5.  
  6.     private int punchesLeft;
  7.  
  8.     public int getPunchesLeft() {
  9.         return this.punchesLeft;
  10.     }
  11.  
  12.     @Override
  13.     public void execute(AbilityContext ctx) {
  14.  
  15.         BendingData data = ctx.getData();
  16.         Bender bender = ctx.getBender();
  17.         float chi = 3;
  18.  
  19.         if (ctx.getLevel() >= 1) {
  20.             chi = 4;
  21.         }
  22.         if (ctx.getLevel() >= 2) {
  23.             chi = 5;
  24.         }
  25.         if (ctx.isMasterLevel(AbilityData.AbilityTreePath.FIRST)) {
  26.             chi = 8;
  27.         }
  28.         if (ctx.isMasterLevel(AbilityData.AbilityTreePath.SECOND)) {
  29.             chi = 3;
  30.         }
  31.         if (!data.hasStatusControl(INFERNO_PUNCH) && bender.consumeChi(chi)) {
  32.             data.addStatusControl(INFERNO_PUNCH);
  33.              punchesLeft = 1;
  34.             AbilityData abilityData = ctx.getData().getAbilityData("inferno_punch");
  35.  
  36.             if (abilityData.getLevel() >= 2) {
  37.                 punchesLeft = 2;
  38.             }
  39.  
  40.             if (abilityData.isMasterPath(AbilityData.AbilityTreePath.FIRST)) {
  41.                 punchesLeft = 1;
  42.                 //Creates a bunch of fire blocks around the target
  43.             }
  44.             if (abilityData.isMasterPath(AbilityData.AbilityTreePath.SECOND)) {
  45.                 punchesLeft = 3;
  46.             }
  47.  
  48.         }
  49.  
  50.     }
  51.  
  52.  
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top