mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-03-25 08:34:16 +08:00
talent bug fix
This commit is contained in:
@@ -55,17 +55,17 @@ class Life {
|
|||||||
|
|
||||||
const contents = [];
|
const contents = [];
|
||||||
for(const talentId of talents) {
|
for(const talentId of talents) {
|
||||||
const result = this.#talent.do(talentId);
|
const result = this.#talent.do(talentId, this.#property);
|
||||||
if(!result) continue;
|
if(!result) continue;
|
||||||
this.#triggerTalents.add(talentId);
|
this.#triggerTalents.add(talentId);
|
||||||
const { effect, name, desctiption } = result;
|
const { effect, name, desctiption, grade } = result;
|
||||||
contents.push({
|
contents.push({
|
||||||
type: this.#property.TYPES.TLT,
|
type: this.#property.TYPES.TLT,
|
||||||
name,
|
name,
|
||||||
grade,
|
grade,
|
||||||
desctiption,
|
desctiption,
|
||||||
})
|
})
|
||||||
if(!result.effect) continue;
|
if(!effect) continue;
|
||||||
this.#property.effect(effect);
|
this.#property.effect(effect);
|
||||||
}
|
}
|
||||||
return contents;
|
return contents;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { clone } from './functions/util.js';
|
import { clone } from './functions/util.js';
|
||||||
|
import { checkCondition } from './functions/condition.js';
|
||||||
|
|
||||||
class Talent {
|
class Talent {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
||||||
@@ -13,9 +15,9 @@ class Talent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check(talentId) {
|
check(talentId, property) {
|
||||||
const { condition } = this.get(talentId);
|
const { condition } = this.get(talentId);
|
||||||
return checkCondition(condition);
|
return checkCondition(property, condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
get(talentId) {
|
get(talentId) {
|
||||||
@@ -71,10 +73,9 @@ class Talent {
|
|||||||
return Number(this.get(talents).status) || 0;
|
return Number(this.get(talents).status) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
do(talentId) {
|
do(talentId, property) {
|
||||||
const { effect, condition, initiative, grade, name, description } = this.get(talentId);
|
const { effect, condition, grade, name, description } = this.get(talentId);
|
||||||
if(!initiative) return null;
|
if(condition && !checkCondition(property, condition))
|
||||||
if(condition && !checkCondition(condition))
|
|
||||||
return null;
|
return null;
|
||||||
return { effect, grade, name, description };
|
return { effect, grade, name, description };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user