Monster Attribute Scaler Plugin#772
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new feature plugin designed to enhance game difficulty by scaling monster attributes. It leverages the existing plugin architecture to apply multiplicative modifiers to monster stats at spawn time, while providing a configurable interface for server administrators to adjust these values. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new MonsterAttributeScaler plugin and its associated configuration to scale monster attributes like health, damage, and defense by a configurable percentage. The code review identified a critical issue where attribute modifiers were not being removed when monsters were removed from the map, which could lead to stat stacking on respawn. Additionally, feedback was provided to refine the health-scaling logic to prevent unintended healing or resurrection, and a suggestion was made to replace Console.WriteLine with a structured logging framework.
sven-n
left a comment
There was a problem hiding this comment.
Configuration changes in the Admin Panel require a server restart to take effect.
Do you know why? Because the plugin creates one element per monster and never updates it again.
How about this solution:
- The plugin just holds one SimpleElement and shares it between all monsters by adding the same instance to all monsters. No tracking of monsters required.
- When configuration changed, simply apply the change to the one shared SimpleElement instance.
Can you try that?
It could also be interesting to add percentages for different kind of attributes. At the moment, it scales every attribute by the same percentage.
Monster Attribute Scaler Plugin
What it does:
A feature plugin that scales all monster base stats by a configurable percentage.
Default: +25% to MinimumPhysBaseDmg, MaximumPhysBaseDmg, AttackRatePvm,
DefenseRatePvm, DefenseBase, and MaximumHealth. Starts disabled by default.
How it works:
The plugin uses multiplicative IElement instances applied per-monster instance,
rather than modifying MonsterDefinition.Attributes. Configuration changes in the
Admin Panel require a server restart to take effect.
scaled at spawn time.
keyed by IAttackable. When a monster is removed from a map, the tracking entry
is cleaned up via IObjectRemovedFromMapPlugIn to prevent memory leaks.
Files modified for this plugin:
OpenMU/src/GameLogic/Properties/PlugInResources.resx
Files added for this plugin:
OpenMU/src/GameLogic/PlugIns/MonsterAttributeScaler.cs
OpenMU/src/GameLogic/PlugIns/MonsterAttributeScalerConfiguration.cs