Fixed carrying stunned people being a severe case of a major ass pain by carrying over the "stairs" from the carrier.
Added "CarriedBy" property, publicized CarriedCharacter and CarriedBy, synced CarriedCharacter and CarriedBy for cool points Publicized Stairs property
This commit is contained in:
@@ -94,7 +94,7 @@ namespace Barotrauma
|
||||
protected float minHealth, maxHealth;
|
||||
|
||||
protected Item focusedItem;
|
||||
private Character focusedCharacter, selectedCharacter;
|
||||
private Character focusedCharacter, selectedCharacter, selectedBy;
|
||||
|
||||
private bool isDead;
|
||||
private CauseOfDeath lastAttackCauseOfDeath;
|
||||
@@ -204,6 +204,27 @@ namespace Barotrauma
|
||||
public Character SelectedCharacter
|
||||
{
|
||||
get { return selectedCharacter; }
|
||||
set
|
||||
{
|
||||
if (selectedCharacter != null)
|
||||
selectedCharacter.selectedBy = null;
|
||||
selectedCharacter = value;
|
||||
if (selectedCharacter != null)
|
||||
selectedCharacter.selectedBy = this;
|
||||
}
|
||||
}
|
||||
|
||||
public Character SelectedBy
|
||||
{
|
||||
get { return selectedBy; }
|
||||
set
|
||||
{
|
||||
if (selectedBy != null)
|
||||
selectedBy.selectedCharacter = null;
|
||||
selectedBy = value;
|
||||
if (selectedBy != null)
|
||||
selectedBy.selectedCharacter = this;
|
||||
}
|
||||
}
|
||||
|
||||
private float lowPassMultiplier;
|
||||
@@ -772,7 +793,7 @@ namespace Barotrauma
|
||||
// - dragging someone
|
||||
// - crouching
|
||||
// - moving backwards
|
||||
if (selectedCharacter == null &&
|
||||
if (SelectedCharacter == null &&
|
||||
(!(AnimController is HumanoidAnimController) || !((HumanoidAnimController)AnimController).Crouching) &&
|
||||
Math.Sign(targetMovement.X) != -Math.Sign(AnimController.Dir))
|
||||
{
|
||||
@@ -919,9 +940,9 @@ namespace Barotrauma
|
||||
if (selectedConstruction != null && IsKeyDown(InputType.Aim)) selectedConstruction.SecondaryUse(deltaTime, this);
|
||||
}
|
||||
|
||||
if (selectedCharacter != null)
|
||||
if (SelectedCharacter != null)
|
||||
{
|
||||
if (Vector2.DistanceSquared(selectedCharacter.WorldPosition, WorldPosition) > 90000.0f || !selectedCharacter.CanBeSelected)
|
||||
if (Vector2.DistanceSquared(SelectedCharacter.WorldPosition, WorldPosition) > 90000.0f || !SelectedCharacter.CanBeSelected)
|
||||
{
|
||||
DeselectCharacter();
|
||||
}
|
||||
@@ -993,7 +1014,7 @@ namespace Barotrauma
|
||||
var owner = (Character)inventory.Owner;
|
||||
|
||||
//can only be accessed if the character is incapacitated and has been selected
|
||||
return selectedCharacter == owner && (!owner.CanInteract);
|
||||
return SelectedCharacter == owner && (!owner.CanInteract);
|
||||
}
|
||||
|
||||
if (inventory.Owner is Item)
|
||||
@@ -1222,22 +1243,22 @@ namespace Barotrauma
|
||||
{
|
||||
if (character == null) return;
|
||||
|
||||
selectedCharacter = character;
|
||||
SelectedCharacter = character;
|
||||
}
|
||||
|
||||
public void DeselectCharacter()
|
||||
{
|
||||
if (selectedCharacter == null) return;
|
||||
if (SelectedCharacter == null) return;
|
||||
|
||||
if (SelectedCharacter.AnimController != null)
|
||||
{
|
||||
foreach (Limb limb in selectedCharacter.AnimController.Limbs)
|
||||
foreach (Limb limb in SelectedCharacter.AnimController.Limbs)
|
||||
{
|
||||
if (limb.pullJoint != null) limb.pullJoint.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
selectedCharacter = null;
|
||||
SelectedCharacter = null;
|
||||
}
|
||||
|
||||
public void DoInteractionUpdate(float deltaTime, Vector2 mouseSimPos)
|
||||
@@ -1250,7 +1271,7 @@ namespace Barotrauma
|
||||
|
||||
if (!CanInteract)
|
||||
{
|
||||
if (selectedCharacter != null)
|
||||
if (SelectedCharacter != null)
|
||||
{
|
||||
DeselectCharacter();
|
||||
}
|
||||
@@ -1283,7 +1304,7 @@ namespace Barotrauma
|
||||
findFocusedTimer -= deltaTime;
|
||||
}
|
||||
|
||||
if (selectedCharacter != null && IsKeyHit(InputType.Select))
|
||||
if (SelectedCharacter != null && IsKeyHit(InputType.Select))
|
||||
{
|
||||
DeselectCharacter();
|
||||
}
|
||||
@@ -1470,9 +1491,9 @@ namespace Barotrauma
|
||||
selectedConstruction = null;
|
||||
}
|
||||
|
||||
if (selectedCharacter != null && AnimController.Anim == AnimController.Animation.CPR)
|
||||
if (SelectedCharacter != null && AnimController.Anim == AnimController.Animation.CPR)
|
||||
{
|
||||
if (GameMain.Client == null) selectedCharacter.Oxygen += (GetSkillLevel("Medical") / 10.0f) * deltaTime;
|
||||
if (GameMain.Client == null) SelectedCharacter.Oxygen += (GetSkillLevel("Medical") / 10.0f) * deltaTime;
|
||||
}
|
||||
|
||||
UpdateSightRange();
|
||||
@@ -1861,7 +1882,7 @@ namespace Barotrauma
|
||||
foreach (Character c in CharacterList)
|
||||
{
|
||||
if (c.focusedCharacter == this) c.focusedCharacter = null;
|
||||
if (c.selectedCharacter == this) c.selectedCharacter = null;
|
||||
if (c.SelectedCharacter == this) c.SelectedCharacter = null;
|
||||
}
|
||||
}
|
||||
partial void DisposeProjSpecific();
|
||||
|
||||
Reference in New Issue
Block a user