Refixing Tool paradigm and adding some more stuff to the Encampment
This commit is contained in:
parent
cce90ce8fd
commit
6aec0a87ea
|
@ -13,6 +13,9 @@ public class BuildingSchematic
|
||||||
public String name;
|
public String name;
|
||||||
public int doorX;
|
public int doorX;
|
||||||
public int doorZ;
|
public int doorZ;
|
||||||
|
public int doorY;
|
||||||
|
public int buildingTier;
|
||||||
|
public int buildingType;
|
||||||
public List<BlockSet> blockList;
|
public List<BlockSet> blockList;
|
||||||
|
|
||||||
public BuildingSchematic()
|
public BuildingSchematic()
|
||||||
|
@ -26,6 +29,9 @@ public class BuildingSchematic
|
||||||
blockList = new ArrayList();
|
blockList = new ArrayList();
|
||||||
this.doorX = 0;
|
this.doorX = 0;
|
||||||
this.doorZ = 0;
|
this.doorZ = 0;
|
||||||
|
this.doorY = 0;
|
||||||
|
this.buildingTier = 0;
|
||||||
|
this.buildingType = DemonBuilding.BUILDING_HOUSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBlockWithMeta(Block block, int meta, int xOffset, int yOffset, int zOffset)
|
public void addBlockWithMeta(Block block, int meta, int xOffset, int yOffset, int zOffset)
|
||||||
|
@ -62,7 +68,7 @@ public class BuildingSchematic
|
||||||
{
|
{
|
||||||
int gridX = (int)((coords.xCoord+2*Math.signum(coords.xCoord))/5);
|
int gridX = (int)((coords.xCoord+2*Math.signum(coords.xCoord))/5);
|
||||||
int gridZ = (int)((coords.zCoord+2*Math.signum(coords.zCoord))/5);
|
int gridZ = (int)((coords.zCoord+2*Math.signum(coords.zCoord))/5);
|
||||||
|
|
||||||
holder.setGridSpace(gridX, gridZ, new GridSpace(GridSpace.HOUSE,0));
|
holder.setGridSpace(gridX, gridZ, new GridSpace(GridSpace.HOUSE,0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,6 +81,49 @@ public class BuildingSchematic
|
||||||
int gridX = (int)((doorX+2*Math.signum(doorX))/5);
|
int gridX = (int)((doorX+2*Math.signum(doorX))/5);
|
||||||
int gridZ = (int)((doorZ+2*Math.signum(doorZ))/5);
|
int gridZ = (int)((doorZ+2*Math.signum(doorZ))/5);
|
||||||
|
|
||||||
return new Int3(gridX, 0, gridZ);
|
return new Int3(gridX, doorY, gridZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||||
|
{
|
||||||
|
GridSpaceHolder grid = this.createGSH();
|
||||||
|
for(int i=this.getMinY(); i<=this.getMaxY(); i++)
|
||||||
|
{
|
||||||
|
grid.destroyAllInGridSpaces(world, xCoord, yCoord + i, zCoord, dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinY()
|
||||||
|
{
|
||||||
|
int min = 0;
|
||||||
|
for(BlockSet set : blockList)
|
||||||
|
{
|
||||||
|
for(Int3 pos : set.getPositions())
|
||||||
|
{
|
||||||
|
if(pos.yCoord < min)
|
||||||
|
{
|
||||||
|
min = pos.yCoord;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return min;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxY()
|
||||||
|
{
|
||||||
|
int max = 0;
|
||||||
|
for(BlockSet set : blockList)
|
||||||
|
{
|
||||||
|
for(Int3 pos : set.getPositions())
|
||||||
|
{
|
||||||
|
if(pos.yCoord > max)
|
||||||
|
{
|
||||||
|
max = pos.yCoord;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return max;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -6,17 +6,20 @@ import WayofTime.alchemicalWizardry.common.Int3;
|
||||||
|
|
||||||
public class DemonBuilding
|
public class DemonBuilding
|
||||||
{
|
{
|
||||||
|
public static final int BUILDING_HOUSE = 0;
|
||||||
|
public static final int BUILDING_PORTAL = 1;
|
||||||
|
|
||||||
public BuildingSchematic schematic;
|
public BuildingSchematic schematic;
|
||||||
public GridSpaceHolder area;
|
public GridSpaceHolder area;
|
||||||
public int buildingTier;
|
public int buildingTier;
|
||||||
public int type;
|
public int buildingType;
|
||||||
public Int3 doorGridSpace;
|
public Int3 doorGridSpace;
|
||||||
|
|
||||||
public DemonBuilding(BuildingSchematic schematic)
|
public DemonBuilding(BuildingSchematic schematic)
|
||||||
{
|
{
|
||||||
this.schematic = schematic;
|
this.schematic = schematic;
|
||||||
this.type = 0;
|
this.buildingType = schematic.buildingType;
|
||||||
this.buildingTier = 0;
|
this.buildingTier = schematic.buildingTier;
|
||||||
this.area = this.createGSHForSchematic(schematic);
|
this.area = this.createGSHForSchematic(schematic);
|
||||||
this.doorGridSpace = schematic.getGridSpotOfDoor();
|
this.doorGridSpace = schematic.getGridSpotOfDoor();
|
||||||
}
|
}
|
||||||
|
@ -43,6 +46,13 @@ public class DemonBuilding
|
||||||
|
|
||||||
public GridSpaceHolder createGSHForSchematic(BuildingSchematic scheme)
|
public GridSpaceHolder createGSHForSchematic(BuildingSchematic scheme)
|
||||||
{
|
{
|
||||||
|
switch(this.buildingType)
|
||||||
|
{
|
||||||
|
case DemonBuilding.BUILDING_HOUSE:
|
||||||
|
return scheme.createGSH();
|
||||||
|
case DemonBuilding.BUILDING_PORTAL:
|
||||||
|
|
||||||
|
}
|
||||||
return scheme.createGSH();
|
return scheme.createGSH();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +80,7 @@ public class DemonBuilding
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Int3(x, 0, z);
|
return new Int3(x, doorGridSpace.yCoord, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel)
|
public Int3 getGridOffsetFromRoad(ForgeDirection sideOfRoad, int yLevel)
|
||||||
|
@ -97,4 +107,9 @@ public class DemonBuilding
|
||||||
|
|
||||||
return new Int3(x, yLevel, z);
|
return new Int3(x, yLevel, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||||
|
{
|
||||||
|
schematic.destroyAllInField(world, xCoord, yCoord, zCoord, dir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package WayofTime.alchemicalWizardry.common.demonVillage;
|
package WayofTime.alchemicalWizardry.common.demonVillage;
|
||||||
|
|
||||||
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class GridSpaceHolder
|
public class GridSpaceHolder
|
||||||
|
@ -192,6 +195,7 @@ public class GridSpaceHolder
|
||||||
|
|
||||||
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
public void setAllGridSpaces(int xInit, int zInit, int yLevel, ForgeDirection dir, int type, GridSpaceHolder master)
|
||||||
{
|
{
|
||||||
|
System.out.println("Grid space selected: (" + xInit + "," + zInit + ")");
|
||||||
if(master != null)
|
if(master != null)
|
||||||
{
|
{
|
||||||
for(int i=-negXRadius; i<=posXRadius; i++)
|
for(int i=-negXRadius; i<=posXRadius; i++)
|
||||||
|
@ -227,9 +231,62 @@ public class GridSpaceHolder
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("Grid space (" + (xInit + xOff) + "," + (zInit + zOff) + ")");
|
||||||
|
|
||||||
master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel));
|
master.setGridSpace(xInit + xOff, zInit + zOff, new GridSpace(type, yLevel));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroyAllInGridSpaces(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
|
||||||
|
{
|
||||||
|
for(int i=-negXRadius; i<=posXRadius; i++)
|
||||||
|
{
|
||||||
|
for(int j=-negZRadius; j<=posZRadius; j++)
|
||||||
|
{
|
||||||
|
GridSpace thisSpace = this.getGridSpace(i, j);
|
||||||
|
if(thisSpace.isEmpty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int xOff = 0;
|
||||||
|
int zOff = 0;
|
||||||
|
|
||||||
|
switch(dir)
|
||||||
|
{
|
||||||
|
case SOUTH:
|
||||||
|
xOff = -i;
|
||||||
|
zOff = -j;
|
||||||
|
break;
|
||||||
|
case WEST:
|
||||||
|
xOff = j;
|
||||||
|
zOff = -i;
|
||||||
|
break;
|
||||||
|
case EAST:
|
||||||
|
xOff = -j;
|
||||||
|
zOff = i;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
xOff = i;
|
||||||
|
zOff = j;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int l = -2; l<=2; l++)
|
||||||
|
{
|
||||||
|
for(int m = -2; m<=2; m++)
|
||||||
|
{
|
||||||
|
Block block = world.getBlock(xCoord + xOff*5 + l, yCoord, zCoord + zOff*5 + m);
|
||||||
|
if(block == ModBlocks.blockDemonPortal)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
world.setBlockToAir(xCoord + xOff*5 + l, yCoord, zCoord + zOff*5 + m);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,6 +101,7 @@ public class TESpellParadigmBlockItemRenderer implements IItemRenderer
|
||||||
case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||||
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
|
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
|
||||||
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
|
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
|
||||||
|
case 3: return "alchemicalwizardry:textures/models/SpellParadigmTool.png";
|
||||||
}
|
}
|
||||||
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.SelfEnvironmentalEarth;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.SelfOffensiveEarth;
|
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.ToolEnvironmentalEarth;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.earth.ToolOffensiveEarth;
|
||||||
|
|
||||||
public class SpellEffectEarth extends SpellEffect
|
public class SpellEffectEarth extends SpellEffect
|
||||||
{
|
{
|
||||||
|
@ -169,9 +170,11 @@ public class SpellEffectEarth extends SpellEffect
|
||||||
public void defaultModificationTool(SpellParadigmTool parad)
|
public void defaultModificationTool(SpellParadigmTool parad)
|
||||||
{
|
{
|
||||||
String toolClass = "pickaxe";
|
String toolClass = "pickaxe";
|
||||||
|
|
||||||
|
|
||||||
float digSpeed = 7.0f;
|
float digSpeed = 7.0f;
|
||||||
|
|
||||||
|
|
||||||
switch(this.powerEnhancement)
|
switch(this.powerEnhancement)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -190,26 +193,31 @@ public class SpellEffectEarth extends SpellEffect
|
||||||
digSpeed = 27.0f;
|
digSpeed = 27.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
parad.setDigSpeed(toolClass, digSpeed);
|
parad.setDigSpeed(toolClass, digSpeed);
|
||||||
|
|
||||||
|
|
||||||
int hlvl = this.potencyEnhancement + 2;
|
int hlvl = this.potencyEnhancement + 2;
|
||||||
parad.setHarvestLevel(toolClass, hlvl);
|
parad.setHarvestLevel(toolClass, hlvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void offensiveModificationTool(SpellParadigmTool parad) {
|
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||||
// TODO Auto-generated method stub
|
{
|
||||||
|
parad.addItemManipulatorEffect(new ToolOffensiveEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||||
{
|
{
|
||||||
String toolClass = "shovel";
|
String toolClass = "shovel";
|
||||||
|
|
||||||
|
|
||||||
float digSpeed = 7.0f;
|
float digSpeed = 7.0f;
|
||||||
|
|
||||||
|
|
||||||
switch(this.powerEnhancement)
|
switch(this.powerEnhancement)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -228,40 +236,49 @@ public class SpellEffectEarth extends SpellEffect
|
||||||
digSpeed = 27.0f;
|
digSpeed = 27.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
parad.setDigSpeed(toolClass, digSpeed);
|
parad.setDigSpeed(toolClass, digSpeed);
|
||||||
|
|
||||||
|
|
||||||
int hlvl = this.potencyEnhancement + 2;
|
int hlvl = this.potencyEnhancement + 2;
|
||||||
parad.setHarvestLevel(toolClass, hlvl);
|
parad.setHarvestLevel(toolClass, hlvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void environmentalModificationTool(SpellParadigmTool parad)
|
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||||
{
|
{
|
||||||
parad.addDigAreaEffect(new ToolEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
parad.addDigAreaEffect(new ToolEnvironmentalEarth(this.powerEnhancement, this.potencyEnhancement, this.costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getCostForDefaultTool()
|
protected int getCostForDefaultTool()
|
||||||
{
|
{
|
||||||
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getCostForOffenseTool() {
|
protected int getCostForOffenseTool()
|
||||||
|
{
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getCostForDefenseTool()
|
protected int getCostForDefenseTool()
|
||||||
{
|
{
|
||||||
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
return (int)(1000 * (1 + this.potencyEnhancement*0.1f) * (1 + this.powerEnhancement*0.2f) * Math.pow(0.85, costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getCostForEnvironmentTool() {
|
protected int getCostForEnvironmentTool()
|
||||||
// TODO Auto-generated method stub
|
{
|
||||||
return 0;
|
return (int)(10 * (1+this.potencyEnhancement*0.8) * Math.pow(1.5*this.powerEnhancement + 3, 2) * Math.pow(0.85, this.costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,9 +199,9 @@ public class SpellEffectFire extends SpellEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getCostForOffenseTool() {
|
protected int getCostForOffenseTool()
|
||||||
// TODO Auto-generated method stub
|
{
|
||||||
return 0;
|
return (int)(0); //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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.SelfDefensiveIce;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.SelfEnvironmentalIce;
|
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.SelfOffensiveIce;
|
||||||
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefaultIce;
|
||||||
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefensiveIce;
|
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.ice.ToolDefensiveIce;
|
||||||
|
|
||||||
public class SpellEffectIce extends SpellEffect
|
public class SpellEffectIce extends SpellEffect
|
||||||
|
@ -168,54 +169,73 @@ public class SpellEffectIce extends SpellEffect
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void defaultModificationTool(SpellParadigmTool parad) {
|
public void defaultModificationTool(SpellParadigmTool parad)
|
||||||
// TODO Auto-generated method stub
|
{
|
||||||
|
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
|
@Override
|
||||||
public void offensiveModificationTool(SpellParadigmTool parad)
|
public void offensiveModificationTool(SpellParadigmTool parad)
|
||||||
{
|
{
|
||||||
parad.addDamageToHash("Sharpness", (this.powerEnhancement+1)*1.5f);
|
parad.addDamageToHash("Sharpness", (this.powerEnhancement+1)*1.5f);
|
||||||
|
|
||||||
|
|
||||||
parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
|
parad.addToolString("Sharpness", "Sharpness" + " " + SpellHelper.getNumeralForInt((this.powerEnhancement+1)));
|
||||||
|
|
||||||
|
|
||||||
parad.addCritChance("SharpCrit", this.potencyEnhancement);
|
parad.addCritChance("SharpCrit", this.potencyEnhancement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void defensiveModificationTool(SpellParadigmTool parad)
|
public void defensiveModificationTool(SpellParadigmTool parad)
|
||||||
{
|
{
|
||||||
parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
parad.addToolSummonEffect(new ToolDefensiveIce(this.powerEnhancement,this.potencyEnhancement,this.costEnhancement));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void environmentalModificationTool(SpellParadigmTool parad) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getCostForDefaultTool() {
|
public void environmentalModificationTool(SpellParadigmTool parad)
|
||||||
// TODO Auto-generated method stub
|
{
|
||||||
return 0;
|
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
|
@Override
|
||||||
protected int getCostForOffenseTool()
|
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
|
@Override
|
||||||
protected int getCostForEnvironmentTool() {
|
protected int getCostForDefenseTool()
|
||||||
// TODO Auto-generated method stub
|
{
|
||||||
return 0;
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,6 +23,7 @@ import net.minecraftforge.common.util.Constants;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
import WayofTime.alchemicalWizardry.common.Int3;
|
import WayofTime.alchemicalWizardry.common.Int3;
|
||||||
|
import WayofTime.alchemicalWizardry.common.block.BlockTeleposer;
|
||||||
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
|
import WayofTime.alchemicalWizardry.common.demonVillage.BuildingSchematic;
|
||||||
import WayofTime.alchemicalWizardry.common.demonVillage.DemonBuilding;
|
import WayofTime.alchemicalWizardry.common.demonVillage.DemonBuilding;
|
||||||
import WayofTime.alchemicalWizardry.common.demonVillage.DemonCrosspath;
|
import WayofTime.alchemicalWizardry.common.demonVillage.DemonCrosspath;
|
||||||
|
@ -720,7 +721,6 @@ public class TEDemonPortal extends TileEntity
|
||||||
|
|
||||||
public void rightClickBlock(EntityPlayer player, int side)
|
public void rightClickBlock(EntityPlayer player, int side)
|
||||||
{
|
{
|
||||||
//this.testGson();
|
|
||||||
if(worldObj.isRemote)
|
if(worldObj.isRemote)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -731,14 +731,97 @@ public class TEDemonPortal extends TileEntity
|
||||||
|
|
||||||
if(ForgeDirection.getOrientation(side) == ForgeDirection.UP)
|
if(ForgeDirection.getOrientation(side) == ForgeDirection.UP)
|
||||||
{
|
{
|
||||||
this.createRandomBuilding();
|
this.createRandomBuilding(DemonBuilding.BUILDING_HOUSE, 0);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
this.createRandomRoad();
|
this.createRandomRoad();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createRandomBuilding()
|
public void createRandomBuilding(int type, int tier)
|
||||||
|
{
|
||||||
|
switch(type)
|
||||||
|
{
|
||||||
|
case DemonBuilding.BUILDING_HOUSE:
|
||||||
|
this.createRandomHouse(tier);
|
||||||
|
break;
|
||||||
|
case DemonBuilding.BUILDING_PORTAL:
|
||||||
|
this.createPortalBuilding(tier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createPortalBuilding(int buildingTier)
|
||||||
|
{
|
||||||
|
int x = 0;
|
||||||
|
int z = 0;
|
||||||
|
|
||||||
|
GridSpace home = this.getGridSpace(x, z);
|
||||||
|
int yLevel = home.getYLevel();
|
||||||
|
|
||||||
|
GridSpaceHolder grid = this.createGSH();
|
||||||
|
|
||||||
|
List<ForgeDirection> directions = new ArrayList();
|
||||||
|
|
||||||
|
for(int i=2; i<6; i++)
|
||||||
|
{
|
||||||
|
ForgeDirection testDir = ForgeDirection.getOrientation(i);
|
||||||
|
if(this.getGridSpace(x + testDir.offsetX, z + testDir.offsetZ).isEmpty())
|
||||||
|
{
|
||||||
|
directions.add(testDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(directions.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<ForgeDirection, List<DemonBuilding>> schemMap = new HashMap();
|
||||||
|
|
||||||
|
for(ForgeDirection nextDir : directions)
|
||||||
|
{
|
||||||
|
for(DemonBuilding build : TEDemonPortal.buildingList)
|
||||||
|
{
|
||||||
|
if(schemMap.containsKey(nextDir))
|
||||||
|
{
|
||||||
|
schemMap.get(nextDir).add(build);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
schemMap.put(nextDir, new ArrayList());
|
||||||
|
schemMap.get(nextDir).add(build);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(schemMap.keySet().isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())];
|
||||||
|
DemonBuilding build = schemMap.get(chosenDirection).get(new Random().nextInt(schemMap.get(chosenDirection).size()));
|
||||||
|
|
||||||
|
build.destroyAllInField(worldObj, xCoord + (x)*5, yLevel, zCoord + (z)*5, chosenDirection.getOpposite());
|
||||||
|
|
||||||
|
Int3 portalSpace = build.getDoorSpace(chosenDirection);
|
||||||
|
int yOffset = portalSpace.yCoord;
|
||||||
|
|
||||||
|
for(int i=0; i<256; i++)
|
||||||
|
{
|
||||||
|
Block block = worldObj.getBlock(xCoord + (x)*5, i, zCoord + (z)*5);
|
||||||
|
if(block == ModBlocks.blockDemonPortal)
|
||||||
|
{
|
||||||
|
BlockTeleposer.swapBlocks(worldObj, worldObj, xCoord, i, zCoord, xCoord, yLevel + yOffset, zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build.buildAll(worldObj, xCoord + (x)*5, yLevel, zCoord + (z)*5, chosenDirection.getOpposite());
|
||||||
|
build.setAllGridSpaces(x, z, yLevel, chosenDirection.getOpposite(), GridSpace.MAIN_PORTAL, grid);
|
||||||
|
this.loadGSH(grid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createRandomHouse(int buildingTier)
|
||||||
{
|
{
|
||||||
int next = rand.nextInt(4);
|
int next = rand.nextInt(4);
|
||||||
ForgeDirection dir;
|
ForgeDirection dir;
|
||||||
|
@ -804,13 +887,16 @@ public class TEDemonPortal extends TileEntity
|
||||||
{
|
{
|
||||||
for(DemonBuilding build : TEDemonPortal.buildingList)
|
for(DemonBuilding build : TEDemonPortal.buildingList)
|
||||||
{
|
{
|
||||||
|
if(build.buildingTier != buildingTier || build.buildingType != DemonBuilding.BUILDING_HOUSE)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Int3 offsetSpace = build.getGridOffsetFromRoad(nextDir, yLevel);
|
Int3 offsetSpace = build.getGridOffsetFromRoad(nextDir, yLevel);
|
||||||
int xOff = offsetSpace.xCoord;
|
int xOff = offsetSpace.xCoord;
|
||||||
int zOff = offsetSpace.zCoord;
|
int zOff = offsetSpace.zCoord;
|
||||||
|
|
||||||
if(build.isValid(grid, x + xOff, z + zOff, nextDir.getOpposite()))
|
if(build.isValid(grid, x + xOff, z + zOff, nextDir.getOpposite()))
|
||||||
{
|
{
|
||||||
System.out.println("This one is valid! Direction: " + nextDir.toString());
|
|
||||||
if(schemMap.containsKey(nextDir))
|
if(schemMap.containsKey(nextDir))
|
||||||
{
|
{
|
||||||
schemMap.get(nextDir).add(build);
|
schemMap.get(nextDir).add(build);
|
||||||
|
@ -837,11 +923,10 @@ public class TEDemonPortal extends TileEntity
|
||||||
Int3 offsetSpace = build.getGridOffsetFromRoad(chosenDirection, yLevel);
|
Int3 offsetSpace = build.getGridOffsetFromRoad(chosenDirection, yLevel);
|
||||||
int xOff = offsetSpace.xCoord;
|
int xOff = offsetSpace.xCoord;
|
||||||
int zOff = offsetSpace.zCoord;
|
int zOff = offsetSpace.zCoord;
|
||||||
|
|
||||||
// System.out.println("xOff: " + xOff + " zOff: " + zOff + " Direction: " + chosenDirection.toString());
|
build.destroyAllInField(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite());
|
||||||
|
|
||||||
build.buildAll(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite());
|
build.buildAll(worldObj, xCoord + (x + xOff)*5, yLevel, zCoord + (z + zOff)*5, chosenDirection.getOpposite());
|
||||||
build.setAllGridSpaces(x + xOff, yLevel, z + zOff, chosenDirection.getOpposite(), GridSpace.HOUSE, grid);
|
build.setAllGridSpaces(x + xOff, z + zOff, yLevel, chosenDirection.getOpposite(), GridSpace.HOUSE, grid);
|
||||||
this.loadGSH(grid);
|
this.loadGSH(grid);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,6 +79,7 @@ public class TESpellParadigmBlock extends TESpellBlock
|
||||||
case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
case 0: return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||||
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
|
case 1: return "alchemicalwizardry:textures/models/SpellParadigmSelf.png";
|
||||||
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
|
case 2: return "alchemicalwizardry:textures/models/SpellParadigmMelee.png";
|
||||||
|
case 3: return "alchemicalwizardry:textures/models/SpellParadigmTool.png";
|
||||||
}
|
}
|
||||||
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
return "alchemicalwizardry:textures/models/SpellParadigmProjectile.png";
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 594 B |
Loading…
Reference in a new issue