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

[Port] Hristov / Христов | [Port] Manual Sending Of The Cartridge / Ручное Досылание Патрона #58

Merged
merged 3 commits into from
Sep 21, 2024

Conversation

Spatison
Copy link
Member

@Spatison Spatison commented Sep 15, 2024

Описание PR

Порт изменений Христова и системы ручной подачи патрона.


Медиа

Видео

Изменения

🆑 Spatison

  • add: Added a new sprite of Hristov / Добавлен новый спрайт Христова
  • tweak: Hristov has been improved / Христов был улучшен
  • tweak: Some weapons now require manually cycling / В некоторых видах оружия теперь необходимо вручную досылать патрон

Copy link
Contributor

coderabbitai bot commented Sep 15, 2024

Walkthrough

The pull request introduces several modifications primarily focused on the functionality of firearms and ammunition management within the game. Key changes include the addition of an AutoCycle property to the BallisticAmmoProviderComponent, affecting how cartridges are ejected and ammunition is handled during firing. Various weapon configurations have been updated to specify whether they automatically cycle ammunition. Additionally, new audio resources and metadata for graphical assets have been added to enhance the overall experience.

Changes

Files Change Summary
Content.Server/Weapons/Ranged/Systems/GunSystem.cs Added condition for cartridge ejection based on BallisticAmmoProviderComponent and AutoCycle property.
Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs Introduced AutoCycle boolean property to control automatic cycling of ammunition.
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs Modified OnBallisticTakeAmmo method to conditionally handle ammunition based on AutoCycle property.
Content.Shared/Wieldable/WieldableSystem.cs Streamlined OnShootAttempt and TryUnwield methods for better control over wielding and unwielding weapons.
Resources/Audio/_White/Guns/attributions.yml Added metadata for a new audio resource ("insert.ogg") related to gun sound effects.
Resources/Prototypes/Catalog/uplink_catalog.yml Increased costs for MagazineBoxAntiMateriel and BriefcaseSyndieSniperBundleFilled, added sale limit for the latter.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml Increased damage values for "Piercing" and "Structural" damage types.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml Added autoCycle property set to false in magazine configuration.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml Added autoCycle property set to false for ShellShotgun and true for BallisticAmmoProvider.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml Enhanced sniper rifle configuration with new components, properties, and updated sprite references.
Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/meta.json Introduced metadata for sniper weapon icons, detailing various states and dimensions.
Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/meta.json Added metadata for in-hand sniper weapon graphics, specifying various states for character animations.

Possibly related PRs

  • Added Right Click Melee Attack to Guns #24: Changes in SharedGunSystem.cs regarding melee interactions with guns may relate to the modifications in GunSystem.cs, as both involve handling gun mechanics and interactions.

Suggested labels

Changes: Sprite, Changes: UI, Changes: Localization, Changes: C#, Changes: YML, Status: Needs Review


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4cfbc4e and 28fb042.

Files ignored due to path filters (10)
  • Resources/Audio/_White/Guns/insert.ogg is excluded by !**/*.ogg
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/base.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/bolt-open.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/icon.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/mag-0.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/equipped-BACKPACK.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-left.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/inhand-right.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-left.png is excluded by !**/*.png
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/wielded-inhand-right.png is excluded by !**/*.png
Files selected for processing (12)
  • Content.Server/Weapons/Ranged/Systems/GunSystem.cs (1 hunks)
  • Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs (1 hunks)
  • Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs (1 hunks)
  • Content.Shared/Wieldable/WieldableSystem.cs (2 hunks)
  • Resources/Audio/_White/Guns/attributions.yml (1 hunks)
  • Resources/Prototypes/Catalog/uplink_catalog.yml (2 hunks)
  • Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml (2 hunks)
  • Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml (2 hunks)
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/meta.json (1 hunks)
  • Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/meta.json (1 hunks)
Additional comments not posted (21)
Resources/Audio/_White/Guns/attributions.yml (1)

1-4: LGTM! The addition of attribution and licensing information is appreciated.

The new YAML file provides clear metadata for the "insert.ogg" audio file, including:

  • The files it applies to
  • The license under which the file is distributed (CC-BY-NC-SA-4.0)
  • The copyright information
  • The source link to the original file

Including this information enhances the project's compliance with licensing requirements and provides proper attribution for the audio resource. Great job!

Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Projectiles/antimateriel.yml (2)

10-10: Verify the intended balance impact of tripling the piercing damage.

The Piercing damage value has been significantly increased from 40 to 120. This change will make the projectile much more effective against targets vulnerable to piercing damage.

Please ensure that this aligns with the intended game balance and design goals. Consider playtesting to validate that the increased damage does not make the projectile overpowered compared to other options.


11-11: Verify the intended balance impact of increasing the structural damage by a factor of 5.

The Structural damage value has been drastically increased from 30 to 150. This change will make the projectile extremely effective against structural targets.

Please ensure that this aligns with the intended game balance and design goals. The magnitude of this increase raises concerns about potential balance issues. Thorough playtesting is strongly recommended to validate that the increased damage does not make the projectile overpowered for destroying structures compared to other options.

Consider whether such a significant increase is necessary to achieve the desired gameplay experience, or if a smaller adjustment would suffice to maintain better overall balance.

Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi/meta.json (1)

1-23: LGTM!

The JSON metadata file follows the correct structure and syntax. The metadata properties are properly defined, and the file aligns with the summary of changes.

Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi/meta.json (1)

1-31: LGTM! The metadata file is well-structured and contains essential information.

The meta.json file provides crucial metadata for the hristov-inhands.rsi texture, facilitating proper integration and rendering within the game. Here are some key observations:

  • The file follows a valid JSON structure, making it easy to parse and process.
  • The version field is set to 1, which is a common practice for initial versions and allows for future updates.
  • The license field correctly specifies the CC-BY-NC-SA-4.0 license, ensuring compliance with the project's licensing requirements.
  • The copyright field appropriately attributes the copyright to the "WD team".
  • The size field defines the dimensions of the texture as 32x32 pixels, providing the necessary information for rendering the texture accurately.
  • The states field is an array that defines various states for the texture, including "inhand-left", "inhand-right", "wielded-inhand-left", "wielded-inhand-right", and "equipped-BACKPACK", each with 4 directions. This allows for versatile animations and interactions within the game, enhancing the player's experience.

Overall, this metadata file serves as a foundational component for integrating the weapon graphics into the game, facilitating proper rendering and interaction based on the defined states.

Content.Shared/Weapons/Ranged/Components/BallisticAmmoProviderComponent.cs (1)

47-54: LGTM!

The addition of the AutoCycle property to the BallisticAmmoProviderComponent class is a valuable enhancement. It allows control over the automatic cycling behavior of firearms, providing flexibility for different weapon types and scenarios.

The property is well-documented with a clear summary comment explaining its purpose. It is appropriately marked with attributes for serialization, networking, and variable viewer access, ensuring proper functionality and synchronization across clients.

The default value of true is a sensible choice, as it maintains the existing behavior of firearms automatically cycling by default unless explicitly set to false.

Overall, this change improves the functionality and customization options for firearms in the game.

Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml (5)

79-90: LGTM!

The sprite and clothing paths have been updated to use the new hristov-icons.rsi and hristov-inhands.rsi files, which aligns with the PR objective of adding a new sprite for Hristov.


92-92: Nice addition!

The new sound effect for inserting ammo into the Hristov entity enhances the auditory feedback during gameplay.


98-101: Looks good!

The addition of the Gun, Wieldable, and GunRequiresWield components enhances the functionality and interaction model for the Hristov entity, aligning with the PR objective of improving the Hristov entity.


102-106: Great additions!

The addition of the Telescope and MagazineVisuals components enhances the functionality and visual representation of the ammunition state for the Hristov entity, aligning with the PR objective of improving the Hristov entity.


107-107: Looks good!

The addition of the Appearance component enhances the visual representation of the Hristov entity, aligning with the PR objective of improving the Hristov entity.

Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml (2)

38-38: Ensure the autoCycle: false change aligns with the intended shotgun gameplay.

Setting autoCycle to false for the ShellShotgun will require players to manually cycle the ammunition after each shot. While this adds an element of realism, it will slow down the rate of fire.

Please verify that this gameplay impact aligns with the design vision for shotgun combat in the game.


131-131: Confirm the autoCycle: true change for BallisticAmmoProvider matches the intended ammo management design.

Enabling autoCycle for the BallisticAmmoProvider suggests that ammunition will be automatically cycled without manual intervention. This could streamline ammo management across weapons.

Please verify that this automatic cycling behavior aligns with the overall design goals for ammunition handling in the game.

Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml (1)

83-83: Approved: The autoCycle: false property alters the default ammunition cycling behavior of the RPG-7 weapon.

This change requires players to manually cycle the ammunition after each shot, adding an extra step to the firing process. It can impact the pacing and flow of combat when using this weapon, so ensure that this aligns with the intended gameplay experience.

Content.Shared/Wieldable/WieldableSystem.cs (2)

64-67: LGTM!

The simplification of the OnShootAttempt method logic improves code clarity and maintainability. The removal of the redundant conditional checks for MeleeWeaponComponent and MeleeRequiresWieldComponent is appropriate, as this method specifically handles the shoot attempt for weapons with GunRequiresWieldComponent.

The behavior of canceling the shoot attempt and setting the appropriate message when the weapon is not wielded remains intact.


212-221: Improved unwielding checks.

The added checks in the TryUnwield method enhance the control flow and ensure that unwielding only occurs under valid conditions.

The check for the component's current wield state prevents unnecessary processing if the item is already unwielded. Additionally, the checks related to BallisticAmmoProviderComponent and the spent state of the last cartridge prevent unwielding when the weapon has a spent cartridge.

These changes improve the robustness of the unwielding process and help maintain consistency in the weapon's state.

Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs (2)

243-250: LGTM!

The changes introduce a new behavior for ammunition consumption based on the AutoCycle property. When AutoCycle is true, the existing logic is preserved, and when it's false, the ammunition is not consumed, and the loop is exited early. This allows for more control over ammunition cycling for different weapon types.

The changes are logically sound and don't introduce any apparent issues.


257-265: LGTM!

The changes introduce a new behavior for handling unspawned ammunition based on the AutoCycle property. When AutoCycle is false, and the newly spawned entity has a CartridgeAmmoComponent, it is retained in the component.Entities list and container. This allows for more nuanced control over ammunition management, particularly when automatic cycling is disabled.

The changes enhance the functionality of the ammunition handling system and are logically sound. They don't introduce any apparent issues.

Content.Server/Weapons/Ranged/Systems/GunSystem.cs (1)

172-173: LGTM!

The added condition provides more control over cartridge ejection behavior based on the gun's configuration. It allows for flexibility in managing ammunition cycling, particularly for ballistic weapons.

Resources/Prototypes/Catalog/uplink_catalog.yml (2)

390-390: Approve cost increase for balance.

Tripling the cost of the anti-materiel magazine from 2 to 6 telecrystals seems like an appropriate balance change to prevent overuse of powerful ammunition. The increased cost makes these magazines more of an investment.


892-893: Approve cost increase and sale limit for powerful weapon bundle.

Increasing the cost of the syndicate sniper bundle from 12 to 20 telecrystals and limiting purchases to 1 per uplink are reasonable changes to prevent overuse of this powerful weapon.

The original cost was likely too low for the bundle's power level. With the higher cost and sale limit, acquiring the sniper rifle requires a major investment and uplinks can't stockpile multiple sniper bundles.

These nerfs seem appropriate to keep the syndicate sniper in check. Nice balance changes!


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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

RSI Diff Bot; head commit 28fb042 merging into 4cfbc4e
This PR makes changes to 1 or more RSIs. Here is a summary of all changes:

Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-icons.rsi

State Old New Status
base Added
bolt-open Added
icon Added
mag-0 Added

Resources/Textures/_White/Objects/Weapons/Guns/Snipers/hristov-inhands.rsi

State Old New Status
equipped-BACKPACK Added
inhand-left Added
inhand-right Added
wielded-inhand-left Added
wielded-inhand-right Added

@Remuchi
Copy link
Collaborator

Remuchi commented Sep 16, 2024

Название и ченджлог немного сбивают с толку. Потому что помимо изменений Христова так же были затронуты дробовики, да и целом добавлена система, что часть оружий надо вручную сайклить.

@Spatison Spatison changed the title [Port] Hristov / Христов [Port] Hristov / Христов Sep 16, 2024
@Spatison Spatison changed the title [Port] Hristov / Христов [Port] Hristov / Христов | [Port] Manual Sending Of The Cartridge / Ручное Досылание Патрона Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants