Skip to content

Commit

Permalink
Handle blood hunter class name changing to archived
Browse files Browse the repository at this point in the history
Fixes #1122
  • Loading branch information
kakaroto committed May 20, 2024
1 parent 221466e commit 0d808c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/dndbeyond/base/character.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,22 @@ class Character extends CharacterBase {
if (substring) return this._actions.some(f => f.includes(name));
else return this._actions.includes(name);
}
/**
* Blood Hunter was renamed to "Blood Hunter (archived)"
* Try to find the blood h
*/
fixBloodHunterClassName(name) {
if (name !== "Blood Hunter") return name;
const new_name = Object.keys(this._classes).find(c => c.includes("Blood Hunter"));
if (new_name) return new_name;
return "Blood Hunter (archived)";
}
getClassLevel(name) {
name = this.fixBloodHunterClassName(name);
return this._classes[name] || 0;
}
hasClass(name) {
name = this.fixBloodHunterClassName(name);
return this._classes[name] !== undefined;
}
getAbility(abbr) {
Expand Down

0 comments on commit 0d808c5

Please sign in to comment.