New source found from dndbeyond.com
This commit is contained in:
@@ -8,15 +8,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
import { orderBy } from 'lodash';
|
||||
import { AbilityAccessors } from "../engine/Ability";
|
||||
import { FeatureFlagEnum } from "../engine/FeatureFlagInfo";
|
||||
import { characterSelectors, featureFlagInfoSelectors, rulesEngineSelectors } from "../selectors";
|
||||
import { rulesEngineSelectors } from "../selectors";
|
||||
import { getAbilityManager } from './AbilityManager';
|
||||
import { FeatureFlagManager } from './FeatureFlagManager';
|
||||
// import { BlessingManager, getBlessingManager } from './FeatureManager';
|
||||
import { FeaturesManager } from './FeaturesManager';
|
||||
import { transformAbilityScores } from './utils/modifierTransformers';
|
||||
export class AttributesManager extends FeaturesManager {
|
||||
import { BaseManager } from './BaseManager';
|
||||
export class AttributesManager extends BaseManager {
|
||||
constructor(params) {
|
||||
super(params);
|
||||
this.getHighestAbilityScore = (abilities) => {
|
||||
@@ -28,31 +23,9 @@ export class AttributesManager extends FeaturesManager {
|
||||
getAbilities() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const abilities = rulesEngineSelectors.getAbilities(this.state);
|
||||
const featureFlagsManager = new FeatureFlagManager(featureFlagInfoSelectors.getFeatureFlagInfo(this.state));
|
||||
const hasAccessToBlessing = featureFlagsManager.getFlag(FeatureFlagEnum.RELEASE_GATE_GFS_BLESSINGS_UI);
|
||||
if (!hasAccessToBlessing) {
|
||||
return abilities.map((ability) => {
|
||||
return getAbilityManager(Object.assign(Object.assign({}, this.params), { ability }));
|
||||
});
|
||||
}
|
||||
else {
|
||||
// TODO: GFS this is all the wrong place
|
||||
// it should just be
|
||||
// const abilities = getCharacter.abilities ...
|
||||
const validGlobalModifiers = this.getValidGlobalModifiers();
|
||||
const baseStats = characterSelectors.getStats(this.state);
|
||||
const ruleData = rulesEngineSelectors.getRuleData(this.state);
|
||||
const { generatedFeature } = transformAbilityScores(validGlobalModifiers, baseStats, ruleData);
|
||||
// TODO: GFS THERE IS SOME MORE TO DO HERE
|
||||
const characterFeatureManagers = yield this.getCharacterFeatures();
|
||||
// TODO: GFS this should be part of the process and I should just ask for the the object here.
|
||||
const myAbilityState = this.processCharacter(generatedFeature);
|
||||
return abilities.map((ability) => {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const name = (_b = (_a = AbilityAccessors.getLabel(ability)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : 'The ability with no name';
|
||||
return getAbilityManager(Object.assign(Object.assign({}, this.params), { ability: Object.assign(Object.assign({}, ability), { maxStatScore: (_c = myAbilityState.attributes[name].max) !== null && _c !== void 0 ? _c : null, modifier: (_d = myAbilityState.attributes[name].modifier) !== null && _d !== void 0 ? _d : null, score: (_e = myAbilityState.attributes[name].value) !== null && _e !== void 0 ? _e : null, totalScore: (_f = myAbilityState.attributes[name].value) !== null && _f !== void 0 ? _f : null }) }));
|
||||
});
|
||||
}
|
||||
return abilities.map((ability) => {
|
||||
return getAbilityManager(Object.assign(Object.assign({}, this.params), { ability }));
|
||||
});
|
||||
});
|
||||
}
|
||||
getAbilitiesWithoutBlessings() {
|
||||
|
||||
Reference in New Issue
Block a user