更新英雄接口实现
This commit is contained in:
parent
4d61eae54d
commit
c10d466c3b
@ -75,7 +75,11 @@ export class BattleHandler {
|
||||
};
|
||||
|
||||
public updatePlayerHero(aplayer: Player){
|
||||
|
||||
let ph = this.getPlayer(aplayer);
|
||||
if(!ph){
|
||||
return false;
|
||||
}
|
||||
return ph.updateHero();
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
@ -27,8 +27,6 @@ export class PetHandler {
|
||||
|
||||
_waitskills: Skill[] = [];
|
||||
|
||||
_attackskills: Skill[] = [];
|
||||
|
||||
_baseap: number; // 基础
|
||||
|
||||
_basehp: number = 0;
|
||||
@ -75,6 +73,8 @@ export class PetHandler {
|
||||
};
|
||||
|
||||
public loadData(id: number, param: SkillParam, exskillid?: number[], exap?: number){
|
||||
this.clear(true);
|
||||
|
||||
this._id = id || 0;
|
||||
this._cfg = CfgMan.findUnitCfg(this._id);
|
||||
|
||||
|
@ -37,14 +37,6 @@ export class PlayerHandler {
|
||||
public init(aplayer: Player, owner: BattleHandler){
|
||||
this._owner = owner;
|
||||
this._player = aplayer;
|
||||
this._playercfg = CfgMan.findPlayerCfg(this._player.heroId);
|
||||
this._self = new PetHandler();
|
||||
this._self.init(null, this, 0);
|
||||
this._self._isHero = true;
|
||||
let lst = this._playercfg.ex_skill? [this._playercfg.ex_skill]: null;
|
||||
let ps = new SkillParam(0, 0, 0, this, this._self, null, null);
|
||||
this._self.loadData(this._playercfg.herounit_id, ps, lst);
|
||||
this._unitcfg = this._playercfg && CfgMan.findUnitCfg(this._playercfg.herounit_id);
|
||||
};
|
||||
|
||||
public clear(){
|
||||
@ -53,6 +45,22 @@ export class PlayerHandler {
|
||||
});
|
||||
this._self = null;
|
||||
this._pets.length = 0;
|
||||
this._totalcc = 0;
|
||||
this._totalem = 0;
|
||||
this._cardstate = CondType.NO_COND;
|
||||
this._friend = null;
|
||||
};
|
||||
|
||||
public updateHero(){
|
||||
this.clear();
|
||||
this._playercfg = CfgMan.findPlayerCfg(this._player.heroId);
|
||||
this._self = new PetHandler();
|
||||
this._self.init(null, this, 0);
|
||||
this._self._isHero = true;
|
||||
let lst = this._playercfg.ex_skill? [this._playercfg.ex_skill]: null;
|
||||
let ps = new SkillParam(0, 0, 0, this, this._self, null, null);
|
||||
this._self.loadData(this._playercfg.herounit_id, ps, lst);
|
||||
this._unitcfg = this._playercfg && CfgMan.findUnitCfg(this._playercfg.herounit_id);
|
||||
};
|
||||
|
||||
public getCurrCardCount(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user