mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
@@ -52,8 +52,6 @@ export default class GOnHookManager extends Singleton{
|
||||
|
||||
//需要捕捉的宠物
|
||||
onHookCatchPets:TB.TbGRole[] = [];
|
||||
//需要主动吞噬的宠物 (主动吞噬其他 0星 宠物 升星)
|
||||
onHookEngulfPets:PlayerPetOV[] = [];
|
||||
|
||||
//是否挂机
|
||||
_isOnHook:boolean = false;
|
||||
@@ -93,21 +91,6 @@ export default class GOnHookManager extends Singleton{
|
||||
await this.onSellCreeps(pet)
|
||||
}
|
||||
}
|
||||
|
||||
//自动吞噬
|
||||
for (const item of this.onHookEngulfPets) {
|
||||
|
||||
//获取可吞噬的宠物 ( 等级0, 同类宠物, 不是自己, 不在阵法中)
|
||||
let engulfs = PlayerPetData.getIns().getData()
|
||||
.filter(value => (value.petStar || 0) == 0 && item.petTbId == value.petTbId && item.petId != value.petId && PlayerTacticalData.getIns().getItemIndex(value.petId) != -1)
|
||||
.map(value => value.petId);
|
||||
|
||||
//吞噬
|
||||
if(engulfs.length){
|
||||
await API.PetUpStar(item.petId,engulfs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}).bind(this))
|
||||
|
||||
@@ -161,14 +144,7 @@ export default class GOnHookManager extends Singleton{
|
||||
//通知添加野怪被删除
|
||||
app.event.emit(GOnHookManagerEvent.DEL_KILL_SREEP,creeps);
|
||||
|
||||
let pet:PlayerPetOV = await GAPI.GOnHookCatchCreeps(creeps.key);
|
||||
|
||||
//保存宠物
|
||||
if(pet){
|
||||
PlayerPetData.getIns().addPet(pet);
|
||||
}
|
||||
|
||||
return !!pet;
|
||||
return !!await GAPI.GOnHookCatchCreeps(creeps.key);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user