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

Upstream Merge 6/7/2024 #20

Merged
merged 52 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
5b8d8bd
Sleep deprived coding
VMSolidus May 5, 2024
c964f91
guhh
VMSolidus May 5, 2024
84afa69
updating mimic rule
VMSolidus May 8, 2024
7126614
update mimic spawns
VMSolidus May 8, 2024
dcbb94d
Guh
VMSolidus May 11, 2024
3a1bf4a
Update submarine
VMSolidus May 11, 2024
f293866
rsi validator
VMSolidus May 11, 2024
2291292
Revert "rsi validator"
VMSolidus May 11, 2024
e5b5765
guhhhhh
VMSolidus May 11, 2024
bbc73ed
Update vending_machines.yml
VMSolidus May 11, 2024
9e6c56c
Update vending_machines.yml
VMSolidus May 11, 2024
35204d3
Update vending_machines.yml
VMSolidus May 11, 2024
e1e7d1f
Update vending_machines.yml
VMSolidus May 11, 2024
bcbe1ad
Update vending_machines.yml
VMSolidus May 11, 2024
7f1f618
Update vending_machines.yml
VMSolidus May 11, 2024
7fdfea5
found it
VMSolidus May 12, 2024
01186cf
Fuck the test
VMSolidus May 12, 2024
8455835
Update bay12barbershop.yml
VMSolidus May 12, 2024
f9c509a
Update vending_machines.yml
VMSolidus May 12, 2024
6458ed0
more point lights
VMSolidus May 12, 2024
1d2bd21
More work on shader
VMSolidus May 12, 2024
1925472
update cola and coffee
VMSolidus May 14, 2024
f27b719
engivend done
VMSolidus May 14, 2024
e8fc219
Chunk of sprites adjusted. Some may be slightly misaligned :)
Pspritechologist May 14, 2024
d5afb68
Merge branch 'master' into Vendors
VMSolidus May 30, 2024
0f4cecf
wallmed done
VMSolidus May 30, 2024
9122ae1
guh
VMSolidus May 30, 2024
65a58f4
FINALLY DONE
VMSolidus May 30, 2024
386057a
Merge branch 'master' into FIX-MIMICS
VMSolidus May 31, 2024
8033d02
Merge branch 'master' into Additional-Loadout-Items
DangerRevolution May 31, 2024
770a2b0
YE
VMSolidus May 31, 2024
0edd396
Merge branch 'master' into Additional-Loadout-Items
VMSolidus Jun 3, 2024
8375afc
Update ciggy discreption
VMSolidus Jun 3, 2024
6ca58bf
Update packs.yml
VMSolidus Jun 3, 2024
f24dcfe
Update outerClothing.yml
VMSolidus Jun 3, 2024
c588ac5
update categories
VMSolidus Jun 3, 2024
c68218b
Add bluesec and reorganize security
VMSolidus Jun 3, 2024
11c49a0
Adding prescription glasses
VMSolidus Jun 3, 2024
0c0cc24
Update medical.yml
VMSolidus Jun 3, 2024
d573549
Apply suggestions from code review
VMSolidus Jun 8, 2024
68461a6
Update MobReplacementRuleSystem.cs
VMSolidus Jun 8, 2024
b2f4da6
Update MobReplacementRuleSystem.cs
VMSolidus Jun 8, 2024
f5bfb93
Merge remote-tracking branch 'EE-Personal/FIX-MIMICS' into Sekrit-stuff
VMSolidus Jun 8, 2024
8763409
Merge remote-tracking branch 'EE-Personal/Additional-Loadout-Items' i…
VMSolidus Jun 8, 2024
36d7208
Merge remote-tracking branch 'EE-Personal/Harpy-Markings-Wave-2' into…
VMSolidus Jun 8, 2024
862b26c
Merge remote-tracking branch 'EE-Personal/Vendors' into Sekrit-stuff
VMSolidus Jun 8, 2024
ce16969
Update fitness.yml
VMSolidus Jun 8, 2024
6ed6530
Update barbershop.yml
VMSolidus Jun 8, 2024
6972cd1
Update drinks-cartons.yml
VMSolidus Jun 8, 2024
b39282c
aaaaaaaaaaaaaaaaaa
VMSolidus Jun 8, 2024
62f6090
MORE OF THESE? They're being upstreamed by the way
VMSolidus Jun 8, 2024
1b8d149
Update drinks.yml
VMSolidus Jun 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 3 additions & 5 deletions Content.Server/Advertise/AdvertiseComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@

namespace Content.Server.Advertise
{
[RegisterComponent, Access(typeof(AdvertiseSystem))]
[RegisterComponent]
public sealed partial class AdvertiseComponent : Component
{
/// <summary>
/// Minimum time in seconds to wait before saying a new ad, in seconds. Has to be larger than or equal to 1.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("minWait")]
public int MinimumWait { get; private set; } = 8 * 60;
public int MinimumWait = 8 * 60;

/// <summary>
/// Maximum time in seconds to wait before saying a new ad, in seconds. Has to be larger than or equal
/// to <see cref="MinimumWait"/>
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxWait")]
public int MaximumWait { get; private set; } = 10 * 60;
public int MaximumWait = 10 * 60;

/// <summary>
/// The identifier for the advertisements pack prototype.
Expand Down
24 changes: 24 additions & 0 deletions Content.Server/Antag/Mimic/MobReplacementRuleComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,33 @@ public sealed partial class MobReplacementRuleComponent : Component
[DataField]
public EntProtoId Proto = "MobMimic";

[DataField]
public int NumberToReplace { get; set; }

[DataField]
public string Announcement = "station-event-rampant-intelligence-announcement";

/// <summary>
/// Chance per-entity.
/// </summary>
[DataField]
public float Chance = 0.001f;

[DataField]
public bool DoAnnouncement = true;

[DataField]
public float MimicMeleeDamage = 20f;

[DataField]
public float MimicMoveSpeed = 1f;

[DataField]
public string MimicAIType = "SimpleHostileCompound";

[DataField]
public bool MimicSmashGlass = true;

[DataField]
public bool VendorModify = true;
}
145 changes: 140 additions & 5 deletions Content.Server/Antag/MobReplacementRuleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,172 @@
using System.Numerics;
using Content.Server.Antag.Mimic;
using Content.Server.Chat.Systems;
using Content.Server.GameTicking.Rules;
using Content.Server.GameTicking.Rules.Components;
using Content.Server.NPC.Systems;
using Content.Server.Station.Systems;
using Content.Server.GameTicking;
using Content.Shared.VendingMachines;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Server.GameObjects;
using Robust.Shared.Physics.Systems;
using System.Linq;
using Robust.Shared.Physics;
using Content.Shared.Movement.Components;
using Content.Shared.Damage;
using Content.Server.NPC.HTN;
using Content.Server.NPC;
using Content.Shared.Weapons.Melee;
using Content.Server.Advertise;
using Content.Server.Power.Components;
using Content.Shared.CombatMode;

namespace Content.Server.Antag;

public sealed class MobReplacementRuleSystem : GameRuleSystem<MobReplacementRuleComponent>
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly NpcFactionSystem _npcFaction = default!;
[Dependency] private readonly NPCSystem _npc = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly AdvertiseSystem _advertise = default!;


protected override void Started(EntityUid uid, MobReplacementRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, component, gameRule, args);

var query = AllEntityQuery<VendingMachineComponent, TransformComponent>();
var spawns = new List<(EntityUid Entity, EntityCoordinates Coordinates)>();
var stations = _gameTicker.GetSpawnableStations();

while (query.MoveNext(out var vendingUid, out _, out var xform))
{
if (!_random.Prob(component.Chance))
var ownerStation = _station.GetOwningStation(vendingUid);

if (ownerStation == null
|| ownerStation != stations[0])
continue;

// Make sure that we aren't running this on something that is already a mimic
if (HasComp<CombatModeComponent>(vendingUid))
continue;

spawns.Add((vendingUid, xform.Coordinates));
}

foreach (var entity in spawns)
if (spawns == null)
{
var coordinates = entity.Coordinates;
Del(entity.Entity);
//WTF THE STATION DOESN'T EXIST! WE MUST BE IN A TEST! QUICK, PUT A MIMIC AT 0,0!!!
Spawn(component.Proto, new EntityCoordinates(uid, new Vector2(0, 0)));
}
else
{
// This is intentionally not clamped. If a server host wants to replace every vending machine in the entire station with a mimic, who am I to stop them?
var k = MathF.MaxMagnitude(component.NumberToReplace, 1);
while (k > 0 && spawns != null)
{
var spawnLocation = _random.PickAndTake(spawns);
BuildAMimicWorkshop(spawnLocation.Entity, component);

if (k == MathF.MaxMagnitude(component.NumberToReplace, 1)
&& component.DoAnnouncement)
_chat.DispatchStationAnnouncement(stations[0], Loc.GetString("station-event-rampant-intelligence-announcement"), playDefaultSound: true,
colorOverride: Color.Red, sender: "Central Command");

k--;
}
}
}

/// <summary>
/// It's like Build a Bear, but MURDER
/// </summary>
/// <param name="uid"></param>
public void BuildAMimicWorkshop(EntityUid uid, MobReplacementRuleComponent component)
{
var metaData = MetaData(uid);
var vendorPrototype = metaData.EntityPrototype;
var mimicProto = _prototype.Index<EntityPrototype>(component.Proto);

var vendorComponents = vendorPrototype?.Components.Keys
.Where(n => n != "Transform" && n != "MetaData")
.Select(name => (name, _componentFactory.GetRegistration(name).Type))
.ToList() ?? new List<(string name, Type type)>();

var mimicComponents = mimicProto?.Components.Keys
.Where(n => n != "Transform" && n != "MetaData")
.Select(name => (name, _componentFactory.GetRegistration(name).Type))
.ToList() ?? new List<(string name, Type type)>();

Spawn(component.Proto, coordinates);
foreach (var name in mimicComponents.Except(vendorComponents))
{
var newComponent = _componentFactory.GetComponent(name.name);
EntityManager.AddComponent(uid, newComponent);
}

var xform = Transform(uid);
if (xform.Anchored)
_transform.Unanchor(uid, xform);

SetupMimicNPC(uid, component);

if (TryComp<AdvertiseComponent>(uid, out var vendor)
&& component.VendorModify)
SetupMimicVendor(uid, component, vendor);
}
/// <summary>
/// This handles getting the entity ready to be a hostile NPC
/// </summary>
/// <param name="uid"></param>
/// <param name="component"></param>
private void SetupMimicNPC(EntityUid uid, MobReplacementRuleComponent component)
{
_physics.SetBodyType(uid, BodyType.KinematicController);
_npcFaction.AddFaction(uid, "SimpleHostile");

var melee = EnsureComp<MeleeWeaponComponent>(uid);
melee.Angle = 0;
DamageSpecifier dspec = new()
{
DamageDict = new()
{
{ "Blunt", component.MimicMeleeDamage }
}
};
melee.Damage = dspec;

var movementSpeed = EnsureComp<MovementSpeedModifierComponent>(uid);
(movementSpeed.BaseSprintSpeed, movementSpeed.BaseWalkSpeed) = (component.MimicMoveSpeed, component.MimicMoveSpeed);

var htn = EnsureComp<HTNComponent>(uid);
htn.RootTask = new HTNCompoundTask() { Task = component.MimicAIType };
htn.Blackboard.SetValue(NPCBlackboard.NavSmash, component.MimicSmashGlass);
_npc.WakeNPC(uid, htn);
}

/// <summary>
/// Handling specific interactions with vending machines
/// </summary>
/// <param name="uid"></param>
/// <param name="mimicComponent"></param>
/// <param name="vendorComponent"></param>
private void SetupMimicVendor(EntityUid uid, MobReplacementRuleComponent mimicComponent, AdvertiseComponent vendorComponent)
{
vendorComponent.MinimumWait = 5;
vendorComponent.MaximumWait = 15;
_advertise.SayAdvertisement(uid, vendorComponent);
_advertise.RefreshTimer(uid, vendorComponent);

if (TryComp<ApcPowerReceiverComponent>(uid, out var aPC))
aPC.NeedsPower = false;
}
}
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/GameTicker.Spawning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public sealed partial class GameTicker
// Mainly to avoid allocations.
private readonly List<EntityCoordinates> _possiblePositions = new();

private List<EntityUid> GetSpawnableStations()
public List<EntityUid> GetSpawnableStations()
{
var spawnableStations = new List<EntityUid>();
var query = EntityQueryEnumerator<StationJobsComponent, StationSpawningComponent>();
Expand Down
23 changes: 23 additions & 0 deletions Resources/Locale/en-US/advertisements/vending/bay12Vendors.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
advertisement-solsnack-1 = We cut all the red-tape so that you can have diarrhea!
advertisement-solsnack-2 = Food safety standards are merely a suggestion if you know the right people!
advertisement-solsnack-3 = Snacks from home, corruption included!
advertisement-solsnack-4 = A taste of home!

advertisement-weebvend-1 = Konnichiwa gaijin senpai!
advertisement-weebvend-2 = Notice me senpai!
advertisement-weebvend-3 = Kawaii-desu!

advertisement-hotfood-1 = Get your stale, crumbling food here! Sol's national dish has never tasted better!
advertisement-hotfood-2 = If this is the food waiting for you at home, it's no wonder you're hiding here.
advertisement-hotfood-3 = Solarian food products, served with a side of diarrhea as always!
advertisement-hotfood-4 = Revenge is a dish best served warm.

advertisement-fitness-1 = SweatMAX, get robust!
advertisement-fitness-2 = Pain is just weakness leaving the body!
advertisement-fitness-3 = Run! Your fat is catching up to you!
advertisement-fitness-4 = Never forget leg day!
advertisement-fitness-5 = Push out!
advertisement-fitness-6 = This is the only break you get today.
advertisement-fitness-7 = Don't cry, sweat!
advertisement-fitness-8 = Healthy is an outfit that looks good on everybody.
advertisement-fitness-9 = Want to hide from the Solarian authorities? Don't worry, they don't know what the inside of a gym looks like.
4 changes: 4 additions & 0 deletions Resources/Locale/en-US/deltav/markings/harpy.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ marking-HarpyTailRooster-rooster_tail = Tail
marking-HarpyTailFinch = Finch Tail
marking-HarpyTailFinch-finch_tail = Tail

marking-HarpyTailPeacock = Peacock Tail
marking-HarpyTailPeacock-peacock_tail_feathers = Feathers
marking-HarpyTailPeacock-peacock_tail_eyes = Eyes

marking-HarpyChestDefault = Wing & Groin Under-Clothes
marking-HarpyChestDefault-upper = Wing Under-Clothes
marking-HarpyChestDefault-lower = Groin Under-Clothes
Expand Down
6 changes: 6 additions & 0 deletions Resources/Locale/en-US/loadouts/categories.ftl
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Alphabetically ordered
loadout-category-Accessories = Accessories
loadout-category-Eyes = Eyes
loadout-category-Hands = Hands
loadout-category-Head = Head
loadout-category-Items = Items
loadout-category-Jobs = Jobs
loadout-category-Mask = Mask
loadout-category-Neck = Neck
loadout-category-Outer = Outer
loadout-category-Shoes = Shoes
loadout-category-Species = Species
loadout-category-Uncategorized = Uncategorized
loadout-category-Uniform = Uniform
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/reagents/bay12reagents.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
reagent-name-milk-choco = chocolate milk
reagent-desc-milk-choco = A milk drink flavored with chocolate.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
station-event-rampant-intelligence-announcement = Rampant brand intelligence has been detected board your station. Please inspect any vendors for aggressive marketing tactics, and reboot them if necessary.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- type: advertisementsPack
id: FitnessVendAds
advertisements:
- advertisement-fitness-1
- advertisement-fitness-2
- advertisement-fitness-3
- advertisement-fitness-4
- advertisement-fitness-5
- advertisement-fitness-6
- advertisement-fitness-7
- advertisement-fitness-8
- advertisement-fitness-9
thankyous:
- vending-machine-thanks
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- type: advertisementsPack
id: HotfoodAds
advertisements:
- advertisement-hotfood-1
- advertisement-hotfood-2
- advertisement-hotfood-3
- advertisement-hotfood-4
thankyous:
- vending-machine-thanks
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: advertisementsPack
id: SolsnackAds
advertisements:
- advertisement-solsnack-1
- advertisement-solsnack-2
- advertisement-solsnack-3
thankyous:
- vending-machine-thanks
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: advertisementsPack
id: WeebVendAds
advertisements:
- advertisement-weebvend-1
- advertisement-weebvend-2
- advertisement-weebvend-3
thankyous:
- vending-machine-thanks
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- type: vendingMachineInventory
id: FitnessVendInventory
startingInventory:
FoodSnackProteinbar: 3
FoodCondimentPacketProtein: 3
DrinkMilkCartonMini: 3
DrinkMilkCartonMiniChocolate: 3
DrinkWaterBottleFull: 3
DrinkFitnessShakerBlack: 2
DrinkFitnessShakerRed: 2
DrinkFitnessShakerBlue: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: vendingMachineInventory
id: HotfoodInventory
startingInventory:
FoodSnackAncientBurger: 1
FoodSnackAncientPizza: 1
FoodSnackAncientFries: 1
FoodSnackAncientHotdog: 1
FoodSnackAncientTaco: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- type: vendingMachineInventory
id: SolsnackInventory
startingInventory:
FoodSnackLunacakeWrapped: 3
FoodSnackMochicakeWrapped: 3
FoodSnackMooncakeWrapped: 3
FoodSnackTidegobs: 3
FoodSnackSaturnos: 3
FoodSnackJoveGello: 3
FoodSnackPlutoniumrods: 3
FoodSnackMarsFrouka: 3
FoodSnackVenusianhotcakes: 3
FoodSnackOortrocks: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: vendingMachineInventory
id: WeebVendInventory
startingInventory:
FoodSnackRedalertnuts: 3
FoodSnackRicecake: 3
FoodSnackPokeysticks: 3
FoodSnackChocobanana: 3
FoodSnackDango: 3
Loading
Loading