mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 05:15:11 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f2673803ee
17 files changed
+461
-72
No files matched your search
@@ -2,7 +2,6 @@ package kamkeel.npcs.controllers.data.ability;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
import kamkeel.npcs.controllers.data.telegraph.Telegraph;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphType;
|
||||
@@ -36,7 +35,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import somehussar.gui.annotationHandling.GuiEditable;
|
||||
|
||||
public abstract class Ability implements IAbility {
|
||||
|
||||
|
||||
@@ -368,7 +368,7 @@ public class AbilityController implements IAbilityHandler {
|
||||
registerType("cnpc:dual_disc", AbilityDisc::new);
|
||||
registerType("cnpc:dual_disc", AbilityDiscDual::new);
|
||||
registerType("cnpc:laser_shot", AbilityLaserShot::new);
|
||||
registerType("cnpc:beam", AbilityEnergyBeam::new);
|
||||
registerType("cnpc:beam", AbilityBeam::new);
|
||||
registerType("cnpc:dual_beam", AbilityBeamDual::new);
|
||||
|
||||
// Movement abilities
|
||||
|
||||
@@ -16,6 +16,11 @@ public class EnergyColorData {
|
||||
|
||||
public EnergyColorData() {}
|
||||
|
||||
public EnergyColorData(int innerColor, int outerColor) {
|
||||
this.innerColor = innerColor;
|
||||
this.outerColor = outerColor;
|
||||
}
|
||||
|
||||
public EnergyColorData(int innerColor, int outerColor, boolean outerColorEnabled,
|
||||
float outerColorWidth, float outerColorAlpha, float rotationSpeed) {
|
||||
this.innerColor = innerColor;
|
||||
|
||||
+4
-4
@@ -30,7 +30,7 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
* The beam stays attached to the origin and curves as it homes in on target.
|
||||
* Cannot cross over itself (self-intersection prevention).
|
||||
*/
|
||||
public class AbilityEnergyBeam extends Ability implements IAbilityEnergyBeam {
|
||||
public class AbilityBeam extends Ability implements IAbilityEnergyBeam {
|
||||
|
||||
// Shape properties (standalone)
|
||||
private float beamWidth = 0.4f;
|
||||
@@ -47,7 +47,7 @@ public class AbilityEnergyBeam extends Ability implements IAbilityEnergyBeam {
|
||||
// Transient state for beam entity (used during windup charging)
|
||||
private transient EntityAbilityBeam beamEntity = null;
|
||||
|
||||
public AbilityEnergyBeam() {
|
||||
public AbilityBeam() {
|
||||
this.typeId = "ability.cnpc.beam";
|
||||
this.name = "Beam";
|
||||
this.targetingMode = TargetingMode.AGGRO_TARGET;
|
||||
@@ -331,9 +331,9 @@ public class AbilityEnergyBeam extends Ability implements IAbilityEnergyBeam {
|
||||
.tab("ability.tab.visual"),
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density", this::getLightningDensity, this::setLightningDensity)
|
||||
.range(0.01f, 5.0f).visibleWhen(this::hasLightningEffect),
|
||||
.range(0.01f, 100f).visibleWhen(this::hasLightningEffect),
|
||||
FieldDef.floatField("gui.radius", this::getLightningRadius, this::setLightningRadius)
|
||||
.range(0.1f, 10.0f).visibleWhen(this::hasLightningEffect)
|
||||
.range(0.1f, 100f).visibleWhen(this::hasLightningEffect)
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
@@ -444,10 +444,10 @@ public class AbilityBeamDual extends Ability {
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density",
|
||||
() -> getLightningDensity(0), v -> setLightningDensity(0, v))
|
||||
.range(0.01f, 5.0f).visibleWhen(() -> hasLightningEffect(0)),
|
||||
.range(0.01f, 100f).visibleWhen(() -> hasLightningEffect(0)),
|
||||
FieldDef.floatField("gui.radius",
|
||||
() -> getLightningRadius(0), v -> setLightningRadius(0, v))
|
||||
.range(0.1f, 10.0f).visibleWhen(() -> hasLightningEffect(0))
|
||||
.range(0.1f, 100f).visibleWhen(() -> hasLightningEffect(0))
|
||||
).tab("ability.tab.visual"),
|
||||
// Visual tab - Beam 2
|
||||
FieldDef.enumField("ability.anchorPoint", AnchorPoint.class,
|
||||
@@ -480,10 +480,10 @@ public class AbilityBeamDual extends Ability {
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density",
|
||||
() -> getLightningDensity(1), v -> setLightningDensity(1, v))
|
||||
.range(0.01f, 5.0f).visibleWhen(() -> hasLightningEffect(1)),
|
||||
.range(0.01f, 100f).visibleWhen(() -> hasLightningEffect(1)),
|
||||
FieldDef.floatField("gui.radius",
|
||||
() -> getLightningRadius(1), v -> setLightningRadius(1, v))
|
||||
.range(0.1f, 10.0f).visibleWhen(() -> hasLightningEffect(1))
|
||||
.range(0.1f, 100f).visibleWhen(() -> hasLightningEffect(1))
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -329,9 +329,9 @@ public class AbilityDisc extends Ability implements IAbilityDisc {
|
||||
.tab("ability.tab.visual"),
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density", this::getLightningDensity, this::setLightningDensity)
|
||||
.range(0.01f, 5.0f).visibleWhen(this::hasLightningEffect),
|
||||
.range(0.01f, 100f).visibleWhen(this::hasLightningEffect),
|
||||
FieldDef.floatField("gui.radius", this::getLightningRadius, this::setLightningRadius)
|
||||
.range(0.1f, 10.0f).visibleWhen(this::hasLightningEffect)
|
||||
.range(0.1f, 100f).visibleWhen(this::hasLightningEffect)
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -490,10 +490,10 @@ public class AbilityDiscDual extends Ability {
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density",
|
||||
() -> getLightningDensity(1), v -> setLightningDensity(1, v))
|
||||
.range(0.01f, 5.0f).visibleWhen(() -> hasLightningEffect(1)),
|
||||
.range(0.01f, 100f).visibleWhen(() -> hasLightningEffect(1)),
|
||||
FieldDef.floatField("gui.radius",
|
||||
() -> getLightningRadius(1), v -> setLightningRadius(1, v))
|
||||
.range(0.1f, 10.0f).visibleWhen(() -> hasLightningEffect(1))
|
||||
.range(0.1f, 100f).visibleWhen(() -> hasLightningEffect(1))
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -286,9 +286,9 @@ public class AbilityLaserShot extends Ability implements IAbilityLaserShot {
|
||||
FieldDef.boolField("ability.lightning", this::hasLightningEffect, this::setLightningEffect).tab("ability.tab.visual"),
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density", this::getLightningDensity, this::setLightningDensity)
|
||||
.range(0.01f, 5.0f).visibleWhen(this::hasLightningEffect),
|
||||
.range(0.01f, 100f).visibleWhen(this::hasLightningEffect),
|
||||
FieldDef.floatField("gui.radius", this::getLightningRadius, this::setLightningRadius)
|
||||
.range(0.1f, 10.0f).visibleWhen(this::hasLightningEffect)
|
||||
.range(0.1f, 100f).visibleWhen(this::hasLightningEffect)
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -455,9 +455,9 @@ public class AbilityOrb extends Ability implements IAbilityOrb {
|
||||
FieldDef.boolField("ability.lightning", this::hasLightningEffect, this::setLightningEffect).tab("ability.tab.visual"),
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density", this::getLightningDensity, this::setLightningDensity)
|
||||
.range(0.01f, 5.0f).visibleWhen(this::hasLightningEffect),
|
||||
.visibleWhen(this::hasLightningEffect).range(0.01f, 100f),
|
||||
FieldDef.floatField("gui.radius", this::getLightningRadius, this::setLightningRadius)
|
||||
.range(0.1f, 10.0f).visibleWhen(this::hasLightningEffect)
|
||||
.range(0.1f, 100f).visibleWhen(this::hasLightningEffect)
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import kamkeel.npcs.util.AnchorPointHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
@@ -182,19 +183,36 @@ public class AbilityOrbBarrage extends Ability {
|
||||
currentOrb++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInterrupt(DamageSource source) {
|
||||
// Can be interrupted if the caster is hit when the beam is moving
|
||||
if (!interruptible) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Only direct physical hits can interrupt, not magic, fire, or other indirect damage
|
||||
if (source == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reject indirect damage types
|
||||
if (source.isMagicDamage() || source.isFireDamage() || source.isExplosion()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Reject damage without a direct attacker entity
|
||||
if (source.getEntity() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Direct hit from an entity - can interrupt
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup() {
|
||||
currentOrb = 0;
|
||||
|
||||
if (orbEntities != null && !orbEntities.isEmpty()) {
|
||||
for (EntityAbilityOrb orbEntity : orbEntities) {
|
||||
if (orbEntity != null && !orbEntity.isDead) {
|
||||
orbEntity.setDead();
|
||||
}
|
||||
}
|
||||
orbEntities.clear();
|
||||
}
|
||||
|
||||
if (chargingEntities != null) {
|
||||
for (int i = 0; i < chargingEntities.length; i++) {
|
||||
if (chargingEntities[i] != null && !chargingEntities[i].isDead) {
|
||||
@@ -204,6 +222,15 @@ public class AbilityOrbBarrage extends Ability {
|
||||
}
|
||||
chargingEntities = null;
|
||||
}
|
||||
|
||||
if (orbEntities != null && !orbEntities.isEmpty()) {
|
||||
for (EntityAbilityOrb orbEntity : orbEntities) {
|
||||
if (orbEntity != null && !orbEntity.isDead) {
|
||||
orbEntity.setDead();
|
||||
}
|
||||
}
|
||||
orbEntities.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -567,9 +594,9 @@ public class AbilityOrbBarrage extends Ability {
|
||||
FieldDef.boolField("ability.lightning", this::hasLightningEffect, this::setLightningEffect).tab("ability.tab.visual"),
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density", this::getLightningDensity, this::setLightningDensity)
|
||||
.range(0.01f, 5.0f).visibleWhen(this::hasLightningEffect),
|
||||
.range(0.01f, 100f).visibleWhen(this::hasLightningEffect),
|
||||
FieldDef.floatField("gui.radius", this::getLightningRadius, this::setLightningRadius)
|
||||
.range(0.1f, 10.0f).visibleWhen(this::hasLightningEffect)
|
||||
.range(0.1f, 100f).visibleWhen(this::hasLightningEffect)
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -550,10 +550,10 @@ public class AbilityOrbDual extends Ability {
|
||||
FieldDef.row(
|
||||
FieldDef.floatField("gui.density",
|
||||
() -> getLightningDensity(1), v -> setLightningDensity(1, v))
|
||||
.range(0.01f, 5.0f).visibleWhen(() -> hasLightningEffect(1)),
|
||||
.range(0.01f, 100f).visibleWhen(() -> hasLightningEffect(1)),
|
||||
FieldDef.floatField("gui.radius",
|
||||
() -> getLightningRadius(1), v -> setLightningRadius(1, v))
|
||||
.range(0.1f, 10.0f).visibleWhen(() -> hasLightningEffect(1))
|
||||
.range(0.1f, 100f).visibleWhen(() -> hasLightningEffect(1))
|
||||
).tab("ability.tab.visual")
|
||||
));
|
||||
}
|
||||
|
||||
@@ -40,8 +40,10 @@ public class AbilityShockwave extends Ability implements IAbilityShockwave {
|
||||
this.cooldownTicks = 0;
|
||||
this.windUpTicks = 25;
|
||||
this.telegraphType = TelegraphType.CIRCLE;
|
||||
this.windUpSound = "random.explode";
|
||||
this.windUpSound = "game.tnt.primed";
|
||||
this.activeSound = "random.explode";
|
||||
this.windUpAnimationName = "Ability_Shockwave_Windup";
|
||||
this.activeAnimationName = "Ability_Shockwave_Active";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -105,14 +107,12 @@ public class AbilityShockwave extends Ability implements IAbilityShockwave {
|
||||
applyEffects(entity);
|
||||
}
|
||||
}
|
||||
|
||||
// Shockwave completes instantly
|
||||
signalCompletion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActiveTick(EntityLivingBase caster, EntityLivingBase target, World world, int tick) {
|
||||
// Shockwave is instant - nothing to do per-tick
|
||||
if (tick == 10)
|
||||
signalCompletion();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -220,6 +220,16 @@ public class FieldDef {
|
||||
return this;
|
||||
}
|
||||
|
||||
public FieldDef min(float min) {
|
||||
this.min = min;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FieldDef max(float max) {
|
||||
this.max = max;
|
||||
return this;
|
||||
}
|
||||
|
||||
public FieldDef visibleWhen(BooleanSupplier condition) {
|
||||
this.visibleWhen = condition;
|
||||
return this;
|
||||
|
||||
@@ -16,6 +16,7 @@ public class ItemElementalStaff extends ItemStaff {
|
||||
public ItemElementalStaff(int par1, EnumNpcToolMaterial material) {
|
||||
super(par1, material);
|
||||
setHasSubtypes(true);
|
||||
this.color = OrbColor.GENERIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package noppes.npcs.items;
|
||||
|
||||
import kamkeel.npcs.controllers.data.ability.AnchorPoint;
|
||||
import kamkeel.npcs.controllers.data.ability.data.*;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,13 +24,18 @@ import noppes.npcs.entity.EntityProjectile;
|
||||
import noppes.npcs.util.IProjectileCallback;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
|
||||
private EnumNpcToolMaterial material;
|
||||
|
||||
protected OrbColor color;
|
||||
|
||||
public ItemStaff(int par1, EnumNpcToolMaterial material) {
|
||||
super(par1);
|
||||
this.material = material;
|
||||
this.color = OrbColor.get(material.ordinal());;
|
||||
setCreativeTab(CustomItems.tabWeapon);
|
||||
}
|
||||
|
||||
@@ -36,70 +45,92 @@ public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World worldObj, EntityPlayer player, int par4) {
|
||||
if (worldObj.isRemote) {
|
||||
public void onPlayerStoppedUsing(ItemStack stack, World world, EntityPlayer player, int par4) {
|
||||
|
||||
if (world.isRemote)
|
||||
return;
|
||||
}
|
||||
|
||||
if (stack.stackTagCompound == null)
|
||||
return;
|
||||
Entity entity = ((WorldServer) player.worldObj).getEntityByID(stack.stackTagCompound.getInteger("MagicProjectile"));
|
||||
if (entity == null || !(entity instanceof EntityProjectile))
|
||||
|
||||
Entity entity = ((WorldServer) world)
|
||||
.getEntityByID(stack.stackTagCompound.getInteger("MagicProjectile"));
|
||||
|
||||
if (!(entity instanceof EntityAbilityOrb))
|
||||
return;
|
||||
EntityProjectile item = (EntityProjectile) entity;
|
||||
item.callback = this;
|
||||
item.callbackItem = stack;
|
||||
item.explosive = true;
|
||||
item.explosiveDamage = false;
|
||||
item.explosiveRadius = 1;
|
||||
item.prevRotationYaw = item.rotationYaw = player.rotationYaw;
|
||||
item.prevRotationPitch = item.rotationPitch = player.rotationPitch;
|
||||
item.shoot(2);
|
||||
|
||||
player.worldObj.playSoundAtEntity(player, "customnpcs:magic.shot", 1.0F, 1);
|
||||
EntityAbilityOrb orb = (EntityAbilityOrb) entity;
|
||||
|
||||
orb.startMoving(null);
|
||||
|
||||
world.playSoundAtEntity(
|
||||
player,
|
||||
"customnpcs:magic.shot",
|
||||
1.0F,
|
||||
1.0F
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
int tick = getMaxItemUseDuration(stack) - count;
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
spawnParticle(stack, player);
|
||||
return;
|
||||
}
|
||||
|
||||
int chargeTime = 20 + material.getHarvestLevel() * 8;
|
||||
|
||||
if (tick == chargeTime) {
|
||||
|
||||
if (!player.capabilities.isCreativeMode && !hasInfinite(stack)) {
|
||||
if (!hasItem(player, CustomItems.mana))
|
||||
return;
|
||||
consumeItem(player, CustomItems.mana);
|
||||
}
|
||||
player.worldObj.playSoundAtEntity(player, "customnpcs:magic.charge", 1.0F, 1);
|
||||
|
||||
player.worldObj.playSoundAtEntity(
|
||||
player,
|
||||
"customnpcs:magic.charge",
|
||||
1.0F,
|
||||
1.0F
|
||||
);
|
||||
|
||||
if (stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
|
||||
int damage = 6 + material.getDamageVsEntity() + player.worldObj.rand.nextInt(4);
|
||||
damage += damage * EnchantInterface.getLevel(EnchantInterface.Damage, stack) * 0.5f;
|
||||
EntityProjectile projectile = new EntityMagicProjectile(player.worldObj, player, getProjectile(stack), false);
|
||||
projectile.damage = damage;
|
||||
projectile.setSpeed(25);
|
||||
double dx = -MathHelper.sin((float) ((player.rotationYaw / 180F) * Math.PI)) * MathHelper.cos((float) ((player.rotationPitch / 180F) * Math.PI));
|
||||
double dz = MathHelper.cos((float) ((player.rotationYaw / 180F) * Math.PI)) * MathHelper.cos((float) ((player.rotationPitch / 180F) * Math.PI));
|
||||
projectile.setPosition(player.posX + dx * 0.8, player.posY + 1.5 - player.rotationPitch / 80, player.posZ + dz * 0.8);
|
||||
player.worldObj.spawnEntityInWorld(projectile);
|
||||
stack.stackTagCompound.setInteger("MagicProjectile", projectile.getEntityId());//entityid
|
||||
}
|
||||
if (tick > chargeTime && stack.stackTagCompound != null) {
|
||||
Entity entity = ((WorldServer) player.worldObj).getEntityByID(stack.stackTagCompound.getInteger("MagicProjectile"));
|
||||
if (entity == null || !(entity instanceof EntityProjectile))
|
||||
return;
|
||||
EntityProjectile item = (EntityProjectile) entity;
|
||||
item.ticksInAir = 0;
|
||||
|
||||
double dx = -MathHelper.sin((float) ((player.rotationYaw / 180F) * Math.PI)) * MathHelper.cos((float) ((player.rotationPitch / 180F) * Math.PI));
|
||||
double dz = MathHelper.cos((float) ((player.rotationYaw / 180F) * Math.PI)) * MathHelper.cos((float) ((player.rotationPitch / 180F) * Math.PI));
|
||||
item.setPosition(player.posX + dx * 0.8, player.posY + 1.5 - player.rotationPitch / 80, player.posZ + dz * 0.8);
|
||||
}
|
||||
EnergyCombatData combat = new EnergyCombatData();
|
||||
combat.damage = damage;
|
||||
combat.explosive = true;
|
||||
|
||||
EnergyColorData colorData = new EnergyColorData(getOrbColor(stack, false), getOrbColor(stack, true));
|
||||
EnergyLightningData lightning = new EnergyLightningData();
|
||||
EnergyLifespanData lifespan = new EnergyLifespanData(100, 72000);
|
||||
EnergyHomingData homing = new EnergyHomingData();
|
||||
|
||||
homing.speed = 0.5f;
|
||||
homing.homingStrength = 0.35f;
|
||||
homing.homingRange = 20f;
|
||||
|
||||
EntityAbilityOrb orb = new EntityAbilityOrb(
|
||||
player.worldObj, player, null,
|
||||
player.posX, player.posY + player.getEyeHeight(), player.posZ,
|
||||
1.0f, colorData, combat, homing, lightning, lifespan
|
||||
);
|
||||
|
||||
orb.setupCharging(
|
||||
new EnergyAnchorData(AnchorPoint.FRONT, 0, -1, 0),
|
||||
chargeTime
|
||||
);
|
||||
|
||||
player.worldObj.spawnEntityInWorld(orb);
|
||||
stack.stackTagCompound.setInteger("MagicProjectile", orb.getEntityId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,6 +149,15 @@ public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
public int getOrbColor(ItemStack stack, boolean outer) {
|
||||
if (color == OrbColor.GENERIC) {
|
||||
float[] color = EntitySheep.fleeceColorTable[stack.getItemDamage()];
|
||||
return new Color(color[0], color[1], color[2]).getRGB();
|
||||
}
|
||||
|
||||
return outer ? color.outer : color.inner;
|
||||
}
|
||||
|
||||
public ItemStack getProjectile(ItemStack stack) {
|
||||
if (stack.getItem() == CustomItems.staffWood) {
|
||||
return new ItemStack(CustomItems.spellNature);
|
||||
@@ -196,4 +236,32 @@ public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
public boolean hasInfinite(ItemStack stack) {
|
||||
return EnchantInterface.getLevel(EnchantInterface.Infinite, stack) > 0;
|
||||
}
|
||||
|
||||
public enum OrbColor {
|
||||
WOOD(0x7cc818, 0x644a32),
|
||||
STONE(0x532d5b, 0x515151),
|
||||
BRONZE(0x83F7F6, 0x5CF0FF),
|
||||
IRON(0xf7fac5, 0xeafa94),
|
||||
DIA(0x44B6FF, 0x94DFED),
|
||||
GOLD(0xb3011e, 0xd47c32),
|
||||
EMERALD(0xdd6df7, 0xcf1dfa),
|
||||
DEMONIC(0xb8144a, 0x422643),
|
||||
FROST(0xffffff, 0xaccbfe),
|
||||
MITHRIL(0xf7fac5, 0xffffff),
|
||||
GENERIC(0xFFFFFF, 0x88FFFF);
|
||||
|
||||
public final int inner;
|
||||
public final int outer;
|
||||
|
||||
OrbColor(int inner, int outer) {
|
||||
this.inner = inner;
|
||||
this.outer = outer;
|
||||
}
|
||||
|
||||
public static OrbColor get(int id) {
|
||||
if (id >= OrbColor.values().length || id < 0) return GENERIC;
|
||||
|
||||
return OrbColor.values()[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"Loop": 0,
|
||||
"Speed": 1.0f,
|
||||
"Frames": [
|
||||
{
|
||||
"ColorMarker": 16777215,
|
||||
"Comment": "",
|
||||
"Speed": 1.0f,
|
||||
"FrameParts": [
|
||||
{
|
||||
"Pivot2": -7.0f,
|
||||
"Part": "LEFT_ARM",
|
||||
"Rotation1": -12.0f,
|
||||
"Rotation0": 12.0f,
|
||||
"Pivot0": -1.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": -63.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -9.0f,
|
||||
"Part": "HEAD",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 69.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -7.0f,
|
||||
"Part": "RIGHT_ARM",
|
||||
"Rotation1": 12.0f,
|
||||
"Rotation0": 12.0f,
|
||||
"Pivot0": 1.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": 63.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -4.0f,
|
||||
"Part": "RIGHT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 56.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 4.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -6.0f,
|
||||
"Part": "LEFT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 0.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 0.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -9.0f,
|
||||
"Part": "BODY",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 50.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": 0.0f
|
||||
}
|
||||
],
|
||||
"Smooth": 0b,
|
||||
"Duration": 2
|
||||
}
|
||||
],
|
||||
"CurrentFrameTime": 0,
|
||||
"CurrentFrame": 0,
|
||||
"Smooth": 0b,
|
||||
"ID": 20,
|
||||
"WhileAttacking": 1b,
|
||||
"WhileWalking": 1b,
|
||||
"Name": "Ability_Shockwave_Active",
|
||||
"WhileStanding": 1b
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
{
|
||||
"Loop": -1,
|
||||
"Speed": 1.0f,
|
||||
"Frames": [
|
||||
{
|
||||
"ColorMarker": 16777215,
|
||||
"Comment": "",
|
||||
"Speed": 2.0f,
|
||||
"FrameParts": [
|
||||
{
|
||||
"Pivot2": 4.0f,
|
||||
"Part": "LEFT_ARM",
|
||||
"Rotation1": -12.0f,
|
||||
"Rotation0": -183.0f,
|
||||
"Pivot0": -1.0f,
|
||||
"Pivot1": -2.0f,
|
||||
"Rotation2": -12.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": 3.0f,
|
||||
"Part": "HEAD",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": -18.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 1.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": 4.0f,
|
||||
"Part": "RIGHT_ARM",
|
||||
"Rotation1": 12.0f,
|
||||
"Rotation0": -183.0f,
|
||||
"Pivot0": 1.0f,
|
||||
"Pivot1": -2.0f,
|
||||
"Rotation2": 12.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -1.0f,
|
||||
"Part": "RIGHT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 12.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 0.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -2.0f,
|
||||
"Part": "LEFT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": -25.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": -5.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": 3.0f,
|
||||
"Part": "BODY",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": -18.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 1.0f,
|
||||
"Rotation2": 0.0f
|
||||
}
|
||||
],
|
||||
"Smooth": 0b,
|
||||
"Duration": 5
|
||||
},
|
||||
{
|
||||
"ColorMarker": 16777215,
|
||||
"Comment": "",
|
||||
"Speed": 0.5f,
|
||||
"FrameParts": [
|
||||
{
|
||||
"Pivot2": 4.0f,
|
||||
"Part": "LEFT_ARM",
|
||||
"Rotation1": -12.0f,
|
||||
"Rotation0": -183.0f,
|
||||
"Pivot0": -1.0f,
|
||||
"Pivot1": -2.0f,
|
||||
"Rotation2": -12.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": 3.0f,
|
||||
"Part": "HEAD",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": -18.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 1.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": 4.0f,
|
||||
"Part": "RIGHT_ARM",
|
||||
"Rotation1": 12.0f,
|
||||
"Rotation0": -183.0f,
|
||||
"Pivot0": 1.0f,
|
||||
"Pivot1": -2.0f,
|
||||
"Rotation2": 12.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -1.0f,
|
||||
"Part": "RIGHT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 12.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 0.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -2.0f,
|
||||
"Part": "LEFT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": -25.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": -5.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": 3.0f,
|
||||
"Part": "BODY",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": -18.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 1.0f,
|
||||
"Rotation2": 0.0f
|
||||
}
|
||||
],
|
||||
"Smooth": 0b,
|
||||
"Duration": 18
|
||||
},
|
||||
{
|
||||
"ColorMarker": 16777215,
|
||||
"Comment": "",
|
||||
"Speed": 3.0f,
|
||||
"FrameParts": [
|
||||
{
|
||||
"Pivot2": -7.0f,
|
||||
"Part": "LEFT_ARM",
|
||||
"Rotation1": -12.0f,
|
||||
"Rotation0": 12.0f,
|
||||
"Pivot0": -1.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": -63.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -9.0f,
|
||||
"Part": "HEAD",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 69.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -7.0f,
|
||||
"Part": "RIGHT_ARM",
|
||||
"Rotation1": 12.0f,
|
||||
"Rotation0": 12.0f,
|
||||
"Pivot0": 1.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": 63.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -4.0f,
|
||||
"Part": "RIGHT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 56.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 4.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -6.0f,
|
||||
"Part": "LEFT_LEG",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 0.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 0.0f,
|
||||
"Rotation2": 0.0f
|
||||
},
|
||||
{
|
||||
"Pivot2": -9.0f,
|
||||
"Part": "BODY",
|
||||
"Rotation1": 0.0f,
|
||||
"Rotation0": 50.0f,
|
||||
"Pivot0": 0.0f,
|
||||
"Pivot1": 7.0f,
|
||||
"Rotation2": 0.0f
|
||||
}
|
||||
],
|
||||
"Smooth": 0b,
|
||||
"Duration": 2
|
||||
}
|
||||
],
|
||||
"CurrentFrameTime": 0,
|
||||
"CurrentFrame": 1,
|
||||
"Smooth": 0b,
|
||||
"ID": 19,
|
||||
"WhileAttacking": 1b,
|
||||
"WhileWalking": 1b,
|
||||
"Name": "Ability_Shockwave_Windup",
|
||||
"WhileStanding": 1b
|
||||
}
|
||||
Reference in new issue
Block a user