Skip to content

Commit

Permalink
Merge pull request #30 from TheDenSS14/floofmerge
Browse files Browse the repository at this point in the history
Floof Merge 11/10/24
  • Loading branch information
sleepyyapril authored Nov 11, 2024
2 parents 9b53728 + a0530f9 commit 984f845
Show file tree
Hide file tree
Showing 65 changed files with 47,923 additions and 35,208 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ concurrency: commit_action
on:
pull_request_target:
types: [closed]
branches:
- stable

env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
Expand All @@ -20,7 +22,7 @@ jobs:
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_TOKEN }}
ref: ${{ vars.CHANGELOG_BRANCH }}
ref: ${{ vars.CHANGELOG_BRANCH }}

- name: Setup Git
run: |
Expand All @@ -47,7 +49,7 @@ jobs:

- name: Commit Changelog
run: |
git pull origin master
git pull origin ${{ vars.CHANGELOG_BRANCH }}
git add *.yml
git commit -m "${{ vars.CHANGELOG_MESSAGE }} (#${{ env.PR_NUMBER }})"
git push
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/discord-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: checkout
uses: actions/checkout@v3
with:
ref: master
ref: stable

- name: Publish changelog
run: Tools/actions_changelogs_since_last_run.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/[email protected]
with:
ref: master
ref: stable
submodules: 'recursive'
- name: Setup .NET Core
uses: actions/[email protected]
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/stable-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Close PRs to stable

on:
pull_request_target:
types: [ opened, ready_for_review ]

jobs:
run:
runs-on: ubuntu-latest
if: ${{ github.base_ref == 'stable' && github.actor != 'Fansana' && github.actor != 'Memeji' && github.actor != 'FoxxoTrystan' }}

steps:
- uses: superbrothers/close-pull-request@v3
with:
comment: "Thank you for contributing to Floof Station repository. Unfortunately, it looks like you submitted your pull request to the stable branch, Please move this PR to the master Branch."
35 changes: 35 additions & 0 deletions Content.Client/Floofstation/HypnotizedSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Content.Shared.Floofstation.Hypno;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
using Robust.Client.Player;
using Content.Client.Overlays;

namespace Content.Client.Floofstation;

public sealed class HypnotizedSystem : EquipmentHudSystem<HypnotizedComponent>
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<PsionicHypnoComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
}

private void OnGetStatusIconsEvent(EntityUid uid, PsionicHypnoComponent component, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
return;

if (_playerManager.LocalEntity is not { Valid: true } player
|| !TryComp<HypnotizedComponent>(player, out var hypnoComp)
|| hypnoComp.Master != uid)
return;

if (_prototype.TryIndex<StatusIconPrototype>(component.MasterIcon, out var iconPrototype))
args.StatusIcons.Add(iconPrototype);
}
}
35 changes: 35 additions & 0 deletions Content.Client/Floofstation/PsionicHypnoSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Content.Shared.Floofstation.Hypno;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
using Robust.Client.Player;
using Content.Client.Overlays;

namespace Content.Client.Floofstation;

public sealed class PsionicHypnoSystem : EquipmentHudSystem<PsionicHypnoComponent>
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<HypnotizedComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
}

private void OnGetStatusIconsEvent(EntityUid uid, HypnotizedComponent component, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
return;

if (_playerManager.LocalEntity is not { Valid: true } player
|| !TryComp<PsionicHypnoComponent>(player, out var hypnoComp)
|| component.Master != player)
return;

if (_prototype.TryIndex<StatusIconPrototype>(hypnoComp.SubjectIcon, out var iconPrototype))
args.StatusIcons.Add(iconPrototype);
}
}
29 changes: 23 additions & 6 deletions Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Wieldable.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand Down Expand Up @@ -94,11 +95,27 @@ public override void Update(float frameTime)
// it's kinda tricky.
// I think as long as we make secondaries their own component it's probably fine
// as long as guncomp has an alt-use key then it shouldn't be too much of a PITA to deal with.
if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
{
return;
//if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
//{
// return;
//}
// Floof changes from frontier
bool gunBoundToUse = false;
bool gunBoundToAlt = false;

if (TryComp<GunComponent>(weaponUid, out var gun)) {
gunBoundToUse = gun.UseKey;
gunBoundToAlt = !gun.UseKey; //Bound to alt-use when false

// If ranged mode only works when wielded, do not block melee attacks when unwielded
// (e.g. crusher & crusher glaive)
if (TryComp<GunRequiresWieldComponent>(weaponUid, out var _) &&
TryComp<WieldableComponent>(weaponUid, out var wield)) {
gunBoundToUse &= wield.Wielded;
gunBoundToAlt &= wield.Wielded;
}
}

// End Floof changes
var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition);

if (mousePos.MapId == MapId.Nullspace)
Expand All @@ -118,7 +135,7 @@ public override void Update(float frameTime)
}

// Heavy attack.
if (altDown == BoundKeyState.Down)
if (altDown == BoundKeyState.Down && !gunBoundToAlt) //Floof: add !gunBoundToAlt condition
{
// If it's an unarmed attack then do a disarm
if (weapon.AltDisarm && weaponUid == entity)
Expand All @@ -139,7 +156,7 @@ public override void Update(float frameTime)
}

// Light attack
if (useDown == BoundKeyState.Down)
if (useDown == BoundKeyState.Down && !gunBoundToUse) //Floof: add !gunBoundToAlt condition
{
var attackerPos = Transform(entity).MapPosition;

Expand Down
2 changes: 2 additions & 0 deletions Content.Server/Abilities/Psionics/Abilities/DarkSwapSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ private void OnPowerUsed(DarkSwapActionEvent args)

if (_psionics.OnAttemptPowerUse(args.Performer, "DarkSwap", args.ManaCost / 2, args.CheckInsulation))
{
SpawnAtPosition("ShadowkinShadow", Transform(args.Performer).Coordinates);
SpawnAtPosition("EffectFlashShadowkinDarkSwapOff", Transform(args.Performer).Coordinates);
RemComp(args.Performer, ethereal);
args.Handled = true;
}
Expand Down
32 changes: 29 additions & 3 deletions Content.Server/Abilities/Psionics/Abilities/MindSwapPowerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using Content.Server.GameTicking;
using Content.Shared.Mind;
using Content.Shared.Actions.Events;
using Content.Server.DoAfter;
using Content.Shared.DoAfter;

namespace Content.Server.Abilities.Psionics
{
Expand All @@ -23,11 +25,13 @@ public sealed class MindSwapPowerSystem : EntitySystem
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly MetaDataSystem _metaDataSystem = default!;
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MindSwapPowerActionEvent>(OnPowerUsed);
SubscribeLocalEvent<MindSwapPowerComponent, MindSwapPowerActionEvent>(OnPowerUsed);
SubscribeLocalEvent<PsionicComponent, MindSwapPowerDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<MindSwappedComponent, MindSwapPowerReturnActionEvent>(OnPowerReturned);
SubscribeLocalEvent<MindSwappedComponent, DispelledEvent>(OnDispelled);
SubscribeLocalEvent<MindSwappedComponent, MobStateChangedEvent>(OnMobStateChanged);
Expand All @@ -36,18 +40,40 @@ public override void Initialize()
SubscribeLocalEvent<MindSwappedComponent, ComponentInit>(OnSwapInit);
}

private void OnPowerUsed(MindSwapPowerActionEvent args)
private void OnPowerUsed(EntityUid uid, MindSwapPowerComponent component, MindSwapPowerActionEvent args)
{
if (!_psionics.OnAttemptPowerUse(args.Performer, "mind swap")
|| !(TryComp<DamageableComponent>(args.Target, out var damageable) && damageable.DamageContainerID == "Biological"))
return;

Swap(args.Performer, args.Target);
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, args.Performer, component.UseDelay, new MindSwapPowerDoAfterEvent(), args.Performer, target: args.Target)
{
Hidden = true,
BreakOnTargetMove = true,
BreakOnDamage = true,
BreakOnUserMove = true
}, out var doAfterId);

if (TryComp<PsionicComponent>(uid, out var magic))
magic.DoAfter = doAfterId;

_psionics.LogPowerUsed(args.Performer, "mind swap");
args.Handled = true;
}

private void OnDoAfter(EntityUid uid, PsionicComponent component, MindSwapPowerDoAfterEvent args)
{
if (component is null)
return;
component.DoAfter = null;

if (args.Target is null
|| args.Cancelled)
return;

Swap(uid, args.Target.Value);
}

private void OnPowerReturned(EntityUid uid, MindSwappedComponent component, MindSwapPowerReturnActionEvent args)
{
if (HasComp<PsionicInsulationComponent>(component.OriginalEntity) || HasComp<PsionicInsulationComponent>(uid))
Expand Down
4 changes: 0 additions & 4 deletions Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,6 @@ private bool CanCallOrRecall(CommunicationsConsoleComponent comp)
|| !comp.CanShuttle)
return false;

// Calling shuttle checks
if (_roundEndSystem.ExpectedCountdownEnd is null)
return comp.CanShuttle;

// Recalling shuttle checks
var recallThreshold = _cfg.GetCVar(CCVars.EmergencyRecallTurningPoint);

Expand Down
Loading

0 comments on commit 984f845

Please sign in to comment.