/// <summary>
/// How long it takes the mime to get their powers back
/// </summary>
- [DataField("vowCooldown", customTypeSerializer: typeof(TimeOffsetSerializer))]
+ [DataField("vowCooldown")]
public TimeSpan VowCooldown = TimeSpan.FromMinutes(5);
}
}
/// <summary>
/// How long the inserting animation will play
/// </summary>
- [DataField("insertionTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
+ [DataField("insertionTime")]
public TimeSpan InsertionTime = TimeSpan.FromSeconds(0.79f); // 0.01 off for animation timing
}
SubscribeAllEvent<HeavyAttackEvent>(OnHeavyAttack);
SubscribeAllEvent<DisarmAttackEvent>(OnDisarmAttack);
SubscribeAllEvent<StopAttackEvent>(OnStopAttack);
+
+#if DEBUG
+ SubscribeLocalEvent<MeleeWeaponComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, MeleeWeaponComponent component, MapInitEvent args)
+ {
+ if (component.NextAttack > TimeSpan.Zero)
+ Logger.Warning($"Initializing a map that contains an entity that is on cooldown. Entity: {ToPrettyString(uid)}");
+#endif
}
private void OnMeleeSelected(EntityUid uid, MeleeWeaponComponent component, HandSelectedEvent args)
if (!component.ResetOnHandSelected)
return;
+ if (Paused(uid))
+ return;
+
// If someone swaps to this weapon then reset its cd.
var curTime = Timing.CurTime;
var minimum = curTime + TimeSpan.FromSeconds(1 / component.AttackRate);
{
// Reset shotting for cycling
if (Resolve(uid, ref gunComp, false) &&
- gunComp is { FireRate: > 0f })
+ gunComp is { FireRate: > 0f } &&
+ !Paused(uid))
{
gunComp.NextFire = Timing.CurTime + TimeSpan.FromSeconds(1 / gunComp.FireRate);
}
DebugTools.Assert((component.AvailableModes & fire) != 0x0);
component.SelectedMode = fire;
- var curTime = Timing.CurTime;
- var cooldown = TimeSpan.FromSeconds(InteractNextFire);
- if (component.NextFire < curTime)
- component.NextFire = curTime + cooldown;
- else
- component.NextFire += cooldown;
+ if (!Paused(uid))
+ {
+ var curTime = Timing.CurTime;
+ var cooldown = TimeSpan.FromSeconds(InteractNextFire);
+
+ if (component.NextFire < curTime)
+ component.NextFire = curTime + cooldown;
+ else
+ component.NextFire += cooldown;
+ }
Audio.PlayPredicted(component.SoundModeToggle, uid, user);
Popup(Loc.GetString("gun-selected-mode", ("mode", GetLocSelector(fire))), uid, user);
SubscribeLocalEvent<GunComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<GunComponent, CycleModeEvent>(OnCycleMode);
SubscribeLocalEvent<GunComponent, ComponentInit>(OnGunInit);
+
+#if DEBUG
+ SubscribeLocalEvent<GunComponent, MapInitEvent>(OnMapInit);
+ }
+
+ private void OnMapInit(EntityUid uid, GunComponent component, MapInitEvent args)
+ {
+ if (component.NextFire > TimeSpan.Zero)
+ Logger.Warning($"Initializing a map that contains an entity that is on cooldown. Entity: {ToPrettyString(uid)}");
+#endif
}
private void OnGunInit(EntityUid uid, GunComponent component, ComponentInit args)
- pos: -2.172831,4.5306726
parent: 179
type: Transform
- - nextAttack: 384.7724706
- type: MeleeWeapon
- uid: 148
type: Ointment
components:
- pos: -3.4579864,-1.9811735
parent: 179
type: Transform
- - nextAttack: 582.1216812
- type: MeleeWeapon
- uid: 186
type: PowerCellMedium
components:
- pos: -0.11783123,4.753312
parent: 179
type: Transform
- - nextAttack: 244.2972008
- type: MeleeWeapon
- uid: 328
type: MopItem
components:
- pos: 7.6382103,16.08618
parent: 179
type: Transform
- - nextAttack: 3088.5283222
- type: MeleeWeapon
- solutions:
absorbed:
temperature: 293.15
- pos: 0.6895334,4.7183027
parent: 179
type: Transform
- - nextAttack: 247.8805212
- type: MeleeWeapon
- uid: 344
type: ClothingHeadHatWelding
components:
- pos: -1.6207478,4.3951616
parent: 179
type: Transform
- - nextAttack: 232.4472496
- type: MeleeWeapon
- uid: 360
type: PowerCellMedium
components:
- pos: -3.277628,-2.15838
parent: 179
type: Transform
- - nextAttack: 578.7883598
- type: MeleeWeapon
- uid: 382
type: SheetSteel
components:
- pos: -1.235331,4.739151
parent: 179
type: Transform
- - nextAttack: 385.5557994
- type: MeleeWeapon
- uid: 432
type: ChemicalPayload
components:
- pos: -3.1734612,-2.6066077
parent: 179
type: Transform
- - nextAttack: 577.9550312
- type: MeleeWeapon
- uid: 435
type: ModularGrenade
components:
- pos: 1.1246341,7.500063
parent: 179
type: Transform
- - nextAttack: 669.0197422
- type: MeleeWeapon
- uid: 673
type: Poweredlight
components:
parent: 179
type: Transform
- uid: 956
- type: EmergencyOxygenTank
+ type: EmergencyOxygenTankFilled
components:
- pos: -10.505015,6.711994
parent: 179
type: Transform
- - nextAttack: 396.1132382
- type: MeleeWeapon
- uid: 957
type: AlwaysPoweredLightLED
components: