diff --git a/Sources/Sandbox.Game/Definitions/MyWeaponDefinition.cs b/Sources/Sandbox.Game/Definitions/MyWeaponDefinition.cs index 14817e31b..8abdda52c 100644 --- a/Sources/Sandbox.Game/Definitions/MyWeaponDefinition.cs +++ b/Sources/Sandbox.Game/Definitions/MyWeaponDefinition.cs @@ -18,18 +18,16 @@ public class MyWeaponDefinition : MyDefinitionBase public class MyWeaponAmmoData { public int RateOfFire; // rounds per minute (round == 1 bullet) - public int BurstFireRate; public MySoundPair ShootSound; public int ShootIntervalInMiliseconds; // derivative of Rate of fire - public MyWeaponAmmoData(MyObjectBuilder_WeaponDefinition.WeaponAmmoData data) : this(data.RateOfFire, data.ShootSoundName, data.BurstFireRate) + public MyWeaponAmmoData(MyObjectBuilder_WeaponDefinition.WeaponAmmoData data) : this(data.RateOfFire, data.ShootSoundName) { } - public MyWeaponAmmoData(int rateOfFire, string soundName, int burstFireRate) + public MyWeaponAmmoData(int rateOfFire, string soundName) { this.RateOfFire = rateOfFire; - this.BurstFireRate = burstFireRate; this.ShootSound = new MySoundPair(soundName); this.ShootIntervalInMiliseconds = (int)(1000 / (RateOfFire * oneSixtieth)); } diff --git a/Sources/Sandbox.Game/Game/Weapons/Ammo/MyAmmoConstants.cs b/Sources/Sandbox.Game/Game/Weapons/Ammo/MyAmmoConstants.cs index 9f53c197b..34dc87173 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Ammo/MyAmmoConstants.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Ammo/MyAmmoConstants.cs @@ -88,11 +88,6 @@ public int CurrentWeaponRateOfFire get { return m_weaponDefinition.WeaponAmmoDatas[(int)AmmoDefinition.AmmoType].RateOfFire; } } - public int CurrentWeaponBurstFireRate - { - get { return m_weaponDefinition.WeaponAmmoDatas[(int)AmmoDefinition.AmmoType].BurstFireRate; } - } - public int CurrentWeaponShootIntervalInMiliseconds { get { return m_weaponDefinition.WeaponAmmoDatas[(int)AmmoDefinition.AmmoType].ShootIntervalInMiliseconds; } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/Barrels/MyLargeMissileBarrel.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/Barrels/MyLargeMissileBarrel.cs index 1e3baf430..ad4296c8d 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/Barrels/MyLargeMissileBarrel.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/Barrels/MyLargeMissileBarrel.cs @@ -24,18 +24,11 @@ class MyLargeMissileBarrel : MyLargeBarrelBase private int m_burstFireTime_ms = 0; private int m_burstFireTimeLoadingIntervalConst_ms = 2000; private bool m_burstFinish = false; + private const int m_burstFireCount = 4; private int m_burstToFire = 0; private MyEntity3DSoundEmitter m_soundEmitter; - private int BurstFireRate - { - get - { - return this.GunBase.BurstFireRate; - } - } - public MyLargeMissileBarrel() { m_soundEmitter = new MyEntity3DSoundEmitter(m_entity); @@ -56,7 +49,7 @@ public override void Init(MyEntity entity, MyLargeTurretBase turretBase) public void Init(Matrix localMatrix, MyLargeTurretBase parentObject) { - m_burstToFire = BurstFireRate; + m_burstToFire = m_burstFireCount; m_burstFireTime_ms = MySandboxGame.TotalGamePlayTimeInMilliseconds; m_burstFireTime_ms = MySandboxGame.TotalGamePlayTimeInMilliseconds; @@ -97,7 +90,7 @@ public override bool StartShooting() MyHud.Notifications.Add(reloadingNotification); } m_burstFireTime_ms = MySandboxGame.TotalGamePlayTimeInMilliseconds; - m_burstToFire = BurstFireRate; + m_burstToFire = m_burstFireCount; m_burstFinish = true; } if ((MySandboxGame.TotalGamePlayTimeInMilliseconds - m_burstFireTime_ms) > m_burstFireTimeLoadingIntervalConst_ms) diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyGunBase.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyGunBase.cs index 779153c6e..19a550877 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyGunBase.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyGunBase.cs @@ -79,7 +79,6 @@ public float BackkickForcePerSecond public bool HasAmmoMagazines { get { return m_weaponProperties.WeaponDefinition.HasAmmoMagazines(); } } public bool IsAmmoProjectile { get { return m_weaponProperties.IsAmmoProjectile; } } public bool IsAmmoMissile { get { return m_weaponProperties.IsAmmoMissile; } } - public int BurstFireRate { get { return m_weaponProperties.CurrentWeaponBurstFireRate; } } public bool HasDummies { get { return m_dummiesByAmmoType.Count > 0; } } public MatrixD WorldMatrix diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncherReload.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncherReload.cs index 2ac5d52b8..c73a59212 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncherReload.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncherReload.cs @@ -21,19 +21,12 @@ namespace Sandbox.Game.Weapons [MyCubeBlockType(typeof(MyObjectBuilder_SmallMissileLauncherReload))] class MySmallMissileLauncherReload : MySmallMissileLauncher, IMySmallMissileLauncherReload { + const int NUM_ROCKETS_TO_COOLDOWN = 4; const int COOLDOWN_TIME_MILISECONDS = 5000; int m_numRocketsShot = 0; private static readonly MyHudNotification MISSILE_RELOAD_NOTIFICATION = new MyHudNotification( MySpaceTexts.MissileLauncherReloadingNotification, COOLDOWN_TIME_MILISECONDS, level: MyNotificationLevel.Important); - private int BurstFireRate - { - get - { - return this.GunBase.BurstFireRate; - } - } - static MySmallMissileLauncherReload() { var useConveyor = new MyTerminalControlOnOffSwitch("UseConveyor", MySpaceTexts.Terminal_UseConveyorSystem); @@ -47,11 +40,11 @@ static MySmallMissileLauncherReload() override public void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction) { //small reloadable launcher have cooldown - if ((BurstFireRate == m_numRocketsShot) && (COOLDOWN_TIME_MILISECONDS > MySandboxGame.TotalGamePlayTimeInMilliseconds - m_lastTimeShoot)) + if ((NUM_ROCKETS_TO_COOLDOWN == m_numRocketsShot) && (COOLDOWN_TIME_MILISECONDS > MySandboxGame.TotalGamePlayTimeInMilliseconds - m_lastTimeShoot)) { return; } - if (BurstFireRate == m_numRocketsShot) + if (NUM_ROCKETS_TO_COOLDOWN == m_numRocketsShot) { m_numRocketsShot = 0; } @@ -59,7 +52,7 @@ override public void Shoot(MyShootActionEnum action, Vector3 direction, string g base.Shoot(action, direction, gunAction); - if (m_numRocketsShot == BurstFireRate) + if (m_numRocketsShot == NUM_ROCKETS_TO_COOLDOWN) { MyHud.Notifications.Add(MISSILE_RELOAD_NOTIFICATION); } diff --git a/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_WeaponDefinition.cs b/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_WeaponDefinition.cs index ba80881c1..926db7583 100644 --- a/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_WeaponDefinition.cs +++ b/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_WeaponDefinition.cs @@ -16,9 +16,6 @@ public class WeaponAmmoData [XmlAttribute] public string ShootSoundName; - - [XmlAttribute] - public int BurstFireRate = 4; } [ProtoContract]