Skip to content

Commit

Permalink
Merge branch 'master' into vulp
Browse files Browse the repository at this point in the history
  • Loading branch information
Unkn0wnGh0st333 authored Nov 27, 2024
2 parents 6401334 + 648b6af commit d0d2f4e
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 107 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/labeler-needsreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,41 @@
on:
pull_request_target:
types: [review_requested]
pull_request_review:
types: [submitted]

permissions:
pull-requests: write
contents: write

jobs:
add_label:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_target'
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "S: Needs Review"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "S: Awaiting Changes"

handle_review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request_review'
steps:
- uses: actions-ecosystem/action-add-labels@v1
if: |
github.event.review.state == 'changes_requested' &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER')
with:
labels: "S: Awaiting Changes"

- uses: actions-ecosystem/action-remove-labels@v1
if: |
github.event.review.state == 'changes_requested' &&
(github.event.review.author_association == 'OWNER' ||
github.event.review.author_association == 'MEMBER')
with:
labels: "S: Needs Review"
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server.DeltaV.GameTicking.Rules.Components;

/// <summary>
/// Delays adding components to the antags of a gamerule until some time has passed.
/// </summary>
/// <remarks>
/// This is used for the zombies gamemode so that new players don't hit the funny button immediately and ruin anyone else's plans.
/// </remarks>
[RegisterComponent, Access(typeof(DelayedRuleSystem))]
[AutoGenerateComponentPause]
public sealed partial class DelayedRuleComponent : Component
{
/// <summary>
/// The players must wait this length of time before <see cref="DelayedComponents"/> gets added.
/// If they are somehow found out and get gibbed/cremated/etc before this delay is up they will not turn.
/// </summary>
[DataField(required: true)]
public TimeSpan Delay;

/// <summary>
/// Whether to skip the delay if there is only 1 antag selected.
/// </summary>
[DataField]
public bool IgnoreSolo;

/// <summary>
/// When the <see cref="Delay"/> will end.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan DelayEnds;

/// <summary>
/// The components to add to each player's mob once the delay ends.
/// </summary>
[DataField(required: true)]
public ComponentRegistry DelayedComponents = new();

/// <summary>
/// Popup to show when the delay ends.
/// </summary>
[DataField(required: true)]
public LocId EndedPopup;
}
58 changes: 58 additions & 0 deletions Content.Server/DeltaV/GameTicking/Rules/DelayedRuleSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using Content.Server.Antag.Components;
using Content.Server.GameTicking.Rules;
using Content.Server.DeltaV.GameTicking.Rules.Components;
using Content.Shared.GameTicking.Components;
using Content.Shared.Mind;
using Content.Shared.Popups;

namespace Content.Server.DeltaV.GameTicking.Rules;

public sealed class DelayedRuleSystem : GameRuleSystem<DelayedRuleComponent>
{
[Dependency] private readonly SharedPopupSystem _popup = default!;

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

component.DelayEnds = Timing.CurTime + component.Delay;
}

protected override void ActiveTick(EntityUid uid, DelayedRuleComponent component, GameRuleComponent gameRule, float frameTime)
{
base.ActiveTick(uid, component, gameRule, frameTime);

CheckDelay((uid, component));
}

/// <summary>
/// Checks if the delay has ended.
/// </summary>
private void CheckDelay(Entity<DelayedRuleComponent> ent)
{
if (!TryComp<AntagSelectionComponent>(ent, out var selection))
return;

// skip the delay if it's just 1 player, theres no plan to ruin if you are the only one
var ends = ent.Comp.DelayEnds;
if (ent.Comp.IgnoreSolo && selection.SelectedMinds.Count < 2)
ends = Timing.CurTime;

if (Timing.CurTime < ends)
return;

var comps = ent.Comp.DelayedComponents;
foreach (var (mindId, _) in selection.SelectedMinds)
{
// using OriginalOwnedEntity as the player might have ghosted to try become an evil ghost antag
if (!TryComp<MindComponent>(mindId, out var mind) || !TryGetEntity(mind.OriginalOwnedEntity, out var mob))
continue;

var uid = mob.Value;
_popup.PopupEntity(Loc.GetString(ent.Comp.EndedPopup), uid, uid, PopupType.LargeCaution);
EntityManager.AddComponents(uid, comps);
}

RemCompDeferred<DelayedRuleComponent>(ent);
}
}
11 changes: 7 additions & 4 deletions Content.Server/Objectives/Systems/KillPersonConditionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ private void OnGetProgress(EntityUid uid, KillPersonConditionComponent comp, ref
args.Progress = GetProgress(target.Value, comp.RequireDead);
}

private void OnPersonAssigned(EntityUid uid, PickRandomPersonComponent comp, ref ObjectiveAssignedEvent args)
private void OnPersonAssigned(Entity<PickRandomPersonComponent> ent, ref ObjectiveAssignedEvent args)
{
AssignRandomTarget(uid, args, _ => true);
AssignRandomTarget(ent, args, _ => true);
}

private void OnHeadAssigned(EntityUid uid, PickRandomHeadComponent comp, ref ObjectiveAssignedEvent args)
private void OnHeadAssigned(Entity<PickRandomHeadComponent> ent, ref ObjectiveAssignedEvent args)
{
AssignRandomTarget(uid, args, mind => HasComp<CommandStaffComponent>(uid));
AssignRandomTarget(ent, args, mindId =>
TryComp<MindComponent>(mindId, out var mind) &&
mind.OwnedEntity is { } ownedEnt &&
HasComp<CommandStaffComponent>(ownedEnt));
}

private void AssignRandomTarget(EntityUid uid, ObjectiveAssignedEvent args, Predicate<EntityUid> filter, bool fallbackToAny = true)
Expand Down
43 changes: 25 additions & 18 deletions Resources/Changelog/DeltaVChangelog.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
Entries:
- author: Adrian16199
changes:
- message: Laika no longer takes 200 damage before dying from critical.
type: Fix
id: 209
time: '2024-01-19T20:57:11.0000000+00:00'
- author: lleftTheDragon
changes: []
id: 210
time: '2024-01-19T21:06:32.0000000+00:00'
- author: DebugOk
changes:
- message: Enabled gamerule voting on periapsis
type: Tweak
- message: Enabled map voting on periapsis
type: Tweak
id: 211
time: '2024-01-19T22:33:21.0000000+00:00'
- author: DebugOk
changes:
- message: Added gridinv, sorry.
Expand Down Expand Up @@ -3768,3 +3750,28 @@
id: 708
time: '2024-11-25T05:30:25.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2211
- author: deltanedas
changes:
- message: Initial Infecteds now get radio implants to communicate thanks to the
Syndicate.
type: Tweak
- message: Initial Infecteds now have to wait 5 minutes before they can turn, form
a plan!
type: Tweak
id: 709
time: '2024-11-26T12:23:26.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2194
- author: Stop-Signs
changes:
- message: Omega particles are more deadly, Mystagogues beware!
type: Tweak
id: 710
time: '2024-11-26T18:19:14.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2292
- author: Stop-Signs
changes:
- message: psych chems are no longer stronger nocturine
type: Tweak
id: 711
time: '2024-11-27T20:22:30.0000000+00:00'
url: https://github.com/DeltaV-Station/Delta-v/pull/2302
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zombie-bioterrorist-role-greeting = You are a syndicate sponsored bioterrorist sent to overtake the station by use of the Romerol virus. Coordinate with your team, get supplies and prepare for your eventual transformation. Death to nanotrasen!
zombie-bioterrorist-romerol-active = The romerol in your blood is now active, you are ready to transform!
3 changes: 2 additions & 1 deletion Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@
productEntity: BaseBallBatHomeRun
icon:
entity: BaseBallBatHomeRun
discountCategory: usualDiscounts
discountDownTo:
Telecrystal: 10
Telecrystal: 6
cost:
Telecrystal: 16
categories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,15 @@
- type: AnomalousParticle
particleType: Default
severityOverride: true
severityPerSeverityHit: 0.1
severityPerSeverityHit: 0.3 # DeltaV raised to .3 from .1
stabilityPerDestabilizingHit: 0.05
healthPerWeakeningeHit: 1
stabilityPerWeakeningeHit: -0.05
- type: Projectile
impactEffect: BulletImpactEffectKinetic
damage:
types:
Heat: 20
Heat: 30 # DeltaV raised to 30 from 20

- type: entity
parent: AnomalousParticleDelta
Expand Down
20 changes: 16 additions & 4 deletions Resources/Prototypes/GameRules/roundstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@
min: 600
max: 900
- type: ZombieRule
- type: DelayedRule # DeltaV: Grace period of 5 minutes before you can turn, to avoid a random passenger ruining your plan
delay: 300
delayedComponents:
- type: PendingZombie
- type: ZombifyOnDeath
- type: IncurableZombie
endedPopup: zombie-bioterrorist-romerol-active
- type: AntagSelection
definitions:
- prefRoles: [ InitialInfected ]
Expand All @@ -258,14 +265,19 @@
- ZombieImmune
- AntagImmune
briefing:
text: zombie-patientzero-role-greeting
text: zombie-bioterrorist-role-greeting # DeltaV: Different greeting
color: Plum
sound: "/Audio/Ambience/Antag/zombie_start.ogg"
components:
- type: PendingZombie
- type: ZombifyOnDeath
- type: IncurableZombie
# Begin DeltaV Removals: Moved to DelayedRule above
#- type: PendingZombie
#- type: ZombifyOnDeath
#- type: IncurableZombie
# End DeltaV Removals
- type: InitialInfected
- type: AutoImplant # DeltaV: Let them communicate to come up with a plan of action
implants:
- SyndicateRadioImplant
mindRoles:
- MindRoleInitialInfected

Expand Down
Loading

0 comments on commit d0d2f4e

Please sign in to comment.