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

Resomi #27

Merged
merged 15 commits into from
Nov 25, 2024
9 changes: 9 additions & 0 deletions Content.Server/Flash/FlashSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Robust.Shared.Audio;
using Robust.Shared.Random;
using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
using Content.Shared._CorvaxNext.Flash.Components; //CorvaxNext
pofitlo-Git marked this conversation as resolved.
Show resolved Hide resolved

namespace Content.Server.Flash
{
Expand Down Expand Up @@ -116,6 +117,14 @@ public void Flash(EntityUid target,
bool melee = false,
TimeSpan? stunDuration = null)
{
#region CorvaxNext
//CorvaxNext duration modifier for resomi
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
if (TryComp<FlashModifierComponent>(target, out var CompUser))
pofitlo-Git marked this conversation as resolved.
Show resolved Hide resolved
{
flashDuration *= CompUser.Modifier;
}
#endregion

var attempt = new FlashAttemptEvent(target, user, used);
RaiseLocalEvent(target, attempt, true);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Content.Shared.Alert;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Resomi.Abilities
pofitlo-Git marked this conversation as resolved.
Show resolved Hide resolved
{
[RegisterComponent]
public sealed partial class ResomiSkillComponent : Component
{
/// <summary>
/// Whether this component is active or not.
/// </summarY>
[DataField("enabled")]
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
public bool Enabled = true;

[DataField("invisibleWallAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
public string? InvisibleWallAction = "ActionMimeInvisibleWall";

[DataField("invisibleWallActionEntity")] public EntityUid? InvisibleWallActionEntity;
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved

// The vow zone lies below
public bool VowBroken = false;

public bool ReadyToRepent = false;

/// <summary>
/// Time when the mime can repent their vow
/// </summary>
[DataField("vowRepentTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
public TimeSpan VowRepentTime = TimeSpan.Zero;

/// <summary>
/// How long it takes the mime to get their powers back
/// </summary>
[DataField("vowCooldown")]
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
public TimeSpan VowCooldown = TimeSpan.FromMinutes(5);

[DataField]
public ProtoId<AlertPrototype> VowAlert = "VowOfSilence";

[DataField]
public ProtoId<AlertPrototype> VowBrokenAlert = "VowBroken";

[DataField("wallPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
AwareFoxy marked this conversation as resolved.
Show resolved Hide resolved
public string WallPrototype = "WallInvisible";

}
}
87 changes: 87 additions & 0 deletions Content.Server/_CorvaxNext/Resomi/Abilities/ResomiSkillSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using Content.Server.Popups;
using Content.Shared.Actions;
using Content.Shared.Actions.Events;
using Content.Shared.Alert;
using Content.Shared.Coordinates.Helpers;
using Content.Shared.Maps;
using Content.Shared.Mobs.Components;
using Content.Shared.Physics;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Timing;
using Content.Shared.Speech.Muting;
using Robust.Shared.Physics.Systems;

namespace Content.Server.Resomi.Abilities
pofitlo-Git marked this conversation as resolved.
Show resolved Hide resolved
{
public sealed class ResomiSkillSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly EntityLookupSystem _lookupSystem = default!;
[Dependency] private readonly TurfSystem _turf = default!;
[Dependency] private readonly IMapManager _mapMan = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly IGameTiming _timing = default!;

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

public override void Update(float frameTime)
{
base.Update(frameTime);
// Queue to track whether mimes can retake vows yet

var query = EntityQueryEnumerator<ResomiSkillComponent>();
while (query.MoveNext(out var uid, out var mime))
{
if (!mime.VowBroken || mime.ReadyToRepent)
continue;

if (_timing.CurTime < mime.VowRepentTime)
continue;

mime.ReadyToRepent = true;
_popupSystem.PopupEntity(Loc.GetString("mime-ready-to-repent"), uid, uid);
}
}

private void OnComponentInit(EntityUid uid, ResomiSkillComponent component, ComponentInit args)
{
EnsureComp<MutedComponent>(uid);
_alertsSystem.ShowAlert(uid, component.VowAlert);
_actionsSystem.AddAction(uid, ref component.InvisibleWallActionEntity, component.InvisibleWallAction, uid);
}

/// <summary>
/// Creates an invisible wall in a free space after some checks.
/// </summary>
private void OnInvisibleWall(EntityUid uid, ResomiSkillComponent component, InvisibleWallActionEvent args)
{
if (!component.Enabled)
return;

if (_container.IsEntityOrParentInContainer(uid))
return;

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

_popupSystem.PopupEntity(Loc.GetString("mime-invisible-wall-popup", ("mime", uid)), uid);
// Make sure we set the invisible wall to despawn properly
Spawn(component.WallPrototype, _turf.GetTileCenter(tile.Value));
// Handle args so cooldown works
args.Handled = true;
}
}
}
pofitlo-Git marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Content.Shared._CorvaxNext.Flash.Components;

[RegisterComponent]
public sealed partial class FlashModifierComponent : Component
{
[DataField]
public float Modifier = 1f;
}
2 changes: 2 additions & 0 deletions Resources/Audio/_CorvaxNext/Voice/Resomi/attritbutions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- files: [resomi_scream.ogg]
copyright: '"'
Binary file not shown.
18 changes: 18 additions & 0 deletions Resources/Locale/ru-RU/_CorvaxNext/accessories/resomi-hair.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
marking-HairResomiBackstrafe = Резоми Завихренья
marking-HairResomiBurstShort = Резоми Всклокоченные короткие
marking-HairResomiDefault = Резоми Обычные
marking-HairResomiDroopy = Резоми Обвисшие
marking-HairResomiEars = Резоми Уши
marking-HairResomiFluffymohawk = Резоми Пушистый ирокез
marking-HairResomiHedge = Резоми Плетень
marking-HairResomiLongway = Резоми Коса
marking-HairResomiMane = Резоми Грива
marking-HairResomiManeBeardless = Резоми Грива (без бороды)
marking-HairResomiMohawk = Резоми Ирокез
marking-HairResomiMushroom = Резоми Грибная
marking-HairResomiNotree = Резоми Благородная
marking-HairResomiSpiky = Резоми Колючая
marking-HairResomiPointy = Резоми Заостренный
marking-HairResomiTwies = Резоми Двойная
marking-HairResomiUpright = Резоми Ровная
marking-HairResomiLong = Резоми Длинная
29 changes: 29 additions & 0 deletions Resources/Locale/ru-RU/_CorvaxNext/markings/resomi.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
marking-ResomiTail = Резоми Хвост
marking-ResomiTail-tail = Резоми Хвост

marking-ResomiTailFeathers = Хвостовое оперенье
marking-ResomiTailFeathers-tail_feathers = Хвостовое оперенье

marking-ResomiLArmFeathers = Резоми Оперение левой руки
marking-ResomiLArmFeathers-l_hand_feathers = Резоми Оперение левой руки

marking-ResomiLLegFeathers = Резоми Оперение левой ноги
marking-ResomiLLegFeathers-l_foot_feathers = Резоми Оперение левой ноги

marking-ResomiRArmFeathers = Резоми Оперение правой руки
marking-ResomiRArmFeathers-r_hand_feathers = Резоми Оперение правой руки

marking-ResomiRLegFeathers = Резоми Оперение правой ноги
marking-ResomiRLegFeathers-r_foot_feathers = Резоми Оперение правой ноги

marking-ResomiFluff = Резоми Пух тела
marking-ResomiFluff-fluff = Резоми Пух тела

marking-ResomiFluffHead = Резоми Пух на голове
marking-ResomiFluffHead-fluff_head = Резоми Пух на голове


marking-ResomiFluffHeadUp = Резоми Пух на голове (верхний)
marking-ResomiFluffHeadUp-fluff_head_up = Резоми Пух на голове(верхний)


2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/species/species.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ species-name-moth = Ниан
species-name-skeleton = Скелет
species-name-vox = Вокс
snail-hurt-by-salt-popup = Солевой раствор жжёт как кислота!
#CorvaxNext
species-name-resomi = Резоми
pofitlo-Git marked this conversation as resolved.
Show resolved Hide resolved
118 changes: 118 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Body/Parts/resomi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
- type: entity
id: PartResomi
parent: [BaseItem, BasePart]
name: "resomi body part"
abstract: true
components:
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fat
Quantity: 3
- ReagentId: Blood
Quantity: 10

- type: entity
id: TorsoResomi
name: "resomi torso"
parent: [PartHuman, BaseTorso]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "torso_m"
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fat
Quantity: 10
- ReagentId: Blood
Quantity: 20


- type: entity
id: HeadResomi
name: "resomi head"
parent: [PartHuman, BaseHead]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "head_m"
- type: Extractable
juiceSolution:
reagents:
- ReagentId: Fat
Quantity: 5
- ReagentId: Blood
Quantity: 10

- type: entity
id: LeftArmResomi
name: "left resomi arm"
parent: [PartHuman, BaseLeftArm]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "l_arm"

- type: entity
id: RightArmResomi
name: "right resomi arm"
parent: [PartHuman, BaseRightArm]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "r_arm"

- type: entity
id: LeftHandResomi
name: "left resomi hand"
parent: [PartHuman, BaseLeftHand]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "l_hand"

- type: entity
id: RightHandResomi
name: "right resomi hand"
parent: [PartHuman, BaseRightHand]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "r_hand"

- type: entity
id: LeftLegResomi
name: "left resomi leg"
parent: [PartHuman, BaseLeftLeg]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "l_leg"

- type: entity
id: RightLegResomi
name: "right resomi leg"
parent: [PartHuman, BaseRightLeg]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "r_leg"

- type: entity
id: LeftFootResomi
name: "left resomi foot"
parent: [PartHuman, BaseLeftFoot]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "l_foot"

- type: entity
id: RightFootResomi
name: "right resomi foot"
parent: [PartHuman, BaseRightFoot]
components:
- type: Sprite
sprite: _CorvaxNext/Mobs/Species/Resomi/parts.rsi
state: "r_foot"
49 changes: 49 additions & 0 deletions Resources/Prototypes/_CorvaxNext/Body/Prototypes/resomi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
- type: body
id: Resomi
name: "resomi"
root: torso
slots:
head:
part: HeadResomi
connections:
- torso
organs:
brain: OrganHumanBrain
eyes: OrganHumanEyes
torso:
part: TorsoResomi
connections:
- right_arm
- left_arm
- right_leg
- left_leg
organs:
heart: OrganHumanHeart
lungs: OrganHumanLungs
stomach: OrganHumanStomach
liver: OrganHumanLiver
kidneys: OrganHumanKidneys
right_arm:
part: RightArmResomi
connections:
- right_hand
left_arm:
part: LeftArmResomi
connections:
- left_hand
right_hand:
part: RightHandResomi
left_hand:
part: LeftHandResomi
right_leg:
part: RightLegResomi
connections:
- right_foot
left_leg:
part: LeftLegResomi
connections:
- left_foot
right_foot:
part: RightFootResomi
left_foot:
part: LeftFootResomi
Loading
Loading