Refixing Tool paradigm and adding some more stuff to the Encampment

This commit is contained in:
WayofTime 2014-06-25 19:28:51 -04:00
parent cce90ce8fd
commit 6aec0a87ea
12 changed files with 387 additions and 54 deletions

View file

@ -17,6 +17,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ea
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;
public class SpellEffectEarth extends SpellEffect
{
@ -169,9 +170,11 @@ public class SpellEffectEarth extends SpellEffect
public void defaultModificationTool(SpellParadigmTool parad)
{
String toolClass = "pickaxe";
float digSpeed = 7.0f;
switch(this.powerEnhancement)
{
case 1:
@ -190,26 +193,31 @@ public class SpellEffectEarth extends SpellEffect
digSpeed = 27.0f;
break;
}
parad.setDigSpeed(toolClass, digSpeed);
int hlvl = this.potencyEnhancement + 2;
parad.setHarvestLevel(toolClass, hlvl);
}
@Override
public void offensiveModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
public void offensiveModificationTool(SpellParadigmTool parad)
{
parad.addItemManipulatorEffect(new ToolOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
}
@Override
public void defensiveModificationTool(SpellParadigmTool parad)
{
String toolClass = "shovel";
float digSpeed = 7.0f;
switch(this.powerEnhancement)
{
case 1:
@ -228,40 +236,49 @@ public class SpellEffectEarth extends SpellEffect
digSpeed = 27.0f;
break;
}
parad.setDigSpeed(toolClass, digSpeed);
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
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() {
protected int getCostForOffenseTool()
{
// TODO Auto-generated method stub
return 0;
}
@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() {
// TODO Auto-generated method stub
return 0;
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));
}
}

View file

@ -199,9 +199,9 @@ public class SpellEffectFire extends SpellEffect
}
@Override
protected int getCostForOffenseTool() {
// TODO Auto-generated method stub
return 0;
protected int getCostForOffenseTool()
{
return (int)(0); //TODO
}
@Override

View file

@ -16,6 +16,7 @@ import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ic
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;
public class SpellEffectIce extends SpellEffect
@ -168,54 +169,73 @@ public class SpellEffectIce extends SpellEffect
}
@Override
public void defaultModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
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.addCritChance("FrostCrit", this.potencyEnhancement * 0.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.addCritChance("SharpCrit", this.potencyEnhancement);
}
@Override
public void defensiveModificationTool(SpellParadigmTool parad)
{
parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
}
@Override
public void environmentalModificationTool(SpellParadigmTool parad) {
// TODO Auto-generated method stub
}
@Override
protected int getCostForDefaultTool() {
// TODO Auto-generated method stub
return 0;
public void environmentalModificationTool(SpellParadigmTool parad)
{
parad.addToolString("SilkTouch", "Silk Touch" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
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 getCostForOffenseTool()
{
return (int)(1000 * (1 + this.powerEnhancement*0.3f) * Math.pow(0.85, costEnhancement));
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;
}
@Override
protected int getCostForEnvironmentTool() {
// TODO Auto-generated method stub
return 0;
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));
}
}

View file

@ -0,0 +1,58 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth;
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 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();
for(ItemStack stack : itemList)
{
if(stack != null && stack.getItem() instanceof ItemBlock && !this.isMundaneBlock(((ItemBlock)stack.getItem()).field_150939_a))
{
newList.add(stack);
}
}
return newList;
}
public boolean isMundaneBlock(Block block)
{
for(Block test : mundaneList)
{
if(test.equals(block))
{
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,30 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice;
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);
}
@Override
public int onLeftClickEntity(ItemStack stack, EntityLivingBase attacked, EntityLivingBase weilder)
{
int duration = 200;
attacked.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id,duration,this.powerUpgrades));
return 0;
}
}