导表+新字段逻辑添加
This commit is contained in:
parent
89315451a0
commit
2a0d3371d4
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
[{"id":30012,"herounit_id":52012,"ex_skill":0,"follower1id":51072,"follower2id":51082,"follower3id":51032,"follower4id":51052},{"id":30022,"herounit_id":52022,"ex_skill":0,"follower1id":51062,"follower2id":51142,"follower3id":51032,"follower4id":51072},{"id":30032,"herounit_id":52032,"ex_skill":0,"follower1id":51062,"follower2id":51052,"follower3id":51072,"follower4id":51022},{"id":30042,"herounit_id":52042,"ex_skill":0,"follower1id":51062,"follower2id":51122,"follower3id":51112,"follower4id":51042},{"id":30052,"herounit_id":52052,"ex_skill":0,"follower1id":51132,"follower2id":51082,"follower3id":51032,"follower4id":51112},{"id":30062,"herounit_id":52062,"ex_skill":0,"follower1id":51122,"follower2id":51132,"follower3id":51112,"follower4id":51042},{"id":30072,"herounit_id":52072,"ex_skill":0,"follower1id":51012,"follower2id":51082,"follower3id":51032,"follower4id":51022},{"id":30082,"herounit_id":52082,"ex_skill":0,"follower1id":51062,"follower2id":51112,"follower3id":51142,"follower4id":51052},{"id":30092,"herounit_id":52092,"ex_skill":0,"follower1id":51072,"follower2id":51102,"follower3id":51052,"follower4id":51062},{"id":30102,"herounit_id":52102,"ex_skill":0,"follower1id":51112,"follower2id":51092,"follower3id":51082,"follower4id":51022}]
|
||||
[{"id":30012,"herounit_id":52012,"ex_skill":0,"follower1id":51072,"follower2id":51082,"follower3id":51032,"follower4id":51052},{"id":30022,"herounit_id":52022,"ex_skill":0,"follower1id":51372,"follower2id":51162,"follower3id":51382,"follower4id":51332},{"id":30032,"herounit_id":52032,"ex_skill":0,"follower1id":51352,"follower2id":51042,"follower3id":51142,"follower4id":51062},{"id":30042,"herounit_id":52042,"ex_skill":0,"follower1id":51062,"follower2id":51122,"follower3id":51112,"follower4id":51042},{"id":30052,"herounit_id":52052,"ex_skill":0,"follower1id":51132,"follower2id":51082,"follower3id":51402,"follower4id":51112},{"id":30062,"herounit_id":52062,"ex_skill":0,"follower1id":51222,"follower2id":51272,"follower3id":51412,"follower4id":51042},{"id":30072,"herounit_id":52072,"ex_skill":0,"follower1id":51012,"follower2id":51082,"follower3id":51402,"follower4id":51152},{"id":30082,"herounit_id":52082,"ex_skill":0,"follower1id":51062,"follower2id":51272,"follower3id":51072,"follower4id":51052},{"id":30092,"herounit_id":52092,"ex_skill":0,"follower1id":51102,"follower2id":51372,"follower3id":51232,"follower4id":51292},{"id":30102,"herounit_id":52102,"ex_skill":0,"follower1id":51022,"follower2id":51092,"follower3id":51192,"follower4id":51392}]
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -34,6 +34,10 @@ export class SkillCfg implements Cfg{
|
||||
public quoteskill_times: number;
|
||||
public quoteskill_timesmax: number;
|
||||
public skill_usersid: number;
|
||||
public quoteskill2id: number;
|
||||
public quoteskill2_times: number;
|
||||
public quoteskill2_timesmax: number;
|
||||
public skill2_usersid: number;
|
||||
public quotecardid: number;
|
||||
public quotecard_times: number;
|
||||
public quotecard_timesmax: number;
|
||||
@ -41,6 +45,10 @@ export class SkillCfg implements Cfg{
|
||||
public getskill_times: number;
|
||||
public getskill_timesmax: number;
|
||||
public skill_ownersid: number;
|
||||
public getskill2id: number;
|
||||
public getskill2_times: number;
|
||||
public getskill2_timesmax: number;
|
||||
public skill2_ownersid: number;
|
||||
|
||||
public decode(data: any) {
|
||||
this.id = data.id;
|
||||
@ -74,6 +82,10 @@ export class SkillCfg implements Cfg{
|
||||
this.quoteskill_times = data.quoteskill_times;
|
||||
this.quoteskill_timesmax = data.quoteskill_timesmax;
|
||||
this.skill_usersid = data.skill_usersid;
|
||||
this.quoteskill2id = data.quoteskill2id;
|
||||
this.quoteskill2_times = data.quoteskill2_times;
|
||||
this.quoteskill2_timesmax = data.quoteskill2_timesmax;
|
||||
this.skill2_usersid = data.skill2_usersid;
|
||||
this.quotecardid = data.quotecardid;
|
||||
this.quotecard_times = data.quotecard_times;
|
||||
this.quotecard_timesmax = data.quotecard_timesmax;
|
||||
@ -81,6 +93,10 @@ export class SkillCfg implements Cfg{
|
||||
this.getskill_times = data.getskill_times;
|
||||
this.getskill_timesmax = data.getskill_timesmax;
|
||||
this.skill_ownersid = data.skill_ownersid;
|
||||
this.getskill2id = data.getskill2id;
|
||||
this.getskill2_times = data.getskill2_times;
|
||||
this.getskill2_timesmax = data.getskill2_timesmax;
|
||||
this.skill2_ownersid = data.skill2_ownersid;
|
||||
};
|
||||
|
||||
public isOK (uniqueID: number, param1: any, param2: any): boolean {
|
||||
|
@ -31,6 +31,7 @@ export class Skill {
|
||||
_orign_cardpt: number = 0;
|
||||
|
||||
private _subskill: Skill;
|
||||
private _subskill2: Skill;
|
||||
|
||||
_sender: PetHandler;
|
||||
_petowner: PetHandler;
|
||||
@ -212,10 +213,10 @@ export class Skill {
|
||||
getEffValue(ac?: number, ap?: number, sp?: number): number{
|
||||
let nmin = CfgMan.calcEffctValueEx(EnhanceCustomType.EFF_VALUE, this._data.eff_numtypeid, this._data.num_signid, this._data.eff_num, ap, sp);
|
||||
let nmax = CfgMan.calcEffctValueEx(EnhanceCustomType.EFF_VALUE, this._data.eff_numtypeid, this._data.num_signid, this._data.eff_nummax, ap, sp);
|
||||
return this.getFinalValue(EnhanceCustomType.EFF_VALUE, nmin, nmax, ac, ap, sp);
|
||||
return this.getFinalValue(EnhanceCustomType.EFF_VALUE, nmin, nmax, ac);
|
||||
};
|
||||
|
||||
getFinalValue(vtype:EnhanceCustomType, nmin: number, nmax: number, ac:number, ap: number, sp: number = 0): number{
|
||||
getFinalValue(vtype:EnhanceCustomType, nmin: number, nmax: number, ac:number, needfix: boolean = false): number{
|
||||
let n = 0;
|
||||
if(CfgMan.canEnhanceValue(vtype, this._data.edd_effid)){
|
||||
n = CfgMan.randomEffValue(nmin, nmax, this._data.edd_effid, this._data.eddeffnum_signid,
|
||||
@ -223,6 +224,9 @@ export class Skill {
|
||||
}else{
|
||||
n = CfgMan.roundV(nmin, nmax);
|
||||
}
|
||||
if(needfix && n == 0){
|
||||
n = 1;
|
||||
}
|
||||
return n;
|
||||
};
|
||||
|
||||
@ -259,15 +263,15 @@ export class Skill {
|
||||
}
|
||||
};
|
||||
|
||||
_triggerSubSkill(skillid: number, sk: Skill, param: SkillParam, sts: SkillTarget[], cb?: any){
|
||||
if(skillid && !sk){
|
||||
sk = this._owner.newSkill(this._data.quoteskillid);
|
||||
_triggerSubSkill(sk: Skill, skid: number, skusertype: number, skcount: number, skmaxcount: number, param: SkillParam, sts: SkillTarget[], cb?: any){
|
||||
if(skid && !sk){
|
||||
sk = this._owner.newSkill(skid);
|
||||
sk.setOrignParam(this._orign_effcnt, this._orign_cardpt, this._sender, this._petowner);
|
||||
}
|
||||
if(sk){
|
||||
let pl = [];
|
||||
let bst = false;
|
||||
switch(this._data.skill_usersid){
|
||||
switch(skusertype){
|
||||
case SkillUserType.SRC_HERO:
|
||||
case SkillUserType.SRC_PLAYER:
|
||||
{
|
||||
@ -302,11 +306,8 @@ export class Skill {
|
||||
break;
|
||||
}
|
||||
|
||||
let ncount = this.getFinalValue(EnhanceCustomType.QUOTE_TIMES, this._data.quotecard_times,
|
||||
this._data.quotecard_timesmax, param.edd_cnt, param.cardpoint);
|
||||
if(ncount == 0){
|
||||
ncount = 1;
|
||||
}
|
||||
let ncount = this.getQuoteCount(skcount, skmaxcount, param.edd_cnt);
|
||||
|
||||
for(let i=0; i<ncount;i++){
|
||||
for(let j = 0; j < pl.length; j++){
|
||||
let sp = pl[j];
|
||||
@ -331,15 +332,16 @@ export class Skill {
|
||||
|
||||
this._cb && this._cb(this, param, res);
|
||||
|
||||
this._triggerSubSkill(this._data.quoteskillid, this._subskill, param, res, cb);
|
||||
this._triggerSubSkill(this._subskill, this._data.quoteskillid, this._data.skill_usersid,
|
||||
this._data.quoteskill_times, this._data.quoteskill_timesmax, param, res, cb);
|
||||
|
||||
this._triggerSubSkill(this._subskill2, this._data.quoteskill2id, this._data.skill2_usersid,
|
||||
this._data.quoteskill2_times, this._data.quoteskill2_timesmax, param, res, cb);
|
||||
};
|
||||
|
||||
trigger(param: SkillParam, cb?: any) {
|
||||
let ncount = this.getFinalValue(EnhanceCustomType.RELEASE_TIMES, this._data.release_times,
|
||||
this._data.release_timesmax, param.edd_cnt, param.cardpoint);
|
||||
if(ncount == 0){
|
||||
ncount = 1;
|
||||
}
|
||||
this._data.release_timesmax, param.edd_cnt, true);
|
||||
let sp;
|
||||
if(param.srcpet != this._petowner){
|
||||
sp = param.clone();
|
||||
@ -421,7 +423,9 @@ export class Skill {
|
||||
case SkillEffectType.CARD_GETDIRECT:
|
||||
if(tgt.dsttype == GameUnitType.PLAYER){
|
||||
let cardid = this._data.quotecardid;
|
||||
let n = (tgt.dst as PlayerHandler).addDirectCard(cardid, res, tgt.srcplayer);
|
||||
let ncount = this.getQuoteCount(this._data.quotecard_times, this._data.quotecard_timesmax, this._orign_effcnt);
|
||||
|
||||
let n = (tgt.dst as PlayerHandler).addDirectCard(cardid, ncount, tgt.srcplayer);
|
||||
if(n >= 0){
|
||||
tgt.success(efftype, n);
|
||||
}else{
|
||||
@ -514,15 +518,17 @@ export class Skill {
|
||||
}
|
||||
};
|
||||
|
||||
getQuoteCount(count: number, maxcount: number, effcount: number){
|
||||
return this.getFinalValue(EnhanceCustomType.QUOTE_TIMES, count, maxcount,
|
||||
effcount, true);
|
||||
};
|
||||
|
||||
summon(efftype: SkillEffectType, exparam: SkillParam, tgt: SkillTarget){
|
||||
switch(efftype){
|
||||
case SkillEffectType.SUMMON_NPC:
|
||||
{
|
||||
let ncount = this.getFinalValue(EnhanceCustomType.QUOTE_TIMES, this._data.quoteunit_times, this._data.quoteunit_timesmax,
|
||||
exparam.edd_cnt, exparam.cardpoint);
|
||||
if(ncount == 0){
|
||||
ncount = 1;
|
||||
}
|
||||
let ncount = this.getQuoteCount(this._data.quoteunit_times, this._data.quoteunit_timesmax, exparam.edd_cnt);
|
||||
|
||||
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
||||
let n = obj.summonPet(this._data.quoteunitid, ncount, exparam);
|
||||
if(n >= 0){
|
||||
@ -534,28 +540,24 @@ export class Skill {
|
||||
break;
|
||||
case SkillEffectType.SUMMON_SKILL:
|
||||
{
|
||||
let ncount = this.getFinalValue(EnhanceCustomType.QUOTE_TIMES, this._data.quoteskill_times, this._data.quoteskill_timesmax,
|
||||
exparam.edd_cnt, exparam.cardpoint);
|
||||
if(ncount == 0){
|
||||
ncount = 1;
|
||||
}
|
||||
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
||||
let res = obj.useSkill(this._data.quoteskillid, ncount, exparam);
|
||||
if(res){
|
||||
tgt.success(efftype, res.length);
|
||||
}else{
|
||||
|
||||
let n1 = this.getQuoteCount(this._data.quoteskill_times, this._data.quoteskill_timesmax, exparam.edd_cnt);
|
||||
let r1 = obj.useSkill(this._data.quoteskillid, n1, exparam);
|
||||
|
||||
let n2 = this.getQuoteCount(this._data.quoteskill2_times, this._data.quoteskill2_timesmax, exparam.edd_cnt);
|
||||
let r2 = obj.useSkill(this._data.quoteskill2id, n2, exparam);
|
||||
|
||||
r1 && tgt.success(efftype, this._data.quoteskillid);
|
||||
r2 && tgt.success(efftype, this._data.quoteskill2id);
|
||||
|
||||
if(!r1 && !r2){
|
||||
tgt.fail(efftype, -1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SkillEffectType.SKILL_GET:
|
||||
{
|
||||
let ncount = this.getFinalValue(EnhanceCustomType.GET_TIMES, this._data.getskill_times, this._data.getskill_timesmax,
|
||||
exparam.edd_cnt, exparam.cardpoint);
|
||||
if(ncount == 0){
|
||||
ncount = 1;
|
||||
}
|
||||
let obj;
|
||||
let sender: PetHandler = null;
|
||||
if(this.isBuffHaloSkill()){
|
||||
if(tgt.srcpet){
|
||||
@ -564,25 +566,20 @@ export class Skill {
|
||||
sender = tgt.srcplayer._self;
|
||||
}
|
||||
}
|
||||
switch(this._data.skill_ownersid){
|
||||
case SkillUserType.NONE:
|
||||
obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
||||
break;
|
||||
case SkillUserType.TARGET:
|
||||
obj = tgt.dst;
|
||||
break;
|
||||
case SkillUserType.SRC_HERO:
|
||||
obj = tgt.srcplayer? tgt.srcplayer: tgt.srcpet._owner;
|
||||
break;
|
||||
case SkillUserType.SRC_PLAYER:
|
||||
obj = tgt.srcplayer;
|
||||
break;
|
||||
}
|
||||
|
||||
let n = obj? obj.addSkill(this._data.getskillid, ncount, sender): 0;
|
||||
if(n){
|
||||
tgt.success(efftype, this._data.getskillid);
|
||||
}else{
|
||||
|
||||
let ncount = this.getFinalValue(EnhanceCustomType.GET_TIMES, this._data.getskill_times, this._data.getskill_timesmax,
|
||||
exparam.edd_cnt, true);
|
||||
let obj = tgt.getTarget(this._data.skill_ownersid);
|
||||
let n1 = obj? obj.addSkill(this._data.getskillid, ncount, sender): 0;
|
||||
n1 && tgt.success(efftype, this._data.getskillid);
|
||||
|
||||
ncount = this.getFinalValue(EnhanceCustomType.GET_TIMES, this._data.getskill2_times, this._data.getskill2_timesmax,
|
||||
exparam.edd_cnt, true);
|
||||
obj = tgt.getTarget(this._data.skill2_ownersid);
|
||||
let n2 = obj? obj.addSkill(this._data.getskill2id, ncount, sender): 0;
|
||||
n2 && tgt.success(efftype, this._data.getskill2id);
|
||||
|
||||
if(!n1 && !n2){
|
||||
tgt.fail(efftype, -1);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {PlayerHandler} from "../Handler/PlayerHandler";
|
||||
import {PetHandler} from "../Handler/PetHandler";
|
||||
import { Skill } from "./Skill";
|
||||
import { GameUnitType, SkillEffectType } from "./SkillConst";
|
||||
import { GameUnitType, SkillEffectType, SkillUserType } from "./SkillConst";
|
||||
import { SKillEffectData, SkillInfoData, SkillInfoMsg } from "../../../message/SkillInfo";
|
||||
|
||||
export class SkillParam{
|
||||
@ -121,6 +121,25 @@ export class SkillTarget{
|
||||
return (this.dst as PetHandler)._owner;
|
||||
};
|
||||
|
||||
public getTarget(usertype: SkillUserType): PlayerHandler | PetHandler{
|
||||
let obj;
|
||||
switch(usertype){
|
||||
case SkillUserType.NONE:
|
||||
obj = this.srcpet? this.srcpet: this.srcplayer;
|
||||
break;
|
||||
case SkillUserType.TARGET:
|
||||
obj = this.dst;
|
||||
break;
|
||||
case SkillUserType.SRC_HERO:
|
||||
obj = this.srcplayer? this.srcplayer: this.srcpet._owner;
|
||||
break;
|
||||
case SkillUserType.SRC_PLAYER:
|
||||
obj = this.srcplayer;
|
||||
break;
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
public srcPet(): PetHandler{
|
||||
if(this.srcpet){
|
||||
return this.srcpet;
|
||||
|
Loading…
x
Reference in New Issue
Block a user