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] Smoke Implant / Имплант Дыма #79

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

Spatison
Copy link
Member

@Spatison Spatison commented Oct 9, 2024

Описание PR

Порт импланта дыма.


Изменения

🆑 Spatison

  • add: Added smoke implant / Добавлен имплант дыма

@Spatison Spatison requested a review from Remuchi October 9, 2024 15:59
@Spatison Spatison self-assigned this Oct 9, 2024
Copy link
Contributor

coderabbitai bot commented Oct 9, 2024

Walkthrough

The pull request introduces several changes related to the addition of a "Smoke implant" in both English and Russian localization files. It includes new entries for the implant's name and description, modifications to existing items' names and descriptions, and the introduction of new entities and actions related to the smoke effect. The changes enhance the localization support and functionality of the game by providing detailed descriptions and actions for the new and modified items.

Changes

File Path Change Summary
Resources/Locale/en-US/_white/store/uplink-catalog.ftl Added "Smoke implant" with name and description; updated "betrayal-knife" to "Experimental syndicate teleporter" with new description.
Resources/Locale/ru-RU/_white/prototypes/actions/types.ftl Added action entry ent-ActivateSmokeImplant for activating the smoke implant in Russian.
Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl Introduced new entity ent-SmokeImplanter inheriting description from ent-BaseImplanter.
Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl Added entry for "SmokeImplant" with name and description in Russian.
Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl Added entries for "Smoke implant" in Russian with name and description.
Resources/Prototypes/_White/Actions/types.yml Introduced ActivateSmokeImplant action with properties defining its functionality and behavior.
Resources/Prototypes/_White/Catalog/uplink_catalog.yml Added listing for "UplinkSmokeImplanter" and adjusted saleLimit formatting for existing items.
Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml Added new entity definition SmokeImplanter inheriting from BaseImplantOnlyImplanterSyndi.
Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml Introduced configuration for "SmokeImplant" with activation and sound trigger properties.

Possibly related PRs

Suggested labels

Changes: Localization, Changes: YML, Changes: Audio, Status: Needs Review

Suggested reviewers

  • Remuchi

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

@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: 2

🧹 Outside diff range and nitpick comments (10)
Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl (1)

1-2: Consider adding Russian translations and more specific information.

While the file is correctly placed in the Russian localization directory, it currently lacks any Russian text. Additionally, the entity name and description don't provide any specific information about the smoke functionality.

  1. Consider adding Russian translations for both the entity name and description.
  2. It would be helpful to include more specific information about the smoke functionality in the description.

Here's a suggestion for improvement (please replace the Russian text with appropriate translations):

-ent-SmokeImplanter = { ent-BaseImplanter }
-    .desc = { ent-BaseImplanter.desc }
+ent-SmokeImplanter = Дымовой имплантер
+    .desc = Имплантер, содержащий дымовой имплант. { ent-BaseImplanter.desc } Позволяет пользователю создавать облако дыма.
Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl (1)

2-2: LGTM: Entity description is clear and accurate

The description for "SmokeImplant" is well-defined in Russian, accurately describing its functionality. It follows the correct .ftl file format and aligns with the PR objectives.

Consider adding information about any cooldown or limitations on the smoke release, if applicable. For example:

-    .desc = Этот имплант выпускает облако дыма при активации.
+    .desc = Этот имплант выпускает облако дыма при активации. Может использоваться раз в [X] минут.

Replace [X] with the actual cooldown time if there is one.

Resources/Locale/ru-RU/_white/prototypes/actions/types.ftl (2)

2-2: LGTM: Correct syntax and appropriate description.

The description is well-formatted and accurately describes the action in Russian.

For consistency, consider adding a period at the end of the action name on line 1, matching the format of the description:

-ent-ActivateSmokeImplant = Выпустить облако дыма
+ent-ActivateSmokeImplant = Выпустить облако дыма.
     .desc = Выпускает облако дыма вокруг вас.

1-2: Changes align well with PR objectives.

The additions to this file successfully implement the Russian localization for the smoke implant action, as outlined in the PR objectives. The translations are accurate and follow the expected format for .ftl files.

To ensure consistency across all localization files, consider creating or updating a style guide for localization entries. This could include guidelines on punctuation usage, capitalization, and formatting conventions for action names and descriptions.

Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml (1)

7-7: Add a newline at the end of the file.

To adhere to YAML best practices and resolve the linter warning, please add a newline character at the end of the file.

Apply this change:

  - type: Implanter
    implant: SmokeImplant
+
🧰 Tools
🪛 yamllint

[error] 7-7: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml (2)

4-6: Consider capitalizing the implant name for consistency.

The basic properties are well-defined:

  • The description clearly explains the implant's function.
  • The noSpawn: true property correctly prevents this entity from spawning in the game world.

However, consider capitalizing the name for consistency with other entity names in the game.

Suggested change:

- name: smoke implant
+ name: Smoke Implant

15-15: Add a newline at the end of the file.

To comply with YAML best practices and resolve the linter warning, add a newline at the end of the file.

Add an empty line after line 15.

🧰 Tools
🪛 yamllint

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Locale/en-US/_white/store/uplink-catalog.ftl (3)

Line range hint 1-5: Remove redundant "Betrayal dagger" entry.

The "Betrayal dagger" entry (lines 4-5) is now redundant with the new "Experimental syndicate teleporter" entry. To avoid confusion, it should be removed.

Apply this diff to remove the redundant entry:

uplink-emp-flashlight-name = Emp Flashlight
uplink-emp-flashlight-desc = A rechargeable device disguised as a flashlight designed to disrupt electronic systems. Useful for disrupting communications, security's energy weapons, and APCs when you're in a tight spot.

-uplink-betrayal-knife-name = Betrayal dagger
-uplink-betrayal-knife-desc = The betrayal dagger allows the user to teleport a short distance, and also causes significant damage when stabbed in the back.

uplink-betrayal-knife-name = Experimental syndicate teleporter
uplink-betrayal-knife-desc = Syndicate teleporter, when used, moves 3-8 meters forward. In case of teleportation into a wall, uses emergency teleportation. Has 4 charge.

13-14: Approve new "Smoke implant" entry with suggestion for description enhancement.

The addition of the "Smoke implant" entry aligns with the PR objectives. The description is concise but could benefit from more details to enhance player understanding.

Consider expanding the description to provide more context or gameplay implications. For example:

uplink-smoke-implant-name = Smoke implant
-uplink-smoke-implant-desc = Releases a cloud of smoke when activated.
+uplink-smoke-implant-desc = A covert implant that releases a thick cloud of smoke when activated, providing cover or creating a diversion. Single-use.

This expanded description gives players more information about the item's potential uses and limitations.


Residual References to "Betrayal dagger" Found in Codebase

The following files still contain references to "Betrayal dagger" or "betrayal-knife":

  • Resources/Changelog/Changelog.yml
  • Resources/Prototypes/_White/Catalog/uplink_catalog.yml
  • Resources/Prototypes/_White/Entities/Objects/Weapons/Melee/daggers.yml
  • Resources/Locale/ru-RU/store/uplink-catalog.ftl
  • Resources/Locale/ru-RU/_white/prototypes/entities/objects/weapons/melee/daggers.ftl
  • Resources/Locale/en-US/_white/store/uplink-catalog.ftl

Please update or remove these references to ensure consistency with the new item name "Experimental syndicate teleporter."

🔗 Analysis chain

Line range hint 6-7: Verify game balance and update related code for the teleporter change.

The item has been changed from a "Betrayal dagger" to an "Experimental syndicate teleporter". This is a significant change in functionality that may affect game balance and player strategies.

  1. Ensure that all related code (e.g., item behavior, crafting recipes, spawn rates) has been updated to reflect this change.
  2. Consider if this change aligns with the game's overall balance and design philosophy.
  3. Update any documentation or player guides that reference this item.

To check for any remaining references to the old name:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to "Betrayal dagger" or "betrayal-knife"
rg -i "betrayal.?(dagger|knife)"

Length of output: 2438

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4c2f775 and 0c383ff.

📒 Files selected for processing (9)
  • Resources/Locale/en-US/_white/store/uplink-catalog.ftl (1 hunks)
  • Resources/Locale/ru-RU/_white/prototypes/actions/types.ftl (1 hunks)
  • Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/implanters.ftl (1 hunks)
  • Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl (1 hunks)
  • Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl (1 hunks)
  • Resources/Prototypes/_White/Actions/types.yml (1 hunks)
  • Resources/Prototypes/_White/Catalog/uplink_catalog.yml (1 hunks)
  • Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml (1 hunks)
  • Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml (1 hunks)
🧰 Additional context used
🪛 yamllint
Resources/Prototypes/_White/Catalog/uplink_catalog.yml

[warning] 64-64: wrong indentation: expected 4 but found 2

(indentation)


[error] 64-64: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml

[error] 7-7: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (14)
Resources/Locale/ru-RU/_white/prototypes/entities/objects/misc/subdermal_implants.ftl (2)

1-1: LGTM: Entity name correctly defined

The entity name for "SmokeImplant" is properly defined in Russian as "имплант дыма" (smoke implant). This aligns with the PR objectives and follows the correct .ftl file format.


1-2: Overall: Excellent addition of Russian localization for SmokeImplant

The file successfully adds Russian localization for the new SmokeImplant entity, consistent with the PR objectives. Both the name and description are accurately translated and follow the correct .ftl file format. The content is concise and focused, providing essential information for Russian-speaking users.

To ensure consistency across localization files, let's verify the existence and content of the English version:

This will help ensure that the Russian translation aligns with the English original and that both languages are updated consistently.

Resources/Locale/ru-RU/_white/prototypes/actions/types.ftl (1)

1-1: LGTM: Correct syntax and appropriate translation.

The entity key and its Russian translation are correctly formatted and appear to accurately represent the action of releasing a smoke cloud.

Resources/Prototypes/_White/Entities/Objects/Misc/implanters.yml (1)

1-7: LGTM! The smoke implanter entity is well-defined.

The new entity SmokeImplanter is correctly structured and aligns with the PR objectives. It inherits from BaseImplantOnlyImplanterSyndi, has appropriate id and suffix, and includes the necessary Implanter component associated with SmokeImplant.

🧰 Tools
🪛 yamllint

[error] 7-7: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Prototypes/_White/Actions/types.yml (5)

1-5: LGTM: Entity type and basic properties are well-defined.

The entity type, id, name, and description are correctly defined and accurately describe the smoke implant activation action. The noSpawn: true property is appropriately set for an action that doesn't spawn a physical entity in the game world.


6-10: Verify the InstantAction component properties.

The InstantAction component is appropriate for the smoke release action. However, please confirm:

  1. Is the useDelay of 20 units the intended cooldown for this action?
  2. What does the priority value of -20 signify in the game's action system?

These values may be correct, but it's worth verifying to ensure they align with the game design intentions.


1-14: Summary: ActivateSmokeImplant entity implementation looks good, with some verifications needed.

The implementation of the ActivateSmokeImplant entity aligns well with the PR objectives of adding a smoke implant feature. The entity definition is structured correctly and includes all necessary components for an instant action that releases smoke.

Key points to address:

  1. Verify the useDelay and priority values in the InstantAction component.
  2. Confirm the existence of the smoke icon resource.
  3. Ensure the ActivateImplantEvent is properly implemented to handle the smoke release functionality.

Once these verifications are complete, this implementation should be ready for integration.


14-14: Verify the implementation of ActivateImplantEvent.

The use of a specific event type (ActivateImplantEvent) for activating the implant is a good practice. However, we should verify that this event type is properly implemented and handles the smoke release functionality as expected.

Run the following script to check for the implementation of ActivateImplantEvent:

#!/bin/bash
# Description: Search for the implementation of ActivateImplantEvent

# Test: Search for ActivateImplantEvent in C# files
if rg -t cs "class ActivateImplantEvent" -A 10; then
  echo "ActivateImplantEvent class found. Please review the implementation to ensure it handles smoke release correctly."
else
  echo "Warning: ActivateImplantEvent class not found in C# files. Verify that the event is implemented correctly."
fi

11-13: Verify the existence of the smoke icon resource.

The use of a smoke grenade icon for the smoke implant action is appropriate. However, let's verify the existence of this resource to ensure it's correctly referenced.

Run the following script to check if the icon resource exists:

✅ Verification successful

Corrected Verification Script for Smoke Icon Resource

Please run the following corrected script to verify the existence and proper configuration of the smoke icon resource:


Smoke Icon Resource Verification Passed

The smoke.rsi file exists and correctly defines the 'icon' state within itself. The smoke icon resource is properly referenced.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of the smoke icon resource.

# Test: Check if the smoke.rsi file exists
if fd -p "Resources/Textures/Objects/Weapons/Grenades/smoke.rsi"; then
  echo "smoke.rsi file found."
else
  echo "Error: smoke.rsi file not found in the expected location."
  exit 1
fi

# Test: Check if the 'icon' state exists in the smoke.rsi file
if rg -q '"icon"' $(fd -p "Resources/Textures/Objects/Weapons/Grenades/smoke.rsi/meta.json"); then
  echo "'icon' state found in smoke.rsi metadata."
else
  echo "Error: 'icon' state not found in smoke.rsi metadata."
  exit 1
fi

echo "All checks passed. The smoke icon resource appears to be correctly referenced."

Length of output: 1311


Script:

#!/bin/bash
# Description: Verify the existence of the smoke icon resource.

# Test: Check if the smoke.rsi file exists
if fd -p "Resources/Textures/Objects/Weapons/Grenades/smoke.rsi" > /dev/null; then
  echo "smoke.rsi file found."
else
  echo "Error: smoke.rsi file not found in the expected location."
  exit 1
fi

# Test: Check if the 'icon' state exists in the smoke.rsi metadata
meta_file=$(fd -e json "Resources/Textures/Objects/Weapons/Grenades/smoke.rsi/meta.json")

if [ -f "$meta_file" ]; then
  if rg -q '"icon"' "$meta_file"; then
    echo "'icon' state found in smoke.rsi metadata."
  else
    echo "Error: 'icon' state not found in smoke.rsi metadata."
    exit 1
  fi
else
  echo "Error: meta.json file not found for smoke.rsi."
  exit 1
fi

echo "All checks passed. The smoke icon resource appears to be correctly referenced."

Length of output: 333


Script:

#!/bin/bash
# Description: Further verify the metadata for the smoke icon resource.

# Search for any JSON metadata files related to smoke.rsi
meta_files=$(fd -e json "smoke.rsi" "Resources/Textures/Objects/Weapons/Grenades/")

if [ -z "$meta_files" ]; then
  echo "No metadata JSON files found for smoke.rsi."
else
  echo "Found metadata files:"
  echo "$meta_files"
  
  # Iterate through each found metadata file to check for 'icon' state
  for meta_file in $meta_files; do
    if rg -q '"icon"' "$meta_file"; then
      echo "'icon' state found in $meta_file."
    else
      echo "'icon' state not found in $meta_file."
    fi
  done
fi

# Additionally, check if 'icon' state is defined within smoke.rsi itself
if rg -q '"icon"' "Resources/Textures/Objects/Weapons/Grenades/smoke.rsi"; then
  echo "'icon' state found directly within smoke.rsi."
else
  echo "'icon' state not found within smoke.rsi."
fi

Length of output: 373

Resources/Prototypes/_White/Entities/Objects/Misc/subdermal_implants.yml (2)

1-3: LGTM: Entity type and inheritance are well-defined.

The entity is correctly defined as a type "entity" and inherits from "BaseSubdermalImplant", which is appropriate for a new implant type. The ID "SmokeImplant" is clear and follows a consistent naming convention.


7-15: Components are well-defined, but verify the implantAction.

The components are appropriate for the smoke implant functionality:

  • SubdermalImplant with implantAction "ActivateSmokeImplant"
  • TriggerImplantAction for activation logic
  • SmokeOnTrigger with spread and duration parameters
  • SoundOnTrigger with a sound effect

The smoke effect parameters and sound file path look good. However, please verify that the "ActivateSmokeImplant" action is correctly defined elsewhere in the codebase.

Run the following script to verify the implantAction:

✅ Verification successful

implantAction "ActivateSmokeImplant" is properly defined and referenced.

The ActivateSmokeImplant action is correctly defined in Actions/types.yml and properly referenced in subdermal_implants.yml. No issues found with the implementation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of "ActivateSmokeImplant" action in the codebase.

# Test: Search for the "ActivateSmokeImplant" action definition
rg --type yaml "ActivateSmokeImplant"

Length of output: 225

🧰 Tools
🪛 yamllint

[error] 15-15: no new line character at the end of file

(new-line-at-end-of-file)

Resources/Locale/ru-RU/_white/store/uplink-catalog.ftl (1)

13-14: LGTM! The new entries for the smoke implant are well-formatted and consistent.

The additions for the smoke implant are correctly formatted and consistent with the existing entries in the file. The translations appear to be accurate:

  • "Имплант дыма" translates to "Smoke implant"
  • "Выпускает облако дыма при активации" translates to "Releases a cloud of smoke when activated"

These new entries align well with the PR objectives of adding a smoke implant feature to the game.

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

53-53: LGTM: Sale limit added for UplinkBetrayalKnife

The addition of a saleLimit of 1 for the UplinkBetrayalKnife is appropriate. This constraint helps balance the game by limiting the number of these powerful items that can be purchased.


53-53: LGTM: Sale limit added for UplinkMiniEbow

The addition of a saleLimit of 1 for the UplinkMiniEbow is appropriate. This constraint helps balance the game by limiting the number of these powerful items that can be purchased.

@Spatison
Copy link
Member Author

Spatison commented Oct 9, 2024

Опять MobMimic ☹️

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