fix strength for melee weapons
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ const Unit = ({ unit, index, catalog, onePerPage }) => {
|
||||
range: "Melee",
|
||||
damage: "1",
|
||||
type: "Melee",
|
||||
str: "0",
|
||||
str: "+0",
|
||||
ap: "0",
|
||||
});
|
||||
}
|
||||
|
||||
+6
-1
@@ -292,7 +292,12 @@ const getWeaponClassNames = (weapons, index) => {
|
||||
|
||||
const calculateWeaponStrength = (strModel, strWeapon) => {
|
||||
if (strWeapon.startsWith("User")) return strModel;
|
||||
if (strWeapon.startsWith("x"))
|
||||
if (strWeapon.startsWith("x")) {
|
||||
return strModel * parseInt(strWeapon.replace("x", ""));
|
||||
}
|
||||
if (strWeapon.includes("+")) {
|
||||
return strModel + parseInt(strWeapon, 10);
|
||||
}
|
||||
if (!strWeapon) return strModel;
|
||||
return parseInt(strWeapon, 10);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user