[BUG] Gambling Tinker's Construct Trait does not work as expected
HartleyAHartley opened this issue ยท 0 comments
Before reporting, make sure your problem isn't caused by the game running out of RAM and you have read the installation guide carefully.
If the game crashes to your desktop without showing a crash screen it's a RAM issue. Don't submit this kind of issue. Please view the installation guide for how to solve this issue.
If this is not the case check the checkbox below by replacing the space between brackets with an 'x'.
- Yes, I'm sure this problem isn't because my game ran out of RAM.
Describe the bug
gambleTrait.calcDamage = function(trait, tool, attacker, target, originalDamage, newDamage, isCritical) {
var dmg = newDamage;
var rand as double = Math.random();
if (rand < 0.15) {
dmg = newDamage * 2 as float;
} else if (rand < 0.45) {
dmg = newDamage * 2 as float;
}
return dmg;
};
Instead of rand < 0.45 being newDamage * 1/2 it is newDamage * 2.
So you have a 45% chance of 2 doubling and 55% of no change
This is unexpected as the tinker's description is:
Pray to RNGesus! There's a chance to reduce 50% of damage, and a lower chance to get 2x of the damage... depends on RNG!
To Reproduce
Steps to reproduce the behavior:
- Go to this line
Expected behavior
35% 2x
15% 1/2x
55% 1x
Screenshots
N/A
Crash reports or logs
N/A
Details
Please fill out the blanks below:
Modpack Version: ( 1.35.2 )
Did you add or remove mods? ( N/A )
Did you edit any config or script? ( N/A )
Using shaders? [Write 'Default' if you are using default shader, if you are not using the default shader please write the name of the shader you are using.] ( N/A )
Singleplayer, LAN game or server pack? ( N/A )