47 lines
966 B
TypeScript
47 lines
966 B
TypeScript
import MapMgr from "../core/MapMgr";
|
|
|
|
export default class WorldStar {
|
|
nNpc: number;
|
|
nOnlyID: number;
|
|
vecApply: [];
|
|
mapid: number;
|
|
pos: any;
|
|
// 星等级
|
|
level: number;
|
|
// 1 地星、2 天星
|
|
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;
|
|
}
|
|
}
|