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

[Feature] StepTriggerGroup to improve StepTriggerImmune behaviour #53

Merged
merged 12 commits into from
Sep 16, 2024

Conversation

HellCatten
Copy link
Contributor

@HellCatten HellCatten commented Sep 10, 2024

Описание

Необходимо настроить модификатор урона, чтобы IPC не получали урон от осколков стекла.

Иммунитет StepTriggerImmuneComponent доработан.
Теперь имеются несколько типов (types):
Lava - тип тайла, наступив на который появляется урон. Это собственно лава и LiquidPlasma
Landmine - мины.
Chasm - дырка в карте, куда можно провалиться
Mousetrap - Мышеловка
SlipTile - Все, что должно подскальзывать игроков, имеющее размер тайла
SlipEntity - Все, что должно подскальзывать игроков, имеющее развер энтити.
Разделено для баланса. Самые ловки могут игнорировать мелкие предметы (энтити), т.е. уворачиваться от них. Но большие по площади вещи (тайлы по типу разлитой воды, бананиума) просчитываются отдельно.

Изменения

  • Улучшить StepTriggerSystem (Immune)
  • Добавлены типы триггера. - Lava Landmine Shard Chasm Mousetrap SlipTile SlipEntity
  • Исправить осколки у IPC
  • Исправить отсутствие урона от лавы и падение в дыры у фелинидов и гарпий.

🆑 Hell_Cat

  • Feature: StepTriggerSystem is improved | Улучшена StepTriggerSystem
  • fix: IPC: Immunity for shards and SpiderWeb | Иммунитет осколкам.
  • fix: Felinid | Фелиниды : Immunity for Shard Landmine Mousetrap SlipEntities | Иммунитет для осколков, жидкости, мин, мышеловок, мыла и бананов.
  • fix: Harpy | Гарпия : Immunity for Shards Landmine Mousetrap | Иммунитет для осколков, жидкости, мин и мышеловок.
  • fix: Mice | Мыши : Don't blow up on landmines | Мыши не подрываются на минах.

Copy link
Contributor

coderabbitai bot commented Sep 10, 2024

Walkthrough

The pull request introduces enhancements to the step trigger system by adding new properties, such as TriggerGroups in the StepTriggerComponent and Whitelist in the StepTriggerImmuneComponent. It defines a new class, StepTriggerGroup, to manage collections of step trigger types, and updates various entity configurations to incorporate these new trigger group properties. The changes facilitate more granular control over interactions and immunity within the game environment.

Changes

File Path Change Summary
Content.Shared/StepTrigger/Components/... Added public StepTriggerGroup? TriggerGroups in StepTriggerComponent and public StepTriggerGroup? Whitelist in StepTriggerImmuneComponent for managing trigger groups and selective immunity.
Content.Shared/StepTrigger/Prototypes/... Introduced StepTriggerGroup class with public List<ProtoId<StepTriggerTypePrototype>>? Types for managing step trigger types, and added StepTriggerTypePrototype class with public string ID.
Content.Shared/StepTrigger/Systems/... Modified CanTrigger method in StepTriggerSystem to enhance logic for determining entity activation based on immunity and trigger groups.
Resources/Prototypes/Entities/... Added triggerGroups properties in various entity configurations (e.g., chemistry_effects.yml, puddle.yml, silicon.yml, etc.) to categorize triggers and enhance interactions based on specific types.
Resources/Prototypes/StepTrigger/... Introduced StepTriggerTypes.yml to define various step trigger types like "Lava", "Landmine", and "SlipTile".

Possibly related PRs

  • Added Right Click Melee Attack to Guns #24: The changes in the main PR introduce new properties related to StepTriggerComponent and StepTriggerImmuneComponent, which enhance the game's step-triggering mechanics. Although the retrieved PR focuses on melee attacks for guns, it does not directly relate to the step trigger functionality or the specific components modified in the main PR.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b235462 and bab5aa2.

Files selected for processing (1)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs

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.

@HellCatten
Copy link
Contributor Author

Проверял на фелинидах и лаве. Пока что не работает.

@HellCatten HellCatten changed the title [FIX] IPC damage modifier [FIX] StepTriggerImmuneComponent fix Sep 13, 2024
@HellCatten
Copy link
Contributor Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Sep 13, 2024

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@HellCatten
Copy link
Contributor Author

@coderabbitai full review

Copy link
Contributor

coderabbitai bot commented Sep 13, 2024

Actions performed

Full review triggered.

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: 0

Outside diff range and nitpick comments (1)
Resources/Prototypes/Entities/Mobs/Player/ipc.yml (1)

114-114: Approve the addition of the Damageable component.

The addition of the Damageable component to the MobIPC entity is a valid change that allows the entity to take damage, which is consistent with the PR objective.

Consider configuring the Damageable component.

The Damageable component is added without any properties, which means it will use default values. To fine-tune the damage behavior, consider configuring the component with appropriate properties such as:

  • maxDamage: The maximum amount of damage the entity can take before being destroyed.
  • resistances: The resistance values for different damage types (e.g., Blunt, Slash, Piercing, etc.).
  • onDamageChanged: An event that is triggered when the entity's damage value changes.
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 95bde11 and 94354c5.

Files selected for processing (9)
  • Content.Shared/StepTrigger/Components/StepTriggerComponent.cs (2 hunks)
  • Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs (2 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs (1 hunks)
  • Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs (2 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/ipc.yml (1 hunks)
  • Resources/Prototypes/Entities/Tiles/chasm.yml (4 hunks)
  • Resources/Prototypes/Entities/Tiles/lava.yml (1 hunks)
  • Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml (1 hunks)
Additional comments not posted (10)
Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs (1)

1-13: LGTM!

The StepTriggerTypePrototype class is well-defined and follows good practices:

  • The class is sealed and partial, preventing unintended inheritance and allowing for extension in other files.
  • The ID property is correctly decorated with [ViewVariables] and [IdDataField] attributes, indicating its purpose as a unique identifier for the prototype.
  • The ID property is initialized with a null-forgiving default! value to ensure it is never null.

Overall, the code is clean, concise, and follows the expected conventions for defining a prototype class.

Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (2)

9-20: LGTM!

The StepTriggerGroup class is well-defined with appropriate access modifiers, attributes, and a clear summary describing its purpose. The use of the partial keyword allows for extending the class functionality in other files if needed.


17-19: LGTM!

The Types property is well-defined with an appropriate type, default value, and custom serializer. The restricted access permissions provide an additional layer of security by limiting access to the StepTriggerSystem.

Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs (2)

17-18: LGTM!

The [Access] attribute is correctly used to specify that the StepTriggerSystem can access this component. This change aligns with the objective of tighter integration between the component and the system.


20-24: The Whitelist property is a valuable addition to the StepTriggerImmuneComponent.

The new property enhances the functionality of the component by allowing for selective immunity based on specified triggers. The [DataField] attribute ensures proper serialization and deserialization of the property.

A few additional insights:

  • The nullable type StepTriggerGroup? allows the property to be optional, providing flexibility in configuration.
  • The default value of default! suppresses the null-state analysis for the expression, indicating that the property can be null.

Overall, this change aligns with the PR objectives and introduces a new layer of control over which triggers the component can ignore, potentially affecting gameplay mechanics related to step triggers.

Resources/Prototypes/Entities/Tiles/lava.yml (1)

16-18: LGTM! The new triggerGroup property enhances the step trigger functionality.

The addition of the triggerGroup property with the "Lava" type is a valid enhancement to the StepTrigger component configuration for the lava tile entity. This change allows for more granular control over how the lava tile interacts with other game elements based on the associated trigger group.

By specifying the "Lava" type in the types array, you are effectively creating a new category of triggers that can be used to define specific behaviors or interactions related to lava tiles. This can lead to more complex and dynamic gameplay mechanics.

The changes are consistent with the existing structure and syntax of the configuration file, ensuring a smooth integration with the rest of the codebase.

Great work on enhancing the configurability of the lava tile entity!

Resources/Prototypes/Entities/Tiles/chasm.yml (1)

17-19: LGTM!

The addition of the triggerGroup property with the "Chasm" type is a valid enhancement to the chasm entity definition. It allows grouping chasm entities and potentially triggering specific behaviors or interactions based on their classification, which aligns with the PR objective of improving the StepTriggerSystem and enhancing immunity features.

Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml (1)

83-85: LGTM!

The addition of the whitelist property to the StepTriggerImmune component for felinids is implemented correctly. The Lava entry in the types list matches the expected step trigger type for lava, making felinids immune to lava damage as intended.

The change is consistent with the PR objective and fits well within the existing structure of the felinid.yml file.

Content.Shared/StepTrigger/Components/StepTriggerComponent.cs (1)

62-63: LGTM! The new TriggerGroups property enhances the functionality of the StepTriggerComponent.

The addition of the nullable TriggerGroups property of type StepTriggerGroup allows the component to associate multiple trigger groups. This could facilitate more complex interactions or behaviors in the game environment.

The property is appropriately marked with the [DataField] attribute for data serialization and the [AutoNetworkedField] attribute for network synchronization.

The existing properties and overall structure of the StepTriggerComponent class remain preserved, ensuring backward compatibility.

Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs (1)

122-143: LGTM!

The changes to the CanTrigger method introduce several improvements:

  1. The new logic enhances the control flow by first checking the active state of the StepTriggerComponent and the presence of the otherUid in the CurrentlySteppedOn list, returning false immediately if either condition fails. This is more efficient than the original logic.

  2. The introduction of the whitelist mechanism in the StepTriggerImmuneComponent allows for more fine-grained control over which entities can trigger step events based on their types. This feature enhances the flexibility of the step trigger system.

  3. The logic for iterating through the types in the whitelist and comparing them with the types in the TriggerGroups of the StepTriggerComponent is implemented correctly.

  4. The code segment is well-structured and follows a clear logical flow, making it easy to understand and maintain.

  5. The removal of the commented-out code improves code readability.

Overall, the changes are a valuable addition to the step trigger system and are implemented effectively.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 95bde11 and 94354c5.

Files selected for processing (9)
  • Content.Shared/StepTrigger/Components/StepTriggerComponent.cs (2 hunks)
  • Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs (2 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs (1 hunks)
  • Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs (2 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/ipc.yml (1 hunks)
  • Resources/Prototypes/Entities/Tiles/chasm.yml (4 hunks)
  • Resources/Prototypes/Entities/Tiles/lava.yml (1 hunks)
  • Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml (1 hunks)
Additional comments not posted (15)
Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs (1)

1-13: LGTM!

The StepTriggerTypePrototype class is well-structured and follows the conventions for defining a prototype class. The class has a single property ID that serves as the unique identifier for the prototype. The use of attributes like [ViewVariables] and [IdDataField] is appropriate for a prototype class.

The class is marked as sealed to prevent inheritance and partial to allow its definition to span multiple files if needed. The class implements the IPrototype interface, which is likely a requirement for all prototype classes in the project.

The naming conventions for the class, namespace, and property are followed consistently. The class is defined in a namespace to prevent naming conflicts and improve code organization. The file name matches the class name, adhering to the convention of one class per file.

Overall, the code is clean, well-organized, and follows the project's conventions. Great job!

Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (2)

9-20: LGTM!

The StepTriggerGroup class is well-defined with appropriate attributes and a clear summary describing its purpose.


17-19: LGTM!

The Types property is well-defined with appropriate attributes, serializer, and access permissions.

Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs (3)

17-17: LGTM!

The [Access] attribute is correctly used to restrict access to the StepTriggerSystem. This change reinforces the relationship between the component's functionality and the broader game mechanics.


20-24: LGTM!

The Whitelist property is correctly defined with a nullable StepTriggerGroup type and a default value. The [DataField] attribute is used appropriately to serialize the property. This change allows for selective immunity and is consistent with the AI-generated summary.


1-2: LGTM!

The new using statement correctly imports the Content.Shared.StepTrigger.Prototypes namespace, which is required for the StepTriggerGroup type used in the Whitelist property. The formatting change to the existing using statement is acceptable.

Resources/Prototypes/Entities/Tiles/lava.yml (1)

16-18: LGTM! The addition of the triggerGroup property enhances the lava tile's functionality.

The introduction of the triggerGroup property with the "Lava" type allows the lava tile entity to interact with other game elements in a more nuanced manner. This change enables more complex interactions or behaviors based on the specified trigger group, potentially enhancing the gameplay experience.

It's important to note that the existing blacklist property remains unchanged, suggesting that the new functionality is additive and does not interfere with the current behavior of the lava tile.

Consider the following additional points:

  • Ensure that the "Lava" type is properly handled in the corresponding game logic to achieve the desired behavior.
  • Verify that the addition of the triggerGroup property does not introduce any unintended side effects or conflicts with other game elements.
  • Update the relevant documentation or comments to reflect the new functionality and its purpose.

Overall, this change improves the configurability and potential interactions of the lava tile entity, likely enhancing the gameplay experience.

Resources/Prototypes/Entities/Tiles/chasm.yml (4)

17-19: LGTM!

The addition of the triggerGroup property with types: - Chasm is a valid way to categorize the entity as a chasm. This categorization can be effectively used to trigger specific behaviors or interactions based on the entity type.


61-61: Looks good!

The removal of the unnecessary empty line enhances the readability of the file without affecting the functionality.


71-71: Looks good!

The removal of the unnecessary empty line enhances the readability of the file without affecting the functionality.


80-80: Looks good!

The removal of the unnecessary empty line enhances the readability of the file without affecting the functionality.

Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml (1)

83-85: LGTM!

The addition of the whitelist property with the Lava entry to the StepTriggerImmune component is correctly implemented. This change aligns with the PR objective of adjusting the damage modifier for felinids, making them immune to step triggers from lava.

Content.Shared/StepTrigger/Components/StepTriggerComponent.cs (2)

1-1: LGTM!

The addition of the using directive is necessary to use types from the Content.Shared.StepTrigger.Prototypes namespace.


62-63: Approve the addition of the TriggerGroups property.

The new TriggerGroups property enhances the functionality of the StepTriggerComponent by allowing it to associate with multiple trigger groups. This change aligns with the provided AI-generated summary.

The property is appropriately annotated with the [DataField] and [AutoNetworkedField] attributes for data serialization and network synchronization.

The default value of default! is used to suppress nullable warnings, as the property is declared as nullable (StepTriggerGroup?).

Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs (1)

129-143: LGTM!

The new logic flow for checking the StepTriggerImmuneComponent and its whitelist is implemented correctly and effectively refines the conditions under which step triggers can be activated. It enhances the control flow by allowing for selective exclusion of entities with specific immunity based on a whitelist.

The code segment is well-structured and readable, making it easier to understand and maintain.

Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs Outdated Show resolved Hide resolved
@HellCatten
Copy link
Contributor Author

2024-09-13.15-39-24.mp4

Works fine

@HellCatten HellCatten marked this pull request as ready for review September 13, 2024 12:43
@HellCatten
Copy link
Contributor Author

LiquidPlasma actually was a lava analog, just with plasma. Fixing it

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: 0

Outside diff range and nitpick comments (1)
Resources/Prototypes/Entities/Tiles/bananium.yml (1)

50-52: LGTM! The change introduces a useful grouping mechanism for step triggers.

The addition of the triggerGroups property allows step triggers to be associated with specific types, enabling more nuanced interactions and behaviors. In this case, the Banana type suggests that stepping on this tile will trigger banana-related effects, which aligns with the PR objective of adjusting entity interactions.

Consider documenting the available trigger group types and their intended behaviors to maintain clarity and consistency across the codebase. This will help other developers understand and utilize the grouping mechanism effectively.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 94354c5 and f9aa5be.

Files selected for processing (19)
  • Content.Shared/StepTrigger/Components/StepTriggerComponent.cs (2 hunks)
  • Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs (2 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs (1 hunks)
  • Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs (2 hunks)
  • Resources/Prototypes/Entities/Effects/chemistry_effects.yml (2 hunks)
  • Resources/Prototypes/Entities/Mobs/Player/ipc.yml (1 hunks)
  • Resources/Prototypes/Entities/Mobs/Species/harpy.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/mousetrap.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Devices/pda.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Materials/shards.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Misc/land_mine.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Specific/Janitorial/soap.yml (1 hunks)
  • Resources/Prototypes/Entities/Tiles/bananium.yml (1 hunks)
  • Resources/Prototypes/Entities/Tiles/chasm.yml (4 hunks)
  • Resources/Prototypes/Entities/Tiles/lava.yml (1 hunks)
  • Resources/Prototypes/Entities/Tiles/liquid_plasma.yml (1 hunks)
  • Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml (1 hunks)
  • Resources/Prototypes/Traits/skills.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs
Files skipped from review as they are similar to previous changes (8)
  • Content.Shared/StepTrigger/Components/StepTriggerComponent.cs
  • Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs
  • Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs
  • Resources/Prototypes/Entities/Mobs/Player/ipc.yml
  • Resources/Prototypes/Entities/Tiles/chasm.yml
  • Resources/Prototypes/Entities/Tiles/lava.yml
  • Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml
Additional comments not posted (9)
Resources/Prototypes/Entities/Tiles/liquid_plasma.yml (1)

16-18: LGTM!

The addition of the triggerGroups property with the Liquid type is a valid and meaningful change for the FloorLiquidPlasmaEntity. This categorization allows the entity to be recognized as a liquid trigger, which is consistent with its nature as a liquid plasma floor tile.

The change is properly implemented without introducing any syntax errors or inconsistencies in the YAML structure.

Resources/Prototypes/Entities/Objects/Misc/land_mine.yml (1)

43-45: LGTM!

The addition of the triggerGroups property with the Landmine type is a valid change that allows the land mine to be categorized under a specific trigger group. This change is consistent with the provided summary and follows the existing code style.

Resources/Prototypes/Entities/Objects/Devices/mousetrap.yml (1)

16-18: LGTM!

The addition of the triggerGroups property to the StepTrigger component is a valid enhancement. Categorizing the trigger under the Mousetrap type allows for more refined control and interaction with other components in the system.

The code change is syntactically correct and aligns with the PR objective of improving the StepTriggerSystem.

Resources/Prototypes/Entities/Effects/chemistry_effects.yml (1)

80-82: LGTM!

The addition of the triggerGroups property with the Liquid type under the StepTrigger component is a valid change. It categorizes the step trigger as a liquid type, which could affect its interaction with other game mechanics or entities that recognize liquid types.

The syntax and structure of the added code are correct.

Resources/Prototypes/Entities/Objects/Specific/Janitorial/soap.yml (1)

27-29: LGTM!

The addition of the triggerGroups property with the Soap type is a valid and consistent change that enhances the functionality of the StepTrigger component by linking it to a specific category. This categorization may influence the behavior of the trigger in the game environment, as accurately described in the AI-generated summary.

Resources/Prototypes/Entities/Objects/Materials/shards.yml (1)

67-69: LGTM!

The addition of the triggerGroups property with the Shard type aligns with the PR objective of adjusting the damage modifier for IPC interacting with glass shards. This change allows for more refined control over how triggers are processed in relation to shards.

Resources/Prototypes/Entities/Mobs/Species/harpy.yml (1)

122-127: LGTM! The whitelist addition enhances the flexibility of the StepTriggerImmune component.

The introduction of the whitelist section in the StepTriggerImmune component configuration allows for fine-grained control over which types can trigger the component. By explicitly listing the allowed types (Shard, Liquid, Landmine, and Mousetrap), the component can selectively ignore triggers from other types. This change enhances the flexibility and customization of the StepTriggerImmune component for the harpy entity, enabling more precise control over its behavior.

The specified types seem reasonable and aligned with the expected behavior of the harpy entity. The indentation and formatting of the added lines are also consistent with the existing code style.

Great work on implementing this enhancement!

Resources/Prototypes/Traits/skills.yml (1)

273-278: LGTM!

The addition of the whitelist property to the StepTriggerImmune component of the TrapAvoider trait is a valid enhancement. It allows the trait to provide immunity to specific types of step triggers, namely Shard, Liquid, Landmine, and Mousetrap. This change is consistent with the purpose of the trait and follows the correct syntax and structure.

Resources/Prototypes/Entities/Objects/Devices/pda.yml (1)

275-277: LGTM!

The addition of the triggerGroups property to the StepTrigger component of the ClownPDA entity looks good. It aligns with the overall enhancements being made to the step trigger system, allowing the ClownPDA to respond to the new Soap trigger type.

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: 0

Outside diff range and nitpick comments (1)
Resources/Prototypes/Entities/Objects/Specific/Janitorial/soap.yml (1)

163-165: Consider using a consistent property name.

The addition of the triggerGroup property under the StepTrigger component is implemented correctly. However, for consistency with the Soap entity, consider using the plural form triggerGroups instead of the singular triggerGroup.

Apply this diff to use a consistent property name:

-    triggerGroup: # WD EDIT
+    triggerGroups: # WD EDIT
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5b28a95 and adab482.

Files selected for processing (2)
  • Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml (1 hunks)
  • Resources/Prototypes/Entities/Objects/Specific/Janitorial/soap.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • Resources/Prototypes/Entities/Objects/Consumable/Food/produce.yml
Additional comments not posted (2)
Resources/Prototypes/Entities/Objects/Specific/Janitorial/soap.yml (2)

27-29: LGTM!

The addition of the triggerGroups property under the StepTrigger component is implemented correctly. Associating the StepTrigger with the SlipEntity category aligns with the PR objectives and may enhance the trigger's functionality in the game environment.


207-209: LGTM!

The addition of the triggerGroups property under the StepTrigger component is implemented correctly. Associating the StepTrigger with the SlipEntity category aligns with the PR objectives and may enhance the trigger's functionality in the game environment.

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: 1

Outside diff range and nitpick comments (1)
Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1)

27-32: Make the Types property setter private.

The DataDefinition, Serializable, and NetSerializable attributes are correctly specified for the StepTriggerGroup class. The Types property is also correctly defined to hold a list of StepTriggerTypePrototype identifiers.

However, consider making the Types property setter private to prevent unintended modifications from outside the class.

[DataField]
-public List<ProtoId<StepTriggerTypePrototype>>? Types = null;
+public List<ProtoId<StepTriggerTypePrototype>>? Types { get; private set; } = null;
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b36e57e and dc223b9.

Files selected for processing (6)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1 hunks)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs (1 hunks)
  • Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs (2 hunks)
  • Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml (1 hunks)
  • Resources/Prototypes/Entities/Tiles/chasm.yml (4 hunks)
  • Resources/Prototypes/StepTrigger/StepTriggerTypes.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs
Files skipped from review as they are similar to previous changes (4)
  • Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs
  • Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml
  • Resources/Prototypes/Entities/Tiles/chasm.yml
  • Resources/Prototypes/StepTrigger/StepTriggerTypes.yml
Additional comments not posted (1)
Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs (1)

1-7: LGTM!

The using directives are correctly specified and seem relevant to the StepTriggerGroup class implementation.

Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs Outdated Show resolved Hide resolved
@HellCatten HellCatten requested a review from Remuchi September 13, 2024 20:22
@Remuchi Remuchi changed the title [FIX] StepTriggerImmuneComponent fix [Feature] StepTriggerGroup to improve StepTriggerImmune behaviour Sep 14, 2024
@Remuchi Remuchi merged commit 35c4454 into WWhiteDreamProject:master Sep 16, 2024
11 checks passed
riddleridou added a commit that referenced this pull request Sep 16, 2024
VMSolidus added a commit to Simple-Station/Einstein-Engines that referenced this pull request Sep 19, 2024
# Description

This is a port of
WWhiteDreamProject/wwdpublic#53 from White
Dream. This PR improves the StepTriggerImmune component by making it
operate on a more granular Blacklist system, such that StepTriggerImmune
entities can further clarify via prototypes which kinds of floor traps
they are immune to, such as landmines/mousetraps, and not have blanket
immunity to everything. Because it turns out things like Lava and Soap
also were caught by the immunity, when really we just wanted Harpies &
Felinids to not trigger landmines.



<details><summary><h1>Media</h1></summary>
<p>

> # Описание
> Необходимо настроить модификатор урона, чтобы IPC не получали урон от
осколков стекла.
> 
> Иммунитет StepTriggerImmuneComponent доработан. Теперь имеются
несколько типов (types): Lava - тип тайла, наступив на который
появляется урон. Это собственно лава и LiquidPlasma Landmine - мины.
Chasm - дырка в карте, куда можно провалиться Mousetrap - Мышеловка
SlipTile - Все, что должно подскальзывать игроков, имеющее размер тайла
SlipEntity - Все, что должно подскальзывать игроков, имеющее развер
энтити. Разделено для баланса. Самые ловки могут игнорировать мелкие
предметы (энтити), т.е. уворачиваться от них. Но большие по площади вещи
(тайлы по типу разлитой воды, бананиума) просчитываются отдельно.
> 
> # Изменения
> * [x]  Улучшить StepTriggerSystem (Immune)
> * [x] Добавлены типы триггера. - Lava Landmine Shard Chasm Mousetrap
SlipTile SlipEntity
> * [x]  Исправить осколки у IPC
> * [x] Исправить отсутствие урона от лавы и падение в дыры у фелинидов
и гарпий.
> 
> 🆑 Hell_Cat
> 
> * Feature: StepTriggerSystem is improved | Улучшена StepTriggerSystem
> * fix: IPC: Immunity for shards and SpiderWeb | Иммунитет осколкам.
> * fix: Felinid | Фелиниды : Immunity for Shard Landmine Mousetrap
SlipEntities | Иммунитет для осколков, жидкости, мин, мышеловок, мыла и
бананов.
> * fix: Harpy | Гарпия : Immunity for Shards Landmine Mousetrap |
Иммунитет для осколков, жидкости, мин и мышеловок.
> * fix: Mice | Мыши : Don't blow up on landmines | Мыши не подрываются
на минах.

</p>
</details>

# Changelog

:cl: Hell_Cat
Feature: StepTriggerSystem has been improved with new StepTriggerGroups.
Additionally, the StepTriggerImmune component now allows declaring for
specific StepTriggerGroups for a given entity to be immune to. Some
examples may be, Felinids, Mice, and Harpies being unable to set off
Landmines.

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: Ivan <[email protected]>
Co-authored-by: FoxxoTrystan <[email protected]>
@HellCatten HellCatten deleted the Ipc-damage-modifier branch September 30, 2024 09:13
Remuchi pushed a commit that referenced this pull request Oct 19, 2024
# Description

This is a port of
#53 from White
Dream. This PR improves the StepTriggerImmune component by making it
operate on a more granular Blacklist system, such that StepTriggerImmune
entities can further clarify via prototypes which kinds of floor traps
they are immune to, such as landmines/mousetraps, and not have blanket
immunity to everything. Because it turns out things like Lava and Soap
also were caught by the immunity, when really we just wanted Harpies &
Felinids to not trigger landmines.

<details><summary><h1>Media</h1></summary>
<p>

> # Описание
> Необходимо настроить модификатор урона, чтобы IPC не получали урон от
осколков стекла.
>
> Иммунитет StepTriggerImmuneComponent доработан. Теперь имеются
несколько типов (types): Lava - тип тайла, наступив на который
появляется урон. Это собственно лава и LiquidPlasma Landmine - мины.
Chasm - дырка в карте, куда можно провалиться Mousetrap - Мышеловка
SlipTile - Все, что должно подскальзывать игроков, имеющее размер тайла
SlipEntity - Все, что должно подскальзывать игроков, имеющее развер
энтити. Разделено для баланса. Самые ловки могут игнорировать мелкие
предметы (энтити), т.е. уворачиваться от них. Но большие по площади вещи
(тайлы по типу разлитой воды, бананиума) просчитываются отдельно.
>
> # Изменения
> * [x]  Улучшить StepTriggerSystem (Immune)
> * [x] Добавлены типы триггера. - Lava Landmine Shard Chasm Mousetrap
SlipTile SlipEntity
> * [x]  Исправить осколки у IPC
> * [x] Исправить отсутствие урона от лавы и падение в дыры у фелинидов
и гарпий.
>
> 🆑 Hell_Cat
>
> * Feature: StepTriggerSystem is improved | Улучшена StepTriggerSystem
> * fix: IPC: Immunity for shards and SpiderWeb | Иммунитет осколкам.
> * fix: Felinid | Фелиниды : Immunity for Shard Landmine Mousetrap
SlipEntities | Иммунитет для осколков, жидкости, мин, мышеловок, мыла и
бананов.
> * fix: Harpy | Гарпия : Immunity for Shards Landmine Mousetrap |
Иммунитет для осколков, жидкости, мин и мышеловок.
> * fix: Mice | Мыши : Don't blow up on landmines | Мыши не подрываются
на минах.

</p>
</details>

# Changelog

:cl: Hell_Cat
Feature: StepTriggerSystem has been improved with new StepTriggerGroups.
Additionally, the StepTriggerImmune component now allows declaring for
specific StepTriggerGroups for a given entity to be immune to. Some
examples may be, Felinids, Mice, and Harpies being unable to set off
Landmines.

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: Ivan <[email protected]>
Co-authored-by: FoxxoTrystan <[email protected]>
# Conflicts:
#	Content.Shared/StepTrigger/Components/StepTriggerComponent.cs
#	Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs
#	Content.Shared/StepTrigger/Prototypes/StepTriggerGroup.cs
#	Content.Shared/StepTrigger/Prototypes/StepTriggerTypePrototype.cs
#	Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs
#	Resources/Prototypes/Entities/Effects/chemistry_effects.yml
#	Resources/Prototypes/Entities/Mobs/NPCs/animals.yml
#	Resources/Prototypes/Entities/Mobs/Player/ipc.yml
#	Resources/Prototypes/Entities/Mobs/Species/harpy.yml
#	Resources/Prototypes/Entities/Objects/Devices/mousetrap.yml
#	Resources/Prototypes/Entities/Objects/Devices/pda.yml
#	Resources/Prototypes/Entities/Objects/Fun/dice.yml
#	Resources/Prototypes/Entities/Objects/Materials/shards.yml
#	Resources/Prototypes/Entities/Objects/Misc/land_mine.yml
#	Resources/Prototypes/Entities/Objects/Specific/Janitorial/soap.yml
#	Resources/Prototypes/Entities/Tiles/bananium.yml
#	Resources/Prototypes/Entities/Tiles/chasm.yml
#	Resources/Prototypes/Entities/Tiles/lava.yml
#	Resources/Prototypes/Entities/Tiles/liquid_plasma.yml
#	Resources/Prototypes/Nyanotrasen/Entities/Mobs/Species/felinid.yml
#	Resources/Prototypes/Traits/skills.yml
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.

3 participants