New Traits + Balancing.

Cascade: Random breaking of blocks around initial block.
Fracture: Random breaking of max. 9 blocks in direction.
Dark: Heals tool, but gives weak- and darkness.
Glimmer: Gives a chance of night vision effect.
Analysing: ++More EXP, less drops!
This commit is contained in:
Robert Sosnitzka
2016-06-20 01:01:07 +02:00
parent 30dba5a0c4
commit 0506ec6dbf
10 changed files with 137 additions and 23 deletions

View File

@@ -0,0 +1,43 @@
package com.sosnitzka.ztic_addon.traits;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import slimeknights.tconstruct.library.traits.AbstractTrait;
import slimeknights.tconstruct.library.utils.ToolHelper;
/**
* Created by Robert on 03.06.2016.
*/
public class TraitDark extends AbstractTrait {
public TraitDark() {
super("dark", TextFormatting.DARK_GRAY);
MinecraftForge.EVENT_BUS.register(this);
}
@Override
public void afterBlockBreak(ItemStack tool, World world, IBlockState state, BlockPos pos, EntityLivingBase player, boolean wasEffective) {
if (random.nextFloat() <= 0.1) {
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 300));
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 300));
ToolHelper.healTool(tool, random.nextInt(51) + 10, null);
}
}
@Override
public void afterHit(ItemStack tool, EntityLivingBase player, EntityLivingBase target, float damage, boolean wasCritical, boolean wasHit) {
if (random.nextFloat() <= 0.1) {
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 300));
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 300));
ToolHelper.healTool(tool, random.nextInt(51) + 10, null);
}
}
}