mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-12-11 07:19:12 +00:00
提交锻造系统
This commit is contained in:
33
JisolGameCocos/assets/script/data/PetEquipData.ts
Normal file
33
JisolGameCocos/assets/script/data/PetEquipData.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { API, EquipForgingBench, PetEquip } from "../consts/API";
|
||||
import BaseData from "./BaseData";
|
||||
import PlayerPetData from "./PlayerPetData";
|
||||
|
||||
//宠物装备数据类
|
||||
export default class PetEquipData extends BaseData{
|
||||
|
||||
//装备
|
||||
equips:PetEquip[];
|
||||
//锻造台
|
||||
info:EquipForgingBench;
|
||||
|
||||
//锻造台是否有宠物
|
||||
get isForgingBenchPet(){
|
||||
return !!PlayerPetData.getIns().petIdQueryPetInfo(this.info.forgingPetId);
|
||||
}
|
||||
|
||||
async onInit() {
|
||||
this.equips = await API.PetEquipAll();
|
||||
this.info = await API.PetEquipForgingInfo();
|
||||
}
|
||||
|
||||
//锻造
|
||||
async forging(){
|
||||
await API.PetEquipForging();
|
||||
}
|
||||
|
||||
//设置锻造宠
|
||||
async setForgingPetId(petId:number){
|
||||
await API.PetEquipForgingPetId(petId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user