Changed Straw totem base fail chance from 50 to 35.
Changed fail chance increase when failed charging from variable to static 5. Changed conditions for failing a revive with the straw totem. The totem no longer gets destroyed and instead uses up the required charges and fail chance gets reset by the required charge amount.
This commit is contained in:
@ -29,7 +29,7 @@ public class StrawTotemItem extends Item {
|
||||
public static final String TAG_TARGET_INDEX = "target_index";
|
||||
public static final String TAG_TARGET_NAME = "target_name";
|
||||
public static final String TAG_FAIL_CHANCE = "fail_chance";
|
||||
public static final int STARTING_FAIL_CHANCE = 50;
|
||||
public static final int STARTING_FAIL_CHANCE = 35;
|
||||
|
||||
public StrawTotemItem() {
|
||||
super(new Item.Properties().tab(ItemGroup.TAB_MISC).stacksTo(1).rarity(Rarity.UNCOMMON));
|
||||
@ -41,7 +41,7 @@ public class StrawTotemItem extends Item {
|
||||
tooltip.add(new StringTextComponent( TextFormatting.GOLD + "Charges: " + TextFormatting.GRAY + stack.getOrCreateTag().getInt(TAG_CHARGE_AMOUNT)));
|
||||
tooltip.add(new StringTextComponent(TextFormatting.GOLD + "Target: " + TextFormatting.GRAY + stack.getOrCreateTag().getString(TAG_TARGET_NAME)));
|
||||
tooltip.add(new StringTextComponent(TextFormatting.GOLD + "Fail Chance: " + TextFormatting.GRAY + stack.getOrCreateTag().getInt(TAG_FAIL_CHANCE)));
|
||||
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "\"Feels kinda funky.\""));
|
||||
tooltip.add(new StringTextComponent(TextFormatting.ITALIC + "" + TextFormatting.DARK_GRAY + "\"Feels kinda funky.\""));
|
||||
tooltip.add(new StringTextComponent(""));
|
||||
if (InputMappings.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), GLFW.GLFW_KEY_LEFT_SHIFT)) {
|
||||
tooltip.add(new StringTextComponent(TextFormatting.YELLOW + "R-CLICK"));
|
||||
|
@ -60,11 +60,11 @@ public class C2SRequestPlayerRevive {
|
||||
if (item.getOrCreateTag().contains(StrawTotemItem.TAG_FAIL_CHANCE)) {
|
||||
int fail_chance = item.getOrCreateTag().getInt(StrawTotemItem.TAG_FAIL_CHANCE);
|
||||
if (Utils.randomIntRange(0, 100) <= fail_chance) {
|
||||
sender.setItemInHand(msg.hand, new ItemStack(Items.AIR));
|
||||
item.getOrCreateTag().putInt(StrawTotemItem.TAG_CHARGE_AMOUNT, item.getOrCreateTag().getInt(StrawTotemItem.TAG_CHARGE_AMOUNT)-required_charge);
|
||||
item.getOrCreateTag().putInt(StrawTotemItem.TAG_FAIL_CHANCE, fail_chance-(5*required_charge));
|
||||
sender.hurt(DamageSource.GENERIC, (sender.getHealth() * (fail_chance / 100.0f)));
|
||||
return;
|
||||
}
|
||||
sender.setItemInHand(msg.hand, new ItemStack(Items.AIR));
|
||||
}
|
||||
player_to_revive.teleportTo(sender.getX(), sender.getY(), sender.getZ());
|
||||
player_to_revive.setGameMode(GameType.SURVIVAL);
|
||||
|
@ -54,7 +54,7 @@ public class C2SRequestTotemCharge {
|
||||
sender.setItemInHand(msg.hand, new ItemStack(Items.AIR));
|
||||
sender.hurt(DamageSource.GENERIC, (sender.getHealth() * (fail_chance / 100.0f)));
|
||||
} else {
|
||||
totem_item.getOrCreateTag().putInt(StrawTotemItem.TAG_FAIL_CHANCE, (int)Utils.clamp(fail_chance+(fail_chance/10), 0, 100));
|
||||
totem_item.getOrCreateTag().putInt(StrawTotemItem.TAG_FAIL_CHANCE, fail_chance+5);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user