Merge pull request #1190 from metalgearsloth/weapon_anims

Port TG weapon animations
This commit is contained in:
ShadowCommander
2020-06-24 03:51:18 -07:00
committed by GitHub
13 changed files with 161 additions and 17 deletions

View File

@@ -50,7 +50,7 @@ namespace Content.Client.GameObjects.EntitySystems
var lunge = attacker.EnsureComponent<MeleeLungeComponent>();
lunge.SetData(msg.Angle);
var entity = EntityManager.SpawnEntity("WeaponArc", attacker.Transform.GridPosition);
var entity = EntityManager.SpawnEntity(weaponArc.Prototype, attacker.Transform.GridPosition);
entity.Transform.LocalRotation = msg.Angle;
var weaponArcAnimation = entity.GetComponent<MeleeWeaponArcAnimationComponent>();

View File

@@ -10,6 +10,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
[Prototype("MeleeWeaponAnimation")]
public sealed class MeleeWeaponAnimationPrototype : IPrototype, IIndexedPrototype
{
private string _prototype;
private string _state;
private string _id;
private Vector4 _colorDelta;
@@ -21,6 +22,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
[ViewVariables] public string ID => _id;
[ViewVariables] public string State => _state;
[ViewVariables] public string Prototype => _prototype;
[ViewVariables] public TimeSpan Length => _length;
[ViewVariables] public float Speed => _speed;
[ViewVariables] public Vector4 Color => _color;
@@ -32,6 +34,7 @@ namespace Content.Shared.GameObjects.Components.Weapons.Melee
{
var serializer = YamlObjectSerializer.NewReader(mapping);
serializer.DataField(ref _prototype, "prototype", "WeaponArc");
serializer.DataField(ref _state, "state", null);
serializer.DataField(ref _id, "id", null);
serializer.DataField(ref _colorDelta, "colorDelta", Vector4.Zero);

View File

@@ -9,3 +9,10 @@
offset: 0.85, 0
drawdepth: Overlays
- type: MeleeWeaponArcAnimation
- type: entity
id: WeaponTGArc
parent: WeaponArc
components:
- type: Sprite
sprite: Effects/weapons/tg_arcs.rsi

View File

@@ -0,0 +1,68 @@
- type: MeleeWeaponAnimation
id: default
state: slash
arcType: Slash
length: 0.1
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: bite
prototype: WeaponTGArc
state: bite
arcType: Poke
length: 0.4
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: claw
prototype: WeaponTGArc
state: claw
arcType: Slash
length: 0.4
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: disarm
prototype: WeaponTGArc
state: disarm
arcType: Poke
length: 0.3
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: fist
state: fist
arcType: Poke
length: 0.15
speed: 1
- type: MeleeWeaponAnimation
id: kick
prototype: WeaponTGArc
state: kick
arcType: Poke
length: 0.3
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: punch
prototype: WeaponTGArc
state: punch
arcType: Poke
length: 0.5
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: smash
prototype: WeaponTGArc
state: smash
arcType: Poke
length: 0.3
color: 255,255,255,1020
colorDelta: 0,0,0,-5100

View File

@@ -1,14 +0,0 @@
- type: MeleeWeaponAnimation
id: default
state: slash
arcType: Slash
length: 0.1
color: 255,255,255,1020
colorDelta: 0,0,0,-5100
- type: MeleeWeaponAnimation
id: fist
state: fist
arcType: Poke
length: 0.15
speed: 1

View File

@@ -4,7 +4,6 @@
"x": 32,
"y": 32
},
"states": [
{
"name": "spear",

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,81 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "https://github.com/tgstation/tgstation/raw/c545428822f1ee0d402b812221518632dbe198cb/icons/effects/effects.dmi",
"states": [
{
"name": "bite",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "claw",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "disarm",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1
]
]
},
{
"name": "kick",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1
]
]
},
{
"name": "punch",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1
]
]
},
{
"name": "smash",
"directions": 1,
"delays": [
[
0.1,
0.1,
0.1
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB