Merge remote-tracking branch 'upstream/stable' into ed-29-10-2024-upstream
# Conflicts: # Content.Server/Chat/Managers/ChatSanitizationManager.cs # Content.Server/Temperature/Systems/TemperatureSystem.cs # Content.Shared/Localizations/ContentLocalizationManager.cs
This commit is contained in:
@@ -440,7 +440,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
DoLungeAnimation(user, weaponUid, weapon.Angle, GetCoordinates(attack.Coordinates).ToMap(EntityManager, TransformSystem), weapon.Range, animation);
|
||||
DoLungeAnimation(user, weaponUid, weapon.Angle, TransformSystem.ToMapCoordinates(GetCoordinates(attack.Coordinates)), weapon.Range, animation);
|
||||
}
|
||||
|
||||
var attackEv = new MeleeAttackEvent(weaponUid);
|
||||
@@ -472,12 +472,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
// TODO: This needs fixing
|
||||
if (meleeUid == user)
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Low,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):actor} melee attacked (light) using their hands and missed");
|
||||
}
|
||||
else
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Low,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):actor} melee attacked (light) using {ToPrettyString(meleeUid):tool} and missed");
|
||||
}
|
||||
var missEvent = new MeleeHitEvent(new List<EntityUid>(), user, meleeUid, damage, null);
|
||||
@@ -526,12 +528,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
|
||||
if (meleeUid == user)
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Medium,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Medium,
|
||||
$"{ToPrettyString(user):actor} melee attacked (light) {ToPrettyString(target.Value):subject} using their hands and dealt {damageResult.GetTotal():damage} damage");
|
||||
}
|
||||
else
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Medium,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Medium,
|
||||
$"{ToPrettyString(user):actor} melee attacked (light) {ToPrettyString(target.Value):subject} using {ToPrettyString(meleeUid):tool} and dealt {damageResult.GetTotal():damage} damage");
|
||||
}
|
||||
|
||||
@@ -553,7 +557,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
if (!TryComp(user, out TransformComponent? userXform))
|
||||
return false;
|
||||
|
||||
var targetMap = GetCoordinates(ev.Coordinates).ToMap(EntityManager, TransformSystem);
|
||||
var targetMap = TransformSystem.ToMapCoordinates(GetCoordinates(ev.Coordinates));
|
||||
|
||||
if (targetMap.MapId != userXform.MapID)
|
||||
return false;
|
||||
@@ -569,12 +573,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
{
|
||||
if (meleeUid == user)
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Low,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):actor} melee attacked (heavy) using their hands and missed");
|
||||
}
|
||||
else
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Low,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):actor} melee attacked (heavy) using {ToPrettyString(meleeUid):tool} and missed");
|
||||
}
|
||||
var missEvent = new MeleeHitEvent(new List<EntityUid>(), user, meleeUid, damage, direction);
|
||||
@@ -595,8 +601,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
// Validate client
|
||||
for (var i = entities.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (ArcRaySuccessful(entities[i], userPos, direction.ToWorldAngle(), component.Angle, distance,
|
||||
userXform.MapID, user, session))
|
||||
if (ArcRaySuccessful(entities[i],
|
||||
userPos,
|
||||
direction.ToWorldAngle(),
|
||||
component.Angle,
|
||||
distance,
|
||||
userXform.MapID,
|
||||
user,
|
||||
session))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -663,16 +675,24 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
|
||||
if (damageResult != null && damageResult.GetTotal() > FixedPoint2.Zero)
|
||||
{
|
||||
// If the target has stamina and is taking blunt damage, they should also take stamina damage based on their blunt to stamina factor
|
||||
if (damageResult.DamageDict.TryGetValue("Blunt", out var bluntDamage))
|
||||
{
|
||||
_stamina.TakeStaminaDamage(entity, (bluntDamage * component.BluntStaminaDamageFactor).Float(), visual: false, source: user, with: meleeUid == user ? null : meleeUid);
|
||||
}
|
||||
|
||||
appliedDamage += damageResult;
|
||||
|
||||
if (meleeUid == user)
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Medium,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Medium,
|
||||
$"{ToPrettyString(user):actor} melee attacked (heavy) {ToPrettyString(entity):subject} using their hands and dealt {damageResult.GetTotal():damage} damage");
|
||||
}
|
||||
else
|
||||
{
|
||||
AdminLogger.Add(LogType.MeleeHit, LogImpact.Medium,
|
||||
AdminLogger.Add(LogType.MeleeHit,
|
||||
LogImpact.Medium,
|
||||
$"{ToPrettyString(user):actor} melee attacked (heavy) {ToPrettyString(entity):subject} using {ToPrettyString(meleeUid):tool} and dealt {damageResult.GetTotal():damage} damage");
|
||||
}
|
||||
}
|
||||
@@ -706,8 +726,13 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
{
|
||||
var castAngle = new Angle(baseAngle + increment * i);
|
||||
var res = _physics.IntersectRay(mapId,
|
||||
new CollisionRay(position, castAngle.ToWorldVec(),
|
||||
AttackMask), range, ignore, false).ToList();
|
||||
new CollisionRay(position,
|
||||
castAngle.ToWorldVec(),
|
||||
AttackMask),
|
||||
range,
|
||||
ignore,
|
||||
false)
|
||||
.ToList();
|
||||
|
||||
if (res.Count != 0)
|
||||
{
|
||||
@@ -718,8 +743,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
return resSet;
|
||||
}
|
||||
|
||||
protected virtual bool ArcRaySuccessful(EntityUid targetUid, Vector2 position, Angle angle, Angle arcWidth, float range,
|
||||
MapId mapId, EntityUid ignore, ICommonSession? session)
|
||||
protected virtual bool ArcRaySuccessful(EntityUid targetUid,
|
||||
Vector2 position,
|
||||
Angle angle,
|
||||
Angle arcWidth,
|
||||
float range,
|
||||
MapId mapId,
|
||||
EntityUid ignore,
|
||||
ICommonSession? session)
|
||||
{
|
||||
// Only matters for server.
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user