Fixes & Tweaks (#356)

* Revert "captains sword reflect chance (#18133)"

This reverts commit e393eedd09.

* Mirror shield passive reflect

* Traitor stuff fixes and tweaks

* Connected dispenser click sound

* No medipen heavy attack

* Slice sound for blades

* Crossbow & material stacking fixes

* Hypospray fixes

* Chenge crossbow damage type

* Fix penetrating on land

* Antispam tweak
This commit is contained in:
Aviu00
2023-09-04 12:03:28 +03:00
committed by Aviu00
parent 800225271c
commit e64c1b7e81
23 changed files with 143 additions and 27 deletions

View File

@@ -216,9 +216,9 @@ namespace Content.Server.Chat.Managers
_utkaSocketWrapper.SendMessageToAll(asayEventMessage);
}
public bool TrySendNewMessage(ICommonSession session, string newMessage)
public bool TrySendNewMessage(ICommonSession session, string newMessage, bool checkLength = false)
{
if (!_antispam || newMessage.Length < _antispamMinLength)
if (!_antispam || checkLength && newMessage.Length < _antispamMinLength)
{
_lastMessages.Remove(session.Data.UserId);
return true;

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Chat.Managers
// WD-EDIT
void SendHookAdminChat(string sender, string message);
bool TrySendNewMessage(ICommonSession session, string newMessage);
bool TrySendNewMessage(ICommonSession session, string newMessage, bool checkLength = false);
// WD-EDIT
void SendAdminAnnouncement(string message);

View File

@@ -249,7 +249,7 @@ public sealed partial class ChatSystem : SharedChatSystem
return;
if (desiredType != InGameICChatType.Emote && player is not null &&
!_chatManager.TrySendNewMessage(player, message)) // WD
!_chatManager.TrySendNewMessage(player, message, true)) // WD
return;
// This message may have a radio prefix, and should then be whispered to the resolved radio channel

View File

@@ -236,6 +236,7 @@ namespace Content.Server.Chemistry.EntitySystems
bufferSolution.Value.Comp.Solution.AddReagent(message.ReagentId, FixedPoint2.New((int)reagentDispenser.Comp.DispenseAmount));
_chemMasterSystem.UpdateUiState((chemMasterUid.Value, chemMaster));
ClickSound(reagentDispenser);
return;
} // WD EDIT END

View File

@@ -0,0 +1,106 @@
using System.Linq;
using Content.Server.Mind;
using Content.Server.Mind.Components;
using Content.Server.Objectives.Interfaces;
using Content.Server.Roles;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Roles;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Server.Objectives.Conditions;
public abstract class KillDepartmentCondition : IObjectiveCondition
{
private IEntityManager EntityManager => IoCManager.Resolve<IEntityManager>();
private IPrototypeManager PrototypeManager => IoCManager.Resolve<IPrototypeManager>();
private MobStateSystem MobStateSystem => EntityManager.EntitySysManager.GetEntitySystem<MobStateSystem>();
private MindSystem MindSystem => EntityManager.EntitySysManager.GetEntitySystem<MindSystem>();
protected abstract string TitleHeader { get; }
public abstract IObjectiveCondition GetAssigned(Mind.Mind mind);
protected List<Mind.Mind?>? Targets;
protected List<Mind.Mind?> GetTargets(Mind.Mind mind, string department)
{
var dep = PrototypeManager.Index<DepartmentPrototype>(department);
var allMinds = EntityManager.EntityQuery<MindContainerComponent>(true).Where(mc =>
{
var entity = mc.Mind?.OwnedEntity;
if (entity == default || mc.Mind == mind)
return false;
var isTargetJob = mc.Mind?.AllRoles.OfType<Job>().Any(job => dep.Roles.Contains(job.Prototype.ID));
if (isTargetJob is false)
return false;
return EntityManager.TryGetComponent(entity, out MobStateComponent? mobState) &&
MobStateSystem.IsAlive(entity.Value, mobState);
}).Select(mc => mc.Mind).ToList();
return allMinds;
}
public string Title
{
get
{
var title = TitleHeader;
if (Targets == null)
return title;
foreach (var target in Targets)
{
if (target?.OwnedEntity is { Valid: true } owned)
{
title += $"\n - {EntityManager.GetComponent<MetaDataComponent>(owned).EntityName}, " +
$"{target?.CurrentJob?.Name ?? "Unknown"}";
}
}
return title;
}
}
public string Description => Loc.GetString("objective-condition-department-description");
public SpriteSpecifier Icon => new SpriteSpecifier.Rsi(new ("Objects/Weapons/Guns/Pistols/viper.rsi"), "icon");
public float Progress
{
get
{
if (Targets == null)
return 1f;
var deadTargetsCount = Targets.Count(target => target != null && MindSystem.IsCharacterDeadIc(target));
return Math.Min(1f / Targets.Count * deadTargetsCount, 1f);
}
}
public float Difficulty => 5f;
public bool Equals(IObjectiveCondition? other)
{
return other is KillDepartmentCondition kdc && Equals(Targets, kdc.Targets);
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
return obj.GetType() == GetType() && Equals((KillDepartmentCondition) obj);
}
public override int GetHashCode()
{
return Targets?.GetHashCode() ?? 0;
}
}

View File

@@ -4,6 +4,7 @@ using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Examine;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Prototypes;
@@ -18,6 +19,7 @@ public sealed class CritSystem : EntitySystem
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
public override void Initialize()
{
@@ -44,7 +46,7 @@ public sealed class CritSystem : EntitySystem
if (!IsCriticalHit(component))
return;
if (!TryComp<MobStateComponent>(target, out _))
if (!TryComp<MobStateComponent>(target, out var mobState) || _mobState.IsDead(target, mobState))
continue;
var damage = args.BaseDamage.Total * component.CritMultiplier;
@@ -55,12 +57,14 @@ public sealed class CritSystem : EntitySystem
var damageGroup = _prototypeManager.Index<DamageGroupPrototype>("Brute");
_bloodstream.TryModifyBloodLevel(target, -ohio);
_damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(damageGroup, -ohio));
_bloodstream.TryModifyBloodLevel(args.User, ohio);
_damageableSystem.TryChangeDamage(args.User, new DamageSpecifier(damageGroup, -ohio * 2));
damage = args.BaseDamage.Total * component.CritMultiplier + ohio;
}
args.BonusDamage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>("Slash"), damage);
args.BonusDamage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>("Slash"),
damage - args.BaseDamage.Total);
_popup.PopupEntity($@"Crit! {damage}", args.User, PopupType.MediumCaution);
}

View File

@@ -1,4 +1,4 @@
- type: entity
- type: entity
id: BaseAnimalOrgan
parent: BaseItem
abstract: true

View File

@@ -367,6 +367,7 @@
tags:
- WhitelistChameleon
- HighRiskItem
- Hardsuit
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitRd
- type: StaticPrice

View File

@@ -135,7 +135,7 @@
path: /Audio/Weapons/guitarsmash.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 2
max: 4
- !type:DoActsBehavior

View File

@@ -109,6 +109,7 @@
damage:
types:
Blunt: 0
ignoreResistances: true
- type: Sprite
state: rods
- type: Stack

View File

@@ -163,7 +163,7 @@
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 5
max: 5
- type: StaticPrice

View File

@@ -14,6 +14,8 @@
damage:
types:
Slash: 12
soundHit:
path: /Audio/Weapons/bladeslice.ogg
- type: Item
size: Normal
- type: Clothing
@@ -38,6 +40,8 @@
damage:
types:
Slash: 16
soundHit:
path: /Audio/Weapons/bladeslice.ogg
- type: Item
size: Normal
- type: Clothing

View File

@@ -12,6 +12,8 @@
damage:
types:
Slash: 10.5
soundHit:
path: /Audio/Weapons/bladeslice.ogg
- type: Item
size: 20
- type: Clothing
@@ -23,6 +25,3 @@
critChance: 20
critMultiplier: 2.2
isBloodDagger: true
- type: Reflect
reflectProb: 0.15
enabled: true

View File

@@ -16,10 +16,6 @@
Slash: 17 #cmon, it has to be at least BETTER than the rest.
soundHit:
path: /Audio/Weapons/bladeslice.ogg
- type: Reflect
enabled: true
reflectProb: .5
spread: 90
- type: Item
size: Normal
sprite: Objects/Weapons/Melee/captain_sabre.rsi

View File

@@ -414,7 +414,7 @@
path: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 1
max: 1
- !type:DoActsBehavior
@@ -449,7 +449,7 @@
path: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 1
max: 1
MaterialCloth1:

View File

@@ -190,7 +190,7 @@
path: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 1
max: 5
MaterialCloth1:

View File

@@ -108,7 +108,7 @@
path: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 1
max: 5

View File

@@ -29,7 +29,7 @@
path: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 2
max: 3
- !type:DoActsBehavior

View File

@@ -194,7 +194,7 @@
path: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
MaterialWoodPlank1:
min: 1
max: 1
- type: Tag

View File

@@ -38,7 +38,7 @@
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
MaterialBananium:
MaterialBananium1:
min: 0
max: 1
- !type:DoActsBehavior

View File

@@ -21,5 +21,5 @@
minMultiplier: 0.01
maxMultiplier: 0.99
minItems: 3
maxItems: 8
maxItems: 10
salesCategory: UplinkSales

View File

@@ -11,6 +11,7 @@
quickEquip: false
slots:
- Back
- SuitStorage
- type: Item
size: Huge
sprite: White/Objects/Weapons/crossbow.rsi
@@ -46,12 +47,12 @@
offset: 0.2,0.2
damage:
types:
Blunt: 15
Piercing: 15
- type: Powered
charge: 180
damage:
types:
Blunt: 10
Piercing: 10
Heat: 10
- type: Construction
deconstructionTarget: null
@@ -74,6 +75,7 @@
quickEquip: false
slots:
- Back
- SuitStorage
- type: Construction
deconstructionTarget: null
graph: WeaponPoweredCrossbowGraph

View File

@@ -22,6 +22,7 @@
quickEquip: false
slots:
- Back
- SuitStorage
- type: Gun
cameraRecoilScalar: 0
fireRate: 2
@@ -83,6 +84,7 @@
quickEquip: false
slots:
- Back
- SuitStorage
- type: Construction
deconstructionTarget: null
graph: WeaponFlamethrowerGraph