-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chemical Moodlets (And Drug Addictions!) (#896)
# Description This PR implements a new Reagent Reaction that modifies a character's mood, done by raising a MoodEvent on that character. It also extends some of the functionality of the TraitSystem and MoodSystem so as to support a new serializable Drug Addiction mechanic. https://www.youtube.com/watch?v=8liPBsUtND4 ![image](https://github.com/user-attachments/assets/3962c492-7677-4007-bf31-23e74b2b7382) <details><summary><h1>Media</h1></summary> <p> ![image](https://github.com/user-attachments/assets/207210d6-e573-46e2-beb4-fab83a83d8b4) ![image](https://github.com/user-attachments/assets/4e1277e1-a873-4185-98b3-39abe06a8235) ![image](https://github.com/user-attachments/assets/e1a6cefe-82ee-482c-ace1-9fb511385fe4) ![image](https://github.com/user-attachments/assets/454dafa2-ba9e-46a6-9ac0-15e2ed35c4f8) </p> </details> # Changelog :cl: - add: Drug Addictions! Drug addictions are long lasting Moodlet-Pairs. The first consisting of a temporary Mood bonus that is refreshed by consuming the drug, and the second consisting of an extremely long lasting mood penalty, which replaces the mood bonus should you go a long enough time between consuming the drug in question. - add: Nicotine Addiction has been added as a new minor negative trait. - add: Drugs/Reagents can now affect your character's Mood! Both with, and without Addiction. - add: TraitSystem has had functionality added for directly adding Moodlets to a character upon joining the round, such as drug addictions, or permanent mood modifications like Sanguine/Saturnine - add: Lotophagoi Oil now induces an extremely powerful drug addiction, providing an extremely large mood benefit for a short time. Which when it wears off, creates an equally extreme mood penalty that lasts for a very long time(or until you drink more Loto Oil).
- Loading branch information
Showing
13 changed files
with
178 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Content.Shared.Chemistry.Reagent; | ||
using Content.Shared.Mood; | ||
using JetBrains.Annotations; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Chemistry.ReagentEffects; | ||
|
||
/// <summary> | ||
/// Adds a moodlet to an entity. | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed partial class ChemAddMoodlet : ReagentEffect | ||
{ | ||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) | ||
{ | ||
var protoMan = IoCManager.Resolve<IPrototypeManager>(); | ||
return Loc.GetString("reagent-effect-guidebook-add-moodlet", | ||
("amount", protoMan.Index<MoodEffectPrototype>(MoodPrototype.Id).MoodChange), | ||
("timeout", protoMan.Index<MoodEffectPrototype>(MoodPrototype.Id).Timeout)); | ||
} | ||
|
||
/// <summary> | ||
/// The mood prototype to be applied to the using entity. | ||
/// </summary> | ||
[DataField(required: true)] | ||
public ProtoId<MoodEffectPrototype> MoodPrototype = default!; | ||
|
||
public override void Effect(ReagentEffectArgs args) | ||
{ | ||
var entityManager = IoCManager.Resolve<EntityManager>(); | ||
var ev = new MoodEffectEvent(MoodPrototype); | ||
entityManager.EventBus.RaiseLocalEvent(args.SolutionEntity, ev); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
Content.Server/Traits/Assorted/ModifyMoodTraitComponent.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Drugs should be paired up in Trios of "Bonus, Penalty, Category" | ||
|
||
# Lotophagoi Oil | ||
- type: moodEffect | ||
id: LotoTranscendence | ||
moodChange: 30 | ||
timeout: 900 #15 minutes | ||
moodletOnEnd: LotoEnthrallment | ||
category: "LotophagoiAddiction" | ||
|
||
- type: moodEffect | ||
id: LotoEnthrallment | ||
moodChange: -30 | ||
timeout: 7200 #2 hours | ||
category: "LotophagoiAddiction" | ||
|
||
- type: moodCategory | ||
id: LotophagoiAddiction | ||
|
||
# Nicotine | ||
- type: moodEffect | ||
id: NicotineBenefit | ||
moodChange: 5 | ||
timeout: 600 #10 minutes | ||
moodletOnEnd: NicotineWithdrawal | ||
category: "NicotineAddiction" | ||
|
||
- type: moodEffect | ||
id: NicotineWithdrawal | ||
moodChange: -7 #No timeout | ||
category: "NicotineAddiction" | ||
|
||
- type: moodCategory | ||
id: NicotineAddiction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters