//释放技能 BanBattleProcess.Item AddItemWhenSkill(ConvertData data, int skillType, int from, int to, int mType, int skillId, int leftAp, CMsgHeader item) { BanBattleProcess.Item newItem = AddSkillItem(skillType, data.attIndex, data.defIndex, data.attCurBp, data.defCurBp, data.attAPCount, data.defAPCount, from, to, mType, skillId, leftAp, item); return(newItem); }
//属性转换 void addItemWhenPropertyChg(ConvertData data, int from, string skillname, int skillId) { BanBattleProcess UIProc = BanBattleProcess.Instance; BanBattleProcess.Item item = new BanBattleProcess.Item(0, 0, data.attIndex, data.defIndex, data.attCurBp, data.defCurBp, data.attAPCount, data.defAPCount, BanBattleProcess.Period.AttributeChange, from, -1, -1, -1, -1, skillname); item.skillId = skillId; UIProc.list_Item.Add(item); }
//属性克制 void addItemWhenPropertyKill(ConvertData data, int extra_3 = 0) { BanBattleProcess UIProc = BanBattleProcess.Instance; BanBattleProcess.Item i = new BanBattleProcess.Item(0, 0, data.attIndex, data.defIndex, data.attCurBp, data.defCurBp, data.attAPCount, data.defAPCount, BanBattleProcess.Period.AttributeConflict, -1, -1, -1, -1, -1); i.extra_3 = extra_3; UIProc.list_Item.Add(i); }
//只分析记录状态 void enterStatus(int result, BanBattleProcess.Item curItem) { if (status == Status_Record) { if (result == RESULT_ATTACKER_WIN) //只有进攻方赢则掉落龙珠 { if (AttId == curItem.attackIndex && DefId == curItem.defenseIndex) { Invoke("dropBall", 1.8f); } } } }
//隐藏所有的东西 //这个方法会被调用,只要有FlyGo,而不仅仅是怒气技能 public void HideWhenOverSkillOver(int result, BanBattleProcess.Item curItem) { if (OverSkill_Appear) //怒气技释放的时候结束 { analyzeStatus(result, curItem); Invoke("HideAll", 2f); } else { //其他情况 enterStatus(result, curItem); } }
void Skill_401(CMsgHeader aHeader) { //技能 CMsgSkillAttack skill = aHeader as CMsgSkillAttack; int from = skill.caster; int to = skill.suffer; //谁受到伤害 if (skill.suffer == localCached.attIndex) { localCached.attCurBp = skill.curAtt; localCached.defAPCount = skill.curAngry; } else { localCached.defCurBp = skill.curAtt; localCached.attAPCount = skill.curAngry; } int skillId = skill.skillId; //恢复的怒气 int RecoverAngry = skill.recoverAngry; //消耗的怒气 int CostAngry = skill.costAngry; //消耗时的怒气 int PreAngry = skill.preAngry; BanBattleProcess.Item newItem = null; if (RecoverAngry > 0) { newItem = AddItemWhenSkill(localCached, skill.skillType, from, to, BanBattleProcess.Item.CostAndRecoverAngry, skillId, skill.curAngry, skill); newItem.recoverAngry = RecoverAngry; newItem.costAngry = CostAngry; newItem.preAngry = PreAngry; } else { AddItemWhenSkill(localCached, skill.skillType, from, to, 0, skillId, skill.curAngry, skill); } }
//分析状态 /// <summary> /// 只有这怒气技能的情况下,才能进入记录状态 /// </summary> /// <param name="result">Result.</param> /// <param name="curItem">Current item.</param> void analyzeStatus(int result, BanBattleProcess.Item curItem) { status = result == RESULT_ATTACKER_WIN ? Status_DirectKill : Status_Record; if (status == Status_DirectKill) //清空数据 { AttId = -1; DefId = -1; } else // 记录数 { AttId = curItem.attackIndex; DefId = curItem.defenseIndex; } AttCombo = Count; if (status == Status_DirectKill) { //直接杀死的时候掉落 Invoke("dropBallEx", 1f); } }
void Skill_407(CMsgHeader aHeader, List <CMsgHeader> battleInfo, int headerIndex) { //自爆技能 //因为自爆技能的特殊,很有可能是夹在两个互殴片段之间 //所以我们要判定是否还处于互殴阶段 bool Vs1 = false, Vs2 = false, Vs = false; CMsgNormalAttack AfterVsAttack = null; int maxLength = battleInfo.Count; int preIndex = headerIndex - 2; if (headerIndex < maxLength) { int tmp = headerIndex; CMsgHeader nextItem = null; do { nextItem = battleInfo[tmp]; CMsgSkillCast check = nextItem as CMsgSkillCast; if (check != null) { if (check.skillType == (int)CSkill_Type.Die) { tmp += 1; } else { break; } } else { ConsoleEx.DebugLog("check = " + nextItem.GetType().ToString()); break; } } while(tmp < maxLength); if (nextItem.status == CMsgHeader.STATUS_ATTACK) { Vs1 = true; AfterVsAttack = nextItem as CMsgNormalAttack; } } if (preIndex >= 0) { CMsgHeader preItem = battleInfo[preIndex]; if (preItem.status == CMsgHeader.STATUS_ATTACK) { Vs2 = true; } } Vs = Vs1 && Vs2; /// /// 我只对受伤队列的第一个感兴趣,后面的,登场时候血量就会减少 /// CMsgSkillBlast item = aHeader as CMsgSkillBlast; int nFrom; CMsgSkillAttack one = item.sufferArr.Value <CMsgSkillAttack>(0); if (item.caster == localCached.attIndex) { localCached.attCurBp = 0; if (Vs) { localCached.defCurBp = AfterVsAttack.curAtt; if (one != null) { localCached.DefExploreHurt = one.finalAtt; } } else { if (one != null) { localCached.defCurBp = one.curAtt; } } nFrom = localCached.attIndex; } else { if (Vs) { localCached.attCurBp = AfterVsAttack.curAtt; if (one != null) { localCached.AttExploreHurt = one.finalAtt; } } else { if (one != null) { localCached.attCurBp = one.curAtt; } } localCached.defCurBp = 0; nFrom = localCached.defIndex; } int skillId = item.skillId; BanBattleProcess.Item added = AddItemWhenSkill(localCached, item.skillType, nFrom, -1, BanBattleProcess.Item.Extra3_Explore, skillId, item.curAngry, item); added.VsMiddle = Vs ? 1 : 0; }
BanBattleProcess.Item AddSkillItem(int skillType, int attackIndex, int defenseIndex, int attackBP, int defenseBP, int attackAP, int defenseAP, int extra_1, int extra_2, int extra_3, int skillId, int leftAp, CMsgHeader item = null) { BanBattleProcess.Item proItem = null; //判定是SkillID 还是AoYiID //非常恶心的判定 if (isAoYiSkill(skillId)) { AoYiData aoyiCfg = Core.Data.dragonManager.getAoYiData(skillId); int pos = getAoYiSkillPos(skillId, attackIndex == extra_1); proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.DragonAoYi, extra_1, extra_2, extra_3, pos, leftAp, aoyiCfg.name, item); proItem.aoyiConfig = aoyiCfg; BanBattleProcess.Instance.list_Item.Add(proItem); return(proItem); } else { int sAction = GetSkillAction(extra_1, skillId); SkillData data = Core.Data.skillManager.getSkillDataConfig(skillId); string skillname = ""; if (data != null) { skillname = data.name; } CSkill_Type cskType = CSkill_Type.Normal; if (System.Enum.IsDefined(typeof(CSkill_Type), skillType)) { cskType = (CSkill_Type)skillType; } if (cskType == CSkill_Type.Anger) { proItem = new BanBattleProcess.Item(data.param.num, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.AngrySkill, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item); } else if (cskType == CSkill_Type.Normal) { proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.NormalSkill, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item); } else if (cskType == CSkill_Type.Die) { proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.DieSkill, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item); } else if (cskType == CSkill_Type.AfterWar) { proItem = new BanBattleProcess.Item(0, 0, attackIndex, defenseIndex, attackBP, defenseBP, attackAP, defenseAP, BanBattleProcess.Period.AfterBattle, extra_1, extra_2, extra_3, sAction, leftAp, skillname, item); } if (proItem != null) { proItem.skillType = cskType; proItem.skillId = skillId; BanBattleProcess.Instance.list_Item.Add(proItem); } } return(proItem); }