1.7.2 commit
This commit is contained in:
parent
92e097eaa2
commit
9aaa65feb4
548 changed files with 46982 additions and 2 deletions
|
@ -0,0 +1,221 @@
|
|||
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.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);
|
||||
}
|
||||
}
|
||||
|
||||
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 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 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,176 @@
|
|||
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;
|
||||
|
||||
public class SpellEffectEarth extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,178 @@
|
|||
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.effect.impactEffects.fire.ProjectileDefaultFire;
|
||||
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;
|
||||
|
||||
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)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
parad.damage+=this.potencyEnhancement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
parad.damage+=this.potencyEnhancement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
parad.addImpactEffect(new ProjectileDefaultFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
parad.damage+=this.potencyEnhancement;
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
return 10*(int)(10*Math.pow(1.5, this.powerEnhancement+1.5*this.potencyEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
return 500*(int)((this.powerEnhancement+1)*Math.pow(2, potencyEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
return (int) ((15*Math.pow(1.7, powerEnhancement)+10*Math.pow(potencyEnhancement,1.8))*Math.pow(0.8, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
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.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;
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
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;
|
||||
|
||||
public class SpellEffectWind extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
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<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 player.getDisplayName();
|
||||
}
|
||||
|
||||
public static void sendParticleToPlayer(EntityPlayer player, String str, double xCoord, double yCoord, double zCoord, double xVel, double yVel, double zVel)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -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))
|
||||
{
|
||||
hit++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean entityEffect(World world, Entity entity);
|
||||
|
||||
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);
|
||||
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,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,44 @@
|
|||
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.world.World;
|
||||
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)
|
||||
{
|
||||
mop.setFire((int)Math.pow(2,this.powerUpgrades));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
int x = mop.blockX;
|
||||
int y = mop.blockY;
|
||||
int z = mop.blockZ;
|
||||
int range = 0;
|
||||
for(int i=-range; i<=range;i++)
|
||||
{
|
||||
for(int j=-range; j<=range;j++)
|
||||
{
|
||||
for(int k=-range; k<=range; k++)
|
||||
{
|
||||
if(world.isAirBlock(x+i, y+j, z+k))
|
||||
{
|
||||
world.setBlock(x+i, y+j, z+k, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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,24 @@
|
|||
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.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)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
world.playAuxSFXAtEntity(player, 1008, (int)player.posX, (int)player.posY, (int)player.posZ, 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -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,(this.powerUpgrades+1)*this.powerUpgrades,this.potencyUpgrades));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
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)
|
||||
{
|
||||
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,38 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
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)
|
||||
{
|
||||
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,45 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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,50 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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,43 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import ibxm.Player;
|
||||
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.PacketHandler;
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue