public static readonly CVarDef<float> PlaytestExplosionDamageModifier =
CVarDef.Create("playtest.explosion_damage_modifier", 1f, CVar.SERVER | CVar.REPLICATED);
+ /// <summary>
+ /// Scales the damage dealt to mobs in the game (i.e. entities with MobStateComponent).
+ /// </summary>
+ [CVarControl(AdminFlags.VarEdit)]
+ public static readonly CVarDef<float> PlaytestMobDamageModifier =
+ CVarDef.Create("playtest.mob_damage_modifier", 1f, CVar.SERVER | CVar.REPLICATED);
+
+ /// <summary>
+ /// Scales the stamina damage dealt the game.
+ /// </summary>
+ [CVarControl(AdminFlags.VarEdit)]
+ public static readonly CVarDef<float> PlaytestStaminaDamageModifier =
+ CVarDef.Create("playtest.stamina_damage_modifier", 1f, CVar.SERVER | CVar.REPLICATED);
+
}
public float UniversalExplosionDamageModifier { get; private set; } = 1f;
public float UniversalThrownDamageModifier { get; private set; } = 1f;
public float UniversalTopicalsHealModifier { get; private set; } = 1f;
+ public float UniversalMobDamageModifier { get; private set; } = 1f;
public override void Initialize()
{
Subs.CVar(_config, CCVars.PlaytestExplosionDamageModifier, value => UniversalExplosionDamageModifier = value, true);
Subs.CVar(_config, CCVars.PlaytestThrownDamageModifier, value => UniversalThrownDamageModifier = value, true);
Subs.CVar(_config, CCVars.PlaytestTopicalsHealModifier, value => UniversalTopicalsHealModifier = value, true);
+ Subs.CVar(_config, CCVars.PlaytestMobDamageModifier, value => UniversalMobDamageModifier = value, true);
}
/// <summary>
using System.Linq;
using Content.Shared.Administration.Logs;
using Content.Shared.Alert;
+using Content.Shared.CCVar;
using Content.Shared.CombatMode;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Events;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
+using Robust.Shared.Configuration;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Random;
[Dependency] private readonly SharedColorFlashEffectSystem _color = default!;
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
+ [Dependency] private readonly IConfigurationManager _config = default!;
/// <summary>
/// How much of a buffer is there between the stun duration and when stuns can be re-applied.
/// </summary>
private static readonly TimeSpan StamCritBufferTime = TimeSpan.FromSeconds(3f);
+ public float UniversalStaminaDamageModifier { get; private set; } = 1f;
+
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StaminaDamageOnCollideComponent, ThrowDoHitEvent>(OnThrowHit);
SubscribeLocalEvent<StaminaDamageOnHitComponent, MeleeHitEvent>(OnMeleeHit);
+
+ Subs.CVar(_config, CCVars.PlaytestStaminaDamageModifier, value => UniversalStaminaDamageModifier = value, true);
}
private void OnStamHandleState(EntityUid uid, StaminaComponent component, ref AfterAutoHandleStateEvent args)
if (ev.Cancelled)
return;
+ value = UniversalStaminaDamageModifier * value;
+
// Have we already reached the point of max stamina damage?
if (component.Critical)
return;
using Content.Shared.Bed.Sleep;
using Content.Shared.Buckle.Components;
using Content.Shared.CombatMode.Pacification;
+using Content.Shared.Damage;
using Content.Shared.Damage.ForceSay;
using Content.Shared.Emoting;
using Content.Shared.Hands;
SubscribeLocalEvent<MobStateComponent, TryingToSleepEvent>(OnSleepAttempt);
SubscribeLocalEvent<MobStateComponent, CombatModeShouldHandInteractEvent>(OnCombatModeShouldHandInteract);
SubscribeLocalEvent<MobStateComponent, AttemptPacifiedAttackEvent>(OnAttemptPacifiedAttack);
+ SubscribeLocalEvent<MobStateComponent, DamageModifyEvent>(OnDamageModify);
SubscribeLocalEvent<MobStateComponent, UnbuckleAttemptEvent>(OnUnbuckleAttempt);
}
args.Cancelled = true;
}
+ private void OnDamageModify(Entity<MobStateComponent> ent, ref DamageModifyEvent args)
+ {
+ args.Damage *= _damageable.UniversalMobDamageModifier;
+ }
+
#endregion
}
using Content.Shared.ActionBlocker;
using Content.Shared.Administration.Logs;
+using Content.Shared.Damage;
using Content.Shared.Mobs.Components;
using Content.Shared.Standing;
using Robust.Shared.Physics.Systems;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;
+ [Dependency] private readonly DamageableSystem _damageable = default!;
private ISawmill _sawmill = default!;
private EntityQuery<MobStateComponent> _mobStateQuery;
changecvar-full-playtest_reagent_heal_modifier = Multiplier affecting all healing done by reagents.
changecvar-simple-playtest_explosion_damage_modifier = Multiplier affecting explosion damage.
changecvar-full-playtest_explosion_damage_modifier = Multiplier affecting all damage dealt by explosives.
+changecvar-simple-playtest_stamina_damage_modifier = Multiplier affecting stamina damage.
+changecvar-full-playtest_stamina_damage_modifier = Multiplier affecting all stamina damage dealt.
+changecvar-simple-playtest_mob_damage_modifier = Multiplier affecting all damage dealt to mobs.
+changecvar-full-playtest_mob_damage_modifier = Multiplier affecting all damage dealt to entities with MobStateComponent.