-
Notifications
You must be signed in to change notification settings - Fork 34
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
Added Right Click Melee Attack to Guns #24
Conversation
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
К строчкам кода изменённым не в папках вайта следует добавлять комментарий.
Одна строчка кода // WD EDIT
// WD EDIT START
Три и более строчки
// WD EDIT END
В прототипе # WD EDIT
Новые файлы стоит добавлять в папку _White.
Ошибка в Build & Test Debug не связана с ПРом |
С этим есть некоторые геймдизайнеровые загвоздки, пусть идея очень даже хорошая. В частности, там идёт расчет на то, что ПКМ будет в будущем использован для системы прицеливания, то есть, это имеет некоторый приоритет. Можно ли добавить, что вместо ПКМ - условный ALT + ЛКМ? |
# Conflicts: # Content.Client/Weapons/Melee/MeleeWeaponSystem.cs # Content.Server/Weapons/Melee/MeleeWeaponSystem.cs # Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs # Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs # Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/pka.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/LMGs/lmgs.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Pistols/pistols.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Revolvers/revolvers.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/SMGs/smgs.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml
Co-authored-by: Spatison <[email protected]>
WalkthroughThe changes involve updates to the melee and ranged weapon systems across multiple files, focusing on enhancing the handling of weapon actions based on user input. Key modifications include the introduction of a new event for melee attempts, restructuring of attack logic, and the addition of new melee weapon types in YAML configurations. The updates aim to clarify control flow and improve the functionality of melee combat mechanics while ensuring that ranged weapons are excluded from melee-specific logic. Changes
Tip OpenAI O1 model for chat
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (14)
- Content.Client/Weapons/Melee/MeleeWeaponSystem.cs (3 hunks)
- Content.Server/Weapons/Melee/MeleeWeaponSystem.cs (2 hunks)
- Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs (3 hunks)
- Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs (3 hunks)
- Content.Shared/_White/Weapons/Melee/Events/MeleeAttemptedEvent.cs (1 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/pka.yml (1 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml (3 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/LMGs/lmgs.yml (1 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Pistols/pistols.yml (1 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Revolvers/revolvers.yml (1 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml (2 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/SMGs/smgs.yml (3 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml (1 hunks)
- Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml (2 hunks)
Files skipped from review due to trivial changes (1)
- Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Additional comments not posted (18)
Resources/Prototypes/Entities/Objects/Weapons/Guns/Basic/pka.yml (2)
14-21
: New MeleeWeapon Component AddedThe addition of the
MeleeWeapon
component with an attack rate of 0.7 and blunt damage of 7 aligns with the PR's objectives to integrate melee capabilities into firearms. This change should enhance gameplay by allowing the proto-kinetic accelerator to be used in close combat scenarios.
21-24
: New IncreaseDamageOnWield Component AddedThe introduction of the
IncreaseDamageOnWield
component, which increases blunt damage by 3 when the weapon is wielded, introduces a new dynamic to weapon handling. This change could encourage players to engage more with melee combat, enhancing the strategic depth of the game.Resources/Prototypes/Entities/Objects/Weapons/Guns/LMGs/lmgs.yml (1)
63-69
: New MeleeWeapon Component for LMGsThe addition of the
MeleeWeapon
component with an attack rate of 0.5 and blunt damage of 8 to the light machine guns enhances their versatility in combat. This change allows for both ranged and melee combat, providing players with more tactical options.Resources/Prototypes/Entities/Objects/Weapons/Guns/Snipers/snipers.yml (2)
40-46
: Review of Melee Weapon Configuration for Base SniperThe configuration for the melee weapon on the base sniper rifle is correctly implemented with an
attackRate
of 0.5 andBlunt
damage of 8. However, ensure that the damage values and attack rate are balanced according to the game's overall weapon mechanics.Please verify the balance of the attack rate and damage values with the game design team.
64-70
: Review of Melee Weapon Configuration for Kardashev-Mosin SniperThe melee weapon configuration for the Kardashev-Mosin sniper is well-implemented, featuring
Piercing
andSlash
damage types, which add depth to the weapon's capabilities. The specific sound path/Audio/Weapons/bladeslice.ogg
is a good touch, enhancing the audio feedback during melee attacks.Resources/Prototypes/Entities/Objects/Weapons/Guns/Revolvers/revolvers.yml (1)
53-58
: Review of Melee Weapon Configuration for Base RevolverThe configuration for the melee weapon on the base revolver is correctly implemented with
Blunt
damage of 7. The use of a generic hit sound collection is appropriate for the weapon type. However, ensure that the damage value is balanced according to the game's overall weapon mechanics.Please verify the balance of the damage value with the game design team.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Rifles/rifles.yml (1)
52-58
: Review of Melee Weapon Configuration for Base RifleThe configuration for the melee weapon on the base rifle is correctly implemented with an
attackRate
of 0.7 andBlunt
damage of 10. However, ensure that the damage values and attack rate are balanced according to the game's overall weapon mechanics.Please verify the balance of the attack rate and damage values with the game design team.
Resources/Prototypes/Entities/Objects/Weapons/Guns/Pistols/pistols.yml (1)
68-73
: Approved: Melee weapon configuration for pistols.The addition of the melee weapon component with a damage type of "Blunt" and a value of 7 is correctly implemented. The sound effect for hits is also appropriately configured.
Please ensure the sound collection
GenericHit
is correctly integrated and available in the game's audio assets.Resources/Prototypes/Entities/Objects/Weapons/Guns/Shotguns/shotguns.yml (1)
46-52
: Approved: Melee weapon configuration for shotguns.The addition of the melee weapon component with an attack rate of 0.7 and a damage type of "Blunt" with a value of 10 is correctly implemented. The sound effect for hits is also appropriately configured.
Please ensure the sound collection
GenericHit
is correctly integrated and available in the game's audio assets.Resources/Prototypes/Entities/Objects/Weapons/Guns/SMGs/smgs.yml (1)
57-63
: Approved: Melee weapon configuration for SMGs.The addition of the melee weapon component with an attack rate of 0.8 and a damage type of "Blunt" with a value of 8 is correctly implemented. The sound effect for hits is also appropriately configured.
Please ensure the sound collection
GenericHit
is correctly integrated and available in the game's audio assets.Content.Client/Weapons/Melee/MeleeWeaponSystem.cs (1)
164-171
: Approved changes for left-click functionality on guns.The logic to prevent left-click attacks when a gun is set to shoot with the left click is correctly implemented. This ensures that guns do not perform unintended melee attacks.
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs (3)
4-4
: Update import to reflect new event usage.The import statement has been updated to include the new
MeleeAttemptedEvent
. This change is necessary to support the new event handling logic introduced in this PR.
66-66
: Subscription to newMeleeAttemptedEvent
.The subscription change from
ShotAttemptedEvent
toMeleeAttemptedEvent
is crucial for the new melee attack functionality. This ensures that the system listens for the correct events when melee attacks are attempted.
90-90
: Method update to handleMeleeAttemptedEvent
.The method
OnMeleeAttempted
has been updated to handle the newMeleeAttemptedEvent
. This change is aligned with the PR's objective to enhance melee attack functionality by integrating it with the right-click action. The method currently checks if the next attack is allowed based on the timing, which is a simple yet effective way to manage attack rates.Content.Server/Weapons/Melee/MeleeWeaponSystem.cs (1)
28-28
: Import addition approved.The new import is necessary for the logic that checks for the presence of a
GunComponent
in theOnMeleeExamineDamage
method.Resources/Prototypes/Entities/Objects/Weapons/Guns/Battery/battery_guns.yml (3)
35-41
: MeleeWeapon component addition approved.The specified
attackRate
andBlunt
damage align with the PR's objectives for integrating melee attacks with firearms. The choice ofGenericHit
for the sound effect is appropriate.
78-84
: Consistent MeleeWeapon component addition approved.The properties of this
MeleeWeapon
component are consistent with the first addition, ensuring uniform behavior across different entities.
105-109
: MeleeWeapon component addition approved with noted variation.The
attackRate
andBlunt
damage are slightly different from the previous additions, which may reflect the specific characteristics of this weapon. This variation is acceptable as long as it aligns with the intended gameplay balance.
Content.Shared/_White/Weapons/Melee/Events/MeleeAttemptedEvent.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Или ввести разницу между зажатым и просто нажатым ПКМ 💅 |
Описание PR
Огнестрельное оружие теперь совместимо с компонентом MeleeWeapon, атаки производятся по нажатию ПКМ в боевом режиме.
Обновлённые характеристики оружия:
Пистолеты - 7 урона, частота атак 1,
ПП - 8 урона, частота атак 0.8,
Дробовики и винтовки - 10 урона, частота атак 0.7.
Винтовка мосина наконец получила свой штык - 10 колющего и 5 режущего урона, частота атак 0.5,
Протокинетик - 7 урона / 10 урона в двух руках. частота атак 0.7.
Медиа
2024-08-28.16-18-49.mp4
_.-.mp4
Изменения
🆑 vanx