Repository navigation
feat: add CellonService #152
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
Open
erwan-joly
wants to merge
2
commits into
master
Choose a base branch
from
claude/project-thread-feix5z
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
70 changes: 70 additions & 0 deletions
70
documentation/DocumentationTest.CellonDocumentation.approved.md
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,70 @@ | ||
| # Cellon Table | ||
| ## Cellon 1 - Cost: 700 | ||
| - Hp: 30 - 100 | ||
| - Mp: 50 - 120 | ||
| - HpRecovery: 5 - 10 | ||
| - MpRecovery: 8 - 15 | ||
|
|
||
| ## Cellon 2 - Cost: 1400 | ||
| - Hp: 120 - 200 | ||
| - Mp: 150 - 250 | ||
| - HpRecovery: 14 - 20 | ||
| - MpRecovery: 16 - 25 | ||
|
|
||
| ## Cellon 3 - Cost: 3000 | ||
| - Hp: 220 - 300 | ||
| - Mp: 280 - 330 | ||
| - HpRecovery: 22 - 28 | ||
| - MpRecovery: 28 - 35 | ||
|
|
||
| ## Cellon 4 - Cost: 5000 | ||
| - Hp: 330 - 400 | ||
| - Mp: 350 - 420 | ||
| - HpRecovery: 30 - 38 | ||
| - MpRecovery: 38 - 45 | ||
|
|
||
| ## Cellon 5 - Cost: 10000 | ||
| - Hp: 430 - 550 | ||
| - Mp: 450 - 550 | ||
| - HpRecovery: 40 - 50 | ||
| - MpRecovery: 50 - 60 | ||
|
|
||
| ## Cellon 6 - Cost: 20000 | ||
| - Hp: 600 - 750 | ||
| - Mp: 600 - 750 | ||
| - HpRecovery: 55 - 70 | ||
| - MpRecovery: 65 - 80 | ||
| - MpConsumption: 1 - 7 | ||
| - CriticalDamageDecrease: 1 - 10 | ||
|
|
||
| ## Cellon 7 - Cost: 32000 | ||
| - Hp: 800 - 1000 | ||
| - Mp: 800 - 1000 | ||
| - HpRecovery: 75 - 90 | ||
| - MpRecovery: 75 - 90 | ||
| - MpConsumption: 8 - 12 | ||
| - CriticalDamageDecrease: 11 - 20 | ||
|
|
||
| ## Cellon 8 - Cost: 58000 | ||
| - Hp: 1000 - 1300 | ||
| - Mp: 1000 - 1300 | ||
| - HpRecovery: 100 - 120 | ||
| - MpRecovery: 100 - 120 | ||
| - MpConsumption: 13 - 17 | ||
| - CriticalDamageDecrease: 21 - 35 | ||
|
|
||
| ## Cellon 9 - Cost: 95000 | ||
| - Hp: 1100 - 1500 | ||
| - Mp: 1100 - 1500 | ||
| - HpRecovery: 110 - 135 | ||
| - MpRecovery: 110 - 135 | ||
| - MpConsumption: 14 - 21 | ||
| - CriticalDamageDecrease: 22 - 45 | ||
|
|
||
| ## Cellon 10 - Cost: 134900 | ||
| - Hp: 1200 - 1700 | ||
| - Mp: 1200 - 1700 | ||
| - HpRecovery: 120 - 150 | ||
| - MpRecovery: 120 - 150 | ||
| - MpConsumption: 15 - 25 | ||
| - CriticalDamageDecrease: 23 - 55 |
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,18 @@ | ||
| // __ _ __ __ ___ __ ___ ___ | ||
| // | \| |/__\ /' _/ / _//__\| _ \ __| | ||
| // | | ' | \/ |`._`.| \_| \/ | v / _| | ||
| // |_|\__|\__/ |___/ \__/\__/|_|_\___| | ||
| // ----------------------------------- | ||
|
|
||
| using NosCore.Shared.Enumerations; | ||
|
|
||
| namespace NosCore.Algorithm.CellonService | ||
| { | ||
| /// <summary> | ||
| /// An option a cellon can roll, with the inclusive range its value is drawn from | ||
| /// </summary> | ||
| /// <param name="Type">The option type</param> | ||
| /// <param name="Minimum">The lowest value the option can roll</param> | ||
| /// <param name="Maximum">The highest value the option can roll</param> | ||
| public sealed record CellonOption(CellonType Type, int Minimum, int Maximum); | ||
| } |
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,56 @@ | ||
| // __ _ __ __ ___ __ ___ ___ | ||
| // | \| |/__\ /' _/ / _//__\| _ \ __| | ||
| // | | ' | \/ |`._`.| \_| \/ | v / _| | ||
| // |_|\__|\__/ |___/ \__/\__/|_|_\___| | ||
| // ----------------------------------- | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using NosCore.Shared.Enumerations; | ||
|
|
||
| namespace NosCore.Algorithm.CellonService | ||
| { | ||
| /// <summary> | ||
| /// Provides the options a cellon can add to an accessory and what applying it costs | ||
| /// </summary> | ||
| public class CellonService : ICellonService | ||
| { | ||
| internal static readonly long[] Price = | ||
| { 0, 700, 1400, 3000, 5000, 10000, 20000, 32000, 58000, 95000, 134900 }; | ||
|
|
||
| internal static readonly CellonOption[][] Options = | ||
| { | ||
| Array.Empty<CellonOption>(), | ||
| new CellonOption[] { new(CellonType.Hp, 30, 100), new(CellonType.Mp, 50, 120), new(CellonType.HpRecovery, 5, 10), new(CellonType.MpRecovery, 8, 15) }, | ||
| new CellonOption[] { new(CellonType.Hp, 120, 200), new(CellonType.Mp, 150, 250), new(CellonType.HpRecovery, 14, 20), new(CellonType.MpRecovery, 16, 25) }, | ||
| new CellonOption[] { new(CellonType.Hp, 220, 300), new(CellonType.Mp, 280, 330), new(CellonType.HpRecovery, 22, 28), new(CellonType.MpRecovery, 28, 35) }, | ||
| new CellonOption[] { new(CellonType.Hp, 330, 400), new(CellonType.Mp, 350, 420), new(CellonType.HpRecovery, 30, 38), new(CellonType.MpRecovery, 38, 45) }, | ||
| new CellonOption[] { new(CellonType.Hp, 430, 550), new(CellonType.Mp, 450, 550), new(CellonType.HpRecovery, 40, 50), new(CellonType.MpRecovery, 50, 60) }, | ||
| new CellonOption[] { new(CellonType.Hp, 600, 750), new(CellonType.Mp, 600, 750), new(CellonType.HpRecovery, 55, 70), new(CellonType.MpRecovery, 65, 80), new(CellonType.MpConsumption, 1, 7), new(CellonType.CriticalDamageDecrease, 1, 10) }, | ||
| new CellonOption[] { new(CellonType.Hp, 800, 1000), new(CellonType.Mp, 800, 1000), new(CellonType.HpRecovery, 75, 90), new(CellonType.MpRecovery, 75, 90), new(CellonType.MpConsumption, 8, 12), new(CellonType.CriticalDamageDecrease, 11, 20) }, | ||
| new CellonOption[] { new(CellonType.Hp, 1000, 1300), new(CellonType.Mp, 1000, 1300), new(CellonType.HpRecovery, 100, 120), new(CellonType.MpRecovery, 100, 120), new(CellonType.MpConsumption, 13, 17), new(CellonType.CriticalDamageDecrease, 21, 35) }, | ||
| new CellonOption[] { new(CellonType.Hp, 1100, 1500), new(CellonType.Mp, 1100, 1500), new(CellonType.HpRecovery, 110, 135), new(CellonType.MpRecovery, 110, 135), new(CellonType.MpConsumption, 14, 21), new(CellonType.CriticalDamageDecrease, 22, 45) }, | ||
| new CellonOption[] { new(CellonType.Hp, 1200, 1700), new(CellonType.Mp, 1200, 1700), new(CellonType.HpRecovery, 120, 150), new(CellonType.MpRecovery, 120, 150), new(CellonType.MpConsumption, 15, 25), new(CellonType.CriticalDamageDecrease, 23, 55) }, | ||
| }; | ||
|
|
||
| /// <summary> | ||
| /// Gets the options a cellon of a specific level can roll | ||
| /// </summary> | ||
| /// <param name="level">The cellon level</param> | ||
| /// <returns>The options, or an empty list for a level no cellon has</returns> | ||
| public IReadOnlyList<CellonOption> GetOptions(byte level) | ||
| { | ||
| return level <= Constants.MaxCellonLevel ? Array.AsReadOnly(Options[level]) : Array.Empty<CellonOption>(); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets the gold cost of applying a cellon of a specific level | ||
| /// </summary> | ||
| /// <param name="level">The cellon level</param> | ||
| /// <returns>The gold cost</returns> | ||
| public long GetPrice(byte level) | ||
| { | ||
| return Price[level]; | ||
| } | ||
| } | ||
| } |
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,30 @@ | ||
| // __ _ __ __ ___ __ ___ ___ | ||
| // | \| |/__\ /' _/ / _//__\| _ \ __| | ||
| // | | ' | \/ |`._`.| \_| \/ | v / _| | ||
| // |_|\__|\__/ |___/ \__/\__/|_|_\___| | ||
| // ----------------------------------- | ||
|
|
||
| using System.Collections.Generic; | ||
|
|
||
| namespace NosCore.Algorithm.CellonService | ||
| { | ||
| /// <summary> | ||
| /// Service for retrieving the options a cellon can add to an accessory and what applying it costs | ||
| /// </summary> | ||
| public interface ICellonService | ||
| { | ||
| /// <summary> | ||
| /// Gets the options a cellon of a specific level can roll | ||
| /// </summary> | ||
| /// <param name="level">The cellon level</param> | ||
| /// <returns>The options, or an empty list for a level no cellon has</returns> | ||
| IReadOnlyList<CellonOption> GetOptions(byte level); | ||
|
|
||
| /// <summary> | ||
| /// Gets the gold cost of applying a cellon of a specific level | ||
| /// </summary> | ||
| /// <param name="level">The cellon level</param> | ||
| /// <returns>The gold cost</returns> | ||
| long GetPrice(byte level); | ||
| } | ||
| } |
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
Oops, something went wrong.
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.
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.
Script executed:
Repository: NosCoreIO/NosCore.Algorithm
Length of output: 2046
Web query:
NuGet NosCore.Shared 6.1.0 package nuget.orgResult:
Script executed:
Repository: NosCoreIO/NosCore.Algorithm
Length of output: 1380
Script executed:
Repository: NosCoreIO/NosCore.Algorithm
Length of output: 1591
Publish NosCore.Shared 6.1.0 before merging this PR.
NosCore.Algorithm.csprojrequiresNosCore.Shared6.1.0. The only configured package source is nuget.org, and CI runsdotnet restorewithout a local feed. While 6.1.0 is unpublished, restore fails, so the required build and test steps cannot run. Merge after 6.1.0 is available on nuget.org, then rerun CI.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.
Expected. This PR merges only after NosCoreIO/NosCore.Shared#289 is tagged 6.1.0 and that version is on nuget.org. CI will be re-run then. Leaving this open until it is.
Generated by Claude Code
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.
@erwan-joly Understood. This is an expected dependency, not a requested code change. The finding remains open pending the 6.1.0 release and a successful CI rerun.
You are interacting with an AI system.