Skip to content

Commit

Permalink
Prepare for sling modifiers by making staffs be ranged
Browse files Browse the repository at this point in the history
Projectile Damage is now Projectile Power, as slings will use it as a percentage boost on distance
Attack Damage and Attack Speed are now Melee Damage and Melee Speed to be more clear
Harvest Tier is now Mining Tier for consistency (other stats for a type share a common prefix)
Staffs now show accuracy, velocity, projectile power, and draw speed in their stats tooltip
Adjusted various modifier recipes to be applicable or not applicable to staffs
  • Loading branch information
KnightMiner committed Nov 26, 2023
1 parent 7329f89 commit f98d351
Show file tree
Hide file tree
Showing 24 changed files with 101 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
}
],
"levels": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
}
],
"slots": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
}
],
"requirements": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
}
],
"requirements": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
}
],
"slots": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
},
{
"tag": "tconstruct:modifiable/armor/leggings"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/melee_or_unarmed"
},
"tools": [
{
"tag": "tconstruct:modifiable/melee_or_unarmed"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged/longbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/longbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged/crossbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/crossbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged/longbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/longbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"tag": "tconstruct:modifiable/harvest"
},
{
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
},
{
"tag": "tconstruct:modifiable/armor/leggings"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
"item": "minecraft:leather"
}
],
"tools": {
"tag": "tconstruct:modifiable/melee_or_unarmed"
},
"tools": [
{
"tag": "tconstruct:modifiable/melee_or_unarmed"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
},
"amount_per_item": 1,
"needed_per_level": 72,
"tools": {
"tag": "tconstruct:modifiable/ranged/longbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/longbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"tools": {
"tag": "tconstruct:modifiable/ranged"
"tag": "tconstruct:modifiable/ranged/bows"
},
"slots": {
"upgrades": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
"amount_per_item": 9,
"needed_per_level": 45,
"leftover": "minecraft:redstone",
"tools": {
"tag": "tconstruct:modifiable/ranged/crossbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/crossbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
},
"amount_per_item": 1,
"needed_per_level": 45,
"tools": {
"tag": "tconstruct:modifiable/ranged/crossbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/crossbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
"tag": "forge:dusts/redstone"
}
],
"tools": {
"tag": "tconstruct:modifiable/ranged/longbows"
},
"tools": [
{
"tag": "tconstruct:modifiable/ranged/longbows"
},
{
"tag": "tconstruct:modifiable/staffs"
}
],
"slots": {
"upgrades": 1
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"#tconstruct:modifiable/ranged/bows"
"#tconstruct:modifiable/ranged/bows",
"#tconstruct:modifiable/staffs"
]
}
4 changes: 2 additions & 2 deletions src/main/java/slimeknights/tconstruct/common/TinkerTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ private static void init() {}
public static final TagKey<Item> HELD_ARMOR = tag("modifiable/armor/held");
/** Modifiable items that have innate shielding behavior */
public static final TagKey<Item> SHIELDS = tag("modifiable/shields");
/** Modifiable items support special staff modifiers */
public static final TagKey<Item> STAFFS = tag("modifiable/staffs");

/** Modifiable items that support ranged attacks. Items in this tag support {@link ToolStats#DRAW_SPEED}, {@link ToolStats#VELOCITY}, {@link ToolStats#PROJECTILE_DAMAGE} and {@link ToolStats#ACCURACY} */
public static final TagKey<Item> RANGED = tag("modifiable/ranged");
Expand All @@ -377,6 +375,8 @@ private static void init() {}
public static final TagKey<Item> LONGBOWS = tag("modifiable/ranged/longbows");
/** Any modifiable bows that store an arrow then fire on next use */
public static final TagKey<Item> CROSSBOWS = tag("modifiable/ranged/crossbows");
/** Modifiable items support special staff modifiers, is a subtag of ranged. TODO 1.19: rename to modifiable/ranged/staffs */
public static final TagKey<Item> STAFFS = tag("modifiable/staffs");

/** Tools that can receive metal based embellishments */
public static final TagKey<Item> EMBELLISHMENT_METAL = tag("modifiable/embellishment/metal");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void addTools() {
this.tag(HELD_ARMOR).addTag(SHIELDS);
this.tag(ARMOR).addTags(WORN_ARMOR, HELD_ARMOR);
this.tag(AOE).addTag(BOOTS); // boot walk modifiers
this.tag(RANGED).addTag(BOWS);
this.tag(RANGED).addTags(BOWS, STAFFS);
this.tag(BOWS).addTags(LONGBOWS, CROSSBOWS);

// general
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static boolean damageAnimated(IToolStackView tool, int amount, LivingEnti
* @param entity Entity for animation
*/
public static boolean damageAnimated(IToolStackView tool, int amount, LivingEntity entity) {
return damageAnimated(tool, amount, entity, InteractionHand.MAIN_HAND);
return damageAnimated(tool, amount, entity, entity.isUsingItem() ? entity.getUsedItemHand() : InteractionHand.MAIN_HAND);
}

/** Implements {@link net.minecraft.world.item.Item#damageItem(ItemStack, int, LivingEntity, Consumer)} for a modifiable item */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.addInput(Items.EXPERIENCE_BOTTLE)
.setMaxLevel(5) // max +250%
.setSlots(SlotType.UPGRADE, 1)
.setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_UNARMED, TinkerTags.Items.HARVEST, TinkerTags.Items.RANGED, TinkerTags.Items.LEGGINGS))
.setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_UNARMED, TinkerTags.Items.HARVEST, TinkerTags.Items.BOWS, TinkerTags.Items.LEGGINGS))
.saveSalvage(consumer, prefix(TinkerModifiers.experienced, upgradeSalvage))
.save(consumer, prefix(TinkerModifiers.experienced, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.magnetic)
Expand Down Expand Up @@ -377,7 +377,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.addInput(Items.LEATHER)
.setMaxLevel(3) // max 12.5% knockback, or 6.25% on the dagger
.setSlots(SlotType.UPGRADE, 1)
.setTools(TinkerTags.Items.MELEE_OR_UNARMED)
.setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_UNARMED, TinkerTags.Items.STAFFS))
.saveSalvage(consumer, prefix(TinkerModifiers.padded, upgradeSalvage))
.save(consumer, prefix(TinkerModifiers.padded, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.severing)
Expand Down Expand Up @@ -504,13 +504,13 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
* ranged
*/
IncrementalModifierRecipeBuilder.modifier(ModifierIds.power)
.setTools(TinkerTags.Items.LONGBOWS)
.setTools(ingredientFromTags(TinkerTags.Items.LONGBOWS, TinkerTags.Items.STAFFS))
.setInput(TinkerWorld.ichorGeode.asItem(), 1, 72)
.setSlots(SlotType.UPGRADE, 1)
.setMaxLevel(5)
.saveSalvage(consumer, prefix(ModifierIds.power, upgradeSalvage))
.save(consumer, prefix(ModifierIds.power, upgradeFolder));
hasteRecipes(consumer, ModifierIds.quickCharge, Ingredient.of(TinkerTags.Items.CROSSBOWS), 4, upgradeFolder, upgradeSalvage);
hasteRecipes(consumer, ModifierIds.quickCharge, ingredientFromTags(TinkerTags.Items.CROSSBOWS, TinkerTags.Items.STAFFS), 4, upgradeFolder, upgradeSalvage);
IncrementalModifierRecipeBuilder.modifier(ModifierIds.trueshot)
.setInput(Items.TARGET, 1, 10)
.setSlots(SlotType.UPGRADE, 1)
Expand All @@ -527,7 +527,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.addInput(TinkerWorld.slime.get(SlimeType.SKY))
.setMaxLevel(5) // vanilla caps at 2, that is boring
.setSlots(SlotType.UPGRADE, 1)
.setTools(TinkerTags.Items.RANGED)
.setTools(TinkerTags.Items.BOWS) // TODO: switch to ranged when spitting is implemented
.saveSalvage(consumer, prefix(TinkerModifiers.punch, upgradeSalvage))
.save(consumer, prefix(TinkerModifiers.punch, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.impaling)
Expand Down Expand Up @@ -620,7 +620,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.saveSalvage(consumer, prefix(TinkerModifiers.sinistral, upgradeSalvage))
.save(consumer, prefix(TinkerModifiers.sinistral, upgradeFolder));
ModifierRecipeBuilder.modifier(TinkerModifiers.scope)
.setTools(TinkerTags.Items.LONGBOWS)
.setTools(ingredientFromTags(TinkerTags.Items.LONGBOWS, TinkerTags.Items.STAFFS))
.addInput(Tags.Items.STRING)
.addInput(Items.SPYGLASS)
.addInput(Tags.Items.STRING)
Expand Down Expand Up @@ -1076,7 +1076,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.save(consumer, prefix(ModifierIds.gilded, abilityFolder));
// luck is 3 recipes
// level 1 always requires a slot
Ingredient luckSupporting = ingredientFromTags(TinkerTags.Items.MELEE, TinkerTags.Items.HARVEST, TinkerTags.Items.RANGED);
Ingredient luckSupporting = ingredientFromTags(TinkerTags.Items.MELEE, TinkerTags.Items.HARVEST, TinkerTags.Items.BOWS);
ModifierRecipeBuilder.modifier(ModifierIds.luck)
.setTools(luckSupporting)
.addInput(Tags.Items.INGOTS_COPPER)
Expand Down Expand Up @@ -1133,7 +1133,7 @@ private void addModifierRecipes(Consumer<FinishedRecipe> consumer) {
.save(consumer, wrap(ModifierIds.luck, abilityFolder, "_crystal"));
// salvage lets you salvage from chestplates
ModifierRecipeBuilder.modifier(ModifierIds.luck)
.setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_UNARMED, TinkerTags.Items.HARVEST, TinkerTags.Items.RANGED))
.setTools(ingredientFromTags(TinkerTags.Items.MELEE_OR_UNARMED, TinkerTags.Items.HARVEST, TinkerTags.Items.BOWS))
.setSalvageLevelRange(1, 1)
.setSlots(SlotType.ABILITY, 1)
.saveSalvage(consumer, prefix(ModifierIds.luck, abilitySalvage));
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/assets/tconstruct/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2499,8 +2499,8 @@

"_comment": "Stats",

"tool_stat.tconstruct.attack_speed": "Attack Speed: ",
"tool_stat.tconstruct.attack_speed.description": "Base value for attack speed calculations.\nRoughly full strength attacks per second.",
"tool_stat.tconstruct.attack_speed": "Melee Speed: ",
"tool_stat.tconstruct.attack_speed.description": "Base value for melee attack speed calculations.\nRoughly is number of full strength attacks per second.",
"tool_stat.tconstruct.durability": "Durability: ",
"tool_stat.tconstruct.durability.description": "The base-value for durability calculations.\nUsually an integral part to the overall durability of a tool.",
"tool_stat.tconstruct.use_item_speed": "Use Item Speed: ",
Expand All @@ -2509,9 +2509,9 @@
"stat.tconstruct.head": "Head",
"tool_stat.tconstruct.mining_speed": "Mining Speed: ",
"tool_stat.tconstruct.mining_speed.description": "How fast a tool with a tool head of this material can mine blocks.\nMay be influenced by other toolparts.",
"tool_stat.tconstruct.harvest_tier": "Harvest Tier: ",
"tool_stat.tconstruct.harvest_tier": "Mining Tier: ",
"tool_stat.tconstruct.harvest_tier.description": "What range of blocks a tool with a tool head of this material can mine.",
"tool_stat.tconstruct.attack_damage": "Attack Damage: ",
"tool_stat.tconstruct.attack_damage": "Melee Damage: ",
"tool_stat.tconstruct.attack_damage.description": "Base value for melee attack calculations.\nThe end result depends on the tool itself and the other components used.",

"tool_stat.tconstruct.armor": "Armor: ",
Expand All @@ -2535,8 +2535,8 @@
"tool_stat.tconstruct.velocity.description": "Determines how quickly arrows fly after firing. Faster arrows deal more damage.",
"tool_stat.tconstruct.accuracy": "Accuracy: ",
"tool_stat.tconstruct.accuracy.description": "Determines how close the bow aims towards the center.",
"tool_stat.tconstruct.projectile_damage": "Proj. Damage: ",
"tool_stat.tconsturct.projectile_damage.description": "Determines the base damage of projectiles fired by this weapon.",
"tool_stat.tconstruct.projectile_damage": "Proj. Power: ",
"tool_stat.tconsturct.projectile_damage.description": "Determines the base damage or strength of projectiles fired by this weapon.",

"stat.tconstruct.extra": "Binding",
"stat.tconstruct.bowstring": "Bowstring",
Expand Down

0 comments on commit f98d351

Please sign in to comment.