mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-03-29 21:27:57 +08:00
add event grade
This commit is contained in:
@@ -44,12 +44,12 @@ class Event {
|
||||
}
|
||||
|
||||
do(eventId, property) {
|
||||
const { effect, branch, event: description, postEvent } = this.get(eventId);
|
||||
const { effect, branch, event: description, postEvent, grade } = this.get(eventId);
|
||||
if(branch)
|
||||
for(const [cond, next] of branch)
|
||||
if(checkCondition(property, cond))
|
||||
return { effect, next, description };
|
||||
return { effect, postEvent, description };
|
||||
return { effect, next, description, grade };
|
||||
return { effect, postEvent, description, grade };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -142,13 +142,14 @@ class Life {
|
||||
}
|
||||
|
||||
doEvent(eventId) {
|
||||
const { effect, next, description, postEvent } = this.#event.do(eventId, this.#property);
|
||||
const { effect, next, description, postEvent, grade } = this.#event.do(eventId, this.#property);
|
||||
this.#property.change(this.PropertyTypes.EVT, eventId);
|
||||
this.#property.effect(effect);
|
||||
const content = {
|
||||
type: this.PropertyTypes.EVT,
|
||||
description,
|
||||
postEvent,
|
||||
grade,
|
||||
}
|
||||
if(next) return [content, this.doEvent(next)].flat();
|
||||
return [content];
|
||||
|
||||
Reference in New Issue
Block a user