Skip to content

Commit

Permalink
Implement crossbows having more velocity via tool stats
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Dec 23, 2022
1 parent dc31859 commit 8d08023
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"base": {
"tconstruct:attack_damage": 0.0,
"tconstruct:attack_speed": 1.0,
"tconstruct:velocity": 1.05,
"tconstruct:draw_speed": 0.8
},
"multipliers": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ TinkerTags.Blocks.TREE_LOGS, new TreeAOEIterator(0, 0),
// stats
.stat(ToolStats.ATTACK_DAMAGE, 0f)
.stat(ToolStats.ATTACK_SPEED, 1.0f)
.stat(ToolStats.DRAW_SPEED, 0.8f)
.stat(ToolStats.VELOCITY, 1.05f) // vanilla has a 3.15 multiplier on crossbows, but 3 on bows. Works out to a 5% difference
.stat(ToolStats.DRAW_SPEED, 0.8f) // vanilla has a 25 second time for crossbows, 20 seconds for bows. Works out to 80%
.multiplier(ToolStats.DURABILITY, 2f)
.smallToolStartingSlots();
define(ToolDefinitions.LONGBOW)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public InteractionResultHolder<ItemStack> use(Level level, Player player, Intera
if (ammo.is(Items.FIREWORK_ROCKET)) {
// TODO: don't hardcode fireworks, perhaps use a map or a JSON behavior list
projectile = new FireworkRocketEntity(level, ammo, player, player.getX(), player.getY() - 0.15f, player.getZ(), true);
speed = 1.6f;
speed = 1.5f;
damage += 3;
} else {
ArrowItem arrowItem = ammo.getItem() instanceof ArrowItem a ? a : (ArrowItem)Items.ARROW;
Expand All @@ -139,7 +139,7 @@ public InteractionResultHolder<ItemStack> use(Level level, Player player, Intera
arrow.setCritArrow(true);
arrow.setSoundEvent(SoundEvents.CROSSBOW_HIT);
arrow.setShotFromCrossbow(true);
speed = 3.15f;
speed = 3f;
damage += 1;

// vanilla arrows have a base damage of 2, cancel that out then add in our base damage to account for custom arrows with higher base damage
Expand Down

0 comments on commit 8d08023

Please sign in to comment.