public override void Init() { base.Init(); m_WeaponFireData = m_CfgEternityProxy.GetWeaponDataOfMachineGun(m_WeaponTable.TypeDateSheetld); m_CrossSightInfo = new CrossSightInfo(); m_CrossSightInfo.m_MaxRayDistance = m_SkillMaxDistance; m_CrossSightInfo.m_CrossSightShape = CrossSightShape.ConeSquare; m_CrossSightInfo.m_ConeSquareInfo.detectionMode = DetectionMode.All; m_CrossSightLoic = new CCrossSightLoic(); m_CrossSightLoic = new CrossSightLoic_Improve_ConeSquare(m_CrossSightLoic); m_CrossSightLoic.SetCrossSightInfo(m_CrossSightInfo); m_CrossSightLoic.SetBallisticOffsetFunc(BallisticOffsetFunc, null); m_CurrentBulletCount = 0; //子弹数 m_Accuracy = m_MainPlayer.GetWeaponAttribute(m_UId, crucis.attributepipeline.attribenum.AttributeName.kWeaponAccuracy); //精准度 m_Stability = m_MainPlayer.GetWeaponAttribute(m_UId, crucis.attributepipeline.attribenum.AttributeName.kWeaponStability); //稳定性 m_Aspect = m_WeaponFireData.AngleRatio; m_CurrentHorizontalAngle = GetHorizontalAngle_Before(); m_CurrentVerticalAngle = m_Aspect == 0 ? m_CurrentHorizontalAngle : m_CurrentHorizontalAngle / m_Aspect; m_CrossSightLoic.ChangeVirtualCameraAttribute(m_CurrentHorizontalAngle, m_Aspect); m_FireInterval = WeaponAndCrossSightFactory.CalculateFireInterval(m_MainPlayer, m_WeaponTable.TypeDateSheetld, m_UId, WeaponAndCrossSight.WeaponAndCrossSightTypes.MachineGun); }
public override void Init() { base.Init(); m_WeaponFireData = m_CfgEternityProxy.GetWeaponDataOfMissile(m_WeaponTable.TypeDateSheetld); m_CrossSightInfo = new CrossSightInfo(); m_CrossSightInfo.m_MaxRayDistance = m_SkillMaxDistance; m_CrossSightInfo.m_CrossSightShape = CrossSightShape.ConeSquare; m_CrossSightLoic = new CCrossSightLoic(); m_CrossSightLoic = new CrossSightLoic_Improve_ConeSquare(m_CrossSightLoic); m_CrossSightLoic.SetCrossSightInfo(m_CrossSightInfo); float accuracy = m_MainPlayer.GetWeaponAttribute(m_UId, crucis.attributepipeline.attribenum.AttributeName.kWeaponAccuracy); //精准度 float stability = m_MainPlayer.GetWeaponAttribute(m_UId, crucis.attributepipeline.attribenum.AttributeName.kWeaponStability); //稳定性 // 表里配置的时间是毫秒 m_LockonTimeParam = (m_WeaponFireData.LockTime - accuracy * m_WeaponFireData.TimeCoefficient) / 1000f; m_MaxMissileCountInOneShotParam = (int)(m_WeaponFireData.MagazineNumber + stability * m_WeaponFireData.MagazineQuantityCoefficient); m_ReticleHorizontalFOVParam = m_WeaponFireData.AimingSize; m_ReticleAspect = m_WeaponFireData.AngleRange; if (m_ReticleAspect == 0) { Debug.LogWarning(string.Format("--------------------> 导弹类武器表 ID= {0},AngleRange = 0,策划确认下对吗? ", m_WeaponTable.TypeDateSheetld)); } float fieldOfView = m_ReticleAspect == 0 ? 60 : m_ReticleHorizontalFOVParam / m_ReticleAspect; m_CrossSightLoic.ChangeVirtualCameraAttribute(fieldOfView, m_ReticleAspect); m_FireInterval = WeaponAndCrossSightFactory.CalculateFireInterval(m_MainPlayer, m_WeaponTable.TypeDateSheetld, m_UId, WeaponAndCrossSight.WeaponAndCrossSightTypes.Missile); }
public override void Init() { base.Init(); m_WeaponFireData = m_CfgEternityProxy.GetWeaponDataOfMining(m_WeaponTable.TypeDateSheetld); m_CrossSightInfo = new CrossSightInfo(); m_CrossSightInfo.m_MaxRayDistance = m_SkillMaxDistance; m_CrossSightInfo.m_CrossSightShape = CrossSightShape.CrossLine; m_CrossSightInfo.m_LineInfo.detectionMode = DetectionMode.All; m_CrossSightLoic = new CCrossSightLoic(); m_CrossSightLoic = new CrossSightLoic_Improve_line(m_CrossSightLoic); m_CrossSightLoic.SetCrossSightInfo(m_CrossSightInfo); m_FireInterval = WeaponAndCrossSightFactory.CalculateFireInterval(m_MainPlayer, m_WeaponTable.TypeDateSheetld, m_UId, WeaponAndCrossSight.WeaponAndCrossSightTypes.Mining); }
/// <summary> /// 获取武器射速by SkillID /// </summary> /// <param name="skllId"></param> /// <returns></returns> private float GetWeaponFireInterval(int skllId) { if (m_ISpacecraftSkillProperty.GetHeroType() == KHeroType.htPlayer) { ShipItemsProxy shipItemsProxy = GameFacade.Instance.RetrieveProxy(ProxyName.ShipItemsProxy) as ShipItemsProxy; IShip ship = shipItemsProxy.GetCurrentWarShip(m_ISpacecraftSkillProperty.EntityId()); if (ship != null) { IWeapon[] weapons = ship.GetWeaponContainer().GetWeapons(); for (int i = 0; i < weapons.Length; i++) { if (weapons[i].GetBaseConfig().SkillId == (ulong)skllId) { return(WeaponAndCrossSightFactory.CalculateFireInterval((SpacecraftEntity)m_ISpacecraftSkillProperty.GetOwner(), weapons[i].GetConfig().TypeDateSheetld, weapons[i].GetUID(), (WeaponAndCrossSight.WeaponAndCrossSightTypes)weapons[i].GetConfig().Reticle)); } } } } return(1.0f); }
public override void Init() { base.Init(); m_WeaponFireData = m_CfgEternityProxy.GetWeaponDataOfShotgun(m_WeaponTable.TypeDateSheetld); float accuracy = m_MainPlayer.GetWeaponAttribute(m_UId, crucis.attributepipeline.attribenum.AttributeName.kWeaponAccuracy); //精准度 float stability = m_MainPlayer.GetWeaponAttribute(m_UId, crucis.attributepipeline.attribenum.AttributeName.kWeaponStability); //稳定性 float m_SonMaxSpreadAngle = m_WeaponFireData.SonDiffusionAngle - accuracy * m_WeaponFireData.SonDiffusionAngleCoefficient; //子区域偏移最大角度 m_RestoreDuration = (m_WeaponFireData.RecoveryTime - stability * m_WeaponFireData.RecoveryTimeCoefficient) / 1000f; int sonCount = (int)m_WeaponFireData.SonNumber; AimArea mainAimArea = new AimArea(); // 中心区域覆盖角度 float MainAreaCoverAngle = m_WeaponFireData.CoreDiameterAngle - accuracy * m_WeaponFireData.CoreDiameterAngleCoefficient; int mainRayCount = m_WeaponFireData.CoreRadialNumber; mainAimArea.Init(false, 0, MainAreaCoverAngle, mainRayCount, m_SkillMaxDistance, sonCount); m_AimAreaList.Add(mainAimArea); //子区域 for (int i = 0; i < sonCount; i++) { AimArea sonAimArea = new AimArea(); // 子区域覆盖角度 float SubAimAreaCoverAngle = m_WeaponFireData.SonDiameterAngle - accuracy * m_WeaponFireData.SonDiameterAngleCoefficient; int sonRayCount = m_WeaponFireData.SonRadialNumber; sonAimArea.Init(true, m_SonMaxSpreadAngle, SubAimAreaCoverAngle, sonRayCount, m_SkillMaxDistance, sonCount); m_AimAreaList.Add(sonAimArea); } m_FireInterval = WeaponAndCrossSightFactory.CalculateFireInterval(m_MainPlayer, m_WeaponTable.TypeDateSheetld, m_UId, WeaponAndCrossSight.WeaponAndCrossSightTypes.ShotGun); }