Всякое (#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:
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Server.Station.Components;
|
||||
using Robust.Shared.Collections;
|
||||
@@ -107,6 +108,12 @@ public abstract partial class GameRuleSystem<T> where T: IComponent
|
||||
|
||||
targetGrid = RobustRandom.Pick(possibleTargets);
|
||||
|
||||
foreach (var target in possibleTargets.Where(HasComp<BecomesStationComponent>)) // WD
|
||||
{
|
||||
targetGrid = target;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!TryComp<MapGridComponent>(targetGrid, out var gridComp))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using Content.Server.Revolutionary;
|
||||
using Content.Server.Revolutionary.Components;
|
||||
using Content.Server.Roles;
|
||||
using Content.Server.RoundEnd;
|
||||
using Content.Server.StationEvents.Components;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Humanoid;
|
||||
@@ -51,6 +52,7 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
|
||||
[Dependency] private readonly SharedStunSystem _stun = default!;
|
||||
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
|
||||
[Dependency] private readonly AudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!; // WD
|
||||
|
||||
[ValidatePrototypeId<NpcFactionPrototype>]
|
||||
public const string RevolutionaryNpcFaction = "Revolutionary";
|
||||
@@ -87,8 +89,13 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
|
||||
|
||||
if (CheckCommandLose())
|
||||
{
|
||||
// _roundEnd.DoRoundEndBehavior(RoundEndBehavior.ShuttleCall, component.ShuttleCallTime);
|
||||
_roundEnd.EndRound(); // WD EDIT
|
||||
// WD EDIT START
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ public sealed class VentCrittersRule : StationEventSystem<VentCrittersRuleCompon
|
||||
var validLocations = new List<EntityCoordinates>();
|
||||
while (locations.MoveNext(out _, out _, out var transform))
|
||||
{
|
||||
if (!HasComp<BecomesStationComponent>(transform.GridUid)) // WD EDIT
|
||||
continue;
|
||||
|
||||
if (CompOrNull<StationMemberComponent>(transform.GridUid)?.Station == station)
|
||||
{
|
||||
validLocations.Add(transform.Coordinates);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Atmos;
|
||||
|
||||
namespace Content.Server._White.ChangeTemperatureOnCollide;
|
||||
|
||||
[RegisterComponent]
|
||||
@@ -6,6 +8,12 @@ public sealed partial class ChangeTemperatureOnCollideComponent : Component
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float Temperature;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinTemperature = Atmospherics.TCMB;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MaxTemperature = 450;
|
||||
|
||||
[DataField]
|
||||
public string FixtureID = "projectile";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Shared.Atmos;
|
||||
using Robust.Shared.Physics.Events;
|
||||
|
||||
namespace Content.Server._White.ChangeTemperatureOnCollide;
|
||||
@@ -24,7 +23,16 @@ public sealed class ChangeTemperatureOnCollideSystem : EntitySystem
|
||||
if (!TryComp(args.OtherEntity, out TemperatureComponent? temperature))
|
||||
return;
|
||||
|
||||
_temperature.ForceChangeTemperature(args.OtherEntity,
|
||||
MathF.Max(Atmospherics.TCMB, temperature.CurrentTemperature + component.Temperature), temperature);
|
||||
var curTemp = temperature.CurrentTemperature;
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,15 @@ public sealed partial class MeleeWeaponComponent : Component
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
@@ -105,7 +114,7 @@ public sealed partial class MeleeWeaponComponent : Component
|
||||
public Angle Angle = Angle.FromDegrees(60);
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public EntProtoId Animation = "WeaponArcPunch";
|
||||
public EntProtoId Animation = "WeaponArcThrust"; // WD EDIT
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public EntProtoId WideAnimation = "WeaponArcSlash";
|
||||
|
||||
@@ -428,14 +428,14 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
switch (attack)
|
||||
{
|
||||
case LightAttackEvent light:
|
||||
DoLightAttack(user, light, weaponUid, weapon, session);
|
||||
animation = weapon.Animation;
|
||||
DoLightAttack(user, light, weaponUid, weapon, session, out var anim); // WD EDIT
|
||||
animation = anim ?? weapon.Animation; // WD EDIT
|
||||
break;
|
||||
case DisarmAttackEvent disarm:
|
||||
if (!DoDisarm(user, disarm, weaponUid, weapon, session))
|
||||
return false;
|
||||
|
||||
animation = weapon.Animation;
|
||||
animation = weapon.DisarmAnimation; // WD EDIT
|
||||
break;
|
||||
case HeavyAttackEvent heavy:
|
||||
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 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
|
||||
var damage = GetDamage(meleeUid, user, component) * GetHeavyDamageModifier(meleeUid, user, component);
|
||||
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);
|
||||
RaiseLocalEvent(meleeUid, missEvent);
|
||||
Audio.PlayPredicted(component.SwingSound, meleeUid, user);
|
||||
if (component.Animation == "WeaponArcThrust") // WD EDIT
|
||||
animation = component.MissAnimation;
|
||||
return;
|
||||
}
|
||||
|
||||
// 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
|
||||
var blockEvent = new MeleeBlockAttemptEvent(user);
|
||||
RaiseLocalEvent(target.Value, ref blockEvent);
|
||||
@@ -508,6 +504,13 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
return;
|
||||
// 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)
|
||||
{
|
||||
target.Value
|
||||
@@ -579,7 +582,8 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
var entities = GetEntityList(ev.Entities);
|
||||
|
||||
// WD EDIT
|
||||
_stamina.TakeStaminaDamage(user, 7);
|
||||
if (component.HeavyAttackStaminaCost > 0)
|
||||
_stamina.TakeStaminaDamage(user, component.HeavyAttackStaminaCost);
|
||||
// WD EDIT END
|
||||
|
||||
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}");
|
||||
|
||||
// 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
|
||||
var hitEvent = new MeleeHitEvent(targets, user, meleeUid, damage, direction);
|
||||
RaiseLocalEvent(meleeUid, hitEvent);
|
||||
@@ -666,13 +683,6 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
||||
if (!Blocker.CanAttack(user, entity, (weapon, component)))
|
||||
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));
|
||||
RaiseLocalEvent(entity, attackedEvent);
|
||||
var modifiedDamage = DamageSpecifier.ApplyModifierSets(damage + hitEvent.BonusDamage + attackedEvent.BonusDamage, hitEvent.ModifiersList);
|
||||
|
||||
@@ -69,4 +69,22 @@
|
||||
components:
|
||||
- type: Borer
|
||||
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
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
sprite: Objects/Weapons/Melee/pickaxe.rsi
|
||||
state: pickaxe
|
||||
- type: MeleeWeapon
|
||||
heavyAttackStaminaCost: 0 # For mining
|
||||
attackRate: 0.7
|
||||
wideAnimationRotation: -135
|
||||
soundHit:
|
||||
@@ -49,6 +50,7 @@
|
||||
sprite: Objects/Tools/handdrill.rsi
|
||||
state: handdrill
|
||||
- type: MeleeWeapon
|
||||
heavyAttackStaminaCost: 0 # For mining
|
||||
autoAttack: true
|
||||
angle: 0
|
||||
wideAnimationRotation: -90
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
Blunt: 7
|
||||
bluntStaminaDamageFactor: 2.0
|
||||
angle: 60
|
||||
animation: WeaponArcSlash
|
||||
- type: StaminaDamageOnHit
|
||||
damage: 40
|
||||
sound: /Audio/Weapons/egloves.ogg
|
||||
- type: StaminaDamageOnCollide
|
||||
damage: 40
|
||||
sound: /Audio/Weapons/egloves.ogg
|
||||
- type: ExaminableBattery
|
||||
- type: Battery
|
||||
maxCharge: 1000
|
||||
startingCharge: 1000
|
||||
|
||||
@@ -373,7 +373,7 @@
|
||||
entries:
|
||||
- id: MobGiantSpiderAngry
|
||||
prob: 0.05
|
||||
|
||||
|
||||
- type: entity
|
||||
id: BorerSpawn
|
||||
parent: BaseGameRule
|
||||
@@ -389,9 +389,9 @@
|
||||
startAudio:
|
||||
path: /Audio/Announcements/attention.ogg
|
||||
- type: VentCrittersRule
|
||||
entries:
|
||||
- id: MobSimpleBorer
|
||||
prob: 0.04
|
||||
specialEntries:
|
||||
- id: SpawnPointGhostBorer
|
||||
prob: 0.03
|
||||
|
||||
- type: entity
|
||||
id: SpiderClownSpawn
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
- type: damageModifierSet
|
||||
id: Dwarf
|
||||
coefficients:
|
||||
Blunt: 0.7
|
||||
Blunt: 0.9
|
||||
Slash: 1.2
|
||||
Piercing: 1.2
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
- type: Sprite
|
||||
sprite: White/Objects/Weapons/experimental_stunbaton.rsi
|
||||
- type: Stunbaton
|
||||
energyPerUse: 100
|
||||
- type: MeleeWeapon
|
||||
damage:
|
||||
types:
|
||||
@@ -17,7 +16,9 @@
|
||||
bluntStaminaDamageFactor: 2.0
|
||||
angle: 70
|
||||
- type: StaminaDamageOnHit
|
||||
damage: 80
|
||||
damage: 45
|
||||
- type: StaminaDamageOnCollide
|
||||
damage: 45
|
||||
- type: Battery
|
||||
maxCharge: 2000
|
||||
startingCharge: 2000
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
- Revolutionary
|
||||
- Zombie
|
||||
- RampingStationEventScheduler
|
||||
- Changeling
|
||||
- Cult
|
||||
- BasicRoundstartVariation
|
||||
|
||||
- type: gamePreset
|
||||
id: Extended
|
||||
@@ -102,7 +105,7 @@
|
||||
- changeling
|
||||
name: changeling-title
|
||||
description: changeling-description
|
||||
showInVote: false
|
||||
showInVote: true
|
||||
rules:
|
||||
- Changeling
|
||||
- BasicStationEventScheduler
|
||||
|
||||
Reference in New Issue
Block a user