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

mech tags + immortal headrev + shield rebalance #664

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 0 additions & 25 deletions Content.Client/Revolutionary/UI/DeconvertedEui.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Content.Client/Revolutionary/UI/DeconvertedMenu.xaml

This file was deleted.

16 changes: 0 additions & 16 deletions Content.Client/Revolutionary/UI/DeconvertedMenu.xaml.cs

This file was deleted.

30 changes: 8 additions & 22 deletions Content.Server/GameTicking/Rules/RevolutionaryRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
using Content.Shared.Roles;
using Content.Shared.Stunnable;
using Content.Shared.Zombies;
using FastAccessors;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using System.Linq;
Expand Down Expand Up @@ -277,15 +278,17 @@ private bool CheckCommandLose()
private void OnHeadRevMobStateChanged(EntityUid uid, HeadRevolutionaryComponent comp, MobStateChangedEvent ev)
{
if (ev.NewMobState == MobState.Dead || ev.NewMobState == MobState.Invalid)
{
RemCompDeferred<HeadRevolutionaryComponent>(uid);
CheckRevsLose();
}
}

/// <summary>
/// Checks if all the Head Revs are dead and if so will deconvert all regular revs.
/// </summary>
private bool CheckRevsLose()
{
var stunTime = TimeSpan.FromSeconds(4);
var headRevList = new List<EntityUid>();

var headRevs = AllEntityQuery<HeadRevolutionaryComponent, MobStateComponent>();
Expand All @@ -297,32 +300,15 @@ private bool CheckRevsLose()
// If no Head Revs are alive all normal Revs will lose their Rev status and rejoin Nanotrasen
if (IsGroupDead(headRevList, false))
{
var rev = AllEntityQuery<RevolutionaryComponent, MindContainerComponent>();
while (rev.MoveNext(out var uid, out _, out var mc))
var headrev = AllEntityQuery<RevolutionaryComponent, MindContainerComponent>();
while (headrev.MoveNext(out var uid, out _, out var mc))
{
if (HasComp<HeadRevolutionaryComponent>(uid))
continue;

_npcFaction.RemoveFaction(uid, RevolutionaryNpcFaction);
_stun.TryParalyze(uid, stunTime, true);
RemCompDeferred<RevolutionaryComponent>(uid);
_popup.PopupEntity(Loc.GetString("rev-break-control", ("name", Identity.Entity(uid, EntityManager))), uid);
_adminLogManager.Add(LogType.Mind, LogImpact.Medium, $"{ToPrettyString(uid)} was deconverted due to all Head Revolutionaries dying.");

if (!_mind.TryGetMind(uid, out var mindId, out var mind, mc))
continue;

// remove their antag role
_role.MindTryRemoveRole<RevolutionaryRoleComponent>(mindId);

// make it very obvious to the rev they've been deconverted since
// they may not see the popup due to antag and/or new player tunnel vision
if (_mind.TryGetSession(mindId, out var session))
_euiMan.OpenEui(new DeconvertedEui(), session);
AddComp<HeadRevolutionaryComponent>(uid);
return false;
}
return true;
}

return false;
}

Expand Down
29 changes: 22 additions & 7 deletions Resources/Prototypes/ADT/tags.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- type: Tag
id: socks

- type: Tag
id: underwearb

- type: Tag
id: underweart

Expand Down Expand Up @@ -42,13 +42,13 @@

- type: Tag
id: ChangelingBlacklist
- type: Tag

- type: Tag
id: BoomBoxTape

- type: Tag
id: MobileDefibrillator

- type: Tag
id: HighVoltageDefibrillator

Expand All @@ -67,5 +67,20 @@
- type: Tag
id: ADTHardsuitSalvage

- type: Tag
- type: Tag
id: ADTBluespaceAnomalyCore

- type: Tag
id: ADTMechEquipmentGeneral

- type: Tag
id: ADTMechEquipmentMed

- type: Tag
id: ADTMechEquipmentService

- type: Tag
id: ADTMechEquipmentIndustrial

- type: Tag
id: ADTMechEquipmentSec
21 changes: 10 additions & 11 deletions Resources/Prototypes/Entities/Objects/Shields/shields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
coefficients:
Blunt: 0.8
Slash: 0.8
Piercing: 0.8
Heat: 0.8
Piercing: 0.1
Heat: 0.1
activeBlockModifier:
coefficients:
Blunt: 0.7
Slash: 0.7
Piercing: 0.7
Heat: 0.7
Piercing: 0.1
Heat: 0.1
flatReductions:
Blunt: 1
Slash: 1
Expand All @@ -42,7 +42,7 @@
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 250 #This is probably enough damage before it breaks
damage: 200 #This is probably enough damage before it breaks
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
Expand Down Expand Up @@ -84,10 +84,10 @@
- type: Blocking
passiveBlockModifier:
coefficients:
Heat: 0.4
Heat: 0.7
activeBlockModifier:
coefficients:
Heat: 0.2
Heat: 0.6
flatReductions:
Heat: 2

Expand All @@ -104,12 +104,11 @@
- type: Blocking
passiveBlockModifier:
coefficients:
Blunt: 0.6
Piercing: 0.5
Piercing: 0.7
activeBlockModifier:
coefficients:
Blunt: 0.4
Piercing: 0.3
Blunt: 0.1
Piercing: 0.4
flatReductions:
Blunt: 1.5
Piercing: 1.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- type: GuideHelp
guides:
- Robotics
- type: Tag
tags:
- ADTMechEquipmentGeneral

- type: entity
id: MechEquipmentGrabber
Expand All @@ -27,6 +30,9 @@
- type: ContainerContainer
containers:
item-container: !type:Container
- type: Tag
tags:
- ADTMechEquipmentIndustrial

- type: entity
id: MechEquipmentGrabberSmall
Expand Down Expand Up @@ -70,3 +76,6 @@
- type: UseDelay
delay: 0.5
# TODO: tag as being for H.O.N.K. only!!!
- type: Tag
tags:
- ADTMechEquipmentService
8 changes: 8 additions & 0 deletions Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
pilotWhitelist:
components:
- HumanoidAppearance
equipmentWhitelist:
tags:
- ADTMechEquipmentGeneral
- ADTMechEquipmentIndustrial
- type: MeleeWeapon
hidden: true
attackRate: 1
Expand Down Expand Up @@ -170,6 +174,10 @@
pilotWhitelist:
components:
- HumanoidAppearance
equipmentWhitelist:
tags:
- ADTMechEquipmentGeneral
- ADTMechEquipmentService

- type: entity
parent: MechHonker
Expand Down
Loading