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

Specie update #524

Merged
merged 37 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
cd18b7f
Vulps
FoxxoTrystan Oct 19, 2023
097541d
Vulpkanins
FoxxoTrystan Oct 19, 2023
3914644
Reptilians
FoxxoTrystan Oct 19, 2023
9a6e337
Diona war against the glass shard is done!
FoxxoTrystan Oct 21, 2023
6873db0
Felinds
FoxxoTrystan Oct 22, 2023
d4ab07d
Moth
FoxxoTrystan Oct 22, 2023
d2ed8e2
Diona Final
FoxxoTrystan Oct 22, 2023
c64198e
Oni
FoxxoTrystan Oct 22, 2023
4453170
Update FelinidSystem.cs
FoxxoTrystan Oct 24, 2023
065f793
Spooders Abilities.
FoxxoTrystan Oct 28, 2023
9560fb7
Sooder progress
FoxxoTrystan Oct 30, 2023
a2d0cfb
More Spooder progress!
FoxxoTrystan Nov 1, 2023
dbbed50
Spooders can bite!
FoxxoTrystan Nov 1, 2023
8dcdff1
Spooder Cocoon
FoxxoTrystan Nov 1, 2023
47bb7a2
Fixes
FoxxoTrystan Nov 1, 2023
e331538
Compleatly finished spooders
FoxxoTrystan Nov 2, 2023
7566161
Dog Screams
FoxxoTrystan Nov 2, 2023
98d59aa
Spooder data
FoxxoTrystan Nov 2, 2023
2e011ce
Merge remote-tracking branch 'upstream/master' into Specie-update
FoxxoTrystan Nov 3, 2023
93b0cd1
Update with Master.
FoxxoTrystan Nov 3, 2023
426fb18
Revert "Update with Master."
FoxxoTrystan Nov 3, 2023
573c12e
Size Progress!
FoxxoTrystan Nov 3, 2023
19bb428
Bags
FoxxoTrystan Nov 5, 2023
f147ed2
Values
FoxxoTrystan Nov 5, 2023
5ff4f06
Update felinid.yml
FoxxoTrystan Nov 5, 2023
b8dad76
Food
FoxxoTrystan Nov 12, 2023
5aeeb1c
Merge remote-tracking branch 'upstream/master' into Specie-update
FoxxoTrystan Nov 12, 2023
4564ef5
Final Snack
FoxxoTrystan Nov 13, 2023
83b3bca
Finals
FoxxoTrystan Nov 13, 2023
d49aada
RSI Oopsies
FoxxoTrystan Nov 13, 2023
f34f33a
Update vulpkanin.yml
FoxxoTrystan Nov 13, 2023
e219399
Linder Happy
FoxxoTrystan Nov 13, 2023
c0a062f
Update vulpkanin.yml
FoxxoTrystan Nov 13, 2023
c5abc7e
Update sizeattribute.yml
FoxxoTrystan Nov 13, 2023
3ea5587
Remove Custom Reptilian Lungs
FoxxoTrystan Nov 28, 2023
b188d2f
Update misc.yml
FoxxoTrystan Nov 28, 2023
f53fc31
Merge remote-tracking branch 'upstream/master' into Specie-update
FoxxoTrystan Nov 28, 2023
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
12 changes: 12 additions & 0 deletions Content.Server/Atmos/Miasma/RottingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Robust.Server.GameObjects;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;
using Content.Shared.Cuffs.Components;

namespace Content.Server.Atmos.Miasma;

Expand Down Expand Up @@ -98,6 +99,17 @@ public bool IsRotProgressing(EntityUid uid, PerishableComponent? perishable)
return false;
}

if (TryComp<CuffableComponent>(uid, out var cuffed) && cuffed.CuffedHandCount > 0)
{
if (TryComp<HandcuffComponent>(cuffed.LastAddedCuffs, out var cuffcomp))
{
if (cuffcomp.NoRot)
{
return false;
}
}
}

var ev = new IsRottingEvent();
RaiseLocalEvent(uid, ref ev);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Content.Shared.Item;
using Content.Shared.Inventory;
using Content.Shared.Hands;
using Content.Shared.Actions;
using Content.Shared.IdentityManagement;
using Content.Server.Body.Components;
using Content.Server.Medical;
Expand Down Expand Up @@ -41,7 +40,7 @@ public override void Initialize()
SubscribeLocalEvent<FelinidComponent, HairballActionEvent>(OnHairball);
SubscribeLocalEvent<FelinidComponent, EatMouseActionEvent>(OnEatMouse);
SubscribeLocalEvent<FelinidComponent, DidEquipHandEvent>(OnEquipped);
SubscribeLocalEvent<FelinidComponent,DidUnequipHandEvent>(OnUnequipped);
SubscribeLocalEvent<FelinidComponent, DidUnequipHandEvent>(OnUnequipped);
SubscribeLocalEvent<HairballComponent, ThrowDoHitEvent>(OnHairballHit);
SubscribeLocalEvent<HairballComponent, GettingPickedUpAttemptEvent>(OnHairballPickupAttempt);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Nyanotrasen/Abilities/Oni/OniComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ public sealed partial class OniComponent : Component
public DamageModifierSet MeleeModifiers = default!;

[DataField("stamDamageBonus")]
public float StamDamageMultiplier = 1.25f;
public float StamDamageMultiplier = 1.20f;
}
}
17 changes: 6 additions & 11 deletions Content.Server/Nyanotrasen/Abilities/Oni/OniSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,22 @@ private void OnEntInserted(EntityUid uid, OniComponent component, EntInsertedInt
var heldComp = EnsureComp<HeldByOniComponent>(args.Entity);
heldComp.Holder = uid;

if (TryComp<ToolComponent>(args.Entity, out var tool) && _toolSystem.HasQuality(args.Entity, "Prying", tool))
tool.SpeedModifier *= 1.66f;

if (TryComp<GunComponent>(args.Entity, out var gun))
{
gun.MinAngle *= 15f;
gun.AngleIncrease *= 15f;
gun.MaxAngle *= 15f;
gun.MinAngle *= 20f;
gun.AngleIncrease *= 20f;
gun.MaxAngle *= 20f;
}
}

private void OnEntRemoved(EntityUid uid, OniComponent component, EntRemovedFromContainerMessage args)
{
if (TryComp<ToolComponent>(args.Entity, out var tool) && _toolSystem.HasQuality(args.Entity, "Prying", tool))
tool.SpeedModifier /= 1.66f;

if (TryComp<GunComponent>(args.Entity, out var gun))
{
gun.MinAngle /= 15f;
gun.AngleIncrease /= 15f;
gun.MaxAngle /= 15f;
gun.MinAngle /= 20f;
gun.AngleIncrease /= 20f;
gun.MaxAngle /= 20f;
}

RemComp<HeldByOniComponent>(args.Entity);
Expand Down
24 changes: 11 additions & 13 deletions Content.Server/Spider/SpiderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
using Content.Shared.Maps;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Nutrition.Components;

namespace Content.Server.Spider;

public sealed class SpiderSystem : SharedSpiderSystem
{
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly HungerSystem _hungerSystem = default!;

public override void Initialize()
{
Expand All @@ -22,6 +25,13 @@ private void OnSpawnNet(EntityUid uid, SpiderComponent component, SpiderWebActio
if (args.Handled)
return;

if (TryComp<HungerComponent>(uid, out var hungerComp)
&& _hungerSystem.IsHungerBelowState(uid, HungerThreshold.Okay, hungerComp.CurrentHunger - 5, hungerComp))
{
_popup.PopupEntity(Loc.GetString("sericulture-failure-hunger"), args.Performer, args.Performer);
return;
}

var transform = Transform(uid);

if (transform.GridUid == null)
Expand All @@ -42,22 +52,10 @@ private void OnSpawnNet(EntityUid uid, SpiderComponent component, SpiderWebActio
result = true;
}

// Spawn web in other directions
for (var i = 0; i < 4; i++)
{
var direction = (DirectionFlag) (1 << i);
coords = transform.Coordinates.Offset(direction.AsDir().ToVec());

if (!IsTileBlockedByWeb(coords))
{
Spawn(component.WebPrototype, coords);
result = true;
}
}

if (result)
{
_popup.PopupEntity(Loc.GetString("spider-web-action-success"), args.Performer, args.Performer);
_hungerSystem.ModifyHunger(uid, -5);
args.Handled = true;
}
else
Expand Down
7 changes: 7 additions & 0 deletions Content.Server/_NF/ArachnidChaos/ArachnidChaosComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

namespace Content.Server.ArachnidChaos
{
[RegisterComponent]
public sealed partial class ArachnidChaosComponent : Component
{}
}
139 changes: 139 additions & 0 deletions Content.Server/_NF/ArachnidChaos/ArachnidChaosSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
using Content.Server.Administration.Logs;
using Content.Shared.Verbs;
using Content.Shared.DoAfter;
using Content.Shared.Popups;
using Content.Shared.Inventory;
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Robust.Shared.Audio;
using Content.Shared.Audio;
using Content.Server.Body.Components;
using Content.Shared.ArachnidChaos;
using Content.Server.Nutrition.EntitySystems;
using Robust.Shared.Player;
using Content.Shared.Mobs.Systems;
using Content.Server.Body.Systems;
using Content.Shared.Database;
using Robust.Shared.Utility;

namespace Content.Server.ArachnidChaos
{
public sealed class ArachnidChaosSystem : EntitySystem
{
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ArachnidChaosComponent, GetVerbsEvent<InnateVerb>>(AddBiteVerb);
SubscribeLocalEvent<ArachnidChaosComponent, ArachnidChaosDoAfterEvent>(OnDoAfter);
}
private void AddBiteVerb(EntityUid uid, ArachnidChaosComponent component, GetVerbsEvent<InnateVerb> args)
{
if (!args.CanInteract || !args.CanAccess)
return;

if (!_mobStateSystem.IsAlive(args.User))
return;

if (args.User == args.Target)
return;

if (!TryComp<BloodstreamComponent>(args.Target, out var bloodstream))
return;

InnateVerb verb = new()
{
Act = () =>
{
if (!IsActionValid(args.User, args.Target))
return;

_popupSystem.PopupEntity(Loc.GetString("spider-biting", ("UsernameName", args.User), ("targetName", args.Target)), args.User);
_popupSystem.PopupEntity(Loc.GetString("spider-biting"), args.User, args.User);

var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, 3f, new ArachnidChaosDoAfterEvent(), uid, target: args.Target, used: uid)
{
BreakOnTargetMove = true,
BreakOnUserMove = true,
BreakOnDamage = true,
BlockDuplicate = true
};

_doAfter.TryStartDoAfter(doAfterEventArgs);
},
Icon = new SpriteSpecifier.Rsi(new ("Nyanotrasen/Icons/verbiconfangs.rsi"), "icon"),
Text = Loc.GetString("action-name-spider-bite"),
Priority = 2
};
args.Verbs.Add(verb);
}
private void OnDoAfter(EntityUid uid, ArachnidChaosComponent comp, DoAfterEvent args)
{
if (args.Cancelled || args.Handled || args.Args.Target == null)
return;

if (!IsActionValid(args.Args.User, args.Args.Target.Value))
return;

if (!TryComp<HungerComponent>(args.Args.User, out var hunger))
return;

if (!TryComp<BloodstreamComponent>(args.Args.Target.Value, out var bloodstream))
return;

_bloodstreamSystem.TryModifyBloodLevel(args.Args.Target.Value, -5, bloodstream);
SoundSystem.Play("/Audio/Items/drink.ogg", Filter.Pvs(args.Args.User), args.Args.User, AudioHelpers.WithVariation(0.15f));
_hunger.ModifyHunger(args.Args.User, 5, hunger);

_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.Args.User):actor} drank blood from {ToPrettyString(args.Args.Target.Value):actor}");

args.Repeat = true;
}

private bool IsActionValid(EntityUid user, EntityUid target)
{
if (!TryComp<BloodstreamComponent>(target, out var bloodstream))
return false;

if (bloodstream.BloodReagent == "Blood")
{
if (_bloodstreamSystem.GetBloodLevelPercentage(target, bloodstream) <= 0.0f)
{
_popupSystem.PopupEntity(Loc.GetString("no-blood-warning"), user, user, Shared.Popups.PopupType.SmallCaution);
return false;
}
}
else
{
_popupSystem.PopupEntity(Loc.GetString("no-good-blood"), user, user, Shared.Popups.PopupType.SmallCaution);
return false;
}

if (!TryComp<HungerComponent>(user, out var hunger))
return false;

if (hunger.CurrentThreshold == Shared.Nutrition.Components.HungerThreshold.Overfed)
{
_popupSystem.PopupEntity(Loc.GetString("food-system-you-cannot-eat-any-more"), user, user, Shared.Popups.PopupType.SmallCaution);
return false;
}

if (_inventorySystem.TryGetSlotEntity(user, "mask", out var maskUid) &&
EntityManager.TryGetComponent<IngestionBlockerComponent>(maskUid, out var blocker) &&
blocker.Enabled)
{
_popupSystem.PopupEntity(Loc.GetString("hairball-mask", ("mask", maskUid)), user, user, Shared.Popups.PopupType.SmallCaution);
return false;
}

return true;
}
}
}
13 changes: 13 additions & 0 deletions Content.Server/_NF/SizeAttribute/SizeAttributeComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

namespace Content.Server.SizeAttribute
{
[RegisterComponent]
public sealed partial class SizeAttributeComponent : Component
{
[DataField("short")]
public bool Short = false;

[DataField("tall")]
public bool Tall = false;
}
}
91 changes: 91 additions & 0 deletions Content.Server/_NF/SizeAttribute/SizeAttributeSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using System.Numerics;
using Robust.Server.GameObjects;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Systems;
using Content.Server.Item.PseudoItem;

namespace Content.Server.SizeAttribute
{
public sealed class SizeAttributeSystem : EntitySystem
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly AppearanceSystem _appearance = default!;
[Dependency] private readonly FixtureSystem _fixtures = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SizeAttributeComponent, ComponentInit>(OnComponentInit);
}

private void OnComponentInit(EntityUid uid, SizeAttributeComponent component, ComponentInit args)
{
if (!TryComp<SizeAttributeWhitelistComponent>(uid, out var whitelist))
return;

if (whitelist.Tall && component.Tall)
{
Scale(uid, component, whitelist.TallScale, whitelist.TallDensity);
PseudoItem(uid, component, whitelist.TallPseudoItem);
}
else if (whitelist.Short && component.Short)
{
Scale(uid, component, whitelist.ShortScale, whitelist.ShortDensity);
PseudoItem(uid, component, whitelist.ShortPseudoItem);
}
}

private void PseudoItem(EntityUid uid, SizeAttributeComponent component, bool active)
{
if (active)
{
if (TryComp<PseudoItemComponent>(uid, out var pseudoI))
return;

_entityManager.AddComponent<PseudoItemComponent>(uid);
}
else
{
if (!TryComp<PseudoItemComponent>(uid, out var pseudoI))
return;

_entityManager.RemoveComponent<PseudoItemComponent>(uid);
}
}

private void Scale(EntityUid uid, SizeAttributeComponent component, float scale, float density)
{
if (scale <= 0f && density <= 0f)
return;

_entityManager.EnsureComponent<ScaleVisualsComponent>(uid);

var appearanceComponent = _entityManager.EnsureComponent<AppearanceComponent>(uid);
if (!_appearance.TryGetData<Vector2>(uid, ScaleVisuals.Scale, out var oldScale, appearanceComponent))
oldScale = Vector2.One;

_appearance.SetData(uid, ScaleVisuals.Scale, oldScale * scale, appearanceComponent);

if (_entityManager.TryGetComponent(uid, out FixturesComponent? manager))
{
foreach (var (id, fixture) in manager.Fixtures)
{
switch (fixture.Shape)
{
case PhysShapeCircle circle:
_physics.SetPositionRadius(uid, id, fixture, circle, circle.Position * scale, circle.Radius * scale, manager);
break;
default:
throw new NotImplementedException();
}

_physics.SetDensity(uid, id, fixture, density);
}
}
}
}

[ByRefEvent]
public readonly record struct ScaleEntityEvent(EntityUid Uid) { }
}
Loading
Loading