-
Notifications
You must be signed in to change notification settings - Fork 149
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] Xeno Maid #888
[FEATURE] Xeno Maid #888
Changes from all commits
369f7a2
ad72ee8
7a4fa9b
0e7bcb6
cd90553
adf791c
0c01f84
66022d0
7d5c8e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||||||||||||||||||||||
using Content.Server.Weapons.Ranged.Systems; | ||||||||||||||||||||||||
using Content.Shared.Actions; | ||||||||||||||||||||||||
using Content.Shared.Backmen.Abilities.Xeno; | ||||||||||||||||||||||||
using Robust.Server.GameObjects; | ||||||||||||||||||||||||
using Robust.Shared.Audio.Systems; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
namespace Content.Server.Backmen.Abilities.Xeno; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
public sealed class XenoAbilitiesSystem : EntitySystem | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!; | ||||||||||||||||||||||||
[Dependency] private readonly GunSystem _gunSystem = default!; | ||||||||||||||||||||||||
[Dependency] private readonly PhysicsSystem _physics = default!; | ||||||||||||||||||||||||
[Dependency] private readonly SharedTransformSystem _transform = default!; | ||||||||||||||||||||||||
[Dependency] private readonly SharedActionsSystem _actions = default!; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
public override void Initialize() | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
base.Initialize(); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
SubscribeLocalEvent<XenoAcidSpillerComponent, XenoAcidSpitActionEvent>(OnAcidSpit); | ||||||||||||||||||||||||
SubscribeLocalEvent<XenoAcidSpillerComponent, ComponentStartup>(OnStartup); | ||||||||||||||||||||||||
SubscribeLocalEvent<XenoAcidSpillerComponent, ComponentShutdown>(OnShutdown); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
private void OnAcidSpit(EntityUid uid, XenoAcidSpillerComponent component, XenoAcidSpitActionEvent args) | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
if (args.Handled) | ||||||||||||||||||||||||
return; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
var xform = Transform(uid); | ||||||||||||||||||||||||
var acidBullet = Spawn(component.BulletSpawnId, xform.Coordinates); | ||||||||||||||||||||||||
var mapCoords = _transform.ToMapCoordinates(args.Target); | ||||||||||||||||||||||||
var direction = mapCoords.Position - _transform.GetMapCoordinates(xform).Position; | ||||||||||||||||||||||||
var userVelocity = _physics.GetMapLinearVelocity(uid); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
_gunSystem.ShootProjectile(acidBullet, direction, userVelocity, uid, uid); | ||||||||||||||||||||||||
_audioSystem.PlayPvs(component.BulletSound, uid, component.BulletSound.Params); | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
args.Handled = true; | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
private void OnStartup(EntityUid uid, XenoAcidSpillerComponent component, ComponentStartup args) | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
_actions.AddAction(uid, ref component.AcidSpitAction, component.AcidSpitActionId); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
Comment on lines
+43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Добавьте обработку ошибок при добавлении действия Метод AddAction может завершиться неудачно, но текущая реализация не обрабатывает такой случай. private void OnStartup(EntityUid uid, XenoAcidSpillerComponent component, ComponentStartup args)
{
- _actions.AddAction(uid, ref component.AcidSpitAction, component.AcidSpitActionId);
+ if (!_actions.AddAction(uid, ref component.AcidSpitAction, component.AcidSpitActionId))
+ {
+ Log.Warning($"Failed to add acid spit action to {ToPrettyString(uid)}");
+ }
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||
|
||||||||||||||||||||||||
private void OnShutdown(EntityUid uid, XenoAcidSpillerComponent component, ComponentShutdown args) | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
_actions.RemoveAction(uid, component.AcidSpitAction); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Shared.Backmen.Abilities.Xeno; | ||
|
||
[RegisterComponent] | ||
public sealed partial class XenoAcidSpillerComponent : Component | ||
{ | ||
[DataField] | ||
public EntProtoId AcidSpitActionId = "ActionXenoSpitMaidAcid"; | ||
|
||
[DataField] | ||
public EntityUid? AcidSpitAction; | ||
|
||
[DataField] | ||
public EntProtoId BulletSpawnId = "BulletSplashMaidAcid"; | ||
Comment on lines
+15
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Характеристики прототипа пули требуют корректировки Анализ показал следующие характеристики:
Рекомендуется:
🔗 Analysis chainПроверить прототип пули Необходимо проверить характеристики "BulletSplashMaidAcid" для обеспечения игрового баланса. Let me gather more information about the bullet prototype's damage configuration. Let me check the properties of the reagent being used in the splash effect. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Поиск определения прототипа пули
rg "BulletSplashMaidAcid" -A 10
Length of output: 1347 Script: #!/bin/bash
# Поиск полного определения прототипа пули и его характеристик
rg -A 20 "id: BulletSplashMaidAcid" Resources/Prototypes/_Backmen/Actions/xeno.yml
Length of output: 515 Script: #!/bin/bash
# Поиск определения реагента SlermQueenPlus
rg "SlermQueenPlus" -A 10
Length of output: 4383 |
||
|
||
[DataField] | ||
public SoundSpecifier BulletSound = new SoundPathSpecifier("/Audio/Effects/Fluids/splat.ogg"); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using Content.Shared.Actions; | ||
|
||
namespace Content.Shared.Backmen.Abilities.Xeno; | ||
|
||
public sealed partial class XenoAcidSpitActionEvent : WorldTargetActionEvent; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- type: entity | ||
id: ActionXenoSpitMaidAcid | ||
name: Spit slerm | ||
description: Spit the violet acid on your enemies. | ||
components: | ||
- type: WorldTargetAction | ||
icon: Interface/Actions/fleshAcidSpit.png | ||
#itemIconStyle: NoItem | ||
event: !type:XenoAcidSpitActionEvent | ||
checkCanAccess: true | ||
useDelay: 60 | ||
range: 32 | ||
repeat: true | ||
priority: -20 | ||
|
||
- type: entity | ||
id: BulletSplashMaidAcid | ||
name: maid acid spit | ||
parent: BaseBulletTrigger | ||
categories: [ HideSpawnMenu ] | ||
components: | ||
- type: Sprite | ||
sprite: Objects/Weapons/Guns/Projectiles/flesh_toxic.rsi | ||
layers: | ||
- state: flesh_toxic | ||
- type: Projectile | ||
damage: | ||
types: | ||
Caustic: 5 | ||
- type: SplashOnTrigger | ||
splashReagents: | ||
- ReagentId: SlermQueenPlus | ||
Quantity: 30 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,18 @@ | |
# fake: true | ||
# disease: FurryVirus | ||
|
||
|
||
- type: emote | ||
id: BCatMeow | ||
name: chat-emote-name-BCatMeow | ||
category: Vocal | ||
chatMessages: ["chat-emote-msg-BCatMeow"] | ||
|
||
- type: disease | ||
parent: FurryVirus | ||
id: FurryVirusPlus | ||
cures: [] | ||
|
||
Comment on lines
+17
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Отсутствие лечения может быть проблематичным
Хотите, чтобы я предложил список подходящих методов лечения? |
||
- type: disease | ||
id: FurryVirus | ||
name: disease-proto-furry-virus | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
- type: entity | ||
id: MobMaidXeno | ||
parent: MobXeno | ||
name: горничная ксеноморфа | ||
description: Это чертовски мило, пока она сытная. | ||
components: | ||
- type: LagCompensation | ||
- type: Input | ||
context: "human" | ||
- type: MovedByPressure | ||
- type: DamageOnHighSpeedImpact | ||
damage: | ||
types: | ||
Blunt: 5 | ||
soundHit: | ||
path: /Audio/Effects/hit_kick.ogg | ||
- type: Sprite | ||
drawdepth: Mobs | ||
sprite: Backmen/Mobs/Aliens/Xenos/maidxenos.rsi | ||
layers: | ||
- map: ["enum.DamageStateVisualLayers.Base"] | ||
state: running | ||
noRot: true | ||
netsync: false | ||
- type: Clickable | ||
- type: InteractionOutline | ||
- type: SolutionContainerManager | ||
- type: AtmosExposed | ||
- type: MobThresholds | ||
thresholds: | ||
0: Alive | ||
100: Dead | ||
- type: Internals | ||
- type: Damageable | ||
damageContainer: Biological | ||
damageModifierSet: Xenolian | ||
- type: Body | ||
prototype: Animal | ||
- type: Actions | ||
- type: DoAfter | ||
- type: Polymorphable | ||
- type: Buckle | ||
- type: Insulated | ||
- type: Hands | ||
showInHands: true | ||
- type: MobState | ||
allowedStates: | ||
- Alive | ||
- Dead | ||
- type: MovementSpeedModifier | ||
baseWalkSpeed : 2.5 | ||
baseSprintSpeed : 4 | ||
- type: Stamina | ||
critThreshold: 500 | ||
- type: Appearance | ||
- type: Bloodstream | ||
bloodMaxVolume: 0 | ||
- type: UnpoweredFlashlight | ||
- type: PointLight | ||
enabled: false | ||
radius: 4 | ||
color: "purple" | ||
- type: Puller | ||
needsHands: false | ||
- type: NoSlip | ||
- type: IgnoreSpiderWeb | ||
- type: IntrinsicRadioReceiver | ||
- type: ActiveRadio | ||
channels: | ||
- Hivemind | ||
- type: IntrinsicRadioTransmitter | ||
channels: | ||
- Hivemind | ||
- type: LizardAccent | ||
- type: Speech | ||
speechSounds: Xeno | ||
- type: Eye | ||
drawFov: false | ||
- type: SolutionRegeneration | ||
solution: spray | ||
generated: | ||
reagents: | ||
- ReagentId: Water | ||
Quantity: 10 | ||
- type: Access | ||
tags: | ||
- Xeno | ||
- type: LanguageSpeaker | ||
currentLanguage: Xeno | ||
- type: LanguageKnowledge | ||
speaks: | ||
- Xeno | ||
understands: | ||
- Xeno | ||
- TauCetiBasic |
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.
Необходима валидация входных параметров
В методе OnAcidSpit отсутствуют проверки:
Предлагаемые изменения:
📝 Committable suggestion