v1.6.17.0 (Unto the Breach update)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
namespace Barotrauma.Items.Components
|
||||
@@ -23,7 +23,7 @@ namespace Barotrauma.Items.Components
|
||||
public string OwnerTags
|
||||
{
|
||||
get => string.Join(',', OwnerTagSet);
|
||||
set => OwnerTagSet = value.Split(',').ToIdentifiers().ToImmutableHashSet();
|
||||
set => OwnerTagSet = value.ToIdentifiers().ToImmutableHashSet();
|
||||
}
|
||||
|
||||
[Serialize("", IsPropertySaveable.Yes, alwaysUseInstanceValues: true)]
|
||||
@@ -95,6 +95,10 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
item.AddTag(s);
|
||||
}
|
||||
if (GameMain.GameSession?.GameMode is PvPMode)
|
||||
{
|
||||
item.AddTag($"id_{character.TeamID}".ToIdentifier());
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(spawnPoint.IdCardDesc))
|
||||
{
|
||||
item.Description = Description = spawnPoint.IdCardDesc;
|
||||
|
||||
@@ -174,9 +174,11 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void Drop(Character dropper, bool setTransform = true)
|
||||
{
|
||||
//end hit first (which sets the weapon to the "held" state, with disabled physics and no special collision detection)
|
||||
EndHit();
|
||||
//ensure the physics body is enabled
|
||||
item.body.PhysEnabled = true;
|
||||
base.Drop(dropper, setTransform);
|
||||
hitting = false;
|
||||
hitPos = 0.0f;
|
||||
}
|
||||
|
||||
public override void UpdateBroken(float deltaTime, Camera cam)
|
||||
@@ -251,10 +253,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
if (hitPos < -MathHelper.Pi)
|
||||
{
|
||||
RestoreCollision();
|
||||
hitting = false;
|
||||
hitTargets.Clear();
|
||||
hitPos = 0;
|
||||
EndHit();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -291,6 +290,14 @@ namespace Barotrauma.Items.Components
|
||||
User = character;
|
||||
}
|
||||
|
||||
private void EndHit()
|
||||
{
|
||||
RestoreCollision();
|
||||
hitting = false;
|
||||
hitTargets.Clear();
|
||||
hitPos = 0;
|
||||
}
|
||||
|
||||
private void RestoreCollision()
|
||||
{
|
||||
impactQueue.Clear();
|
||||
@@ -380,6 +387,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
else if (f2.Body.UserData is Holdable holdable && holdable.CanPush)
|
||||
{
|
||||
if (holdable.Item.GetRootInventoryOwner() == User) { return false; }
|
||||
hitTargets.Add(holdable.Item);
|
||||
}
|
||||
}
|
||||
@@ -475,8 +483,8 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
if (GameMain.NetworkMember is { IsServer: true } server && targetEntity != null)
|
||||
{
|
||||
server.CreateEntityEvent(item, new Item.ApplyStatusEffectEventData(conditionalActionType, targetItemComponent: null, targetCharacter, targetLimb, useTarget: targetEntity));
|
||||
server.CreateEntityEvent(item, new Item.ApplyStatusEffectEventData(ActionType.OnUse, targetItemComponent: null, targetCharacter, targetLimb, useTarget: targetEntity));
|
||||
server.CreateEntityEvent(item, new Item.ApplyStatusEffectEventData(conditionalActionType, targetItemComponent: this, targetCharacter, targetLimb, useTarget: targetEntity));
|
||||
server.CreateEntityEvent(item, new Item.ApplyStatusEffectEventData(ActionType.OnUse, targetItemComponent: this, targetCharacter, targetLimb, useTarget: targetEntity));
|
||||
serverLogger ??= new System.Text.StringBuilder();
|
||||
serverLogger.Clear();
|
||||
serverLogger.Append($"{picker?.LogName} used {item.Name}");
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
IsActive = true;
|
||||
float baseReloadTime = reload;
|
||||
float weaponSkill = character.GetSkillLevel("weapons");
|
||||
float weaponSkill = character.GetSkillLevel(Tags.WeaponsSkill);
|
||||
|
||||
bool applyReloadFailure = ReloadSkillRequirement > 0 && ReloadNoSkill > reload && weaponSkill < ReloadSkillRequirement;
|
||||
if (applyReloadFailure)
|
||||
@@ -291,6 +291,9 @@ namespace Barotrauma.Items.Components
|
||||
var lastProjectile = LastProjectile;
|
||||
if (lastProjectile != projectile)
|
||||
{
|
||||
//Note that we always snap the rope here, unlike when firing a rope from a turret.
|
||||
//That's because handheld RangedWeapons have some special logic for handling the rope,
|
||||
//which doesn't support multiple attached ropes (see Holdable.GetRope and the references to it)
|
||||
lastProjectile?.Item.GetComponent<Rope>()?.Snap();
|
||||
}
|
||||
float damageMultiplier = (1f + item.GetQualityModifier(Quality.StatType.FirepowerMultiplier)) * WeaponDamageModifier;
|
||||
|
||||
@@ -764,7 +764,7 @@ namespace Barotrauma.Items.Components
|
||||
if (!character.AnimController.InWater && character.AnimController is HumanoidAnimController humanAnim &&
|
||||
Math.Abs(fromCharacterToLeak.X) < 100.0f && fromCharacterToLeak.Y < 0.0f && fromCharacterToLeak.Y > -150.0f)
|
||||
{
|
||||
humanAnim.Crouching = true;
|
||||
humanAnim.Crouch();
|
||||
}
|
||||
}
|
||||
if (!character.IsClimbing)
|
||||
|
||||
Reference in New Issue
Block a user