Всякое (#104)

* - tweak: Revert mistakes.

* - tweak: Limit tempgun max temperature.

* - tweak: Gamemode tweaks.

* - tweak: Shuttle aren't messy anymore.

* - tweak: Vent critters spawn tweaks.

* - tweak: No stamina cost for mining weapons.

* - tweak: Better block.

* - add: Cool attack animations.

* - fix: Fix sprite.

* - add: Stun baton now shows charge.

* - tweak: Add cult to all in once.
This commit is contained in:
Aviu00
2024-02-21 16:52:25 +09:00
committed by GitHub
parent 6a22647864
commit c0cb414f17
14 changed files with 111 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.GameTicking.Rules.Components; using Content.Server.GameTicking.Rules.Components;
using Content.Server.Station.Components; using Content.Server.Station.Components;
using Robust.Shared.Collections; using Robust.Shared.Collections;
@@ -107,6 +108,12 @@ public abstract partial class GameRuleSystem<T> where T: IComponent
targetGrid = RobustRandom.Pick(possibleTargets); targetGrid = RobustRandom.Pick(possibleTargets);
foreach (var target in possibleTargets.Where(HasComp<BecomesStationComponent>)) // WD
{
targetGrid = target;
break;
}
if (!TryComp<MapGridComponent>(targetGrid, out var gridComp)) if (!TryComp<MapGridComponent>(targetGrid, out var gridComp))
return false; return false;

View File

@@ -13,6 +13,7 @@ using Content.Server.Revolutionary;
using Content.Server.Revolutionary.Components; using Content.Server.Revolutionary.Components;
using Content.Server.Roles; using Content.Server.Roles;
using Content.Server.RoundEnd; using Content.Server.RoundEnd;
using Content.Server.StationEvents.Components;
using Content.Shared.Chat; using Content.Shared.Chat;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.Humanoid; using Content.Shared.Humanoid;
@@ -51,6 +52,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
[Dependency] private readonly SharedStunSystem _stun = default!; [Dependency] private readonly SharedStunSystem _stun = default!;
[Dependency] private readonly RoundEndSystem _roundEnd = default!; [Dependency] private readonly RoundEndSystem _roundEnd = default!;
[Dependency] private readonly AudioSystem _audioSystem = default!; [Dependency] private readonly AudioSystem _audioSystem = default!;
[Dependency] private readonly GameTicker _gameTicker = default!; // WD
[ValidatePrototypeId<NpcFactionPrototype>] [ValidatePrototypeId<NpcFactionPrototype>]
public const string RevolutionaryNpcFaction = "Revolutionary"; public const string RevolutionaryNpcFaction = "Revolutionary";
@@ -87,8 +89,13 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
if (CheckCommandLose()) if (CheckCommandLose())
{ {
// _roundEnd.DoRoundEndBehavior(RoundEndBehavior.ShuttleCall, component.ShuttleCallTime); // WD EDIT START
_roundEnd.EndRound(); // WD EDIT // Basically check for all in once gamemode
if (_gameTicker.GetActiveGameRules().Where(HasComp<RampingStationEventSchedulerComponent>).Any())
_roundEnd.DoRoundEndBehavior(RoundEndBehavior.ShuttleCall, component.ShuttleCallTime);
else
_roundEnd.EndRound();
// WD EDIT END
GameTicker.EndGameRule(uid, gameRule); GameTicker.EndGameRule(uid, gameRule);
} }
} }

View File

@@ -27,6 +27,9 @@ public sealed class VentCrittersRule : StationEventSystem<VentCrittersRuleCompon
var validLocations = new List<EntityCoordinates>(); var validLocations = new List<EntityCoordinates>();
while (locations.MoveNext(out _, out _, out var transform)) while (locations.MoveNext(out _, out _, out var transform))
{ {
if (!HasComp<BecomesStationComponent>(transform.GridUid)) // WD EDIT
continue;
if (CompOrNull<StationMemberComponent>(transform.GridUid)?.Station == station) if (CompOrNull<StationMemberComponent>(transform.GridUid)?.Station == station)
{ {
validLocations.Add(transform.Coordinates); validLocations.Add(transform.Coordinates);

View File

@@ -1,3 +1,5 @@
using Content.Shared.Atmos;
namespace Content.Server._White.ChangeTemperatureOnCollide; namespace Content.Server._White.ChangeTemperatureOnCollide;
[RegisterComponent] [RegisterComponent]
@@ -6,6 +8,12 @@ public sealed partial class ChangeTemperatureOnCollideComponent : Component
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]
public float Temperature; public float Temperature;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MinTemperature = Atmospherics.TCMB;
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MaxTemperature = 450;
[DataField] [DataField]
public string FixtureID = "projectile"; public string FixtureID = "projectile";
} }

View File

@@ -1,6 +1,5 @@
using Content.Server.Temperature.Components; using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems; using Content.Server.Temperature.Systems;
using Content.Shared.Atmos;
using Robust.Shared.Physics.Events; using Robust.Shared.Physics.Events;
namespace Content.Server._White.ChangeTemperatureOnCollide; namespace Content.Server._White.ChangeTemperatureOnCollide;
@@ -24,7 +23,16 @@ public sealed class ChangeTemperatureOnCollideSystem : EntitySystem
if (!TryComp(args.OtherEntity, out TemperatureComponent? temperature)) if (!TryComp(args.OtherEntity, out TemperatureComponent? temperature))
return; return;
_temperature.ForceChangeTemperature(args.OtherEntity, var curTemp = temperature.CurrentTemperature;
MathF.Max(Atmospherics.TCMB, temperature.CurrentTemperature + component.Temperature), temperature); var newTemp = curTemp + component.Temperature;
if (curTemp < component.MinTemperature)
newTemp = MathF.Max(curTemp, newTemp);
else if (curTemp > component.MaxTemperature)
newTemp = MathF.Min(curTemp, newTemp);
else
newTemp = Math.Clamp(newTemp, component.MinTemperature, component.MaxTemperature);
_temperature.ForceChangeTemperature(args.OtherEntity, newTemp, temperature);
} }
} }

View File

@@ -66,6 +66,15 @@ public sealed partial class MeleeWeaponComponent : Component
[ViewVariables(VVAccess.ReadWrite), DataField] [ViewVariables(VVAccess.ReadWrite), DataField]
public bool IgnoreResistances; public bool IgnoreResistances;
[ViewVariables(VVAccess.ReadWrite), DataField]
public float HeavyAttackStaminaCost = 8;
[ViewVariables(VVAccess.ReadWrite), DataField]
public EntProtoId MissAnimation = "WeaponArcPunch";
[ViewVariables(VVAccess.ReadWrite), DataField]
public EntProtoId DisarmAnimation = "WeaponArcDisarm";
// WD END // WD END
/// <summary> /// <summary>
@@ -105,7 +114,7 @@ public sealed partial class MeleeWeaponComponent : Component
public Angle Angle = Angle.FromDegrees(60); public Angle Angle = Angle.FromDegrees(60);
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public EntProtoId Animation = "WeaponArcPunch"; public EntProtoId Animation = "WeaponArcThrust"; // WD EDIT
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public EntProtoId WideAnimation = "WeaponArcSlash"; public EntProtoId WideAnimation = "WeaponArcSlash";

View File

@@ -428,14 +428,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
switch (attack) switch (attack)
{ {
case LightAttackEvent light: case LightAttackEvent light:
DoLightAttack(user, light, weaponUid, weapon, session); DoLightAttack(user, light, weaponUid, weapon, session, out var anim); // WD EDIT
animation = weapon.Animation; animation = anim ?? weapon.Animation; // WD EDIT
break; break;
case DisarmAttackEvent disarm: case DisarmAttackEvent disarm:
if (!DoDisarm(user, disarm, weaponUid, weapon, session)) if (!DoDisarm(user, disarm, weaponUid, weapon, session))
return false; return false;
animation = weapon.Animation; animation = weapon.DisarmAnimation; // WD EDIT
break; break;
case HeavyAttackEvent heavy: case HeavyAttackEvent heavy:
if (!DoHeavyAttack(user, heavy, weaponUid, weapon, session)) if (!DoHeavyAttack(user, heavy, weaponUid, weapon, session))
@@ -459,8 +459,9 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
protected abstract bool InRange(EntityUid user, EntityUid target, float range, ICommonSession? session); protected abstract bool InRange(EntityUid user, EntityUid target, float range, ICommonSession? session);
protected virtual void DoLightAttack(EntityUid user, LightAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session) protected virtual void DoLightAttack(EntityUid user, LightAttackEvent ev, EntityUid meleeUid, MeleeWeaponComponent component, ICommonSession? session, out string? animation) // WD EDIT
{ {
animation = null; // WD EDIT
// If I do not come back later to fix Light Attacks being Heavy Attacks you can throw me in the spider pit -Errant // If I do not come back later to fix Light Attacks being Heavy Attacks you can throw me in the spider pit -Errant
var damage = GetDamage(meleeUid, user, component) * GetHeavyDamageModifier(meleeUid, user, component); var damage = GetDamage(meleeUid, user, component) * GetHeavyDamageModifier(meleeUid, user, component);
var target = GetEntity(ev.Target); var target = GetEntity(ev.Target);
@@ -489,18 +490,13 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
var missEvent = new MeleeHitEvent(new List<EntityUid>(), user, meleeUid, damage, null); var missEvent = new MeleeHitEvent(new List<EntityUid>(), user, meleeUid, damage, null);
RaiseLocalEvent(meleeUid, missEvent); RaiseLocalEvent(meleeUid, missEvent);
Audio.PlayPredicted(component.SwingSound, meleeUid, user); Audio.PlayPredicted(component.SwingSound, meleeUid, user);
if (component.Animation == "WeaponArcThrust") // WD EDIT
animation = component.MissAnimation;
return; return;
} }
// Sawmill.Debug($"Melee damage is {damage.Total} out of {component.Damage.Total}"); // Sawmill.Debug($"Melee damage is {damage.Total} out of {component.Damage.Total}");
// Raise event before doing damage so we can cancel damage if the event is handled
var hitEvent = new MeleeHitEvent(new List<EntityUid> { target.Value }, user, meleeUid, damage, null);
RaiseLocalEvent(meleeUid, hitEvent);
if (hitEvent.Handled)
return;
// WD START // WD START
var blockEvent = new MeleeBlockAttemptEvent(user); var blockEvent = new MeleeBlockAttemptEvent(user);
RaiseLocalEvent(target.Value, ref blockEvent); RaiseLocalEvent(target.Value, ref blockEvent);
@@ -508,6 +504,13 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
return; return;
// WD END // WD END
// Raise event before doing damage so we can cancel damage if the event is handled
var hitEvent = new MeleeHitEvent(new List<EntityUid> { target.Value }, user, meleeUid, damage, null);
RaiseLocalEvent(meleeUid, hitEvent);
if (hitEvent.Handled)
return;
var targets = new List<EntityUid>(1) var targets = new List<EntityUid>(1)
{ {
target.Value target.Value
@@ -579,7 +582,8 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
var entities = GetEntityList(ev.Entities); var entities = GetEntityList(ev.Entities);
// WD EDIT // WD EDIT
_stamina.TakeStaminaDamage(user, 7); if (component.HeavyAttackStaminaCost > 0)
_stamina.TakeStaminaDamage(user, component.HeavyAttackStaminaCost);
// WD EDIT END // WD EDIT END
if (entities.Count == 0) if (entities.Count == 0)
@@ -634,6 +638,19 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
// Sawmill.Debug($"Melee damage is {damage.Total} out of {component.Damage.Total}"); // Sawmill.Debug($"Melee damage is {damage.Total} out of {component.Damage.Total}");
// WD START
foreach (var target in new List<EntityUid>(targets))
{
var blockEvent = new MeleeBlockAttemptEvent(user);
RaiseLocalEvent(target, ref blockEvent);
if (blockEvent.Blocked)
targets.Remove(target);
}
if (targets.Count == 0)
return true;
// WD END
// Raise event before doing damage so we can cancel damage if the event is handled // Raise event before doing damage so we can cancel damage if the event is handled
var hitEvent = new MeleeHitEvent(targets, user, meleeUid, damage, direction); var hitEvent = new MeleeHitEvent(targets, user, meleeUid, damage, direction);
RaiseLocalEvent(meleeUid, hitEvent); RaiseLocalEvent(meleeUid, hitEvent);
@@ -666,13 +683,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
if (!Blocker.CanAttack(user, entity, (weapon, component))) if (!Blocker.CanAttack(user, entity, (weapon, component)))
continue; continue;
// WD START
var blockEvent = new MeleeBlockAttemptEvent(user);
RaiseLocalEvent(entity, ref blockEvent);
if (blockEvent.Blocked)
continue;
// WD END
var attackedEvent = new AttackedEvent(meleeUid, user, GetCoordinates(ev.Coordinates)); var attackedEvent = new AttackedEvent(meleeUid, user, GetCoordinates(ev.Coordinates));
RaiseLocalEvent(entity, attackedEvent); RaiseLocalEvent(entity, attackedEvent);
var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + attackedEvent.BonusDamage, hitEvent.ModifiersList); var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + attackedEvent.BonusDamage, hitEvent.ModifiersList);

View File

@@ -69,4 +69,22 @@
components: components:
- type: Borer - type: Borer
reproduceCost: 100 reproduceCost: 100
assumeControlCost: 250 assumeControlCost: 250
- type: entity
id: SpawnPointGhostBorer
name: ghost role spawn point
suffix: coartical borer
parent: MarkerBase
components:
- type: GhostRole
name: ghost-role-information-borer-name
description: ghost-role-information-borer-description
- type: GhostRoleMobSpawner
prototype: MobSimpleBorer
- type: Sprite
sprite: Markers/jobs.rsi
layers:
- state: green
- sprite: Mobs/Animals/borer.rsi
state: borer

View File

@@ -11,6 +11,7 @@
sprite: Objects/Weapons/Melee/pickaxe.rsi sprite: Objects/Weapons/Melee/pickaxe.rsi
state: pickaxe state: pickaxe
- type: MeleeWeapon - type: MeleeWeapon
heavyAttackStaminaCost: 0 # For mining
attackRate: 0.7 attackRate: 0.7
wideAnimationRotation: -135 wideAnimationRotation: -135
soundHit: soundHit:
@@ -49,6 +50,7 @@
sprite: Objects/Tools/handdrill.rsi sprite: Objects/Tools/handdrill.rsi
state: handdrill state: handdrill
- type: MeleeWeapon - type: MeleeWeapon
heavyAttackStaminaCost: 0 # For mining
autoAttack: true autoAttack: true
angle: 0 angle: 0
wideAnimationRotation: -90 wideAnimationRotation: -90

View File

@@ -38,13 +38,13 @@
Blunt: 7 Blunt: 7
bluntStaminaDamageFactor: 2.0 bluntStaminaDamageFactor: 2.0
angle: 60 angle: 60
animation: WeaponArcSlash
- type: StaminaDamageOnHit - type: StaminaDamageOnHit
damage: 40 damage: 40
sound: /Audio/Weapons/egloves.ogg sound: /Audio/Weapons/egloves.ogg
- type: StaminaDamageOnCollide - type: StaminaDamageOnCollide
damage: 40 damage: 40
sound: /Audio/Weapons/egloves.ogg sound: /Audio/Weapons/egloves.ogg
- type: ExaminableBattery
- type: Battery - type: Battery
maxCharge: 1000 maxCharge: 1000
startingCharge: 1000 startingCharge: 1000

View File

@@ -373,7 +373,7 @@
entries: entries:
- id: MobGiantSpiderAngry - id: MobGiantSpiderAngry
prob: 0.05 prob: 0.05
- type: entity - type: entity
id: BorerSpawn id: BorerSpawn
parent: BaseGameRule parent: BaseGameRule
@@ -389,9 +389,9 @@
startAudio: startAudio:
path: /Audio/Announcements/attention.ogg path: /Audio/Announcements/attention.ogg
- type: VentCrittersRule - type: VentCrittersRule
entries: specialEntries:
- id: MobSimpleBorer - id: SpawnPointGhostBorer
prob: 0.04 prob: 0.03
- type: entity - type: entity
id: SpiderClownSpawn id: SpiderClownSpawn

View File

@@ -8,7 +8,7 @@
- type: damageModifierSet - type: damageModifierSet
id: Dwarf id: Dwarf
coefficients: coefficients:
Blunt: 0.7 Blunt: 0.9
Slash: 1.2 Slash: 1.2
Piercing: 1.2 Piercing: 1.2

View File

@@ -9,7 +9,6 @@
- type: Sprite - type: Sprite
sprite: White/Objects/Weapons/experimental_stunbaton.rsi sprite: White/Objects/Weapons/experimental_stunbaton.rsi
- type: Stunbaton - type: Stunbaton
energyPerUse: 100
- type: MeleeWeapon - type: MeleeWeapon
damage: damage:
types: types:
@@ -17,7 +16,9 @@
bluntStaminaDamageFactor: 2.0 bluntStaminaDamageFactor: 2.0
angle: 70 angle: 70
- type: StaminaDamageOnHit - type: StaminaDamageOnHit
damage: 80 damage: 45
- type: StaminaDamageOnCollide
damage: 45
- type: Battery - type: Battery
maxCharge: 2000 maxCharge: 2000
startingCharge: 2000 startingCharge: 2000

View File

@@ -20,6 +20,9 @@
- Revolutionary - Revolutionary
- Zombie - Zombie
- RampingStationEventScheduler - RampingStationEventScheduler
- Changeling
- Cult
- BasicRoundstartVariation
- type: gamePreset - type: gamePreset
id: Extended id: Extended
@@ -102,7 +105,7 @@
- changeling - changeling
name: changeling-title name: changeling-title
description: changeling-description description: changeling-description
showInVote: false showInVote: true
rules: rules:
- Changeling - Changeling
- BasicStationEventScheduler - BasicStationEventScheduler