Fire stuff

This commit is contained in:
WayofTime 2014-01-19 16:42:31 -05:00
parent 4f0b6199f6
commit 51897c6923
7 changed files with 71 additions and 7 deletions

View file

@ -23,7 +23,6 @@ import thaumcraft.api.ItemApi;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks; import WayofTime.alchemicalWizardry.common.AlchemicalWizardryEventHooks;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardryFuelHandler; import WayofTime.alchemicalWizardry.common.AlchemicalWizardryFuelHandler;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardryTickHandler; import WayofTime.alchemicalWizardry.common.AlchemicalWizardryTickHandler;
import WayofTime.alchemicalWizardry.common.BloodMagicConfiguration;
import WayofTime.alchemicalWizardry.common.CommonProxy; import WayofTime.alchemicalWizardry.common.CommonProxy;
import WayofTime.alchemicalWizardry.common.EntityAirElemental; import WayofTime.alchemicalWizardry.common.EntityAirElemental;
import WayofTime.alchemicalWizardry.common.LifeBucketHandler; import WayofTime.alchemicalWizardry.common.LifeBucketHandler;
@ -31,6 +30,7 @@ import WayofTime.alchemicalWizardry.common.ModLivingDropsEvent;
import WayofTime.alchemicalWizardry.common.PacketHandler; import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.common.PotionBoost; import WayofTime.alchemicalWizardry.common.PotionBoost;
import WayofTime.alchemicalWizardry.common.PotionDrowning; import WayofTime.alchemicalWizardry.common.PotionDrowning;
import WayofTime.alchemicalWizardry.common.PotionFlameCloak;
import WayofTime.alchemicalWizardry.common.PotionFlight; import WayofTime.alchemicalWizardry.common.PotionFlight;
import WayofTime.alchemicalWizardry.common.PotionInhibit; import WayofTime.alchemicalWizardry.common.PotionInhibit;
import WayofTime.alchemicalWizardry.common.PotionProjectileProtect; import WayofTime.alchemicalWizardry.common.PotionProjectileProtect;
@ -119,6 +119,7 @@ public class AlchemicalWizardry
public static Potion customPotionInhibit; public static Potion customPotionInhibit;
public static Potion customPotionFlight; public static Potion customPotionFlight;
public static Potion customPotionReciprocation; public static Potion customPotionReciprocation;
public static Potion customPotionFlameCloak;
public static int customPotionDrowningID; public static int customPotionDrowningID;
public static int customPotionBoostID; public static int customPotionBoostID;
@ -126,6 +127,7 @@ public class AlchemicalWizardry
public static int customPotionInhibitID; public static int customPotionInhibitID;
public static int customPotionFlightID; public static int customPotionFlightID;
public static int customPotionReciprocationID; public static int customPotionReciprocationID;
public static int customPotionFlameCloakID;
public static boolean isThaumcraftLoaded; public static boolean isThaumcraftLoaded;
@ -537,6 +539,7 @@ public class AlchemicalWizardry
customPotionInhibit = (new PotionInhibit(customPotionInhibitID, false, 0)).setIconIndex(0, 0).setPotionName("Inhibit"); customPotionInhibit = (new PotionInhibit(customPotionInhibitID, false, 0)).setIconIndex(0, 0).setPotionName("Inhibit");
customPotionFlight = (new PotionFlight(customPotionFlightID, false, 0)).setIconIndex(0, 0).setPotionName("Flight"); customPotionFlight = (new PotionFlight(customPotionFlightID, false, 0)).setIconIndex(0, 0).setPotionName("Flight");
customPotionReciprocation = (new PotionReciprocation(customPotionReciprocationID, false, 0xFFFFFF)).setIconIndex(0, 0).setPotionName("Reciprocation"); customPotionReciprocation = (new PotionReciprocation(customPotionReciprocationID, false, 0xFFFFFF)).setIconIndex(0, 0).setPotionName("Reciprocation");
customPotionFlameCloak = (new PotionFlameCloak(customPotionFlameCloakID,false,0).setIconIndex(0,0).setPotionName("Flame Cloak"));
//All items registered go here //All items registered go here
//LanguageRegistry.addName(orbOfTesting, "Orb of Testing"); //LanguageRegistry.addName(orbOfTesting, "Orb of Testing");
LanguageRegistry.addName(ModItems.weakBloodOrb, "Weak Blood Orb"); LanguageRegistry.addName(ModItems.weakBloodOrb, "Weak Blood Orb");

View file

@ -1,6 +1,5 @@
package WayofTime.alchemicalWizardry.common; package WayofTime.alchemicalWizardry;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm; import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.FMLLog;
import net.minecraftforge.common.Configuration; import net.minecraftforge.common.Configuration;
@ -45,6 +44,7 @@ public class BloodMagicConfiguration
AlchemicalWizardry.customPotionInhibitID = config.get("Potion ID", "Inhibit", 103).getInt(); AlchemicalWizardry.customPotionInhibitID = config.get("Potion ID", "Inhibit", 103).getInt();
AlchemicalWizardry.customPotionFlightID = config.get("Potion ID", "Flight", 104).getInt(); AlchemicalWizardry.customPotionFlightID = config.get("Potion ID", "Flight", 104).getInt();
AlchemicalWizardry.customPotionReciprocationID = config.get("Potion ID", "Reciprocation", 105).getInt(); AlchemicalWizardry.customPotionReciprocationID = config.get("Potion ID", "Reciprocation", 105).getInt();
AlchemicalWizardry.customPotionFlameCloakID = config.get("Potion ID","FlameCloak",106).getInt();
MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt(); MeteorParadigm.maxChance = config.get("meteor", "maxChance", 1000).getInt();
AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true); AlchemicalWizardry.doMeteorsDestroyBlocks = config.get("meteor", "doMeteorsDestroyBlocks", true).getBoolean(true);

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.relauncher.ReflectionHelper; import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@ -10,6 +11,7 @@ import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
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.potion.Potion;
import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
@ -51,6 +53,19 @@ public class AlchemicalWizardryEventHooks
((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve); ((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
} }
} }
if(entityAttacked.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
{
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
Entity entityAttacking = event.source.getSourceOfDamage();
if(entityAttacking != null && entityAttacking instanceof EntityLivingBase && !entityAttacking.isImmuneToFire() && !((EntityLivingBase)entityAttacking).isPotionActive(Potion.fireResistance))
{
entityAttacking.attackEntityFrom(DamageSource.inFire, 2*i+2);
entityAttacking.setFire(3);
}
}
} }
// @ForgeSubscribe // @ForgeSubscribe
@ -63,6 +78,9 @@ public class AlchemicalWizardryEventHooks
public void onEntityUpdate(LivingUpdateEvent event) public void onEntityUpdate(LivingUpdateEvent event)
{ {
EntityLivingBase entityLiving = event.entityLiving; EntityLivingBase entityLiving = event.entityLiving;
double x = entityLiving.posX;
double y = entityLiving.posY;
double z = entityLiving.posZ;
if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote) if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote)
{ {
@ -210,5 +228,26 @@ public class AlchemicalWizardryEventHooks
} }
} }
} }
if(entityLiving.isPotionActive(AlchemicalWizardry.customPotionFlameCloak))
{
entityLiving.worldObj.spawnParticle("flame", x+SpellHelper.gaussian(1),y-1.3+SpellHelper.gaussian(0.3),z+SpellHelper.gaussian(1), 0, 0.06d, 0);
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionFlameCloak).getAmplifier();
double range = i*0.5;
List<Entity> entities = SpellHelper.getEntitiesInRange(entityLiving.worldObj, x, y, z, range, range);
if(entities!=null)
{
for(Entity entity : entities)
{
if(!entity.equals(entityLiving)&&!entity.isImmuneToFire()&&!(entity instanceof EntityLivingBase && ((EntityLivingBase)entity).isPotionActive(Potion.fireResistance)))
{
entity.setFire(3);
}
}
}
}
} }
} }

View file

@ -0,0 +1,18 @@
package WayofTime.alchemicalWizardry.common;
import net.minecraft.potion.Potion;
public class PotionFlameCloak extends Potion
{
public PotionFlameCloak(int par1, boolean par2, int par3)
{
super(par1, par2, par3);
}
@Override
public Potion setIconIndex(int par1, int par2)
{
super.setIconIndex(par1, par2);
return this;
}
}

View file

@ -17,6 +17,6 @@ public class SelfDefaultFire extends SelfSpellEffect
@Override @Override
public void onSelfUse(World world, EntityPlayer player) public void onSelfUse(World world, EntityPlayer player)
{ {
player.addPotionEffect(new PotionEffect(Potion.fireResistance.id,1000,0)); player.setFire((int)(10*Math.pow(1.5, powerUpgrades+1.5*potencyUpgrades)));
} }
} }

View file

@ -16,6 +16,9 @@ public class SelfDefensiveFire extends SelfSpellEffect {
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub
world.playAuxSFXAtEntity(player, 1008, (int)player.posX, (int)player.posY, (int)player.posZ, 0);
} }
} }

View file

@ -1,7 +1,9 @@
package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire; package WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.fire;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.impactEffects.SelfSpellEffect;
public class SelfOffensiveFire extends SelfSpellEffect public class SelfOffensiveFire extends SelfSpellEffect
@ -14,7 +16,6 @@ public class SelfOffensiveFire extends SelfSpellEffect
@Override @Override
public void onSelfUse(World world, EntityPlayer player) public void onSelfUse(World world, EntityPlayer player)
{ {
player.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionFlameCloak.id,(this.powerUpgrades+1)*this.powerUpgrades,this.potencyUpgrades));
} }
} }