Улучшение расы фелинидов (#2612)
Co-authored-by: SplikZerys <tronezero700@yandex.ru> Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>
This commit is contained in:
parent
e661317de5
commit
1b65b7c2f8
5 changed files with 81 additions and 27 deletions
|
|
@ -10,6 +10,7 @@ using Robust.Shared.Containers;
|
|||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Shared._Sunrise.Felinid;
|
||||
|
||||
namespace Content.Shared.Item;
|
||||
|
||||
|
|
@ -115,6 +116,10 @@ public abstract class SharedItemSystem : EntitySystem
|
|||
|
||||
private void AddPickupVerb(EntityUid uid, ItemComponent component, GetVerbsEvent<InteractionVerb> args)
|
||||
{
|
||||
// Sunrise-start. Предотвращаем появление стандартного верба подбора для фелинидов
|
||||
if (HasComp<FelinidComponent>(uid))
|
||||
return;
|
||||
// Sunrise-end
|
||||
if (args.Hands == null ||
|
||||
args.Using != null ||
|
||||
!args.CanAccess ||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
using Content.Shared.DoAfter;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._Sunrise.Felinid;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class FelinidPickupDoAfterEvent : SimpleDoAfterEvent
|
||||
{
|
||||
}
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Movement.Pulling.Events;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
|
|
@ -9,10 +13,14 @@ namespace Content.Shared._Sunrise.Felinid;
|
|||
|
||||
public abstract class SharedFelinidSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<FelinidComponent, GettingPickedUpAttemptEvent>(OnGettingPickupAttempt);
|
||||
SubscribeLocalEvent<FelinidComponent, PickupAttemptEvent>(OnPickupAttempt);
|
||||
SubscribeLocalEvent<FelinidComponent, BeingEquippedAttemptEvent>(OnBeingEquippedAttempt);
|
||||
SubscribeLocalEvent<FelinidComponent, ContainerIsInsertingAttemptEvent>(OnHandEquippedAttempt);
|
||||
|
|
@ -21,6 +29,7 @@ public abstract class SharedFelinidSystem : EntitySystem
|
|||
SubscribeLocalEvent<FelinidComponent, InteractionAttemptEvent>(OnInteractAttempt);
|
||||
SubscribeLocalEvent<FelinidComponent, PullAttemptEvent>(OnPullAttempt);
|
||||
SubscribeLocalEvent<FelinidComponent, AttackAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<FelinidComponent, FelinidPickupDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
private void OnInteractAttempt(Entity<FelinidComponent> ent, ref InteractionAttemptEvent args)
|
||||
|
|
@ -62,4 +71,46 @@ public abstract class SharedFelinidSystem : EntitySystem
|
|||
if (HasComp<FelinidComponent>(args.Item) || component.InContainer)
|
||||
args.Cancel();
|
||||
}
|
||||
private void OnGettingPickupAttempt(EntityUid uid, FelinidComponent component, ref GettingPickedUpAttemptEvent args)
|
||||
{
|
||||
args.Cancel();
|
||||
StartFelinidPickupDoAfter(args.User, args.Item);
|
||||
}
|
||||
private void StartFelinidPickupDoAfter(EntityUid user, EntityUid item)
|
||||
{
|
||||
var ev = new FelinidPickupDoAfterEvent();
|
||||
var args = new DoAfterArgs(EntityManager, user, 3f, ev, item, target: item)
|
||||
{
|
||||
BreakOnMove = true,
|
||||
NeedHand = true,
|
||||
MovementThreshold = 0.5f
|
||||
};
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(args);
|
||||
}
|
||||
private void OnDoAfter(Entity<FelinidComponent> ent, ref FelinidPickupDoAfterEvent args)
|
||||
{
|
||||
if (args.Handled || args.Cancelled)
|
||||
return;
|
||||
|
||||
if (args.Args.Target == null)
|
||||
return;
|
||||
|
||||
if (!TryComp<HandsComponent>(args.Args.User, out var hands))
|
||||
return;
|
||||
|
||||
if (!_hands.TryGetEmptyHand(args.Args.User, out var emptyHand, hands))
|
||||
return;
|
||||
|
||||
if (TryComp<MultiHandedItemComponent>(args.Args.Target.Value, out var multiHanded)
|
||||
&& hands.CountFreeHands() < multiHanded!.HandsNeeded)
|
||||
{
|
||||
_popup.PopupPredictedCursor(Loc.GetString("multi-handed-item-pick-up-fail",
|
||||
("number", multiHanded.HandsNeeded - 1), ("item", ent.Owner)), args.Args.User);
|
||||
return;
|
||||
}
|
||||
|
||||
_hands.TryPickup(args.Args.User, args.Args.Target.Value, emptyHand, checkActionBlocker: false, handsComp: hands);
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
- type: damageModifierSet
|
||||
id: Felinid
|
||||
coefficients:
|
||||
Blunt: 1.3
|
||||
Piercing: 1.3
|
||||
Slash: 1.3
|
||||
Cold: 1.3
|
||||
Heat: 1.3
|
||||
Blunt: 1.1
|
||||
Piercing: 1.1
|
||||
Slash: 1.1
|
||||
Cold: 1.1
|
||||
Heat: 1.1
|
||||
|
||||
- type: damageModifierSet
|
||||
id: Swine
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
id: MobFelinidBase
|
||||
abstract: true
|
||||
components:
|
||||
# SUNRISE EDIT
|
||||
- type: Interactions
|
||||
# SUNRISE EDIT
|
||||
- type: MultiHandedItem
|
||||
handsNeeded: 2
|
||||
- type: Absorbable
|
||||
- type: OwOAccent
|
||||
- type: Speech
|
||||
|
|
@ -408,7 +408,7 @@
|
|||
fix1:
|
||||
shape:
|
||||
!type:PhysShapeCircle
|
||||
radius: 0.20
|
||||
radius: 0.35
|
||||
density: 100
|
||||
restitution: 0.0
|
||||
mask:
|
||||
|
|
@ -446,12 +446,12 @@
|
|||
- type: MobThresholds
|
||||
thresholds:
|
||||
0: Alive
|
||||
75: Critical
|
||||
150: Dead
|
||||
80: Critical
|
||||
160: Dead
|
||||
- type: SlowOnDamage
|
||||
speedModifierThresholds:
|
||||
30: 0.7
|
||||
40: 0.5
|
||||
60: 0.7
|
||||
70: 0.5
|
||||
- type: MeleeWeapon
|
||||
hidden: true
|
||||
soundHit:
|
||||
|
|
@ -462,15 +462,8 @@
|
|||
damage:
|
||||
types:
|
||||
Slash: 3
|
||||
- type: DamageOnHighSpeedImpact
|
||||
minimumSpeed: 5
|
||||
damage:
|
||||
types:
|
||||
Blunt: 10
|
||||
soundHit:
|
||||
path: /Audio/Effects/hit_kick.ogg
|
||||
- type: Stamina
|
||||
critThreshold: 50
|
||||
critThreshold: 100
|
||||
- type: FootprintEmitter
|
||||
- type: Vocal
|
||||
sounds:
|
||||
|
|
@ -506,14 +499,12 @@
|
|||
showInChat: true
|
||||
probability: 0.35
|
||||
- type: MovementSpeedModifier
|
||||
baseWalkSpeed: 2.0
|
||||
baseSprintSpeed: 4.0
|
||||
baseWalkSpeed: 2.5
|
||||
baseSprintSpeed: 4.5
|
||||
- type: Item
|
||||
size: Huge
|
||||
shape:
|
||||
- 0,0,3,3
|
||||
- type: ItemRepickupCooldown
|
||||
cooldown: 5
|
||||
- type: Felinid
|
||||
damageBonus:
|
||||
types:
|
||||
|
|
@ -523,9 +514,7 @@
|
|||
Blunt: 5
|
||||
damageSound: /Audio/Effects/hit_kick.ogg
|
||||
- type: ScaleSprite
|
||||
scale: 0.72, 0.72
|
||||
- type: ToggleableNightVision
|
||||
effect: EffectNightVisioSpecies
|
||||
scale: 0.80, 0.80
|
||||
|
||||
- type: entity
|
||||
save: false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue