- add: Mjolnir. (#350)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Content.Server.Damage.Systems;
|
using Content.Server.Damage.Systems;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
|
|
||||||
namespace Content.Server.Damage.Components
|
namespace Content.Server.Damage.Components
|
||||||
{
|
{
|
||||||
@@ -15,5 +16,7 @@ namespace Content.Server.Damage.Components
|
|||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public DamageSpecifier Damage = default!;
|
public DamageSpecifier Damage = default!;
|
||||||
|
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)] // WD
|
||||||
|
public SoundSpecifier? Sound;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ using Content.Shared.Effects;
|
|||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
using Content.Shared.Projectiles;
|
using Content.Shared.Projectiles;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
|
using Content.Shared.Weapons.Melee;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
@@ -28,7 +29,8 @@ namespace Content.Server.Damage.Systems
|
|||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeLocalEvent<DamageOtherOnHitComponent, ThrowDoHitEvent>(OnDoHit);
|
SubscribeLocalEvent<DamageOtherOnHitComponent, ThrowDoHitEvent>(OnDoHit,
|
||||||
|
before: new[] {typeof(MeleeThrowOnHitSystem)}); // WD EDIT
|
||||||
SubscribeLocalEvent<DamageOtherOnHitComponent, DamageExamineEvent>(OnDamageExamine);
|
SubscribeLocalEvent<DamageOtherOnHitComponent, DamageExamineEvent>(OnDamageExamine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +57,7 @@ namespace Content.Server.Damage.Systems
|
|||||||
_color.RaiseEffect(Color.Red, new List<EntityUid>() { args.Target }, Filter.Pvs(args.Target, entityManager: EntityManager));
|
_color.RaiseEffect(Color.Red, new List<EntityUid>() { args.Target }, Filter.Pvs(args.Target, entityManager: EntityManager));
|
||||||
}
|
}
|
||||||
|
|
||||||
_guns.PlayImpactSound(args.Target, dmg, null, false);
|
_guns.PlayImpactSound(args.Target, dmg, component.Sound, component.Sound != null); // WD EDIT
|
||||||
if (TryComp<PhysicsComponent>(uid, out var body) && body.LinearVelocity.LengthSquared() > 0f)
|
if (TryComp<PhysicsComponent>(uid, out var body) && body.LinearVelocity.LengthSquared() > 0f)
|
||||||
{
|
{
|
||||||
var direction = body.LinearVelocity.Normalized();
|
var direction = body.LinearVelocity.Normalized();
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ public sealed class WizardSpellsSystem : EntitySystem
|
|||||||
_handsSystem.TryForcePickupAnyHand(msg.Performer, recallComponent.Item.Value);
|
_handsSystem.TryForcePickupAnyHand(msg.Performer, recallComponent.Item.Value);
|
||||||
|
|
||||||
msg.Handled = true;
|
msg.Handled = true;
|
||||||
|
Speak(msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,16 @@ public sealed partial class MeleeThrowOnHitComponent : Component
|
|||||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
[AutoNetworkedField]
|
[AutoNetworkedField]
|
||||||
public bool Enabled = true;
|
public bool Enabled = true;
|
||||||
|
|
||||||
|
// WD START
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[AutoNetworkedField]
|
||||||
|
public float StunTime;
|
||||||
|
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[AutoNetworkedField]
|
||||||
|
public bool ThrowOnThrowHit;
|
||||||
|
// WD END
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Content.Shared.Construction.Components;
|
using Content.Shared.Construction.Components;
|
||||||
|
using Content.Shared.Stunnable;
|
||||||
|
using Content.Shared.Throwing;
|
||||||
using Content.Shared.Weapons.Melee.Components;
|
using Content.Shared.Weapons.Melee.Components;
|
||||||
using Content.Shared.Weapons.Melee.Events;
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
@@ -18,22 +20,67 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
|
|||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||||
|
[Dependency] private readonly SharedStunSystem _stun = default!; // WD
|
||||||
|
[Dependency] private readonly ThrownItemSystem _thrownItem = default!; // WD
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
|
SubscribeLocalEvent<MeleeThrowOnHitComponent, ThrowDoHitEvent>(OnDoHit); // WD
|
||||||
|
|
||||||
SubscribeLocalEvent<MeleeThrowOnHitComponent, MeleeHitEvent>(OnMeleeHit);
|
SubscribeLocalEvent<MeleeThrowOnHitComponent, MeleeHitEvent>(OnMeleeHit);
|
||||||
SubscribeLocalEvent<MeleeThrownComponent, ComponentStartup>(OnThrownStartup);
|
SubscribeLocalEvent<MeleeThrownComponent, ComponentStartup>(OnThrownStartup);
|
||||||
SubscribeLocalEvent<MeleeThrownComponent, ComponentShutdown>(OnThrownShutdown);
|
SubscribeLocalEvent<MeleeThrownComponent, ComponentShutdown>(OnThrownShutdown);
|
||||||
SubscribeLocalEvent<MeleeThrownComponent, StartCollideEvent>(OnStartCollide);
|
SubscribeLocalEvent<MeleeThrownComponent, StartCollideEvent>(OnStartCollide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDoHit(Entity<MeleeThrowOnHitComponent> ent, ref ThrowDoHitEvent args) // WD
|
||||||
|
{
|
||||||
|
if (!ent.Comp.ThrowOnThrowHit)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!CanThrowOnHit(ent, args.Target))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!TryComp(ent, out PhysicsComponent? physics))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var velocity = physics.LinearVelocity.Normalized() * ent.Comp.Speed;
|
||||||
|
|
||||||
|
RemComp<MeleeThrownComponent>(args.Target);
|
||||||
|
var thrownComp = new MeleeThrownComponent
|
||||||
|
{
|
||||||
|
Velocity = velocity,
|
||||||
|
Lifetime = ent.Comp.Lifetime,
|
||||||
|
MinLifetime = ent.Comp.MinLifetime
|
||||||
|
};
|
||||||
|
AddComp(args.Target, thrownComp);
|
||||||
|
if (ent.Comp.StunTime != 0f)
|
||||||
|
_stun.TryParalyze(args.Target, TimeSpan.FromSeconds(ent.Comp.StunTime), true);
|
||||||
|
|
||||||
|
_thrownItem.LandComponent(ent, args.Component, physics, false);
|
||||||
|
_physics.SetLinearVelocity(ent, Vector2.Zero);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnMeleeHit(Entity<MeleeThrowOnHitComponent> ent, ref MeleeHitEvent args)
|
private void OnMeleeHit(Entity<MeleeThrowOnHitComponent> ent, ref MeleeHitEvent args)
|
||||||
{
|
{
|
||||||
var (_, comp) = ent;
|
var (_, comp) = ent;
|
||||||
if (!args.IsHit)
|
if (!args.IsHit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// WD START
|
||||||
|
var stunTime = comp.StunTime;
|
||||||
|
var speed = comp.Speed;
|
||||||
|
var lifetime = comp.Lifetime;
|
||||||
|
|
||||||
|
if (args.Direction != null) // Heavy attack
|
||||||
|
{
|
||||||
|
stunTime = 0f;
|
||||||
|
speed *= 0.5f;
|
||||||
|
lifetime *= 0.5f;
|
||||||
|
}
|
||||||
|
// WD END
|
||||||
|
|
||||||
var mapPos = _transform.GetMapCoordinates(args.User).Position;
|
var mapPos = _transform.GetMapCoordinates(args.User).Position;
|
||||||
foreach (var hit in args.HitEntities)
|
foreach (var hit in args.HitEntities)
|
||||||
{
|
{
|
||||||
@@ -55,11 +102,13 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
|
|||||||
RaiseLocalEvent(hit, ref ev);
|
RaiseLocalEvent(hit, ref ev);
|
||||||
var thrownComp = new MeleeThrownComponent
|
var thrownComp = new MeleeThrownComponent
|
||||||
{
|
{
|
||||||
Velocity = angle.Normalized() * comp.Speed,
|
Velocity = angle.Normalized() * speed, // WD EDIT
|
||||||
Lifetime = comp.Lifetime,
|
Lifetime = lifetime, // WD EDIT
|
||||||
MinLifetime = comp.MinLifetime
|
MinLifetime = comp.MinLifetime
|
||||||
};
|
};
|
||||||
AddComp(hit, thrownComp);
|
AddComp(hit, thrownComp);
|
||||||
|
if (stunTime != 0f)
|
||||||
|
_stun.TryParalyze(hit, TimeSpan.FromSeconds(stunTime), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
BIN
Resources/Audio/White/Magic/Mjolnir/hit.ogg
Normal file
BIN
Resources/Audio/White/Magic/Mjolnir/hit.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/White/Magic/Mjolnir/swing.ogg
Normal file
BIN
Resources/Audio/White/Magic/Mjolnir/swing.ogg
Normal file
Binary file not shown.
@@ -281,6 +281,7 @@
|
|||||||
sprite: Objects/Magic/magicactions.rsi
|
sprite: Objects/Magic/magicactions.rsi
|
||||||
state: summons
|
state: summons
|
||||||
event: !type:InstantRecallSpellEvent
|
event: !type:InstantRecallSpellEvent
|
||||||
|
speech: "GAR YOK!"
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: ActionTeleportSpell
|
id: ActionTeleportSpell
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
types:
|
types:
|
||||||
Slash: 30
|
Slash: 30
|
||||||
- type: Clothing
|
- type: Clothing
|
||||||
|
quickEquip: false
|
||||||
sprite: White/Objects/Weapons/Chaplain/spellblade.rsi
|
sprite: White/Objects/Weapons/Chaplain/spellblade.rsi
|
||||||
slots:
|
slots:
|
||||||
- back
|
- back
|
||||||
@@ -51,3 +52,55 @@
|
|||||||
inHandsOnly: true
|
inHandsOnly: true
|
||||||
closeOnHandDeselect: true
|
closeOnHandDeselect: true
|
||||||
- type: SpellBlade
|
- type: SpellBlade
|
||||||
|
|
||||||
|
- type: entity
|
||||||
|
name: мьёльнир
|
||||||
|
parent: BaseItem
|
||||||
|
id: Mjolnir
|
||||||
|
description: Могучий молот, заимствованный у Тора, бога грома. Он трещит от едва сдерживаемой силы.
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
sprite: White/Objects/Weapons/mjolnir.rsi
|
||||||
|
state: icon
|
||||||
|
- type: MeleeWeapon
|
||||||
|
wideAnimationRotation: -135
|
||||||
|
attackRate: 0.75
|
||||||
|
damage:
|
||||||
|
types:
|
||||||
|
Blunt: 25
|
||||||
|
Structural: 20
|
||||||
|
soundHit:
|
||||||
|
path: /Audio/White/Magic/Mjolnir/hit.ogg
|
||||||
|
soundSwing:
|
||||||
|
path: /Audio/White/Magic/Mjolnir/swing.ogg
|
||||||
|
- type: Wieldable
|
||||||
|
- type: IncreaseDamageOnWield
|
||||||
|
damage:
|
||||||
|
types:
|
||||||
|
Blunt: 15
|
||||||
|
Structural: 60
|
||||||
|
- type: Item
|
||||||
|
size: Huge
|
||||||
|
sprite: White/Objects/Weapons/mjolnir.rsi
|
||||||
|
- type: Clothing
|
||||||
|
quickEquip: false
|
||||||
|
sprite: White/Objects/Weapons/mjolnir.rsi
|
||||||
|
slots:
|
||||||
|
- back
|
||||||
|
- suitStorage
|
||||||
|
- type: DisarmMalus
|
||||||
|
- type: MeleeThrowOnHit
|
||||||
|
lifetime: 0.05
|
||||||
|
minLifetime: 0.01
|
||||||
|
speed: 20
|
||||||
|
stunTime: 1.5
|
||||||
|
throwOnThrowHit: true
|
||||||
|
- type: DamageOtherOnHit
|
||||||
|
sound:
|
||||||
|
path: /Audio/White/Magic/Mjolnir/hit.ogg
|
||||||
|
damage:
|
||||||
|
types:
|
||||||
|
Blunt: 40
|
||||||
|
Structural: 80
|
||||||
|
- type: ChangeThrowForce
|
||||||
|
throwForce: 20
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: Холод
|
name: Холод
|
||||||
description: Клинок заклинаний наделяется замораживать врагов. И тот, кто удерживает клинок в руках, становится неуязвимым к низкой температуре.
|
description: Клинок заклинаний наделяется способностью замораживать врагов. И тот, кто удерживает клинок в руках, становится неуязвимым к низкой температуре.
|
||||||
id: AspectFrost
|
id: AspectFrost
|
||||||
noSpawn: true
|
noSpawn: true
|
||||||
components:
|
components:
|
||||||
|
|||||||
@@ -260,3 +260,16 @@
|
|||||||
conditions:
|
conditions:
|
||||||
- !type:ListingLimitedStockCondition
|
- !type:ListingLimitedStockCondition
|
||||||
stock: 1
|
stock: 1
|
||||||
|
|
||||||
|
- type: listing
|
||||||
|
id: SpellBookMjolnir
|
||||||
|
name: spellbook-mjolnir-name
|
||||||
|
description: spellbook-mjolnir-desc
|
||||||
|
productEntity: Mjolnir
|
||||||
|
cost:
|
||||||
|
SpellPoint: 2
|
||||||
|
categories:
|
||||||
|
- MagicItems
|
||||||
|
conditions:
|
||||||
|
- !type:ListingLimitedStockCondition
|
||||||
|
stock: 1
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 568 B |
BIN
Resources/Textures/White/Objects/Weapons/mjolnir.rsi/icon.png
Normal file
BIN
Resources/Textures/White/Objects/Weapons/mjolnir.rsi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 686 B |
Binary file not shown.
|
After Width: | Height: | Size: 681 B |
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"license": "CC-BY-SA-3.0",
|
||||||
|
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/pull/49264/commits/d0dffe7ca643db2624424fdcebf45863f85c0448",
|
||||||
|
"size": {
|
||||||
|
"x": 32,
|
||||||
|
"y": 32
|
||||||
|
},
|
||||||
|
"states": [
|
||||||
|
{
|
||||||
|
"name": "icon",
|
||||||
|
"delays": [
|
||||||
|
[
|
||||||
|
2,
|
||||||
|
0.1,
|
||||||
|
0.1,
|
||||||
|
0.1,
|
||||||
|
0.1,
|
||||||
|
0.1,
|
||||||
|
0.1,
|
||||||
|
0.1
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inhand-left",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inhand-right",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "wielded-inhand-left",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "wielded-inhand-right",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "equipped-BACKPACK",
|
||||||
|
"directions": 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 695 B |
Binary file not shown.
|
After Width: | Height: | Size: 684 B |
Reference in New Issue
Block a user