增加时间处理
This commit is contained in:
parent
a0c87cd98f
commit
e099d7e6cf
@ -18,6 +18,8 @@ export class BattleHandler {
|
||||
private _players: Map<Player, PlayerHandler> = new Map();
|
||||
|
||||
_room: Room;
|
||||
private _cardusing: boolean;
|
||||
private _sktime: number;
|
||||
|
||||
public init(cs: CardGameState, room: Room){
|
||||
this._cs = cs;
|
||||
@ -187,6 +189,18 @@ export class BattleHandler {
|
||||
return lst;
|
||||
};
|
||||
|
||||
public beginUseCard(){
|
||||
this._cardusing = true;
|
||||
this._sktime = 0;
|
||||
};
|
||||
|
||||
public endUseCard(){
|
||||
this._cardusing = false;
|
||||
};
|
||||
|
||||
public isUsingCard(){
|
||||
return this._cardusing;
|
||||
};
|
||||
//--------------------对外接口(外部调用)----------------------------
|
||||
/**
|
||||
* 使用卡片
|
||||
@ -209,6 +223,8 @@ export class BattleHandler {
|
||||
return 0;
|
||||
}
|
||||
|
||||
this.beginUseCard();
|
||||
|
||||
let pt = obj.cardpoint;
|
||||
|
||||
let cfg = CfgMan.findEffCardCfg(obj.card);
|
||||
@ -222,7 +238,9 @@ export class BattleHandler {
|
||||
|
||||
this.onUseCardEnd(ps);
|
||||
|
||||
return 0;
|
||||
this.endUseCard();
|
||||
|
||||
return this._sktime;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -342,7 +360,7 @@ export class BattleHandler {
|
||||
};
|
||||
|
||||
public onUpdatePetNotify(apet: PetHandler){
|
||||
return this._room.updatePet([apet.exportInfo()])
|
||||
return this._room.updatePet([apet.exportInfo()]);
|
||||
};
|
||||
|
||||
public onPlayerAddCardNotify(aplayer: PlayerHandler, count: number, maxcount: number, from?: PlayerHandler){
|
||||
@ -365,11 +383,18 @@ export class BattleHandler {
|
||||
difflst.push(item);
|
||||
}
|
||||
});
|
||||
let skid = '';
|
||||
let tm = 0;
|
||||
difflst.forEach((item: SkillTarget) =>{
|
||||
tm += item.getLastTime();
|
||||
skid += item.srcskillid + '|';
|
||||
});
|
||||
//todo:
|
||||
|
||||
if(this.isUsingCard()){
|
||||
this._sktime += tm;
|
||||
}else{
|
||||
this._room.addScheduleTime(tm*1000, skid);
|
||||
}
|
||||
this._room.bMsgQueue(lst);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user