Skip to content

Commit

Permalink
Merge pull request DeltaV-Station#83 from DebugOk/merge-nyano-21/06-2
Browse files Browse the repository at this point in the history
Merge up to nyano 21/06 (electric boogaloo)
  • Loading branch information
DebugOk authored Jun 26, 2023
2 parents 30ebeb5 + 111733e commit 58be11a
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Content.Server.Chat.Managers;
using Content.Server.Chat.Systems;
using Content.Server.Chemistry.Components;
using Content.Server.Construction.Components;
using Content.Server.Destructible;
using Content.Server.Explosion.EntitySystems;
using Content.Server.Fluids.EntitySystems;
Expand Down Expand Up @@ -73,6 +74,7 @@
using Content.Shared.Roles;
using Content.Shared.Shuttles.Components;
using Content.Shared.Storage;
using Content.Shared.Zombies;


namespace Content.Server.GameTicking.Rules;
Expand Down Expand Up @@ -146,6 +148,7 @@ public override void Initialize()

SubscribeLocalEvent<ShipwreckSurvivorComponent, MobStateChangedEvent>(OnSurvivorMobStateChanged);
SubscribeLocalEvent<ShipwreckSurvivorComponent, BeingGibbedEvent>(OnSurvivorBeingGibbed);
SubscribeLocalEvent<EntityZombifiedEvent>(OnZombified);
}

private void OnAnnounceRoundAttempt(ref AnnounceRoundAttemptEvent ev)
Expand Down Expand Up @@ -538,6 +541,9 @@ private void DamageShuttleMidflight(ShipwreckedRuleComponent component)
// So make them indestructible.
RemComp<DestructibleComponent>(uid);

// Disallow them to be broken down, too.
RemComp<ConstructionComponent>(uid);

// These should be weak enough to rough up the walls but not destroy them.
_explosionSystem.QueueExplosion(uid, "DemolitionCharge",
2f,
Expand All @@ -562,7 +568,7 @@ private void DamageShuttleMidflight(ShipwreckedRuleComponent component)
EnsureComp<FinitePowerSupplierComponent>(uid);

// Hit it right away.
powerSupplier.MaxSupply *= 0.95f;
powerSupplier.MaxSupply *= 0.8f;
}
}

Expand Down Expand Up @@ -1226,7 +1232,7 @@ private void OnRoundEndText(RoundEndTextAppendEvent ev)

foreach (var (survivor, session) in shipwrecked.Survivors)
{
if (_mobStateSystem.IsDead(survivor))
if (IsDead(survivor))
{
ev.AddLine(Loc.GetString("shipwrecked-list-perished-name",
("name", MetaData(survivor).EntityName),
Expand Down Expand Up @@ -1309,15 +1315,39 @@ private void OnSurvivorBeingGibbed(EntityUid survivor, ShipwreckSurvivorComponen
}
}

private void OnZombified(EntityZombifiedEvent args)
{
var query = EntityQueryEnumerator<ShipwreckedRuleComponent, GameRuleComponent>();
while (query.MoveNext(out var uid, out var shipwrecked, out var gameRule))
{
if (!GameTicker.IsGameRuleActive(uid, gameRule))
continue;

CheckShouldRoundEnd(uid, shipwrecked);
}
}

// This should probably be something general, but I'm not sure where to put it,
// and it's small enough to stay here for now. Feel free to move it.
public bool IsDead(EntityUid uid)
{
return (_mobStateSystem.IsDead(uid) ||
// Zombies are not dead-dead, so check for that.
HasComp<ZombieComponent>(uid) ||
Deleted(uid));
}

private void CheckShouldRoundEnd(EntityUid uid, ShipwreckedRuleComponent component)
{
var totalSurvivors = component.Survivors.Count;
var deadSurvivors = 0;

var zombieQuery = GetEntityQuery<ZombieComponent>();

foreach (var (survivor, _) in component.Survivors)
{
// Check if everyone's dead.
if (_mobStateSystem.IsDead(survivor) || Deleted(survivor))
if (IsDead(survivor))
++deadSurvivors;
}

Expand Down
6 changes: 3 additions & 3 deletions Content.Server/Nyanotrasen/Power/FinitePowerSupplierSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<FinitePowerSupplierComponent, MapInitEvent>(OnInit);
SubscribeLocalEvent<FinitePowerSupplierComponent, ComponentStartup>(OnStartup);
}

private void OnInit(EntityUid uid, FinitePowerSupplierComponent component, MapInitEvent args)
private void OnStartup(EntityUid uid, FinitePowerSupplierComponent component, ComponentStartup args)
{
// Prevent reconstruction exploits. There's a better way to handle this,
// but it would involve storing state on the machine circuitboard or its parts.
// This will do for now.
RemCompDeferred<ConstructionComponent>(uid);
RemComp<ConstructionComponent>(uid);
}

public override void Update(float frameTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ shipwrecked-list-objective-thrusters-fail = - [color=red]None[/color] of the [co
shipwrecked-list-objective-generator-fail = - The generator was [color=red]never repaired[/color].
shipwrecked-list-objective-console-fail = - The console was [color=red]never repaired[/color].
shipwrecked-list-objective-thruster-partial = - Only [color=blue]{$goodThrusterCount}[/color] out of [color=blue]{$totalThrusterCount}[/color] thrusters were repaired.
shipwrecked-list-objective-thrusters-partial = - Only [color=blue]{$goodThrusterCount}[/color] out of [color=blue]{$totalThrusterCount}[/color] thrusters were repaired.
shipwrecked-list-objective-thrusters-pass = - All [color=green]{$totalThrusterCount}[/color] thrusters were [color=green]repaired[/color].
shipwrecked-list-objective-generator-pass = - The generator was [color=green]repaired[/color].
Expand Down Expand Up @@ -103,9 +103,8 @@ hecate-told-name-3 = {$name}? Your parents must have been interesting.
shipwrecked-hecate-response-job = I am an autopilot hologram, here to ferry you to your destination.
# Pre-crash
shipwrecked-hecate-response-food = This vessel is stocked with rations for our trip, in a refridgeration unit, in the corner of the common area.
shipwrecked-hecate-response-food = This vessel is stocked with rations for our trip, in a refrigeration unit, in the corner of the common area.
shipwrecked-hecate-response-supplies = This vessel is stocked with supplies in the event of an onboard fire, or boredom. Please enjoy yourself.
# shipwrecked-hecate-response-freeport = Freeport 7 was constructed at the edge of the D.M.Z. to facilitate trade between neutral parties.
# Post-crash
shipwrecked-hecate-response-generator = Our on-board generator was damaged in the crash. We will eventually lose power.
Expand Down
33 changes: 26 additions & 7 deletions Resources/Maps/Shuttles/adventurer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,8 @@ entities:
entities:
- uid: 179
components:
- name: refridgerator
- desc: A tall box with a dizzying array of metal coils at the back.
name: refrigerator
type: MetaData
- pos: -0.5,-1.5
parent: 2
Expand Down Expand Up @@ -1446,6 +1447,8 @@ entities:
pos: 4.5,7.5
parent: 2
type: Transform
- access: []
type: AccessReader
- proto: MaintenanceFluffSpawner
entities:
- uid: 257
Expand Down Expand Up @@ -1482,6 +1485,15 @@ entities:
pos: -0.5,-4.5
parent: 2
type: Transform
- proto: PersonalAI
entities:
- uid: 290
components:
- flags: SessionSpecific
type: MetaData
- pos: 4.175825,10.454469
parent: 2
type: Transform
- proto: Pickaxe
entities:
- uid: 281
Expand Down Expand Up @@ -1770,14 +1782,24 @@ entities:
Pressed:
- 254
type: DeviceLinkSource
- proto: Sink
- proto: SinkEmpty
entities:
- uid: 6
components:
- rot: 3.141592653589793 rad
pos: -0.5,-3.5
parent: 2
type: Transform
- solutions:
tank:
temperature: 293.15
canMix: false
canReact: true
maxVol: 500
reagents:
- Quantity: 50
ReagentId: Water
type: SolutionContainerManager
- proto: SMESBasic
entities:
- uid: 199
Expand Down Expand Up @@ -1865,16 +1887,13 @@ entities:
- pos: 3.5,-5.5
parent: 2
type: Transform
- proto: SuitStorageEngi
- proto: SuitStorageEVA
entities:
- uid: 200
components:
- anchored: true
pos: 4.5,-2.5
- pos: 4.5,-2.5
parent: 2
type: Transform
- bodyType: Static
type: Physics
- proto: SyringeSpaceacillin
entities:
- uid: 270
Expand Down
10 changes: 7 additions & 3 deletions Resources/Prototypes/Nyanotrasen/Entities/Mobs/NPCs/robots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@
Base: shell
- type: MovementAlwaysTouching
- type: MovementSpeedModifier
baseWalkSpeed: 3
baseSprintSpeed: 6
baseWalkSpeed: 2.25
baseSprintSpeed: 4.5
- type: MeleeWeapon
hidden: true
soundHit:
path: /Audio/Weapons/bladeslice.ogg
angle: 0
range: 1
animation: WeaponArcSlash
damage:
types:
Expand Down Expand Up @@ -171,6 +172,7 @@
soundHit:
path: /Audio/Weapons/pierce.ogg
angle: 0
range: 1.25
animation: WeaponArcSlash
damage:
types:
Expand All @@ -186,7 +188,7 @@
generated:
reagents:
- ReagentId: Toxin
Quantity: 1
Quantity: 0.1
- type: Butcherable
spawned:
- id: SheetSteel1
Expand Down Expand Up @@ -266,6 +268,8 @@
- type: ContainerContainer
containers:
ballistic-ammo: !type:Container
- type: ExplosionResistance
damageCoefficient: 0.8
- type: BallisticAmmoProvider
proto: BulletCannonBall
capacity: 16
Expand Down
23 changes: 12 additions & 11 deletions Resources/Prototypes/Nyanotrasen/Entities/Mobs/NPCs/special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/hecate_response_name.ogg
listenEvent: !type:NPCConversationToldNameEvent
- prompts: [job]
- prompts: [job, occupation, profession]
responses:
- text: shipwrecked-hecate-response-job
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_job.ogg
- prompts: [help]
- prompts: [help, topics]
weight: 0.5
hidden: true
responses:
Expand All @@ -88,7 +88,7 @@
- text: hecate-response-buy-sell
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/hecate_response_buy_sell.ogg
- prompts: [hi, hello]
- prompts: [hi, hello, hey, greetings, salutations]
weight: 0.1
hidden: true
responses:
Expand All @@ -101,7 +101,8 @@
- text: hecate-response-hello-3
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/hecate_response_hello_3.ogg
- prompts: [bye, goodbye, done]
- prompts: [bye, goodbye, done, farewell, later, seeya]
weight: 0.1
hidden: true
responses:
- text: hecate-response-bye-1
Expand All @@ -121,20 +122,20 @@
# Quest-relevant
#

- prompts: [food]
- prompts: [food, drink, drinks]
responses:
- text: shipwrecked-hecate-response-food
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_food.ogg
- prompts: [supplies]
- prompts: [supplies, supply]
responses:
- text: shipwrecked-hecate-response-supplies
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_supplies.ogg

# Post-crash

- prompts: [generator]
- prompts: [generator, generators, power, engine]
locked: true
responses:
- text: shipwrecked-hecate-response-generator
Expand All @@ -151,13 +152,13 @@
- text: shipwrecked-hecate-response-rescue
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_rescue.ogg
- prompts: [scans]
- prompts: [scans, scan]
locked: true
responses:
- text: shipwrecked-hecate-response-scans
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_scans.ogg
- prompts: [status]
- prompts: [status, stats, prelaunch]
locked: true
responses:
- is: !type:ShipwreckedHecateAskStatusEvent
Expand All @@ -181,7 +182,7 @@
text: shipwrecked-hecate-response-status-all-green-again
audio: !type:SoundPathSpecifier
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_status_all_green_again.ogg
- prompts: [weapons, firearms, arms, guns]
- prompts: [weapons, firearms, arms, guns, safe]
locked: true
responses:
- is: !type:ShipwreckedHecateAskWeaponsEvent
Expand All @@ -196,7 +197,7 @@
path: /Audio/Nyanotrasen/Dialogue/Hecate/shipwrecked_hecate_response_weapons_after.ogg

# All objectives complete!
- prompts: [launch, takeoff, liftoff, blastoff]
- prompts: [launch, takeoff, liftoff, blastoff, ready, go, leave, escape]
locked: true
responses:
- is: !type:ShipwreckedHecateAskLaunchEvent
Expand Down
8 changes: 4 additions & 4 deletions Resources/Prototypes/Nyanotrasen/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
spawnPointHecate: SpawnPointShipwreckHecate
hecatePrototype: MobQuestHecateShipwrecked
eventSchedule:
- 12: AnnounceTransit
- 8: ShowHecate
- 13: AnnounceTransit
- 9: ShowHecate
- 1: IntroduceHecate
- 160: EncounterTurbulence
- 10: ShiftParallax
- 60: MidFlightDamage
- 1: Alert
- 8: DecoupleEngine
- 8: SendDistressSignal
- 14: SendDistressSignal
- 8: InterstellarBody
- 8: EnteringAtmosphere
- 6: Crash
- 4: AfterCrash
- 6: AfterCrash
- 12: Sitrep

0 comments on commit 58be11a

Please sign in to comment.