Updating the finished tool paradigm

This commit is contained in:
WayofTime 2014-07-06 08:03:22 -04:00
parent cabc296b21
commit 084e3dd348
20 changed files with 181 additions and 26 deletions

View file

@ -48,6 +48,7 @@ public class SpellParadigmTool extends SpellParadigm
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;
@ -66,6 +67,8 @@ public class SpellParadigmTool extends SpellParadigm
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();
@ -73,12 +76,12 @@ public class SpellParadigmTool extends SpellParadigm
this.maxDamage = 5;
this.harvestLevel = new HashMap();
this.harvestLevel.put("pickaxe", 2);
this.harvestLevel.put("pickaxe", -1);
this.harvestLevel.put("shovel", -1);
this.harvestLevel.put("axe", -1);
this.digSpeed = new HashMap();
this.digSpeed.put("pickaxe", 6.0f);
this.digSpeed.put("pickaxe", 1.0f);
this.digSpeed.put("shovel", 1.0f);
this.digSpeed.put("axe", 1.0f);
@ -88,7 +91,9 @@ public class SpellParadigmTool extends SpellParadigm
this.fortuneLevel = 0;
this.silkTouch = false;
this.duration = 2400;
this.duration = 0;
this.durationHash.put("default", 2400);
//this.addRightClickEffect(new RightClickTunnel(0,0,0));
@ -178,6 +183,11 @@ public class SpellParadigmTool extends SpellParadigm
itemTool.setToolListString(toolStack, toolStringList);
for(Integer integ : this.durationHash.values())
{
this.duration += integ;
}
itemTool.setDuration(toolStack, world, this.duration);
itemTool.loadParadigmIntoStack(toolStack, this.bufferedEffectList);
@ -453,6 +463,11 @@ public class SpellParadigmTool extends SpellParadigm
this.critChanceHash.put(key, chance);
}
public void addDuration(String key, int dur)
{
this.durationHash.put(key, dur);
}
public float getCritChance()
{
float chance = 0.0f;

View file

@ -17,6 +17,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fi
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;
public class SpellEffectFire extends SpellEffect
@ -181,15 +182,21 @@ public class SpellEffectFire extends SpellEffect
}
@Override
public void defensiveModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
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));
}
@Override
public void environmentalModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
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
@ -201,18 +208,18 @@ public class SpellEffectFire extends SpellEffect
@Override
protected int getCostForOffenseTool()
{
return (int)(0); //TODO
return (int)(1000 * (1 + this.powerEnhancement*0.3f) * (1 + this.potencyEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForDefenseTool() {
// TODO Auto-generated method stub
return 0;
protected int getCostForDefenseTool()
{
return (int)(500 * (1 + this.powerEnhancement*0.5f) * (1 + this.potencyEnhancement) * Math.pow(0.85, costEnhancement));
}
@Override
protected int getCostForEnvironmentTool() {
// TODO Auto-generated method stub
protected int getCostForEnvironmentTool()
{
return 0;
}
}

View file

@ -0,0 +1,47 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import java.util.Random;
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;
public class ToolEnvironmentalFire extends OnBreakBlockEffect
{
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;
}
}