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

feat: Extra vehicles from json now works #362

Merged

Conversation

VanWeapon
Copy link
Contributor

@VanWeapon VanWeapon commented Jan 1, 2025

Description of changes

  • implements the extra_vehicles attribute from chapter jsons which works on init now. All extra vehicles are added to the 10th company so they show up on the homeworld at the beginning of the game

Reasons for changes

  • implement unfinished feature

Related links

Summary by Sourcery

New Features:

  • Added support for the "extra_vehicles" attribute in chapter JSON files to add vehicles to the 10th company during game initialization.

Copy link
Contributor

sourcery-ai bot commented Jan 1, 2025

Reviewer's Guide by Sourcery

This pull request implements the extra_vehicles attribute from chapter JSON files, allowing additional vehicles to be added to the 10th company during game initialization. The implementation iterates through the provided vehicle types and quantities specified in the JSON, adding each vehicle to the 10th company. It also includes logic to avoid overwriting existing vehicles and prevent potential crashes by limiting the number of added vehicles.

File-Level Changes

Change Details Files
Added support for the extra_vehicles attribute in the chapter JSON files.
  • The scr_initialize_custom function now reads and processes the extra_vehicles attribute from the chapter JSON files during game initialization.
  • Added logic to handle various vehicle types, including Rhino, Whirlwind, Predator, Land Raider, and Land Speeder.
  • Implemented a check to prevent overwriting existing vehicles in the 10th company.
  • Included a safeguard to prevent potential crashes by limiting the maximum number of added vehicles.
  • Updated the chapter JSON schema and template to include the extra_vehicles attribute.
  • Modified the game project files to incorporate the changes in the initialization script and data files.
scripts/scr_initialize_custom/scr_initialize_custom.gml
ChapterMaster.yyp
datafiles/main/chapters/1.JSON
datafiles/main/chapters/template.JSON

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions bot added the PR: Feature Adds something new label Jan 1, 2025
sourcery-ai[bot]
sourcery-ai bot previously approved these changes Jan 1, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @VanWeapon - I've reviewed your changes - here's some feedback:

Overall Comments:

  • There's a bug in the Land Speeder implementation - the _slot++ increment is outside the repeat loop, which will cause all Land Speeders to be added to the same slot
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@VanWeapon
Copy link
Contributor Author

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @VanWeapon - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider refactoring the repeated vehicle initialization checks into a data-driven structure to reduce code duplication. This could be achieved by creating a vehicle configuration map that defines the properties and initialization logic for each vehicle type.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@OH296 OH296 merged commit 6483f94 into Adeptus-Dominus:release/0.10.0.0 Jan 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Feature Adds something new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants