Merge branch 'master' of git.kingsome.cn:node/card_svr

This commit is contained in:
zhl 2021-03-24 17:49:35 +08:00
commit 63ce9d2e0e
6 changed files with 27 additions and 7 deletions

View File

@ -1 +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":"1"},{"id":99006,"type_id":1,"value":"20"},{"id":99007,"type_id":1,"value":"12"},{"id":99008,"type_id":2,"value":"12"},{"id":99009,"type_id":2,"value":"15"},{"id":99010,"type_id":2,"value":"15"},{"id":99011,"type_id":2,"value":"20"},{"id":99012,"type_id":2,"value":"8"},{"id":99013,"type_id":1,"value":"3"},{"id":99014,"type_id":2,"value":"5"},{"id":99015,"type_id":1,"value":"10"},{"id":99016,"type_id":1,"value":"10"},{"id":99017,"type_id":2,"value":"7"},{"id":99018,"type_id":2,"value":"7"},{"id":99019,"type_id":2,"value":"5"},{"id":99020,"type_id":2,"value":"30"},{"id":99021,"type_id":3,"value":"15"},{"id":99022,"type_id":3,"value":"35"},{"id":99023,"type_id":1,"value":"2"},{"id":99024,"type_id":1,"value":"3"},{"id":99025,"type_id":1,"value":"3"},{"id":99026,"type_id":2,"value":"1"},{"id":99027,"type_id":1,"value":"5"},{"id":99028,"type_id":1,"value":"5"},{"id":99029,"type_id":1,"value":"5"},{"id":99030,"type_id":1,"value":"5"},{"id":99031,"type_id":4,"value":"90001"},{"id":99032,"type_id":4,"value":"90002"},{"id":99033,"type_id":2,"value":"15"},{"id":99034,"type_id":4,"value":"80031"},{"id":99035,"type_id":4,"value":"80029"},{"id":99036,"type_id":4,"value":"80030"},{"id":99037,"type_id":4,"value":"80032"},{"id":99038,"type_id":1,"value":"20"},{"id":99039,"type_id":5,"value":"0"},{"id":99040,"type_id":5,"value":"0"},{"id":99041,"type_id":3,"value":"50"},{"id":99042,"type_id":3,"value":"0"},{"id":99043,"type_id":3,"value":"45"},{"id":99044,"type_id":3,"value":"60"},{"id":99045,"type_id":3,"value":"75"},{"id":99046,"type_id":3,"value":"0"},{"id":99047,"type_id":3,"value":"12"},{"id":99048,"type_id":3,"value":"24"},{"id":99049,"type_id":3,"value":"36"},{"id":99050,"type_id":4,"value":"130001:130019"},{"id":99051,"type_id":4,"value":"130021:130058"},{"id":99052,"type_id":4,"value":"130060:130099"},{"id":99053,"type_id":3,"value":"80"},{"id":99054,"type_id":3,"value":"60"},{"id":99055,"type_id":3,"value":"40"},{"id":99056,"type_id":3,"value":"20"},{"id":99057,"type_id":3,"value":"39"},{"id":99058,"type_id":3,"value":"26"},{"id":99059,"type_id":3,"value":"13"},{"id":99060,"type_id":3,"value":"0"},{"id":99061,"type_id":1,"value":"1"},{"id":99062,"type_id":1,"value":"1"},{"id":99063,"type_id":1,"value":"1"},{"id":99064,"type_id":1,"value":"1"},{"id":99065,"type_id":4,"value":"99050:99051"}]
[{"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":"1"},{"id":99006,"type_id":1,"value":"20"},{"id":99007,"type_id":1,"value":"12"},{"id":99008,"type_id":2,"value":"12"},{"id":99009,"type_id":2,"value":"15"},{"id":99010,"type_id":2,"value":"15"},{"id":99011,"type_id":2,"value":"20"},{"id":99012,"type_id":2,"value":"8"},{"id":99013,"type_id":1,"value":"3"},{"id":99014,"type_id":2,"value":"5"},{"id":99015,"type_id":1,"value":"10"},{"id":99016,"type_id":1,"value":"10"},{"id":99017,"type_id":2,"value":"7"},{"id":99018,"type_id":2,"value":"7"},{"id":99019,"type_id":2,"value":"5"},{"id":99020,"type_id":2,"value":"30"},{"id":99021,"type_id":3,"value":"15"},{"id":99022,"type_id":3,"value":"35"},{"id":99023,"type_id":1,"value":"2"},{"id":99024,"type_id":1,"value":"3"},{"id":99025,"type_id":1,"value":"3"},{"id":99026,"type_id":2,"value":"1"},{"id":99027,"type_id":1,"value":"5"},{"id":99028,"type_id":1,"value":"5"},{"id":99029,"type_id":1,"value":"5"},{"id":99030,"type_id":1,"value":"5"},{"id":99031,"type_id":4,"value":"90001"},{"id":99032,"type_id":4,"value":"90002"},{"id":99033,"type_id":2,"value":"15"},{"id":99034,"type_id":4,"value":"80031"},{"id":99035,"type_id":4,"value":"80029"},{"id":99036,"type_id":4,"value":"80030"},{"id":99037,"type_id":4,"value":"80032"},{"id":99038,"type_id":1,"value":"20"},{"id":99039,"type_id":5,"value":"0"},{"id":99040,"type_id":5,"value":"0"},{"id":99041,"type_id":3,"value":"50"},{"id":99042,"type_id":3,"value":"0"},{"id":99043,"type_id":3,"value":"45"},{"id":99044,"type_id":3,"value":"60"},{"id":99045,"type_id":3,"value":"75"},{"id":99046,"type_id":3,"value":"0"},{"id":99047,"type_id":3,"value":"12"},{"id":99048,"type_id":3,"value":"24"},{"id":99049,"type_id":3,"value":"36"},{"id":99050,"type_id":4,"value":"130001:130019"},{"id":99051,"type_id":4,"value":"130021:130058"},{"id":99052,"type_id":4,"value":"130060:130099"},{"id":99053,"type_id":3,"value":"80"},{"id":99054,"type_id":3,"value":"60"},{"id":99055,"type_id":3,"value":"40"},{"id":99056,"type_id":3,"value":"20"},{"id":99057,"type_id":3,"value":"30"},{"id":99058,"type_id":3,"value":"20"},{"id":99059,"type_id":3,"value":"10"},{"id":99060,"type_id":3,"value":"0"},{"id":99061,"type_id":1,"value":"1"},{"id":99062,"type_id":1,"value":"1"},{"id":99063,"type_id":1,"value":"1"},{"id":99064,"type_id":1,"value":"1"},{"id":99065,"type_id":4,"value":"99050:99051"}]

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@ import { PetHandler } from "./PetHandler";
import { SKillEffectData, SkillInfoMsg } from "message/SkillInfo";
import { PetInfo } from "message/PetInfo";
import arrUtil from "../../../utils/array.util";
import { debugRoom } from "../../../common/Debug";
import { debugRoom, error } from "../../../common/Debug";
import { RemovePetMsg } from "message/RemovePetMsg";
@ -692,6 +692,7 @@ export class BattleHandler {
oldpos?: number})
:number{
if(!obj || !obj.card){
error(`[useCard]not card!`);
return 0;
}
@ -702,6 +703,7 @@ export class BattleHandler {
let dstpt = dstph? dstph.getPet(obj.dstpet): null;
if(!ph){
error(`[useCard]not player!${obj.srcplayer.id}`);
return 0;
}

View File

@ -612,12 +612,21 @@ export class PetHandler {
return n;
};
public checkSkills(tgtype: TriggerType, tgtv: PlayerHandler, sp: SkillParam, cb?: any){
public checkSkills(tgtype: TriggerType, tgtv: PlayerHandler, sp: SkillParam, cb?: any, soleskills?: Map<number, any>){
if(this._isSilent){
return;
}
this._waitskills.forEach((item: Skill) => {
item.checkTrigger(tgtype, tgtv, sp, cb);
let bfind = false;
if(soleskills){
bfind = !!soleskills.get(item._id);
}
if(!bfind){
let bok = !!item.checkTrigger(tgtype, tgtv, sp, cb);
if(bok && item.isSoleSkill() && soleskills){
soleskills.set(item._id, item);
}
}
});
};

View File

@ -13,6 +13,7 @@ import { Card } from "rooms/schema/Card";
import arrUtil from "utils/array.util";
import { SKillEffectData } from "message/SkillInfo";
import { GameEnv } from "../../../cfg/GameEnv";
import { error } from "../../../common/Debug";
export class PlayerHandler {
public _player: Player;
@ -208,6 +209,7 @@ export class PlayerHandler {
{
let cfg = CfgMan.findEffCardCfg(obj.cardid);
if(!cfg){
error(`[useCard]not config!${obj.cardid}`);
return false;
}
@ -232,6 +234,7 @@ export class PlayerHandler {
let pet = this.newPet();
if(!pet){
error(`[useCard]not empty pet!${obj.cardid}|${oldpos}`);
return false;
}
obj.srcpet = pet;
@ -812,6 +815,8 @@ export class PlayerHandler {
sp = new SkillParam(0, 0, 0, this, this._self, null, null);
}
let soleskills: Map<number, Skill> = new Map();
let reslst: SkillTarget[] = [];
this._self && (this._self != expet) && this._self.checkSkills(tgttype, tgtvalue, sp, (skill: Skill, ap: SkillParam, res: SkillTarget[])=>{
if(res){
@ -821,7 +826,7 @@ export class PlayerHandler {
st.LoadParam(sp);
reslst.push(st);
}
});
}, soleskills);
this._pets.forEach((item: PetHandler) => {
if(!item.isAlive()){
@ -839,7 +844,7 @@ export class PlayerHandler {
st.LoadParam(sp);
reslst.push(st);
}
});
}, soleskills);
});
this._owner.onSkillResult(reslst);

View File

@ -129,6 +129,10 @@ export class Skill {
return this._data.effect_typeid == SkillEffectType.SKILL_GET;
};
isSoleSkill(){
return this._data.repeatedeffect == 1;
};
isSingleTarget(){
switch(this._data.rangeid){
case SkillRangeUnitType.ALL: