Anti-comments sweep!
This commit is contained in:
parent
e6a10f3f06
commit
dea1f87078
454 changed files with 23594 additions and 26739 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,21 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
public class SpellModifier
|
||||
public class SpellModifier
|
||||
{
|
||||
public static final int DEFAULT = 0;
|
||||
public static final int OFFENSIVE = 1;
|
||||
public static final int DEFENSIVE = 2;
|
||||
public static final int ENVIRONMENTAL = 3;
|
||||
|
||||
private int modifier;
|
||||
|
||||
protected SpellModifier(int modifier)
|
||||
{
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public int getModifier()
|
||||
{
|
||||
return this.modifier;
|
||||
}
|
||||
public static final int DEFAULT = 0;
|
||||
public static final int OFFENSIVE = 1;
|
||||
public static final int DEFENSIVE = 2;
|
||||
public static final int ENVIRONMENTAL = 3;
|
||||
|
||||
private int modifier;
|
||||
|
||||
protected SpellModifier(int modifier)
|
||||
{
|
||||
this.modifier = modifier;
|
||||
}
|
||||
|
||||
public int getModifier()
|
||||
{
|
||||
return this.modifier;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
public class SpellModifierDefault extends SpellModifier
|
||||
public class SpellModifierDefault extends SpellModifier
|
||||
{
|
||||
public SpellModifierDefault()
|
||||
{
|
||||
super(SpellModifier.DEFAULT);
|
||||
}
|
||||
public SpellModifierDefault()
|
||||
{
|
||||
super(SpellModifier.DEFAULT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
public class SpellModifierDefensive extends SpellModifier
|
||||
public class SpellModifierDefensive extends SpellModifier
|
||||
{
|
||||
public SpellModifierDefensive()
|
||||
{
|
||||
super(SpellModifier.DEFENSIVE);
|
||||
}
|
||||
public SpellModifierDefensive()
|
||||
{
|
||||
super(SpellModifier.DEFENSIVE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
public class SpellModifierEnvironmental extends SpellModifier
|
||||
public class SpellModifierEnvironmental extends SpellModifier
|
||||
{
|
||||
public SpellModifierEnvironmental()
|
||||
{
|
||||
super(SpellModifier.ENVIRONMENTAL);
|
||||
}
|
||||
public SpellModifierEnvironmental()
|
||||
{
|
||||
super(SpellModifier.ENVIRONMENTAL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
public class SpellModifierOffensive extends SpellModifier
|
||||
public class SpellModifierOffensive extends SpellModifier
|
||||
{
|
||||
public SpellModifierOffensive()
|
||||
{
|
||||
super(SpellModifier.OFFENSIVE);
|
||||
}
|
||||
public SpellModifierOffensive()
|
||||
{
|
||||
super(SpellModifier.OFFENSIVE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,163 +1,161 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
|
||||
public abstract class SpellParadigm
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class SpellParadigm
|
||||
{
|
||||
protected List<SpellEffect> bufferedEffectList = new LinkedList();
|
||||
public List<String> effectList = new LinkedList();
|
||||
|
||||
public void addBufferedEffect(SpellEffect effect)
|
||||
{
|
||||
if(effect!=null)
|
||||
{
|
||||
this.bufferedEffectList.add(effect);
|
||||
|
||||
effectList.add(effect.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void modifyBufferedEffect(SpellModifier modifier)
|
||||
{
|
||||
SpellEffect effect = this.getBufferedEffect();
|
||||
if(effect!=null)
|
||||
{
|
||||
effect.modifyEffect(modifier);
|
||||
|
||||
effectList.add(modifier.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void applyEnhancement(SpellEnhancement enh)
|
||||
{
|
||||
if(enh!=null)
|
||||
{
|
||||
if(bufferedEffectList.isEmpty())
|
||||
{
|
||||
this.enhanceParadigm(enh);
|
||||
}
|
||||
else
|
||||
{
|
||||
SpellEffect effect = this.getBufferedEffect();
|
||||
if(effect!=null)
|
||||
{
|
||||
effect.enhanceEffect(enh);
|
||||
}
|
||||
}
|
||||
|
||||
effectList.add(enh.getClass().getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public abstract void enhanceParadigm(SpellEnhancement enh);
|
||||
public abstract void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack);
|
||||
|
||||
public void applySpellEffect(SpellEffect effect)
|
||||
{
|
||||
effect.modifyParadigm(this);
|
||||
}
|
||||
|
||||
public void applyAllSpellEffects()
|
||||
{
|
||||
for(SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
this.applySpellEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
public SpellEffect getBufferedEffect()
|
||||
{
|
||||
if(bufferedEffectList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return bufferedEffectList.get(bufferedEffectList.size()-1);
|
||||
}
|
||||
}
|
||||
|
||||
public int getTotalCost()
|
||||
{
|
||||
int cost = 0;
|
||||
if(this.bufferedEffectList!=null && !this.bufferedEffectList.isEmpty())
|
||||
{
|
||||
if(this instanceof SpellParadigmProjectile)
|
||||
{
|
||||
for(SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost+=effect.getCostForProjectile();
|
||||
}
|
||||
}else if(this instanceof SpellParadigmSelf)
|
||||
{
|
||||
for(SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost+=effect.getCostForSelf();
|
||||
}
|
||||
}else if(this instanceof SpellParadigmMelee)
|
||||
{
|
||||
for(SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost+=effect.getCostForMelee();
|
||||
}
|
||||
}else if(this instanceof SpellParadigmTool)
|
||||
{
|
||||
for(SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost+=effect.getCostForTool();
|
||||
}
|
||||
}
|
||||
|
||||
return (int)(cost*Math.sqrt(this.bufferedEffectList.size()));
|
||||
}
|
||||
protected List<SpellEffect> bufferedEffectList = new LinkedList();
|
||||
public List<String> effectList = new LinkedList();
|
||||
|
||||
return getDefaultCost();
|
||||
}
|
||||
|
||||
public abstract int getDefaultCost();
|
||||
|
||||
public int getBufferedEffectPower()
|
||||
{
|
||||
SpellEffect eff = this.getBufferedEffect();
|
||||
|
||||
if(eff!=null)
|
||||
{
|
||||
return eff.getPowerEnhancements();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getBufferedEffectCost()
|
||||
{
|
||||
SpellEffect eff = this.getBufferedEffect();
|
||||
|
||||
if(eff!=null)
|
||||
{
|
||||
return eff.getCostEnhancements();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getBufferedEffectPotency()
|
||||
{
|
||||
SpellEffect eff = this.getBufferedEffect();
|
||||
|
||||
if(eff!=null)
|
||||
{
|
||||
return eff.getPotencyEnhancements();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
public void addBufferedEffect(SpellEffect effect)
|
||||
{
|
||||
if (effect != null)
|
||||
{
|
||||
this.bufferedEffectList.add(effect);
|
||||
|
||||
effectList.add(effect.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void modifyBufferedEffect(SpellModifier modifier)
|
||||
{
|
||||
SpellEffect effect = this.getBufferedEffect();
|
||||
if (effect != null)
|
||||
{
|
||||
effect.modifyEffect(modifier);
|
||||
|
||||
effectList.add(modifier.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void applyEnhancement(SpellEnhancement enh)
|
||||
{
|
||||
if (enh != null)
|
||||
{
|
||||
if (bufferedEffectList.isEmpty())
|
||||
{
|
||||
this.enhanceParadigm(enh);
|
||||
} else
|
||||
{
|
||||
SpellEffect effect = this.getBufferedEffect();
|
||||
if (effect != null)
|
||||
{
|
||||
effect.enhanceEffect(enh);
|
||||
}
|
||||
}
|
||||
|
||||
effectList.add(enh.getClass().getName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public abstract void enhanceParadigm(SpellEnhancement enh);
|
||||
|
||||
public abstract void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack);
|
||||
|
||||
public void applySpellEffect(SpellEffect effect)
|
||||
{
|
||||
effect.modifyParadigm(this);
|
||||
}
|
||||
|
||||
public void applyAllSpellEffects()
|
||||
{
|
||||
for (SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
this.applySpellEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
public SpellEffect getBufferedEffect()
|
||||
{
|
||||
if (bufferedEffectList.isEmpty())
|
||||
{
|
||||
return null;
|
||||
} else
|
||||
{
|
||||
return bufferedEffectList.get(bufferedEffectList.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
public int getTotalCost()
|
||||
{
|
||||
int cost = 0;
|
||||
if (this.bufferedEffectList != null && !this.bufferedEffectList.isEmpty())
|
||||
{
|
||||
if (this instanceof SpellParadigmProjectile)
|
||||
{
|
||||
for (SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost += effect.getCostForProjectile();
|
||||
}
|
||||
} else if (this instanceof SpellParadigmSelf)
|
||||
{
|
||||
for (SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost += effect.getCostForSelf();
|
||||
}
|
||||
} else if (this instanceof SpellParadigmMelee)
|
||||
{
|
||||
for (SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost += effect.getCostForMelee();
|
||||
}
|
||||
} else if (this instanceof SpellParadigmTool)
|
||||
{
|
||||
for (SpellEffect effect : bufferedEffectList)
|
||||
{
|
||||
cost += effect.getCostForTool();
|
||||
}
|
||||
}
|
||||
|
||||
return (int) (cost * Math.sqrt(this.bufferedEffectList.size()));
|
||||
}
|
||||
|
||||
return getDefaultCost();
|
||||
}
|
||||
|
||||
public abstract int getDefaultCost();
|
||||
|
||||
public int getBufferedEffectPower()
|
||||
{
|
||||
SpellEffect eff = this.getBufferedEffect();
|
||||
|
||||
if (eff != null)
|
||||
{
|
||||
return eff.getPowerEnhancements();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getBufferedEffectCost()
|
||||
{
|
||||
SpellEffect eff = this.getBufferedEffect();
|
||||
|
||||
if (eff != null)
|
||||
{
|
||||
return eff.getCostEnhancements();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int getBufferedEffectPotency()
|
||||
{
|
||||
SpellEffect eff = this.getBufferedEffect();
|
||||
|
||||
if (eff != null)
|
||||
{
|
||||
return eff.getPotencyEnhancements();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,70 +1,70 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IMeleeSpellEntityEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IMeleeSpellWorldEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SpellParadigmMelee extends SpellParadigm
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SpellParadigmMelee extends SpellParadigm
|
||||
{
|
||||
private List<IMeleeSpellEntityEffect> entityEffectList;
|
||||
private List<IMeleeSpellWorldEffect> worldEffectList;
|
||||
|
||||
public SpellParadigmMelee()
|
||||
{
|
||||
this.entityEffectList = new ArrayList();
|
||||
this.worldEffectList = new ArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
private List<IMeleeSpellEntityEffect> entityEffectList;
|
||||
private List<IMeleeSpellWorldEffect> worldEffectList;
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
for(IMeleeSpellEntityEffect effect : entityEffectList)
|
||||
{
|
||||
effect.onEntityImpact(world, entityPlayer);
|
||||
}
|
||||
|
||||
for(IMeleeSpellWorldEffect effect : worldEffectList)
|
||||
{
|
||||
effect.onWorldEffect(world, entityPlayer);
|
||||
}
|
||||
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(itemStack, entityPlayer, cost);
|
||||
}
|
||||
public SpellParadigmMelee()
|
||||
{
|
||||
this.entityEffectList = new ArrayList();
|
||||
this.worldEffectList = new ArrayList();
|
||||
}
|
||||
|
||||
public void addEntityEffect(IMeleeSpellEntityEffect eff)
|
||||
{
|
||||
if(eff!=null)
|
||||
{
|
||||
this.entityEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addWorldEffect(IMeleeSpellWorldEffect eff)
|
||||
{
|
||||
if(eff!=null)
|
||||
{
|
||||
this.worldEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
for (IMeleeSpellEntityEffect effect : entityEffectList)
|
||||
{
|
||||
effect.onEntityImpact(world, entityPlayer);
|
||||
}
|
||||
|
||||
for (IMeleeSpellWorldEffect effect : worldEffectList)
|
||||
{
|
||||
effect.onWorldEffect(world, entityPlayer);
|
||||
}
|
||||
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(itemStack, entityPlayer, cost);
|
||||
}
|
||||
|
||||
public void addEntityEffect(IMeleeSpellEntityEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.entityEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addWorldEffect(IMeleeSpellWorldEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.worldEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,102 +1,101 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ProjectileDefaultFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SpellParadigmProjectile extends SpellParadigm
|
||||
{
|
||||
public DamageSource damageSource;
|
||||
public float damage;
|
||||
public int cost;
|
||||
public List<IProjectileImpactEffect> impactList;
|
||||
public List<IProjectileUpdateEffect> updateEffectList;
|
||||
public boolean penetration;
|
||||
public int ricochetMax;
|
||||
public boolean isSilkTouch;
|
||||
|
||||
public SpellParadigmProjectile()
|
||||
{
|
||||
this.damageSource = DamageSource.generic;
|
||||
this.damage = 1;
|
||||
this.cost = 0;
|
||||
this.impactList = new ArrayList();
|
||||
this.updateEffectList = new ArrayList();
|
||||
this.penetration = false;
|
||||
this.ricochetMax = 0;
|
||||
this.isSilkTouch = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
public DamageSource damageSource;
|
||||
public float damage;
|
||||
public int cost;
|
||||
public List<IProjectileImpactEffect> impactList;
|
||||
public List<IProjectileUpdateEffect> updateEffectList;
|
||||
public boolean penetration;
|
||||
public int ricochetMax;
|
||||
public boolean isSilkTouch;
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer);
|
||||
this.prepareProjectile(proj);
|
||||
world.spawnEntityInWorld(proj);
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(itemStack, entityPlayer, cost);
|
||||
}
|
||||
|
||||
public static SpellParadigmProjectile getParadigmForEffectArray(List<SpellEffect> effectList)
|
||||
{
|
||||
SpellParadigmProjectile parad = new SpellParadigmProjectile();
|
||||
|
||||
for(SpellEffect eff : effectList)
|
||||
{
|
||||
parad.addBufferedEffect(eff);
|
||||
}
|
||||
|
||||
return parad;
|
||||
}
|
||||
|
||||
public void prepareProjectile(EntitySpellProjectile proj)
|
||||
{
|
||||
proj.setDamage(damage);
|
||||
proj.setImpactList(impactList);
|
||||
proj.setUpdateEffectList(updateEffectList);
|
||||
proj.setPenetration(penetration);
|
||||
proj.setRicochetMax(ricochetMax);
|
||||
proj.setIsSilkTouch(isSilkTouch);
|
||||
proj.setSpellEffectList(bufferedEffectList);
|
||||
}
|
||||
|
||||
public void addImpactEffect(IProjectileImpactEffect eff)
|
||||
{
|
||||
if(eff!=null)
|
||||
{
|
||||
this.impactList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addUpdateEffect(IProjectileUpdateEffect eff)
|
||||
{
|
||||
if(eff!=null)
|
||||
{
|
||||
this.updateEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
public SpellParadigmProjectile()
|
||||
{
|
||||
this.damageSource = DamageSource.generic;
|
||||
this.damage = 1;
|
||||
this.cost = 0;
|
||||
this.impactList = new ArrayList();
|
||||
this.updateEffectList = new ArrayList();
|
||||
this.penetration = false;
|
||||
this.ricochetMax = 0;
|
||||
this.isSilkTouch = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
EntitySpellProjectile proj = new EntitySpellProjectile(world, entityPlayer);
|
||||
this.prepareProjectile(proj);
|
||||
world.spawnEntityInWorld(proj);
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(itemStack, entityPlayer, cost);
|
||||
}
|
||||
|
||||
public static SpellParadigmProjectile getParadigmForEffectArray(List<SpellEffect> effectList)
|
||||
{
|
||||
SpellParadigmProjectile parad = new SpellParadigmProjectile();
|
||||
|
||||
for (SpellEffect eff : effectList)
|
||||
{
|
||||
parad.addBufferedEffect(eff);
|
||||
}
|
||||
|
||||
return parad;
|
||||
}
|
||||
|
||||
public void prepareProjectile(EntitySpellProjectile proj)
|
||||
{
|
||||
proj.setDamage(damage);
|
||||
proj.setImpactList(impactList);
|
||||
proj.setUpdateEffectList(updateEffectList);
|
||||
proj.setPenetration(penetration);
|
||||
proj.setRicochetMax(ricochetMax);
|
||||
proj.setIsSilkTouch(isSilkTouch);
|
||||
proj.setSpellEffectList(bufferedEffectList);
|
||||
}
|
||||
|
||||
public void addImpactEffect(IProjectileImpactEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.impactList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addUpdateEffect(IProjectileUpdateEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.updateEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 50;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,58 +1,57 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ISelfSpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SpellParadigmSelf extends SpellParadigm
|
||||
{
|
||||
public List<ISelfSpellEffect> selfSpellEffectList;
|
||||
|
||||
public SpellParadigmSelf()
|
||||
{
|
||||
selfSpellEffectList = new ArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
public List<ISelfSpellEffect> selfSpellEffectList;
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
this.applyAllSpellEffects();
|
||||
|
||||
for(ISelfSpellEffect eff : selfSpellEffectList)
|
||||
{
|
||||
eff.onSelfUse(world, entityPlayer);
|
||||
}
|
||||
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(itemStack, entityPlayer, cost);
|
||||
}
|
||||
public SpellParadigmSelf()
|
||||
{
|
||||
selfSpellEffectList = new ArrayList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
this.applyAllSpellEffects();
|
||||
|
||||
for (ISelfSpellEffect eff : selfSpellEffectList)
|
||||
{
|
||||
eff.onSelfUse(world, entityPlayer);
|
||||
}
|
||||
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(itemStack, entityPlayer, cost);
|
||||
}
|
||||
|
||||
public void addSelfSpellEffect(ISelfSpellEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.selfSpellEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public void addSelfSpellEffect(ISelfSpellEffect eff)
|
||||
{
|
||||
if(eff!=null)
|
||||
{
|
||||
this.selfSpellEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.*;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
|
@ -14,488 +15,470 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IDigAreaEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IItemManipulator;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ILeftClickEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IOnBanishTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IOnBreakBlock;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IOnSummonTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IRightClickEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ISpecialDamageEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.IToolUpdateEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.RightClickTunnel;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
|
||||
public class SpellParadigmTool extends SpellParadigm
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
public class SpellParadigmTool extends SpellParadigm
|
||||
{
|
||||
private List<ILeftClickEffect> leftClickEffectList;
|
||||
private List<IRightClickEffect> rightClickEffectList;
|
||||
private List<IToolUpdateEffect> toolUpdateEffectList;
|
||||
private List<IOnSummonTool> toolSummonEffectList;
|
||||
private List<IOnBanishTool> toolBanishEffectList;
|
||||
private List<IOnBreakBlock> breakBlockEffectList;
|
||||
private List<IItemManipulator> itemManipulatorEffectList;
|
||||
private List<IDigAreaEffect> digAreaEffectList;
|
||||
private List<ISpecialDamageEffect> specialDamageEffectList;
|
||||
|
||||
private float maxDamage;
|
||||
private HashMap<String,Integer> harvestLevel;
|
||||
private HashMap<String,Float> digSpeed;
|
||||
private HashMap<String,Float> maxDamageHash;
|
||||
private HashMap<String,Float> critChanceHash;
|
||||
private HashMap<String,Integer> durationHash; //ticks
|
||||
|
||||
private HashMap<String, String> toolInfoString;
|
||||
|
||||
private int fortuneLevel;
|
||||
private boolean silkTouch;
|
||||
|
||||
private int duration;
|
||||
|
||||
public SpellParadigmTool()
|
||||
{
|
||||
this.leftClickEffectList = new LinkedList();
|
||||
this.rightClickEffectList = new LinkedList();
|
||||
this.toolUpdateEffectList = new LinkedList();
|
||||
this.toolSummonEffectList = new LinkedList();
|
||||
this.toolBanishEffectList = new LinkedList();
|
||||
this.breakBlockEffectList = new LinkedList();
|
||||
this.itemManipulatorEffectList = new LinkedList();
|
||||
this.digAreaEffectList = new LinkedList();
|
||||
this.specialDamageEffectList = new LinkedList();
|
||||
this.durationHash = new HashMap();
|
||||
|
||||
this.toolInfoString = new HashMap();
|
||||
this.critChanceHash = new HashMap();
|
||||
|
||||
this.maxDamage = 5;
|
||||
|
||||
this.harvestLevel = new HashMap();
|
||||
this.harvestLevel.put("pickaxe", -1);
|
||||
this.harvestLevel.put("shovel", -1);
|
||||
this.harvestLevel.put("axe", -1);
|
||||
|
||||
this.digSpeed = new HashMap();
|
||||
this.digSpeed.put("pickaxe", 1.0f);
|
||||
this.digSpeed.put("shovel", 1.0f);
|
||||
this.digSpeed.put("axe", 1.0f);
|
||||
|
||||
this.maxDamageHash = new HashMap();
|
||||
this.maxDamageHash.put("default", 5.0f);
|
||||
|
||||
this.fortuneLevel = 0;
|
||||
this.silkTouch = false;
|
||||
|
||||
this.duration = 0;
|
||||
|
||||
this.durationHash.put("default", 2400);
|
||||
|
||||
//this.addRightClickEffect(new RightClickTunnel(0,0,0));
|
||||
|
||||
//this.addItemManipulatorEffect(new ToolDefaultFire(0,0,0));
|
||||
//this.addDigAreaEffect(new DigAreaEffect(0,0,0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
private List<ILeftClickEffect> leftClickEffectList;
|
||||
private List<IRightClickEffect> rightClickEffectList;
|
||||
private List<IToolUpdateEffect> toolUpdateEffectList;
|
||||
private List<IOnSummonTool> toolSummonEffectList;
|
||||
private List<IOnBanishTool> toolBanishEffectList;
|
||||
private List<IOnBreakBlock> breakBlockEffectList;
|
||||
private List<IItemManipulator> itemManipulatorEffectList;
|
||||
private List<IDigAreaEffect> digAreaEffectList;
|
||||
private List<ISpecialDamageEffect> specialDamageEffectList;
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack crystal)
|
||||
{
|
||||
if(entityPlayer.worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(crystal, entityPlayer, cost);
|
||||
|
||||
ItemStack toolStack = this.prepareTool(crystal, world);
|
||||
|
||||
entityPlayer.setCurrentItemOrArmor(0, toolStack);
|
||||
|
||||
this.onSummonTool(toolStack, world, entityPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param crystalStack
|
||||
* @return stack containing the new multitool
|
||||
*/
|
||||
public ItemStack prepareTool(ItemStack crystalStack, World world)
|
||||
{
|
||||
ItemStack toolStack = new ItemStack(ModItems.customTool,1);
|
||||
|
||||
ItemSpellMultiTool itemTool = (ItemSpellMultiTool) ModItems.customTool;
|
||||
|
||||
itemTool.setItemAttack(toolStack, this.composeMaxDamageFromHash());
|
||||
|
||||
Set<Entry<String,Integer>> harvestLevelSet = this.harvestLevel.entrySet();
|
||||
|
||||
for(Entry<String,Integer> testMap : harvestLevelSet)
|
||||
{
|
||||
String tool = testMap.getKey();
|
||||
int level = testMap.getValue();
|
||||
|
||||
itemTool.setHarvestLevel(toolStack, tool, level);
|
||||
}
|
||||
|
||||
Set<Entry<String,Float>> digSpeedSet = this.digSpeed.entrySet();
|
||||
|
||||
for(Entry<String,Float> testMap : digSpeedSet)
|
||||
{
|
||||
String tool = testMap.getKey();
|
||||
float speed = testMap.getValue();
|
||||
|
||||
itemTool.setDigSpeed(toolStack, tool, speed);
|
||||
}
|
||||
|
||||
itemTool.setFortuneLevel(toolStack, getFortuneLevel());
|
||||
itemTool.setSilkTouch(toolStack, this.getSilkTouch());
|
||||
|
||||
if(this.getSilkTouch())
|
||||
{
|
||||
this.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt(1));
|
||||
}
|
||||
|
||||
if(this.getFortuneLevel() > 0)
|
||||
{
|
||||
this.addToolString("Fortune", "Fortune" + " " + SpellHelper.getNumeralForInt(this.getFortuneLevel()));
|
||||
}
|
||||
|
||||
itemTool.setCritChance(toolStack, this.getCritChance()/100f);
|
||||
|
||||
List<String> toolStringList = new LinkedList();
|
||||
|
||||
for(String str : this.toolInfoString.values())
|
||||
{
|
||||
toolStringList.add(str);
|
||||
}
|
||||
|
||||
itemTool.setToolListString(toolStack, toolStringList);
|
||||
|
||||
for(Integer integ : this.durationHash.values())
|
||||
{
|
||||
this.duration += integ;
|
||||
}
|
||||
|
||||
itemTool.setDuration(toolStack, world, this.duration);
|
||||
itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList);
|
||||
|
||||
EnergyItems.checkAndSetItemOwner(toolStack, EnergyItems.getOwnerName(crystalStack));
|
||||
|
||||
itemTool.setContainedCrystal(toolStack, crystalStack);
|
||||
|
||||
return toolStack;
|
||||
}
|
||||
private float maxDamage;
|
||||
private HashMap<String, Integer> harvestLevel;
|
||||
private HashMap<String, Float> digSpeed;
|
||||
private HashMap<String, Float> maxDamageHash;
|
||||
private HashMap<String, Float> critChanceHash;
|
||||
private HashMap<String, Integer> durationHash;
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public static SpellParadigmTool getParadigmForEffectArray(List<SpellEffect> effectList)
|
||||
{
|
||||
SpellParadigmTool parad = new SpellParadigmTool();
|
||||
|
||||
for(SpellEffect eff : effectList)
|
||||
{
|
||||
parad.addBufferedEffect(eff);
|
||||
}
|
||||
|
||||
parad.applyAllSpellEffects();
|
||||
|
||||
return parad;
|
||||
}
|
||||
|
||||
public void addLeftClickEffect(ILeftClickEffect eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.leftClickEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addRightClickEffect(IRightClickEffect eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.rightClickEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addUpdateEffect(IToolUpdateEffect eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.toolUpdateEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToolSummonEffect(IOnSummonTool eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.toolSummonEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToolBanishEffect(IOnBanishTool eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.toolBanishEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addBlockBreakEffect(IOnBreakBlock eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.breakBlockEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addItemManipulatorEffect(IItemManipulator eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.itemManipulatorEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addDigAreaEffect(IDigAreaEffect eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.digAreaEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSpecialDamageEffect(ISpecialDamageEffect eff)
|
||||
{
|
||||
if(eff != null)
|
||||
{
|
||||
this.specialDamageEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
int total = 0;
|
||||
for(ILeftClickEffect effect : this.leftClickEffectList)
|
||||
{
|
||||
total += effect.onLeftClickEntity(stack, attacked, weilder);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onRightClickBlock(ItemStack toolStack, EntityLivingBase weilder, World world, MovingObjectPosition mop)
|
||||
{
|
||||
int total = 0;
|
||||
for(IRightClickEffect effect : this.rightClickEffectList)
|
||||
{
|
||||
total += effect.onRightClickBlock(toolStack, weilder, world, mop);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onRightClickAir(ItemStack toolStack, World world, EntityPlayer player)
|
||||
{
|
||||
int total = 0;
|
||||
for(IRightClickEffect effect : this.rightClickEffectList)
|
||||
{
|
||||
total += effect.onRightClickAir(toolStack, player);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand)
|
||||
{
|
||||
int total = 0;
|
||||
for(IToolUpdateEffect effect : this.toolUpdateEffectList)
|
||||
{
|
||||
total += effect.onUpdate(toolStack, world, par3Entity, invSlot, inHand);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onSummonTool(ItemStack toolStack, World world, Entity entity)
|
||||
{
|
||||
int total = 0;
|
||||
for(IOnSummonTool effect : this.toolSummonEffectList)
|
||||
{
|
||||
total += effect.onSummonTool(toolStack, world, entity);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand)
|
||||
{
|
||||
int total = 0;
|
||||
for(IOnBanishTool effect : this.toolBanishEffectList)
|
||||
{
|
||||
total += effect.onBanishTool(toolStack, world, entity, invSlot, inHand);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onBreakBlock(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken)
|
||||
{
|
||||
int total = 0;
|
||||
for(IOnBreakBlock effect : this.breakBlockEffectList)
|
||||
{
|
||||
total += effect.onBlockBroken(container, world, player, block, meta, x, y, z, sideBroken);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public List<ItemStack> handleItemList(ItemStack toolStack, List<ItemStack> items)
|
||||
{
|
||||
List<ItemStack> heldList = items;
|
||||
|
||||
for(IItemManipulator eff : this.itemManipulatorEffectList)
|
||||
{
|
||||
List<ItemStack> newHeldList = eff.handleItemsOnBlockBroken(toolStack, heldList);
|
||||
heldList = newHeldList;
|
||||
}
|
||||
|
||||
return heldList;
|
||||
}
|
||||
|
||||
public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool)
|
||||
{
|
||||
int cost = 0;
|
||||
|
||||
for(IDigAreaEffect effect : this.digAreaEffectList)
|
||||
{
|
||||
cost += effect.digSurroundingArea(container, world, player, blockPos, usedToolClass, blockHardness, harvestLvl, itemTool);
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
public int getFortuneLevel()
|
||||
{
|
||||
return this.fortuneLevel;
|
||||
}
|
||||
|
||||
public void setFortuneLevel(int fortuneLevel)
|
||||
{
|
||||
this.fortuneLevel = fortuneLevel;
|
||||
}
|
||||
|
||||
public boolean getSilkTouch()
|
||||
{
|
||||
return this.silkTouch;
|
||||
}
|
||||
|
||||
public void setSilkTouch(boolean silkTouch)
|
||||
{
|
||||
this.silkTouch = silkTouch;
|
||||
}
|
||||
|
||||
public int getDuration()
|
||||
{
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration)
|
||||
{
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public void setDigSpeed(String toolClass, float digSpeed)
|
||||
{
|
||||
this.digSpeed.put(toolClass, digSpeed);
|
||||
}
|
||||
|
||||
public void setHarvestLevel(String toolClass, int hlvl)
|
||||
{
|
||||
this.harvestLevel.put(toolClass, hlvl);
|
||||
}
|
||||
|
||||
public float composeMaxDamageFromHash()
|
||||
{
|
||||
float damage = 0.0f;
|
||||
|
||||
for(float f : this.maxDamageHash.values())
|
||||
{
|
||||
damage += f;
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void addDamageToHash(String key, float dmg)
|
||||
{
|
||||
this.maxDamageHash.put(key, dmg);
|
||||
}
|
||||
|
||||
public void addToolString(String key, String str)
|
||||
{
|
||||
if(str != null && key != null)
|
||||
{
|
||||
this.toolInfoString.put(key, str);
|
||||
}
|
||||
}
|
||||
|
||||
public void addCritChance(String key, float chance)
|
||||
{
|
||||
//Chance is in percentage chance i.e. chance = 1.0 means 1.0%
|
||||
this.critChanceHash.put(key, chance);
|
||||
}
|
||||
|
||||
public void addDuration(String key, int dur)
|
||||
{
|
||||
this.durationHash.put(key, dur);
|
||||
}
|
||||
|
||||
public float getCritChance()
|
||||
{
|
||||
float chance = 0.0f;
|
||||
|
||||
for(float fl : this.critChanceHash.values())
|
||||
{
|
||||
chance += fl;
|
||||
}
|
||||
|
||||
return chance;
|
||||
}
|
||||
|
||||
public float getAddedDamageForEntity(Entity entity)
|
||||
{
|
||||
HashMap<String, Float> hash = new HashMap();
|
||||
|
||||
for(ISpecialDamageEffect effect : this.specialDamageEffectList)
|
||||
{
|
||||
hash.put(effect.getKey(), effect.getDamageForEntity(entity));
|
||||
}
|
||||
|
||||
float addedDmg = 0.0f;
|
||||
|
||||
for(float fl : hash.values())
|
||||
{
|
||||
addedDmg += fl;
|
||||
}
|
||||
|
||||
return addedDmg;
|
||||
}
|
||||
private HashMap<String, String> toolInfoString;
|
||||
|
||||
private int fortuneLevel;
|
||||
private boolean silkTouch;
|
||||
|
||||
private int duration;
|
||||
|
||||
public SpellParadigmTool()
|
||||
{
|
||||
this.leftClickEffectList = new LinkedList();
|
||||
this.rightClickEffectList = new LinkedList();
|
||||
this.toolUpdateEffectList = new LinkedList();
|
||||
this.toolSummonEffectList = new LinkedList();
|
||||
this.toolBanishEffectList = new LinkedList();
|
||||
this.breakBlockEffectList = new LinkedList();
|
||||
this.itemManipulatorEffectList = new LinkedList();
|
||||
this.digAreaEffectList = new LinkedList();
|
||||
this.specialDamageEffectList = new LinkedList();
|
||||
this.durationHash = new HashMap();
|
||||
|
||||
this.toolInfoString = new HashMap();
|
||||
this.critChanceHash = new HashMap();
|
||||
|
||||
this.maxDamage = 5;
|
||||
|
||||
this.harvestLevel = new HashMap();
|
||||
this.harvestLevel.put("pickaxe", -1);
|
||||
this.harvestLevel.put("shovel", -1);
|
||||
this.harvestLevel.put("axe", -1);
|
||||
|
||||
this.digSpeed = new HashMap();
|
||||
this.digSpeed.put("pickaxe", 1.0f);
|
||||
this.digSpeed.put("shovel", 1.0f);
|
||||
this.digSpeed.put("axe", 1.0f);
|
||||
|
||||
this.maxDamageHash = new HashMap();
|
||||
this.maxDamageHash.put("default", 5.0f);
|
||||
|
||||
this.fortuneLevel = 0;
|
||||
this.silkTouch = false;
|
||||
this.duration = 0;
|
||||
this.durationHash.put("default", 2400);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack crystal)
|
||||
{
|
||||
if (entityPlayer.worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int cost = this.getTotalCost();
|
||||
|
||||
EnergyItems.syphonBatteries(crystal, entityPlayer, cost);
|
||||
|
||||
ItemStack toolStack = this.prepareTool(crystal, world);
|
||||
|
||||
entityPlayer.setCurrentItemOrArmor(0, toolStack);
|
||||
|
||||
this.onSummonTool(toolStack, world, entityPlayer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param crystalStack
|
||||
* @return stack containing the new multitool
|
||||
*/
|
||||
public ItemStack prepareTool(ItemStack crystalStack, World world)
|
||||
{
|
||||
ItemStack toolStack = new ItemStack(ModItems.customTool, 1);
|
||||
|
||||
ItemSpellMultiTool itemTool = (ItemSpellMultiTool) ModItems.customTool;
|
||||
|
||||
itemTool.setItemAttack(toolStack, this.composeMaxDamageFromHash());
|
||||
|
||||
Set<Entry<String, Integer>> harvestLevelSet = this.harvestLevel.entrySet();
|
||||
|
||||
for (Entry<String, Integer> testMap : harvestLevelSet)
|
||||
{
|
||||
String tool = testMap.getKey();
|
||||
int level = testMap.getValue();
|
||||
|
||||
itemTool.setHarvestLevel(toolStack, tool, level);
|
||||
}
|
||||
|
||||
Set<Entry<String, Float>> digSpeedSet = this.digSpeed.entrySet();
|
||||
|
||||
for (Entry<String, Float> testMap : digSpeedSet)
|
||||
{
|
||||
String tool = testMap.getKey();
|
||||
float speed = testMap.getValue();
|
||||
|
||||
itemTool.setDigSpeed(toolStack, tool, speed);
|
||||
}
|
||||
|
||||
itemTool.setFortuneLevel(toolStack, getFortuneLevel());
|
||||
itemTool.setSilkTouch(toolStack, this.getSilkTouch());
|
||||
|
||||
if (this.getSilkTouch())
|
||||
{
|
||||
this.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt(1));
|
||||
}
|
||||
|
||||
if (this.getFortuneLevel() > 0)
|
||||
{
|
||||
this.addToolString("Fortune", "Fortune" + " " + SpellHelper.getNumeralForInt(this.getFortuneLevel()));
|
||||
}
|
||||
|
||||
itemTool.setCritChance(toolStack, this.getCritChance() / 100f);
|
||||
|
||||
List<String> toolStringList = new LinkedList();
|
||||
|
||||
for (String str : this.toolInfoString.values())
|
||||
{
|
||||
toolStringList.add(str);
|
||||
}
|
||||
|
||||
itemTool.setToolListString(toolStack, toolStringList);
|
||||
|
||||
for (Integer integ : this.durationHash.values())
|
||||
{
|
||||
this.duration += integ;
|
||||
}
|
||||
|
||||
itemTool.setDuration(toolStack, world, this.duration);
|
||||
itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList);
|
||||
|
||||
EnergyItems.checkAndSetItemOwner(toolStack, EnergyItems.getOwnerName(crystalStack));
|
||||
|
||||
itemTool.setContainedCrystal(toolStack, crystalStack);
|
||||
|
||||
return toolStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultCost()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
public static SpellParadigmTool getParadigmForEffectArray(List<SpellEffect> effectList)
|
||||
{
|
||||
SpellParadigmTool parad = new SpellParadigmTool();
|
||||
|
||||
for (SpellEffect eff : effectList)
|
||||
{
|
||||
parad.addBufferedEffect(eff);
|
||||
}
|
||||
|
||||
parad.applyAllSpellEffects();
|
||||
|
||||
return parad;
|
||||
}
|
||||
|
||||
public void addLeftClickEffect(ILeftClickEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.leftClickEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addRightClickEffect(IRightClickEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.rightClickEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addUpdateEffect(IToolUpdateEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.toolUpdateEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToolSummonEffect(IOnSummonTool eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.toolSummonEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToolBanishEffect(IOnBanishTool eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.toolBanishEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addBlockBreakEffect(IOnBreakBlock eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.breakBlockEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addItemManipulatorEffect(IItemManipulator eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.itemManipulatorEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addDigAreaEffect(IDigAreaEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.digAreaEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public void addSpecialDamageEffect(ISpecialDamageEffect eff)
|
||||
{
|
||||
if (eff != null)
|
||||
{
|
||||
this.specialDamageEffectList.add(eff);
|
||||
}
|
||||
}
|
||||
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
int total = 0;
|
||||
for (ILeftClickEffect effect : this.leftClickEffectList)
|
||||
{
|
||||
total += effect.onLeftClickEntity(stack, attacked, weilder);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onRightClickBlock(ItemStack toolStack, EntityLivingBase weilder, World world, MovingObjectPosition mop)
|
||||
{
|
||||
int total = 0;
|
||||
for (IRightClickEffect effect : this.rightClickEffectList)
|
||||
{
|
||||
total += effect.onRightClickBlock(toolStack, weilder, world, mop);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onRightClickAir(ItemStack toolStack, World world, EntityPlayer player)
|
||||
{
|
||||
int total = 0;
|
||||
for (IRightClickEffect effect : this.rightClickEffectList)
|
||||
{
|
||||
total += effect.onRightClickAir(toolStack, player);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand)
|
||||
{
|
||||
int total = 0;
|
||||
for (IToolUpdateEffect effect : this.toolUpdateEffectList)
|
||||
{
|
||||
total += effect.onUpdate(toolStack, world, par3Entity, invSlot, inHand);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onSummonTool(ItemStack toolStack, World world, Entity entity)
|
||||
{
|
||||
int total = 0;
|
||||
for (IOnSummonTool effect : this.toolSummonEffectList)
|
||||
{
|
||||
total += effect.onSummonTool(toolStack, world, entity);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand)
|
||||
{
|
||||
int total = 0;
|
||||
for (IOnBanishTool effect : this.toolBanishEffectList)
|
||||
{
|
||||
total += effect.onBanishTool(toolStack, world, entity, invSlot, inHand);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public int onBreakBlock(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken)
|
||||
{
|
||||
int total = 0;
|
||||
for (IOnBreakBlock effect : this.breakBlockEffectList)
|
||||
{
|
||||
total += effect.onBlockBroken(container, world, player, block, meta, x, y, z, sideBroken);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
public List<ItemStack> handleItemList(ItemStack toolStack, List<ItemStack> items)
|
||||
{
|
||||
List<ItemStack> heldList = items;
|
||||
|
||||
for (IItemManipulator eff : this.itemManipulatorEffectList)
|
||||
{
|
||||
List<ItemStack> newHeldList = eff.handleItemsOnBlockBroken(toolStack, heldList);
|
||||
heldList = newHeldList;
|
||||
}
|
||||
|
||||
return heldList;
|
||||
}
|
||||
|
||||
public int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool)
|
||||
{
|
||||
int cost = 0;
|
||||
|
||||
for (IDigAreaEffect effect : this.digAreaEffectList)
|
||||
{
|
||||
cost += effect.digSurroundingArea(container, world, player, blockPos, usedToolClass, blockHardness, harvestLvl, itemTool);
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
public int getFortuneLevel()
|
||||
{
|
||||
return this.fortuneLevel;
|
||||
}
|
||||
|
||||
public void setFortuneLevel(int fortuneLevel)
|
||||
{
|
||||
this.fortuneLevel = fortuneLevel;
|
||||
}
|
||||
|
||||
public boolean getSilkTouch()
|
||||
{
|
||||
return this.silkTouch;
|
||||
}
|
||||
|
||||
public void setSilkTouch(boolean silkTouch)
|
||||
{
|
||||
this.silkTouch = silkTouch;
|
||||
}
|
||||
|
||||
public int getDuration()
|
||||
{
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration)
|
||||
{
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public void setDigSpeed(String toolClass, float digSpeed)
|
||||
{
|
||||
this.digSpeed.put(toolClass, digSpeed);
|
||||
}
|
||||
|
||||
public void setHarvestLevel(String toolClass, int hlvl)
|
||||
{
|
||||
this.harvestLevel.put(toolClass, hlvl);
|
||||
}
|
||||
|
||||
public float composeMaxDamageFromHash()
|
||||
{
|
||||
float damage = 0.0f;
|
||||
|
||||
for (float f : this.maxDamageHash.values())
|
||||
{
|
||||
damage += f;
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void addDamageToHash(String key, float dmg)
|
||||
{
|
||||
this.maxDamageHash.put(key, dmg);
|
||||
}
|
||||
|
||||
public void addToolString(String key, String str)
|
||||
{
|
||||
if (str != null && key != null)
|
||||
{
|
||||
this.toolInfoString.put(key, str);
|
||||
}
|
||||
}
|
||||
|
||||
public void addCritChance(String key, float chance)
|
||||
{
|
||||
//Chance is in percentage chance i.e. chance = 1.0 means 1.0%
|
||||
this.critChanceHash.put(key, chance);
|
||||
}
|
||||
|
||||
public void addDuration(String key, int dur)
|
||||
{
|
||||
this.durationHash.put(key, dur);
|
||||
}
|
||||
|
||||
public float getCritChance()
|
||||
{
|
||||
float chance = 0.0f;
|
||||
|
||||
for (float fl : this.critChanceHash.values())
|
||||
{
|
||||
chance += fl;
|
||||
}
|
||||
|
||||
return chance;
|
||||
}
|
||||
|
||||
public float getAddedDamageForEntity(Entity entity)
|
||||
{
|
||||
HashMap<String, Float> hash = new HashMap();
|
||||
|
||||
for (ISpecialDamageEffect effect : this.specialDamageEffectList)
|
||||
{
|
||||
hash.put(effect.getKey(), effect.getDamageForEntity(entity));
|
||||
}
|
||||
|
||||
float addedDmg = 0.0f;
|
||||
|
||||
for (float fl : hash.values())
|
||||
{
|
||||
addedDmg += fl;
|
||||
}
|
||||
|
||||
return addedDmg;
|
||||
}
|
||||
}
|
|
@ -1,217 +1,290 @@
|
|||
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.*;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.enhancement.SpellEnhancement;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public abstract class SpellEffect
|
||||
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()
|
||||
{
|
||||
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());
|
||||
|
@ -219,41 +292,43 @@ public abstract class SpellEffect
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,277 +4,264 @@ 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;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ToolOffensiveEarth;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.*;
|
||||
|
||||
public class SpellEffectEarth extends SpellEffect
|
||||
public class SpellEffectEarth extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefaultEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
@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 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 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 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 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 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 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 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 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 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 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
|
||||
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 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 getCostForOffenseProjectile()
|
||||
{
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
return (int)(3*Math.pow((this.powerEnhancement*2+1),2)*(this.potencyEnhancement*2+1)*Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
return (int) (10 * (1.5 * this.potencyEnhancement + 1) * (Math.pow(1 * this.powerEnhancement + 1, 2)) * 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 getCostForDefenseProjectile()
|
||||
{
|
||||
return (int) (3 * Math.pow((this.powerEnhancement * 2 + 1), 2) * (this.potencyEnhancement * 2 + 1) * 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 getCostForEnvironmentProjectile()
|
||||
{
|
||||
return (int) (10 * 2 * (0.1d * (this.potencyEnhancement + 1)) * Math.pow(3.47, this.potencyEnhancement) * 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 getCostForDefaultSelf()
|
||||
{
|
||||
return (int) (20 * Math.pow(1.5 * powerEnhancement + 1, 2) * (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 getCostForOffenseSelf()
|
||||
{
|
||||
return (int) (10 * Math.pow(2 * this.powerEnhancement + 1, 2) * (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 getCostForDefenseSelf()
|
||||
{
|
||||
return (int) (750 * (1.1 * this.powerEnhancement + 1) * (0.5 * this.potencyEnhancement + 1) * 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 getCostForEnvironmentSelf()
|
||||
{
|
||||
return (int) (250 * (1.2 * this.potencyEnhancement + 1) * (3 * this.powerEnhancement + 2.5) * 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 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 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 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 getCostForEnvironmentMelee()
|
||||
{
|
||||
return (int)(500*Math.pow(2*this.potencyEnhancement+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
|
||||
public void defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "pickaxe";
|
||||
@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;
|
||||
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;
|
||||
}
|
||||
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);
|
||||
parad.setDigSpeed(toolClass, digSpeed);
|
||||
|
||||
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addItemManipulatorEffect(new ToolOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addItemManipulatorEffect(new ToolOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "shovel";
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "shovel";
|
||||
|
||||
|
||||
float digSpeed = 7.0f;
|
||||
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;
|
||||
}
|
||||
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);
|
||||
parad.setDigSpeed(toolClass, digSpeed);
|
||||
|
||||
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
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
|
||||
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 getCostForDefaultTool()
|
||||
{
|
||||
return (int) (1000 * (1 + this.potencyEnhancement * 0.1f) * (1 + this.powerEnhancement * 0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@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 getCostForDefenseTool()
|
||||
{
|
||||
return (int) (1000 * (1 + this.potencyEnhancement * 0.1f) * (1 + this.powerEnhancement * 0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return (int)(10 * (1+this.potencyEnhancement*0.8) * Math.pow(1.5*this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement));
|
||||
}
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return (int) (10 * (1 + this.potencyEnhancement * 0.8) * Math.pow(1.5 * this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,222 +4,208 @@ 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.ToolEnvironmentalFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.ToolOffensiveFire;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.*;
|
||||
|
||||
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 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 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 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 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 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 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 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 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 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 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 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
|
||||
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 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 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 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 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 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 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 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 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 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 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 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
|
||||
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 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 offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolOffensiveFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addCritChance("defFire", this.potencyEnhancement);
|
||||
|
||||
parad.addDuration("defFire", 1200 * this.powerEnhancement);
|
||||
|
||||
parad.addToolString("defFire", "Unbreaking" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
parad.addToolString("offFire", "Fire Aspect" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addBlockBreakEffect(new ToolEnvironmentalFire(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
|
||||
parad.addToolString("envFire", "Magma Plume" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addCritChance("defFire", this.potencyEnhancement);
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
parad.addDuration("defFire", 1200 * this.powerEnhancement);
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
parad.addToolString("defFire", "Unbreaking" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int)(500 * (1 + this.powerEnhancement*0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addBlockBreakEffect(new ToolEnvironmentalFire(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
parad.addToolString("envFire", "Magma Plume" + " " + SpellHelper.getNumeralForInt(this.powerEnhancement + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return (int) (1000 * (1 + this.powerEnhancement * 0.3f) * (1 + this.potencyEnhancement * 0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int) (500 * (1 + this.powerEnhancement * 0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,238 +4,225 @@ 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.ToolDefaultIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefensiveIce;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.*;
|
||||
|
||||
public class SpellEffectIce extends SpellEffect
|
||||
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 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 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 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 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 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 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 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 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 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 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 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
|
||||
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 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 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 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 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 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 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 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 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 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 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 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
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
return (int) (20 * (0.5 * potencyEnhancement + 1) * (0 * powerEnhancement + 1) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolDefaultIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
@Override
|
||||
public void defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolDefaultIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
|
||||
|
||||
parad.addToolString("FrostTouch", "FrostTouch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
|
||||
parad.addToolString("FrostTouch", "FrostTouch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement + 1)));
|
||||
|
||||
|
||||
parad.addCritChance("FrostCrit", this.potencyEnhancement * 0.5f);
|
||||
}
|
||||
parad.addCritChance("FrostCrit", this.potencyEnhancement * 0.5f);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addDamageToHash("Sharpness", (this.powerEnhancement+1)*1.5f);
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addDamageToHash("Sharpness", (this.powerEnhancement + 1) * 1.5f);
|
||||
|
||||
|
||||
parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
|
||||
parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement + 1)));
|
||||
|
||||
|
||||
parad.addCritChance("SharpCrit", this.potencyEnhancement);
|
||||
}
|
||||
parad.addCritChance("SharpCrit", this.potencyEnhancement);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
@Override
|
||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement + 1)));
|
||||
|
||||
|
||||
parad.setSilkTouch(true);
|
||||
}
|
||||
parad.setSilkTouch(true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return (int)(500 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.1f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return (int) (500 * (1 + this.powerEnhancement * 0.3f) * (1 + this.potencyEnhancement * 0.1f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return (int) (1000 * (1 + this.powerEnhancement * 0.3f) * (1 + this.potencyEnhancement * 0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int)(500 * (1 + this.powerEnhancement*0.2) * (1 + this.potencyEnhancement*0.5) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int) (500 * (1 + this.powerEnhancement * 0.2) * (1 + this.potencyEnhancement * 0.5) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return (int)(1000 * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
@Override
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return (int) (1000 * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,239 +4,226 @@ 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;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind.*;
|
||||
|
||||
public class SpellEffectWind extends SpellEffect
|
||||
public class SpellEffectWind extends SpellEffect
|
||||
{
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
parad.addImpactEffect(new ProjectileDefaultWind(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||
}
|
||||
@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 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 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 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 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 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 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 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 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 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 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
|
||||
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 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 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 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 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 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 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 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 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 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 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 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
|
||||
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 defaultModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
String toolClass = "axe";
|
||||
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
float digSpeed = 7.0f;
|
||||
|
||||
@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));
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addBlockBreakEffect(new ToolEnvironmentalWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
parad.setDigSpeed(toolClass, digSpeed);
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultTool()
|
||||
{
|
||||
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
int hlvl = this.potencyEnhancement + 2;
|
||||
parad.setHarvestLevel(toolClass, hlvl);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseTool()
|
||||
{
|
||||
return 0; //Cost is on the attack method
|
||||
}
|
||||
@Override
|
||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||
{
|
||||
parad.addLeftClickEffect(new ToolOffensiveWind(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseTool()
|
||||
{
|
||||
return (int)(150 * (1+this.powerEnhancement*0.4f) * (1+this.potencyEnhancement*0.3f) * Math.pow(0.85, 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
|
||||
protected int getCostForEnvironmentTool()
|
||||
{
|
||||
return (int)(150 * (1+this.powerEnhancement) * Math.pow(0.85, costEnhancement));
|
||||
}
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -25,364 +26,361 @@ 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.alchemy.energy.IAlchemyGoggles;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
||||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
|
||||
public class SpellHelper
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class SpellHelper
|
||||
{
|
||||
public static Random rand = new Random();
|
||||
public static final double root2 = Math.sqrt(2);
|
||||
|
||||
public static boolean canEntityBeSeen(Entity entity, Entity entity2)
|
||||
{
|
||||
return entity.worldObj.rayTraceBlocks(Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ), Vec3.createVectorHelper(entity2.posX, entity2.posY, entity2.posZ), false) == null;
|
||||
}
|
||||
|
||||
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 boolean canPlayerSeeAlchemy(EntityPlayer player)
|
||||
{
|
||||
if(player != null)
|
||||
{
|
||||
ItemStack stack = player.getCurrentArmor(3);
|
||||
if(stack != null)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
if(item instanceof IAlchemyGoggles && ((IAlchemyGoggles)item).showIngameHUD(player.worldObj, stack, player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack heldStack = player.getHeldItem();
|
||||
if(heldStack != null && heldStack.getItem() instanceof IReagentManipulator)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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<EntityLivingBase> getLivingEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
return world.getEntitiesWithinAABB(EntityLivingBase.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);
|
||||
public static Random rand = new Random();
|
||||
public static final double root2 = Math.sqrt(2);
|
||||
|
||||
public static boolean canEntityBeSeen(Entity entity, Entity entity2)
|
||||
{
|
||||
return entity.worldObj.rayTraceBlocks(Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ), Vec3.createVectorHelper(entity2.posX, entity2.posY, entity2.posZ), false) == null;
|
||||
}
|
||||
|
||||
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 boolean canPlayerSeeAlchemy(EntityPlayer player)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
ItemStack stack = player.getCurrentArmor(3);
|
||||
if (stack != null)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof IAlchemyGoggles && ((IAlchemyGoggles) item).showIngameHUD(player.worldObj, stack, player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack heldStack = player.getHeldItem();
|
||||
if (heldStack != null && heldStack.getItem() instanceof IReagentManipulator)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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<EntityLivingBase> getLivingEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
return world.getEntitiesWithinAABB(EntityLivingBase.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 boolean 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);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getUsername(EntityPlayer player)
|
||||
{
|
||||
return SoulNetworkHandler.getUsername(player);
|
||||
}
|
||||
|
||||
public static EntityPlayer getPlayerForUsername(String str)
|
||||
{
|
||||
return SoulNetworkHandler.getPlayerForUsername(str);
|
||||
}
|
||||
|
||||
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)
|
||||
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 boolean 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);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getUsername(EntityPlayer player)
|
||||
{
|
||||
return SoulNetworkHandler.getUsername(player);
|
||||
}
|
||||
|
||||
public static EntityPlayer getPlayerForUsername(String str)
|
||||
{
|
||||
return SoulNetworkHandler.getPlayerForUsername(str);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
SpellHelper.sendParticleToPlayer(player,"reddust", xCoord + Math.random() - Math.random(), yCoord + Math.random() - Math.random(), zCoord + Math.random() - Math.random(), f1, f2, f3);
|
||||
String testStr = str.toLowerCase();
|
||||
|
||||
if (lowercaseOre.contains(testStr))
|
||||
{
|
||||
isAllowed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
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 (!isAllowed)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
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);
|
||||
String dustName = oreName.replace("ore", "dust");
|
||||
|
||||
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)
|
||||
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;
|
||||
|
@ -408,116 +406,127 @@ public class SpellHelper
|
|||
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 "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to determine if stack1 can be placed into stack2. If stack2 is null and stack1 isn't null, returns true. Ignores stack size
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
* @return True if they can be combined
|
||||
*/
|
||||
public static boolean canCombine(ItemStack stack1, ItemStack stack2)
|
||||
{
|
||||
if(stack1 == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(stack2 == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(stack1.isItemStackDamageable() ^ stack2.isItemStackDamageable())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean tagsEqual = ItemStack.areItemStackTagsEqual(stack1, stack2);
|
||||
|
||||
return stack1.getItem() == stack2.getItem() && tagsEqual && stack1.getItemDamage() == stack2.getItemDamage() && Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
* @return Stacks after stacking
|
||||
*/
|
||||
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2)
|
||||
{
|
||||
ItemStack[] returned = new ItemStack[2];
|
||||
|
||||
if(canCombine(stack1, stack2))
|
||||
{
|
||||
int transferedAmount = stack2 == null ? stack1.stackSize : Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize);
|
||||
if(transferedAmount > 0)
|
||||
{
|
||||
ItemStack copyStack = stack1.splitStack(transferedAmount);
|
||||
if(stack2 == null)
|
||||
{
|
||||
stack2 = copyStack;
|
||||
}else
|
||||
{
|
||||
stack2.stackSize+=transferedAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
returned[0] = stack1;
|
||||
returned[1] = stack2;
|
||||
|
||||
return returned;
|
||||
}
|
||||
|
||||
public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory)
|
||||
{
|
||||
if(stack == null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
for(int i=0; i<inventory.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack[] combinedStacks = combineStacks(stack, inventory.getStackInSlot(i));
|
||||
stack = combinedStacks[0];
|
||||
inventory.setInventorySlotContents(i, combinedStacks[1]);
|
||||
|
||||
if(stack.stackSize <= 0)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static boolean hydrateSoil(World world, int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if(block == Blocks.dirt || block == Blocks.grass || (block == Blocks.farmland && world.getBlockMetadata(x, y, z) == 0))
|
||||
{
|
||||
world.setBlock(x, y, z, Blocks.farmland, 15, 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
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 "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to determine if stack1 can be placed into stack2. If stack2 is null and stack1 isn't null, returns true. Ignores stack size
|
||||
*
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
* @return True if they can be combined
|
||||
*/
|
||||
public static boolean canCombine(ItemStack stack1, ItemStack stack2)
|
||||
{
|
||||
if (stack1 == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (stack2 == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (stack1.isItemStackDamageable() ^ stack2.isItemStackDamageable())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean tagsEqual = ItemStack.areItemStackTagsEqual(stack1, stack2);
|
||||
|
||||
return stack1.getItem() == stack2.getItem() && tagsEqual && stack1.getItemDamage() == stack2.getItemDamage() && Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param stack1 Stack that is placed into a slot
|
||||
* @param stack2 Slot content that stack1 is placed into
|
||||
* @return Stacks after stacking
|
||||
*/
|
||||
public static ItemStack[] combineStacks(ItemStack stack1, ItemStack stack2)
|
||||
{
|
||||
ItemStack[] returned = new ItemStack[2];
|
||||
|
||||
if (canCombine(stack1, stack2))
|
||||
{
|
||||
int transferedAmount = stack2 == null ? stack1.stackSize : Math.min(stack2.getMaxStackSize() - stack2.stackSize, stack1.stackSize);
|
||||
if (transferedAmount > 0)
|
||||
{
|
||||
ItemStack copyStack = stack1.splitStack(transferedAmount);
|
||||
if (stack2 == null)
|
||||
{
|
||||
stack2 = copyStack;
|
||||
} else
|
||||
{
|
||||
stack2.stackSize += transferedAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
returned[0] = stack1;
|
||||
returned[1] = stack2;
|
||||
|
||||
return returned;
|
||||
}
|
||||
|
||||
public static ItemStack insertStackIntoInventory(ItemStack stack, IInventory inventory)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++)
|
||||
{
|
||||
ItemStack[] combinedStacks = combineStacks(stack, inventory.getStackInSlot(i));
|
||||
stack = combinedStacks[0];
|
||||
inventory.setInventorySlotContents(i, combinedStacks[1]);
|
||||
|
||||
if (stack.stackSize <= 0)
|
||||
{
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static boolean hydrateSoil(World world, int x, int y, int z)
|
||||
{
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == Blocks.dirt || block == Blocks.grass || (block == Blocks.farmland && world.getBlockMetadata(x, y, z) == 0))
|
||||
{
|
||||
world.setBlock(x, y, z, Blocks.farmland, 15, 2);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,74 +1,73 @@
|
|||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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));
|
||||
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)
|
||||
|
||||
if (entities != null)
|
||||
{
|
||||
for(Entity entity : entities)
|
||||
for (Entity entity : entities)
|
||||
{
|
||||
if(hit<maxHit&&!entity.equals(entityPlayer))
|
||||
{
|
||||
if(this.entityEffect(world, entity, entityPlayer))
|
||||
{
|
||||
hit++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMeleeSpellEntityEffect
|
||||
public interface IMeleeSpellEntityEffect
|
||||
{
|
||||
public void onEntityImpact(World world, EntityPlayer entityPlayer);
|
||||
public void onEntityImpact(World world, EntityPlayer entityPlayer);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
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 interface IMeleeSpellWorldEffect
|
||||
{
|
||||
public void onWorldEffect(World world, EntityPlayer entityPlayer);
|
||||
public void onWorldEffect(World world, EntityPlayer entityPlayer);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,9 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IProjectileImpactEffect
|
||||
public interface IProjectileImpactEffect
|
||||
{
|
||||
public void onEntityImpact(Entity mop, Entity projectile);
|
||||
public void onTileImpact(World world, MovingObjectPosition mop);
|
||||
public void onEntityImpact(Entity mop, Entity projectile);
|
||||
|
||||
public void onTileImpact(World world, MovingObjectPosition mop);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
|||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface IProjectileUpdateEffect
|
||||
public interface IProjectileUpdateEffect
|
||||
{
|
||||
public void onUpdateEffect(Entity projectile);
|
||||
public void onUpdateEffect(Entity projectile);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface ISelfSpellEffect
|
||||
public interface ISelfSpellEffect
|
||||
{
|
||||
public void onSelfUse(World world, EntityPlayer player);
|
||||
public void onSelfUse(World world, EntityPlayer player);
|
||||
}
|
||||
|
|
|
@ -4,30 +4,30 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffect
|
||||
public abstract class MeleeSpellCenteredWorldEffect extends MeleeSpellWorldEffect
|
||||
{
|
||||
protected float range;
|
||||
|
||||
public MeleeSpellCenteredWorldEffect(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
protected float range;
|
||||
|
||||
@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 MeleeSpellCenteredWorldEffect(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
public void setRange(float range)
|
||||
{
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
public abstract void onCenteredWorldEffect(EntityPlayer player, World world, int posX, int posY, int posZ);
|
||||
@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);
|
||||
}
|
||||
|
|
|
@ -5,17 +5,17 @@ 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);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ 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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ 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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MeleeDefensiveEarth extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeDefensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power+2);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +1,47 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,32 @@
|
|||
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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MeleeOffensiveEarth extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +1,55 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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 class ProjectileDefaultEarth extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefaultEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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 onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,66 +1,58 @@
|
|||
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;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ProjectileDefensiveEarth extends ProjectileImpactEffect
|
||||
public class ProjectileDefensiveEarth extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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 onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,82 +1,78 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
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 class ProjectileEnvironmentalEarth extends ProjectileUpdateEffect
|
||||
{
|
||||
public ProjectileEnvironmentalEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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);
|
||||
|
||||
@Override
|
||||
public void onUpdateEffect(Entity projectile)
|
||||
{
|
||||
Vec3 posVec = SpellHelper.getEntityBlockVector(projectile);
|
||||
|
||||
blocksBroken++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
((EntitySpellProjectile) projectile).setBlocksBroken(blocksBroken);
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
blocksBroken++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
((EntitySpellProjectile) projectile).setBlocksBroken(blocksBroken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,92 +1,60 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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 class ProjectileOffensiveEarth extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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 onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
int horizRange = (int) (this.powerUpgrades);
|
||||
int vertDepth = (int) (3 * this.potencyUpgrades + 1);
|
||||
|
||||
@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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
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;
|
||||
}
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,52 +1,51 @@
|
|||
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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SelfDefaultEarth extends SelfSpellEffect
|
||||
{
|
||||
|
||||
public SelfDefaultEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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;
|
||||
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);
|
||||
}
|
||||
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));
|
||||
}
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SelfEnvironmentalEarth extends SelfSpellEffect
|
||||
{
|
||||
public SelfEnvironmentalEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,43 +1,43 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,86 +1,86 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.DigAreaEffect;
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,58 +1,57 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
|
||||
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ItemManipulator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ItemManipulator;
|
||||
|
||||
|
||||
public class ToolOffensiveEarth extends ItemManipulator
|
||||
{
|
||||
public static Block[] mundaneList = new Block[]{Blocks.stone,Blocks.cobblestone,Blocks.sand,Blocks.gravel,Blocks.netherrack,Blocks.dirt};
|
||||
public static Block[] mundaneList = new Block[]{Blocks.stone, Blocks.cobblestone, Blocks.sand, Blocks.gravel, Blocks.netherrack, Blocks.dirt};
|
||||
|
||||
|
||||
public ToolOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
public ToolOffensiveEarth(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList)
|
||||
{
|
||||
List<ItemStack> newList = new LinkedList();
|
||||
@Override
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList)
|
||||
{
|
||||
List<ItemStack> newList = new LinkedList();
|
||||
|
||||
|
||||
for(ItemStack stack : itemList)
|
||||
{
|
||||
if(stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock)stack.getItem()).field_150939_a))
|
||||
{
|
||||
newList.add(stack);
|
||||
}
|
||||
}
|
||||
for (ItemStack stack : itemList)
|
||||
{
|
||||
if (stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock) stack.getItem()).field_150939_a))
|
||||
{
|
||||
newList.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return newList;
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
|
||||
public boolean isMundaneBlock(Block block)
|
||||
{
|
||||
for(Block test : mundaneList)
|
||||
{
|
||||
if(test.equals(block))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public boolean isMundaneBlock(Block block)
|
||||
{
|
||||
for (Block test : mundaneList)
|
||||
{
|
||||
if (test.equals(block))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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 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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer entityPlayer)
|
||||
{
|
||||
if (entity instanceof EntityLiving)
|
||||
{
|
||||
entity.setFire(3 * this.powerUpgrades + 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MeleeEnvironmentalFire extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeEnvironmentalFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(3*power + 2);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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 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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,70 +1,70 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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);
|
||||
}
|
||||
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 onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
Vec3 blockVec = SpellHelper.getEntityBlockVector(mop);
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,47 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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);
|
||||
}
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,46 +1,44 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
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 class ProjectileEnvironmentalFire extends ProjectileUpdateEffect
|
||||
{
|
||||
public ProjectileEnvironmentalFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,81 +1,51 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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 class ProjectileOffensiveFire extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileOffensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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 onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
int horizRange = (int) (this.powerUpgrades);
|
||||
int vertDepth = (int) (3 * this.potencyUpgrades + 1);
|
||||
|
||||
@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);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
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);
|
||||
}
|
||||
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)));
|
||||
}
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.setFire((int) (10 * Math.pow(1.5, powerUpgrades + 1.5 * potencyUpgrades)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,43 +1,44 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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 class SelfDefensiveFire extends SelfSpellEffect
|
||||
{
|
||||
|
||||
public SelfDefensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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);
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
int horizRange = (int) (this.powerUpgrades);
|
||||
int vertDepth = (int) (3 * this.potencyUpgrades + 1);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,56 +1,56 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
@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++)
|
||||
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 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 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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 class SelfOffensiveFire extends SelfSpellEffect
|
||||
{
|
||||
public SelfOffensiveFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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));
|
||||
}
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id, 300 * (2 * this.powerUpgrades + 1), this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,38 +1,36 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.ItemManipulator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,47 +1,47 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.OnBreakBlockEffect;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class ToolEnvironmentalFire extends OnBreakBlockEffect
|
||||
{
|
||||
public ToolEnvironmentalFire(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
public ToolEnvironmentalFire(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)
|
||||
{
|
||||
int amount = 0;
|
||||
int cost = (int)(250 * (1 - 0.1f*powerUpgrades) * Math.pow(0.85, costUpgrades));
|
||||
int radius = this.powerUpgrades;
|
||||
float chance = 0.35f + 0.15f*this.potencyUpgrades;
|
||||
|
||||
for(int i=-radius; i<=radius; i++)
|
||||
{
|
||||
for(int j=-radius; j<=radius; j++)
|
||||
{
|
||||
for(int k=-radius; k<=radius; k++)
|
||||
{
|
||||
Block blockAffected = world.getBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ);
|
||||
|
||||
if((new Random().nextFloat() <= chance) && (blockAffected == Blocks.gravel || blockAffected == Blocks.stone || blockAffected == Blocks.cobblestone))
|
||||
{
|
||||
world.setBlock(x + i -sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava);
|
||||
amount += cost;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
@Override
|
||||
public int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken)
|
||||
{
|
||||
int amount = 0;
|
||||
int cost = (int) (250 * (1 - 0.1f * powerUpgrades) * Math.pow(0.85, costUpgrades));
|
||||
int radius = this.powerUpgrades;
|
||||
float chance = 0.35f + 0.15f * this.potencyUpgrades;
|
||||
|
||||
for (int i = -radius; i <= radius; i++)
|
||||
{
|
||||
for (int j = -radius; j <= radius; j++)
|
||||
{
|
||||
for (int k = -radius; k <= radius; k++)
|
||||
{
|
||||
Block blockAffected = world.getBlock(x + i - sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ);
|
||||
|
||||
if ((new Random().nextFloat() <= chance) && (blockAffected == Blocks.gravel || blockAffected == Blocks.stone || blockAffected == Blocks.cobblestone))
|
||||
{
|
||||
world.setBlock(x + i - sideBroken.offsetX, y + j, z + k - sideBroken.offsetZ, Blocks.lava);
|
||||
amount += cost;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
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);
|
||||
}
|
||||
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));
|
||||
}
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,29 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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 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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +1,48 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellWorldEffect;
|
||||
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 class MeleeDefensiveIce extends MeleeSpellWorldEffect
|
||||
{
|
||||
public MeleeDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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 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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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 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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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 class ProjectileDefaultIce extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
public ProjectileDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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 class ProjectileDefensiveIce extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
public ProjectileDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,39 +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;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class ProjectileEnvironmentalIce extends ProjectileUpdateEffect
|
||||
public class ProjectileEnvironmentalIce extends ProjectileUpdateEffect
|
||||
{
|
||||
|
||||
public ProjectileEnvironmentalIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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 class ProjectileOffensiveIce extends ProjectileImpactEffect
|
||||
{
|
||||
public ProjectileOffensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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 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;
|
||||
}
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,41 +1,39 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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 class SelfDefaultIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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 class SelfDefensiveIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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));
|
||||
}
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionIceCloak.id, 300 * (2 * this.powerUpgrades + 1), this.potencyUpgrades));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SelfOffensiveIce extends SelfSpellEffect
|
||||
{
|
||||
public SelfOffensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
|
||||
|
||||
public class ToolDefaultIce extends LeftClickEffect
|
||||
{
|
||||
public ToolDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
public ToolDefaultIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
int duration = 200;
|
||||
@Override
|
||||
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
|
||||
{
|
||||
int duration = 200;
|
||||
|
||||
|
||||
attacked.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,duration,this.powerUpgrades));
|
||||
attacked.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, duration, this.powerUpgrades));
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.SummonToolEffect;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
@ -11,52 +11,52 @@ 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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ToolDefensiveIce extends SummonToolEffect
|
||||
{
|
||||
public ToolDefensiveIce(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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);
|
||||
@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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,69 +1,69 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmTool;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
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;
|
||||
|
@ -76,9 +76,9 @@ public class DigAreaEffect implements IDigAreaEffect
|
|||
|
||||
String localToolClass = itemTool.getToolClassForMaterial(localBlock.getMaterial());
|
||||
|
||||
if(localToolClass != null && itemTool.getHarvestLevel(container, toolClass) >= localBlock.getHarvestLevel(localMeta))
|
||||
if (localToolClass != null && itemTool.getHarvestLevel(container, toolClass) >= localBlock.getHarvestLevel(localMeta))
|
||||
{
|
||||
isEffective = true;
|
||||
isEffective = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,32 +96,26 @@ public class DigAreaEffect implements IDigAreaEffect
|
|||
{
|
||||
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);
|
||||
|
||||
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)
|
||||
|
||||
if (!world.isRemote)
|
||||
{
|
||||
SpellHelper.spawnItemListInWorld(items, world, x + 0.5f, y + 0.5f, z + 0.5f);
|
||||
SpellHelper.spawnItemListInWorld(items, world, x + 0.5f, y + 0.5f, z + 0.5f);
|
||||
}
|
||||
|
||||
|
||||
world.func_147479_m(x, y, z);
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
// world.setBlockToAir(x, y, z);
|
||||
// world.func_147479_m(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.func_147479_m(x, y, z);
|
||||
|
@ -129,10 +123,10 @@ public class DigAreaEffect implements IDigAreaEffect
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public float getHardnessDifference()
|
||||
{
|
||||
return 1.5f;
|
||||
}
|
||||
}
|
||||
|
||||
public float getHardnessDifference()
|
||||
{
|
||||
return 1.5f;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,171 +1,171 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
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;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.spell.ItemSpellMultiTool;
|
||||
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 interface IDigAreaEffect
|
||||
{
|
||||
public abstract int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool);
|
||||
public abstract int digSurroundingArea(ItemStack container, World world, EntityPlayer player, MovingObjectPosition blockPos, String usedToolClass, float blockHardness, int harvestLvl, ItemSpellMultiTool itemTool);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IItemManipulator
|
||||
import java.util.List;
|
||||
|
||||
public interface IItemManipulator
|
||||
{
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList);
|
||||
public List<ItemStack> handleItemsOnBlockBroken(ItemStack toolStack, List<ItemStack> itemList);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
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 interface ILeftClickEffect
|
||||
{
|
||||
public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
public abstract int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IOnBanishTool
|
||||
public interface IOnBanishTool
|
||||
{
|
||||
public abstract int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand);
|
||||
public abstract int onBanishTool(ItemStack toolStack, World world, Entity entity, int invSlot, boolean inHand);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IOnBreakBlock
|
||||
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);
|
||||
public abstract int onBlockBroken(ItemStack container, World world, EntityPlayer player, Block block, int meta, int x, int y, int z, ForgeDirection sideBroken);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IOnSummonTool
|
||||
public interface IOnSummonTool
|
||||
{
|
||||
public abstract int onSummonTool(ItemStack toolStack, World world, Entity entity);
|
||||
public abstract int onSummonTool(ItemStack toolStack, World world, Entity entity);
|
||||
}
|
||||
|
|
|
@ -5,11 +5,11 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IRightClickEffect
|
||||
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);
|
||||
//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);
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.t
|
|||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public interface ISpecialDamageEffect
|
||||
public interface ISpecialDamageEffect
|
||||
{
|
||||
public float getDamageForEntity(Entity entity);
|
||||
|
||||
public String getKey();
|
||||
public float getDamageForEntity(Entity entity);
|
||||
|
||||
public String getKey();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IToolUpdateEffect
|
||||
public interface IToolUpdateEffect
|
||||
{
|
||||
public abstract int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand);
|
||||
public abstract int onUpdate(ItemStack toolStack, World world, Entity par3Entity, int invSlot, boolean inHand);
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -5,17 +5,17 @@ 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);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -1,21 +1,15 @@
|
|||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.t
|
|||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
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;
|
||||
|
@ -11,167 +7,171 @@ import net.minecraft.util.Vec3;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class RightClickTunnel extends RightClickEffect
|
||||
{
|
||||
Random rand = new Random();
|
||||
public RightClickTunnel(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
Random rand = new Random();
|
||||
|
||||
@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;
|
||||
}
|
||||
public RightClickTunnel(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
|
||||
@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();
|
||||
@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;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
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)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.t
|
|||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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);
|
||||
}
|
||||
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;
|
||||
@Override
|
||||
protected boolean entityEffect(World world, Entity entity, EntityPlayer player)
|
||||
{
|
||||
double wantedVel = 0.5d + 0.5d * this.powerUpgrades;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
if (entity instanceof EntityLiving)
|
||||
{
|
||||
entity.motionY = wantedVel;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.MeleeSpellCenteredWorldEffect;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MeleeEnvironmentalWind extends MeleeSpellCenteredWorldEffect
|
||||
{
|
||||
public MeleeEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
this.setRange(5*power + 5);
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ExtrapolatedMeleeEntityEffect;
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,30 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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);
|
||||
}
|
||||
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 onEntityImpact(Entity mop, Entity proj)
|
||||
{
|
||||
float wantedYVel = (float) ((0.5) * (0.5 * this.potencyUpgrades + 1));
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mop.motionX = proj.motionX;
|
||||
mop.motionY = mop.motionY += wantedYVel;
|
||||
mop.motionZ = proj.motionZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileUpdateEffect;
|
||||
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);
|
||||
}
|
||||
import java.util.List;
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ProjectileImpactEffect;
|
||||
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);
|
||||
}
|
||||
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 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;
|
||||
}
|
||||
@Override
|
||||
public void onTileImpact(World world, MovingObjectPosition mop)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,20 @@
|
|||
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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SelfDefaultWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefaultWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@Override
|
||||
public void onSelfUse(World world, EntityPlayer player)
|
||||
{
|
||||
player.extinguish();
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SelfDefensiveWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfDefensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,45 +1,45 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SelfEnvironmentalWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfEnvironmentalWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,26 @@
|
|||
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;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SelfOffensiveWind extends SelfSpellEffect
|
||||
{
|
||||
public SelfOffensiveWind(int power, int potency, int cost)
|
||||
{
|
||||
super(power, potency, cost);
|
||||
}
|
||||
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;
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.wind;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.tool.LeftClickEffect;
|
||||
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);
|
||||
}
|
||||
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;
|
||||
}
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue