-
Notifications
You must be signed in to change notification settings - Fork 520
feature/random xp config #758
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bd23f20
feature: implement party xp bonus
eduardosmaniotto a0ac911
Merge branch 'master' into feature/party-xp
eduardosmaniotto 46a5919
create random xp bonus and party xp bonus configurations
eduardosmaniotto 745c507
Merge branch 'master' into feature/party-xp
eduardosmaniotto 7ac9a88
Merge branch 'master' into feature/party-xp
eduardosmaniotto 176f72a
fix merge conflict
eduardosmaniotto 59cd02b
Merge branch 'master' into feature/party-xp
eduardosmaniotto 17ec82c
revert party xp changes, keeping only random xp config
eduardosmaniotto 1d5fe83
revert party xp changes, keeping only random xp config
eduardosmaniotto 23c76c5
code review: apply gemini code suggestion
eduardosmaniotto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
src/Persistence/Initialization/CharacterClasses/CharacterClassInitialization.cs
This file contains hidden or 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 hidden or 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
23 changes: 23 additions & 0 deletions
23
src/Persistence/Initialization/Updates/AddRandomExperienceConfigAttributesPlugIn075.cs
This file contains hidden or 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,23 @@ | ||
| // <copyright file="AddRandomExperienceConfigAttributesPlugIn075.cs" company="MUnique"> | ||
| // Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
| // </copyright> | ||
|
|
||
| namespace MUnique.OpenMU.Persistence.Initialization.Updates; | ||
|
|
||
| using System.Runtime.InteropServices; | ||
| using MUnique.OpenMU.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// This update adds the random experience config attributes for version 0.75. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = PlugInName, Description = PlugInDescription)] | ||
| [Guid("5F412933-CC0F-483B-B6AE-7B358A6257FD")] | ||
| public class AddRandomExperienceConfigAttributesPlugIn075 : AddRandomExperienceConfigAttributesPlugInBase | ||
| { | ||
| /// <inheritdoc /> | ||
| public override UpdateVersion Version => UpdateVersion.AddRandomExperienceConfigAttributes075; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override string DataInitializationKey => Version075.DataInitialization.Id; | ||
| } |
23 changes: 23 additions & 0 deletions
23
src/Persistence/Initialization/Updates/AddRandomExperienceConfigAttributesPlugIn095d.cs
This file contains hidden or 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,23 @@ | ||
| // <copyright file="AddRandomExperienceConfigAttributesPlugIn095d.cs" company="MUnique"> | ||
| // Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
| // </copyright> | ||
|
|
||
| namespace MUnique.OpenMU.Persistence.Initialization.Updates; | ||
|
|
||
| using System.Runtime.InteropServices; | ||
| using MUnique.OpenMU.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// This update adds the random experience config attributes for version 0.95d. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = PlugInName, Description = PlugInDescription)] | ||
| [Guid("9A166583-C3E7-4E04-924C-F01FF9840974")] | ||
| public class AddRandomExperienceConfigAttributesPlugIn095d : AddRandomExperienceConfigAttributesPlugInBase | ||
| { | ||
| /// <inheritdoc /> | ||
| public override UpdateVersion Version => UpdateVersion.AddRandomExperienceConfigAttributes095d; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override string DataInitializationKey => Version095d.DataInitialization.Id; | ||
| } |
71 changes: 71 additions & 0 deletions
71
src/Persistence/Initialization/Updates/AddRandomExperienceConfigAttributesPlugInBase.cs
This file contains hidden or 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,71 @@ | ||
| // <copyright file="AddRandomExperienceConfigAttributesPlugInBase.cs" company="MUnique"> | ||
| // Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
| // </copyright> | ||
|
|
||
| namespace MUnique.OpenMU.Persistence.Initialization.Updates; | ||
|
|
||
| using MUnique.OpenMU.AttributeSystem; | ||
| using MUnique.OpenMU.DataModel.Configuration; | ||
| using MUnique.OpenMU.GameLogic.Attributes; | ||
|
|
||
| /// <summary> | ||
| /// This update adds the random experience config attributes to the database | ||
| /// (RandomExperienceMinMultiplier, RandomExperienceMaxMultiplier) | ||
| /// and assigns their default values to global base attributes. | ||
| /// </summary> | ||
| public abstract class AddRandomExperienceConfigAttributesPlugInBase : UpdatePlugInBase | ||
| { | ||
| /// <summary> | ||
| /// The plugin name. | ||
| /// </summary> | ||
| internal const string PlugInName = "Add Random Experience Configuration Attributes"; | ||
|
|
||
| /// <summary> | ||
| /// The plugin description. | ||
| /// </summary> | ||
| internal const string PlugInDescription = "Adds new random experience Configuration attributes to the game configuration."; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override string Name => PlugInName; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override string Description => PlugInDescription; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override bool IsMandatory => true; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override DateTime CreatedAt => new(2026, 04, 27, 20, 0, 0, DateTimeKind.Utc); | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) | ||
| { | ||
| var attributesToAdd = new[] | ||
| { | ||
| Stats.RandomExperienceMinMultiplier, | ||
| Stats.RandomExperienceMaxMultiplier, | ||
| }; | ||
|
|
||
| foreach (var attr in attributesToAdd) | ||
| { | ||
| if (!gameConfiguration.Attributes.Any(a => a.Id == attr.Id)) | ||
| { | ||
| var newAttr = context.CreateNew<AttributeDefinition>(attr.Id, attr.Designation, attr.Description); | ||
| gameConfiguration.Attributes.Add(newAttr); | ||
| } | ||
| } | ||
|
|
||
| var randMin = gameConfiguration.Attributes.First(a => a.Id == Stats.RandomExperienceMinMultiplier.Id); | ||
| var randMax = gameConfiguration.Attributes.First(a => a.Id == Stats.RandomExperienceMaxMultiplier.Id); | ||
|
|
||
| if (!gameConfiguration.GlobalBaseAttributeValues.Any(a => a.Definition?.Id == randMin.Id)) | ||
| { | ||
| gameConfiguration.GlobalBaseAttributeValues.Add(context.CreateNew<ConstValueAttribute>(0.8f, randMin)); | ||
| } | ||
|
|
||
| if (!gameConfiguration.GlobalBaseAttributeValues.Any(a => a.Definition?.Id == randMax.Id)) | ||
| { | ||
| gameConfiguration.GlobalBaseAttributeValues.Add(context.CreateNew<ConstValueAttribute>(1.2f, randMax)); | ||
| } | ||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
src/Persistence/Initialization/Updates/AddRandomExperienceConfigAttributesPlugInSeason6.cs
This file contains hidden or 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,23 @@ | ||
| // <copyright file="AddRandomExperienceConfigAttributesPlugInSeason6.cs" company="MUnique"> | ||
| // Licensed under the MIT License. See LICENSE file in the project root for full license information. | ||
| // </copyright> | ||
|
|
||
| namespace MUnique.OpenMU.Persistence.Initialization.Updates; | ||
|
|
||
| using System.Runtime.InteropServices; | ||
| using MUnique.OpenMU.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// This update adds the random experience config attributes for season 6. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = PlugInName, Description = PlugInDescription)] | ||
| [Guid("D1DC70A2-2614-4CC0-81C0-6C8253781019")] | ||
| public class AddRandomExperienceConfigAttributesPlugInSeason6 : AddRandomExperienceConfigAttributesPlugInBase | ||
| { | ||
| /// <inheritdoc /> | ||
| public override UpdateVersion Version => UpdateVersion.AddRandomExperienceConfigAttributesSeason6; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override string DataInitializationKey => VersionSeasonSix.DataInitialization.Id; | ||
| } |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.