Фелинидам не место в мехах для больших дядь
This commit is contained in:
parent
733ec19150
commit
1e617b9896
7 changed files with 98 additions and 8 deletions
|
|
@ -253,6 +253,12 @@ public sealed partial class MechSystem : SharedMechSystem
|
|||
return;
|
||||
}
|
||||
|
||||
if (_whitelistSystem.IsWhitelistPass(component.PilotBlacklist, args.User))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("mech-no-enter", ("item", uid)), args.User);
|
||||
return;
|
||||
}
|
||||
|
||||
if (TryComp<AccessReaderComponent>(uid, out var accessReader))
|
||||
if (!_accessReader.IsAllowed(args.Args.User, uid, accessReader))
|
||||
{
|
||||
|
|
@ -290,7 +296,7 @@ public sealed partial class MechSystem : SharedMechSystem
|
|||
if (_mobThresholdSystem.TryGetThresholdForState(uid, MobState.Critical, out var critThreshold) && critThreshold != null)
|
||||
component.MaxIntegrity = critThreshold.Value;
|
||||
}
|
||||
|
||||
|
||||
if (args.DamageIncreased &&
|
||||
args.DamageDelta != null &&
|
||||
component.PilotSlot.ContainedEntity != null)
|
||||
|
|
@ -299,7 +305,7 @@ public sealed partial class MechSystem : SharedMechSystem
|
|||
_damageable.TryChangeDamage(component.PilotSlot.ContainedEntity, damagetoplayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void PlayCritSound(EntityUid uid, MechComponent component, DamageableComponent damage )
|
||||
{
|
||||
var total = damage.TotalDamage;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public sealed partial class MechComponent : Component
|
|||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
public bool Broken = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Whether the mech has toggled lights.
|
||||
/// </summary>
|
||||
|
|
@ -107,6 +107,9 @@ public sealed partial class MechComponent : Component
|
|||
[DataField]
|
||||
public EntityWhitelist? PilotWhitelist;
|
||||
|
||||
[DataField]
|
||||
public EntityWhitelist? PilotBlacklist;
|
||||
|
||||
/// <summary>
|
||||
/// A container for storing the equipment entities.
|
||||
/// </summary>
|
||||
|
|
@ -151,7 +154,7 @@ public sealed partial class MechComponent : Component
|
|||
/// </summary>
|
||||
[DataField]
|
||||
public List<EntProtoId> StartingEquipment = new();
|
||||
|
||||
|
||||
#region Sounds
|
||||
[DataField]
|
||||
public SoundSpecifier EnableLightSound = new SoundPathSpecifier("/Audio/_Sunrise/Mechs/mech_lights_enabled.ogg");
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ public sealed partial class EntityWhitelist
|
|||
[DataField]
|
||||
public List<ProtoId<TagPrototype>>? Tags;
|
||||
|
||||
[DataField]
|
||||
public bool RequireAllTags;
|
||||
|
||||
// Sunrise-Start
|
||||
[DataField]
|
||||
public List<ProtoId<SpeciesPrototype>>? Species;
|
||||
|
|
|
|||
|
|
@ -96,14 +96,28 @@ public sealed class EntityWhitelistSystem : EntitySystem
|
|||
|
||||
if (list.Tags != null)
|
||||
{
|
||||
return list.RequireAll
|
||||
? _tag.HasAllTags(uid, list.Tags)
|
||||
: _tag.HasAnyTag(uid, list.Tags);
|
||||
// Sunrise-Start
|
||||
if (list.RequireAllTags ? _tag.HasAllTags(uid, list.Tags) : _tag.HasAnyTag(uid, list.Tags))
|
||||
{
|
||||
if (!list.RequireAll)
|
||||
return true;
|
||||
}
|
||||
else if (list.RequireAll)
|
||||
return false;
|
||||
// Sunrise-End
|
||||
}
|
||||
|
||||
// Sunrise-Start
|
||||
if (list.Species != null && TryComp<HumanoidAppearanceComponent>(uid, out var appearance))
|
||||
return list.Species.Contains(appearance.Species);
|
||||
{
|
||||
if (list.Species.Contains(appearance.Species))
|
||||
{
|
||||
if (!list.RequireAll)
|
||||
return true;
|
||||
}
|
||||
else if (list.RequireAll)
|
||||
return false;
|
||||
}
|
||||
// Sunrise-End
|
||||
|
||||
return list.RequireAll;
|
||||
|
|
|
|||
|
|
@ -11982,3 +11982,18 @@
|
|||
type: Tweak
|
||||
id: 825
|
||||
time: '2025-02-09T20:38:28.533994+00:00'
|
||||
- author: VigersRay
|
||||
changes:
|
||||
- message: "\u0424\u0435\u043B\u0438\u043D\u0438\u0434\u044B \u0431\u043E\u043B\u044C\
|
||||
\u0448\u0435 \u043D\u0435 \u043C\u043E\u0433\u0443\u0442 \u043F\u0438\u043B\u043E\
|
||||
\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u043E\
|
||||
\u0440\u0430\u0437\u043C\u0435\u0440\u043D\u044B\u0435 \u043C\u0435\u0445\u0438\
|
||||
."
|
||||
type: Tweak
|
||||
- message: "\u0424\u0435\u043B\u0438\u043D\u0438\u0434\u044B \u0442\u0435\u043F\u0435\
|
||||
\u0440\u044C \u043C\u043E\u0433\u0443\u0442 \u043F\u0438\u043B\u043E\u0442\u0438\
|
||||
\u0440\u043E\u0432\u0430\u0442\u044C \u0412\u0418\u041C \u0438 \u0425\u0410\u041C\
|
||||
\u042F\u041A."
|
||||
type: Tweak
|
||||
id: 826
|
||||
time: '2025-02-09T21:39:40.572406+00:00'
|
||||
|
|
|
|||
|
|
@ -208,6 +208,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -273,6 +276,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -340,6 +346,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -415,6 +424,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
equipmentWhitelist:
|
||||
tags:
|
||||
- IndustrialMech
|
||||
|
|
@ -506,6 +518,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: Reflect
|
||||
reflectProb: 0.15
|
||||
spread: 180
|
||||
|
|
@ -569,6 +584,8 @@
|
|||
pilotWhitelist:
|
||||
tags:
|
||||
- Hamster
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 0.8
|
||||
|
|
@ -646,6 +663,8 @@
|
|||
pilotWhitelist:
|
||||
tags:
|
||||
- VimPilot
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 0.8
|
||||
|
|
@ -714,6 +733,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -780,6 +802,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -852,6 +877,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -922,6 +950,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -1007,6 +1038,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -1087,6 +1121,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -1170,6 +1207,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -1252,6 +1292,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
@ -1329,6 +1372,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
attackRate: 1
|
||||
|
|
|
|||
|
|
@ -157,6 +157,9 @@
|
|||
pilotWhitelist:
|
||||
components:
|
||||
- HumanoidAppearance
|
||||
pilotBlacklist:
|
||||
species:
|
||||
- Felinid
|
||||
equipmentWhitelist:
|
||||
tags:
|
||||
- CombatMech
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue