Started work on Fire spell effects
This commit is contained in:
parent
e116b021c9
commit
0a023c6a0b
|
@ -5,6 +5,8 @@ import java.util.Iterator;
|
|||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileImpactEffect;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.IProjectileUpdateEffect;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMeleeSpellEntityEffect
|
||||
{
|
||||
public void onEntityImpact(World world, Entity entity);
|
||||
}
|
|
@ -6,6 +6,9 @@ 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;
|
||||
|
||||
public class SpellParadigmMelee extends SpellParadigm
|
||||
|
@ -22,15 +25,25 @@ public class SpellParadigmMelee extends SpellParadigm
|
|||
@Override
|
||||
public void enhanceParadigm(SpellEnhancement enh)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
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)
|
||||
|
|
|
@ -10,6 +10,8 @@ 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.enhancement.SpellEnhancement;
|
||||
|
||||
public class SpellParadigmProjectile extends SpellParadigm
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
|
||||
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;
|
||||
|
|
|
@ -0,0 +1,177 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||
|
||||
public class SpellEffectFire extends SpellEffect
|
||||
{
|
||||
|
||||
@Override
|
||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationProjectile(SpellParadigmProjectile parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationSelf(SpellParadigmSelf parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defaultModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void offensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void defensiveModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void environmentalModificationMelee(SpellParadigmMelee parad)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentProjectile()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentSelf()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefaultMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForOffenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForDefenseMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getCostForEnvironmentMelee()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class ExtrapolatedMeleeEntityEffect implements IMeleeSpellEntityEffect
|
||||
{
|
||||
protected float range;
|
||||
protected float radius;
|
||||
|
||||
public ExtrapolatedMeleeEntityEffect(int range, int radius)
|
||||
{
|
||||
this.range = range;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
@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));
|
||||
|
||||
if(entities!=null)
|
||||
{
|
||||
for(Entity entity : entities)
|
||||
{
|
||||
this.entityEffect(world, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void entityEffect(World world, Entity entity);
|
||||
|
||||
public void setRange(float range)
|
||||
{
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
public void setRadius(float radius)
|
||||
{
|
||||
this.radius = radius;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IMeleeSpellEntityEffect
|
||||
{
|
||||
public void onEntityImpact(World world, EntityPlayer entityPlayer);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.Vec3;
|
|
@ -1,4 +1,4 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
|
@ -1,4 +1,4 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package WayofTime.alchemicalWizardry.common.spell.complex;
|
||||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
Loading…
Reference in a new issue