导表+完善连牌逻辑

This commit is contained in:
yuexin 2021-03-03 15:29:52 +08:00
parent 186434cb85
commit 901886725b
3 changed files with 27 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -29,14 +29,15 @@ export class PlayerHandler {
public _friend: PlayerHandler;
public _cardstate: CondType = CondType.NO_COND;
public _cardlinkfrom: PlayerHandler = null;
public _isdied: boolean = false;
_totalcc: number = 0;
private _totalcc: number = 0;
private _totalem: number = 0;
private _cardstate: CondType = CondType.NO_COND;
private _cardlinkfrom: PlayerHandler = null;
private _cardlinkcards: Card[] = null;
public init(aplayer: Player, owner: BattleHandler){
this._owner = owner;
@ -696,6 +697,23 @@ export class PlayerHandler {
return obj? obj.getEffValue(): 0;
};
public isLinkCard(ct: CondType): boolean{
let bok = false;
switch(ct){
case CondType.CARD_ACTION_LINK_OTHER:
case CondType.CARD_ACTION_LINK_SELF:
bok = this._cardstate == ct;
break;
case CondType.CARD_ACTION_LINK:
bok = this._cardstate == CondType.CARD_ACTION_LINK_OTHER ||
this._cardstate == CondType.CARD_ACTION_LINK_SELF;
break;
default:
break;
}
return bok && this._cardlinkcards && this._cardlinkcards.length > 1;
};
onCardLinkReady(fromplayer: PlayerHandler){
this.checkSkills(TriggerType.CARD_LINK_BEFORE);
};
@ -703,6 +721,7 @@ export class PlayerHandler {
onCardLinkEnd(linkcards: Card[], fromplayer: PlayerHandler){
this._cardstate = fromplayer? CondType.CARD_ACTION_LINK_OTHER: CondType.CARD_ACTION_LINK_SELF;
this._cardlinkfrom = fromplayer;
this._cardlinkcards = linkcards;
this.checkSkills(TriggerType.CARD_LINK_AFTER, fromplayer);
};
@ -735,6 +754,7 @@ export class PlayerHandler {
this.onCardChanged(this._cardlinkfrom);
this._cardstate = CondType.NO_COND; // 重置状态
this._cardlinkfrom = null;
this._cardlinkcards = null;
};
onRoundStart(){
@ -745,6 +765,7 @@ export class PlayerHandler {
this.checkSkills(TriggerType.ROUND_END_MYSELF);
this._cardstate = CondType.NO_COND; // 重置状态
this._cardlinkfrom = null;
this._cardlinkcards = null;
};
onGameStart(){

View File

@ -36,10 +36,8 @@ export class Condition {
return this._isok(v,this._v,this._cdt);
case CondType.CARD_ACTION_LINK_OTHER:
case CondType.CARD_ACTION_LINK_SELF:
return tg_owner._cardstate == this._type;
case CondType.CARD_ACTION_LINK:
return tg_owner._cardstate == CondType.CARD_ACTION_LINK_OTHER ||
tg_owner._cardstate == CondType.CARD_ACTION_LINK_SELF;
return tg_owner.isLinkCard(this._type);
case CondType.SELF:
return tg_value? tg_value == tg_owner: true;
case CondType.FRIEND: