Skip to content

Commit

Permalink
Merge pull request #687 from jrodrigv/master
Browse files Browse the repository at this point in the history
PR for release KSP 1.7
  • Loading branch information
jrodrigv authored May 1, 2019
2 parents 077b565 + f9dede4 commit 24504c2
Show file tree
Hide file tree
Showing 219 changed files with 11,349 additions and 11,507 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,6 @@ BDArmory/LocalDev/Refs/UnityEngine.dll
/Binaries
/BDArmory/Distribution/GameData/BDArmory/Plugins
/BDArmory/_ReSharper.Caches/ReSharperPlatformVs15182_74c703de.BDArmory.00
/packages/Microsoft.Net.Compilers.2.8.0
/_ReSharper.Caches/ReSharperPlatformVs15182_74c703de.BDArmory.00
/BDArmory/_ReSharper.Caches/ReSharperPlatformVs15183_74c703de.BDArmory.00
5 changes: 4 additions & 1 deletion BDArmory.Core/BDAPersistantSettingsField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class BDAPersistantSettingsField : Attribute
public BDAPersistantSettingsField()
{
}

public static void Save()
{
ConfigNode fileNode = ConfigNode.Load(BDArmorySettings.settingsConfigURL);
Expand All @@ -33,6 +34,7 @@ public static void Save()
field.Dispose();
fileNode.Save(BDArmorySettings.settingsConfigURL);
}

public static void Load()
{
ConfigNode fileNode = ConfigNode.Load(BDArmorySettings.settingsConfigURL);
Expand All @@ -55,6 +57,7 @@ public static void Load()
}
field.Dispose();
}

public static object ParseValue(Type type, string value)
{
if (type == typeof(string))
Expand Down Expand Up @@ -104,4 +107,4 @@ public static object ParseValue(Type type, string value)
return null;
}
}
}
}
10 changes: 5 additions & 5 deletions BDArmory.Core/BDArmorySettings.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@

namespace BDArmory.Core
namespace BDArmory.Core
{
public class BDArmorySettings
{
public static string settingsConfigURL = "GameData/BDArmory/settings.cfg";

[BDAPersistantSettingsField] public static bool INSTAKILL = false;
[BDAPersistantSettingsField] public static bool BULLET_HITS = true;
[BDAPersistantSettingsField] public static bool BULLET_DECALS = true;
[BDAPersistantSettingsField] public static int MAX_NUM_BULLET_DECALS = 200;
[BDAPersistantSettingsField] public static float PHYSICS_RANGE = 0; //TODO: remove all references to this so it can be deprecated!
[BDAPersistantSettingsField] public static bool SHOW_AMMO_GAUGES = false;
[BDAPersistantSettingsField] public static bool EJECT_SHELLS = true;
[BDAPersistantSettingsField] public static bool SHELL_COLLISIONS = true;
[BDAPersistantSettingsField] public static bool INFINITE_AMMO = false;
Expand All @@ -21,7 +20,6 @@ public class BDArmorySettings
[BDAPersistantSettingsField] public static bool BOMB_CLEARANCE_CHECK = true;
[BDAPersistantSettingsField] public static float MAX_BULLET_RANGE = 8000f; //TODO: remove all references to this so it can be deprecated! all ranges should be supplied in part config!
[BDAPersistantSettingsField] public static float TRIGGER_HOLD_TIME = 0.3f;
[BDAPersistantSettingsField] public static bool ALLOW_LEGACY_TARGETING = true; //TODO: remove all references to this so it can be deprecated! legacy targeting should not be support anymore in future versions.
[BDAPersistantSettingsField] public static float TARGET_CAM_RESOLUTION = 1024f;
[BDAPersistantSettingsField] public static bool BW_TARGET_CAM = true;
[BDAPersistantSettingsField] public static float SMOKE_DEFLECTION_FACTOR = 10f;
Expand Down Expand Up @@ -58,5 +56,7 @@ public class BDArmorySettings
[BDAPersistantSettingsField] public static int MAX_FIRES_PER_VESSEL = 10; //controls fx for penetration only for landed or splashed
[BDAPersistantSettingsField] public static float FIRELIFETIME_IN_SECONDS = 90f; //controls fx for penetration only for landed or splashed
[BDAPersistantSettingsField] public static bool PERFORMANCE_LOGGING = false;
[BDAPersistantSettingsField] public static bool AUTOCATEGORIZE_PARTS = true;
[BDAPersistantSettingsField] public static bool SHOW_CATEGORIES = false;
}
}
4 changes: 2 additions & 2 deletions BDArmory.Core/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
namespace BDArmory.Core
{
[KSPAddon(KSPAddon.Startup.Flight, false)]
public class Bootstrapper :MonoBehaviour
public class Bootstrapper : MonoBehaviour
{
private void Awake()
{
{
Dependencies.Register<DamageService, ModuleDamageService>();
}
}
Expand Down
7 changes: 1 addition & 6 deletions BDArmory.Core/BuildingDamage.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using UnityEngine;

namespace BDArmory.Core
Expand All @@ -19,8 +16,6 @@ public override void OnAwake()
building.damageDecay = 600f;
building.impactMomentumThreshold *= 150;
}

}

}
}
8 changes: 4 additions & 4 deletions BDArmory.Core/Dependencies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

namespace BDArmory.Core
{
public static class Dependencies
public static class Dependencies
{
private static readonly Dictionary<Type, object> Systems = new Dictionary<Type, object>();
public static void Register<T,TN>()

public static void Register<T, TN>()
{
if (!Systems.ContainsKey(typeof(T)))
{

Systems.Add(typeof(T), Activator.CreateInstance<TN>());
Systems.Add(typeof(T), Activator.CreateInstance<TN>());
}
}

Expand Down
2 changes: 1 addition & 1 deletion BDArmory.Core/Enum/DamageOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ public enum DamageOperation
Set = 0,
Add = 1
}
}
}
2 changes: 1 addition & 1 deletion BDArmory.Core/Events/DamageEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public class DamageEventArgs : EventArgs
public float Armor { get; set; }
public DamageOperation Operation { get; set; }
}
}
}
5 changes: 1 addition & 4 deletions BDArmory.Core/Extension/DamageFX.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class DamageFX : MonoBehaviour

public void Start()
{

}

public void FixedUpdate()
Expand All @@ -26,22 +25,20 @@ public void FixedUpdate()
}
}


public static void SetEngineDamage(Part part)
{
ModuleEngines engine;
engine = part.GetComponent<ModuleEngines>();
engine.flameout = true;
engine.heatProduction *= 1.0125f;
engine.maxThrust *= 0.825f;
engine.maxThrust *= 0.825f;
}

public static void SetWingDamage(Part part)
{
ModuleLiftingSurface wing;
wing = part.GetComponent<ModuleLiftingSurface>();
wing.deflectionLiftCoeff *= 0.825f;

}
}
}
Loading

0 comments on commit 24504c2

Please sign in to comment.