import table

This commit is contained in:
yuexin 2020-12-04 18:13:36 +08:00
parent f32117aa05
commit fe533f72e6
3 changed files with 9 additions and 87 deletions

View File

@ -1,82 +1 @@
[
{
"id": 99001,
"type_id": 1,
"value": 6
},
{
"id": 99002,
"type_id": 1,
"value": 2
},
{
"id": 99003,
"type_id": 2,
"value": 20
},
{
"id": 99004,
"type_id": 1,
"value": 2
},
{
"id": 99005,
"type_id": 1,
"value": 3
},
{
"id": 99006,
"type_id": 1,
"value": 4
},
{
"id": 99007,
"type_id": 1,
"value": 12
},
{
"id": 99008,
"type_id": 2,
"value": 8
},
{
"id": 99009,
"type_id": 2,
"value": 8
},
{
"id": 99010,
"type_id": 2,
"value": 15
},
{
"id": 99011,
"type_id": 2,
"value": 20
},
{
"id": 99012,
"type_id": 2,
"value": 5
},
{
"id": 99013,
"type_id": 1,
"value": 5
},
{
"id": 99014,
"type_id": 2,
"value": 5
},
{
"id": 99015,
"type_id": 1,
"value": 10
},
{
"id": 99016,
"type_id": 1,
"value": 10
}
]
[{"id":99001,"type_id":1,"value":6},{"id":99002,"type_id":1,"value":2},{"id":99003,"type_id":2,"value":20},{"id":99004,"type_id":1,"value":2},{"id":99005,"type_id":1,"value":3},{"id":99006,"type_id":1,"value":4},{"id":99007,"type_id":1,"value":12},{"id":99008,"type_id":2,"value":8},{"id":99009,"type_id":2,"value":8},{"id":99010,"type_id":2,"value":15},{"id":99011,"type_id":2,"value":20},{"id":99012,"type_id":2,"value":5},{"id":99013,"type_id":1,"value":5},{"id":99014,"type_id":2,"value":5},{"id":99015,"type_id":1,"value":10},{"id":99016,"type_id":1,"value":10}]

View File

@ -230,9 +230,11 @@ export class Skill {
}
}
cb && (this._cb = cb);
this._tgctrl.checkTrigger(tg_type, tg_value, this._owner, () => {
this.trigger(tg_target);
});
if(this._tgctrl.checkTrigger(tg_type, tg_value, this._owner)){
return this.trigger(tg_target);
}else{
return null;
}
};
handleCard(efftype: SkillEffectType, effvalue: number, tgt: SkillTarget){

View File

@ -24,14 +24,15 @@ export class TriggerCtrl{
this._cond = condobj;
};
checkTrigger(tg_type: TriggerType, tg_value: any, tg_owner: any, callback: any){
checkTrigger(tg_type: TriggerType, tg_value: any, tg_owner: any, callback?: any): boolean{
if(tg_type == TriggerType.NO_COND){
// callback && callback();
return;
return true;
}
if(this._tg.isOK(tg_type)){
if(this._cond.isOK(tg_value, tg_owner)){
callback && callback();
return true;
}
}
}