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:
WayofTime 2014-01-18 22:16:39 -05:00
parent dc775435bf
commit 091bb3db3f
13 changed files with 131 additions and 18 deletions

View file

@ -7,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellModifierDefault;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire;
@ -55,6 +56,7 @@ public class ItemComplexSpellCrystal extends EnergyItems
SpellParadigm parad = new SpellParadigmSelf();
parad.addBufferedEffect(new SpellEffectFire());
parad.modifyBufferedEffect(new SpellModifierDefault());
parad.castSpell(par2World, par3EntityPlayer, par1ItemStack);
return par1ItemStack;

View file

@ -28,6 +28,8 @@ public class SpellParadigmSelf extends SpellParadigm
@Override
public void castSpell(World world, EntityPlayer entityPlayer, ItemStack itemStack)
{
this.applyAllSpellEffects();
for(ISelfSpellEffect eff : selfSpellEffectList)
{
eff.onSelfUse(world, entityPlayer);

View file

@ -12,6 +12,7 @@ public abstract class SpellEffect
protected int modifierState;
protected int powerEnhancement;
protected int costEnhancement;
protected int potencyEnhancement;
public SpellEffect()
{
@ -28,6 +29,7 @@ public abstract class SpellEffect
{
case SpellEnhancement.POWER: this.powerEnhancement++; 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);
}
if(parad instanceof SpellParadigmSelf)
{
this.modifySelfParadigm((SpellParadigmSelf)parad);
}
if(parad instanceof SpellParadigmMelee)
{
this.modifyMeleeParadigm((SpellParadigmMelee)parad);
}
}
public void modifyProjectileParadigm(SpellParadigmProjectile parad)

View file

@ -3,11 +3,10 @@ package WayofTime.alchemicalWizardry.common.spell.complex.effect;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmMelee;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigmSelf;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfDefaultFire;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire.SelfDefaultFire;
public class SpellEffectFire extends SpellEffect
{
@Override
public void defaultModificationProjectile(SpellParadigmProjectile parad)
{
@ -38,7 +37,7 @@ public class SpellEffectFire extends SpellEffect
@Override
public void defaultModificationSelf(SpellParadigmSelf parad)
{
parad.addSelfSpellEffect(new SelfDefaultFire());
parad.addSelfSpellEffect(new SelfDefaultFire(powerEnhancement, potencyEnhancement, costEnhancement));
}
@Override

View file

@ -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);
}
}

View file

@ -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;
}
}

View file

@ -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));
}
}

View file

@ -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
}
}

View file

@ -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);
}
}

View file

@ -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)
{
}
}

View file

@ -4,6 +4,7 @@ public class SpellEnhancement
{
public static final int POWER = 0;
public static final int EFFICIENCY = 1;
public static final int POTENCY = 2;
private int state = this.POWER;

View file

@ -0,0 +1,10 @@
package WayofTime.alchemicalWizardry.common.spell.complex.enhancement;
public class SpellEnhancementPotency extends SpellEnhancement
{
public SpellEnhancementPotency()
{
super(SpellEnhancement.POTENCY);
}
}

View file

@ -46,7 +46,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
this.output = new PositionedStack(recipe.getResult(), 76, 25);
this.lp = recipe.getAmountNeeded() * 100;
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));
orbs.add(new BloodOrbs(orb));
}
@ -89,7 +89,7 @@ public class NEIAlchemyRecipeHandler extends TemplateRecipeHandler {
}
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));
if(NEIServerUtils.areStacksSameTypeCrafting(orb, ingredient)) {
arecipes.add(new CachedAlchemyRecipe(recipe));