/// <summary> /// 模拟输出系法术攻击 /// </summary> /// <param name="npc_Operate">被模拟的NPC角色</param> private void getVolumeAttack(NPC npc_Operate) { var roles = this.getGetAllRoles(); for (int i = 0; i < roles.Count; i++) { if (CheckIsEnemy(npc_Operate, roles[i])) { Engine_MagicEngine.attackMagicTool at = new Engine_MagicEngine.attackMagicTool(npc_Operate.getCar().ability.driver.skill1); getItemVolumeAttack(npc_Operate, roles[i], at); Engine_MagicEngine.attackMagicTool at2 = new Engine_MagicEngine.attackMagicTool(npc_Operate.getCar().ability.driver.skill2); getItemVolumeAttack(npc_Operate, roles[i], at2); } } }
private void getItemVolumeAttack(NPC npc_Operate, RoleInGame itemValue, Engine_MagicEngine.attackMagicTool at) { foreach (var item in this._collectPosition) { var centerPosition = Program.dt.GetFpByIndex(item.Value); var fromTarget = Program.dt.GetFpByIndex(npc_Operate.StartFPIndex); var endTarget = Program.dt.GetFpByIndex(itemValue.StartFPIndex); var costVolumn = this.GetCollectReWard(item.Key) * 100; RoleInGame boss; double distance; if (npc_Operate.HasTheBoss(this._Players, out boss)) { var bossPoint = Program.dt.GetFpByIndex(boss.StartFPIndex); distance = CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fromTarget.Latitde, fromTarget.Longitude, centerPosition.Latitde, centerPosition.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(centerPosition.Latitde, centerPosition.Longitude, endTarget.Latitde, endTarget.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(bossPoint.Latitde, bossPoint.Longitude, endTarget.Latitde, endTarget.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(bossPoint.Latitde, bossPoint.Longitude, fromTarget.Latitde, fromTarget.Longitude); } else { distance = CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fromTarget.Latitde, fromTarget.Longitude, centerPosition.Latitde, centerPosition.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(centerPosition.Latitde, centerPosition.Longitude, endTarget.Latitde, endTarget.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fromTarget.Latitde, fromTarget.Longitude, endTarget.Latitde, endTarget.Longitude); } var victim = itemValue; long harmValue; var car = npc_Operate.getCar(); if (victim.improvementRecord.defenceValue > 0) { harmValue = ((at.leftValue(car.ability) - costVolumn) * (100 - at.GetDefensiveValue(victim.getCar().ability.driver, victim.improvementRecord.defenceValue > 0)) / 100); } else { harmValue = ((at.leftValue(car.ability) - costVolumn) * (100 - at.GetDefensiveValue(victim.getCar().ability.driver)) / 100); } this.magicE.AmbushSelf(victim, at, ref harmValue); //harmValue = at.ImproveAttack(npc_Operate, harmValue); var itemHarmValue = harmValue / distance; if (npc_Operate.attackTag == null || npc_Operate.attackTag.HarmValue < itemHarmValue) { switch (at.skill.skillEnum) { case CommonClass.driversource.SkillEnum.Electic: { npc_Operate.attackTag = new NPC.AttackTag() { aType = NPC.AttackTag.AttackType.electric, HarmValue = itemHarmValue, Target = victim.Key, fpPass = Program.dt.GetFpByIndex(item.Value) }; }; break; case CommonClass.driversource.SkillEnum.Fire: { npc_Operate.attackTag = new NPC.AttackTag() { aType = NPC.AttackTag.AttackType.fire, HarmValue = itemHarmValue, Target = victim.Key, fpPass = Program.dt.GetFpByIndex(item.Value) }; }; break; case CommonClass.driversource.SkillEnum.Water: { npc_Operate.attackTag = new NPC.AttackTag() { aType = NPC.AttackTag.AttackType.water, HarmValue = itemHarmValue, Target = victim.Key, fpPass = Program.dt.GetFpByIndex(item.Value) }; }; break; default: { throw new Exception("输入异常!!!"); }; } } } }
private void getItemAmbushAttack(NPC npc_Operate, RoleInGame roleInGame) { var car = npc_Operate.getCar(); Model.FastonPosition fp; var victim = roleInGame; if (victim.confuseRecord.simulate.dealWithItem_simulate(victim, this, car, npc_Operate)) { var listIndexes = this.getCollectPositionsByDistance(Program.dt.GetFpByIndex(victim.StartFPIndex)); fp = Program.dt.GetFpByIndex(this._collectPosition[listIndexes[0]]); var longCollectMoney = this.GetCollectReWard(listIndexes[0]) * 100; double distance; RoleInGame boss; var fromTarget = Program.dt.GetFpByIndex(npc_Operate.StartFPIndex); var endTarget = fp; if (npc_Operate.HasTheBoss(this._Players, out boss)) { var bossPoint = Program.dt.GetFpByIndex(boss.StartFPIndex); distance = CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fromTarget.Latitde, fromTarget.Longitude, fp.Latitde, fp.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fp.Latitde, fp.Longitude, endTarget.Latitde, endTarget.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(bossPoint.Latitde, bossPoint.Longitude, endTarget.Latitde, endTarget.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(bossPoint.Latitde, bossPoint.Longitude, fromTarget.Latitde, fromTarget.Longitude); } else { distance = CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fromTarget.Latitde, fromTarget.Longitude, fp.Latitde, fp.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(fp.Latitde, fp.Longitude, endTarget.Latitde, endTarget.Longitude) + CommonClass.Geography.getLengthOfTwoPoint.GetDistance(endTarget.Latitde, endTarget.Longitude, fromTarget.Latitde, fromTarget.Longitude); } var roles = this.getGetAllRoles(); for (int i = 0; i < roles.Count; i++) { if (CheckIsPartner(npc_Operate, roles[i])) { /* * 要是伙伴,才能潜伏攻击。且伙伴必须是输出系。 */ if (roles[i].getCar().ability.driver != null) { if (roles[i].getCar().ability.driver.race == CommonClass.driversource.Race.immortal) { if (!roles[i].Bust) { if (!roles[i].confuseRecord.IsBeingControlled()) { Engine_MagicEngine.attackMagicTool amt = new Engine_MagicEngine.attackMagicTool(roles[i].getCar().ability.driver.skill1); // var harmValue = 0;//this.debtE.DealWithReduceWhenSimulationWithoutDefendMagic(amt, npc_Operate, car, longCollectMoney, victim, 100); // this.GetCollectReWard(item.Key) * 100 var harmValue = npc_Operate.confuseRecord.SimulationToMagicAttack(amt, npc_Operate, car, longCollectMoney, victim, 100); //var harmValue = this.debtE.SimulationToMagicAttack(amt, npc_Operate, car, longCollectMoney, victim, 100); var itemHarmValue = harmValue / distance; if (npc_Operate.attackTag == null || npc_Operate.attackTag.HarmValue < itemHarmValue) { npc_Operate.attackTag = new NPC.AttackTag() { aType = NPC.AttackTag.AttackType.ambush, HarmValue = itemHarmValue, Target = victim.Key, fpPass = fp }; } } } } } //getItemAmbushAttack(npc_Operate, roles[i]); // roles[i]. //Engine_MagicEngine.attackMagicTool at = new Engine_MagicEngine.attackMagicTool(npc_Operate.getCar().ability.driver.skill1); //getItemVolumeAttack(npc_Operate, roles[i], at); //Engine_MagicEngine.attackMagicTool at2 = new Engine_MagicEngine.attackMagicTool(npc_Operate.getCar().ability.driver.skill2); //getItemVolumeAttack(npc_Operate, roles[i], at2); } } } else { } }