CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.65k stars 4.18k forks source link

Rail-Mounted Crossbows Are Not Functional #29941

Open Mrchache opened 5 years ago

Mrchache commented 5 years ago

Describe the bug
Rail-Mounted Crossbows only shoot one tile, regardless of distance aimed. While this can hit an enemy (Crawling Zombie in this test) the result was the ammunition always bouncing off the zombies thick hide and doing no damage. Bolts Used: Aluminum Broadhead Bolt, Simple Wooden Small Game Bolt, Wooden Bodkin Bolt, Wooden Broadhead Bolt, Simple Wooden Bolt, and Makeshift Wooden Bolt.

To Reproduce
Steps to reproduce the behavior:

  1. Make a player with a M4A1 and attach the Rail-Mounted Crossbow to the M4.
  2. Try to aim a distance greater then one square.
  3. The bolt will only travel 1 square.

Also,

  1. Make a player with a M4A1 and attach the Rail-Mounted Crossbow to the M4.
  2. Aim at an adjacent crawling zombie and fire a bolt.
  3. The result is the bolt hitting the target and bouncing off its hide, doing no damage.

Expected behavior
A rail-mounted crossbow on an M4A1 shows that, with a simple wooden bolt, the attachment should fire up to 8 tiles away and a rail-mounted crossbow with an aluminum broadhead arrow should not be defeated by a crawling zombie's armor.

Screenshots
Rail-mounted Crossbow test 1 Rail Mounted Crossbow 2

Versions and configuration(please complete the following information):

Additional context

darktoes commented 5 years ago

Yeah so basically there's this really weird thing in the code set so that if a projectile has 0 damage, it just plonks onto the tile in front of the player rather than acting like a real projectile. Why? Hell if I know. In this case, the rail-mounted crossbow has no assigned damage value (0) and the projectile fired has a multiplicative damage value. This means that the fired projectile has a damage value of 0 * 1.25 = 0. 0 damage, so that weird code thing is in effect. Again, no idea why that's a thing. The repeating crossbow has an identical problem because it also has a base damage of 0.

The fix for this is easy. I just need to assign actual damage values to the repeating crossbow and the rail-mounted crossbow. I'll be doing in that in my next PR so it's no biggie. If anyone else finds any other weapons that use bolts/arrows in the base game that have a 0 damage value and do this, please list them here. I don't think there's any others though.

Mrchache commented 5 years ago

Thanks for taking the time to explain what's going on in the background, I appreciate that. Looking forward to your next PR!

HeadstrongCatgirl commented 5 years ago

Regular bows also do that sometimes, but I can't determine the circumstances under which that happens.

Zireael07 commented 5 years ago

Probably when they're extremely damaged?

darktoes commented 5 years ago

Beat me to it. Some bows have quite a low damage rating. If they're damaged, by being driven over or used as a melee weapon, for example, then their damage will decrease and could easily go down to or below zero.

HeadstrongCatgirl commented 5 years ago

Not necessarily when damaged and it seems to deserve a separate issue.

darktoes commented 5 years ago

If you can find a way to reproduce it reliably, go ahead.

Greevv commented 5 years ago

In addition to the problems already stated, the strange system of multiplying damage sometimes leads to things like metal bolts doing almost no damage, but if I instead use the bone bolts from the more survival tools mod, they do much more damage.

darktoes commented 5 years ago

The damage multiplication system is going to be the new norm, but existing bows and crossbows haven't been modified to suit it yet. The bone bolts from the survival tools mod are probably redundant now that makeshift bolts can be made with bone tips anyway. I recommend not using them or removing them altogether.

Greevv commented 5 years ago

To be honest I use exclusively bone bolts because the rest do abysmal damage.

On Sat, Apr 27, 2019, 11:06 PM darktoes <notifications@github.com wrote:

The damage multiplication system is going to be the new norm, but existing bows and crossbows haven't been modified to suit it yet. The bone bolts from the survival tools mod are probably redundant now that makeshift bolts can be made with bone tips anyway. I recommend not using them or removing them all together.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CleverRaven/Cataclysm-DDA/issues/29941#issuecomment-487337448, or mute the thread https://github.com/notifications/unsubscribe-auth/AIERJQC5KRBOR3MYUIA4P23PSUICHANCNFSM4HISI2PA .