mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Remove the resizing for perfect dodge and add a 10% chance to dodge projectiles instead
This commit is contained in:
1 parent
7f87feaa0f
commit
08bdb0789a
2 files changed
+22
-33
No files matched your search
@@ -21,11 +21,6 @@ import tconstruct.util.network.HealthUpdatePacket;
|
||||
|
||||
public class ArmorAbilities
|
||||
{
|
||||
//Abilities
|
||||
boolean morphed;
|
||||
boolean morphLoaded = Loader.isModLoaded("Morph");
|
||||
boolean smartmoveLoaded = Loader.isModLoaded("SmartMoving");
|
||||
|
||||
public static List<String> stepBoostedPlayers = new ArrayList();
|
||||
//ItemStack prevFeet;
|
||||
double prevMotionY;
|
||||
@@ -91,34 +86,6 @@ public class ArmorAbilities
|
||||
{
|
||||
stack.getItem().onUpdate(stack, player.worldObj, player, 8, true);
|
||||
}*/
|
||||
|
||||
if (morphLoaded)
|
||||
{
|
||||
if (morph.api.Api.hasMorph(player.getCommandSenderName(), event.side.isClient()))
|
||||
{
|
||||
morphed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!player.isPlayerSleeping() && !smartmoveLoaded)
|
||||
{
|
||||
ItemStack chest = player.getCurrentArmor(2);
|
||||
if (chest == null || !(chest.getItem() instanceof IModifyable))
|
||||
{
|
||||
if (!(morphLoaded && morphed))
|
||||
PlayerAbilityHelper.setEntitySize(player, 0.6F, 1.8F);
|
||||
}
|
||||
else
|
||||
{
|
||||
NBTTagCompound tag = chest.getTagCompound().getCompoundTag(((IModifyable) chest.getItem()).getBaseTagName());
|
||||
int dodge = tag.getInteger("Perfect Dodge");
|
||||
if (dodge > 0)
|
||||
{
|
||||
if (!(morphLoaded && morphed))
|
||||
PlayerAbilityHelper.setEntitySize(player, Math.max(0.15F, 0.6F - (dodge * 0.09f)), 1.8F - (dodge * 0.04f));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraft.entity.boss.*;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.event.entity.living.*;
|
||||
@@ -103,4 +104,25 @@ public class TinkerArmorEvents
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void perfectDodge(LivingAttackEvent event)
|
||||
{
|
||||
if(!event.source.isProjectile())
|
||||
return;
|
||||
|
||||
// perfect dodge?
|
||||
if(!(event.entityLiving instanceof EntityPlayer))
|
||||
return;
|
||||
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack chest = player.getCurrentArmor(2);
|
||||
if(chest == null || !(chest.getItem() instanceof IModifyable) || !chest.hasTagCompound())
|
||||
return;
|
||||
|
||||
NBTTagCompound tags = chest.getTagCompound().getCompoundTag(((IModifyable) chest.getItem()).getBaseTagName());
|
||||
int dodge = tags.getInteger("Perfect Dodge");
|
||||
if(dodge > TConstruct.random.nextInt(10))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user