This commit is contained in:
Vick Scarlet
2021-08-17 17:07:14 +08:00
parent 776bc33de1
commit dd194c899a
20 changed files with 2660 additions and 573 deletions

View File

@@ -15,9 +15,9 @@ class Life {
#triggerTalents;
async initial() {
const age = JSON.parse(await json('data/age.json'));
const talents = JSON.parse(await json('data/talents.json'));
const events = JSON.parse(await json('data/events.json'));
const age = await json('age');
const talents = await json('talents');
const events = await json('events');
this.#property.initial({age});
this.#talent.initial({talents});
@@ -30,6 +30,10 @@ class Life {
this.doTalent();
}
getTalentAllocationAddition(talents) {
return this.#talent.allocationAddition(talents);
}
next() {
const {age, event, talent} = this.#property.ageNext();
@@ -56,7 +60,7 @@ class Life {
contents.push({
type: this.#property.TYPES.TLT,
name,
rate,
grade,
desctiption,
})
if(!result.effect) continue;
@@ -91,6 +95,12 @@ class Life {
return eventId;
return events[events.length-1];
}
talentRandom() {
return this.#talent.talentRandom();
}
}
export default Life;
export default Life;