- special death messages for husk infections

- fixed husk infections not being removed from clients
- more accurate bleeding indicators
- humanoid standing anim tweaking
This commit is contained in:
Regalis
2016-08-28 20:17:00 +03:00
parent 202f959bd2
commit 2c5d272acd
6 changed files with 33 additions and 30 deletions
+2 -1
View File
@@ -11,6 +11,7 @@
<CauseOfDeath.Suffocation>Suffocated</CauseOfDeath.Suffocation> <CauseOfDeath.Suffocation>Suffocated</CauseOfDeath.Suffocation>
<CauseOfDeath.Pressure>Crushed by water pressure</CauseOfDeath.Pressure> <CauseOfDeath.Pressure>Crushed by water pressure</CauseOfDeath.Pressure>
<CauseOfDeath.Burn>Burned to death</CauseOfDeath.Burn> <CauseOfDeath.Burn>Burned to death</CauseOfDeath.Burn>
<CauseOfDeath.Husk>Taken over by a parasite</CauseOfDeath.Husk>
<CauseOfDeath.Disconnected>Disconnected</CauseOfDeath.Disconnected> <CauseOfDeath.Disconnected>Disconnected</CauseOfDeath.Disconnected>
<Self_CauseOfDeath.Damage>You have succumbed to your injuries.</Self_CauseOfDeath.Damage> <Self_CauseOfDeath.Damage>You have succumbed to your injuries.</Self_CauseOfDeath.Damage>
@@ -19,6 +20,7 @@
<Self_CauseOfDeath.Suffocation>You have suffocated.</Self_CauseOfDeath.Suffocation> <Self_CauseOfDeath.Suffocation>You have suffocated.</Self_CauseOfDeath.Suffocation>
<Self_CauseOfDeath.Pressure>You have been crushed by water pressure.</Self_CauseOfDeath.Pressure> <Self_CauseOfDeath.Pressure>You have been crushed by water pressure.</Self_CauseOfDeath.Pressure>
<Self_CauseOfDeath.Burn>You have burned to death.</Self_CauseOfDeath.Burn> <Self_CauseOfDeath.Burn>You have burned to death.</Self_CauseOfDeath.Burn>
<Self_CauseOfDeath.Husk>The parasite has taken over your body.</Self_CauseOfDeath.Husk>
<Self_CauseOfDeath.Disconnected>You have been disconnected from the server.</Self_CauseOfDeath.Disconnected> <Self_CauseOfDeath.Disconnected>You have been disconnected from the server.</Self_CauseOfDeath.Disconnected>
<HuskDormant>Your throat feels sore</HuskDormant> <HuskDormant>Your throat feels sore</HuskDormant>
@@ -28,7 +30,6 @@
<HuskCantSpeak>You feel something moving in your throat. You try to scream but no sound comes out.</HuskCantSpeak> <HuskCantSpeak>You feel something moving in your throat. You try to scream but no sound comes out.</HuskCantSpeak>
<HuskActivate>A strange chitinous appendage bursts out from your mouth. Use it to inject eggs into a living body by pressing [Attack]!</HuskActivate> <HuskActivate>A strange chitinous appendage bursts out from your mouth. Use it to inject eggs into a living body by pressing [Attack]!</HuskActivate>
@@ -338,13 +338,13 @@ namespace Barotrauma
if (!onGround || (LowestLimb.SimPosition.Y - floorY > 0.5f && stairs == null)) return; if (!onGround || (LowestLimb.SimPosition.Y - floorY > 0.5f && stairs == null)) return;
float? ceilingY = null; //float? ceilingY = null;
if (Submarine.PickBody(head.SimPosition, head.SimPosition + Vector2.UnitY, null, Physics.CollisionWall)!=null) //if (Submarine.PickBody(head.SimPosition, head.SimPosition + Vector2.UnitY, null, Physics.CollisionWall)!=null)
{ //{
ceilingY = Submarine.LastPickedPosition.Y; // ceilingY = Submarine.LastPickedPosition.Y;
if (ceilingY - floorY < HeadPosition) Crouching = true; // if (ceilingY - floorY < HeadPosition) Crouching = true;
} //}
getUpSpeed = getUpSpeed * Math.Max(head.SimPosition.Y - colliderPos.Y, 0.5f); getUpSpeed = getUpSpeed * Math.Max(head.SimPosition.Y - colliderPos.Y, 0.5f);
@@ -457,23 +457,19 @@ namespace Barotrauma
{ {
float movementFactor = (movement.X / 4.0f) * movement.X * Math.Sign(movement.X); float movementFactor = (movement.X / 4.0f) * movement.X * Math.Sign(movement.X);
for (int i = -1; i < 2; i += 2)
//MoveLimb(leftFoot, footPos, 2.5f);
for (int i = -1; i < 2; i+=2 )
{ {
Vector2 footPos = new Vector2( Vector2 footPos = new Vector2(
Crouching ? waist.SimPosition.X + Math.Sign(stepSize.X*i)*Dir*0.3f : waist.SimPosition.X, Crouching ? waist.SimPosition.X + Math.Sign(stepSize.X * i) * Dir * 0.3f : GetCenterOfMass().X,
colliderPos.Y - 0.2f); colliderPos.Y - 0.1f);
var foot = i == -1 ? rightFoot : leftFoot; var foot = i == -1 ? rightFoot : leftFoot;
MoveLimb(foot, footPos, Math.Abs(foot.SimPosition.X - footPos.X)*50.0f); MoveLimb(foot, footPos, Math.Abs(foot.SimPosition.X - footPos.X) * 100.0f, true);
} }
leftFoot.body.SmoothRotate(Dir * MathHelper.PiOver2, 5.0f); leftFoot.body.SmoothRotate(Dir * MathHelper.PiOver2, 50.0f);
rightFoot.body.SmoothRotate(Dir * MathHelper.PiOver2, 5.0f); rightFoot.body.SmoothRotate(Dir * MathHelper.PiOver2, 50.0f);
if (!rightHand.Disabled) if (!rightHand.Disabled)
{ {
@@ -1183,7 +1179,7 @@ namespace Barotrauma
Vector2 position = limb.SimPosition; Vector2 position = limb.SimPosition;
if (!limb.pullJoint.Enabled && mirror) if ((limb.pullJoint==null || !limb.pullJoint.Enabled) && mirror)
{ {
difference = limb.body.SimPosition - torso.SimPosition; difference = limb.body.SimPosition - torso.SimPosition;
difference = Vector2.Transform(difference, torsoTransform); difference = Vector2.Transform(difference, torsoTransform);
+1 -1
View File
@@ -9,7 +9,7 @@ namespace Barotrauma
{ {
enum CauseOfDeath enum CauseOfDeath
{ {
Damage, Bloodloss, Pressure, Suffocation, Drowning, Burn, Disconnected Damage, Bloodloss, Pressure, Suffocation, Drowning, Burn, Husk, Disconnected
} }
public enum DamageType { None, Blunt, Slash, Burn } public enum DamageType { None, Blunt, Slash, Burn }
+6 -1
View File
@@ -1816,6 +1816,7 @@ namespace Barotrauma
bleeding = 0.0f; bleeding = 0.0f;
Oxygen = 100.0f; Oxygen = 100.0f;
AnimController.StunTimer = 0.0f; AnimController.StunTimer = 0.0f;
huskInfection = null;
return true; return true;
} }
@@ -1827,7 +1828,11 @@ namespace Barotrauma
if (message.ReadBoolean()) if (message.ReadBoolean())
{ {
HuskInfectionState = message.ReadRangedSingle(0.0f, 1.0f, 4); float infectionState = message.ReadRangedSingle(0.0f, 1.0f, 4);
if (infectionState == 0.0f)
huskInfection = null;
else
HuskInfectionState = infectionState;
} }
break; break;
+5 -4
View File
@@ -233,11 +233,12 @@ namespace Barotrauma
healthBar.Draw(spriteBatch); healthBar.Draw(spriteBatch);
} }
int bloodDropCount = (int)Math.Floor(character.Bleeding); float bloodDropCount = character.Bleeding;
bloodDropCount = MathHelper.Clamp(bloodDropCount, 0, 5); bloodDropCount = MathHelper.Clamp(bloodDropCount, 0.0f, 5.0f);
for (int i = 1; i < bloodDropCount; i++) for (int i = 0; i < Math.Ceiling(bloodDropCount); i++)
{ {
spriteBatch.Draw(statusIcons.Texture, new Vector2(5.0f + 20 * i, healthBar.Rect.Y - 20.0f), new Rectangle(39, 3, 15, 19), Color.White * 0.8f); float alpha = MathHelper.Clamp(bloodDropCount-i, 0.2f, 1.0f);
spriteBatch.Draw(statusIcons.Texture, new Vector2(25.0f + 20 * i, healthBar.Rect.Y - 20.0f), new Rectangle(39, 3, 15, 19), Color.White * alpha);
} }
float pressureFactor = (character.AnimController.CurrentHull == null) ? float pressureFactor = (character.AnimController.CurrentHull == null) ?
@@ -67,7 +67,7 @@ namespace Barotrauma
state = InfectionState.Dormant; state = InfectionState.Dormant;
IncubationTimer += 100* deltaTime / IncubationDuration; IncubationTimer += deltaTime / IncubationDuration;
if (Character.Controlled != character) return; if (Character.Controlled != character) return;
@@ -79,7 +79,7 @@ namespace Barotrauma
private void UpdateTransitionState(float deltaTime, Character character) private void UpdateTransitionState(float deltaTime, Character character)
{ {
IncubationTimer += deltaTime*10.0f/ IncubationDuration; IncubationTimer += deltaTime / IncubationDuration;
if (state == InfectionState.Dormant && Character.Controlled == character) if (state == InfectionState.Dormant && Character.Controlled == character)
{ {
@@ -98,7 +98,7 @@ namespace Barotrauma
state = InfectionState.Active; state = InfectionState.Active;
} }
character.AddDamage(CauseOfDeath.Damage, 0.5f*deltaTime, null); character.AddDamage(CauseOfDeath.Husk, 0.5f*deltaTime, null);
if (character.AnimController.limbJoints[0].LimitEnabled && if (character.AnimController.limbJoints[0].LimitEnabled &&
(character.AnimController.CurrentHull == null || (character.AnimController.CurrentHull == null ||