Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'Fansana:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Merrokitsune authored Nov 15, 2024
2 parents a4e9ffd + 2e39a10 commit b7b339a
Show file tree
Hide file tree
Showing 12 changed files with 171 additions and 26 deletions.
57 changes: 57 additions & 0 deletions Content.Server/AutoVote/AutoVoteSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Robust.Shared.Configuration;
using Content.Server.Voting.Managers;
using Content.Shared.GameTicking;
using Content.Shared.Voting;
using Content.Shared.CCVar;
using Robust.Server.Player;
using Content.Server.GameTicking;

namespace Content.Server.AutoVote;

public sealed class AutoVoteSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] public readonly IVoteManager _voteManager = default!;
[Dependency] public readonly IPlayerManager _playerManager = default!;

public bool _shouldVoteNextJoin = false;

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

SubscribeLocalEvent<RoundRestartCleanupEvent>(OnReturnedToLobby);
SubscribeLocalEvent<PlayerJoinedLobbyEvent>(OnPlayerJoinedLobby);
}

public void OnReturnedToLobby(RoundRestartCleanupEvent ev)
{
CallAutovote();
}

public void OnPlayerJoinedLobby(PlayerJoinedLobbyEvent ev)
{
if (_shouldVoteNextJoin)
{
CallAutovote();
_shouldVoteNextJoin = false;
}
}

private void CallAutovote()
{
if (!_cfg.GetCVar(CCVars.AutoVoteEnabled))
return;

if (_playerManager.PlayerCount == 0)
{
_shouldVoteNextJoin = true;
return;
}

if (_cfg.GetCVar(CCVars.MapAutoVoteEnabled))
_voteManager.CreateStandardVote(null, StandardVoteType.Preset);
if (_cfg.GetCVar(CCVars.PresetAutoVoteEnabled))
_voteManager.CreateStandardVote(null, StandardVoteType.Map);
}
}
7 changes: 1 addition & 6 deletions Content.Server/Dragon/DragonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@ public override void Update(float frameTime)

comp.RiftAccumulator += frameTime;

// Delete it, naughty dragon!
if (comp.RiftAccumulator >= comp.RiftMaxAccumulator)
{
Roar(uid, comp);
QueueDel(uid);
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Power/Pow3r/BatteryRampPegSolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void Tick(float frameTime, PowerState state, IParallelManager parallel)
// suppliers + discharger) Then decide based on total layer size whether its worth parallelizing that
// layer?
_networkJob.Networks = group;
parallel.ProcessNow(_networkJob, group.Count);
parallel.ProcessSerialNow(_networkJob, group.Count);
}

ClearBatteries(state);
Expand Down
26 changes: 24 additions & 2 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2062,13 +2062,13 @@ public static readonly CVarDef<string>
*/

/// <summary>
/// Time that players have to wait before rules can be accepted.
/// Time that players have to wait before rules can be accepted.
/// </summary>
public static readonly CVarDef<float> RulesWaitTime =
CVarDef.Create("rules.time", 60f, CVar.SERVER | CVar.REPLICATED);

/// <summary>
/// Don't show rules to localhost/loopback interface.
/// Don't show rules to localhost/loopback interface.
/// </summary>
public static readonly CVarDef<bool> RulesExemptLocal =
CVarDef.Create("rules.exempt_local", true, CVar.SERVERONLY);
Expand Down Expand Up @@ -2640,5 +2640,27 @@ public static readonly CVarDef<float>
CVarDef.Create("ghost.allow_same_character", false, CVar.SERVERONLY);

#endregion

/*
* AUTOVOTE SYSTEM
*/

/// <summary>
/// Enables the automatic voting system.
/// </summary>
public static readonly CVarDef<bool> AutoVoteEnabled =
CVarDef.Create("vote.autovote_enabled", true, CVar.SERVERONLY); // Floof enabled by default

/// <summary>
/// Automatically make map votes on return to lobby? Requires auto voting to be enabled.
/// </summary>
public static readonly CVarDef<bool> MapAutoVoteEnabled =
CVarDef.Create("vote.map_autovote_enabled", true, CVar.SERVERONLY);

/// <summary>
/// Automatically make preset votes on return to lobby? Requires auto voting to be enabled.
/// </summary>
public static readonly CVarDef<bool> PresetAutoVoteEnabled =
CVarDef.Create("vote.preset_autovote_enabled", true, CVar.SERVERONLY);
}
}
61 changes: 61 additions & 0 deletions Resources/Changelog/Floof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1422,3 +1422,64 @@ Entries:
id: 189
time: '2024-11-13T22:20:32.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/348
- author: fenndragon
changes:
- type: Tweak
message: Tweaked Price
id: 190
time: '2024-11-14T09:55:10.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/353
- author: Memeji
changes:
- type: Fix
message: Gladiators can no longer have bionics.
- type: Tweak
message: Bionic arm cannot opened powered doors. Cost reduced to 6 instead of 8.
id: 191
time: '2024-11-14T09:55:48.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/343
- author: Fansana
changes:
- type: Tweak
message: Tweaked game mode votes
id: 192
time: '2024-11-14T09:57:52.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/350
- author: fenndragon
changes:
- type: Remove
message: Removed timer from dragon gameplay
id: 193
time: '2024-11-14T18:02:17.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/352
- author: Fansana
changes:
- type: Fix
message: Fixed the power flickers!
id: 194
time: '2024-11-14T18:03:44.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/354
- author: fenndragon
changes:
- type: Add
message: Added Leash anchor to Space drakes
- type: Tweak
message: 'Tweaked the name of Space drakes '
id: 195
time: '2024-11-14T18:05:25.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/349
- author: Memeji
changes:
- type: Tweak
message: Removed nicotine from Interdynes and replaced it with iron and dylovene.
id: 196
time: '2024-11-14T18:06:38.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/344
- author: Fansana
changes:
- type: Add
message: Added auto vote system
id: 197
time: '2024-11-14T23:20:24.0000000+00:00'
url: https://github.com/Fansana/floofstation1/pull/351

Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ ghost-role-information-ifrit-name = Ifrit
ghost-role-information-ifrit-description = Listen to your owner. Don't tank damage. Punch people hard.
ghost-role-information-space-dragon-name = Space dragon
ghost-role-information-space-dragon-description = Call in 3 carp rifts and take over this quadrant! You have only 5 minutes in between each rift before you will disappear.
ghost-role-information-space-dragon-description = create 3 carp rifts and protect your nest!
ghost-role-information-space-dragon-dungeon-description = Defend the expedition dungeon with your fishy comrades!
ghost-role-information-cluwne-name = Cluwne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@
smokable:
maxVol: 40
reagents:
- ReagentId: Nicotine
Quantity: 10
- ReagentId: Omnizine
- ReagentId: Iron # Floof - Herbals aren't nicotine
Quantity: 5
- ReagentId: Omnizine # Floof - Herbals aren't nicotine
Quantity: 5
- ReagentId: Dylovene # Floof - Herbals aren't nicotine
Quantity: 5

- type: entity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@
suffix: Full
components:
- type: Material
- type: Food
transferAmount: 10
- type: BadFood
- type: PhysicalComposition
materialComposition:
Uranium: 100
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Floof/Catalog/Cargo/cargo_fun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
sprite: Structures/Storage/Crates/xeno.rsi
state: icon
product: CrateNTxenos
cost: 100000
cost: 99999
category: cargoproduct-category-name-fun
group: market
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
- SimpleSpaceMobBase
- FlyingMobBase
id: MobDragonPet
name: adolescent space dragon
description: A younger Space dragon with a friendly demeanor.
name: Space Drake
description: A smaller breed of space dragon with a friendly demeanor.
components:
- type: Body
prototype: Animal
Expand Down Expand Up @@ -156,6 +156,7 @@
- TauCetiBasic
understands:
- TauCetiBasic
- type: LeashAnchor

- type: entity
categories: [ HideSpawnMenu ]
Expand Down
14 changes: 12 additions & 2 deletions Resources/Prototypes/Traits/physical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterSpeciesRequirement
species:
- Human # Entirely arbitrary, I've decided I want a trait unique to humans. Since they don't normally get anything exciting.
Expand Down Expand Up @@ -403,6 +404,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterSpeciesRequirement
inverted: true
species:
Expand All @@ -420,16 +422,17 @@
- type: trait
id: BionicArm
category: Physical
points: -8
points: -3 # Floof - since you can't get free JoL anymore
requirements:
- !type:CharacterJobRequirement
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
components:
- type: Prying
speedModifier: 1
pryPowered: true
pryPowered: false # Floof

- type: trait
id: PlateletFactories
Expand All @@ -440,6 +443,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterSpeciesRequirement
inverted: true
species:
Expand Down Expand Up @@ -469,6 +473,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterSpeciesRequirement
species:
- Human
Expand All @@ -487,6 +492,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterTraitRequirement
inverted: true
traits:
Expand All @@ -509,6 +515,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterDepartmentRequirement
departments:
- Security
Expand All @@ -533,6 +540,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterTraitRequirement
traits:
- CyberEyes
Expand All @@ -558,6 +566,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterTraitRequirement
traits:
- CyberEyes
Expand All @@ -581,6 +590,7 @@
inverted: true
jobs:
- Prisoner # Bionics should be "Confiscated" from long term prisoners.
- Gladiator # Floof
- !type:CharacterDepartmentRequirement
departments:
- Security
Expand Down
10 changes: 5 additions & 5 deletions Resources/Prototypes/game_presets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
alias:
- survival
name: survival-title
showInVote: true # secret # DeltaV - Me when the survival. Used for periapsis.
showInVote: false # secret # DeltaV - Me when the survival. Used for periapsis.
description: survival-description
rules:
- RampingStationEventScheduler
Expand All @@ -14,7 +14,7 @@
id: SurvivalHellshift
alias:
- hellshift
showInVote: true
showInVote: false
name: hellshift-title
description: hellshift-description
rules:
Expand All @@ -25,7 +25,7 @@
- type: gamePreset
id: SurvivalIrregular
alias: [irregular]
showInVote: true
showInVote: false
name: irregular-title
description: irregular-description
rules:
Expand Down Expand Up @@ -62,7 +62,7 @@
- extended
- shittersafari
name: extended-title
showInVote: true #2boring2vote # DeltaV - I'd like to disagree, used for periapsis.
showInVote: false #2boring2vote # DeltaV - I'd like to disagree, used for periapsis.
description: extended-description
rules:
- BasicStationEventScheduler
Expand Down Expand Up @@ -127,7 +127,7 @@
- traitor
name: traitor-title
description: traitor-description
showInVote: true
showInVote: false
rules:
- Traitor
- SubGamemodesRule
Expand Down

0 comments on commit b7b339a

Please sign in to comment.