Joshie comment!
This commit is contained in:
parent
1c0deadfc6
commit
ac943e9d38
753 changed files with 8715 additions and 1184 deletions
|
@ -0,0 +1,259 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifier;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
|
||||
public abstract class SpellEffect
|
||||
{
|
||||
protected int modifierState;
|
||||
protected int powerEnhancement;
|
||||
protected int costEnhancement;
|
||||
protected int potencyEnhancement;
|
||||
|
||||
public SpellEffect()
|
||||
{
|
||||
this.modifierState = SpellModifier.DEFAULT;
|
||||
this.powerEnhancement = 0;
|
||||
this.costEnhancement = 0;
|
||||
this.potencyEnhancement = 0;
|
||||
}
|
||||
|
||||
public void enhanceEffect(SpellEnhancement enh)
|
||||
{
|
||||
if(enh!=null)
|
||||
{
|
||||
switch(enh.getState())
|
||||
{
|
||||
case SpellEnhancement.POWER: this.powerEnhancement++; break;
|
||||
case SpellEnhancement.EFFICIENCY: this.costEnhancement++; break;
|
||||
case SpellEnhancement.POTENCY: this.potencyEnhancement++; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void modifyEffect(SpellModifier mod)
|
||||
{
|
||||
if(mod!=null)
|
||||
modifierState = mod.getModifier();
|
||||
}
|
||||
|
||||
public void modifyParadigm(SpellParadigm parad)
|
||||
{
|
||||
if(parad instanceof SpellParadigmProjectile)
|
||||
{
|
||||
this.modifyProjectileParadigm((SpellParadigmProjectile)parad);
|
||||
}
|
||||
if(parad instanceof SpellParadigmSelf)
|
||||
{
|
||||
this.modifySelfParadigm((SpellParadigmSelf)parad);
|
||||
}
|
||||
if(parad instanceof SpellParadigmMelee)
|
||||
{
|
||||
this.modifyMeleeParadigm((SpellParadigmMelee)parad);
|
||||
}
|
||||
if(parad instanceof SpellParadigmTool)
|
||||
{
|
||||
this.modifyToolParadigm((SpellParadigmTool)parad);
|
||||
}
|
||||
}
|
||||
|
||||
public void modifyProjectileParadigm(SpellParadigmProjectile parad)
|
||||
{
|
||||
switch(modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: this.defaultModificationProjectile(parad); break;
|
||||
case SpellModifier.OFFENSIVE: this.offensiveModificationProjectile(parad); break;
|
||||
case SpellModifier.DEFENSIVE: this.defensiveModificationProjectile(parad); break;
|
||||
case SpellModifier.ENVIRONMENTAL: this.environmentalModificationProjectile(parad); break;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void defaultModificationProjectile(SpellParadigmProjectile parad);
|
||||
public abstract void offensiveModificationProjectile(SpellParadigmProjectile parad);
|
||||
public abstract void defensiveModificationProjectile(SpellParadigmProjectile parad);
|
||||
public abstract void environmentalModificationProjectile(SpellParadigmProjectile parad);
|
||||
|
||||
public void modifySelfParadigm(SpellParadigmSelf parad)
|
||||
{
|
||||
switch(modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: this.defaultModificationSelf(parad); break;
|
||||
case SpellModifier.OFFENSIVE: this.offensiveModificationSelf(parad); break;
|
||||
case SpellModifier.DEFENSIVE: this.defensiveModificationSelf(parad); break;
|
||||
case SpellModifier.ENVIRONMENTAL: this.environmentalModificationSelf(parad); break;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void defaultModificationSelf(SpellParadigmSelf parad);
|
||||
public abstract void offensiveModificationSelf(SpellParadigmSelf parad);
|
||||
public abstract void defensiveModificationSelf(SpellParadigmSelf parad);
|
||||
public abstract void environmentalModificationSelf(SpellParadigmSelf parad);
|
||||
|
||||
public void modifyMeleeParadigm(SpellParadigmMelee parad)
|
||||
{
|
||||
switch(modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: this.defaultModificationMelee(parad); break;
|
||||
case SpellModifier.OFFENSIVE: this.offensiveModificationMelee(parad); break;
|
||||
case SpellModifier.DEFENSIVE: this.defensiveModificationMelee(parad); break;
|
||||
case SpellModifier.ENVIRONMENTAL: this.environmentalModificationMelee(parad); break;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void defaultModificationMelee(SpellParadigmMelee parad);
|
||||
public abstract void offensiveModificationMelee(SpellParadigmMelee parad);
|
||||
public abstract void defensiveModificationMelee(SpellParadigmMelee parad);
|
||||
public abstract void environmentalModificationMelee(SpellParadigmMelee parad);
|
||||
|
||||
public void modifyToolParadigm(SpellParadigmTool parad)
|
||||
{
|
||||
switch(modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: this.defaultModificationTool(parad); break;
|
||||
case SpellModifier.OFFENSIVE: this.offensiveModificationTool(parad); break;
|
||||
case SpellModifier.DEFENSIVE: this.defensiveModificationTool(parad); break;
|
||||
case SpellModifier.ENVIRONMENTAL: this.environmentalModificationTool(parad); break;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void defaultModificationTool(SpellParadigmTool parad);
|
||||
public abstract void offensiveModificationTool(SpellParadigmTool parad);
|
||||
public abstract void defensiveModificationTool(SpellParadigmTool parad);
|
||||
public abstract void environmentalModificationTool(SpellParadigmTool parad);
|
||||
|
||||
public int getCostForProjectile()
|
||||
{
|
||||
switch(this.modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: return this.getCostForDefaultProjectile();
|
||||
case SpellModifier.OFFENSIVE: return this.getCostForOffenseProjectile();
|
||||
case SpellModifier.DEFENSIVE: return this.getCostForDefenseProjectile();
|
||||
case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentProjectile();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected abstract int getCostForDefaultProjectile();
|
||||
protected abstract int getCostForOffenseProjectile();
|
||||
protected abstract int getCostForDefenseProjectile();
|
||||
protected abstract int getCostForEnvironmentProjectile();
|
||||
|
||||
public int getCostForSelf()
|
||||
{
|
||||
switch(this.modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: return this.getCostForDefaultSelf();
|
||||
case SpellModifier.OFFENSIVE: return this.getCostForOffenseSelf();
|
||||
case SpellModifier.DEFENSIVE: return this.getCostForDefenseSelf();
|
||||
case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentSelf();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected abstract int getCostForDefaultSelf();
|
||||
protected abstract int getCostForOffenseSelf();
|
||||
protected abstract int getCostForDefenseSelf();
|
||||
protected abstract int getCostForEnvironmentSelf();
|
||||
|
||||
public int getCostForMelee()
|
||||
{
|
||||
switch(this.modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: return this.getCostForDefaultMelee();
|
||||
case SpellModifier.OFFENSIVE: return this.getCostForOffenseMelee();
|
||||
case SpellModifier.DEFENSIVE: return this.getCostForDefenseMelee();
|
||||
case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentMelee();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected abstract int getCostForDefaultMelee();
|
||||
protected abstract int getCostForOffenseMelee();
|
||||
protected abstract int getCostForDefenseMelee();
|
||||
protected abstract int getCostForEnvironmentMelee();
|
||||
|
||||
public int getCostForTool()
|
||||
{
|
||||
switch(this.modifierState)
|
||||
{
|
||||
case SpellModifier.DEFAULT: return this.getCostForDefaultTool();
|
||||
case SpellModifier.OFFENSIVE: return this.getCostForOffenseTool();
|
||||
case SpellModifier.DEFENSIVE: return this.getCostForDefenseTool();
|
||||
case SpellModifier.ENVIRONMENTAL: return this.getCostForEnvironmentTool();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected abstract int getCostForDefaultTool();
|
||||
protected abstract int getCostForOffenseTool();
|
||||
protected abstract int getCostForDefenseTool();
|
||||
protected abstract int getCostForEnvironmentTool();
|
||||
|
||||
public int getPowerEnhancements()
|
||||
{
|
||||
return this.powerEnhancement;
|
||||
}
|
||||
|
||||
public int getCostEnhancements()
|
||||
{
|
||||
return this.costEnhancement;
|
||||
}
|
||||
|
||||
public int getPotencyEnhancements()
|
||||
{
|
||||
return this.potencyEnhancement;
|
||||
}
|
||||
|
||||
public NBTTagCompound getTag()
|
||||
{
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
|
||||
tag.setString("Class", this.getClass().getName());
|
||||
tag.setInteger("modifier", modifierState);
|
||||
tag.setInteger("power", powerEnhancement);
|
||||
tag.setInteger("cost", costEnhancement);
|
||||
tag.setInteger("potency", potencyEnhancement);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public static SpellEffect getEffectFromTag(NBTTagCompound tag)
|
||||
{
|
||||
try {
|
||||
Class clazz = Class.forName(tag.getString("Class"));
|
||||
if(clazz !=null)
|
||||
{
|
||||
try {
|
||||
Object obj = clazz.newInstance();
|
||||
if(obj instanceof SpellEffect)
|
||||
{
|
||||
SpellEffect eff = (SpellEffect) obj;
|
||||
|
||||
eff.modifierState = tag.getInteger("modifier");
|
||||
eff.powerEnhancement = tag.getInteger("power");
|
||||
eff.costEnhancement = tag.getInteger("cost");
|
||||
eff.potencyEnhancement = tag.getInteger("potency");
|
||||
|
||||
return eff;
|
||||
}
|
||||
} catch (InstantiationException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,267 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeDefaultEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeDefensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeEnvironmentalEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.MeleeOffensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileDefaultEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileDefensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileEnvironmentalEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ProjectileOffensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfDefaultEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfDefensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfEnvironmentalEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfOffensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ToolEnvironmentalEarth;
|
||||
|
||||
public class SpellEffectEarth extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefensiveEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addUpdateEffect(new ProjectileEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfOffensiveEarth(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefensiveEarth(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfEnvironmentalEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeOffensiveEarth(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeDefensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
return (int)(10*Math.pow((0.5*(this.powerEnhancement)+1)*2 + 1,3)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
|
||||
return (int)(10*(1.5*this.potencyEnhancement+1)*(Math.pow(1*this.powerEnhancement+1,2))*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
return (int)(3*Math.pow((this.powerEnhancement*2+1),2)*(this.potencyEnhancement*2+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
return (int)(10*2*(0.1d*(this.potencyEnhancement+1))*Math.pow(3.47,this.potencyEnhancement)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
return (int)(20*Math.pow(1.5*powerEnhancement+1,2)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
return (int)(10*Math.pow(2*this.powerEnhancement+1,2)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
return (int)(750*(1.1*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
return (int)(250*(1.2*this.potencyEnhancement+1)*(3*this.powerEnhancement+2.5)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
return (int)(50*Math.pow(1.5*this.potencyEnhancement + 1,3)*(0.5*this.powerEnhancement + 1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
return (int)(20*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
return (int)(5*(1.2*this.powerEnhancement+1)*(1.0f/3.0f*Math.pow(this.potencyEnhancement,2)+2+1.0f/2.0f*this.potencyEnhancement)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
return (int)(500*Math.pow(2*this.potencyEnhancement+1, 3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "pickaxe";
|
||||
|
||||
float digSpeed = 7.0f;
|
||||
|
||||
switch(this.powerEnhancement)
|
||||
{
|
||||
case 1:
|
||||
digSpeed = 9.0f;
|
||||
break;
|
||||
case 2:
|
||||
digSpeed = 12.0f;
|
||||
break;
|
||||
case 3:
|
||||
digSpeed = 16.0f;
|
||||
break;
|
||||
case 4:
|
||||
digSpeed = 21.0f;
|
||||
break;
|
||||
case 5:
|
||||
digSpeed = 27.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
parad.setDigSpeed(toolClass, digSpeed);
|
||||
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "shovel";
|
||||
|
||||
float digSpeed = 7.0f;
|
||||
|
||||
switch(this.powerEnhancement)
|
||||
{
|
||||
case 1:
|
||||
digSpeed = 9.0f;
|
||||
break;
|
||||
case 2:
|
||||
digSpeed = 12.0f;
|
||||
break;
|
||||
case 3:
|
||||
digSpeed = 16.0f;
|
||||
break;
|
||||
case 4:
|
||||
digSpeed = 21.0f;
|
||||
break;
|
||||
case 5:
|
||||
digSpeed = 27.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
parad.setDigSpeed(toolClass, digSpeed);
|
||||
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addDigAreaEffect(new ToolEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,218 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeDefaultFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeDefensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeEnvironmentalFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.MeleeOffensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileEnvironmentalFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileOffensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefaultFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfEnvironmentalFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfOffensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolDefaultFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolOffensiveFire;
|
||||
|
||||
public class SpellEffectFire extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
parad.damage+=this.potencyEnhancement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileOffensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addUpdateEffect(new ProjectileEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefaultFire(powerEnhancement, potencyEnhancement, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfOffensiveFire(powerEnhancement,potencyEnhancement,costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefensiveFire(powerEnhancement,potencyEnhancement,costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfEnvironmentalFire(powerEnhancement, potencyEnhancement, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeDefaultFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeOffensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeDefensiveFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
return (int)((5*Math.pow(1.5*this.powerEnhancement+1, 2)*(1.5*this.potencyEnhancement+1)+this.potencyEnhancement*15)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
return (int)(10*Math.pow((this.powerEnhancement)*1.3+1,2)*((1.5*this.potencyEnhancement+1))*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
return (int)(25*Math.pow(1*this.powerEnhancement+1,2)*(1*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
return (int)(75*(0.5*this.powerEnhancement+1)*(0.5*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
return 10*(int)(10*Math.pow(1.5, this.powerEnhancement+1.5*this.potencyEnhancement)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
return (int)(300*(3*powerEnhancement+1)*(2*potencyEnhancement + 1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
return (int)(25*(3*this.potencyEnhancement+1)*(2*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
return (int)((15*Math.pow(1.7, powerEnhancement)+10*Math.pow(potencyEnhancement,1.8))*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
return (int)(25*(1.2*this.potencyEnhancement+1)*(2.5*this.powerEnhancement+2)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
return (int)(500*(1+this.potencyEnhancement)*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
return (int)(30*(1.5*potencyEnhancement+1)*(3*powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
return (int)(25*Math.pow(1.5*this.powerEnhancement+1,3)*(0.25*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addItemManipulatorEffect(new ToolDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolOffensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
|
||||
parad.addToolString("offFire", "Fire Aspect" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,221 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeDefaultIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeDefensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeEnvironmentalIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.MeleeOffensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileDefaultIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileDefensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileEnvironmentalIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ProjectileOffensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfDefaultIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfDefensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfEnvironmentalIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfOffensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefensiveIce;
|
||||
|
||||
public class SpellEffectIce extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.damage+=this.potencyEnhancement;
|
||||
parad.addImpactEffect(new ProjectileDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.damage+=2;
|
||||
parad.addImpactEffect(new ProjectileOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addUpdateEffect(new ProjectileEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefaultIce(this.powerEnhancement,this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeOffensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeEnvironmentalIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
return (int)((30)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
return (int)((60)*(this.powerEnhancement+1)*(3*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
return (int)(75*(2*this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
return (int)(200*(2*this.powerEnhancement+1)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
return (int)(20*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
return (int)(100*(2*this.powerEnhancement+1)*(2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
return (int)(200*(3*powerEnhancement+1)*(2*potencyEnhancement + 1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
return (int)(10*(1.5*potencyEnhancement+1)*(3*powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
return (int)(250*(potencyEnhancement+1)*(1.5*powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
return (int)(40*(1.5*potencyEnhancement+1)*Math.pow(1.5, powerEnhancement)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
return (int)(50*(0.5*potencyEnhancement+1)*(0.7*powerEnhancement+1)*(0.5*powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
return (int)(20*(0.5*potencyEnhancement+1)*(0*powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationTool(SpellParadigmTool parad) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addDamageToHash("Sharpness", (this.powerEnhancement+1)*1.5f);
|
||||
|
||||
parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
|
||||
|
||||
parad.addCritChance("SharpCrit", this.potencyEnhancement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.powerEnhancement*0.3f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool() {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,242 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeDefaultWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeDefensiveWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeEnvironmentalWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.MeleeOffensiveWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileDefaultWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileEnvironmentalWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ProjectileOffensiveWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfDefaultWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfDefensiveWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfEnvironmentalWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.SelfOffensiveWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ToolDefensiveWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ToolEnvironmentalWind;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.ToolOffensiveWind;
|
||||
|
||||
public class SpellEffectWind extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.isSilkTouch = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addUpdateEffect(new ProjectileEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfDefensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
parad.addSelfSpellEffect(new SelfEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeOffensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addEntityEffect(new MeleeDefensiveWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
parad.addWorldEffect(new MeleeEnvironmentalWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
return (int)(100*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
return (int)(100*(0.5*this.potencyEnhancement+1)*(this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
return (int)(100*(this.potencyEnhancement+1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
return (int)(50*(this.powerEnhancement+1)*(this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
return (int)(100*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
return (int)(100*(0.5*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
return (int)(500*(0.7d*this.powerEnhancement+1)*(0.8*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
return (int)(500*(0.7d*this.powerEnhancement+1)*(0.2*this.potencyEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
return (int)(350*(1.0*this.potencyEnhancement+1)*(1.2*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
return (int)(250*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
return (int)(150*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
return (int)(100*(1.0*this.potencyEnhancement+1)*(0.7*this.powerEnhancement+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "axe";
|
||||
|
||||
float digSpeed = 7.0f;
|
||||
|
||||
switch(this.powerEnhancement)
|
||||
{
|
||||
case 1:
|
||||
digSpeed = 9.0f;
|
||||
break;
|
||||
case 2:
|
||||
digSpeed = 12.0f;
|
||||
break;
|
||||
case 3:
|
||||
digSpeed = 16.0f;
|
||||
break;
|
||||
case 4:
|
||||
digSpeed = 21.0f;
|
||||
break;
|
||||
case 5:
|
||||
digSpeed = 27.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
parad.setDigSpeed(toolClass, digSpeed);
|
||||
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolDefensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
parad.addToolString("DefWind", "Knockback" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addBlockBreakEffect(new ToolEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return 0; //Cost is on the attack method
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int)(150 * (1+this.powerEnhancement*0.4f) * (1+this.potencyEnhancement*0.3f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return (int)(150 * (1+this.powerEnhancement) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,381 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
|
||||
public class SpellHelper
|
||||
{
|
||||
public static Random rand = new Random();
|
||||
public static final double root2 = Math.sqrt(2);
|
||||
|
||||
public static void smeltBlockInWorld(World world, int posX, int posY, int posZ)
|
||||
{
|
||||
FurnaceRecipes recipes = FurnaceRecipes.smelting();
|
||||
|
||||
Block block = world.getBlock(posX, posY, posZ);
|
||||
if(block==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int meta = world.getBlockMetadata(posX, posY, posZ);
|
||||
|
||||
ItemStack smeltedStack = recipes.getSmeltingResult(new ItemStack(block,1,meta));
|
||||
if(smeltedStack!=null && smeltedStack.getItem() instanceof ItemBlock)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, ((ItemBlock)(smeltedStack.getItem())).field_150939_a, smeltedStack.getItemDamage(), 3);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Entity> getEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
return world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius));
|
||||
}
|
||||
|
||||
public static List<EntityItem> getItemsInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
return world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius));
|
||||
}
|
||||
|
||||
public static List<EntityPlayer> getPlayersInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
return world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(posX-0.5f, posY-0.5f, posZ-0.5f, posX + 0.5f, posY + 0.5f, posZ + 0.5f).expand(horizontalRadius, verticalRadius, horizontalRadius));
|
||||
}
|
||||
|
||||
public static double gaussian(double d)
|
||||
{
|
||||
return d * ((rand.nextFloat() - 0.5D));
|
||||
}
|
||||
|
||||
public static Vec3 getEntityBlockVector(Entity entity)
|
||||
{
|
||||
int posX = (int) Math.round(entity.posX - 0.5f);
|
||||
int posY = (int) entity.posY;
|
||||
int posZ = (int) Math.round(entity.posZ - 0.5f);
|
||||
|
||||
return entity.getLookVec().createVectorHelper(posX, posY, posZ);
|
||||
}
|
||||
|
||||
public static ForgeDirection getDirectionForLookVector(Vec3 lookVec)
|
||||
{
|
||||
double distance = lookVec.lengthVector();
|
||||
|
||||
if(lookVec.yCoord>distance*0.9)
|
||||
{
|
||||
return ForgeDirection.UP;
|
||||
}
|
||||
if(lookVec.yCoord<distance*-0.9)
|
||||
{
|
||||
return ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
return getCompassDirectionForLookVector(lookVec);
|
||||
}
|
||||
|
||||
public static ForgeDirection getCompassDirectionForLookVector(Vec3 lookVec)
|
||||
{
|
||||
double radius = Math.sqrt(Math.pow(lookVec.xCoord,2)+Math.pow(lookVec.zCoord,2));
|
||||
|
||||
if(lookVec.zCoord>radius*1/root2)
|
||||
{
|
||||
return ForgeDirection.SOUTH;
|
||||
}
|
||||
if(lookVec.zCoord<-radius*1/root2)
|
||||
{
|
||||
return ForgeDirection.NORTH;
|
||||
}
|
||||
if(lookVec.xCoord>radius*1/root2)
|
||||
{
|
||||
return ForgeDirection.EAST;
|
||||
}
|
||||
if(lookVec.xCoord<-radius*1/root2)
|
||||
{
|
||||
return ForgeDirection.WEST;
|
||||
}
|
||||
|
||||
return ForgeDirection.EAST;
|
||||
}
|
||||
|
||||
public static void freezeWaterBlock(World world, int posX, int posY, int posZ)
|
||||
{
|
||||
Block block = world.getBlock(posX, posY, posZ);
|
||||
|
||||
if(block == Blocks.water || block == Blocks.flowing_water)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, Blocks.ice);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getUsername(EntityPlayer player)
|
||||
{
|
||||
return SoulNetworkHandler.getUsername(player);
|
||||
}
|
||||
|
||||
public static void sendParticleToPlayer(EntityPlayer player, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel)
|
||||
{
|
||||
if(player instanceof EntityPlayerMP)
|
||||
{
|
||||
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getParticlePacket(str, xCoord, yCoord, zCoord, xVel, yVel, zVel),(EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendIndexedParticleToPlayer(EntityPlayer player, int index, double xCoord, double yCoord, double zCoord)
|
||||
{
|
||||
switch(index)
|
||||
{
|
||||
case 1:
|
||||
SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.5117D, 0.0117D, 0.0117D);
|
||||
break;
|
||||
case 2:
|
||||
SpellHelper.sendParticleToPlayer(player, "reddust", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 0.82D, 0.941D, 0.91D);
|
||||
break;
|
||||
case 3:
|
||||
SpellHelper.sendParticleToPlayer(player, "mobSpell", xCoord + 0.5D + rand.nextGaussian() / 8, yCoord + 1.1D, zCoord + 0.5D + rand.nextGaussian() / 8, 1.0D, 0.371D, 0.371D);
|
||||
break;
|
||||
case 4:
|
||||
float f = (float) 1.0F;
|
||||
float f1 = f * 0.6F + 0.4F;
|
||||
float f2 = f * f * 0.7F - 0.5F;
|
||||
float f3 = f * f * 0.6F - 0.7F;
|
||||
|
||||
for (int l = 0; l < 8; ++l)
|
||||
{
|
||||
SpellHelper.sendParticleToPlayer(player,"reddust", xCoord + Math.random() - Math.random(), yCoord + Math.random() - Math.random(), zCoord + Math.random() - Math.random(), f1, f2, f3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel)
|
||||
{
|
||||
List<EntityPlayer> entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius);
|
||||
|
||||
if(entities==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(EntityPlayer player : entities)
|
||||
{
|
||||
SpellHelper.sendParticleToPlayer(player, str, xCoord, yCoord, zCoord, xVel, yVel, zVel);
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendIndexedParticleToAllAround(World world, double xPos, double yPos, double zPos, int radius, int dimension, int index, double xCoord, double yCoord, double zCoord)
|
||||
{
|
||||
List<EntityPlayer> entities = SpellHelper.getPlayersInRange(world, xPos, yPos, zPos, radius, radius);
|
||||
|
||||
if(entities==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(EntityPlayer player : entities)
|
||||
{
|
||||
SpellHelper.sendIndexedParticleToPlayer(player, index, xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setPlayerSpeedFromServer(EntityPlayer player, double motionX, double motionY, double motionZ)
|
||||
{
|
||||
if(player instanceof EntityPlayerMP)
|
||||
{
|
||||
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getVelSettingPacket(motionX, motionY, motionZ), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isFakePlayer(World world, EntityPlayer player)
|
||||
{
|
||||
if(world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(player instanceof FakePlayer || SpellHelper.getUsername(player).contains("[CoFH]"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
String str = player.getClass().getSimpleName();
|
||||
if(str.contains("GC"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(player.getClass().equals(EntityPlayerMP.class))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void smashBlock(World world, int posX, int posY, int posZ)
|
||||
{
|
||||
Block block = world.getBlock(posX, posY, posZ);
|
||||
|
||||
if(block==Blocks.stone)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, Blocks.cobblestone);
|
||||
return;
|
||||
}
|
||||
else if(block==Blocks.cobblestone)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, Blocks.gravel);
|
||||
return;
|
||||
}
|
||||
else if(block==Blocks.gravel)
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, Blocks.sand);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isBlockFluid(Block block)
|
||||
{
|
||||
return block instanceof BlockLiquid;
|
||||
}
|
||||
|
||||
public static void evaporateWaterBlock(World world, int posX, int posY, int posZ)
|
||||
{
|
||||
Block block = world.getBlock(posX, posY, posZ);
|
||||
|
||||
if(block == Blocks.water || block == Blocks.flowing_water)
|
||||
{
|
||||
world.setBlockToAir(posX, posY, posZ);
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getDustForOre(ItemStack item)
|
||||
{
|
||||
String oreName = OreDictionary.getOreName(OreDictionary.getOreID(item));
|
||||
|
||||
if(oreName.contains("ore"))
|
||||
{
|
||||
String lowercaseOre = oreName.toLowerCase();
|
||||
boolean isAllowed = false;
|
||||
|
||||
for(String str : AlchemicalWizardry.allowedCrushedOresArray)
|
||||
{
|
||||
String testStr = str.toLowerCase();
|
||||
|
||||
if(lowercaseOre.contains(testStr))
|
||||
{
|
||||
isAllowed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isAllowed)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String dustName = oreName.replace("ore", "dust");
|
||||
|
||||
ArrayList<ItemStack> items = OreDictionary.getOres(dustName);
|
||||
|
||||
if(items!=null && items.size()>=1)
|
||||
{
|
||||
return(items.get(0).copy());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<ItemStack> getItemsFromBlock(World world, Block block, int x, int y, int z, int meta, boolean silkTouch, int fortune)
|
||||
{
|
||||
boolean canSilk = block.canSilkHarvest(world, null, x, y, z, meta);
|
||||
|
||||
if(canSilk && silkTouch)
|
||||
{
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
ItemStack item = new ItemStack(block, 1, meta);
|
||||
|
||||
items.add(item);
|
||||
|
||||
return items;
|
||||
}else
|
||||
{
|
||||
return block.getDrops(world, x, y, z, meta, fortune);
|
||||
}
|
||||
}
|
||||
|
||||
public static void spawnItemListInWorld(List<ItemStack> items, World world, float x, float y, float z)
|
||||
{
|
||||
for(ItemStack stack : items)
|
||||
{
|
||||
EntityItem itemEntity = new EntityItem(world, x, y, z, stack);
|
||||
itemEntity.delayBeforeCanPickup = 10;
|
||||
world.spawnEntityInWorld(itemEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public static MovingObjectPosition raytraceFromEntity (World world, Entity player, boolean par3, double range)
|
||||
{
|
||||
float f = 1.0F;
|
||||
float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f;
|
||||
float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f;
|
||||
double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f;
|
||||
double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f;
|
||||
if (!world.isRemote && player instanceof EntityPlayer)
|
||||
d1 += 1.62D;
|
||||
double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f;
|
||||
Vec3 vec3 = world.getWorldVec3Pool().getVecFromPool(d0, d1, d2);
|
||||
float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI);
|
||||
float f5 = -MathHelper.cos(-f1 * 0.017453292F);
|
||||
float f6 = MathHelper.sin(-f1 * 0.017453292F);
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f3 * f5;
|
||||
double d3 = range;
|
||||
if (player instanceof EntityPlayerMP)
|
||||
{
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
}
|
||||
Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
|
||||
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
|
||||
}
|
||||
|
||||
public static String getNumeralForInt(int num)
|
||||
{
|
||||
switch(num)
|
||||
{
|
||||
case 1: return "I";
|
||||
case 2: return "II";
|
||||
case 3: return "III";
|
||||
case 4: return "IV";
|
||||
case 5: return "V";
|
||||
case 6: return "VI";
|
||||
case 7: return "VII";
|
||||
case 8: return "VIII";
|
||||
case 9: return "IX";
|
||||
case 10: return "X";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntityEffect
|
||||
{
|
||||
protected float range;
|
||||
protected float radius;
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
protected int maxHit;
|
||||
|
||||
public ExtrapolatedMeleeEntityEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
this.range = 0;
|
||||
this.radius = 0;
|
||||
this.maxHit = 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(World world, EntityPlayer entityPlayer)
|
||||
{
|
||||
Vec3 lookVec = entityPlayer.getLook(range);
|
||||
double x = entityPlayer.posX + lookVec.xCoord;
|
||||
double y = entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord;
|
||||
double z = entityPlayer.posZ + lookVec.zCoord;
|
||||
|
||||
List<Entity> entities = world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(x-0.5f, y-0.5f, z-0.5f, x + 0.5f, y + 0.5f, z + 0.5f).expand(radius, radius, radius));
|
||||
int hit = 0;
|
||||
|
||||
if(entities!=null)
|
||||
{
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
if(hit<maxHit&&!entity.equals(entityPlayer))
|
||||
{
|
||||
if(this.entityEffect(world, entity, entityPlayer))
|
||||
{
|
||||
hit++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean entityEffect(World world, Entity entity, EntityPlayer player);
|
||||
|
||||
public void setRange(float range)
|
||||
{
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
public void setRadius(float radius)
|
||||
{
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public void setMaxNumberHit(int maxHit)
|
||||
{
|
||||
this.maxHit = maxHit;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMeleeSpellEntityEffect
|
||||
{
|
||||
public void onEntityImpact(World world, EntityPlayer entityPlayer);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMeleeSpellWorldEffect
|
||||
{
|
||||
public void onWorldEffect(World world, EntityPlayer entityPlayer);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IProjectileImpactEffect
|
||||
{
|
||||
public void onEntityImpact(Entity mop, Entity projectile);
|
||||
public void onTileImpact(World world, MovingObjectPosition mop);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface IProjectileUpdateEffect
|
||||
{
|
||||
public void onUpdateEffect(Entity projectile);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ISelfSpellEffect
|
||||
{
|
||||
public void onSelfUse(World world, EntityPlayer player);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffect
|
||||
{
|
||||
protected float range;
|
||||
|
||||
public MeleeSpellCenteredWorldEffect(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorldEffect(World world, EntityPlayer entityPlayer)
|
||||
{
|
||||
Vec3 lookVec = entityPlayer.getLook(range).normalize();
|
||||
int x = (int)(entityPlayer.posX + lookVec.xCoord*range);
|
||||
int y = (int)(entityPlayer.posY + entityPlayer.getEyeHeight() + lookVec.yCoord*range);
|
||||
int z = (int)(entityPlayer.posZ + lookVec.zCoord*range);
|
||||
|
||||
this.onCenteredWorldEffect(entityPlayer, world, x, y, z);
|
||||
}
|
||||
|
||||
public void setRange(float range)
|
||||
{
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
public abstract void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class MeleeSpellWorldEffect implements IMeleeSpellWorldEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public MeleeSpellWorldEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract void onWorldEffect(World world, EntityPlayer entityPlayer);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
public abstract class ProjectileImpactEffect implements IProjectileImpactEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public ProjectileImpactEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
public abstract class ProjectileUpdateEffect implements IProjectileUpdateEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public ProjectileUpdateEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class SelfSpellEffect implements ISelfSpellEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public SelfSpellEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
|
||||
public class MeleeDefaultEarth extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeDefaultEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
int radius = this.potencyUpgrades;
|
||||
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k)==null)
|
||||
{
|
||||
Block block = world.getBlock(posX + i, posY + j, posZ + k);
|
||||
|
||||
if(block.getBlockHardness(world, posX + i, posY + j, posZ + k)==-1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int meta = world.getBlockMetadata(posX + i, posY + j, posZ + k);
|
||||
|
||||
EntityFallingBlock entity = new EntityFallingBlock(world, posX + i + 0.5f, posY + j + 0.5f, posZ + k + 0.5f, block, meta);
|
||||
world.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
|
||||
public class MeleeDefensiveEarth extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeDefensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power+2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
ForgeDirection dir = SpellHelper.getDirectionForLookVector(player.getLook(1));
|
||||
|
||||
int vertRadius = (int)(2 + 1.0f/2.0f*Math.pow(this.potencyUpgrades,2)+1.0f/2.0f*this.potencyUpgrades);
|
||||
int horizRadius = this.potencyUpgrades+1;
|
||||
|
||||
int xOff = dir.offsetX;
|
||||
int zOff = dir.offsetZ;
|
||||
|
||||
for(int i=-horizRadius; i<=horizRadius; i++)
|
||||
{
|
||||
for(int j=0; j<vertRadius; j++)
|
||||
{
|
||||
BlockTeleposer.swapBlocks(world, world, posX + i*zOff, posY + j, posZ + i*xOff, posX + i*zOff, posY + j - vertRadius, posZ + i*xOff);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
|
||||
public class MeleeEnvironmentalEarth extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeEnvironmentalEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
int radius = this.potencyUpgrades;
|
||||
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX + i, posY + j, posZ + k) && world.getTileEntity(posX + i, posY + j, posZ + k)==null)
|
||||
{
|
||||
ItemStack stack = new ItemStack(world.getBlock(posX+i, posY+j, posZ+k),1,world.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
|
||||
ItemStack dustStack = SpellHelper.getDustForOre(stack);
|
||||
|
||||
if(dustStack!=null)
|
||||
{
|
||||
dustStack.stackSize *= 3;
|
||||
world.spawnEntityInWorld(new EntityItem(world,posX,posY,posZ,dustStack));
|
||||
|
||||
world.setBlockToAir(posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
|
||||
public class MeleeOffensiveEarth extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
int radius = this.potencyUpgrades;
|
||||
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileDefaultEarth extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefaultEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int horizRange = (int)(0.5*(this.powerUpgrades)+1);
|
||||
int vertRange = (int)(0.5*(this.powerUpgrades)+1);
|
||||
|
||||
int posX = mop.blockX;
|
||||
int posY = mop.blockY;
|
||||
int posZ = mop.blockZ;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
Block block = world.getBlock(posX+i, posY+j, posZ+k);
|
||||
if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1 || SpellHelper.isBlockFluid(block))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
//world.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
world.func_147480_a(posX+i, posY+j, posZ+k, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
|
||||
public class ProjectileDefensiveEarth extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int horizRange = (int)(this.powerUpgrades);
|
||||
int vertRange = (int)(this.potencyUpgrades);
|
||||
|
||||
int posX = mop.blockX;
|
||||
int posY = mop.blockY;
|
||||
int posZ = mop.blockZ;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
Block block = world.getBlock(posX+i, posY+j, posZ+k);
|
||||
if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
//world.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
if(world.rand.nextFloat()<0.6f)
|
||||
{
|
||||
SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,82 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
|
||||
public class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect
|
||||
{
|
||||
public ProjectileEnvironmentalEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEffect(Entity projectile)
|
||||
{
|
||||
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
|
||||
|
||||
int horizRange = this.powerUpgrades+1;
|
||||
int vertRange = (int)(0.5*(this.powerUpgrades+1));
|
||||
int maxBlocks = (int)(2*Math.pow(3.47, this.potencyUpgrades));
|
||||
|
||||
int posX = (int)(posVec.xCoord);
|
||||
int posY = (int)(posVec.yCoord);
|
||||
int posZ = (int)(posVec.zCoord);
|
||||
|
||||
World worldObj = projectile.worldObj;
|
||||
|
||||
if(projectile instanceof EntitySpellProjectile)
|
||||
{
|
||||
int blocksBroken = ((EntitySpellProjectile) projectile).getBlocksBroken();
|
||||
|
||||
if(blocksBroken>=maxBlocks)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(!worldObj.isAirBlock(posX+i, posY+j, posZ+k)&&blocksBroken<maxBlocks)
|
||||
{
|
||||
Block block = worldObj.getBlock(posX+i, posY+j, posZ+k);
|
||||
int meta = worldObj.getBlockMetadata(posX+i, posY+j, posZ+k);
|
||||
if(block == null || block.getBlockHardness(worldObj, posX+i, posY+j, posZ+k)==-1 || SpellHelper.isBlockFluid(block))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(((EntitySpellProjectile)projectile).getIsSilkTouch()&&block.canSilkHarvest(worldObj, ((EntitySpellProjectile)projectile).shootingEntity, posX+i, posY+j, posZ+k, meta))
|
||||
{
|
||||
ItemStack stack = new ItemStack(block,1,meta);
|
||||
EntityItem itemEntity = new EntityItem(worldObj,posX+i+0.5, posY+j+0.5, posZ+k+0.5,stack);
|
||||
worldObj.spawnEntityInWorld(itemEntity);
|
||||
worldObj.setBlockToAir(posX+i, posY+j, posZ+k);
|
||||
}else
|
||||
{
|
||||
worldObj.func_147480_a(posX+i, posY+j, posZ+k, true);
|
||||
}
|
||||
//block.breakBlock(worldObj, posX+i, posY+j, posZ+k, block.blockID, worldObj.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
//worldObj.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
|
||||
|
||||
blocksBroken++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
((EntitySpellProjectile) projectile).setBlocksBroken(blocksBroken);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileOffensiveEarth extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
int horizRange = (int)(this.powerUpgrades);
|
||||
int vertDepth = (int)(3*this.potencyUpgrades+1);
|
||||
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(mop);
|
||||
|
||||
int posX = (int)(blockVector.xCoord);
|
||||
int posY = (int)(blockVector.yCoord);
|
||||
int posZ = (int)(blockVector.zCoord);
|
||||
|
||||
World world = mop.worldObj;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertDepth; j<0; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
Block block = world.getBlock(posX+i, posY+j, posZ+k);
|
||||
if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
//world.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
if(block == Blocks.stone || block == Blocks.cobblestone || block == Blocks.sand || block == Blocks.gravel || block == Blocks.grass || block == Blocks.dirt)
|
||||
{
|
||||
world.setBlockToAir(posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
// int horizRange = (int)(this.powerUpgrades);
|
||||
// int vertRange = (int)(this.potencyUpgrades);
|
||||
//
|
||||
// int posX = mop.blockX;
|
||||
// int posY = mop.blockY;
|
||||
// int posZ = mop.blockZ;
|
||||
//
|
||||
// for(int i=-horizRange; i<=horizRange; i++)
|
||||
// {
|
||||
// for(int j=-vertRange; j<=vertRange; j++)
|
||||
// {
|
||||
// for(int k=-horizRange; k<=horizRange; k++)
|
||||
// {
|
||||
// if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
// {
|
||||
// Block block = world.getBlock(posX+i, posY+j, posZ+k);
|
||||
// if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// //block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
// //world.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
// if(world.rand.nextFloat()<0.6f)
|
||||
// {
|
||||
// SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefaultEarth extends SelfSpellEffect
|
||||
{
|
||||
|
||||
public SelfDefaultEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int horizRadius = this.powerUpgrades;
|
||||
int vertRange = 5 + 10*this.potencyUpgrades;
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
|
||||
|
||||
int posX = (int)(blockVec.xCoord);
|
||||
int posY = (int)(blockVec.yCoord) - 1;
|
||||
int posZ = (int)(blockVec.zCoord);
|
||||
|
||||
for(int i=-horizRadius; i<=horizRadius; i++)
|
||||
{
|
||||
for(int k=-horizRadius; k<=horizRadius; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY, posZ+k))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for(int j=-1; j>=-vertRange; j--)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY+j, posZ+k)&&!SpellHelper.isBlockFluid(world.getBlock(posX+i, posY+j, posZ+k)))
|
||||
{
|
||||
BlockTeleposer.swapBlocks(world, world, posX+i, posY, posZ+k, posX+i, posY+j, posZ+k);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefensiveEarth extends SelfSpellEffect
|
||||
{
|
||||
|
||||
public SelfDefensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int pot = 2*this.potencyUpgrades + 1;
|
||||
int duration = 20*60*(this.powerUpgrades+1);
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.field_76434_w.id,duration, pot));
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id, duration, pot));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfEnvironmentalEarth extends SelfSpellEffect
|
||||
{
|
||||
public SelfEnvironmentalEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
float radius = this.powerUpgrades*2 + 1.5f;
|
||||
int dur = this.powerUpgrades*5*20 + 60;
|
||||
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ, radius, radius);
|
||||
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
((EntityLiving) entity).addPotionEffect(new PotionEffect(Potion.weakness.id,dur,this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfOffensiveEarth extends SelfSpellEffect
|
||||
{
|
||||
|
||||
public SelfOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int horizRadius = this.powerUpgrades;
|
||||
int vertRadius = this.potencyUpgrades + 1;
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(player);
|
||||
|
||||
int posX = (int)(blockVec.xCoord);
|
||||
int posY = (int)(blockVec.yCoord);
|
||||
int posZ = (int)(blockVec.zCoord);
|
||||
|
||||
for(int i=-horizRadius; i<=horizRadius; i++)
|
||||
{
|
||||
for(int j=-vertRadius; j<0; j++)
|
||||
{
|
||||
for(int k=-horizRadius; k<=horizRadius; k++)
|
||||
{
|
||||
if(world.rand.nextFloat()<0.7f)
|
||||
{
|
||||
SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.DigAreaEffect;
|
||||
|
||||
public class ToolEnvironmentalEarth extends DigAreaEffect
|
||||
{
|
||||
public ToolEnvironmentalEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool)
|
||||
{
|
||||
if(!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int x = blockPos.blockX;
|
||||
int y = blockPos.blockY;
|
||||
int z = blockPos.blockZ;
|
||||
ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit);
|
||||
|
||||
int radius = 2;
|
||||
int depth = 5;
|
||||
|
||||
depth--;
|
||||
|
||||
int posX = radius;
|
||||
int negX = radius;
|
||||
int posY = radius;
|
||||
int negY = radius;
|
||||
int posZ = radius;
|
||||
int negZ = radius;
|
||||
|
||||
switch(sidehit)
|
||||
{
|
||||
case UP:
|
||||
posY = 0;
|
||||
negY = depth;
|
||||
break;
|
||||
case DOWN:
|
||||
negY = 0;
|
||||
posY = depth;
|
||||
break;
|
||||
case SOUTH:
|
||||
posZ = 0;
|
||||
negZ = depth;
|
||||
break;
|
||||
case NORTH:
|
||||
negZ = 0;
|
||||
posZ = depth;
|
||||
break;
|
||||
case WEST:
|
||||
negX = 0;
|
||||
posX = depth;
|
||||
break;
|
||||
case EAST:
|
||||
posX = 0;
|
||||
negX = depth;
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
for(int xPos = x-negX; xPos <= x+posX; xPos++)
|
||||
{
|
||||
for(int yPos = y-negY; yPos <= y+posY; yPos++)
|
||||
{
|
||||
for(int zPos = z-negZ; zPos <= z+posZ; zPos++)
|
||||
{
|
||||
this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeDefaultFire extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeDefaultFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3+0.3f*potency);
|
||||
this.setRadius(2+0.3f*potency);
|
||||
this.setMaxNumberHit(potency+1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
entity.setFire(3*this.powerUpgrades+3);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect;
|
||||
|
||||
public class MeleeDefensiveFire extends MeleeSpellWorldEffect
|
||||
{
|
||||
public MeleeDefensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorldEffect(World world, EntityPlayer entityPlayer)
|
||||
{
|
||||
ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec());
|
||||
|
||||
int width = this.potencyUpgrades + 1;
|
||||
int length = 5*this.powerUpgrades + 3;
|
||||
|
||||
int xOffset = look.offsetX;
|
||||
int zOffset = look.offsetZ;
|
||||
|
||||
Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer);
|
||||
|
||||
int xStart = (int)(lookVec.xCoord)+1*xOffset;
|
||||
int zStart = (int)(lookVec.zCoord)+1*zOffset;
|
||||
int yStart = (int)(lookVec.yCoord)-1;
|
||||
|
||||
for(int i=-width; i<=width; i++)
|
||||
{
|
||||
for(int j=0; j<length;j++)
|
||||
{
|
||||
for(int k=0;k<3;k++)
|
||||
{
|
||||
if(world.isAirBlock(xStart + i*(zOffset) + j*(xOffset), yStart+k, zStart + i*(xOffset) + j*(zOffset)))
|
||||
{
|
||||
world.setBlock(xStart + i*(zOffset) + j*(xOffset), yStart+k, zStart + i*(xOffset) + j*(zOffset), Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
|
||||
public class MeleeEnvironmentalFire extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeEnvironmentalFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
int radius = this.potencyUpgrades;
|
||||
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
SpellHelper.evaporateWaterBlock(world, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeOffensiveFire extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeOffensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3+0.3f*potency);
|
||||
this.setRadius(2+0.3f*potency);
|
||||
this.setMaxNumberHit(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
((EntityLiving)entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFireFuse.id,20*(7-this.powerUpgrades),this.potencyUpgrades));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileDefaultFire extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefaultFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(mop);
|
||||
|
||||
int x = (int)(blockVec.xCoord);
|
||||
int y = (int)(blockVec.yCoord);
|
||||
int z = (int)(blockVec.zCoord);
|
||||
World world = mop.worldObj;
|
||||
|
||||
int horizRange = 0;
|
||||
int vertRange = 0;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange;i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange;j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(world.isAirBlock(x+i, y+j, z+k))
|
||||
{
|
||||
world.setBlock(x+i, y+j, z+k, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int x = mop.blockX;
|
||||
int y = mop.blockY;
|
||||
int z = mop.blockZ;
|
||||
|
||||
int horizRange = 0;
|
||||
int vertRange = 0;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange;i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange;j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(world.isAirBlock(x+i, y+j, z+k))
|
||||
{
|
||||
world.setBlock(x+i, y+j, z+k, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileDefensiveFire extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
mop.setFire(3*(this.potencyUpgrades+1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int horizRange = (int)((this.powerUpgrades));
|
||||
int vertRange = (int)((this.powerUpgrades));
|
||||
|
||||
int posX = mop.blockX;
|
||||
int posY = mop.blockY;
|
||||
int posZ = mop.blockZ;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
SpellHelper.smeltBlockInWorld(world, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
|
||||
public class ProjectileEnvironmentalFire extends ProjectileUpdateEffect
|
||||
{
|
||||
public ProjectileEnvironmentalFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEffect(Entity projectile)
|
||||
{
|
||||
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
|
||||
|
||||
int horizRange = this.powerUpgrades+1;
|
||||
int vertRange = (int)(0.5*(this.powerUpgrades+1));
|
||||
|
||||
int posX = (int)(posVec.xCoord);
|
||||
int posY = (int)(posVec.yCoord);
|
||||
int posZ = (int)(posVec.zCoord);
|
||||
|
||||
World worldObj = projectile.worldObj;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(!worldObj.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
SpellHelper.evaporateWaterBlock(worldObj, posX + i, posY + j, posZ + k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileOffensiveFire extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileOffensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
int horizRange = (int)(this.powerUpgrades);
|
||||
int vertDepth = (int)(3*this.potencyUpgrades+1);
|
||||
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(mop);
|
||||
|
||||
int posX = (int)(blockVector.xCoord);
|
||||
int posY = (int)(blockVector.yCoord);
|
||||
int posZ = (int)(blockVector.zCoord);
|
||||
|
||||
World world = mop.worldObj;
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertDepth; j<0; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
world.setBlock(posX + i, posY + j, posZ + k, Blocks.flowing_lava,7,3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
// int horizRange = (int)(this.powerUpgrades);
|
||||
// int vertRange = (int)(this.potencyUpgrades);
|
||||
//
|
||||
// int posX = mop.blockX;
|
||||
// int posY = mop.blockY;
|
||||
// int posZ = mop.blockZ;
|
||||
//
|
||||
// for(int i=-horizRange; i<=horizRange; i++)
|
||||
// {
|
||||
// for(int j=-vertRange; j<=vertRange; j++)
|
||||
// {
|
||||
// for(int k=-horizRange; k<=horizRange; k++)
|
||||
// {
|
||||
// if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
// {
|
||||
// Block block = world.getBlock(posX+i, posY+j, posZ+k);
|
||||
// if(block == null || block.getBlockHardness(world, posX+i, posY+j, posZ+k)==-1)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
// //block.breakBlock(world, posX+i, posY+j, posZ+k, block.blockID, world.getBlockMetadata(posX+i, posY+j, posZ+k));
|
||||
// //world.destroyBlock(posX+i, posY+j, posZ+k, true);
|
||||
// if(world.rand.nextFloat()<0.6f)
|
||||
// {
|
||||
// SpellHelper.smashBlock(world, posX+i, posY+j, posZ+k);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ISelfSpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SelfDefaultFire extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefaultFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.setFire((int)(10*Math.pow(1.5, powerUpgrades+1.5*potencyUpgrades)));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefensiveFire extends SelfSpellEffect {
|
||||
|
||||
public SelfDefensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int horizRange = (int)(this.powerUpgrades);
|
||||
int vertDepth = (int)(3*this.potencyUpgrades+1);
|
||||
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(player);
|
||||
|
||||
int posX = (int)(blockVector.xCoord);
|
||||
int posY = (int)(blockVector.yCoord);
|
||||
int posZ = (int)(blockVector.zCoord);
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertDepth; j<0; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
if(world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
world.setBlock(posX + i, posY + j, posZ + k, Blocks.flowing_lava,7,3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfEnvironmentalFire extends SelfSpellEffect
|
||||
{
|
||||
public SelfEnvironmentalFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int posX = (int) Math.round(player.posX - 0.5f);
|
||||
int posY = (int) player.posY;
|
||||
int posZ = (int) Math.round(player.posZ - 0.5f);
|
||||
|
||||
int powRadius = this.powerUpgrades;
|
||||
int potRadius = this.potencyUpgrades-1;
|
||||
|
||||
for(int i=-powRadius;i<=powRadius;i++)
|
||||
{
|
||||
for(int j=-powRadius;j<=powRadius;j++)
|
||||
{
|
||||
for(int k=-powRadius;k<=powRadius;k++)
|
||||
{
|
||||
if(world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
world.setBlock(posX+i, posY+j, posZ+k, Blocks.fire);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=-potRadius;i<=potRadius;i++)
|
||||
{
|
||||
for(int j=-potRadius;j<=potRadius;j++)
|
||||
{
|
||||
for(int k=-potRadius;k<=potRadius;k++)
|
||||
{
|
||||
if(!world.isAirBlock(posX+i, posY+j, posZ+k))
|
||||
{
|
||||
SpellHelper.smeltBlockInWorld(world, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfOffensiveFire extends SelfSpellEffect
|
||||
{
|
||||
public SelfOffensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,300*(2*this.powerUpgrades+1),this.potencyUpgrades));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ItemManipulator;
|
||||
|
||||
public class ToolDefaultFire extends ItemManipulator
|
||||
{
|
||||
public ToolDefaultFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList)
|
||||
{
|
||||
LinkedList<ItemStack> newList = new LinkedList();
|
||||
for(ItemStack item : itemList)
|
||||
{
|
||||
ItemStack newItem = FurnaceRecipes.smelting().getSmeltingResult(item);
|
||||
if(newItem != null)
|
||||
{
|
||||
newList.add(newItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
newList.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
return newList;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
|
||||
public class ToolOffensiveFire extends LeftClickEffect
|
||||
{
|
||||
public ToolOffensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
attacked.setFire(3 + 4*this.powerUpgrades);
|
||||
|
||||
return (int)(10*(1+this.powerUpgrades)*Math.pow(0.85, this.costUpgrades));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeDefaultIce extends ExtrapolatedMeleeEntityEffect {
|
||||
|
||||
public MeleeDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3+0.3f*potency);
|
||||
this.setRadius(2+0.3f*potency);
|
||||
this.setMaxNumberHit(potency+1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
if(entity.hurtResistantTime>0)
|
||||
{
|
||||
entity.hurtResistantTime = Math.max(0, -(potencyUpgrades+1)+entity.hurtResistantTime);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect;
|
||||
|
||||
public class MeleeDefensiveIce extends MeleeSpellWorldEffect
|
||||
{
|
||||
public MeleeDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorldEffect(World world, EntityPlayer entityPlayer)
|
||||
{
|
||||
ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(entityPlayer.getLookVec());
|
||||
|
||||
int width = this.powerUpgrades;
|
||||
int height = this.powerUpgrades + 2;
|
||||
|
||||
int xOffset = look.offsetX;
|
||||
int zOffset = look.offsetZ;
|
||||
|
||||
int range = this.potencyUpgrades + 1;
|
||||
|
||||
Vec3 lookVec = SpellHelper.getEntityBlockVector(entityPlayer);
|
||||
|
||||
int xStart = (int)(lookVec.xCoord) + range * xOffset;
|
||||
int zStart = (int)(lookVec.zCoord) + range * zOffset;
|
||||
int yStart = (int)(lookVec.yCoord);
|
||||
|
||||
for(int i=-width; i<=width; i++)
|
||||
{
|
||||
for(int j=0; j<height;j++)
|
||||
{
|
||||
if(world.isAirBlock(xStart + i*(zOffset), yStart + j, zStart + i*(xOffset)))
|
||||
{
|
||||
world.setBlock(xStart + i*(zOffset), yStart + j, zStart + i*(xOffset), Blocks.ice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntitySnowball;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeEnvironmentalIce extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeEnvironmentalIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setMaxNumberHit(1+potency);
|
||||
this.setRadius(2);
|
||||
this.setRange(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
//TODO Change to an Ice Cage
|
||||
for(int i=0;i<=this.powerUpgrades;i++)
|
||||
{
|
||||
double randX = (world.rand.nextDouble()-world.rand.nextDouble())*3;
|
||||
double randY = -world.rand.nextDouble()*3;
|
||||
double randZ = (world.rand.nextDouble()-world.rand.nextDouble())*3;
|
||||
|
||||
EntitySnowball snowball = new EntitySnowball(world, entity.posX-3*randX, entity.posY-3*randY, entity.posZ-3*randZ);
|
||||
snowball.motionX = randX;
|
||||
snowball.motionY = randY;
|
||||
snowball.motionZ = randZ;
|
||||
|
||||
world.spawnEntityInWorld(snowball);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeOffensiveIce extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeOffensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setMaxNumberHit(1+potency);
|
||||
this.setRadius(2);
|
||||
this.setRange(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(entity);
|
||||
|
||||
int posX = (int)(blockVector.xCoord);
|
||||
int posY = (int)(blockVector.yCoord);
|
||||
int posZ = (int)(blockVector.zCoord);
|
||||
|
||||
double yVel = 1*(0.3*this.powerUpgrades+0.90);
|
||||
|
||||
entity.motionY = yVel;
|
||||
|
||||
for(int i=0;i<2;i++)
|
||||
{
|
||||
if(world.isAirBlock(posX,posY+i,posZ))
|
||||
{
|
||||
world.setBlock(posX, posY+i, posZ, Blocks.ice);
|
||||
}
|
||||
}
|
||||
|
||||
entity.fallDistance = 0.0f;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileDefaultIce extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int horizRadius = this.powerUpgrades+1;
|
||||
int vertRadius = this.potencyUpgrades;
|
||||
|
||||
ForgeDirection sideHit = ForgeDirection.getOrientation(mop.sideHit);
|
||||
|
||||
int posX = mop.blockX + sideHit.offsetX;
|
||||
int posY = mop.blockY + sideHit.offsetY;
|
||||
int posZ = mop.blockZ + sideHit.offsetZ;
|
||||
|
||||
if(world.isAirBlock(posX, posY, posZ))
|
||||
{
|
||||
world.setBlock(posX, posY, posZ, Blocks.ice);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileDefensiveIce extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int horizRadius = this.powerUpgrades+1;
|
||||
int vertRadius = this.potencyUpgrades;
|
||||
|
||||
int posX = mop.blockX;
|
||||
int posY = mop.blockY;
|
||||
int posZ = mop.blockZ;
|
||||
|
||||
for(int i=-horizRadius; i<=horizRadius; i++)
|
||||
{
|
||||
for(int k=-horizRadius; k<=horizRadius; k++)
|
||||
{
|
||||
for(int j=-vertRadius; j<=vertRadius; j++)
|
||||
{
|
||||
SpellHelper.freezeWaterBlock(world, posX+i, posY+j, posZ+k);
|
||||
|
||||
if(world.isAirBlock(posX+i, posY+j, posZ+k)&&!world.isAirBlock(posX+i, posY+j-1, posZ+k))
|
||||
{
|
||||
world.setBlock(posX+i, posY+j, posZ+k, Blocks.snow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
|
||||
public class ProjectileEnvironmentalIce extends ProjectileUpdateEffect
|
||||
{
|
||||
|
||||
public ProjectileEnvironmentalIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEffect(Entity projectile)
|
||||
{
|
||||
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
|
||||
|
||||
int horizRange = this.powerUpgrades+1;
|
||||
int vertRange = this.potencyUpgrades+1;
|
||||
|
||||
int posX = (int)(posVec.xCoord);
|
||||
int posY = (int)(posVec.yCoord);
|
||||
int posZ = (int)(posVec.zCoord);
|
||||
|
||||
for(int i=-horizRange; i<=horizRange; i++)
|
||||
{
|
||||
for(int j=-vertRange; j<=vertRange; j++)
|
||||
{
|
||||
for(int k=-horizRange; k<=horizRange; k++)
|
||||
{
|
||||
SpellHelper.freezeWaterBlock(projectile.worldObj, posX+i, posY+j, posZ+k);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileOffensiveIce extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileOffensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
if(mop instanceof EntityLivingBase)
|
||||
{
|
||||
((EntityLivingBase) mop).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60*(this.powerUpgrades+1),this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefaultIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
Vec3 blockVector = SpellHelper.getEntityBlockVector(player);
|
||||
|
||||
int posX = (int)(blockVector.xCoord);
|
||||
int posY = (int)(blockVector.yCoord);
|
||||
int posZ = (int)(blockVector.zCoord);
|
||||
|
||||
double yVel = 1*(0.4*this.powerUpgrades+0.75);
|
||||
|
||||
//PacketDispatcher.sendPacketToPlayer(PacketHandler.getPlayerVelocitySettingPacket(player.motionX, yVel, player.motionZ),(Player)player);
|
||||
SpellHelper.setPlayerSpeedFromServer(player, player.motionX, yVel, player.motionZ);
|
||||
|
||||
for(int i=0;i<2;i++)
|
||||
{
|
||||
if(world.isAirBlock(posX,posY+i,posZ))
|
||||
{
|
||||
world.setBlock(posX, posY+i, posZ, Blocks.ice);
|
||||
}
|
||||
}
|
||||
|
||||
player.fallDistance = 0.0f;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefensiveIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionIceCloak.id,300*(2*this.powerUpgrades+1),this.potencyUpgrades));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfEnvironmentalIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfEnvironmentalIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
ForgeDirection look = SpellHelper.getCompassDirectionForLookVector(player.getLookVec());
|
||||
|
||||
int width = this.potencyUpgrades + 1;
|
||||
int length = 5*this.powerUpgrades + 3;
|
||||
|
||||
int xOffset = look.offsetX;
|
||||
int zOffset = look.offsetZ;
|
||||
|
||||
Vec3 lookVec = SpellHelper.getEntityBlockVector(player);
|
||||
|
||||
int xStart = (int)(lookVec.xCoord);
|
||||
int zStart = (int)(lookVec.zCoord);
|
||||
int yStart = (int)(lookVec.yCoord)-1;
|
||||
|
||||
for(int i=-width; i<=width; i++)
|
||||
{
|
||||
for(int j=0; j<length;j++)
|
||||
{
|
||||
if(world.isAirBlock(xStart + i*(zOffset) + j*(xOffset), yStart, zStart + i*(xOffset) + j*(zOffset)))
|
||||
{
|
||||
world.setBlock(xStart + i*(zOffset) + j*(xOffset), yStart, zStart + i*(xOffset) + j*(zOffset), Blocks.ice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfOffensiveIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfOffensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
double horizRadius = this.powerUpgrades+1;
|
||||
double vertRadius = 0.5*this.powerUpgrades+1;
|
||||
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, player.posX, player.posY, player.posZ,horizRadius, vertRadius);
|
||||
|
||||
if(entities==null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int i=0;
|
||||
int number = this.powerUpgrades+1;
|
||||
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
if(i>=number)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityLivingBase && !entity.equals(player))
|
||||
{
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,60*(1+this.powerUpgrades),this.potencyUpgrades));
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.SummonToolEffect;
|
||||
|
||||
public class ToolDefensiveIce extends SummonToolEffect
|
||||
{
|
||||
public ToolDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onSummonTool(ItemStack toolStack, World world, Entity entity)
|
||||
{
|
||||
int horizRadius = this.powerUpgrades*2+2;
|
||||
int vertRadius = this.powerUpgrades * 3 + 2;
|
||||
List<Entity> entityList = SpellHelper.getEntitiesInRange(world, entity.posX, entity.posY, entity.posZ, horizRadius, vertRadius);
|
||||
|
||||
for(Entity ent : entityList)
|
||||
{
|
||||
if(ent instanceof EntityLivingBase && !ent.equals(entity))
|
||||
{
|
||||
((EntityLivingBase)ent).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,200,this.potencyUpgrades*2));
|
||||
}
|
||||
}
|
||||
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(entity);
|
||||
|
||||
int x = (int)(blockVec.xCoord);
|
||||
int y = (int)(blockVec.yCoord);
|
||||
int z = (int)(blockVec.zCoord);
|
||||
|
||||
for(int posX = x-horizRadius; posX <= x+horizRadius; posX++)
|
||||
{
|
||||
for(int posY = y-vertRadius; posY <= y+vertRadius; posY++)
|
||||
{
|
||||
for(int posZ = z-horizRadius; posZ <= z+horizRadius; posZ++)
|
||||
{
|
||||
SpellHelper.freezeWaterBlock(world, posX, posY, posZ);
|
||||
if(world.isSideSolid(posX, posY, posZ, ForgeDirection.UP) && world.isAirBlock(posX, posY+1, posZ))
|
||||
{
|
||||
world.setBlock(posX, posY+1, posZ, Blocks.snow_layer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
|
||||
public class DigAreaEffect implements IDigAreaEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public DigAreaEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool)
|
||||
{
|
||||
if(!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int x = blockPos.blockX;
|
||||
int y = blockPos.blockY;
|
||||
int z = blockPos.blockZ;
|
||||
ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit);
|
||||
|
||||
for(int xPos = x-1; xPos <= x+1; xPos++)
|
||||
{
|
||||
for(int yPos = y-1; yPos <= y+1; yPos++)
|
||||
{
|
||||
for(int zPos = z-1; zPos <= z+1; zPos++)
|
||||
{
|
||||
this.breakBlock(container, world, player, blockHardness, xPos, yPos, zPos, itemTool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void breakBlock(ItemStack container, World world, EntityPlayer player, float blockHardness, int x, int y, int z, ItemSpellMultiTool itemTool)
|
||||
{
|
||||
int hlvl = -1;
|
||||
Block localBlock = world.getBlock(x, y, z);
|
||||
int localMeta = world.getBlockMetadata(x, y, z);
|
||||
String toolClass = localBlock.getHarvestTool(localMeta);
|
||||
if (toolClass != null && itemTool.getHarvestLevel(container, toolClass) != -1)
|
||||
hlvl = localBlock.getHarvestLevel(localMeta);
|
||||
int toolLevel = itemTool.getHarvestLevel(container, toolClass);
|
||||
|
||||
float localHardness = localBlock == null ? Float.MAX_VALUE : localBlock.getBlockHardness(world, x, y, z);
|
||||
|
||||
if (hlvl <= toolLevel && localHardness - this.getHardnessDifference() <= blockHardness)
|
||||
{
|
||||
boolean cancelHarvest = false;
|
||||
|
||||
if (!cancelHarvest)
|
||||
{
|
||||
if (localBlock != null && !(localHardness < 0))
|
||||
{
|
||||
boolean isEffective = false;
|
||||
|
||||
String localToolClass = itemTool.getToolClassForMaterial(localBlock.getMaterial());
|
||||
|
||||
if(localToolClass != null && itemTool.getHarvestLevel(container, toolClass) >= localBlock.getHarvestLevel(localMeta))
|
||||
{
|
||||
isEffective = true;
|
||||
}
|
||||
|
||||
|
||||
if (localBlock.getMaterial().isToolNotRequired())
|
||||
{
|
||||
isEffective = true;
|
||||
}
|
||||
|
||||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
if (isEffective)
|
||||
{
|
||||
if (localBlock.removedByPlayer(world, player, x, y, z))
|
||||
{
|
||||
localBlock.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
|
||||
}
|
||||
//localBlock.harvestBlock(world, player, x, y, z, localMeta);
|
||||
localBlock.onBlockHarvested(world, x, y, z, localMeta, player);
|
||||
if (localHardness > 0f)
|
||||
itemTool.onBlockDestroyed(container, world, localBlock, x, y, z, player);
|
||||
|
||||
List<ItemStack> items = SpellHelper.getItemsFromBlock(world, localBlock, x, y, z, localMeta, itemTool.getSilkTouch(container), itemTool.getFortuneLevel(container));
|
||||
|
||||
SpellParadigmTool parad = itemTool.loadParadigmFromStack(container);
|
||||
items = parad.handleItemList(container, items);
|
||||
|
||||
if(!world.isRemote)
|
||||
{
|
||||
SpellHelper.spawnItemListInWorld(items, world, x + 0.5f, y + 0.5f, z + 0.5f);
|
||||
}
|
||||
|
||||
world.func_147479_m(x, y, z);
|
||||
}
|
||||
else
|
||||
{
|
||||
// world.setBlockToAir(x, y, z);
|
||||
// world.func_147479_m(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.func_147479_m(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float getHardnessDifference()
|
||||
{
|
||||
return 1.5f;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,171 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
|
||||
public class DigAreaTunnel extends DigAreaEffect
|
||||
{
|
||||
Random rand = new Random();
|
||||
|
||||
public DigAreaTunnel(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool)
|
||||
{
|
||||
if(!blockPos.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
List<Vec3> vectorLine = new LinkedList();
|
||||
|
||||
double initialX = blockPos.blockX;
|
||||
double initialY = blockPos.blockY;
|
||||
double initialZ = blockPos.blockZ;
|
||||
ForgeDirection sidehit = ForgeDirection.getOrientation(blockPos.sideHit);
|
||||
ForgeDirection opposite = sidehit.getOpposite();
|
||||
|
||||
System.out.println(opposite.toString());
|
||||
|
||||
double initialLength = this.getRandomVectorLength();
|
||||
|
||||
Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX*initialLength, opposite.offsetY*initialLength, opposite.offsetZ*initialLength);
|
||||
|
||||
Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord);
|
||||
vectorLine.add(initialVector);
|
||||
|
||||
double currentLength = lastVec.lengthVector();
|
||||
double totalLength = this.totalLength();
|
||||
|
||||
while(currentLength < totalLength-0.01)
|
||||
{
|
||||
Vec3 tempVec = lastVec.addVector(0, 0, 0);
|
||||
|
||||
tempVec = tempVec.normalize();
|
||||
|
||||
double varr = this.varyRate();
|
||||
|
||||
tempVec = tempVec.addVector(varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat()));
|
||||
|
||||
tempVec = tempVec.normalize();
|
||||
|
||||
double length = Math.min(this.getRandomVectorLength(), totalLength-currentLength);
|
||||
|
||||
tempVec.xCoord = tempVec.xCoord*length;
|
||||
tempVec.yCoord = tempVec.yCoord*length;
|
||||
tempVec.zCoord = tempVec.zCoord*length;
|
||||
|
||||
vectorLine.add(tempVec);
|
||||
|
||||
lastVec = tempVec;
|
||||
|
||||
currentLength += tempVec.lengthVector();
|
||||
}
|
||||
|
||||
for(Vec3 testVec : vectorLine)
|
||||
{
|
||||
this.travelVector(testVec, world, initialX, initialY, initialZ);
|
||||
|
||||
initialX += testVec.xCoord;
|
||||
initialY += testVec.yCoord;
|
||||
initialZ += testVec.zCoord;
|
||||
}
|
||||
|
||||
this.travelVector(lastVec, world, initialX, initialY, initialZ);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double totalLength()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public double getStepSize()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public double varyRate()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
public double getRandomVectorLength()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
public double getRandomStepLength()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
public int getRandomRadius()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
public void destroySphereOfMundane(World world, double x, double y, double z, int radius)
|
||||
{
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int newX = (int)(i + x + 0.5);
|
||||
int newY = (int)(j + y + 0.5);
|
||||
int newZ = (int)(k + z + 0.5);
|
||||
|
||||
this.destroyMunadeAt(world, newX, newY, newZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void destroyMunadeAt(World world, int x, int y, int z)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
public void travelVector(Vec3 vector, World world, double x, double y, double z)
|
||||
{
|
||||
double vecLength = vector.lengthVector();
|
||||
System.out.println(vecLength);
|
||||
Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
normVec = normVec.normalize();
|
||||
|
||||
Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0);
|
||||
double distanceTravelled = 0;
|
||||
|
||||
while(distanceTravelled < vecLength)
|
||||
{
|
||||
System.out.println(distanceTravelled);
|
||||
double stepLength = this.getRandomStepLength();
|
||||
|
||||
prevVec = prevVec.addVector(stepLength*normVec.xCoord, stepLength*normVec.yCoord, normVec.zCoord);
|
||||
|
||||
this.destroySphereOfMundane(world, prevVec.xCoord + x, prevVec.yCoord + y, prevVec.zCoord + z, this.getRandomRadius());
|
||||
|
||||
distanceTravelled = prevVec.lengthVector();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
|
||||
public interface IDigAreaEffect
|
||||
{
|
||||
public abstract int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IItemManipulator
|
||||
{
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ILeftClickEffect
|
||||
{
|
||||
public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IOnBanishTool
|
||||
{
|
||||
public abstract int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand);
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IOnBreakBlock
|
||||
{
|
||||
public abstract int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IOnSummonTool
|
||||
{
|
||||
public abstract int onSummonTool(ItemStack toolStack, World world, Entity entity);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IRightClickEffect
|
||||
{
|
||||
//public abstract int onRightClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
|
||||
public abstract int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop);
|
||||
|
||||
public abstract int onRightClickAir(ItemStack stack, EntityLivingBase weilder);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface ISpecialDamageEffect
|
||||
{
|
||||
public float getDamageForEntity(Entity entity);
|
||||
|
||||
public String getKey();
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolUpdateEffect
|
||||
{
|
||||
public abstract int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand);
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class ItemManipulator implements IItemManipulator
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public ItemManipulator(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack,List<ItemStack> itemList);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class LeftClickEffect implements ILeftClickEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public LeftClickEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class OnBreakBlockEffect implements IOnBreakBlock
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public OnBreakBlockEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
public abstract class RightClickEffect implements IRightClickEffect
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public RightClickEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,177 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class RightClickTunnel extends RightClickEffect
|
||||
{
|
||||
Random rand = new Random();
|
||||
public RightClickTunnel(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onRightClickBlock(ItemStack stack, EntityLivingBase weilder, World world, MovingObjectPosition mop)
|
||||
{
|
||||
if(weilder.worldObj.isRemote)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if(!mop.typeOfHit.equals(MovingObjectPosition.MovingObjectType.BLOCK))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
List<Vec3> vectorLine = new LinkedList();
|
||||
|
||||
double initialX = mop.blockX;
|
||||
double initialY = mop.blockY;
|
||||
double initialZ = mop.blockZ;
|
||||
ForgeDirection sidehit = ForgeDirection.getOrientation(mop.sideHit);
|
||||
ForgeDirection opposite = sidehit.getOpposite();
|
||||
|
||||
double initialLength = this.getRandomVectorLength();
|
||||
|
||||
Vec3 initialVector = Vec3.createVectorHelper(opposite.offsetX*initialLength, opposite.offsetY*initialLength, opposite.offsetZ*initialLength);
|
||||
|
||||
Vec3 lastVec = Vec3.createVectorHelper(initialVector.xCoord, initialVector.yCoord, initialVector.zCoord);
|
||||
vectorLine.add(initialVector);
|
||||
|
||||
double currentLength = lastVec.lengthVector();
|
||||
double totalLength = this.totalLength();
|
||||
|
||||
while(currentLength < totalLength-0.01)
|
||||
{
|
||||
Vec3 tempVec = lastVec.addVector(0, 0, 0);
|
||||
|
||||
tempVec = tempVec.normalize();
|
||||
|
||||
double varr = this.varyRate();
|
||||
|
||||
tempVec = tempVec.addVector(varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat()), varr*(rand.nextFloat() - rand.nextFloat()));
|
||||
|
||||
tempVec = tempVec.normalize();
|
||||
|
||||
double length = Math.min(this.getRandomVectorLength(), totalLength-currentLength);
|
||||
|
||||
tempVec.xCoord = tempVec.xCoord*length;
|
||||
tempVec.yCoord = tempVec.yCoord*length;
|
||||
tempVec.zCoord = tempVec.zCoord*length;
|
||||
|
||||
vectorLine.add(tempVec);
|
||||
|
||||
lastVec = tempVec;
|
||||
|
||||
currentLength += tempVec.lengthVector();
|
||||
}
|
||||
|
||||
for(Vec3 testVec : vectorLine)
|
||||
{
|
||||
this.travelVector(testVec, world, initialX, initialY, initialZ);
|
||||
|
||||
initialX += testVec.xCoord;
|
||||
initialY += testVec.yCoord;
|
||||
initialZ += testVec.zCoord;
|
||||
}
|
||||
|
||||
this.travelVector(lastVec, world, initialX, initialY, initialZ);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onRightClickAir(ItemStack stack, EntityLivingBase weilder)
|
||||
{
|
||||
//Empty Method
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double totalLength()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public double getStepSize()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public double varyRate()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
public double getRandomVectorLength()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
public double getRandomStepLength()
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
|
||||
public int getRandomRadius()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
public void destroySphereOfMundane(World world, double x, double y, double z, int radius)
|
||||
{
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
if (i * i + j * j + k * k >= (radius + 0.50f) * (radius + 0.50f))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int newX = (int)(i + x + 0.5);
|
||||
int newY = (int)(j + y + 0.5);
|
||||
int newZ = (int)(k + z + 0.5);
|
||||
|
||||
this.destroyMunadeAt(world, newX, newY, newZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void destroyMunadeAt(World world, int x, int y, int z)
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
public void travelVector(Vec3 vector, World world, double x, double y, double z)
|
||||
{
|
||||
double vecLength = vector.lengthVector();
|
||||
|
||||
Vec3 normVec = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord);
|
||||
normVec = normVec.normalize();
|
||||
|
||||
Vec3 prevVec = Vec3.createVectorHelper(0, 0, 0);
|
||||
double distanceTravelled = 0;
|
||||
|
||||
while(distanceTravelled < vecLength)
|
||||
{
|
||||
double stepLength = this.getRandomStepLength();
|
||||
|
||||
prevVec = prevVec.addVector(stepLength*normVec.xCoord, stepLength*normVec.yCoord, normVec.zCoord);
|
||||
|
||||
this.destroySphereOfMundane(world, prevVec.xCoord + x, prevVec.yCoord + y, prevVec.zCoord + z, this.getRandomRadius());
|
||||
|
||||
distanceTravelled = prevVec.lengthVector();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
public abstract class SummonToolEffect implements IOnSummonTool
|
||||
{
|
||||
protected int powerUpgrades;
|
||||
protected int potencyUpgrades;
|
||||
protected int costUpgrades;
|
||||
|
||||
public SummonToolEffect(int power, int potency, int cost)
|
||||
{
|
||||
this.powerUpgrades = power;
|
||||
this.potencyUpgrades = potency;
|
||||
this.costUpgrades = cost;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeDefaultWind extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeDefaultWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(4+2.0f*potency);
|
||||
this.setRadius(4+2.0f*potency);
|
||||
this.setMaxNumberHit(potency+1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer player)
|
||||
{
|
||||
double wantedVel = -(0.5d+0.7d*this.powerUpgrades);
|
||||
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
double dist = Math.sqrt(entity.getDistanceToEntity(player));
|
||||
double xVel = wantedVel*(entity.posX - player.posX)/dist;
|
||||
double yVel = wantedVel*(entity.posY - player.posY)/dist;
|
||||
double zVel = wantedVel*(entity.posZ - player.posZ)/dist;
|
||||
|
||||
entity.motionX = xVel;
|
||||
entity.motionY = yVel;
|
||||
entity.motionZ = zVel;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeDefensiveWind extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeDefensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3+0.3f*potency);
|
||||
this.setRadius(2+0.3f*potency);
|
||||
this.setMaxNumberHit(potency+1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer player)
|
||||
{
|
||||
double wantedVel = 0.5d+0.5d*this.powerUpgrades;
|
||||
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
entity.motionY = wantedVel;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
|
||||
public class MeleeEnvironmentalWind extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(5*power + 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ)
|
||||
{
|
||||
int radius = 5*this.potencyUpgrades + 3;
|
||||
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius);
|
||||
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
if(entity instanceof EntityItem)
|
||||
{
|
||||
((EntityItem)entity).delayBeforeCanPickup = 0;
|
||||
entity.onCollideWithPlayer((EntityPlayer)player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
|
||||
public class MeleeOffensiveWind extends ExtrapolatedMeleeEntityEffect
|
||||
{
|
||||
public MeleeOffensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3+0.3f*potency);
|
||||
this.setRadius(2+0.3f*potency);
|
||||
this.setMaxNumberHit(potency+1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer player)
|
||||
{
|
||||
double wantedVel = 1.0d+1.0d*this.powerUpgrades;
|
||||
|
||||
if(entity instanceof EntityLiving)
|
||||
{
|
||||
double dist = Math.sqrt(entity.getDistanceToEntity(player));
|
||||
double xVel = wantedVel*(entity.posX - player.posX)/dist;
|
||||
double yVel = wantedVel*(entity.posY - player.posY+0.5f)/dist;
|
||||
double zVel = wantedVel*(entity.posZ - player.posZ)/dist;
|
||||
|
||||
entity.motionX = xVel;
|
||||
entity.motionY = yVel;
|
||||
entity.motionZ = zVel;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileDefaultWind extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefaultWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
float wantedYVel = (float)((0.5)*(0.5*this.potencyUpgrades + 1));
|
||||
|
||||
mop.motionX = proj.motionX;
|
||||
mop.motionY = mop.motionY += wantedYVel;
|
||||
mop.motionZ = proj.motionZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
|
||||
public class ProjectileEnvironmentalWind extends ProjectileUpdateEffect
|
||||
{
|
||||
public ProjectileEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateEffect(Entity projectile)
|
||||
{
|
||||
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
|
||||
|
||||
int horizRange = this.powerUpgrades+1;
|
||||
int vertRange = 1*this.potencyUpgrades+1;
|
||||
|
||||
World worldObj = projectile.worldObj;
|
||||
|
||||
if(projectile instanceof EntitySpellProjectile)
|
||||
{
|
||||
Entity shooter = ((EntitySpellProjectile) projectile).shootingEntity;
|
||||
if(shooter instanceof EntityPlayer)
|
||||
{
|
||||
List<Entity> entitylist = SpellHelper.getEntitiesInRange(worldObj, projectile.posX, projectile.posY, projectile.posZ, horizRange, vertRange);
|
||||
if(entitylist !=null)
|
||||
{
|
||||
for(Entity entity : entitylist)
|
||||
{
|
||||
if(entity instanceof EntityItem)
|
||||
{
|
||||
((EntityItem)entity).delayBeforeCanPickup = 0;
|
||||
entity.onCollideWithPlayer((EntityPlayer)shooter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
|
||||
public class ProjectileOffensiveWind extends ProjectileImpactEffect
|
||||
{
|
||||
|
||||
public ProjectileOffensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
if(mop instanceof EntityLiving)
|
||||
{
|
||||
((EntityLiving) mop).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id,(int)(100*(2*this.powerUpgrades+1)*(1/(this.potencyUpgrades+1))),this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefaultWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefaultWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.extinguish();
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfDefensiveWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
double radius = 1.5d*this.powerUpgrades+1.5d;
|
||||
double posX = player.posX;
|
||||
double posY = player.posY;
|
||||
double posZ = player.posZ;
|
||||
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius);
|
||||
|
||||
for(Entity entity: entities)
|
||||
{
|
||||
if((!entity.equals(player))&&entity instanceof EntityLiving)
|
||||
{
|
||||
((EntityLiving)entity).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id,200,this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfEnvironmentalWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
double radius = 1.5d*this.potencyUpgrades+1;
|
||||
double posX = player.posX;
|
||||
double posY = player.posY-0.7d;
|
||||
double posZ = player.posZ;
|
||||
double wantedVel = 0.7d+0.7d*this.powerUpgrades;
|
||||
|
||||
List<Entity> entities = SpellHelper.getEntitiesInRange(world, posX, posY, posZ, radius, radius);
|
||||
|
||||
for(Entity entity: entities)
|
||||
{
|
||||
if((!entity.equals(player))&&entity instanceof EntityLiving)
|
||||
{
|
||||
double dist = Math.sqrt(entity.getDistanceToEntity(player));
|
||||
double xVel = wantedVel*(entity.posX - posX)/dist;
|
||||
double yVel = wantedVel*(entity.posY - posY)/dist;
|
||||
double zVel = wantedVel*(entity.posZ - posZ)/dist;
|
||||
|
||||
entity.motionX = xVel;
|
||||
entity.motionY = yVel;
|
||||
entity.motionZ = zVel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
|
||||
public class SelfOffensiveWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfOffensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
Vec3 vec = player.getLookVec();
|
||||
double wantedVelocity = 1.5 + this.powerUpgrades*0.4;
|
||||
|
||||
SpellHelper.setPlayerSpeedFromServer(player, vec.xCoord * wantedVelocity, vec.yCoord * wantedVelocity, vec.zCoord * wantedVelocity);
|
||||
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Vec3;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
|
||||
public class ToolDefensiveWind extends LeftClickEffect
|
||||
{
|
||||
|
||||
public ToolDefensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
Vec3 vec = weilder.getLookVec();
|
||||
vec.yCoord = 0;
|
||||
vec.normalize();
|
||||
|
||||
float velocity = 0.5f*(1+this.powerUpgrades*0.8f);
|
||||
float ratio = 0.1f + 0.3f*this.potencyUpgrades;
|
||||
|
||||
attacked.motionX += vec.xCoord*velocity;
|
||||
attacked.motionY += velocity*ratio;
|
||||
attacked.motionZ += vec.zCoord*velocity;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect;
|
||||
|
||||
public class ToolEnvironmentalWind extends OnBreakBlockEffect
|
||||
{
|
||||
public ToolEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken)
|
||||
{
|
||||
double vertRange = 0.5 + (this.powerUpgrades*this.powerUpgrades + this.powerUpgrades)/2;
|
||||
double horizRange = vertRange;
|
||||
|
||||
List<EntityItem> itemList = SpellHelper.getItemsInRange(world, x + 0.5f, y + 0.5f, z + 0.5f, horizRange, vertRange);
|
||||
|
||||
for(EntityItem entity : itemList)
|
||||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
entity.delayBeforeCanPickup = 0;
|
||||
entity.onCollideWithPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
|
||||
public class ToolOffensiveWind extends LeftClickEffect
|
||||
{
|
||||
public ToolOffensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
attacked.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionHeavyHeart.id,(int)(100*(2*this.powerUpgrades+1)*(1/(this.potencyUpgrades+1))),this.potencyUpgrades));
|
||||
|
||||
return (int)(100*(0.5*this.potencyUpgrades+1)*(this.powerUpgrades+1)*Math.pow(0.85, costUpgrades));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue