Loaded sounds are properly freed, ObjectProperty optimization, expanded skill effects (rangedweapon accuracy, welding efficiency, electrical shocks), armored wearables + ballistic vest & helmet

This commit is contained in:
Regalis
2015-09-28 19:48:31 +03:00
parent 97c3ac1412
commit cc16bb3ad7
34 changed files with 411 additions and 183 deletions

View File

@@ -15,6 +15,7 @@ using System.Xml.Linq;
namespace Subsurface
{
class Character : Entity, IDamageable, IPropertyObject
{
public static List<Character> CharacterList = new List<Character>();
@@ -170,6 +171,12 @@ namespace Subsurface
}
}
public float Stun
{
get { return AnimController.StunTimer; }
set { StartStun(value); }
}
public float Health
{
get
@@ -873,8 +880,7 @@ namespace Subsurface
public AttackResult AddDamage(Vector2 simPosition, DamageType damageType, float amount, float bleedingAmount, float stun, bool playSound)
{
AnimController.StunTimer = Math.Max(AnimController.StunTimer, stun);
StartStun(stun);
if (controlled == this) CharacterHUD.TakeDamage();
Limb closestLimb = null;
@@ -901,14 +907,11 @@ namespace Subsurface
return attackResult;
}
public void Stun()
public void StartStun(float stunTimer)
{
//for (int i = 0; i < selectedItems.Length; i++ )
//{
// if (selectedItems[i] == null) continue;
// selectedItems[i].Drop();
// selectedItems[i] = null;
//}
if (stunTimer <= 0.0f) return;
AnimController.StunTimer = Math.Max(AnimController.StunTimer, stunTimer);
selectedConstruction = null;
}
@@ -1268,7 +1271,7 @@ namespace Subsurface
}
catch { return; }
AnimController.StunTimer = newStunTimer;
StartStun(newStunTimer);
Health = newHealth;
LargeUpdateTimer = 1;