water ambience sounds change according to speed, oxygengenerator fills oxygen tanks even if their condition is 0, submarine refactoring & bugfixes, wire node editing bugfixes

This commit is contained in:
Regalis
2015-09-24 15:21:10 +03:00
parent f6966f06c3
commit bf7619bcc4
33 changed files with 635 additions and 490 deletions
@@ -10,6 +10,8 @@ namespace Subsurface
{
class AICharacter : Character
{
const float AttackBackPriority = 1.0f;
private AIController aiController;
public AICharacter(string file) : this(file, Vector2.Zero, null)
@@ -57,6 +59,15 @@ namespace Subsurface
aiController.Update(deltaTime);
}
public override AttackResult AddDamage(IDamageable attacker, Vector2 position, Attack attack, bool playSound = false)
{
AttackResult result = base.AddDamage(attacker, position, attack, playSound);
aiController.OnAttacked(attacker, (result.Damage + result.Bleeding)/Math.Max(health,1.0f));
return result;
}
public override void FillNetworkData(NetworkEventType type, NetOutgoingMessage message, object data)
{
if (type == NetworkEventType.KillCharacter)