上下限随机处理

This commit is contained in:
yuexin 2020-12-21 19:57:59 +08:00
parent 780dc65929
commit 2720bbd785
13 changed files with 273 additions and 101 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
[{"id":30011,"herounit_id":50011,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51031,"follower3":"狮子王","follower4id":51041,"follower4":"波斯猫"},{"id":30021,"herounit_id":50021,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51061,"follower3":"小火龙","follower4id":51051,"follower4":"偷油鼠"},{"id":30031,"herounit_id":50031,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51031,"follower3":"狮子王","follower4id":51041,"follower4":"波斯猫"},{"id":30041,"herounit_id":50041,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51061,"follower3":"小火龙","follower4id":51051,"follower4":"偷油鼠"},{"id":30051,"herounit_id":50051,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51031,"follower3":"狮子王","follower4id":51041,"follower4":"波斯猫"},{"id":30061,"herounit_id":50061,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51061,"follower3":"小火龙","follower4id":51051,"follower4":"偷油鼠"},{"id":30071,"herounit_id":50071,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51031,"follower3":"狮子王","follower4id":51041,"follower4":"波斯猫"},{"id":30081,"herounit_id":50081,"ex_skill":0,"follower1id":51011,"follower1":"熊战士","follower2id":51021,"follower2":"蛙博士","follower3id":51061,"follower3":"小火龙","follower4id":51051,"follower4":"偷油鼠"}] [{"id":30011,"herounit_id":50011,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51031,"follower4id":51041},{"id":30021,"herounit_id":50021,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51061,"follower4id":51051},{"id":30031,"herounit_id":50031,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51031,"follower4id":51041},{"id":30041,"herounit_id":50041,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51061,"follower4id":51051},{"id":30051,"herounit_id":50051,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51031,"follower4id":51041},{"id":30061,"herounit_id":50061,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51061,"follower4id":51051},{"id":30071,"herounit_id":50071,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51031,"follower4id":51041},{"id":30081,"herounit_id":50081,"ex_skill":0,"follower1id":51011,"follower2id":51021,"follower3id":51061,"follower4id":51051}]

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
[{"id":10001,"type_id":1,"count":16,"point":1,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10011,"type_id":1,"count":16,"point":2,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10021,"type_id":1,"count":16,"point":3,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10031,"type_id":1,"count":16,"point":4,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10041,"type_id":1,"count":16,"point":5,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10051,"type_id":1,"count":16,"point":6,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10061,"type_id":1,"count":16,"point":7,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10071,"type_id":1,"count":16,"point":8,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10081,"type_id":1,"count":16,"point":9,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10091,"type_id":1,"count":16,"point":10,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10101,"type_id":2,"count":16,"point":10,"weight":"10101:100"},{"id":10111,"type_id":3,"count":8,"point":10,"weight":"10111:100"},{"id":10002,"type_id":1,"count":0,"point":0,"weight":""},{"id":10012,"type_id":1,"count":20,"point":1,"weight":""},{"id":10022,"type_id":1,"count":20,"point":2,"weight":""},{"id":10032,"type_id":1,"count":20,"point":3,"weight":""},{"id":10042,"type_id":1,"count":20,"point":4,"weight":""},{"id":10052,"type_id":1,"count":20,"point":5,"weight":""},{"id":10062,"type_id":1,"count":20,"point":6,"weight":""},{"id":10072,"type_id":1,"count":20,"point":7,"weight":""},{"id":10082,"type_id":1,"count":20,"point":8,"weight":""},{"id":10092,"type_id":1,"count":20,"point":9,"weight":""},{"id":10102,"type_id":1,"count":20,"point":10,"weight":""},{"id":10112,"type_id":2,"count":20,"point":10,"weight":""},{"id":10122,"type_id":3,"count":10,"point":10,"weight":""},{"id":10132,"type_id":4,"count":10,"point":10,"weight":""}] [{"id":10001,"type_id":1,"count":16,"point":1,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10011,"type_id":1,"count":16,"point":2,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10021,"type_id":1,"count":16,"point":3,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10031,"type_id":1,"count":16,"point":4,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10041,"type_id":1,"count":16,"point":5,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10051,"type_id":1,"count":16,"point":6,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10061,"type_id":1,"count":16,"point":7,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10071,"type_id":1,"count":16,"point":8,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10081,"type_id":1,"count":16,"point":9,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10091,"type_id":1,"count":16,"point":10,"weight":"20011:10|20021:10|20031:10|20041:10|20051:10|20061:10|20071:10|20081:10"},{"id":10101,"type_id":2,"count":16,"point":10,"weight":"10101:100"},{"id":10111,"type_id":3,"count":8,"point":10,"weight":"10111:100"}]

Binary file not shown.

View File

@ -7,26 +7,18 @@ export class HeroCfg implements Cfg{
public herounit_id: number; public herounit_id: number;
public ex_skill: number; public ex_skill: number;
public follower1id: number; public follower1id: number;
public follower1: number;
public follower2id: number; public follower2id: number;
public follower2: number;
public follower3id: number; public follower3id: number;
public follower3: number;
public follower4id: number; public follower4id: number;
public follower4: number;
public decode(data: any) { public decode(data: any) {
this.id = data.id; this.id = data.id;
this.herounit_id = data.herounit_id; this.herounit_id = data.herounit_id;
this.ex_skill = data.ex_skill; this.ex_skill = data.ex_skill;
this.follower1id = data.follower1id; this.follower1id = data.follower1id;
this.follower1 = data.follower1;
this.follower2id = data.follower2id; this.follower2id = data.follower2id;
this.follower2 = data.follower2;
this.follower3id = data.follower3id; this.follower3id = data.follower3id;
this.follower3 = data.follower3;
this.follower4id = data.follower4id; this.follower4id = data.follower4id;
this.follower4 = data.follower4;
}; };
public isOK (uniqueID: number, param1: any, param2: any): boolean { public isOK (uniqueID: number, param1: any, param2: any): boolean {

View File

@ -32,9 +32,14 @@ export class SkillCfg implements Cfg{
public quoteskillid: number; public quoteskillid: number;
public quoteskill_times: number; public quoteskill_times: number;
public quoteskill_timesmax: number; public quoteskill_timesmax: number;
public skill_users: number;
public quotecardid: number; public quotecardid: number;
public quotecard_times: number; public quotecard_times: number;
public quotecard_timesmax: number; public quotecard_timesmax: number;
public getskillid: number;
public getskill_times: number;
public getskill_timesmax: number;
public skill_owners: number;
public decode(data: any) { public decode(data: any) {
this.id = data.id; this.id = data.id;
@ -66,9 +71,14 @@ export class SkillCfg implements Cfg{
this.quoteskillid = data.quoteskillid; this.quoteskillid = data.quoteskillid;
this.quoteskill_times = data.quoteskill_times; this.quoteskill_times = data.quoteskill_times;
this.quoteskill_timesmax = data.quoteskill_timesmax; this.quoteskill_timesmax = data.quoteskill_timesmax;
this.skill_users = data.skill_users;
this.quotecardid = data.quotecardid; this.quotecardid = data.quotecardid;
this.quotecard_times = data.quotecard_times; this.quotecard_times = data.quotecard_times;
this.quotecard_timesmax = data.quotecard_timesmax; this.quotecard_timesmax = data.quotecard_timesmax;
this.getskillid = data.getskillid;
this.getskill_times = data.getskill_times;
this.getskill_timesmax = data.getskill_timesmax;
this.skill_owners = data.skill_owners;
}; };
public isOK (uniqueID: number, param1: any, param2: any): boolean { public isOK (uniqueID: number, param1: any, param2: any): boolean {

View File

@ -4,7 +4,7 @@ import { SkillCfg } from "cfg/parsers/SkillCfg";
import { UnitCfg } from "cfg/parsers/UnitCfg"; import { UnitCfg } from "cfg/parsers/UnitCfg";
import arrUtil from "../../utils/array.util"; import arrUtil from "../../utils/array.util";
import { BaseConst } from "../../constants/BaseConst"; import { BaseConst } from "../../constants/BaseConst";
import { EffectCardType, EnhanceEffectType, SkillEffectSignType, SkillEffectValueType, SkillTargetType } from "./skill/SkillConst"; import { EffectCardType, EnhanceCalcType, EnhanceEffectType, SkillEffectSignType, SkillEffectValueType, SkillTargetType } from "./skill/SkillConst";
let CfgMan = { let CfgMan = {
/** /**
@ -34,18 +34,18 @@ let CfgMan = {
calcEnhanceValue( calcEnhanceValue(
eT: EnhanceEffectType, eT: EnhanceEffectType,
eV: number, eV: number,
eR: number, eC: number,
aP: number, aP: number,
): number{ ): number{
switch(eT){ switch(eT){
case EnhanceEffectType.EN_POWER_BYAP: case EnhanceEffectType.EN_POWER_BYAP:
case EnhanceEffectType.EN_SKILL_BYAP: case EnhanceEffectType.EN_SKILL_BYAP:
return eV * eR * aP; return eV * eC * aP;
case EnhanceEffectType.EN_POWER_BYCFG: case EnhanceEffectType.EN_POWER_BYCFG:
case EnhanceEffectType.EN_SKILL_BYCFG: case EnhanceEffectType.EN_SKILL_BYCFG:
return eV * eR; return eV * eC;
case EnhanceEffectType.EN_SUBSKILL_BYCFG: case EnhanceEffectType.EN_QCOUNT:
return eR; return eC;
default: default:
return 0; return 0;
} }
@ -62,18 +62,120 @@ let CfgMan = {
switch(eST){ switch(eST){
case SkillEffectSignType.PERCENT: case SkillEffectSignType.PERCENT:
n /= 100; n /= 100;
break;
default: default:
break; break;
} }
switch(eVT){ switch(eVT){
case SkillEffectValueType.RATIO: case SkillEffectValueType.RATIO_AP:
n *= aP; n *= aP;
break;
default: default:
break; break;
} }
return n; return n;
}, },
_calcValue(ev: number, et: SkillEffectSignType){
let n = ev;
switch(et){
case SkillEffectSignType.PERCENT:
n /= 100;
break;
default:
break;
}
return n;
},
calcEffctValueEx(
eVT: SkillEffectValueType,
eST: SkillEffectSignType,
eV: number,
aP: number,
sP: number)
{
let n = this._calcValue(eV, eST);
switch(eVT){
case SkillEffectValueType.RATIO_AP:
n *= aP;
break;
case SkillEffectValueType.RATIO_SP:
n *= sP;
break;
}
return n;
},
randomEffectValue(
vMin: number,
vMax: number,
eET: EnhanceEffectType,
eST: SkillEffectSignType,
eEV: number,
aC: number
): number{
let eV = this._calcValue(eEV, eST);
let nmin = vMin;
let nmax = vMax;
switch(eET){
case EnhanceEffectType.EN_SKILL_BYCFG:
nmin += eV * aC;
break;
case EnhanceEffectType.EN_SKILL_BYAP:
nmin += eV * aC;
break;
case EnhanceEffectType.EN_QCOUNT:
nmin += aC;
break;
case EnhanceEffectType.EN_POWER_BYCFG:
nmin += eV * aC;
nmax = nmin;
break;
case EnhanceEffectType.EN_POWER_BYAP:
nmin += eV * aC;
nmax = nmin;
break;
case EnhanceEffectType.EN_SKILL_RELEASE_MIN:
nmin += aC;
break;
case EnhanceEffectType.EN_SKILL_RELEASE_MAX:
nmax += aC;
break;
case EnhanceEffectType.EN_QCOUNT_MAX:
nmax += aC;
break;
case EnhanceEffectType.EN_SKILL_BYCFG_MAX:
nmax += eV * aC;
break;
case EnhanceEffectType.EN_SKILL_BYCFG_MM:
nmin += eV * aC;
nmax += eV * aC;
break;
case EnhanceEffectType.EN_SKILL_BYAP_MAX:
nmax += eV * aC;
break;
case EnhanceEffectType.EN_SKILL_BYAP_MM:
nmin += eV * aC;
nmax += eV * aC;
break;
case EnhanceEffectType.EN_SKILL_QCOUNT_MM:
nmin += aC;
nmax += aC;
break;
case EnhanceEffectType.EN_SKILL_RELEASE_MM:
nmin += aC;
nmax += aC;
break;
default:
return 0;
}
return this.roundV(nmin, nmax);
},
getTargetByCard(cardid: number): SkillTargetType{ getTargetByCard(cardid: number): SkillTargetType{
let obj = this._cardcache.get(cardid + ''); let obj = this._cardcache.get(cardid + '');
if(obj){ if(obj){

View File

@ -17,7 +17,7 @@ export class PetHandler {
_owner: PlayerHandler; _owner: PlayerHandler;
_id: number; _id: number;
_cfg: UnitCfg; _cfg: UnitCfg;
_skills: Map<number, Skill> = new Map(); _skills: Skill[] = [];
_bornSkills: Skill[] = []; _bornSkills: Skill[] = [];
_dieSkills: Skill[] = []; _dieSkills: Skill[] = [];
@ -80,7 +80,7 @@ export class PetHandler {
this._ceilBaseAP(); this._ceilBaseAP();
this._skills.clear(); this._skills.length = 0;
this.addSkill(this._cfg.base_skill1id); this.addSkill(this._cfg.base_skill1id);
this.addSkill(this._cfg.base_skill2id); this.addSkill(this._cfg.base_skill2id);
@ -138,13 +138,14 @@ export class PetHandler {
return lst; return lst;
}; };
public addSkill(skillid: number): Skill{ public addSkill(skillid: number, count: number = 1): Skill[]{
let lst;
if(skillid > 0){ if(skillid > 0){
let obj = this._skills.get(skillid); lst = [];
if(!obj){ for(let i = 0; i < count;i++){
obj = this._owner.newSkill(skillid); let obj = this._owner.newSkill(skillid);
if(obj){ if(obj){
this._skills.set(skillid, obj); this._skills.push(obj);
this._selfskills.push(skillid); this._selfskills.push(skillid);
if(obj.isBornSkill()){ if(obj.isBornSkill()){
this._bornSkills.push(obj); this._bornSkills.push(obj);
@ -155,20 +156,24 @@ export class PetHandler {
}else{ }else{
this._waitskills.push(obj); this._waitskills.push(obj);
} }
lst.push(obj);
} }
return obj;
} }
} }
return null; return lst;
}; };
public delSkill(skillid:number, halocb?: any){ public delSkill(skillid:number, halocb?: any){
if(skillid > 0){ if(skillid > 0){
let obj = this._skills.get(skillid); let idx = this._skills.findIndex((item:Skill) => {
if(obj){ return item._id == skillid;
let idx = this._bornSkills.indexOf(obj); });
if(idx >= 0){
let baseidx = idx;
let obj = this._skills[idx];
idx = this._bornSkills.indexOf(obj);
if(idx >= 0){ if(idx >= 0){
this._bornSkills.splice(idx, 1); this._bornSkills.splice(idx, 1);
} }
@ -185,8 +190,10 @@ export class PetHandler {
if(idx >= 0){ if(idx >= 0){
this._waitskills.splice(idx, 1); this._waitskills.splice(idx, 1);
} }
this._skills.splice(baseidx, 1);
} }
this._skills.delete(skillid);
} }
}; };

View File

@ -137,7 +137,7 @@ export class PlayerHandler {
return false; return false;
} }
if(cfg.type_id == EffectCardType.NPC){ if(cfg.type_id == EffectCardType.NPC || cfg.type_id == EffectCardType.NPC_CUSTOM){
let pet = this.newPet(); let pet = this.newPet();
if(!pet){ if(!pet){
return false; return false;
@ -179,8 +179,8 @@ export class PlayerHandler {
return obj; return obj;
}; };
public addSkill(skillid: number): Skill{ public addSkill(skillid: number, count: number = 1): Skill[]{
return this._self.addSkill(skillid); return this._self.addSkill(skillid, count);
}; };
public handleSkill(skillid: number, count: number, param: SkillParam, pet: PetHandler):SkillTarget[]{ public handleSkill(skillid: number, count: number, param: SkillParam, pet: PetHandler):SkillTarget[]{
@ -199,19 +199,21 @@ export class PlayerHandler {
let bhalo = false; let bhalo = false;
let bchged = false; let bchged = false;
for(let i = 0; i < count; i++){ for(let i = 0; i < count; i++){
let obj = pet.addSkill(skillid); let sl = pet.addSkill(skillid);
if(obj){ if(sl && sl.length > 0){
bchged = true; bchged = true;
if(obj.isBornSkill()){ sl.forEach((obj: Skill)=>{
lst.push(obj); if(obj.isBornSkill()){
}else if(obj.isDieSkill()){ lst.push(obj);
//nothing to do }else if(obj.isDieSkill()){
}else if(obj.isHaloSkill()){ //nothing to do
//only handle halo, not handle skill }else if(obj.isHaloSkill()){
bhalo = true; //only handle halo, not handle skill
}else{ bhalo = true;
lst.push(obj); }else{
} lst.push(obj);
}
});
} }
} }
if(bhalo){ if(bhalo){
@ -279,6 +281,10 @@ export class PlayerHandler {
} }
}; };
public totalAP(){
return this._self.totalAP();
};
public setFriend(aplayer: PlayerHandler){ public setFriend(aplayer: PlayerHandler){
this._friend = aplayer; this._friend = aplayer;
}; };
@ -292,7 +298,7 @@ export class PlayerHandler {
return this._self.reborn(); return this._self.reborn();
}; };
public attack(apet: PetHandler, param: SkillParam){ public attack(apet: PetHandler, param: SkillParam, ev: number){
return this._self.attack(apet, param); return this._self.attack(apet, param);
}; };
@ -454,14 +460,10 @@ export class PlayerHandler {
return false; return false;
} }
let bok = false; let obj = this._self._skills.find((val: Skill)=>{
for(let [key, val] of this._self._skills){ return val.isTransEffCardSkill();
if(val.isTransEffCardSkill()){ });
bok = true; return !!obj;
break;
}
}
return bok;
}; };
public getTransEffCardRate(): number{ public getTransEffCardRate(): number{
@ -469,12 +471,11 @@ export class PlayerHandler {
return 0; return 0;
} }
for(let [key, val] of this._self._skills){ let obj = this._self._skills.find((val: Skill)=>{
if(val.isTransEffCardSkill()){ return val.isTransEffCardSkill();
return val.getEffValue(); });
}
} return obj? obj.getEffValue(): 0;
return 0;
}; };
onCardLinkReady(fromplayer: PlayerHandler){ onCardLinkReady(fromplayer: PlayerHandler){

View File

@ -25,6 +25,7 @@ export class Skill {
halo_v: number = -1; halo_v: number = -1;
rd: number = 0; rd: number = 0;
private _subskill: Skill;
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
// onLoad () {}; // onLoad () {};
@ -170,17 +171,23 @@ export class Skill {
return CfgMan.calcEnhanceValue(this._data.edd_effid, this._data.edd_effnum, param.edd_cnt, param.cardpoint); return CfgMan.calcEnhanceValue(this._data.edd_effid, this._data.edd_effnum, param.edd_cnt, param.cardpoint);
}; };
getEffValue(ap?: number): number{
return CfgMan.calcEffectValue(this._data.eff_numtypeid, getEffValue(ac?: number, ap?: number): number{
this._data.num_signid, this._data.eff_num, this._data.eff_nummax, ap? ap: this._data.eff_num); return this.getFinalValue(this._data.eff_num, this._data.eff_nummax, ac, ap);
}; };
getHaloValue(ap?: number): number{ getFinalValue(nmin: number, nmax: number, ac:number, ap: number, sp: number = 0): number{
let n = CfgMan.randomEffectValue(nmin, nmax, this._data.edd_effid, this._data.eddeffnum_signid,
this._data.edd_effnum, ac);
return CfgMan.calcEffctValueEx(this._data.eff_numtypeid, this._data.num_signid, n, ap, sp);
};
getHaloValue(): number{
if(!this.isHaloSkill()){ if(!this.isHaloSkill()){
return 0; return 0;
} }
if(this.halo_v < 0){ if(this.halo_v < 0){
this.halo_v = this.getEffValue(ap); this.halo_v = this.getEffValue();
} }
return this.halo_v; return this.halo_v;
}; };
@ -206,7 +213,14 @@ export class Skill {
this.halo_v = -1; this.halo_v = -1;
}; };
trigger(param: SkillParam, cb?: any) { _triggerSubSkill(param: SkillParam, cb?: any){
if(this._data.quoteskillid && !this._subskill){
this._subskill = this._owner.newSkill(this._data.quoteskillid);
}
};
_trigger(param: SkillParam, cb?: any) {
//触发buff效果 //触发buff效果
let res = TriggerManager.onTrigger(this, param); let res = TriggerManager.onTrigger(this, param);
@ -220,9 +234,18 @@ export class Skill {
this._cb && this._cb(this, param, res); this._cb && this._cb(this, param, res);
this._man && this._man.onSkillTrigger(this, param, res); this._triggerSubSkill(param, cb);
};
return res; trigger(param: SkillParam, cb?: any) {
let ncount = this.getFinalValue(this._data.release_times,
this._data.release_timesmax, param.edd_cnt, param.cardpoint);
if(ncount == 0){
ncount = 1;
}
for(let i=0; i<ncount;i++){
this._trigger(param, cb);
}
}; };
checkTrigger(tg_type: TriggerType, tg_value: any, tg_target: SkillParam, cb?: any) { checkTrigger(tg_type: TriggerType, tg_value: any, tg_target: SkillParam, cb?: any) {
@ -344,10 +367,14 @@ export class Skill {
}; };
summon(efftype: SkillEffectType, exparam: SkillParam, tgt: SkillTarget){ summon(efftype: SkillEffectType, exparam: SkillParam, tgt: SkillTarget){
let ncount = 1 + exparam.edd_cnt;
switch(efftype){ switch(efftype){
case SkillEffectType.SUMMON_NPC: case SkillEffectType.SUMMON_NPC:
{ {
let ncount = this.getFinalValue(this._data.quoteunit_times, this._data.quoteunit_timesmax,
exparam.edd_cnt, exparam.cardpoint);
if(ncount == 0){
ncount = 1;
}
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);
if(n >= 0){ if(n >= 0){
@ -359,6 +386,11 @@ export class Skill {
break; break;
case SkillEffectType.SUMMON_SKILL: case SkillEffectType.SUMMON_SKILL:
{ {
let ncount = this.getFinalValue(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 obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
let res = obj.useSkill(this._data.quoteskillid, ncount, exparam); let res = obj.useSkill(this._data.quoteskillid, ncount, exparam);
if(res){ if(res){
@ -370,10 +402,15 @@ export class Skill {
break; break;
case SkillEffectType.SKILL_GET: case SkillEffectType.SKILL_GET:
{ {
let ncount = this.getFinalValue(this._data.getskill_times, this._data.getskill_timesmax,
exparam.edd_cnt, exparam.cardpoint);
if(ncount == 0){
ncount = 1;
}
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer; let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
let n = obj.addSkill(this._data.quoteskillid); let n = obj.addSkill(this._data.getskillid, ncount);
if(n){ if(n){
tgt.success(efftype, this._data.quoteskillid); tgt.success(efftype, this._data.getskillid);
}else{ }else{
tgt.fail(efftype, -1); tgt.fail(efftype, -1);
} }
@ -451,11 +488,12 @@ export class Skill {
} }
}; };
attack(tgt: SkillTarget, param: SkillParam){ attack(effvalue: number, tgt: SkillTarget, param: SkillParam){
let efftype = SkillEffectType.ATTACK; let efftype = SkillEffectType.ATTACK;
if(tgt.dsttype == GameUnitType.HERO || tgt.dsttype == GameUnitType.PET){ if(tgt.dsttype == GameUnitType.HERO || tgt.dsttype == GameUnitType.PET){
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer; let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
let res = obj.attack((tgt.dst as PetHandler), param); let v = effvalue;
let res = obj.attack((tgt.dst as PetHandler), param, v);
if(res){ if(res){
tgt.success(efftype, res); tgt.success(efftype, res);
}else{ }else{
@ -470,7 +508,8 @@ export class Skill {
let efftype = SkillEffectType.ATTACK_BACK; let efftype = SkillEffectType.ATTACK_BACK;
if(tgt.dsttype == GameUnitType.HERO || tgt.dsttype == GameUnitType.PET){ if(tgt.dsttype == GameUnitType.HERO || tgt.dsttype == GameUnitType.PET){
let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer; let obj = tgt.srcpet? tgt.srcpet: tgt.srcplayer;
let res = obj.attack((tgt.dst as PetHandler), param); let v = effvalue;
let res = obj.attack((tgt.dst as PetHandler), param, v);
if(res){ if(res){
tgt.success(efftype, res); tgt.success(efftype, res);
}else{ }else{
@ -504,7 +543,6 @@ export class Skill {
obj._type = this._type; obj._type = this._type;
obj._param = this._param; obj._param = this._param;
obj._tgctrl = this._tgctrl; obj._tgctrl = this._tgctrl;
obj._man = this._man;
return obj; return obj;
}; };
}; };

View File

@ -118,7 +118,7 @@ export const enum SkillRangeUnitType{
* 6. * 6.
* 7. * 7.
* 8.ID * 8.ID
* 9.ID * 9.ID // 已废弃
* 10. * 10.
* 11.HP * 11.HP
* 12.[] * 12.[]
@ -143,7 +143,7 @@ export const enum SkillEffectType
POWEREX_ENHANCE = 6, POWEREX_ENHANCE = 6,
HURT_POWER = 7, HURT_POWER = 7,
SUMMON_NPC = 8, SUMMON_NPC = 8,
SUMMON_SKILL = 9, SUMMON_SKILL = 9, // 废弃
TAUNT = 10, TAUNT = 10,
HURT_HP = 11, HURT_HP = 11,
POWER_ADD_BUFF = 12, POWER_ADD_BUFF = 12,
@ -163,7 +163,8 @@ export const enum SkillEffectValueType
{ {
NONE = 0, NONE = 0,
NUMBER = 1, NUMBER = 1,
RATIO = 2, RATIO_AP = 2, // 总点数*倍数
RATIO_SP = 3, // 战力*倍数
}; };
// 技能效果参数标识 // 技能效果参数标识
@ -180,29 +181,49 @@ export const enum EffectCardType
NONE = 0, NONE = 0,
NPC = 1, NPC = 1,
MAGIC = 2, MAGIC = 2,
NPC_CUSTOM = 11,
}; };
// 技能效果强化类型 // 技能效果强化类型
/** /**
* 1.使+* * 1.使+* //下限
* 2.使+** * 2.使+** //下限
* 3.使+ * 3.使+ //下限
* 4.使+* * 4.使+* //下限
* 5.使+** * 5.使+** //下限
* 21.使+a牌数 * 21.使+a牌数
* 22.使+a牌数 * 22.使+a牌数
* 23.使+a牌数 * 23.使+a牌数
* 24.+a参数*a牌数112425
* 25.++a参数*a牌数
* 26.+a倍速**a牌数222627
* 27.++a倍速**a牌数
* 28.++a牌数
* 29.++a牌数
*/ */
export const enum EnhanceEffectType { export const enum EnhanceEffectType {
NONE = 0, NONE = 0,
EN_SKILL_BYCFG = 1, EN_SKILL_BYCFG = 1,
EN_SKILL_BYAP = 2, EN_SKILL_BYAP = 2,
EN_SUBSKILL_BYCFG = 3, EN_QCOUNT = 3,
EN_POWER_BYCFG = 4, EN_POWER_BYCFG = 4,
EN_POWER_BYAP = 5, EN_POWER_BYAP = 5,
EN_SKILL_USECOUNT_MIN = 21, EN_SKILL_RELEASE_MIN = 21,
EN_SKILL_USECOUNT_MAX = 22, EN_SKILL_RELEASE_MAX = 22,
EN_SKILL_QCOUNT_MAX = 23, EN_QCOUNT_MAX = 23,
EN_SKILL_BYCFG_MAX = 24,
EN_SKILL_BYCFG_MM = 25,
EN_SKILL_BYAP_MAX = 26,
EN_SKILL_BYAP_MM = 27,
EN_SKILL_QCOUNT_MM = 28,
EN_SKILL_RELEASE_MM = 29,
};
export const enum EnhanceCalcType {
NONE = 0,
ECT_AC = 1,
ECT_AC_EV = 2,
ECT_AC_EV_AP = 3,
}; };
// 游戏单位类型 // 游戏单位类型

View File

@ -76,8 +76,9 @@ let TriggerManager = {
onTrigger(sender: Skill, param: SkillParam): SkillTarget[] { onTrigger(sender: Skill, param: SkillParam): SkillTarget[] {
let effectid = sender._data.effect_typeid; let effectid = sender._data.effect_typeid;
let env = sender.getEnhanceValue(param);
let effv = sender.getEffValue(param.cardpoint); let effv = sender.getEffValue(param.edd_cnt, param.cardpoint);
let tgts = sender.getTargets(param); let tgts = sender.getTargets(param);
if(!tgts || !tgts.length){ if(!tgts || !tgts.length){
return null; return null;
@ -93,7 +94,7 @@ let TriggerManager = {
case SkillEffectType.CARD_CHG_EN: case SkillEffectType.CARD_CHG_EN:
case SkillEffectType.CARD_GETDIRECT: case SkillEffectType.CARD_GETDIRECT:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.handleCard(effectid, effv + env, item); sender.handleCard(effectid, effv, item);
}); });
break; break;
case SkillEffectType.POWER_ENHANCE: case SkillEffectType.POWER_ENHANCE:
@ -101,7 +102,7 @@ let TriggerManager = {
case SkillEffectType.HURT_POWER: case SkillEffectType.HURT_POWER:
case SkillEffectType.HURT_ALL: case SkillEffectType.HURT_ALL:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.handlePower(effectid, effv + env, item); sender.handlePower(effectid, effv, item);
}); });
break; break;
case SkillEffectType.SUMMON_NPC: case SkillEffectType.SUMMON_NPC:
@ -117,17 +118,17 @@ let TriggerManager = {
break; break;
case SkillEffectType.HURT_HP: case SkillEffectType.HURT_HP:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.handleHP(effv + env, item); sender.handleHP(effv, item);
}); });
break; break;
case SkillEffectType.POWER_ADD_BUFF: case SkillEffectType.POWER_ADD_BUFF:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.addBuff(effectid, effv + env, item); sender.addBuff(effectid, effv, item);
}); });
break; break;
case SkillEffectType.HURT_REDUCE: case SkillEffectType.HURT_REDUCE:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.reduceHurt(effv + env, item); sender.reduceHurt(effv, item);
}); });
break; break;
case SkillEffectType.REBORN: case SkillEffectType.REBORN:
@ -137,22 +138,22 @@ let TriggerManager = {
break; break;
case SkillEffectType.ENHANCE_MAGIC: case SkillEffectType.ENHANCE_MAGIC:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.enhanceMagic(effv + env, item); sender.enhanceMagic(effv, item);
}); });
break; break;
case SkillEffectType.SILENT: case SkillEffectType.SILENT:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.silent(effv + env, item); sender.silent(effv, item);
}); });
break; break;
case SkillEffectType.ATTACK: case SkillEffectType.ATTACK:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.attack(item, param); sender.attack(effv, item, param);
}); });
break; break;
case SkillEffectType.ATTACK_BACK: case SkillEffectType.ATTACK_BACK:
tgts.forEach((item)=>{ tgts.forEach((item)=>{
sender.attack_back(effv + env, item, param); sender.attack_back(effv, item, param);
}); });
break; break;
default: default: