-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move many character properties to the common folder
- Loading branch information
1 parent
80672f5
commit 6bbc394
Showing
12 changed files
with
126 additions
and
84 deletions.
There are no files selected for viewing
11 changes: 10 additions & 1 deletion
11
src/main/typescript/data/actor/character/leveling/properties.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/main/typescript/data/actor/common/skills/properties.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import { | ||
CONSTANTS, | ||
SkillName, | ||
ThaumaturgySpecial | ||
} from "../../../../constants.js"; | ||
import { CompositeNumber } from "../../../common.js"; | ||
import type SpecialsProperties from "../specials/properties.js"; | ||
|
||
export default class SkillsProperties | ||
implements Record<SkillName, CompositeNumber> | ||
{ | ||
/** The Barter skill of the character */ | ||
barter = new CompositeNumber(); | ||
|
||
/** The Diplomacy skill of the character */ | ||
diplomacy = new CompositeNumber(); | ||
|
||
/** The Explosives skill of the character */ | ||
explosives = new CompositeNumber(); | ||
|
||
/** The Firearms skill of the character */ | ||
firearms = new CompositeNumber(); | ||
|
||
/** The Intimidation skill of the character */ | ||
intimidation = new CompositeNumber(); | ||
|
||
/** The Lockpick skill of the character */ | ||
lockpick = new CompositeNumber(); | ||
|
||
/** The Magical Energy Weapons skill of the character */ | ||
magicalEnergyWeapons = new CompositeNumber(); | ||
|
||
/** The Mechanics skill of the character */ | ||
mechanics = new CompositeNumber(); | ||
|
||
/** The Medicine skill of the character */ | ||
medicine = new CompositeNumber(); | ||
|
||
/** The Melee skill of the character */ | ||
melee = new CompositeNumber(); | ||
|
||
/** The Science skill of the character */ | ||
science = new CompositeNumber(); | ||
|
||
/** The Sleight skill of the character */ | ||
sleight = new CompositeNumber(); | ||
|
||
/** The Sneak skill of the character */ | ||
sneak = new CompositeNumber(); | ||
|
||
/** The Survival skill of the character */ | ||
survival = new CompositeNumber(); | ||
|
||
/** The Thaumaturgy skill of the character */ | ||
thaumaturgy = new CompositeNumber(); | ||
|
||
/** The Unarmed skill of the character */ | ||
unarmed = new CompositeNumber(); | ||
|
||
/** Set the base values and skill points for all skills. */ | ||
setBaseValues( | ||
specials: SpecialsProperties, | ||
thaumSpecial: ThaumaturgySpecial, | ||
skillInfo: SkillInfo | ||
) { | ||
let skill: SkillName; | ||
for (skill in CONSTANTS.skillSpecials) { | ||
this[skill] = this.computeBaseSkill( | ||
skill, | ||
specials, | ||
thaumSpecial, | ||
skillInfo | ||
); | ||
} | ||
this["thaumaturgy"] = this.computeBaseSkill( | ||
"thaumaturgy", | ||
specials, | ||
thaumSpecial, | ||
skillInfo | ||
); | ||
} | ||
|
||
protected computeBaseSkill( | ||
skill: SkillName, | ||
_specials: SpecialsProperties, | ||
_thaumSpecial: ThaumaturgySpecial, | ||
skillInfo: SkillInfo | ||
): CompositeNumber { | ||
const baseSkill = 0; | ||
const composite = new CompositeNumber(baseSkill, { min: 0, max: 85 }); | ||
composite.add({ | ||
value: skillInfo.getValue(skill), | ||
labelComponents: [{ key: "wv.rules.skills.points.short" }] | ||
}); | ||
return composite; | ||
} | ||
} | ||
|
||
export interface SkillInfo { | ||
getValue(skill: SkillName): number; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import type { TYPES } from "../../../constants.js"; | ||
import VitalsSource from "../common/vitals/source.js"; | ||
|
||
export default interface NpcDataSource { | ||
type: typeof TYPES.ACTOR.NPC; | ||
data: NpcDataSourceData; | ||
} | ||
|
||
export class NpcDataSourceData {} | ||
export class NpcDataSourceData { | ||
/** The vitals of the NPC */ | ||
vitals = new VitalsSource(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/typescript/ruleEngine/ruleElements/permSpecialComponent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/typescript/ruleEngine/ruleElements/tempSpecialComponent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters