Skip to content

Commit

Permalink
RolemasterUnified Official: Fix knockback bug and creature weapons
Browse files Browse the repository at this point in the history
Handle a lot more creature weapons, espcially the fan favourite
short sword.
  • Loading branch information
nashidau committed Nov 26, 2024
1 parent 00f87de commit f3da1e5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
28 changes: 20 additions & 8 deletions RolemasterUnified_Official/rolemasterunified.html
Original file line number Diff line number Diff line change
Expand Up @@ -5355,7 +5355,7 @@ <h3>Custom Spell List</h3>

<br>

Revision 624786d99fedd96187dc1c0bd0628ea8183cb488
Revision f33a0056e3c9290689d2e3d6124d8e7cb5c4c3e4


<hr>
Expand Down Expand Up @@ -14159,16 +14159,17 @@ <h3>Custom Spell List</h3>
fa: "Falchion",
ma: "Mace",
cu: "Club",
lc: { "Club", size: 1 },
sb: "Bow, Short",
lb: "Bow, Long",
ss: { table: "Arming Sword", size: -1 },
ls: { table: "Arming Sword", size: 1 },
fa: "Falchion",



/*
Short Sword ss
Longsword ls
Falchion fa
Two-handed Sword ts
Club cu
Two-handed Club tc
Shield sh
Quarterstaff qs
Expand Down Expand Up @@ -14314,13 +14315,22 @@ <h3>Custom Spell List</h3>

if (weaponcodes[type]) {
console.log("Look up", weaponcodes[type]);
getCompendiumPage(`AttackTable:${weaponcodes[type]}`, cdata => {
const wc = weaponcodes[type];
let table;
let sizemod = 0;
if (typeof(wc == 'string')) {
table = wc;
} else {
table = wc.table;
table = wc.sizemod;
}
getCompendiumPage(`AttackTable:${table}`, cdata => {
let nu = {};
// FIXME: Handle errors in size slookup gracefully.
nu[`${prefix}_attackname`] = creature.getLongSize(size) + " " + weaponcodes[type];
nu[`${prefix}_attacksize`] = size;
nu[`${prefix}_attacksize`] = size + wc.sizemod;
nu[`${prefix}_attackbasefumble`] = 1; // FIXMEitems.attackaddfumble;
nu[`${prefix}_attacktable`] = weaponcodes[type];
nu[`${prefix}_attacktable`] = table;
nu[`${prefix}_attackstr`] = 100;
nu[`${prefix}_attacksource`] = 'creature';
nu[`${prefix}_attackskill`] = ob;
Expand Down Expand Up @@ -14503,6 +14513,8 @@ <h3>Custom Spell List</h3>
} else {
// Sometimes negatives has '( )' around them
value = value.replace(/[)(]/g, "");
// Knockback may have a foot marker (single quote)
value = value.replace(/(\d+)'/g, "$1");
istr += `${istrfield}${Math.abs(value)}`;
}
}
Expand Down
2 changes: 1 addition & 1 deletion RolemasterUnified_Official/sheet.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"legacy": false,
"printable": true,
"compendium": "RMU",
"version": "1731991330"
"version": "1732601216"
}
6 changes: 6 additions & 0 deletions RolemasterUnified_Official/updates.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2024-11-26

- Handle the knockback results when they have a ' in them.
- Handle short swords and a few other weapons for creatures.


# 2024-11-19

- Stats are now right aligned.
Expand Down

0 comments on commit f3da1e5

Please sign in to comment.