2025-04-23 09:34:08 +08:00

47 lines
971 B
TypeScript

import MapMgr from "../core/MapMgr";
export default class JInChan {
nNpc: number;
nOnlyID: number;
vecApply: [];
mapid: number;
pos: any;
// 金蟾等级
level: number;
// 1 金蟾、2 金蟾boss
type: number;
constructor(npcid: number, mapid: number, level: number, type: number) {
this.nNpc = npcid;
this.nOnlyID = 0;
this.vecApply = [];
this.mapid = mapid;
this.pos = {
x: 0,
y: 0
};
this.level = level;
this.type = type;
}
Reset() {
this.vecApply = [];
}
getCurPos(): any {
return this.pos;
}
GetPos() {
// let vecTmp = this.strPos.split(",");
let mapModel = MapMgr.shared.getMapById(this.mapid);
let pos = mapModel.getARandomPos();
this.pos = {
map: this.mapid,
x: pos.x,
y: pos.y
};
return this.pos;
}
}