-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tweak] Mood upgrade #931
[Tweak] Mood upgrade #931
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,35 @@ | ||||||||||||||||||||||||||||||||||
using Content.Shared.Backmen.Mood; | ||||||||||||||||||||||||||||||||||
using Content.Shared.EntityEffects; | ||||||||||||||||||||||||||||||||||
using Content.Shared.Backmen.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 : EntityEffect | ||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||
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)); | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
public override void Effect(EntityEffectBaseArgs args) | ||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||
var entityManager = IoCManager.Resolve<EntityManager>(); | ||||||||||||||||||||||||||||||||||
var ev = new MoodEffectEvent(MoodPrototype); | ||||||||||||||||||||||||||||||||||
entityManager.EventBus.RaiseLocalEvent(args.TargetEntity, ev); | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
Comment on lines
+23
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve dependency management and error handling The current implementation has several areas for improvement:
Consider this improved implementation: +[Dependency] private readonly IEntityManager _entityManager = default!;
+
public override void Effect(EntityEffectBaseArgs args)
{
- var entityManager = IoCManager.Resolve<EntityManager>();
+ if (!_entityManager.EntityExists(args.TargetEntity))
+ return;
+
var ev = new MoodEffectEvent(MoodPrototype);
- entityManager.EventBus.RaiseLocalEvent(args.TargetEntity, ev);
+ _entityManager.EventBus.RaiseLocalEvent(args.TargetEntity, ev);
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
/// <summary> | ||||||||||||||||||||||||||||||||||
/// The mood prototype to be applied to the using entity. | ||||||||||||||||||||||||||||||||||
/// </summary> | ||||||||||||||||||||||||||||||||||
[DataField(required: true)] | ||||||||||||||||||||||||||||||||||
public ProtoId<MoodEffectPrototype> MoodPrototype = default!; | ||||||||||||||||||||||||||||||||||
Comment on lines
+30
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Mood system integration needs updates for new substances The mood system has proper integration for nicotine and happiness with their respective benefit and withdrawal effects, but lotus oil and cosmic mirage are missing their mood effect definitions. The ChemAddMoodlet component is properly used in narcotics.yml for existing substances, suggesting a pattern to follow. Required updates:
🔗 Analysis chainVerify mood system integration for substance dependencies The field is well-defined, but let's verify its integration with the substances mentioned in the PR objectives (lotus oil, happiness, nicotine, and cosmic mirage). 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the mood system integration for chemical substances
# Check for mood effect prototypes related to the substances
echo "Checking mood effect prototypes..."
rg -l "MoodEffectPrototype" Resources/Prototypes/
# Check for ChemAddMoodlet usage in reagent definitions
echo "Checking reagent definitions..."
rg -A 5 "ChemAddMoodlet" Resources/Prototypes/Reagents/
Length of output: 1568 Script: #!/bin/bash
# Let's verify the mood prototypes for the specific substances mentioned
# Check for mood prototypes related to lotus oil and cosmic mirage
echo "Checking for lotus oil and cosmic mirage related mood effects..."
rg -A 5 "LotusOil|CosmicMirage" Resources/Prototypes/
# Check for all mood effect definitions to understand available prototypes
echo "Checking all mood effect definitions..."
rg -A 5 "type: moodEffect" Resources/Prototypes/
# Check for lotus oil and cosmic mirage reagent definitions
echo "Checking lotus oil and cosmic mirage reagent definitions..."
rg -A 10 "id: (LotusOil|CosmicMirage)" Resources/Prototypes/Reagents/
Length of output: 17410 |
||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -12,24 +12,34 @@ public sealed class MoodEffectPrototype : IPrototype | |||||||||||||||||||||||||||||||||||||||
public string ID { get; } = default!; | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
public string Description => Loc.GetString($"mood-effect-{ID}"); | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
/// <summary> | ||||||||||||||||||||||||||||||||||||||||
/// If they already have an effect with the same category, the new one will replace the old one. | ||||||||||||||||||||||||||||||||||||||||
/// </summary> | ||||||||||||||||||||||||||||||||||||||||
[DataField, ValidatePrototypeId<MoodCategoryPrototype>] | ||||||||||||||||||||||||||||||||||||||||
public string? Category; | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
/// <summary> | ||||||||||||||||||||||||||||||||||||||||
/// How much should this moodlet modify an entity's Mood. | ||||||||||||||||||||||||||||||||||||||||
/// </summary> | ||||||||||||||||||||||||||||||||||||||||
[DataField(required: true)] | ||||||||||||||||||||||||||||||||||||||||
public float MoodChange; | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+21
to
26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add range validation for MoodChange. The MoodChange property should include bounds checking to prevent extreme or invalid mood values that could affect game balance. Consider adding range validation: /// <summary>
/// How much should this moodlet modify an entity's Mood.
+ /// Valid range is [-1.0, 1.0] where negative values represent negative moods.
/// </summary>
[DataField(required: true)]
+ [DataField("moodChange", required: true)]
+ [ViewVariables(VVAccess.ReadWrite)]
+ public float MoodChange
+ {
+ get => _moodChange;
+ set => _moodChange = Math.Clamp(value, -1.0f, 1.0f);
+ }
- public float MoodChange;
+ private float _moodChange; 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
/// <summary> | ||||||||||||||||||||||||||||||||||||||||
/// How long, in Seconds, does this moodlet last? If omitted, the moodlet will last until canceled by any system. | ||||||||||||||||||||||||||||||||||||||||
/// </summary> | ||||||||||||||||||||||||||||||||||||||||
[DataField] | ||||||||||||||||||||||||||||||||||||||||
public int Timeout; | ||||||||||||||||||||||||||||||||||||||||
Comment on lines
+27
to
32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add timeout validation and fix documentation. The Timeout property needs validation and has a documentation style issue. Apply these changes: /// <summary>
- /// How long, in Seconds, does this moodlet last? If omitted, the moodlet will last until canceled by any system.
+ /// How long, in seconds, does this moodlet last? If omitted or zero, the moodlet will last until canceled by any system.
/// </summary>
[DataField]
- public int Timeout;
+ public int Timeout
+ {
+ get => _timeout;
+ set => _timeout = Math.Max(0, value);
+ }
+ private int _timeout; 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
/// <summary> | ||||||||||||||||||||||||||||||||||||||||
/// Should this moodlet be hidden from the player? EG: No popups or chat messages. | ||||||||||||||||||||||||||||||||||||||||
/// </summary> | ||||||||||||||||||||||||||||||||||||||||
[DataField] | ||||||||||||||||||||||||||||||||||||||||
public bool Hidden; | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
/// <summary> | ||||||||||||||||||||||||||||||||||||||||
/// When not null, this moodlet will replace itself with another Moodlet upon expiration. | ||||||||||||||||||||||||||||||||||||||||
/// </summary> | ||||||||||||||||||||||||||||||||||||||||
[DataField] | ||||||||||||||||||||||||||||||||||||||||
public ProtoId<MoodEffectPrototype>? MoodletOnEnd; | ||||||||||||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -404,3 +404,10 @@ reagent-effect-guidebook-plant-seeds-remove = | |||||||||||||||||||||||||||||||||||||||||||
[1] Removes the | ||||||||||||||||||||||||||||||||||||||||||||
*[other] remove the | ||||||||||||||||||||||||||||||||||||||||||||
} seeds of the plant | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
reagent-effect-guidebook-add-moodlet = | ||||||||||||||||||||||||||||||||||||||||||||
modifies mood by {$amount} | ||||||||||||||||||||||||||||||||||||||||||||
{ $timeout -> | ||||||||||||||||||||||||||||||||||||||||||||
[0] indefinitely | ||||||||||||||||||||||||||||||||||||||||||||
*[other] for {$timeout} seconds | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+408
to
+413
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance mood effect description and maintain consistency The new mood effect entry should follow the same chance-based pattern as other entries and provide clearer information about the mood effect. reagent-effect-guidebook-add-moodlet =
- modifies mood by {$amount}
- { $timeout ->
- [0] indefinitely
- *[other] for {$timeout} seconds
- }
+ { $chance ->
+ [1] { $amount ->
+ [>0] Improves
+ *[other] Worsens
+ }
+ *[other] { $amount ->
+ [>0] improve
+ *[other] worsen
+ }
+ } mood by {NATURALFIXED($amount, 2)} points
+ { $timeout ->
+ [0] indefinitely
+ *[other] for {NATURALFIXED($timeout, 1)} {MANY("second", $timeout)}
+ } This refactor:
📝 Committable suggestion
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ guide-entry-surgery = Хирургия | |
guide-entry-partmanipulation = Манипулирование конечностями | ||
guide-entry-organmanipulation = Манипулирование органами | ||
guide-entry-utilitysurgeries = Особые применения | ||
guide-entry-special-actions = Особые действия | ||
guide-entry-mood = Настроение | ||
Comment on lines
+19
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Missing English translations for new guide entries The Russian translations are correctly added, but the corresponding English entries
🔗 Analysis chainLGTM! Verify guide content integration. The new translations follow the established naming convention and appear to be correctly translated to Russian. Let's verify the integration with the corresponding English locale and guide content: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if the new guide entries exist in English locale and guidebook prototypes
# Check English locale for corresponding entries
echo "Checking English locale..."
rg "guide-entry-(special-actions|mood)" Resources/Locale/en-US/
# Check guidebook prototypes for corresponding entries
echo "Checking guidebook prototypes..."
rg "(?i)(special-actions|mood)" Resources/Prototypes/_Backmen/Guidebook/
Length of output: 625 Script: #!/bin/bash
# Let's check if the English locale file exists and contains these entries
echo "Checking English locale file content..."
fd "guides.ftl" Resources/Locale/en-US/ --exec cat {}
# Also check the actual guide content file
echo -e "\nChecking mood guide content..."
fd "Mood.xml" Resources/ServerInfo/_Backmen/Guidebook/ --exec cat {}
Length of output: 7880 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
- type: entity | ||
id: GuidebookMoodPerfect | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood9 | ||
|
||
- type: entity | ||
id: GuidebookMoodExceptional | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood8 | ||
|
||
- type: entity | ||
id: GuidebookMoodGreat | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood7 | ||
|
||
- type: entity | ||
id: GuidebookMoodGood | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood6 | ||
|
||
- type: entity | ||
id: GuidebookMoodNeutral | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood5 | ||
|
||
- type: entity | ||
id: GuidebookMoodMeh | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood4 | ||
|
||
- type: entity | ||
id: GuidebookMoodBad | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood3 | ||
|
||
- type: entity | ||
id: GuidebookMoodTerrible | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood2 | ||
|
||
- type: entity | ||
id: GuidebookMoodHorrible | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood1 | ||
|
||
- type: entity | ||
id: GuidebookMoodDead | ||
name: Mood | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Interface/Alerts/mood.rsi | ||
state: mood_happiness_bad |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- type: guideEntry | ||
id: SpecialActions | ||
name: guide-entry-special-actions | ||
text: "/ServerInfo/_Backmen/Guidebook/Controls/SpecialActions.xml" | ||
|
||
- type: guideEntry | ||
id: Mood | ||
name: guide-entry-mood | ||
text: "/ServerInfo/_Backmen/Guidebook/Controls/Mood.xml" | ||
Comment on lines
+6
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Documentation needs updating to cover new substance dependencies The Mood.xml file exists but lacks specific documentation about the new substance dependencies introduced in this PR (lotus oil, happiness, nicotine, and cosmic mirage). While it mentions substance dependencies in general terms, it should be updated to include:
🔗 Analysis chainVerify mood guide content alignment with new features The guide entry structure is correct. Since this PR introduces significant changes to the mood system (including substance dependencies for lotus oil, happiness, nicotine, and cosmic mirage), we should verify that the referenced XML file includes comprehensive documentation of these new features. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the Mood.xml file exists and contains documentation for new features
# Expected: File should exist and contain content about new mood mechanics and substance dependencies
# Search for the XML file
fd "Mood.xml" --type f
# If found, check its content for new feature documentation
fd "Mood.xml" --type f --exec cat {} \; | grep -iE "(dependency|substance|lotus|happiness|nicotine|cosmic|mirage)"
# Check for any TODO markers that might indicate incomplete documentation
fd "Mood.xml" --type f --exec grep -l "TODO" {} \;
Length of output: 250 Script: #!/bin/bash
# Let's directly examine the content of the Mood.xml file
cat "Resources/ServerInfo/_Backmen/Guidebook/Controls/Mood.xml"
Length of output: 2298 |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,68 @@ | ||||||||||||||||||||||
# 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: 3600 #1 hour | ||||||||||||||||||||||
category: "LotophagoiAddiction" | ||||||||||||||||||||||
|
||||||||||||||||||||||
- type: moodCategory | ||||||||||||||||||||||
id: LotophagoiAddiction | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+3
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Balance concerns with Lotophagoi Oil effects are valid and require adjustment Comparing with other mood effects in the codebase:
The Lotophagoi Oil's +30/-30 mood changes and 15min/1hour durations are indeed excessive and could create gameplay imbalance. 🔗 Analysis chainReview balance of Lotophagoi Oil effects. The mood effects for Lotophagoi Oil are significantly stronger than other substances:
Consider:
Let me gather more information about other mood effects to compare with Lotophagoi Oil. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for any gameplay balance configurations or documentation
rg -g "!*.yml" "Lotophagoi|lotus.*oil" -A 5
Length of output: 1030 Script: #!/bin/bash
# Search for other mood effects in yml files to compare values
rg "type: moodEffect" -A 4 Resources/Prototypes/
Length of output: 16242 |
||||||||||||||||||||||
# 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" | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+28
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify the missing timeout for nicotine withdrawal. The nicotine withdrawal effect has no timeout specified, which differs from other withdrawal effects. This could result in a permanent negative mood effect. If this is intentional, please document it explicitly. Otherwise, consider adding a timeout similar to other withdrawal effects: - type: moodEffect
id: NicotineWithdrawal
moodChange: -7 #No timeout
category: "NicotineAddiction"
+ timeout: 1800 #30 minutes 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
- type: moodCategory | ||||||||||||||||||||||
id: NicotineAddiction | ||||||||||||||||||||||
|
||||||||||||||||||||||
# Space drugs | ||||||||||||||||||||||
- type: moodEffect | ||||||||||||||||||||||
id: SpaceDrugsBenefit | ||||||||||||||||||||||
moodChange: 15 | ||||||||||||||||||||||
timeout: 480 #6 minutes | ||||||||||||||||||||||
moodletOnEnd: SpaceDrugsWithdrawal | ||||||||||||||||||||||
category: "SpaceDrugsAddiction" | ||||||||||||||||||||||
|
||||||||||||||||||||||
- type: moodEffect | ||||||||||||||||||||||
id: SpaceDrugsWithdrawal | ||||||||||||||||||||||
moodChange: -20 | ||||||||||||||||||||||
category: "SpaceDrugsAddiction" | ||||||||||||||||||||||
timeout: 1200 #20 minutes | ||||||||||||||||||||||
|
||||||||||||||||||||||
- type: moodCategory | ||||||||||||||||||||||
id: SpaceDrugsAddiction | ||||||||||||||||||||||
|
||||||||||||||||||||||
# Happiness | ||||||||||||||||||||||
- type: moodEffect | ||||||||||||||||||||||
id: HappinessBenefit | ||||||||||||||||||||||
moodChange: 20 | ||||||||||||||||||||||
timeout: 300 #5 minutes | ||||||||||||||||||||||
moodletOnEnd: HappinessWithdrawal | ||||||||||||||||||||||
category: "HappinessAddiction" | ||||||||||||||||||||||
|
||||||||||||||||||||||
- type: moodEffect | ||||||||||||||||||||||
id: HappinessWithdrawal | ||||||||||||||||||||||
moodChange: -20 | ||||||||||||||||||||||
category: "HappinessAddiction" | ||||||||||||||||||||||
timeout: 600 #10 minutes | ||||||||||||||||||||||
|
||||||||||||||||||||||
- type: moodCategory | ||||||||||||||||||||||
id: HappinessAddiction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve error handling and parameter usage
Several issues need attention:
prototype
parameter but resolvesIPrototypeManager
again via IoCConsider this improved implementation:
📝 Committable suggestion