/// <summary> /// Tricks the ao yi to skill. 伪装奥义为技能 /// </summary> /// <returns>The ao yi to skill.</returns> /// <param name="">.</param> public void trickAoYiToSkill(List <BT_Monster> team) { //加入奥义的主动技能 if (team != null) { foreach (BT_Monster pet in team) { foreach (CAoYi ao in _AoYi.Values) { BT_Skill VirtualSk = new BT_Skill(ao, pet); //奥义伪造为技能 VirtualSk.real = 1; short period = ao.getAoYiItem._SkillOpConfig.type; if (period == SkillOpData.Anger_Skill) { //添加怒气技能 pet.set_AngrySkillArr(VirtualSk); } else { //添加Normal技能 pet.set_NormalSkillArr(VirtualSk); } } } } }
/// <summary> /// 依据技能的优先级来排序 /// </summary> /// <returns>The skill arr.</returns> public static int sortSkillArr(BT_Skill sk1, BT_Skill sk2) { short SkPrior1 = sk1.opObj.prior; short SkPrior2 = sk2.opObj.prior; return(SkPrior1 <= SkPrior2 ? 1 : -1); }
/// <summary> /// Get skill's parameter. /// </summary> /// <returns>The parameter.</returns> /// <param name="skill">Skill.</param> /// <param name="key">Key.</param> private int getParam(BT_Skill skill, string key) { int value = -1; if (skill != null && !string.IsNullOrEmpty(key)) { switch (key) { case "rate": value = skill.param.rate; break; case "rate2": value = skill.param.rate2; break; case "gailv": value = skill.param.gailv; break; case "damage": value = skill.param.damage; break; case "nuqi": value = skill.param.nuqi; break; case "num": value = skill.param.num; break; } } return(value); }
void parseSkill(Battle_Monster value, float skillup) { //取出技能1,2,3 SkillObj skId1 = null, skId2 = null, skId3 = null; if (value.skill != null) { skId1 = value.skill.Value <SkillObj>(0); skId2 = value.skill.Value <SkillObj>(1); skId3 = value.skill.Value <SkillObj>(2); } if (skId1 == null) { skId1 = new SkillObj(); } if (skId2 == null) { skId2 = new SkillObj(); } if (skId3 == null) { skId3 = new SkillObj(); } _nSkill.Add(skId1); //只有宠物大于30级的时候,才能释放第二个技能 if (_level >= 30 && skId2.skillId != 0) { _nSkill.Add(skId2); } _aSkill.Add(skId3); //获取普通技能 foreach (SkillObj nSkill in _nSkill) { if (nSkill.skillId > 0) { BT_Skill sk = new BT_Skill(nSkill.skillId, nSkill.skillLevel, skillMgr, this); if (sk != null) { improvePossibility(sk, skillup); _nskillArr.Add(sk); } } } //获取怒气技能 foreach (SkillObj aSkill in _aSkill) { if (aSkill.skillId > 0) { BT_Skill sk = new BT_Skill(aSkill.skillId, aSkill.skillLevel, skillMgr, this); improvePossibility(sk, skillup); _askillArr.Add(sk); } } }
//提升技能触发概率 private void improvePossibility(BT_Skill sk, float rate) { if (sk.param.gailv > 0) { sk.param.gailv = MathHelper.MidpointRounding(sk.param.gailv * rate); if (sk.param.gailv > 100) { sk.param.gailv = 100; } } }
public CMsgSkillCast(BT_Skill skill, int category) { this.status = CMsgHeader.STATUS_NOMARL_SKILL; this.skillId = skill.id; this.skillOp = skill.opObj.ID; this.skillType = skill.opObj.type; this.caster = skill.owner.pveId; this.category = category; this.status = (short)(status * 100 + category); this.Mul = skill.RdCast; }
//受到BufforDebuff public void castBufforDebuff() { BT_BuffOrDebuff ReduceHpDebuff = getBuffOrDebuff(CMsgHeader.BUFF_DEBUFF_REDUCE_HP); if (ReduceHpDebuff != null && ReduceHpDebuff.round > 0) { BT_Skill skill = ReduceHpDebuff.skill; if (skill != null) { skill.castDecSkill(skill.param.num); } } }
/// /// ---- 关于技能的统计,仅仅针对 攻击方 ---- /// //设定普通技能释放次数 public void setTotalNormalSkill(BT_MonsterTeam Team, BT_Skill skill) { if (Team != null && skill != null) { string whichTeam = Team.getTeamName; if (whichTeam == "Att") { //既不是怒气技也不是奥义技 if (skill.opObj.type != SkillOpData.Anger_Skill && skill.real != 1) { statictis._totalNoramSkill++; statictis._NorSkillArr.Add(skill.id); } } } }
//重置奥义 public void resetAoYi(BT_Skill sk, BT_MonsterTeam Team) { int AoYiID = sk.id; BattleAoYi workAoYi = null; if (Team.getTeamName == "Att") { workAoYi = this._attAoYi; } else { workAoYi = this._defAoYi; } //设置这个奥义未使用过 workAoYi.resetCurAoYi(AoYiID); }
//能否释放技能 -- 根据Debuff的状态来决定 public bool canCastSkillAcc2BuffOrDebuff(BT_Skill sk, int skType) { bool canCast = true; if (skType == SkillOpData.Common_Skill) { BT_BuffOrDebuff sealDebuff = getBuffOrDebuff(CMsgHeader.BUFF_DEBUFF_SEAL, false); if (sealDebuff != null && _lastLun == 0) { canCast = false; CMsgSkillBuffDebuffEffect msg = new CMsgSkillBuffDebuffEffect(this, sealDebuff); msg.arg1 = sk.id; _war.addMsgToRecorder(msg); } } return(canCast); }
//能否释放奥义技能 public bool canCastAoYi(BT_Skill sk, BT_MonsterTeam Team) { int AoYiID = sk.id; BattleAoYi workAoYi = null; if (Team.getTeamName == "Att") { workAoYi = this._attAoYi; } else { workAoYi = this._defAoYi; } bool can = false; ConsoleEx.Write(" AY id = " + AoYiID + " name = " + Core.Data.dragonManager.getAoYiData(AoYiID).name, "yellow"); if (workAoYi.isFirstAoYi(AoYiID)) { if (workAoYi.curAoYiCast(AoYiID) == false) { can = true; } } else { //前一个是否已经使用过 bool pre = workAoYi.prevAoYiCast(AoYiID); bool cur = workAoYi.curAoYiCast(AoYiID); //wxl if (/*pre == true &&*/ cur == false) { can = true; } } return(can); }
/// <summary> /// 开启一个回合的开始计算 /// </summary> public void StartWarStep() { bool begin = RoundBegin(); if (begin) { //当前回合有怒气技吗? BT_Skill angrySk = null; int Count = 0; bool castAngry = curRound_CastAngry(ref angrySk, ref Count); if (castAngry) { addAngryByAoYi(); bufOrDebufSkill(); propertyChg(); propertyKill(); //通知UI层显示 AngryIsReady(angrySk.id, Count, angrySk.forcastInfo()); } else { addAngryByAoYi(); bufOrDebufSkill(); propertyChg(); propertyKill(); castAngrySkill(); castNormalSkill(); fighting(); castEndSkill(); EndWarStep(); } //通知UI reportStepToUI(); } }
/// <summary> /// 当前回合有足够的怒气,去释放怒气技能吗 /// </summary> private bool curRound_CastAngry(ref BT_Skill angry, ref int Count) { bool can = false; List <BT_Skill> angryArr = _curAtter.get_AngrySkillArr; if (angryArr != null) { foreach (BT_Skill sk in angryArr) { can = sk.param.nuqi <= _curAtter._selfTeam.curAngry; can = can && sk.real == 0; if (can) { angry = sk; Count = _curAtter._selfTeam.curAngry / sk.param.nuqi; break; } } } return(can); }
/// <summary> /// Set skill's parameter. /// </summary> /// <param name="skill">Skill.</param> /// <param name="key">Key.</param> /// <param name="value">Value.</param> private void setParam(BT_Skill skill, string key, int value) { if (skill != null && !string.IsNullOrEmpty(key)) { switch (key) { case "rate": skill.param.rate = value; break; case "rate2": skill.param.rate2 = value; break; case "gailv": skill.param.gailv = value; //保证概率不超过100 if (skill.param.gailv > 100) { skill.param.gailv = 100; } break; case "damage": skill.param.damage = value; break; case "nuqi": skill.param.nuqi = value; break; case "num": skill.param.num = value; break; } } }
public CMsgSkillRecovery(BT_Skill skill) : base(skill, CMsgSkillCast.categoryRecovery) { }
public CMsgSkillDeath(BT_Skill skill) : base(skill, CMsgSkillCast.categoryDeath) { }
public CMsgSkillChangeCurAttackAll(BT_Skill skill) : base(skill, CMsgSkillCast.categoryChangeCurAttackAll) { sufferArr = null; }
public CMsgSkillAngryExchange(BT_Skill skill) : base(skill, CMsgSkillCast.categoryAngryExchange) { }
public CMsgSkillBlast(BT_Skill skill) : base(skill, CMsgSkillCast.categoryBlast) { sufferArr = null; }
public CMsgSkillRevive(BT_Skill skill) : base(skill, CMsgSkillCast.categoryRevive) { reviveArr = null; }
public CMsgSkillChangeCurAttackBoth(BT_Skill skill) : base(skill, CMsgSkillCast.categoryChangeCurAttackBoth) { }
public CMsgSkillAfterRecovery(BT_Skill skill) : base(skill, CMsgSkillCast.categoryRecoveryAfterBattle) { }
public CMsgSkillBuffDebuff(BT_Skill skill) : base(skill, CMsgSkillCast.categoryBuffOrDebuff) { sufferArr = null; }
public CMsgSkillBomb(BT_Skill skill, int suffer, int startAtt) : base(skill, CMsgSkillCast.categoryBomb) { this.suffer = suffer; this.startAtt = startAtt; }
public CMsgSkillCut(BT_Skill skill, int suffer) : base(skill, CMsgSkillCast.categoryCut) { this.suffer = suffer; }
public CMsgSkillSuckAttack(BT_Skill skill, int suffer, int suckAttack) : base(skill, CMsgSkillCast.categorySuckAttack) { this.suffer = suffer; this.suckAttack = suckAttack; }
public CMsgSkillAttDelta(BT_Skill skill, int addAtt) : base(skill, CMsgSkillCast.categoryAttDelta) { this.addAtt = addAtt; }
public CMsgSkillChangeAttack(BT_Skill skill, int suffer) : base(skill, CMsgSkillCast.categoryChangeCurAttack) { this.suffer = suffer; }
public CMsgSkillReviveSelf(BT_Skill skill) : base(skill, CMsgSkillCast.categoryReviveSelf) { }
public CMsgSkillAttackCombo(BT_Skill skill) : base(skill, CMsgSkillCast.categoryAttackCombo) { attackArr = null; }