mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-01-19 04:19:30 +08:00
部分成就的完成
This commit is contained in:
parent
2ea95671a5
commit
d47c18105d
@ -52,7 +52,14 @@ main.floors.MT17=
|
||||
]
|
||||
}
|
||||
},
|
||||
"afterBattle": {},
|
||||
"afterBattle": {
|
||||
"12,6": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nif (core.status.hero.hp - flags.hphphp >= 150000) {\n\tcore.completeAchievement('normal', 1);\n\tdelete flags.hphphp;\n}\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"afterGetItem": {},
|
||||
"afterOpenDoor": {},
|
||||
"autoEvent": {},
|
||||
@ -94,7 +101,15 @@ main.floors.MT17=
|
||||
"fgmap": [
|
||||
|
||||
],
|
||||
"beforeBattle": {},
|
||||
"beforeBattle": {
|
||||
"12,6": [
|
||||
{
|
||||
"type": "setValue",
|
||||
"name": "flag:hphphp",
|
||||
"value": "core.status.hero.hp"
|
||||
}
|
||||
]
|
||||
},
|
||||
"bg2map": [
|
||||
|
||||
],
|
||||
|
@ -120,7 +120,14 @@ main.floors.MT6=
|
||||
]
|
||||
}
|
||||
},
|
||||
"afterBattle": {},
|
||||
"afterBattle": {
|
||||
"4,12": [
|
||||
{
|
||||
"type": "function",
|
||||
"function": "function(){\nif (core.status.hero.hp === 1) {\n\tcore.completeAchievement('normal', 0);\n}\n}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"afterGetItem": {
|
||||
"4,4": [
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { Animation, sleep, TimingFn } from 'mutate-animate';
|
||||
import { completeAchievement } from '../ui/achievement';
|
||||
import { has } from '../utils';
|
||||
import { ChaseCameraData, ChasePath, getChaseDataByIndex } from './data';
|
||||
|
||||
@ -30,6 +31,8 @@ export class Chase {
|
||||
*/
|
||||
showPath: boolean = false;
|
||||
|
||||
endFn?: () => void;
|
||||
|
||||
/**
|
||||
* 开始一个追逐战
|
||||
* @param index 追逐战索引
|
||||
@ -203,6 +206,14 @@ export class Chase {
|
||||
this.showPath = show;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当追逐战结束后执行函数
|
||||
* @param fn 执行的函数
|
||||
*/
|
||||
onEnd(fn: () => void) {
|
||||
this.endFn = fn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束这个追逐战
|
||||
*/
|
||||
@ -215,6 +226,7 @@ export class Chase {
|
||||
delete flags.chaseIndex;
|
||||
flags.__lockViewport__ = false;
|
||||
core.deleteCanvas('chasePath');
|
||||
if (this.endFn) this.endFn();
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,10 +235,20 @@ export async function startChase(index: number) {
|
||||
flags.chaseIndex = index;
|
||||
flags.onChase = true;
|
||||
await sleep(20);
|
||||
flags.chase = new Chase(
|
||||
const chase = new Chase(
|
||||
data.path,
|
||||
data.fns,
|
||||
data.camera,
|
||||
flags.chaseHard === 0
|
||||
);
|
||||
flags.chase = chase;
|
||||
|
||||
// 成就
|
||||
chase.onEnd(() => {
|
||||
if (flags.chaseHard === 1) {
|
||||
if (index === 1) {
|
||||
completeAchievement('challenge', 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user