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

[Update] Buff Xeno #900

Merged
merged 12 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Content.Server/ADT/Abilities/XenoQeen/XenoQeenComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Abilities.XenoQeen
{
/// <summary>
/// Lets its owner entity use mime powers, like placing invisible walls.
/// </summary>
[RegisterComponent]
public sealed partial class XenoQeenComponent : Component
{
/// <summary>
/// Whether this component is active or not.
/// </summarY>
[DataField("enabled")]
public bool Enabled = true;

/// <summary>
/// The wall prototype to use.
/// </summary>
[DataField("wallPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string XenoTurret = "WeaponTurretXeno";

[DataField("xenoTurretAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? XenoTurretAction = "ActionXenoQeenTurret";

[DataField("xenoTurretActionEntity")] public EntityUid? XenoTurretActionEntity;
}
}
66 changes: 66 additions & 0 deletions Content.Server/ADT/Abilities/XenoQeen/XenoQeenSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using Content.Server.Popups;
using Content.Shared.Actions;
using Content.Shared.Actions.Events;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Maps;
using Content.Shared.Physics;
using Robust.Shared.Containers;
using Robust.Shared.Map;

namespace Content.Server.Abilities.XenoQeen
{
public sealed class XenoQeenSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly TurfSystem _turf = default!;
[Dependency] private readonly IMapManager _mapMan = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<XenoQeenComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<XenoQeenComponent, InvisibleWallActionEvent>(OnCreateTurret);
}

public override void Update(float frameTime)
{
base.Update(frameTime);
}
private void OnComponentInit(EntityUid uid, XenoQeenComponent component, ComponentInit args)
{
_actionsSystem.AddAction(uid, ref component.XenoTurretActionEntity, component.XenoTurretAction, uid);
}
private void OnCreateTurret(EntityUid uid, XenoQeenComponent component, InvisibleWallActionEvent args)
{
if (!component.Enabled)
return;

if (_container.IsEntityOrParentInContainer(uid))
return;

var xform = Transform(uid);
// Get the tile in front of the Qeen
var offsetValue = xform.LocalRotation.ToWorldVec();
var coords = xform.Coordinates.Offset(offsetValue).SnapToGrid(EntityManager, _mapMan);
var tile = coords.GetTileRef(EntityManager, _mapMan);
if (tile == null)
return;

// Check if the tile is blocked by a wall or mob, and don't create the wall if so
if (_turf.IsTileBlocked(tile.Value, CollisionGroup.Impassable | CollisionGroup.Opaque))
{
_popupSystem.PopupEntity(Loc.GetString("create-turret-failed"), uid, uid);
return;
}

_popupSystem.PopupEntity(Loc.GetString("create-turret"), uid);
// Make sure we set the invisible wall to despawn properly
Spawn(component.XenoTurret, _turf.GetTileCenter(tile.Value));
// Handle args so cooldown works
args.Handled = true;
}

}
}
14 changes: 14 additions & 0 deletions Resources/Locale/ru-RU/ADT/prototypes/Actions/XenoQeen.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ent-ActionXenoQeenTurret = Создать ксено турель.
.desc = Создаёт перед вами ксену турель, если хватает места.
create-turret-failed = Найдите другое место.
create-turret = Арргхсс. Шшшшш!
ent-ActionSpawnMobXenoSpitter = Призвать Плевальщик
.desc = Родите Плевальщика, который будет плеваться!
ent-ActionSpawnMobXenoPraetorian = Призвать Преторианеца
.desc = Родите Преторианеца, который будет сражаться за вас!
ent-ActionSpawnMobXenoDrone = Просто Дрон. Кому он нужен?
.desc = Родите рабочего, Дрон.
ent-ActionSpawnMobXenoRavager = Призвать Разрушителя
.desc = Родите смерть во плоти!
ent-ActionSpawnMobXenoRunner = Призвать Бегуна
.desc = Родите самую быструю личинку!
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
ent-MobXeno = Бурильщик
.desc = Обычно они приходят ночью. Обычно.
ent-MobXenoPraetorian = Преторианец
.desc = { ent-MobXeno.desc }
.desc = Преторианец. Личная гвардия королевы, задача которого - защитить королеву. Стойкий воин ксено с хорошим уроном.
ent-MobXenoDrone = Дрон
.desc = { ent-MobXeno.desc }
.desc = Дрон. Рядовой представитель ксеносов, задача которых - защищать улей и иногда охотиться. Не обладают выдающимися характеристиками. Самый типичный ксено.
ent-MobXenoQueen = Королева
.desc = { ent-MobXeno.desc }
.desc = Королева. Предводительница стаи, невероятно сильная и живучая, если она оказалась перед вами - считайте, что вы мертвы.
ent-MobXenoRavager = Разрушитель
.desc = { ent-MobXeno.desc }
.desc = Разрушитель. Самый сильный и живучий ксенос, после королевы.
ent-MobXenoRunner = Бегун
.desc = { ent-MobXeno.desc }
.desc = Бегун. Обладает малым уроном, но отличается большой скоростью, так что быстро бегает и бьёт.
ent-MobXenoRouny = Руни
.desc = { ent-MobXenoRunner.desc }
ent-MobXenoSpitter = Плевальщик
.desc = { ent-MobXeno.desc }
.desc = Плевальщик. Рядовой представитель ксеносов, который плюётся едкой кислотой, прожигающую даже броню. Однако слаб в ближнем бою.
ent-MobPurpleSnake = космическая гадюка
.desc = Грозная пурпурная змея с Kepler-283c.
ent-MobSmallPurpleSnake = космическая гадюка
Expand Down
109 changes: 109 additions & 0 deletions Resources/Prototypes/ADT/Actions/XenoQeen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Спавн турелей у королевы
- type: entity
id: ActionXenoQeenTurret
name: Create Xeno turret
description: Create an xeno turret in front of you, if placeable there.
components:
- type: InstantAction
priority: -1
useDelay: 180
icon:
sprite: Objects/Weapons/Guns/Turrets/xenoturret.rsi
state: icon
event: !type:InvisibleWallActionEvent
# Я не смог сделать отдельный ивент для спавнта турели. Он не видел прототип ивента.

- type: entity
id: ActionSpawnMobXenoSpitter
name: Spawn Spitter
description: Give birth to Spitter who will spit!
categories: [ HideSpawnMenu ]
components:
- type: WorldTargetAction
useDelay: 240
range: 4
itemIconStyle: BigAction
icon:
sprite: Mobs/Aliens/Xenos/spitter.rsi
state: crit
event: !type:WorldSpawnSpellEvent
prototypes:
- id: MobXenoSpitter
amount: 1
offset: 0, 1

- type: entity
id: ActionSpawnMobXenoPraetorian
name: Spawn Praetorian
description: Give birth to a Praetorian who will fight for you!
categories: [ HideSpawnMenu ]
components:
- type: WorldTargetAction
useDelay: 300
range: 4
itemIconStyle: BigAction
icon:
sprite: Mobs/Aliens/Xenos/praetorian.rsi
state: crit
event: !type:WorldSpawnSpellEvent
prototypes:
- id: MobXenoPraetorian
amount: 1
offset: 0, 1

- type: entity
id: ActionSpawnMobXenoDrone
name: Just a Drone. Who needs it?
description: Give birth to a worker, Drone.
categories: [ HideSpawnMenu ]
components:
- type: WorldTargetAction
useDelay: 80
range: 4
itemIconStyle: BigAction
icon:
sprite: Mobs/Aliens/Xenos/drone.rsi
state: crit
event: !type:WorldSpawnSpellEvent
prototypes:
- id: MobXenoDrone
amount: 1
offset: 0, 1

- type: entity
id: ActionSpawnMobXenoRavager
name: Spawn Ravager
description: Give birth to death in the flesh!
categories: [ HideSpawnMenu ]
components:
- type: WorldTargetAction
useDelay: 480
range: 4
itemIconStyle: BigAction
icon:
sprite: Mobs/Aliens/Xenos/ravager.rsi
state: crit
event: !type:WorldSpawnSpellEvent
prototypes:
- id: MobXenoRavager
amount: 1
offset: 0, 1

- type: entity
id: ActionSpawnMobXenoRunner
name: Spawn Runner
description: Give birth to the fastest larva!
categories: [ HideSpawnMenu ]
components:
- type: WorldTargetAction
useDelay: 120
range: 4
itemIconStyle: BigAction
icon:
sprite: Mobs/Aliens/Xenos/runner.rsi
state: crit
event: !type:WorldSpawnSpellEvent
prototypes:
- id: MobXenoRunner
amount: 1
offset: 0, 1
43 changes: 32 additions & 11 deletions Resources/Prototypes/Entities/Mobs/NPCs/xeno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,18 @@
- type: MobThresholds
thresholds:
0: Alive
100: Dead
350: Dead # ADT Tweak
- type: Stamina
critThreshold: 300
- type: SlowOnDamage
speedModifierThresholds:
50: 0.7
#ADT Start: Xeno baff
- type: MeleeWeapon
damage:
groups:
Brute: 8
Schrodinger71 marked this conversation as resolved.
Show resolved Hide resolved
# ADT End
- type: Fixtures
fixtures:
fix1:
Expand Down Expand Up @@ -183,14 +189,14 @@
- type: MobThresholds
thresholds:
0: Alive
80: Dead
100: Dead # ADT Tweak
- type: SlowOnDamage
speedModifierThresholds:
40: 0.7
- type: MeleeWeapon
damage:
groups:
Brute: 6
Brute: 5 # ADT Tweak
- type: MovementSpeedModifier
baseSprintSpeed: 4
- type: Fixtures
Expand All @@ -214,6 +220,16 @@
parent: MobXeno
id: MobXenoQueen
components:
# ADT Start: Xeno buff
- type: XenoQeen # ADT Tweak: Способность спавнта турелей
- type: ActionGrant
actions:
- ActionSpawnMobXenoSpitter # Призыв Плевальщиков
- ActionSpawnMobXenoPraetorian # Призыв Преторианеца
- ActionSpawnMobXenoDrone # Призыв Дрона
- ActionSpawnMobXenoRavager # Призыв Разрушителя
- ActionSpawnMobXenoRunner # Призыв бегуна
#ADT End
- type: Sprite
drawdepth: Mobs
sprite: Mobs/Aliens/Xenos/queen.rsi
Expand All @@ -224,15 +240,15 @@
- type: MobThresholds
thresholds:
0: Alive
300: Dead
1000: Dead # ADT Tweak
- type: SlowOnDamage
speedModifierThresholds:
150: 0.7
- type: MovementSpeedModifier
- type: MeleeWeapon
damage:
groups:
Brute: 12
Brute: 20 # ADT Tweak
- type: Fixtures
fixtures:
fix1:
Expand All @@ -252,7 +268,6 @@
rankName: collective-mind-queen-rank
# ADT-CollectiveMind-Tweak-End


Schrodinger71 marked this conversation as resolved.
Show resolved Hide resolved
- type: entity
name: ravager
parent: MobXeno
Expand All @@ -268,13 +283,13 @@
- type: MobThresholds
thresholds:
0: Alive
100: Dead
750: Dead # ADT Tweak
- type: MovementSpeedModifier
baseSprintSpeed: 4
baseSprintSpeed: 2 # ADT Tweak
- type: MeleeWeapon
damage:
groups:
Brute: 10
Brute: 30 # ADT Tweak
- type: SlowOnDamage
speedModifierThresholds:
50: 0.7
Expand Down Expand Up @@ -306,8 +321,14 @@
layers:
- map: ["enum.DamageStateVisualLayers.Base"]
state: running
# ADT Start: Xeno buff
- type: MobThresholds
thresholds:
0: Alive
100: Dead
Schrodinger71 marked this conversation as resolved.
Show resolved Hide resolved
# ADT End
- type: MovementSpeedModifier
baseSprintSpeed: 6.0
baseSprintSpeed: 12.0 # ADT Tweak
- type: MeleeWeapon
damage:
groups:
Expand Down Expand Up @@ -362,7 +383,7 @@
- type: MobThresholds
thresholds:
0: Alive
50: Dead
80: Dead # ADT Tweak
- type: SlowOnDamage
speedModifierThresholds:
25: 0.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@
- type: Projectile
damage:
types:
Caustic: 5
Caustic: 12 # ADT Tweak
- type: Sprite
sprite: Objects/Weapons/Guns/Projectiles/xeno_toxic.rsi
layers:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "acid_turret",
"directions": 4,
Expand Down
Loading