Initial stages of Omega being worked on - binding of human and demon at 5%.

This commit is contained in:
WayofTime 2015-01-11 21:05:28 -05:00
parent c0abd69a2a
commit 316a79fab8
16 changed files with 348 additions and 49 deletions

View file

@ -113,6 +113,9 @@ import WayofTime.alchemicalWizardry.common.harvest.PamHarvestCompatRegistry;
import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner; import WayofTime.alchemicalWizardry.common.items.ItemRitualDiviner;
import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding; import WayofTime.alchemicalWizardry.common.items.sigil.SigilOfHolding;
import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour; import WayofTime.alchemicalWizardry.common.items.thaumcraft.ItemSanguineArmour;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import WayofTime.alchemicalWizardry.common.omega.ReagentRegenConfiguration;
import WayofTime.alchemicalWizardry.common.potion.PotionBoost; import WayofTime.alchemicalWizardry.common.potion.PotionBoost;
import WayofTime.alchemicalWizardry.common.potion.PotionDeaf; import WayofTime.alchemicalWizardry.common.potion.PotionDeaf;
import WayofTime.alchemicalWizardry.common.potion.PotionDemonCloak; import WayofTime.alchemicalWizardry.common.potion.PotionDemonCloak;
@ -1307,6 +1310,8 @@ public class AlchemicalWizardry
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 6), new ReagentStack(ReagentRegistry.virtusReagent, 1000)); ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 6), new ReagentStack(ReagentRegistry.virtusReagent, 1000));
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 7), new ReagentStack(ReagentRegistry.reductusReagent, 1000)); ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 7), new ReagentStack(ReagentRegistry.reductusReagent, 1000));
ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(ReagentRegistry.potentiaReagent, 1000)); ReagentRegistry.registerItemAndReagent(new ItemStack(ModItems.baseAlchemyItems, 1, 8), new ReagentStack(ReagentRegistry.potentiaReagent, 1000));
OmegaRegistry.registerParadigm(ReagentRegistry.aquasalusReagent, new OmegaParadigm(ReagentRegistry.aquasalusReagent, ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater, new ReagentRegenConfiguration(20, 10, 1)));
} }
public static void initDemonPacketRegistiry() public static void initDemonPacketRegistiry()

View file

@ -109,38 +109,38 @@ public class APISpellHelper
setPlayerReagentType(player, ReagentRegistry.getKeyForReagent(reagent)); setPlayerReagentType(player, ReagentRegistry.getKeyForReagent(reagent));
} }
public static int getCurrentAdditionalHP(EntityPlayer player) public static float getCurrentAdditionalHP(EntityPlayer player)
{ {
NBTTagCompound data = player.getEntityData(); NBTTagCompound data = player.getEntityData();
if(data.hasKey("BM:CurrentAddedHP")) if(data.hasKey("BM:CurrentAddedHP"))
{ {
return data.getInteger("BM:CurrentAddedHP"); return data.getFloat("BM:CurrentAddedHP");
} }
return 0; return 0;
} }
public static void setCurrentAdditionalHP(EntityPlayer player, int amount) public static void setCurrentAdditionalHP(EntityPlayer player, float amount)
{ {
NBTTagCompound data = player.getEntityData(); NBTTagCompound data = player.getEntityData();
data.setInteger("BM:CurrentAddedHP", amount); data.setFloat("BM:CurrentAddedHP", amount);
} }
public static int getCurrentAdditionalMaxHP(EntityPlayer player) public static float getCurrentAdditionalMaxHP(EntityPlayer player)
{ {
NBTTagCompound data = player.getEntityData(); NBTTagCompound data = player.getEntityData();
if(data.hasKey("BM:MaxAddedHP")) if(data.hasKey("BM:MaxAddedHP"))
{ {
return data.getInteger("BM:MaxAddedHP"); return data.getFloat("BM:MaxAddedHP");
} }
return 0; return 0;
} }
public static void setCurrentAdditionalMaxHP(EntityPlayer player, int amount) public static void setCurrentAdditionalMaxHP(EntityPlayer player, float maxHP)
{ {
NBTTagCompound data = player.getEntityData(); NBTTagCompound data = player.getEntityData();
data.setInteger("BM:MaxAddedHP", amount); data.setFloat("BM:MaxAddedHP", maxHP);
} }
public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range) public static MovingObjectPosition raytraceFromEntity(World world, Entity player, boolean par3, double range)

View file

@ -74,15 +74,18 @@ public class RenderHelper
ItemStack stack = player.inventory.armorItemInSlot(2); ItemStack stack = player.inventory.armorItemInSlot(2);
if(stack != null && stack.getItem() instanceof OmegaArmour) if(stack != null && stack.getItem() instanceof OmegaArmour)
{ {
int duration = ((OmegaArmour)stack.getItem()).getDuration(stack); int maxAmount = (int) APISpellHelper.getPlayerMaxReagentAmount(player);
ReagentStack reagentStack = new ReagentStack(ReagentRegistry.aquasalusReagent, duration);
int maxAmount = 100;
if(reagentStack != null && reagentStack.amount > 0) if(maxAmount > 0)
{ {
renderTestHUD(mc, reagentStack, maxAmount); float val = APISpellHelper.getPlayerCurrentReagentAmount(player);
} ReagentStack reagentStack = new ReagentStack(APISpellHelper.getPlayerReagentType(player), (int) val);
if(reagentStack != null && reagentStack.amount > 0)
{
renderTestHUD(mc, reagentStack, maxAmount);
}
}
} }
if(SpellHelper.canPlayerSeeLPBar(player)) if(SpellHelper.canPlayerSeeLPBar(player))
@ -94,6 +97,13 @@ public class RenderHelper
renderLPHUD(mc, APISpellHelper.getPlayerLPTag(player), max); renderLPHUD(mc, APISpellHelper.getPlayerLPTag(player), max);
} }
} }
float maxHP = APISpellHelper.getCurrentAdditionalMaxHP(player);
// System.out.println("MaxHP: " + maxHP);
if(maxHP > 0)
{
renderHPHUD(mc, APISpellHelper.getCurrentAdditionalHP(player), maxHP);
}
} }
return true; return true;
@ -123,6 +133,35 @@ public class RenderHelper
mc.getTextureManager().bindTexture(test); mc.getTextureManager().bindTexture(test);
drawTexturedModalRect(x, y, 0, 0, 256, 256);
GL11.glPopMatrix();
}
private static void renderHPHUD(Minecraft mc, float hpAmount, float maxAmount)
{
GL11.glPushMatrix();
int xSize = 32;
int ySize = 32;
int amount = Math.max((int) (256 * ((double)(hpAmount) / maxAmount)), 0);
int x = (lpBarX + 8 - xSize / 2) * 8;
int y = (lpBarY + 32 - ySize / 2) * 8;
ResourceLocation test2 = new ResourceLocation("alchemicalwizardry", "textures/gui/HPBar2.png");
GL11.glColor4f(1, 0, 0, 1.0F);
mc.getTextureManager().bindTexture(test2);
GL11.glScalef(1f/8f, 1f/8f, 1f/8f);
drawTexturedModalRect(x, y, amount, 0, amount, 256);
ResourceLocation test = new ResourceLocation("alchemicalwizardry", "textures/gui/HPBar1.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(test);
drawTexturedModalRect(x, y, 0, 0, 256, 256); drawTexturedModalRect(x, y, 0, 0, 256, 256);
GL11.glPopMatrix(); GL11.glPopMatrix();

View file

@ -16,30 +16,40 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.PlayerCapabilities; import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.entity.projectile.EntityThrowable;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
import net.minecraftforge.event.AnvilUpdateEvent; import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.entity.living.EnderTeleportEvent; import net.minecraftforge.event.entity.living.EnderTeleportEvent;
import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
import vazkii.botania.api.internal.IManaBurst; import vazkii.botania.api.internal.IManaBurst;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.BloodMagicConfiguration; import WayofTime.alchemicalWizardry.BloodMagicConfiguration;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour; import WayofTime.alchemicalWizardry.common.items.armour.BoundArmour;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import WayofTime.alchemicalWizardry.common.omega.ReagentRegenConfiguration;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone; import WayofTime.alchemicalWizardry.common.tileEntity.TEMasterStone;
import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
@ -57,13 +67,143 @@ public class AlchemicalWizardryEventHooks
@SubscribeEvent @SubscribeEvent
public void onAnvilUpdateEvent(AnvilUpdateEvent event) public void onAnvilUpdateEvent(AnvilUpdateEvent event)
{ {
if(event.isCancelable() && event.left != null && event.left.getItem() instanceof BoundArmour && event.right != null) if(event.isCancelable() && event.left != null && event.right != null && (event.left.getItem() instanceof BoundArmour || event.right.getItem() instanceof BoundArmour))
{ {
event.setCanceled(true); event.setCanceled(true);
} }
} }
@SubscribeEvent(priority=EventPriority.HIGHEST)
public void onLivingHurtEvent(LivingHurtEvent event)
{
if(!event.isCanceled() && event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote)
{
EntityPlayer player = (EntityPlayer)event.entityLiving;
float prevHp = APISpellHelper.getCurrentAdditionalHP((EntityPlayer)event.entityLiving);
if(prevHp > 0) //TODO change the HP values to floats
{
float recalculatedAmount = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, event.source, event.ammount);
if (recalculatedAmount <= 0) return;
float ratio = recalculatedAmount / event.ammount;
float f1 = recalculatedAmount;
recalculatedAmount = Math.max(recalculatedAmount - player.getAbsorptionAmount(), 0.0F);
player.setAbsorptionAmount(player.getAbsorptionAmount() - (f1 - recalculatedAmount));
if(prevHp > recalculatedAmount)
{
float hp = (prevHp - recalculatedAmount);
if(hp > 0)
{
event.ammount = 0;
}else
{
event.ammount += hp / ratio;
}
APISpellHelper.setCurrentAdditionalHP((EntityPlayer)event.entityLiving, Math.max(0, hp));
System.out.println("HP: " + hp);
APISpellHelper.setCurrentAdditionalHP(player, Math.max(0, hp));
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(Math.max(0, hp), APISpellHelper.getCurrentAdditionalMaxHP(player)), (EntityPlayerMP)player);
}
}
}
}
@SubscribeEvent @SubscribeEvent
public void omegaUpdateHpEvent(LivingUpdateEvent event)
{
if(event.entityLiving instanceof EntityPlayer && !event.entityLiving.worldObj.isRemote)
{
EntityPlayer player = (EntityPlayer)event.entityLiving;
Reagent reagent = APISpellHelper.getPlayerReagentType(player);
float reagentAmount = APISpellHelper.getPlayerCurrentReagentAmount(player);
boolean hasReagentChanged = false;
if(reagentAmount > 0 && OmegaRegistry.hasParadigm(reagent))
{
OmegaParadigm parad = OmegaRegistry.getParadigmForReagent(reagent);
ReagentRegenConfiguration config = parad.getRegenConfig(player);
if(parad.isPlayerWearingFullSet(player))
{
if(event.entityLiving.worldObj.getWorldTime() % config.tickRate == 0)
{
boolean hasHealthChanged = false;
int maxHealth = parad.getMaxAdditionalHealth();
float health = APISpellHelper.getCurrentAdditionalHP(player);
if(health > maxHealth)
{
health = maxHealth;
hasHealthChanged = true;
}else if(health < maxHealth)
{
float addedAmount = Math.min(Math.min((reagentAmount / config.costPerPoint), config.healPerTick), maxHealth - health);
float drain = addedAmount * config.costPerPoint;
reagentAmount -= drain;
hasReagentChanged = true;
health += addedAmount;
hasHealthChanged = true;
}
if(player instanceof EntityPlayerMP)
{
if(hasHealthChanged)
{
APISpellHelper.setCurrentAdditionalHP(player, health);
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getAddedHPPacket(health, maxHealth), (EntityPlayerMP)player);
}
}
}
}
//Consumes the amount
float costPerTick = parad.getCostPerTickOfUse(player);
if(reagentAmount > costPerTick)
{
hasReagentChanged = true;
reagentAmount = Math.max(0, reagentAmount - costPerTick);
}else
{
hasReagentChanged = true;
reagentAmount = 0;
}
}
if(reagentAmount <= 0)
{
ItemStack[] armourInventory = player.inventory.armorInventory;
for(ItemStack stack : armourInventory)
{
if(stack != null && stack.getItem() instanceof OmegaArmour)
{
((OmegaArmour)stack.getItem()).revertArmour(player, stack);
}
}
}
if(player instanceof EntityPlayerMP)
{
if(hasReagentChanged)
{
APISpellHelper.setPlayerCurrentReagentAmount(player, reagentAmount);
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, reagentAmount, APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
}
}
}
}
@SubscribeEvent(priority=EventPriority.HIGHEST)
public void onPlayerDamageEvent(LivingAttackEvent event) public void onPlayerDamageEvent(LivingAttackEvent event)
{ {
if (event.source.isProjectile()) if (event.source.isProjectile())

View file

@ -288,6 +288,7 @@ public enum NewPacketHandler
{ {
EntityPlayer player = Minecraft.getMinecraft().thePlayer; EntityPlayer player = Minecraft.getMinecraft().thePlayer;
APISpellHelper.setPlayerReagentType(player, msg.reagent);
APISpellHelper.setPlayerCurrentReagentAmount(player, msg.currentAR); APISpellHelper.setPlayerCurrentReagentAmount(player, msg.currentAR);
APISpellHelper.setPlayerMaxReagentAmount(player, msg.maxAR); APISpellHelper.setPlayerMaxReagentAmount(player, msg.maxAR);
} }
@ -430,8 +431,8 @@ public enum NewPacketHandler
public static class CurrentAddedHPMessage extends BMMessage public static class CurrentAddedHPMessage extends BMMessage
{ {
int currentHP; float currentHP;
int maxHP; float maxHP;
} }
private class TEAltarCodec extends FMLIndexedMessageToMessageCodec<BMMessage> private class TEAltarCodec extends FMLIndexedMessageToMessageCodec<BMMessage>
@ -673,8 +674,8 @@ public enum NewPacketHandler
break; break;
case 13: case 13:
target.writeInt(((CurrentAddedHPMessage) msg).currentHP); target.writeFloat(((CurrentAddedHPMessage) msg).currentHP);
target.writeInt(((CurrentAddedHPMessage) msg).maxHP); target.writeFloat(((CurrentAddedHPMessage) msg).maxHP);
break; break;
} }
@ -906,8 +907,8 @@ public enum NewPacketHandler
break; break;
case 13: case 13:
((CurrentAddedHPMessage) msg).currentHP = dat.readInt(); ((CurrentAddedHPMessage) msg).currentHP = dat.readFloat();
((CurrentAddedHPMessage) msg).maxHP = dat.readInt(); ((CurrentAddedHPMessage) msg).maxHP = dat.readFloat();
break; break;
} }
@ -1076,11 +1077,11 @@ public enum NewPacketHandler
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);
} }
public static Packet getAddedHPPacket(int curHP, int maxHP) public static Packet getAddedHPPacket(float health, float maxHP)
{ {
CurrentAddedHPMessage msg = new CurrentAddedHPMessage(); CurrentAddedHPMessage msg = new CurrentAddedHPMessage();
msg.index = 13; msg.index = 13;
msg.currentHP = curHP; msg.currentHP = health;
msg.maxHP = maxHP; msg.maxHP = maxHP;
return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg); return INSTANCE.channels.get(Side.SERVER).generatePacketFrom(msg);

View file

@ -218,7 +218,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
return new ArmorProperties(-1, 0, 0); return new ArmorProperties(-1, 0, 0);
} }
if (helmet.getItem().equals(ModItems.boundHelmet) && plate.getItem().equals(ModItems.boundPlate) && leggings.getItem().equals(ModItems.boundLeggings) && boots.getItem().equals(ModItems.boundBoots)) if (helmet.getItem() instanceof BoundArmour && plate.getItem() instanceof BoundArmour && leggings.getItem() instanceof BoundArmour && boots.getItem() instanceof BoundArmour)
{ {
if (source.isUnblockable()) if (source.isUnblockable())
{ {

View file

@ -39,13 +39,25 @@ public abstract class OmegaArmour extends BoundArmour
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
{ {
super.onArmorTick(world, player, itemStack); super.onArmorTick(world, player, itemStack);
if(!this.decrementDuration(itemStack)) //
{ // if(world.getWorldTime() % 20 == 0 && !world.isRemote)
ItemStack stack = this.getContainedArmourStack(itemStack); // {
player.inventory.armorInventory[3-this.armorType] = stack; // NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(ReagentRegistry.aquasalusReagent, this.getDuration(itemStack), 100), (EntityPlayerMP)player);
} // }
//
// if(!this.decrementDuration(itemStack))
// {
// ItemStack stack = this.getContainedArmourStack(itemStack);
// player.inventory.armorInventory[3-this.armorType] = stack;
// }
} }
public void revertArmour(EntityPlayer player, ItemStack itemStack)
{
ItemStack stack = this.getContainedArmourStack(itemStack);
player.inventory.armorInventory[3-this.armorType] = stack;
}
public ItemStack getSubstituteStack(ItemStack boundStack) public ItemStack getSubstituteStack(ItemStack boundStack)
{ {
ItemStack omegaStack = new ItemStack(this); ItemStack omegaStack = new ItemStack(this);

View file

@ -13,7 +13,9 @@ public class OmegaParadigm
public OmegaArmour leggings; public OmegaArmour leggings;
public OmegaArmour boots; public OmegaArmour boots;
public OmegaParadigm(Reagent reagent, OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots) public ReagentRegenConfiguration config;
public OmegaParadigm(Reagent reagent, OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots, ReagentRegenConfiguration config)
{ {
this.helmet = helmet; this.helmet = helmet;
this.chestPiece = chestPiece; this.chestPiece = chestPiece;
@ -28,6 +30,8 @@ public class OmegaParadigm
this.chestPiece.setReagent(reagent); this.chestPiece.setReagent(reagent);
this.leggings.setReagent(reagent); this.leggings.setReagent(reagent);
this.boots.setReagent(reagent); this.boots.setReagent(reagent);
this.config = new ReagentRegenConfiguration(20, 10, 1);
} }
public void convertPlayerArmour(EntityPlayer player) public void convertPlayerArmour(EntityPlayer player)
@ -52,4 +56,31 @@ public class OmegaParadigm
armours[0] = omegaBootsStack; armours[0] = omegaBootsStack;
} }
} }
public ReagentRegenConfiguration getRegenConfig(EntityPlayer player)
{
return this.config;
}
public int getMaxAdditionalHealth()
{
return 50;
}
public float getCostPerTickOfUse(EntityPlayer player)
{
return 1;
}
public boolean isPlayerWearingFullSet(EntityPlayer player)
{
ItemStack[] armours = player.inventory.armorInventory;
ItemStack helmetStack = armours[3];
ItemStack chestStack = armours[2];
ItemStack leggingsStack = armours[1];
ItemStack bootsStack = armours[0];
return helmetStack != null && helmetStack.getItem() == helmet && chestStack != null && chestStack.getItem() == chestPiece && leggingsStack != null && leggingsStack.getItem() == leggings && bootsStack != null && bootsStack.getItem() == boots;
}
} }

View file

@ -0,0 +1,25 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.entity.player.EntityPlayer;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.common.items.armour.OmegaArmour;
public class OmegaParadigmWater extends OmegaParadigm
{
public OmegaParadigmWater(OmegaArmour helmet, OmegaArmour chestPiece, OmegaArmour leggings, OmegaArmour boots)
{
super(ReagentRegistry.aquasalusReagent, helmet, chestPiece, leggings, boots, new ReagentRegenConfiguration(50, 10, 100));
}
@Override
public float getCostPerTickOfUse(EntityPlayer player)
{
if(player.isInWater())
{
return 0.5f;
}else
{
return 1;
}
}
}

View file

@ -1,6 +1,25 @@
package WayofTime.alchemicalWizardry.common.omega; package WayofTime.alchemicalWizardry.common.omega;
import java.util.HashMap;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
public class OmegaRegistry public class OmegaRegistry
{ {
public static HashMap<Reagent, OmegaParadigm> omegaList = new HashMap();
public static void registerParadigm(Reagent reagent, OmegaParadigm parad)
{
omegaList.put(reagent, parad);
}
public static OmegaParadigm getParadigmForReagent(Reagent reagent)
{
return omegaList.get(reagent);
}
public static boolean hasParadigm(Reagent reagent)
{
return omegaList.containsKey(reagent);
}
} }

View file

@ -0,0 +1,15 @@
package WayofTime.alchemicalWizardry.common.omega;
public class ReagentRegenConfiguration
{
public int tickRate;
public int healPerTick;
public float costPerPoint;
public ReagentRegenConfiguration(int tickRate, int healPerTick, float costPerPoint)
{
this.tickRate = tickRate;
this.healPerTick = healPerTick;
this.costPerPoint = costPerPoint;
}
}

View file

@ -160,20 +160,20 @@ public class RitualEffectCrushing extends RitualEffect
if (copyStack.stackSize > 0) if (copyStack.stackSize > 0)
{ {
world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack)); world.spawnEntityInWorld(new EntityItem(world, x + 0.4, y + 2, z + 0.5, copyStack));
} }
}
if (hasOrbisTerrae)
{ if (hasOrbisTerrae)
this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true); {
} this.canDrainReagent(ritualStone, ReagentRegistry.orbisTerraeReagent, orbisTerraeDrain, true);
if (hasPotentia) }
{ if (hasPotentia)
this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true); {
} this.canDrainReagent(ritualStone, ReagentRegistry.potentiaReagent, potentiaDrain, true);
if (hasVirtus) }
{ if (hasVirtus)
this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true); {
} this.canDrainReagent(ritualStone, ReagentRegistry.virtusReagent, virtusDrain, true);
} }
} }
} }

View file

@ -4,18 +4,22 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent; import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
import WayofTime.alchemicalWizardry.api.rituals.RitualEffect; import WayofTime.alchemicalWizardry.api.rituals.RitualEffect;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectOmegaTest extends RitualEffect public class RitualEffectOmegaTest extends RitualEffect
{ {
public static final int tickDuration = 1 * 60 * 20;
@Override @Override
public void performEffect(IMasterRitualStone ritualStone) public void performEffect(IMasterRitualStone ritualStone)
{ {
@ -38,8 +42,16 @@ public class RitualEffectOmegaTest extends RitualEffect
for(EntityPlayer player : playerList) for(EntityPlayer player : playerList)
{ {
OmegaParadigm waterParadigm = new OmegaParadigm(ReagentRegistry.aquasalusReagent, ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater); // OmegaParadigm waterParadigm = new OmegaParadigm(ReagentRegistry.aquasalusReagent, ModItems.boundHelmetWater, ModItems.boundPlateWater, ModItems.boundLeggingsWater, ModItems.boundBootsWater, new ReagentRegenConfiguration(1, 1, 1));
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(ReagentRegistry.aquasalusReagent);
waterParadigm.convertPlayerArmour(player); waterParadigm.convertPlayerArmour(player);
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);
APISpellHelper.setPlayerReagentType(player, ReagentRegistry.aquasalusReagent);
APISpellHelper.setCurrentAdditionalMaxHP(player, waterParadigm.getMaxAdditionalHealth());
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(ReagentRegistry.aquasalusReagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
} }
} }

View file

@ -73,7 +73,7 @@ public class RitualEffectWellOfSuffering extends RitualEffect
{ {
for (EntityLivingBase livingEntity : list) for (EntityLivingBase livingEntity : list)
{ {
if (livingEntity instanceof EntityPlayer || AlchemicalWizardry.wellBlacklist.contains(livingEntity.getClass())) if (!livingEntity.isEntityAlive() || livingEntity instanceof EntityPlayer || AlchemicalWizardry.wellBlacklist.contains(livingEntity.getClass()))
{ {
continue; continue;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B