Nerf bible (#10023)
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.MobState;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Verbs;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Actions;
|
||||
using Content.Server.Cooldown;
|
||||
using Content.Server.Bible.Components;
|
||||
using Content.Server.MobState;
|
||||
using Content.Server.Popups;
|
||||
@@ -14,23 +12,23 @@ using Content.Server.Ghost.Roles.Components;
|
||||
using Content.Server.Ghost.Roles.Events;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Timing;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Bible
|
||||
{
|
||||
public sealed class BibleSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly InventorySystem _invSystem = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
||||
[Dependency] private readonly InventorySystem _invSystem = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||
[Dependency] private readonly UseDelaySystem _delay = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -94,28 +92,23 @@ namespace Content.Server.Bible
|
||||
if (!args.CanReach)
|
||||
return;
|
||||
|
||||
var currentTime = _gameTiming.CurTime;
|
||||
UseDelayComponent? delay = null;
|
||||
|
||||
if (currentTime < component.CooldownEnd)
|
||||
{
|
||||
if (_delay.ActiveDelay(uid, delay))
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Target == null || args.Target == args.User || !_mobStateSystem.IsAlive(args.Target.Value))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
component.LastAttackTime = currentTime;
|
||||
component.CooldownEnd = component.LastAttackTime + TimeSpan.FromSeconds(component.CooldownTime);
|
||||
RaiseLocalEvent(uid, new RefreshItemCooldownEvent(component.LastAttackTime, component.CooldownEnd), false);
|
||||
|
||||
if (!HasComp<BibleUserComponent>(args.User))
|
||||
{
|
||||
_popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, Filter.Entities(args.User));
|
||||
|
||||
SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User);
|
||||
_damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true);
|
||||
_delay.BeginDelay(uid, delay);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -133,18 +126,31 @@ namespace Content.Server.Bible
|
||||
|
||||
SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User);
|
||||
_damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true);
|
||||
_delay.BeginDelay(uid, delay);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
|
||||
_popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), PopupType.Medium);
|
||||
var damage = _damageableSystem.TryChangeDamage(args.Target.Value, component.Damage, true);
|
||||
|
||||
var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
|
||||
_popupSystem.PopupEntity(selfMessage, args.User, Filter.Entities(args.User), PopupType.Large);
|
||||
if (damage == null || damage.Total == 0)
|
||||
{
|
||||
var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
|
||||
_popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), PopupType.Medium);
|
||||
|
||||
SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User);
|
||||
_damageableSystem.TryChangeDamage(args.Target.Value, component.Damage, true);
|
||||
var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-none-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
|
||||
_popupSystem.PopupEntity(selfMessage, args.User, Filter.Entities(args.User), PopupType.Large);
|
||||
}
|
||||
else
|
||||
{
|
||||
var othersMessage = Loc.GetString(component.LocPrefix + "-heal-success-others", ("user", Identity.Entity(args.User, EntityManager)),("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
|
||||
_popupSystem.PopupEntity(othersMessage, args.User, Filter.PvsExcept(args.User), PopupType.Medium);
|
||||
|
||||
var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
|
||||
_popupSystem.PopupEntity(selfMessage, args.User, Filter.Entities(args.User), PopupType.Large);
|
||||
SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User);
|
||||
_delay.BeginDelay(uid, delay);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddSummonVerb(EntityUid uid, SummonableComponent component, GetVerbsEvent<AlternativeVerb> args)
|
||||
@@ -238,5 +244,7 @@ namespace Content.Server.Bible
|
||||
}
|
||||
|
||||
public sealed class SummonActionEvent : InstantActionEvent
|
||||
{}
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,29 +6,34 @@ namespace Content.Server.Bible.Components
|
||||
[RegisterComponent]
|
||||
public sealed class BibleComponent : Component
|
||||
{
|
||||
// Damage that will be healed on a success
|
||||
/// <summary>
|
||||
/// Damage that will be healed on a success
|
||||
/// </summary>
|
||||
[DataField("damage", required: true)]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier Damage = default!;
|
||||
// Damage that will be dealt on a failure
|
||||
|
||||
/// <summary>
|
||||
/// Damage that will be dealt on a failure
|
||||
/// </summary>
|
||||
[DataField("damageOnFail", required: true)]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier DamageOnFail = default!;
|
||||
// Damage that will be dealt when a non-chaplain attempts to heal
|
||||
|
||||
/// <summary>
|
||||
/// Damage that will be dealt when a non-chaplain attempts to heal
|
||||
/// </summary>
|
||||
[DataField("damageOnUntrainedUse", required: true)]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public DamageSpecifier DamageOnUntrainedUse = default!;
|
||||
|
||||
//Chance the bible will fail to heal someone with no helmet
|
||||
/// <summary>
|
||||
/// Chance the bible will fail to heal someone with no helmet
|
||||
/// </summary>
|
||||
[DataField("failChance")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float FailChance = 0.34f;
|
||||
|
||||
public TimeSpan LastAttackTime;
|
||||
public TimeSpan CooldownEnd;
|
||||
[DataField("cooldownTime")]
|
||||
public float CooldownTime { get; } = 5f;
|
||||
|
||||
[DataField("sizzleSound")]
|
||||
public SoundSpecifier SizzleSoundPath = new SoundPathSpecifier("/Audio/Effects/lightburn.ogg");
|
||||
[DataField("healSound")]
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
bible-heal-success-self = You hit {THE($target)} with {THE($bible)}, and {POSS-ADJ($target)} wounds close in a flash of holy light!
|
||||
bible-heal-success-others = {CAPITALIZE(THE($user))} hits {THE($target)} with {THE($bible)}, and {POSS-ADJ($target)} wounds close in a flash of holy light!
|
||||
bible-heal-success-self = You hit {THE($target)} with {THE($bible)}, and their wounds close in a flash of holy light!
|
||||
bible-heal-success-others = {CAPITALIZE(THE($user))} hits {THE($target)} with {THE($bible)}, and their wounds close in a flash of holy light!
|
||||
bible-heal-success-none-self = You hit {THE($target)} with {THE($bible)}, but they have no wounds you can heal!
|
||||
bible-heal-success-none-others = {CAPITALIZE(THE($user))} hits {THE($target)} with {THE($bible)}!
|
||||
|
||||
bible-heal-fail-self = You hit {THE($target)} with {THE($bible)}, and it lands with a sad thwack, dazing {OBJECT($target)}!
|
||||
bible-heal-fail-others = {CAPITALIZE(THE($user))} hits {THE($target)} with {THE($bible)}, and it lands with a sad thack, dazing {OBJECT($target)}!
|
||||
bible-sizzle = The book sizzles in your hands!
|
||||
|
||||
bible-summon-verb = Summon familiar
|
||||
bible-summon-verb-desc = Summon a familiar that will aid you and gain humanlike intelligence once inhabited by a soul.
|
||||
bible-summon-requested = Your familiar will arrive once a willing soul comes forth.
|
||||
bible-summon-respawn-ready = {CAPITALIZE(THE($book))} surges with ethereal power. {CAPITALIZE(POSS-ADJ($book))} resident is home again.
|
||||
|
||||
necro-heal-success-self = You hit {THE($target)} with {THE($bible)}, and {POSS-ADJ($target)} flesh warps as it melts!
|
||||
necro-heal-success-others = {CAPITALIZE(THE($user))} hits {THE($target)} with {THE($bible)}, and {POSS-ADJ($target)} flesh warps as it melts!
|
||||
necro-heal-fail-self = You hit {THE($target)} with {THE($bible)}, and it lands with a sad thwack, failing to smite {OBJECT($target)}.
|
||||
|
||||
@@ -4,18 +4,20 @@
|
||||
parent: BaseStorageItem
|
||||
id: Bible
|
||||
components:
|
||||
- type: UseDelay
|
||||
delay: 10.0
|
||||
- type: Bible
|
||||
damage:
|
||||
groups:
|
||||
Brute: -35
|
||||
Burn: -35
|
||||
Brute: -15
|
||||
Burn: -15
|
||||
damageOnFail:
|
||||
groups:
|
||||
Brute: 15
|
||||
Airloss: 25
|
||||
Airloss: 15
|
||||
damageOnUntrainedUse: ## What a non-chaplain takes when attempting to heal someone
|
||||
groups:
|
||||
Burn: 30
|
||||
Burn: 10
|
||||
- type: Summonable
|
||||
specialItem: SpawnPointGhostRemilia
|
||||
- type: ItemCooldown
|
||||
|
||||
Reference in New Issue
Block a user