提交锻造系统

This commit is contained in:
PC-20230316NUNE\Administrator
2024-01-08 18:55:00 +08:00
parent e737a09828
commit e8a1cb9362
39 changed files with 9319 additions and 2035 deletions

View File

@@ -1,6 +1,7 @@
import { app } from "../App";
import { API, PlayerTacticalOV } from "../consts/API";
import BaseData from "./BaseData";
import PlayerPetData from "./PlayerPetData";
export enum PlayerTacticalEvent{
//更新上阵信息
@@ -31,7 +32,7 @@ export default class PlayerTacticalData extends BaseData{
}
this.info = {
...ov,
roles: JSON.parse(ov.tacticalData),
roles: JSON.parse(ov.tacticalData).map(id => PlayerPetData.getIns().petIdQueryPetInfo(id) ? id : 0),
}
//通知阵法信息已更新
@@ -56,6 +57,7 @@ export default class PlayerTacticalData extends BaseData{
//修改指定位置的上阵 上阵下标,上阵的宠物Id
async UpdateIndexTactical(index:number,petId:number){
this.info.roles = this.info.roles.map(id => petId == id ? 0 : id);
this.info.roles[index] = petId;
await this.UpdateTactical(this.info.roles);
}
@@ -65,6 +67,11 @@ export default class PlayerTacticalData extends BaseData{
return this.info.roles[index];
}
//获取宠物的阵法下标
getItemIndex(roleId:number){
return this.info.roles.indexOf(roleId);
}
//获取初始化上阵信息
getInitTacticalInfo():number[]{
return [0,0,0,0,0,0,0,0,0]