导表+逻辑优化
This commit is contained in:
parent
d25a3d8fa7
commit
ec5f15100c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -238,6 +238,7 @@ export class PlayerHandler {
|
|||||||
if(cfg.skill_typeid == SkillType.MAGIC){
|
if(cfg.skill_typeid == SkillType.MAGIC){
|
||||||
for(let i = 0; i < count; i++){
|
for(let i = 0; i < count; i++){
|
||||||
let sk = this.newSkill(skillid);
|
let sk = this.newSkill(skillid);
|
||||||
|
sk.setOrignParam(param.edd_cnt, param.cardpoint, pet, pet);
|
||||||
lst.push(sk);
|
lst.push(sk);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
|
@ -311,13 +311,13 @@ export class Skill {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let ncount = this.getQuoteValue(skcount, skmaxcount, param.edd_cnt);
|
let ncount = this.getQuoteValue(skcount, skmaxcount, this._orign_effcnt);
|
||||||
|
|
||||||
for(let i=0; i<ncount;i++){
|
for(let i=0; i<ncount;i++){
|
||||||
for(let j = 0; j < pl.length; j++){
|
for(let j = 0; j < pl.length; j++){
|
||||||
let sp = pl[j];
|
let sp = pl[j];
|
||||||
let st = bst? sts[j]: null;
|
let st = bst? sts[j]: null;
|
||||||
sk._trigger(sp, cb, st);
|
sk.trigger(sp, cb, st);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,9 +344,9 @@ export class Skill {
|
|||||||
this._data.quoteskill2_times, this._data.quoteskill2_timesmax, param, res, cb);
|
this._data.quoteskill2_times, this._data.quoteskill2_timesmax, param, res, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
trigger(param: SkillParam, cb?: any) {
|
trigger(param: SkillParam, cb?: any, target?: SkillTarget) {
|
||||||
let ncount = this.getFinalValue(EnhanceCustomType.RELEASE_TIMES, this._data.release_times,
|
let ncount = this.getFinalValue(EnhanceCustomType.RELEASE_TIMES, this._data.release_times,
|
||||||
this._data.release_timesmax, param.edd_cnt, true);
|
this._data.release_timesmax, this._orign_effcnt, true);
|
||||||
let sp;
|
let sp;
|
||||||
// if(param.srcpet != this._petowner){
|
// if(param.srcpet != this._petowner){
|
||||||
if(false){
|
if(false){
|
||||||
@ -357,7 +357,7 @@ export class Skill {
|
|||||||
sp = param;
|
sp = param;
|
||||||
}
|
}
|
||||||
for(let i=0; i<ncount;i++){
|
for(let i=0; i<ncount;i++){
|
||||||
this._trigger(sp, cb);
|
this._trigger(sp, cb, target);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -531,11 +531,20 @@ export class Skill {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
summon(efftype: SkillEffectType, exparam: SkillParam, tgt: SkillTarget){
|
summonSkill(skillid: number, count: number, countmax: number, obj: any, sender: PetHandler): SkillTarget[]{
|
||||||
|
if(!obj){
|
||||||
|
return null;
|
||||||
|
}else{
|
||||||
|
let ncount = this.getFinalValue(EnhanceCustomType.GET_TIMES, count, countmax, this._orign_effcnt, true);
|
||||||
|
return obj.useSkillEx(skillid, ncount, sender);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
summon(efftype: SkillEffectType, exparam: SkillParam, tgt: SkillTarget){
|
||||||
switch(efftype){
|
switch(efftype){
|
||||||
case SkillEffectType.SUMMON_NPC:
|
case SkillEffectType.SUMMON_NPC:
|
||||||
{
|
{
|
||||||
let ncount = this.getQuoteValue(this._data.quoteunit_times, this._data.quoteunit_timesmax, exparam.edd_cnt);
|
let ncount = this.getQuoteValue(this._data.quoteunit_times, this._data.quoteunit_timesmax, this._orign_effcnt);
|
||||||
|
|
||||||
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
|
||||||
let n = obj.summonPet(this._data.quoteunitid, ncount, exparam);
|
let n = obj.summonPet(this._data.quoteunitid, ncount, exparam);
|
||||||
@ -554,11 +563,11 @@ export class Skill {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let n1 = this.getQuoteValue(this._data.quoteskill_times, this._data.quoteskill_timesmax, exparam.edd_cnt);
|
let n1 = this.getQuoteValue(this._data.quoteskill_times, this._data.quoteskill_timesmax, this._orign_effcnt);
|
||||||
let r1 = obj.useSkill(this._data.quoteskillid, n1, exparam);
|
let r1 = obj.useSkill(this._data.quoteskillid, n1, exparam);
|
||||||
r1 && tgt.success(efftype, this._data.quoteskillid);
|
r1 && tgt.success(efftype, this._data.quoteskillid);
|
||||||
|
|
||||||
let n2 = this.getQuoteValue(this._data.quoteskill2_times, this._data.quoteskill2_timesmax, exparam.edd_cnt);
|
let n2 = this.getQuoteValue(this._data.quoteskill2_times, this._data.quoteskill2_timesmax, this._orign_effcnt);
|
||||||
let r2 = obj.useSkill(this._data.quoteskill2id, n2, exparam);
|
let r2 = obj.useSkill(this._data.quoteskill2id, n2, exparam);
|
||||||
r2 && tgt.success(efftype, this._data.quoteskill2id);
|
r2 && tgt.success(efftype, this._data.quoteskill2id);
|
||||||
|
|
||||||
@ -582,27 +591,15 @@ export class Skill {
|
|||||||
|
|
||||||
if(this._data.getskillid){
|
if(this._data.getskillid){
|
||||||
let obj = tgt.getTarget(this._data.skill_ownersid);
|
let obj = tgt.getTarget(this._data.skill_ownersid);
|
||||||
if(!obj){
|
let res = this.summonSkill(this._data.getskillid, this._data.getskill_times, this._data.getskill_timesmax, obj, sender);
|
||||||
tgt.fail(efftype, this._data.getskillid);
|
res? tgt.success(efftype, this._data.getskillid): tgt.fail(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 res = obj.useSkillEx(this._data.getskillid, ncount, sender);
|
|
||||||
res? tgt.success(efftype, this._data.getskillid): tgt.fail(efftype, this._data.getskillid);
|
|
||||||
}
|
|
||||||
bres1 = true;
|
bres1 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this._data.getskill2id){
|
if(this._data.getskill2id){
|
||||||
let obj = tgt.getTarget(this._data.skill2_ownersid);
|
let obj = tgt.getTarget(this._data.skill2_ownersid);
|
||||||
if(!obj){
|
let res = this.summonSkill(this._data.getskill2id, this._data.getskill2_times, this._data.getskill2_timesmax, obj, sender);
|
||||||
tgt.fail(efftype, this._data.getskill2id);
|
res? tgt.success(efftype, this._data.getskill2id): tgt.fail(efftype, this._data.getskill2id);
|
||||||
}else{
|
|
||||||
let ncount = this.getFinalValue(EnhanceCustomType.GET_TIMES, this._data.getskill2_times, this._data.getskill2_timesmax,
|
|
||||||
exparam.edd_cnt, true);
|
|
||||||
let res = obj.useSkillEx(this._data.getskill2id, ncount, sender);
|
|
||||||
res? tgt.success(efftype, this._data.getskill2id): tgt.fail(efftype, this._data.getskill2id);
|
|
||||||
}
|
|
||||||
bres2 = true;
|
bres2 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user