mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-10-09 08:36:22 +00:00
提交锻造系统
This commit is contained in:
@@ -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]
|
||||
|
Reference in New Issue
Block a user