光环逻辑优化
This commit is contained in:
parent
19b212ced8
commit
3430eab7f2
@ -280,56 +280,37 @@ export class PlayerHandler {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public onHaloAdd(apet: PetHandler, only_checkother: boolean = false){
|
public onHaloAdd(apet: PetHandler, only_checkother: boolean = false){
|
||||||
let bkself = this._self._effhalos.length;
|
|
||||||
let bkpets: number[] = [];
|
|
||||||
|
|
||||||
let lst: PetHandler[] = [];
|
let lst: PetHandler[] = [];
|
||||||
if(only_checkother){
|
if(only_checkother){
|
||||||
this._pets.forEach((obj: PetHandler)=>{
|
this._pets.forEach((obj: PetHandler)=>{
|
||||||
if(apet.checkHalo(obj)){
|
if(apet.addEffHalo(obj)){
|
||||||
lst.push(obj);
|
lst.push(obj);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(this._self != apet){
|
if(this._self != apet){
|
||||||
if(apet.checkHalo(this._self)){
|
if(apet.addEffHalo(this._self)){
|
||||||
lst.push(this._self);
|
lst.push(this._self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
this._self.clearEffHalos();
|
apet.addEffHalo(apet);
|
||||||
this._pets.forEach((obj:PetHandler)=>{
|
|
||||||
bkpets.push(obj._effhalos.length);
|
|
||||||
obj.clearEffHalos();
|
|
||||||
});
|
|
||||||
|
|
||||||
apet.checkHalo(apet);
|
|
||||||
|
|
||||||
this._pets.forEach((obj: PetHandler)=>{
|
this._pets.forEach((obj: PetHandler)=>{
|
||||||
if(obj != apet){
|
if(obj != apet){
|
||||||
obj.checkHalo(apet);
|
obj.addEffHalo(apet);
|
||||||
apet.checkHalo(obj);
|
if(apet.addEffHalo(obj)){
|
||||||
|
lst.push(obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(this._self != apet){
|
if(this._self != apet){
|
||||||
this._self.checkHalo(apet);
|
this._self.addEffHalo(apet);
|
||||||
apet.checkHalo(this._self);
|
if(apet.addEffHalo(this._self)){
|
||||||
}
|
|
||||||
|
|
||||||
if(bkself != this._self._effhalos.length){
|
|
||||||
if(this._self != apet){
|
|
||||||
lst.push(this._self);
|
lst.push(this._self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let i = 0; i < bkpets.length; i++){
|
|
||||||
let bk = bkpets[i];
|
|
||||||
let obj = this._pets[i];
|
|
||||||
if(obj != apet && obj._effhalos.length != bk){
|
|
||||||
lst.push(obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._owner.onUpdatePetsNotify(lst);
|
this._owner.onUpdatePetsNotify(lst);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user