Fun testing stuff
Added some basic fire effect stuff to test how well the system works. So far so good!
This commit is contained in:
parent
dc775435bf
commit
091bb3db3f
|
@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifierDefault;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
|
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire;
|
||||||
|
@ -55,6 +56,7 @@ public class ItemComplexSpellCrystal extends EnergyItems
|
||||||
|
|
||||||
SpellParadigm parad = new SpellParadigmSelf();
|
SpellParadigm parad = new SpellParadigmSelf();
|
||||||
parad.addBufferedEffect(new SpellEffectFire());
|
parad.addBufferedEffect(new SpellEffectFire());
|
||||||
|
parad.modifyBufferedEffect(new SpellModifierDefault());
|
||||||
parad.castSpell(par2World, par3EntityPlayer, par1ItemStack);
|
parad.castSpell(par2World, par3EntityPlayer, par1ItemStack);
|
||||||
|
|
||||||
return par1ItemStack;
|
return par1ItemStack;
|
||||||
|
|
|
@ -28,6 +28,8 @@ public class SpellParadigmSelf extends SpellParadigm
|
||||||
@Override
|
@Override
|
||||||
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
|
||||||
{
|
{
|
||||||
|
this.applyAllSpellEffects();
|
||||||
|
|
||||||
for(ISelfSpellEffect eff : selfSpellEffectList)
|
for(ISelfSpellEffect eff : selfSpellEffectList)
|
||||||
{
|
{
|
||||||
eff.onSelfUse(world, entityPlayer);
|
eff.onSelfUse(world, entityPlayer);
|
||||||
|
|
|
@ -12,6 +12,7 @@ public abstract class SpellEffect
|
||||||
protected int modifierState;
|
protected int modifierState;
|
||||||
protected int powerEnhancement;
|
protected int powerEnhancement;
|
||||||
protected int costEnhancement;
|
protected int costEnhancement;
|
||||||
|
protected int potencyEnhancement;
|
||||||
|
|
||||||
public SpellEffect()
|
public SpellEffect()
|
||||||
{
|
{
|
||||||
|
@ -28,6 +29,7 @@ public abstract class SpellEffect
|
||||||
{
|
{
|
||||||
case SpellEnhancement.POWER: this.powerEnhancement++; break;
|
case SpellEnhancement.POWER: this.powerEnhancement++; break;
|
||||||
case SpellEnhancement.EFFICIENCY: this.costEnhancement++; break;
|
case SpellEnhancement.EFFICIENCY: this.costEnhancement++; break;
|
||||||
|
case SpellEnhancement.POTENCY: this.potencyEnhancement++; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,6 +46,14 @@ public abstract class SpellEffect
|
||||||
{
|
{
|
||||||
this.modifyProjectileParadigm((SpellParadigmProjectile)parad);
|
this.modifyProjectileParadigm((SpellParadigmProjectile)parad);
|
||||||
}
|
}
|
||||||
|
if(parad instanceof SpellParadigmSelf)
|
||||||
|
{
|
||||||
|
this.modifySelfParadigm((SpellParadigmSelf)parad);
|
||||||
|
}
|
||||||
|
if(parad instanceof SpellParadigmMelee)
|
||||||
|
{
|
||||||
|
this.modifyMeleeParadigm((SpellParadigmMelee)parad);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void modifyProjectileParadigm(SpellParadigmProjectile parad)
|
public void modifyProjectileParadigm(SpellParadigmProjectile parad)
|
||||||
|
|
|
@ -3,11 +3,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfDefaultFire;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefaultFire;
|
||||||
|
|
||||||
public class SpellEffectFire extends SpellEffect
|
public class SpellEffectFire extends SpellEffect
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
public void defaultModificationProjectile(SpellParadigmProjectile parad)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +37,7 @@ public class SpellEffectFire extends SpellEffect
|
||||||
@Override
|
@Override
|
||||||
public void defaultModificationSelf(SpellParadigmSelf parad)
|
public void defaultModificationSelf(SpellParadigmSelf parad)
|
||||||
{
|
{
|
||||||
parad.addSelfSpellEffect(new SelfDefaultFire());
|
parad.addSelfSpellEffect(new SelfDefaultFire(powerEnhancement, potencyEnhancement, costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class SelfDefaultFire implements ISelfSpellEffect
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onSelfUse(World world, EntityPlayer player)
|
|
||||||
{
|
|
||||||
player.setFire(500);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public abstract class SelfSpellEffect implements ISelfSpellEffect
|
||||||
|
{
|
||||||
|
protected int powerUpgrades;
|
||||||
|
protected int potencyUpgrades;
|
||||||
|
protected int costUpgrades;
|
||||||
|
|
||||||
|
public SelfSpellEffect(int power, int potency, int cost)
|
||||||
|
{
|
||||||
|
this.powerUpgrades = power;
|
||||||
|
this.potencyUpgrades = potency;
|
||||||
|
this.costUpgrades = cost;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ISelfSpellEffect;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.potion.Potion;
|
||||||
|
import net.minecraft.potion.PotionEffect;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class SelfDefaultFire extends SelfSpellEffect
|
||||||
|
{
|
||||||
|
public SelfDefaultFire(int power, int potency, int cost)
|
||||||
|
{
|
||||||
|
super(power, potency, cost);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelfUse(World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id,1000,0));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||||
|
|
||||||
|
public class SelfDefensiveFire extends SelfSpellEffect {
|
||||||
|
|
||||||
|
public SelfDefensiveFire(int power, int potency, int cost)
|
||||||
|
{
|
||||||
|
super(power, potency, cost);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelfUse(World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||||
|
|
||||||
|
public class SelfEnvironmentalFire extends SelfSpellEffect
|
||||||
|
{
|
||||||
|
public SelfEnvironmentalFire(int power, int potency, int cost)
|
||||||
|
{
|
||||||
|
super(power, potency, cost);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelfUse(World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
int posX = (int) Math.round(player.posX - 0.5f);
|
||||||
|
int posY = (int) player.posY;
|
||||||
|
int posZ = (int) Math.round(player.posZ - 0.5f);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
|
||||||
|
|
||||||
|
public class SelfOffensiveFire extends SelfSpellEffect
|
||||||
|
{
|
||||||
|
public SelfOffensiveFire(int power, int potency, int cost)
|
||||||
|
{
|
||||||
|
super(power, potency, cost);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSelfUse(World world, EntityPlayer player)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -4,6 +4,7 @@ public class SpellEnhancement
|
||||||
{
|
{
|
||||||
public static final int POWER = 0;
|
public static final int POWER = 0;
|
||||||
public static final int EFFICIENCY = 1;
|
public static final int EFFICIENCY = 1;
|
||||||
|
public static final int POTENCY = 2;
|
||||||
|
|
||||||
private int state = this.POWER;
|
private int state = this.POWER;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package WayofTime.alchemicalWizardry.common.spell.complex.enhancement;
|
||||||
|
|
||||||
|
public class SpellEnhancementPotency extends SpellEnhancement
|
||||||
|
{
|
||||||
|
public SpellEnhancementPotency()
|
||||||
|
{
|
||||||
|
super(SpellEnhancement.POTENCY);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -46,7 +46,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
|
||||||
this.output = new PositionedStack(recipe.getResult(), 76, 25);
|
this.output = new PositionedStack(recipe.getResult(), 76, 25);
|
||||||
this.lp = recipe.getAmountNeeded() * 100;
|
this.lp = recipe.getAmountNeeded() * 100;
|
||||||
this.orbs = new ArrayList<BloodOrbs>();
|
this.orbs = new ArrayList<BloodOrbs>();
|
||||||
for(int i = recipe.getOrbLevel(); i < bloodOrbs.size(); i++) {
|
for(int i = recipe.getOrbLevel(); i <= bloodOrbs.size(); i++) {
|
||||||
ItemStack orb = new ItemStack(bloodOrbs.get(i - 1));
|
ItemStack orb = new ItemStack(bloodOrbs.get(i - 1));
|
||||||
orbs.add(new BloodOrbs(orb));
|
orbs.add(new BloodOrbs(orb));
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<ItemStack> orbs = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> orbs = new ArrayList<ItemStack>();
|
||||||
for(int i = recipe.getOrbLevel(); i < bloodOrbs.size(); i++) {
|
for(int i = recipe.getOrbLevel(); i <= bloodOrbs.size(); i++) {
|
||||||
ItemStack orb = new ItemStack(bloodOrbs.get(i - 1));
|
ItemStack orb = new ItemStack(bloodOrbs.get(i - 1));
|
||||||
if(NEIServerUtils.areStacksSameTypeCrafting(orb, ingredient)) {
|
if(NEIServerUtils.areStacksSameTypeCrafting(orb, ingredient)) {
|
||||||
arecipes.add(new CachedAlchemyRecipe(recipe));
|
arecipes.add(new CachedAlchemyRecipe(recipe));
|
||||||
|
|
Loading…
Reference in a new issue