Skip to content

Commit

Permalink
Implement basic stat bow modifiers
Browse files Browse the repository at this point in the history
Includes bamboo's trait, quickcharge, trueshot, blindshot, power, diamond, emerald, netherite
Includes projectile damage as a new (hidden) stat, may consider showing it later
  • Loading branch information
KnightMiner committed Dec 16, 2022
1 parent 1f13cd2 commit e6f1719
Show file tree
Hide file tree
Showing 28 changed files with 350 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"modifier": "tconstruct:power",
"min_level": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"modifier": "tconstruct:quick_charge",
"min_level": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:modifier_salvage",
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"modifier": "tconstruct:trueshot",
"min_level": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "tconstruct:incremental_modifier",
"input": {
"item": "minecraft:dirt"
},
"amount_per_item": 1,
"needed_per_level": 10,
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"result": {
"name": "tconstruct:blindshot",
"level": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"type": "forge:conditional",
"recipes": [
{
"conditions": [
{
"prop": "ichor_geodes",
"type": "tconstruct:config"
}
],
"recipe": {
"type": "tconstruct:incremental_modifier",
"input": {
"item": "tconstruct:ichor_slime_crystal"
},
"amount_per_item": 1,
"needed_per_level": 72,
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"result": {
"name": "tconstruct:power",
"level": 1
},
"max_level": 5
}
},
{
"conditions": [
{
"type": "forge:true"
}
],
"recipe": {
"type": "tconstruct:incremental_modifier",
"input": {
"item": "tconstruct:ichor_slime_dirt"
},
"amount_per_item": 1,
"needed_per_level": 36,
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"result": {
"name": "tconstruct:power",
"level": 1
},
"max_level": 5
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"type": "tconstruct:incremental_modifier",
"input": {
"tag": "forge:storage_blocks/redstone"
},
"amount_per_item": 9,
"needed_per_level": 45,
"leftover": "minecraft:redstone",
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"result": {
"name": "tconstruct:quick_charge",
"level": 1
},
"max_level": 4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "tconstruct:incremental_modifier",
"input": {
"tag": "forge:dusts/redstone"
},
"amount_per_item": 1,
"needed_per_level": 45,
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"result": {
"name": "tconstruct:quick_charge",
"level": 1
},
"max_level": 4
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "tconstruct:incremental_modifier",
"input": {
"item": "minecraft:target"
},
"amount_per_item": 1,
"needed_per_level": 10,
"tools": {
"tag": "tconstruct:modifiable/ranged"
},
"slots": {
"upgrades": 1
},
"result": {
"name": "tconstruct:trueshot",
"level": 1
},
"max_level": 3
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:stat_boost",
"level_display": "tconstruct:default",
"stats": [
{
"stat": "tconstruct:accuracy",
"type": "add",
"value": -0.1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
{
"stat": "tconstruct:harvest_tier",
"value": "minecraft:diamond"
},
{
"stat": "tconstruct:projectile_damage",
"type": "add",
"value": 0.5
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"type": "multiply_base",
"value": 0.5
},
{
"stat": "tconstruct:knockback_resistance",
"type": "add",
"value": 0.05
},
{
"stat": "tconstruct:attack_damage",
"type": "multiply_conditional",
Expand All @@ -23,9 +28,9 @@
"value": "minecraft:iron"
},
{
"stat": "tconstruct:knockback_resistance",
"stat": "tconstruct:accuracy",
"type": "add",
"value": 0.05
"value": 0.1
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "tconstruct:stat_boost",
"level_display": "tconstruct:default",
"stats": [
{
"stat": "tconstruct:velocity",
"type": "multiply_base",
"value": 0.1
},
{
"stat": "tconstruct:projectile_damage",
"type": "multiply_all",
"value": -0.1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
{
"stat": "tconstruct:harvest_tier",
"value": "minecraft:netherite"
},
{
"stat": "tconstruct:velocity",
"type": "multiply_base",
"value": 0.1
}
],
"flags": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:stat_boost",
"level_display": "tconstruct:default",
"stats": [
{
"stat": "tconstruct:projectile_damage",
"type": "add",
"value": 0.5
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:stat_boost",
"level_display": "tconstruct:default",
"stats": [
{
"stat": "tconstruct:draw_speed",
"type": "multiply_base",
"value": 0.25
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "tconstruct:stat_boost",
"level_display": "tconstruct:default",
"stats": [
{
"stat": "tconstruct:accuracy",
"type": "add",
"value": 0.1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public class ToolStats {
public static final FloatToolStat VELOCITY = register(new FloatToolStat(name("velocity"), 0xFF78A0CD, 1, 0, 1024f, TinkerTags.Items.RANGED));
/** Starting velocity of the projectile launched from a ranged weapon */
public static final FloatToolStat ACCURACY = register(new FloatToolStat(name("accuracy"), 0xFF8547CC, 0.75f, 0.1f, 1f, TinkerTags.Items.RANGED));

/** Base damage of the projectile, boosted by enchantments such as power. Assumes the arrow itself does 2 damage, so we boost on top of that */
public static final FloatToolStat PROJECTILE_DAMAGE = register(new FloatToolStat(name("projectile_damage"), 0xFFD76464, 2f, 0f, 1024f, TinkerTags.Items.RANGED));


/**
* Gets the tool stat for the given name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ public class ModifierIds {
public static final ModifierId killager = id("killager");
public static final ModifierId cooling = id("cooling");

// ranged
public static final ModifierId power = id("power");
public static final ModifierId quickCharge = id("quick_charge");
public static final ModifierId trueshot = id("trueshot");
public static final ModifierId blindshot = id("blindshot");

// armor
public static final ModifierId wings = id("wings");
public static final ModifierId knockbackResistance = id("knockback_resistance");
Expand All @@ -61,6 +67,7 @@ public class ModifierIds {

// traits - tier 1
public static final ModifierId stringy = id("stringy");
public static final ModifierId flexible = id("flexible");
// traits - tier 2
public static final ModifierId sturdy = id("sturdy");
public static final ModifierId scorching = id("scorching");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ protected void addModifiers() {
.display(ModifierLevelDisplay.SINGLE_LEVEL)
.rarity(Rarity.UNCOMMON)
.multiplyBase(ToolStats.DURABILITY, 0.5f)
// armor
.add(ToolStats.KNOCKBACK_RESISTANCE, 0.05f)
// melee harvest
.multiplyConditional(ToolStats.ATTACK_DAMAGE, 0.25f)
.multiplyConditional(ToolStats.MINING_SPEED, 0.25f)
.update(ToolStats.HARVEST_TIER, Tiers.IRON)
.add(ToolStats.KNOCKBACK_RESISTANCE, 0.05f)
// ranged
.add(ToolStats.ACCURACY, 0.1f)
.build());
// diamond
addModifier(ModifierIds.diamond, StatBoostModifier.builder()
Expand All @@ -88,21 +92,28 @@ protected void addModifiers() {
// armor grants less durability boost
.add(ToolStats.DURABILITY, -250, ARMOR)
.add(ToolStats.ARMOR, 1)
// melee harvest
.add(ToolStats.ATTACK_DAMAGE, 0.5f)
.add(ToolStats.MINING_SPEED, 2)
.update(ToolStats.HARVEST_TIER, Tiers.DIAMOND)
// ranged
.add(ToolStats.PROJECTILE_DAMAGE, 0.5f)
.build());
// netherite
addModifier(ModifierIds.netherite, StatBoostModifier.builder()
.display(ModifierLevelDisplay.SINGLE_LEVEL)
.rarity(Rarity.RARE)
.addFlag(IModifiable.INDESTRUCTIBLE_ENTITY)
.multiplyBase(ToolStats.DURABILITY, 0.2f)
// armor
.add(ToolStats.ARMOR_TOUGHNESS, 1)
.add(ToolStats.KNOCKBACK_RESISTANCE, 0.05f)
// melee harvest
.multiplyBase(ToolStats.ATTACK_DAMAGE, 0.2f)
.multiplyBase(ToolStats.MINING_SPEED, 0.25f)
.update(ToolStats.HARVEST_TIER, Tiers.NETHERITE)
// ranged
.multiplyBase(ToolStats.VELOCITY, 0.1f)
.build());

// general
Expand Down Expand Up @@ -141,6 +152,12 @@ protected void addModifiers() {
// harvest
addModifier(TinkerModifiers.haste, StatBoostModifier.builder().add(ToolStats.MINING_SPEED, 4f).display(new UniqueForLevels(5)).build());

// ranged
addModifier(ModifierIds.power, StatBoostModifier.builder().add(ToolStats.PROJECTILE_DAMAGE, 0.5f).build());
addModifier(ModifierIds.quickCharge, StatBoostModifier.builder().multiplyBase(ToolStats.DRAW_SPEED, 0.25f).build());
addModifier(ModifierIds.trueshot, StatBoostModifier.builder().add(ToolStats.ACCURACY, 0.1f).build());
addModifier(ModifierIds.blindshot, StatBoostModifier.builder().add(ToolStats.ACCURACY, -0.1f).build());

// armor
addModifier(TinkerModifiers.golden, StatBoostModifier.builder().addFlag(ModifiableArmorItem.PIGLIN_NEUTRAL).display(ModifierLevelDisplay.NO_LEVELS).build());
addModifier(ModifierIds.wings, StatBoostModifier.builder().addFlag(ModifiableArmorItem.ELYTRA).build());
Expand All @@ -164,6 +181,7 @@ protected void addModifiers() {

// traits - tier 1
addModifier(ModifierIds.stringy, new Modifier());
addModifier(ModifierIds.flexible, StatBoostModifier.builder().multiplyBase(ToolStats.VELOCITY, 0.1f).multiplyAll(ToolStats.PROJECTILE_DAMAGE, -0.1f).build());
// traits - tier 2
addModifier(ModifierIds.sturdy, StatBoostModifier.builder().multiplyBase(ToolStats.DURABILITY, 0.15f).build());
addModifier(ModifierIds.scorching, new ConditionalDamageModifier(LivingEntityPredicate.ON_FIRE, 2f));
Expand Down

0 comments on commit e6f1719

Please sign in to comment.