From 05af8776eaf5952f04026a1c5fd7fdc9efef0835 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Sun, 17 Apr 2022 17:43:00 -0400 Subject: [PATCH] Familiar QOL changes (#7614) --- Content.Server/Bible/BibleSystem.cs | 20 ++++- .../Bible/Components/SummonableComponent.cs | 11 +++ Resources/Locale/en-US/chapel/bible.ftl | 1 + .../Prototypes/Entities/Mobs/NPCs/animals.yml | 9 ++- .../Prototypes/Entities/Mobs/NPCs/pets.yml | 61 ---------------- .../Entities/Mobs/Player/familiars.yml | 73 +++++++++++++++++++ 6 files changed, 112 insertions(+), 63 deletions(-) create mode 100644 Resources/Prototypes/Entities/Mobs/Player/familiars.yml diff --git a/Content.Server/Bible/BibleSystem.cs b/Content.Server/Bible/BibleSystem.cs index 121c44cdb1..e8bd43c930 100644 --- a/Content.Server/Bible/BibleSystem.cs +++ b/Content.Server/Bible/BibleSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Damage; using Content.Shared.Verbs; using Content.Shared.Tag; using Content.Shared.ActionBlocker; +using Content.Shared.Actions; using Content.Server.Cooldown; using Content.Server.Bible.Components; using Content.Server.Popups; @@ -13,7 +14,6 @@ using Robust.Shared.Audio; using Robust.Shared.Player; using Robust.Shared.Timing; - namespace Content.Server.Bible { public sealed class BibleSystem : EntitySystem @@ -25,6 +25,7 @@ namespace Content.Server.Bible [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly ActionBlockerSystem _blocker = default!; + [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; public override void Initialize() { @@ -32,6 +33,8 @@ namespace Content.Server.Bible SubscribeLocalEvent(OnAfterInteract); SubscribeLocalEvent>(AddSummonVerb); + SubscribeLocalEvent(GetSummonAction); + SubscribeLocalEvent(OnSummon); } private void OnAfterInteract(EntityUid uid, BibleComponent component, AfterInteractEvent args) @@ -111,6 +114,17 @@ namespace Content.Server.Bible args.Verbs.Add(verb); } + private void GetSummonAction(EntityUid uid, SummonableComponent component, GetItemActionsEvent args) + { + if (component.AlreadySummoned) + return; + + args.Actions.Add(component.SummonAction); + } + private void OnSummon(EntityUid uid, SummonableComponent component, SummonActionEvent args) + { + AttemptSummon(component, args.Performer, Transform(args.Performer)); + } private void AttemptSummon(SummonableComponent component, EntityUid user, TransformComponent? position) { if (component.AlreadySummoned || component.SpecialItemPrototype == null) @@ -126,6 +140,10 @@ namespace Content.Server.Bible EntityManager.SpawnEntity(component.SpecialItemPrototype, position.Coordinates); component.AlreadySummoned = true; + _actionsSystem.RemoveAction(user, component.SummonAction); } } + + public sealed class SummonActionEvent : InstantActionEvent + {} } diff --git a/Content.Server/Bible/Components/SummonableComponent.cs b/Content.Server/Bible/Components/SummonableComponent.cs index 20acff747a..cee7dcbdec 100644 --- a/Content.Server/Bible/Components/SummonableComponent.cs +++ b/Content.Server/Bible/Components/SummonableComponent.cs @@ -1,5 +1,8 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Prototypes; +using Content.Shared.Actions.ActionTypes; +using Content.Server.Bible; +using Robust.Shared.Utility; namespace Content.Server.Bible.Components { @@ -19,5 +22,13 @@ namespace Content.Server.Bible.Components [DataField("requriesBibleUser")] public bool RequiresBibleUser = true; + [DataField("summonAction")] + public InstantAction SummonAction = new() + { + Icon = new SpriteSpecifier.Texture(new ResourcePath("Clothing/Head/Hats/witch.rsi/icon.png")), + Name = "bible-summon-verb", + Description = "bible-summon-verb-desc", + Event = new SummonActionEvent(), + }; } } diff --git a/Resources/Locale/en-US/chapel/bible.ftl b/Resources/Locale/en-US/chapel/bible.ftl index dc49e62972..a7af825359 100644 --- a/Resources/Locale/en-US/chapel/bible.ftl +++ b/Resources/Locale/en-US/chapel/bible.ftl @@ -4,6 +4,7 @@ bible-heal-fail-self = You hit {THE($target)} with {THE($bible)}, and it lands w 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. 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)}. diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index b4d79e0721..5012465862 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -8,7 +8,7 @@ description: Some cultures find them terrifying, others crunchy on the teeth. components: - type: MovementSpeedModifier - baseWalkSpeed : 6 + baseWalkSpeed : 3 baseSprintSpeed : 6 - type: Sprite drawdepth: Mobs @@ -51,6 +51,13 @@ bloodMaxVolume: 50 - type: ReplacementAccent accent: mouse + - type: UnarmedCombat + range: 1.5 + arcwidth: 0 + arc: bite + damage: + types: + Piercing: 5 - type: entity name: bee diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml index 4cf2f5db58..faf2ed5ad3 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/pets.yml @@ -113,48 +113,6 @@ types: Heat : 1 #per second, scales with temperature & other constants -- type: entity - name: Cerberus - parent: MobCorgiNarsi - id: MobCorgiCerberus - description: This pupper is not wholesome. - components: - - type: GhostTakeoverAvailable - makeSentient: true - name: Cerberus, Evil Familiar - description: Obey your master. Spread chaos. - rules: You are an intelligent, demonic dog. Try to help the chaplain and any of his flock. As an antagonist, you're otherwise unrestrained. - - type: UnarmedCombat - range: 1.5 - arcwidth: 0 - arc: bite - damage: - types: - Piercing: 8 - Slash: 7 - - type: UtilityAI - behaviorSets: - - Idle - - type: AiFactionTag - factions: - - SimpleNeutral - - type: InteractionPopup - successChance: 0.5 - interactSuccessString: petting-success-corrupted-corgi - interactFailureString: petting-failure-corrupted-corgi - - type: MobState - thresholds: - 0: !type:NormalMobState {} - 80: !type:CriticalMobState {} - 160: !type:DeadMobState {} - - type: Grammar - attributes: - gender: male - proper: true - - type: Tag - tags: - - Familiar - - type: entity name: Ian parent: MobCorgi @@ -201,25 +159,6 @@ proper: true gender: male -- type: entity - name: Remilia - parent: MobBat - id: MobBatRemilia - description: The chaplain's familiar. Likes fruit. - components: - - type: GhostTakeoverAvailable - makeSentient: true - name: Remilia, the chaplain's familiar - description: Obey your master. Eat fruit. - rules: Follow the chaplain around. Don't cause any trouble unless the chaplain tells you to. - - type: Grammar - attributes: - gender: female - proper: true - - type: Tag - tags: - - Familiar - - type: entity name: Lisa parent: MobCorgi diff --git a/Resources/Prototypes/Entities/Mobs/Player/familiars.yml b/Resources/Prototypes/Entities/Mobs/Player/familiars.yml new file mode 100644 index 0000000000..887d58a48d --- /dev/null +++ b/Resources/Prototypes/Entities/Mobs/Player/familiars.yml @@ -0,0 +1,73 @@ +- type: entity + name: Remilia + parent: MobBat + id: MobBatRemilia + description: The chaplain's familiar. Likes fruit. + components: + - type: GhostTakeoverAvailable + makeSentient: true + name: Remilia, the chaplain's familiar + description: Obey your master. Eat fruit. + rules: You are an intelligent fruit bat. Follow the chaplain around. Don't cause any trouble unless the chaplain tells you to. + - type: Grammar + attributes: + gender: female + proper: true + - type: Tag + tags: + - Familiar + - DoorBumpOpener + - type: Access + tags: + - Chapel + - type: Mind + showExamineInfo: true + - type: Alerts + +- type: entity + name: Cerberus + parent: MobCorgiNarsi + id: MobCorgiCerberus + description: This pupper is not wholesome. + components: + - type: GhostTakeoverAvailable + makeSentient: true + name: Cerberus, Evil Familiar + description: Obey your master. Spread chaos. + rules: You are an intelligent, demonic dog. Try to help the chaplain and any of his flock. As an antagonist, you're otherwise unrestrained. + - type: UnarmedCombat + range: 1.5 + arcwidth: 0 + arc: bite + damage: + types: + Piercing: 8 + Slash: 7 + - type: UtilityAI + behaviorSets: + - Idle + - type: AiFactionTag + factions: + - SimpleNeutral + - type: InteractionPopup + successChance: 0.5 + interactSuccessString: petting-success-corrupted-corgi + interactFailureString: petting-failure-corrupted-corgi + - type: MobState + thresholds: + 0: !type:NormalMobState {} + 80: !type:CriticalMobState {} + 160: !type:DeadMobState {} + - type: Grammar + attributes: + gender: male + proper: true + - type: Tag + tags: + - Familiar + - DoorBumpOpener + - type: Access + tags: + - Chapel + - type: Mind + showExamineInfo: true