Skip to content
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

Eternum docs #2221

Merged
merged 8 commits into from
Dec 5, 2024
Merged

Eternum docs #2221

merged 8 commits into from
Dec 5, 2024

Conversation

bob0005
Copy link
Collaborator

@bob0005 bob0005 commented Dec 5, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new section on "Achievements & Quests" detailing various in-game achievements.
    • Added a "Victory and Rewards" section outlining winning conditions and rewards for players.
    • New components for displaying building costs and quest rewards.
  • Documentation Updates

    • Enhanced clarity in combat mechanics and resource production with updated sections.
    • Added a "Disclaimer and Risk Acknowledgment" section outlining critical terms for players.
  • Bug Fixes

    • Resolved inconsistencies in resource ID representations across documentation.

These updates aim to improve user experience by providing clearer information and enhancing gameplay features.

Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eternum ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 0:06am
eternum-docs ❌ Failed (Inspect) Dec 5, 2024 0:06am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
eternum-landing ⬜️ Ignored (Inspect) Visit Preview Dec 5, 2024 0:06am

Copy link
Contributor

coderabbitai bot commented Dec 5, 2024

Walkthrough

The pull request includes the deletion of the ResourceIcon.tsx component and significant updates across various documentation files related to the game Eternum. New sections and subsections are added to documents concerning achievements, mechanics, and seasons, enhancing clarity and detail. Additionally, several new components are introduced, such as BuildingCosts, QuestRewards, and RealmUpgradeCosts, which improve the organization and presentation of game-related information. Import paths have been updated, and new utility functions for formatting have been added to improve numerical representation throughout the documentation.

Changes

File Path Change Summary
eternum-docs/components/ResourceIcon.tsx Component removed: ResourceIcon.
eternum-docs/docs/pages/mechanics/achievements.mdx New section added: Achievements & Quests, with subsections and list items for various achievement categories.
eternum-docs/docs/pages/mechanics/hyperstructures.mdx Imports added; sections revised for clarity and dynamic point referencing.
eternum-docs/docs/pages/mechanics/military/combat.mdx Imports added; combat mechanics updated for clarity and configurability.
eternum-docs/docs/pages/mechanics/realm/buildings.mdx New components added; restructuring of content related to building costs.
eternum-docs/docs/pages/mechanics/realm/realm.mdx New imports added; expanded details on realm levels and dynamic content updates.
eternum-docs/docs/pages/mechanics/realm/wonders.mdx New bullet point added under Exclusive Benefits regarding Wonders.
eternum-docs/docs/pages/mechanics/resources/production.mdx New component added: ResourceTable; import path for ResourceIcon updated.
eternum-docs/docs/pages/mechanics/resources/resources.mdx Resource IDs updated from string to numeric literals; import path for ResourceIcon updated.
eternum-docs/docs/pages/mechanics/resources/storage.mdx New imports added; dynamic calculations for resource weights and storage capacities introduced.
eternum-docs/docs/pages/overview/disclaimer.mdx New section added: Disclaimer and Risk Acknowledgment, outlining key terms and conditions.
eternum-docs/docs/pages/overview/entry.mdx Sections reorganized and renamed for clarity.
eternum-docs/docs/pages/overview/links.mdx New links added under Play & Learn section.
eternum-docs/docs/pages/seasons/overview.mdx New section added: Victory and Rewards, detailing winning conditions and rewards system.
eternum-docs/docs/pages/seasons/rewards.mdx New documentation page for Victory and Rewards, outlining critical warnings and reward distribution.
eternum-docs/src/components/BuildingCosts.tsx New component added: BuildingCosts for displaying building costs.
eternum-docs/src/components/QuestRewards.tsx New component added: QuestRewards for displaying quest rewards.
eternum-docs/src/components/RealmUpgradeCosts.tsx New component added: RealmUpgradeCosts for displaying realm upgrade costs.
eternum-docs/src/utils/constants.tsx New constant added: resources, an array of resource objects.
eternum-docs/src/utils/formatting.tsx Several utility functions added for number formatting and precision handling.
eternum-docs/tsconfig.json Updated include array to include src/components path for TypeScript compilation.
eternum-docs/vocs.config.ts Sidebar structure reorganized, including new links and sections.

Possibly related PRs

Suggested reviewers

  • aymericdelab
  • edisontim

Poem

🐰 In the land of Eternum, where wonders bloom,
A tale of resources, we now resume.
With quests and achievements, players will strive,
New costs and rewards, keeping dreams alive.
So hop to the game, let your journey start,
In this vibrant realm, play with all your heart! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

mentatbot bot commented Dec 5, 2024

You are out of MentatBot reviews. Your usage will refresh December 9 at 08:00 AM.

Copy link

github-actions bot commented Dec 5, 2024

Failed to generate code suggestions for PR

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Outside diff range and nitpick comments (24)
eternum-docs/vocs.config.ts (1)

29-33: Clean up and reorder navigation items

Two suggestions for improvement:

  1. Remove the commented-out Welcome page instead of keeping it as a comment
  2. Consider moving the "Disclaimer - MUST READ" higher in the navigation, possibly right after Introduction, given its importance
 text: "Overview",
 items: [
-  // { text: "Welcome", link: "/overview/welcome" },
   { text: "Introduction", link: "/overview/introduction" },
+  { text: "Disclaimer - MUST READ", link: "/overview/disclaimer" },
   { text: "Entry", link: "/overview/entry" },
   { text: "Quick Links", link: "/overview/links" },
-  { text: "Disclaimer - MUST READ", link: "/overview/disclaimer" },
 ],
eternum-docs/src/components/ResourceIcon.tsx (1)

3-7: Consider adding resource ID type safety

The id parameter could benefit from a more specific type than number | undefined to ensure only valid resource IDs are passed.

+type ResourceId = number;  // Consider making this a union of valid IDs
 type Props = {
   name: string;
-  id: number | undefined;
+  id: ResourceId | undefined;
   size?: number;
 };
eternum-docs/docs/pages/overview/links.mdx (1)

12-13: Maintain consistent punctuation in link descriptions

For consistency with other entries, ensure all descriptions end with periods.

- - [Data & Analytics](https://empire.realms.world/) - Mint your season pass
- - [Marketplace](https://market.realms.world/) - Buy your own Realm NFT or season pass
+ - [Data & Analytics](https://empire.realms.world/) - Mint your season pass.
+ - [Marketplace](https://market.realms.world/) - Buy your own Realm NFT or season pass.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~12-~12: A punctuation mark might be missing here.
Context: ...e.realms.world/) - Mint your season pass - [Marketplace](https://market.realms.world...

(AI_EN_LECTOR_MISSING_PUNCTUATION)

eternum-docs/tsconfig.json (1)

25-25: Remove redundant include path

The path "src/components" is redundant in the include array since "src" already includes all subdirectories under src. TypeScript will automatically include all .ts, .tsx, .d.ts files in src and its subdirectories.

-  "include": ["src", "src/components"],
+  "include": ["src"],
eternum-docs/src/utils/formatting.tsx (1)

7-15: Add input validation for decimal places

The formatNumber function should validate the decimals parameter to prevent negative values or excessive precision.

 export const formatNumber = (num: number, decimals: number): string => {
+  if (decimals < 0) throw new Error('Decimals cannot be negative');
+  if (decimals > 20) throw new Error('Maximum 20 decimal places supported');
   let str = num.toFixed(decimals);

   if (str.includes(".")) {
     str = str.replace(/\.?0+$/, "");
   }

   return str;
 };
eternum-docs/src/components/RealmUpgradeCosts.tsx (1)

14-29: Add semantic HTML structure

The component should use semantic HTML elements for better accessibility.

 return (
-  <div className="my-4 p-3">
-    <div className="font-bold mb-2">Upgrade costs:</div>
-    <div className="grid grid-cols-2 sm:grid-cols-3 gap-2">
+  <section className="my-4 p-3" aria-labelledby="upgrade-costs-title">
+    <h2 id="upgrade-costs-title" className="font-bold mb-2">Upgrade costs:</h2>
+    <ul className="grid grid-cols-2 sm:grid-cols-3 gap-2" role="list">
       {costs.map((cost) => {
         // ... existing mapping code ...
       })}
-    </div>
-  </div>
+    </ul>
+  </section>
 );
eternum-docs/src/components/QuestRewards.tsx (1)

22-22: Consider making the 'K' suffix configurable

The hardcoded 'K' suffix might not be suitable for all amounts. Consider making it dynamic based on the value range.

-                    <span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
+                    <span className="font-medium">
+                      {formatNumberWithSpaces(cost.amount)}
+                      {cost.amount >= 1000 ? 'K' : ''}
+                    </span>
eternum-docs/docs/pages/mechanics/resources/production.mdx (1)

6-7: Consider enhancing the resource insufficiency explanation

The explanation about production halting could be more specific about the threshold at which production stops and how players can monitor this.

-Each resource incurs a production cost. To sustain production, you must balance these costs. If resources are
-insufficient, production will halt until they are replenished.
+Each resource incurs a production cost. To sustain production, you must maintain sufficient input resources. Production
+automatically halts when any required input resource falls below the required amount, and resumes once all resources
+are replenished above the minimum threshold.
eternum-docs/docs/pages/overview/entry.mdx (2)

22-23: Clarify marketplace listing process

The marketplace section could be more detailed about how the listing process works.

-Should a Realm Holder decide not to play with his season ticket, he/she can sell it on the
-[Realms MarketPlace](https://market.realms.world/)
+Should a Realm Holder decide not to participate in a season, they can list their season ticket for sale on the
+[Realms MarketPlace](https://market.realms.world/). The listing process requires connecting your wallet and setting
+a sale price in $LORDS tokens.

42-45: Expand on the Takeover System mechanics

The Takeover System section could benefit from more details about the mechanics and implications.

-> Realms can be conquered within a Season, leading to a temporary loss of control for the original owner. Gameplay
-> rights are restored at the start of the next Season, ensuring a dynamic and competitive environment.
+> Realms can be conquered within a Season through specific combat mechanics:
+> - Conquering requires meeting certain military strength thresholds
+> - Original owners temporarily lose control of resource production and building management
+> - All conquest effects are reset at the start of each new Season
+> - Original owners retain their NFT ownership throughout the process
+> This system creates a dynamic and competitive environment while preserving long-term ownership rights.
eternum-docs/docs/pages/mechanics/resources/storage.mdx (1)

13-20: Consider adding units of measurement consistently.

While the weights are correctly displayed using dynamic values, consider standardizing the unit display format. For example:

-- Basic resources (Wood, Stone, Coal,...):
-  {divideByPrecision(EternumGlobalConfig.resources.resourceWeightsGrams[ResourcesIds.Wood])}kg per unit
+- Basic resources (Wood, Stone, Coal,...): {divideByPrecision(EternumGlobalConfig.resources.resourceWeightsGrams[ResourcesIds.Wood])} kg/unit
eternum-docs/docs/pages/mechanics/realm/realm.mdx (1)

65-68: Consider adding more context to immunity duration.

The immunity duration calculation might be confusing for readers. Consider presenting it in a more reader-friendly format.

-- {(EternumGlobalConfig.tick.armiesTickIntervalInSeconds / 3600 * EternumGlobalConfig.battle.graceTickCount)}-hour immunity from attacks and from attacking others
+- {formatNumberWithSpaces(EternumGlobalConfig.tick.armiesTickIntervalInSeconds / 3600 * EternumGlobalConfig.battle.graceTickCount)} hours of immunity from both incoming and outgoing attacks
eternum-docs/docs/pages/mechanics/hyperstructures.mdx (1)

47-50: Enhance readability of points system description.

Consider using a more structured format for the points system information.

-- {EternumGlobalConfig.hyperstructures.hyperstructurePointsPerCycle} points are generated each Eternum cycle
-- Distribution follows a share-based system
-- The structure owner controls share allocation
-- Share modifications have a 48-hour cooldown period
+- Points Generation:
+  - {formatNumberWithSpaces(EternumGlobalConfig.hyperstructures.hyperstructurePointsPerCycle)} points per Eternum cycle
+- Share System:
+  - Points distributed based on share allocation
+  - Structure owner controls share distribution
+  - 48-hour cooldown period for share modifications
eternum-docs/docs/pages/mechanics/military/combat.mdx (4)

15-17: Consider adding examples for combat advantage calculations.

The damage modifiers are clearly stated, but adding practical examples would help players better understand the impact of these advantages in actual combat scenarios.


29-30: Format the troop loss percentage for better readability.

Consider formatting the configuration value for better readability. For example:

-Retreating forces pay a steep price: deserting armies lose {EternumGlobalConfig.battle.TROOP_BATTLE_LEAVE_SLASH_NUM}% of
+Retreating forces pay a steep price: deserting armies lose **{EternumGlobalConfig.battle.TROOP_BATTLE_LEAVE_SLASH_NUM}%** of

36-49: Consider adding a visual timeline for siege mechanics.

The siege mechanics are well documented, but a visual representation (timeline) could help players better understand the sequence of events and available actions during different phases.


54-61: Add specific examples of resource pillaging calculations.

The resource pillaging section would benefit from concrete examples showing:

  • How stamina affects maximum resource theft
  • Typical troop loss scenarios
eternum-docs/src/components/BuildingCosts.tsx (2)

19-37: Extract repeated resource cost mapping logic.

The resource cost mapping logic is duplicated. Consider extracting it into a reusable component or function.

const ResourceCostDisplay = ({ costs }: { costs: typeof resourceCostsWheat }) => (
  <>
    {costs.map((cost) => {
      const resource = findResourceById(cost.resource);
      return (
        <div key={cost.resource} className="flex items-center gap-1 px-2 py-1.5 rounded-md">
          <ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
          <span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
        </div>
      );
    })}
  </>
);

Then use it like:

<ResourceCostDisplay costs={woodBuildingCosts} />
<span className="">or</span>
<ResourceCostDisplay costs={stoneBuildingCosts} />

43-43: Add error boundary for missing costs.

Consider adding error boundaries or proper error messaging when costs are not available.

-if (costs.length === 0) return null;
+if (!costs?.length) {
+  console.warn(`No costs found for building type: ${buildingType}`);
+  return null;
+}
eternum-docs/docs/pages/seasons/rewards.mdx (2)

27-27: Consider improving grammar in the distribution section.

Add "the" before "season end" for better readability:

-Rewards are distributed after season end:
+Rewards are distributed after the season end:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~27-~27: You might be missing the article “the” here.
Context: ...ribution Rewards are distributed after season end: - Individual rewards are airdropp...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~27-~27: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...n Rewards are distributed after season end: - Individual rewards are airdropped d...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


71-81: Consider using a table for guild rewards structure.

The current list format for guild rewards could be improved using a table for better readability and comparison.

Consider using markdown table format:

-1st Place: 30%
-2nd Place: 20%
-3rd Place: 13%
+| Place | Reward |
+|-------|--------|
+| 1st   | 30%    |
+| 2nd   | 20%    |
+| 3rd   | 13%    |
eternum-docs/docs/pages/mechanics/realm/buildings.mdx (1)

129-136: Consider adding a cost calculation example.

The cost scaling section could benefit from a concrete example showing the actual resource costs for subsequent buildings.

Consider adding:

Example for a Farm:
- First Farm: 100 wood, 50 stone
- Second Farm: 200 wood, 100 stone
- Third Farm: 400 wood, 200 stone
eternum-docs/src/utils/constants.tsx (2)

8-11: Maintain consistent description formatting across resources

Several resources have inconsistent description formatting:

  • Basic resources (Stone, Coal, etc.) have detailed, lore-rich descriptions
  • Game units (Knight, Crossbowman, etc.) have minimal "Wheat." descriptions
  • Some descriptions end with periods, others don't

Consider updating these descriptions to maintain a consistent style and level of detail across all resources.

Also applies to: 224-227, 234-237, 243-246, 252-255, 261-264, 270-273, 279-282


11-11: Document ticker symbol abbreviation conventions

Each resource has a ticker symbol (e.g., "$STONE", "$CLDIRN", "$HRTWD") but the rules for abbreviation are not documented. This could make it difficult for other developers to maintain consistency when adding new resources.

Consider adding documentation about:

  • The use of "$" prefix
  • Maximum ticker length
  • Abbreviation rules

Also applies to: 21-21, 30-30, 40-40, 50-50, 60-60, 69-69, 78-78, 88-88, 98-98, 108-108, 118-118, 128-128, 138-138, 148-148, 158-158, 168-168, 178-178, 188-188, 198-198, 208-208, 218-218, 227-227, 236-236, 245-245, 254-254, 263-263, 272-272, 281-281, 290-290

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between adea4bc and e4667c5.

⛔ Files ignored due to path filters (1)
  • eternum-docs/docs/public/resources/253.png is excluded by !**/*.png
📒 Files selected for processing (24)
  • eternum-docs/components/ResourceIcon.tsx (0 hunks)
  • eternum-docs/docs/pages/mechanics/achievements.mdx (1 hunks)
  • eternum-docs/docs/pages/mechanics/hyperstructures.mdx (2 hunks)
  • eternum-docs/docs/pages/mechanics/military/combat.mdx (3 hunks)
  • eternum-docs/docs/pages/mechanics/realm/buildings.mdx (8 hunks)
  • eternum-docs/docs/pages/mechanics/realm/realm.mdx (2 hunks)
  • eternum-docs/docs/pages/mechanics/realm/wonders.mdx (1 hunks)
  • eternum-docs/docs/pages/mechanics/resources/production.mdx (2 hunks)
  • eternum-docs/docs/pages/mechanics/resources/resources.mdx (6 hunks)
  • eternum-docs/docs/pages/mechanics/resources/storage.mdx (2 hunks)
  • eternum-docs/docs/pages/overview/disclaimer.mdx (1 hunks)
  • eternum-docs/docs/pages/overview/entry.mdx (1 hunks)
  • eternum-docs/docs/pages/overview/links.mdx (1 hunks)
  • eternum-docs/docs/pages/seasons/overview.mdx (0 hunks)
  • eternum-docs/docs/pages/seasons/rewards.mdx (1 hunks)
  • eternum-docs/src/components/BuildingCosts.tsx (1 hunks)
  • eternum-docs/src/components/QuestRewards.tsx (1 hunks)
  • eternum-docs/src/components/RealmUpgradeCosts.tsx (1 hunks)
  • eternum-docs/src/components/ResourceIcon.tsx (1 hunks)
  • eternum-docs/src/components/ResourceTable.tsx (1 hunks)
  • eternum-docs/src/utils/constants.tsx (1 hunks)
  • eternum-docs/src/utils/formatting.tsx (1 hunks)
  • eternum-docs/tsconfig.json (1 hunks)
  • eternum-docs/vocs.config.ts (2 hunks)
💤 Files with no reviewable changes (2)
  • eternum-docs/components/ResourceIcon.tsx
  • eternum-docs/docs/pages/seasons/overview.mdx
✅ Files skipped from review due to trivial changes (2)
  • eternum-docs/docs/pages/mechanics/achievements.mdx
  • eternum-docs/docs/pages/overview/disclaimer.mdx
🧰 Additional context used
🪛 LanguageTool
eternum-docs/docs/pages/overview/links.mdx

[uncategorized] ~12-~12: A punctuation mark might be missing here.
Context: ...e.realms.world/) - Mint your season pass - [Marketplace](https://market.realms.world...

(AI_EN_LECTOR_MISSING_PUNCTUATION)

eternum-docs/docs/pages/seasons/rewards.mdx

[uncategorized] ~27-~27: You might be missing the article “the” here.
Context: ...ribution Rewards are distributed after season end: - Individual rewards are airdropp...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~27-~27: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...n Rewards are distributed after season end: - Individual rewards are airdropped d...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~45-~45: A period might be missing here.
Context: ...kens within the game become permanently inaccessible ### Season Rewards #### Individual Le...

(AI_EN_LECTOR_MISSING_PUNCTUATION_PERIOD)


[uncategorized] ~58-~58: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...ercentage of total VP earned: - If you earned 5% of all VP during the season, you rec...

(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)


[grammar] ~58-~58: With the quantifier ‘all’, the plural form may be more appropriate here.
Context: ...l VP earned: - If you earned 5% of all VP during the season, you receive 5% of th...

(OF_ALL_PLURAL)

eternum-docs/docs/pages/mechanics/realm/realm.mdx

[uncategorized] ~56-~56: Possible missing comma found.
Context: ...ropes as a newly appointed Lord of your Realm Going through these will > help you lea...

(AI_HYDRA_LEO_MISSING_COMMA)

🪛 Biome (1.9.4)
eternum-docs/src/components/ResourceTable.tsx

[error] 54-54: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

eternum-docs/src/components/QuestRewards.tsx

[error] 14-14: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (13)
eternum-docs/vocs.config.ts (2)

74-81: Verify the existence of new Season pages

The new Seasons section structure looks good and provides a clear separation of concerns.

Let's verify that the referenced documentation pages exist:

✅ Verification successful

Navigation structure matches existing documentation pages

The new Seasons section in the navigation correctly references the existing documentation pages:

  • /seasons/overvieweternum-docs/docs/pages/seasons/overview.mdx
  • /seasons/rewardseternum-docs/docs/pages/seasons/rewards.mdx
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new season documentation pages exist
# Expected: Both files should exist in the docs directory

fd -t f "overview.mdx|rewards.mdx" -p "seasons/"

Length of output: 144


Script:

#!/bin/bash
# Let's first find the docs directory structure
fd -t d "docs"

# Then search for the season-related files in the entire repository
fd -t f "overview.mdx|rewards.mdx"

Length of output: 173


Line range hint 12-19: Verify color contrast for accessibility

The custom theme colors, particularly textAccent: "#f6c297" against background: "#14100d", should be verified for sufficient contrast ratio to ensure accessibility compliance.

eternum-docs/docs/pages/mechanics/realm/wonders.mdx (1)

13-13: LGTM! Clear and informative addition

The new bullet point clearly explains the donkey production benefit of Wonders, providing specific numerical details (10% cost) while maintaining consistent documentation style.

eternum-docs/docs/pages/overview/links.mdx (1)

12-13: Verify link accessibility

Let's verify that the new links are accessible and working correctly.

✅ Verification successful

Links are accessible and working correctly

Both URLs return HTTP 200 status codes, indicating they are accessible and functioning properly:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the new URLs are accessible
curl -sL -w "%{http_code}\n" "https://empire.realms.world/" -o /dev/null
curl -sL -w "%{http_code}\n" "https://market.realms.world/" -o /dev/null

Length of output: 153

🧰 Tools
🪛 LanguageTool

[uncategorized] ~12-~12: A punctuation mark might be missing here.
Context: ...e.realms.world/) - Mint your season pass - [Marketplace](https://market.realms.world...

(AI_EN_LECTOR_MISSING_PUNCTUATION)

eternum-docs/src/utils/formatting.tsx (1)

25-27: Consider handling potential precision loss

The divideByPrecision function might lose precision with large numbers due to floating-point arithmetic. Consider using a decimal library for critical financial calculations.

eternum-docs/docs/pages/mechanics/resources/storage.mdx (1)

1-2: LGTM! Good use of dynamic configuration values.

The imports are well-organized, and the use of utility functions for formatting ensures consistent number presentation throughout the documentation.

eternum-docs/docs/pages/seasons/rewards.mdx (1)

34-34: Verify the Hyperstructure points constant.

The code uses a dynamic value from HYPERSTRUCTURE_POINTS_FOR_WIN. Let's verify this constant is properly defined and imported.

✅ Verification successful

Let me verify if this constant is properly imported in the file.


Constant is properly defined and imported

The HYPERSTRUCTURE_POINTS_FOR_WIN constant is correctly defined in sdk/packages/eternum/src/constants/global.ts with a value of 6,320,000 and is properly imported from "@bibliothecadao/eternum" in the rewards.mdx file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for HYPERSTRUCTURE_POINTS_FOR_WIN constant definition
ast-grep --pattern 'export const HYPERSTRUCTURE_POINTS_FOR_WIN = $_'

Length of output: 595


Script:

#!/bin/bash
# Search for imports of HYPERSTRUCTURE_POINTS_FOR_WIN in the rewards.mdx file
rg "HYPERSTRUCTURE_POINTS_FOR_WIN" "eternum-docs/docs/pages/seasons/rewards.mdx" -B2 -A2

Length of output: 543

eternum-docs/docs/pages/mechanics/resources/resources.mdx (1)

16-17: Verify resource ID mappings.

The changes convert string IDs to numeric IDs. Let's verify these IDs match the game's configuration.

Also applies to: 33-37, 43-46, 52-55, 61-66, 72-74, 82-84, 96-96, 110-110, 122-122

✅ Verification successful

The previous pattern didn't find matches, so let's try a broader search to:

  1. Find files that might contain resource definitions
  2. Look for specific numeric IDs being used in the codebase

Based on the search results, I found the resource ID mappings in two key files:

  1. eternum-docs/src/utils/constants.tsx and
  2. sdk/packages/eternum/src/constants/resources.ts

Both files consistently define:

  • Wheat as ID 254
  • Fish as ID 255

Let's verify the other IDs mentioned in the comment by searching for their definitions:


Resource ID mappings verified successfully

The numeric IDs in the code match the game's configuration files exactly. Both eternum-docs/src/utils/constants.tsx and sdk/packages/eternum/src/constants/resources.ts define consistent resource mappings, including:

  • Wheat: ID 254
  • Fish: ID 255
  • Donkey: ID 249
  • Knight: ID 250
  • Crossbowman: ID 251
  • Paladin: ID 252
  • Lords: ID 253
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for resource ID definitions in the game configuration
ast-grep --pattern 'export enum ResourceType {
  $$$
}'

Length of output: 57


Script:

#!/bin/bash
# Search for resource-related enums, constants, or type definitions
rg -g '*.{ts,tsx,js,jsx}' -l "(?i)resource.*?(type|id|enum|const|mapping)"

# Then search for specific numeric values
rg -g '*.{ts,tsx,js,jsx}' "(254|255)" -C 2

Length of output: 111368


Script:

#!/bin/bash
# Search for resource definitions in the constants files
rg -A 2 "trait:|value:" sdk/packages/eternum/src/constants/resources.ts eternum-docs/src/utils/constants.tsx

Length of output: 14931

eternum-docs/docs/pages/mechanics/realm/buildings.mdx (2)

15-15: Verify BuildingCosts component usage consistency.

The BuildingCosts component is used consistently across all building types. Let's verify the component implementation.

Also applies to: 24-24, 38-38, 52-52, 62-62, 79-79, 93-93, 101-101, 109-109

✅ Verification successful

BuildingCosts component is implemented and used correctly

The verification shows that:

  • The BuildingCosts component is properly implemented in eternum-docs/src/components/BuildingCosts.tsx
  • It's consistently used across all building types in buildings.mdx
  • The component correctly handles different building types by accessing the appropriate cost configurations from EternumGlobalConfig
  • The implementation aligns with the SDK's building costs configuration system
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check BuildingCosts component implementation
fd --type f "BuildingCosts.tsx" src/components/

Length of output: 150


Script:

#!/bin/bash
# Search for BuildingCosts component file across the repository
fd BuildingCosts

# Search for BuildingCosts component usage
rg "BuildingCosts" -A 2

Length of output: 11250


1-2: Verify imports from game configuration.

Let's verify the imported types and configuration are properly defined.

✅ Verification successful

Let me verify the other import as well before making the final decision.


Imports are correctly defined and available

The imports are properly defined in the SDK:

  • BuildingType enum is exported from sdk/packages/eternum/src/constants/structures.ts with all building types
  • EternumGlobalConfig is exported from sdk/packages/eternum/src/constants/global.ts
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for BuildingType enum definition
ast-grep --pattern 'export enum BuildingType {
  $$$
}'

Length of output: 1478


Script:

#!/bin/bash
# Search for EternumGlobalConfig export
ast-grep --pattern 'export $_ EternumGlobalConfig'

# Also check if it's exported from index
rg "export.*EternumGlobalConfig" -A 2

Length of output: 322

eternum-docs/src/utils/constants.tsx (3)

1-2: LGTM!

The import statement correctly references the Resources type from the Eternum package.


10-10: Verify image path resolution across different environments

All image paths are relative and start with "/" (e.g., "/2.png"). This might cause issues depending on the deployment setup and base URL configuration.

Consider:

  1. Using a constant for the base image path
  2. Ensuring paths work correctly in all deployment environments

Also applies to: 20-20, 29-29, 39-39, 49-49, 59-59, 68-68, 77-77, 87-87, 97-97, 107-107, 117-117, 127-127, 137-137, 147-147, 157-157, 167-167, 177-177, 187-187, 197-197, 207-207, 217-217, 226-226, 235-235, 244-244, 253-253, 262-262, 271-271, 280-280, 289-289


3-292: Verify the significance of non-sequential resource IDs

The resource IDs have large gaps (e.g., jumps from 22 to 249) and Ancient Fragment (ID: 29) appears last despite having a lower ID. This might affect sorting and filtering operations in the codebase.

✅ Verification successful

Non-sequential resource IDs are used intentionally for filtering operations

Based on the codebase analysis, the non-sequential IDs are intentionally used as unique identifiers for filtering operations, particularly in bank and trading components. The ID gaps and ordering in the array don't affect functionality as resources are filtered by ID for specific purposes:

  • Lords resource (ID 253) is specifically filtered in swap operations
  • Resources are filtered based on user selection and search input
  • Resources are separated into Lords and non-Lords categories for liquidity operations
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check how resource IDs are used in the codebase

# Search for direct ID references
echo "Searching for direct ID references..."
rg -A 2 "id: \d+" --type tsx --type ts

# Search for array sorting/filtering operations on resources
echo "Searching for resource sorting/filtering operations..."
ast-grep --pattern 'resources.sort($$$)' --pattern 'resources.filter($$$)'

Length of output: 516


Script:

#!/bin/bash
# Search for direct ID references with correct file extensions
echo "Searching for direct ID references..."
rg -A 2 "id: \d+" --type typescript --type javascriptreact --type typescriptreact

# Search for resource sorting/filtering operations (one pattern at a time)
echo "Searching for resource sorting operations..."
ast-grep --pattern 'resources.sort($$$)'

echo "Searching for resource filtering operations..."
ast-grep --pattern 'resources.filter($$$)'

# Search for any usage of resources array
echo "Searching for resources array usage..."
rg "resources\." --type typescript --type javascriptreact --type typescriptreact -A 2

Length of output: 2071

Comment on lines +9 to +16
export default function ResourceIcon({ name, id, size = 50 }: Props) {
const imgPath = resources.find((r) => r.id === id)?.img;
return (
<div className="flex self-center justify-center">
<img src={`/resources` + imgPath} alt={name} title={name} width={size} height={size} />
</div>
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling and accessibility improvements

The component could benefit from:

  1. Error handling for missing resources
  2. Image loading error handling
  3. Better accessibility attributes
 export default function ResourceIcon({ name, id, size = 50 }: Props) {
   const imgPath = resources.find((r) => r.id === id)?.img;
+  if (!imgPath) {
+    console.warn(`Resource not found for id: ${id}`);
+    return null;
+  }
   return (
     <div className="flex self-center justify-center">
-      <img src={`/resources` + imgPath} alt={name} title={name} width={size} height={size} />
+      <img
+        src={`/resources${imgPath}`}
+        alt={`${name} resource icon`}
+        title={name}
+        width={size}
+        height={size}
+        onError={(e) => {
+          console.error(`Failed to load resource icon: ${name}`);
+          e.currentTarget.style.display = 'none';
+        }}
+        role="img"
+        aria-label={`${name} resource icon`}
+      />
     </div>
   );
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export default function ResourceIcon({ name, id, size = 50 }: Props) {
const imgPath = resources.find((r) => r.id === id)?.img;
return (
<div className="flex self-center justify-center">
<img src={`/resources` + imgPath} alt={name} title={name} width={size} height={size} />
</div>
);
}
export default function ResourceIcon({ name, id, size = 50 }: Props) {
const imgPath = resources.find((r) => r.id === id)?.img;
if (!imgPath) {
console.warn(`Resource not found for id: ${id}`);
return null;
}
return (
<div className="flex self-center justify-center">
<img
src={`/resources${imgPath}`}
alt={`${name} resource icon`}
title={name}
width={size}
height={size}
onError={(e) => {
console.error(`Failed to load resource icon: ${name}`);
e.currentTarget.style.display = 'none';
}}
role="img"
aria-label={`${name} resource icon`}
/>
</div>
);
}

Comment on lines +3 to +5
export function formatNumberWithSpaces(number: number): string {
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance number formatting to handle edge cases

The formatNumberWithSpaces function doesn't handle negative numbers or decimal places correctly. Consider enhancing it to handle these cases.

 export function formatNumberWithSpaces(number: number): string {
-  return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
+  const parts = number.toString().split('.');
+  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
+  return parts.join('.');
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export function formatNumberWithSpaces(number: number): string {
return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
export function formatNumberWithSpaces(number: number): string {
const parts = number.toString().split('.');
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
return parts.join('.');
}

Comment on lines +18 to +26
{costs.map((cost) => {
const resource = findResourceById(cost.resource);
return (
<div key={cost.resource} className="flex items-center gap-2 px-3 py-1.5">
<ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
<span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
</div>
);
})}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance error handling and accessibility

Several improvements needed in the costs mapping logic:

  1. Add error handling for findResourceById
  2. Make the cost display more dynamic (don't assume 'K' suffix)
  3. Add accessibility attributes
 {costs.map((cost) => {
   const resource = findResourceById(cost.resource);
+  if (!resource) return null;
   return (
-    <div key={cost.resource} className="flex items-center gap-2 px-3 py-1.5">
+    <div 
+      key={cost.resource} 
+      className="flex items-center gap-2 px-3 py-1.5"
+      role="listitem"
+      aria-label={`${resource.trait} cost: ${formatNumberWithSpaces(cost.amount)}000`}
+    >
       <ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
-      <span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
+      <span className="font-medium">
+        {formatNumberWithSpaces(cost.amount * 1000)}
+      </span>
     </div>
   );
 })}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{costs.map((cost) => {
const resource = findResourceById(cost.resource);
return (
<div key={cost.resource} className="flex items-center gap-2 px-3 py-1.5">
<ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
<span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
</div>
);
})}
{costs.map((cost) => {
const resource = findResourceById(cost.resource);
if (!resource) return null;
return (
<div
key={cost.resource}
className="flex items-center gap-2 px-3 py-1.5"
role="listitem"
aria-label={`${resource.trait} cost: ${formatNumberWithSpaces(cost.amount)}000`}
>
<ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
<span className="font-medium">
{formatNumberWithSpaces(cost.amount * 1000)}
</span>
</div>
);
})}

Comment on lines +18 to +23
const resource = findResourceById(cost.resource);
return (
<div key={cost.resource} className="flex items-center gap-1 px-2 py-1.5 rounded-md">
<ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
<span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add null check for resource trait access

The findResourceById could return undefined, making the resource?.trait access potentially unsafe.

-                    <ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
-                    <span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
+                    {resource && (
+                      <>
+                        <ResourceIcon size={24} id={cost.resource} name={resource.trait} />
+                        <span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
+                      </>
+                    )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const resource = findResourceById(cost.resource);
return (
<div key={cost.resource} className="flex items-center gap-1 px-2 py-1.5 rounded-md">
<ResourceIcon size={24} id={cost.resource} name={resource?.trait || ""} />
<span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
</div>
const resource = findResourceById(cost.resource);
return (
<div key={cost.resource} className="flex items-center gap-1 px-2 py-1.5 rounded-md">
{resource && (
<>
<ResourceIcon size={24} id={cost.resource} name={resource.trait} />
<span className="font-medium">{formatNumberWithSpaces(cost.amount)}K</span>
</>
)}
</div>

<>
{Object.entries(EternumGlobalConfig.questResources).map(([questType, rewards]) => {
return (
<div className="my-4 p-3 ">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing key prop for list iteration

React requires a unique key prop for elements in an iteration to maintain component state and optimize rendering.

-          <div className="my-4 p-3 ">
+          <div key={questType} className="my-4 p-3">

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 14-14: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

Comment on lines +20 to +24
cost: RESOURCE_INPUTS[resourceId].map((cost: any) => ({
...cost,
amount: cost.amount * EternumGlobalConfig.resources.resourcePrecision,
name: findResourceById(cost.resource)?.trait || "",
})),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve type safety for cost mapping.

The any type in the cost mapping could lead to runtime errors. Consider defining proper interfaces for the cost structure.

interface ResourceCost {
  resource: number;
  amount: number;
}

// Then use it in the mapping
cost: RESOURCE_INPUTS[resourceId].map((cost: ResourceCost) => ({

Comment on lines +53 to +61
{resource.cost.map((cost) => (
<div className="grid grid-cols-2">
<ResourceIcon size={50} id={cost.resource} name={cost.name || ""} />
<div className="flex flex-col">
<span>{cost.amount}</span>
<span className="font-bold">{cost.name}</span>
</div>
</div>
))}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing key prop in mapped elements.

React requires a unique key prop for elements in iterables. Add a key prop to the grid div.

-<div className="grid grid-cols-2">
+<div key={`${resource.resource_type}-${cost.resource}`} className="grid grid-cols-2">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{resource.cost.map((cost) => (
<div className="grid grid-cols-2">
<ResourceIcon size={50} id={cost.resource} name={cost.name || ""} />
<div className="flex flex-col">
<span>{cost.amount}</span>
<span className="font-bold">{cost.name}</span>
</div>
</div>
))}
{resource.cost.map((cost) => (
<div key={`${resource.resource_type}-${cost.resource}`} className="grid grid-cols-2">
<ResourceIcon size={50} id={cost.resource} name={cost.name || ""} />
<div className="flex flex-col">
<span>{cost.amount}</span>
<span className="font-bold">{cost.name}</span>
</div>
</div>
))}
🧰 Tools
🪛 Biome (1.9.4)

[error] 54-54: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

Comment on lines +14 to +15
for (const resourceId of Object.keys(RESOURCE_INPUTS) as unknown as ResourcesIds[]) {
if (resourceId == ResourcesIds.Lords) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add type safety for resource ID casting.

The type casting of Object.keys() to ResourcesIds[] could be unsafe. Consider using a type guard or Object.entries with proper typing.

-for (const resourceId of Object.keys(RESOURCE_INPUTS) as unknown as ResourcesIds[]) {
+for (const [resourceId, _] of Object.entries(RESOURCE_INPUTS) as [ResourcesIds, unknown][]) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (const resourceId of Object.keys(RESOURCE_INPUTS) as unknown as ResourcesIds[]) {
if (resourceId == ResourcesIds.Lords) continue;
for (const [resourceId, _] of Object.entries(RESOURCE_INPUTS) as [ResourcesIds, unknown][]) {
if (resourceId == ResourcesIds.Lords) continue;

Comment on lines +11 to +12
const resourceCostsWheat = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Wood];
const resourceCostsFish = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Stone];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve variable naming for clarity.

The variable names resourceCostsWheat and resourceCostsFish are misleading as they actually represent Wood and Stone costs.

-const resourceCostsWheat = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Wood];
-const resourceCostsFish = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Stone];
+const woodBuildingCosts = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Wood];
+const stoneBuildingCosts = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Stone];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const resourceCostsWheat = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Wood];
const resourceCostsFish = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Stone];
const woodBuildingCosts = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Wood];
const stoneBuildingCosts = EternumGlobalConfig.resources.resourceBuildingCosts[ResourcesIds.Stone];

@@ -1,4 +1,4 @@
import ResourceIcon from "../../../../components/ResourceIcon";
import ResourceIcon from "../../../../src/components/ResourceIcon";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Import path needs to be updated

The ResourceIcon component exists at eternum-docs/src/components/ResourceIcon.tsx, but the current import path in resources.mdx is using four levels of parent directory traversal (../../../../). Since both files are in the same repository, the import path should be relative to their locations:

  • Current file: eternum-docs/docs/pages/mechanics/resources/resources.mdx
  • Component: eternum-docs/src/components/ResourceIcon.tsx
  • Correct relative path should be: ../../../../../src/components/ResourceIcon
🔗 Analysis chain

Verify ResourceIcon component import path.

The import path has been updated. Let's verify the component exists at the new location.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if ResourceIcon component exists in the new location
fd --type f "ResourceIcon.tsx" src/components/

Length of output: 149


Script:

#!/bin/bash
# Let's first find any file named ResourceIcon with various extensions
fd "ResourceIcon" --type f

# Also search for any imports of ResourceIcon to understand its location
rg "import.*ResourceIcon"

Length of output: 5044

@ponderingdemocritus ponderingdemocritus merged commit d3f1523 into next Dec 5, 2024
27 of 29 checks passed
@ponderingdemocritus ponderingdemocritus deleted the eternum-docs branch December 5, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants