Самодельные отражайки (#6)
* Ghetto Mirror Shield * Protorypes for ghetto mirrors * locale * idk, works fine on my machine * forsenPls (cherry picked from commit 4505739fd9430bcc578da3dec932d9aa7ca933ca)
@@ -0,0 +1,25 @@
|
|||||||
|
using Content.Shared.Damage;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
// WD Engi Exclusive
|
||||||
|
namespace Content.Shared.DamageableClothing;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This component goes on an equippable item that should take damage while in use.
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||||
|
public sealed partial class DamageableClothingComponent : Component
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The entity that's wearing the item.
|
||||||
|
/// </summary>
|
||||||
|
[ViewVariables, AutoNetworkedField]
|
||||||
|
public EntityUid? User;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The damage modifier to use on item.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public DamageModifierSet DamageModifier = default!;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// WD Engi Exclusive
|
||||||
|
namespace Content.Shared.DamageableClothing;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This component gets dynamically added to an Entity via the <see cref="DamageableClothing"/>
|
||||||
|
/// </summary>
|
||||||
|
[RegisterComponent]
|
||||||
|
public sealed partial class DamageableClothingUserComponent : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The entity that's also being damaged.
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public EntityUid? ItemId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
using Robust.Shared.Timing;
|
||||||
|
using Content.Shared.Inventory.Events;
|
||||||
|
// WD Engi Exclusive
|
||||||
|
namespace Content.Shared.DamageableClothing;
|
||||||
|
|
||||||
|
public sealed partial class DamageableClothingSystem : EntitySystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
InitializeUser();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<DamageableClothingComponent, GotEquippedEvent>(OnEquipped);
|
||||||
|
SubscribeLocalEvent<DamageableClothingComponent, GotUnequippedEvent>(OnUnequipped);
|
||||||
|
SubscribeLocalEvent<DamageableClothingComponent, ComponentShutdown>(OnShutdown);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEquipped(EntityUid uid, DamageableClothingComponent component, GotEquippedEvent args)
|
||||||
|
{
|
||||||
|
if (_gameTiming.ApplyingState)
|
||||||
|
return;
|
||||||
|
component.User = args.Equipee;
|
||||||
|
var userComp = EnsureComp<DamageableClothingUserComponent>(args.Equipee);
|
||||||
|
userComp.ItemId = args.Equipment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUnequipped(EntityUid uid, DamageableClothingComponent component, GotUnequippedEvent args)
|
||||||
|
{
|
||||||
|
RemCompDeferred<DamageableClothingUserComponent>(args.Equipee);
|
||||||
|
component.User = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnShutdown(EntityUid uid, DamageableClothingComponent component, ComponentShutdown args)
|
||||||
|
{
|
||||||
|
if (component.User != null)
|
||||||
|
{
|
||||||
|
RemCompDeferred<DamageableClothingUserComponent>(component.User.Value);
|
||||||
|
component.User = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
using Content.Shared.Damage;
|
||||||
|
// WD Engi Exclusive
|
||||||
|
namespace Content.Shared.DamageableClothing;
|
||||||
|
|
||||||
|
public sealed partial class DamageableClothingSystem
|
||||||
|
{
|
||||||
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||||
|
|
||||||
|
private void InitializeUser()
|
||||||
|
{
|
||||||
|
SubscribeLocalEvent<DamageableClothingUserComponent, DamageModifyEvent>(OnUserDamageModified);
|
||||||
|
SubscribeLocalEvent<DamageableClothingComponent, DamageModifyEvent>(OnDamageModified);
|
||||||
|
SubscribeLocalEvent<DamageableClothingUserComponent, EntityTerminatingEvent>(OnEntityTerminating);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnUserDamageModified(EntityUid uid, DamageableClothingUserComponent component, DamageModifyEvent args)
|
||||||
|
{
|
||||||
|
if (TryComp<DamageableClothingComponent>(component.ItemId, out var blocking))
|
||||||
|
{
|
||||||
|
if (args.Damage.GetTotal() <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!TryComp<DamageableComponent>(component.ItemId, out var dmgComp))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var blockFraction = 1;
|
||||||
|
blockFraction = Math.Clamp(blockFraction, 0, 1);
|
||||||
|
_damageable.TryChangeDamage(component.ItemId, blockFraction * args.OriginalDamage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDamageModified(EntityUid uid, DamageableClothingComponent component, DamageModifyEvent args)
|
||||||
|
{
|
||||||
|
var modifier = component.DamageModifier;
|
||||||
|
args.Damage = DamageSpecifier.ApplyModifierSet(args.Damage, modifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnEntityTerminating(EntityUid uid, DamageableClothingUserComponent component, ref EntityTerminatingEvent args)
|
||||||
|
{
|
||||||
|
if (!TryComp<DamageableClothingComponent>(component.ItemId, out var blockingComponent))
|
||||||
|
return;
|
||||||
|
|
||||||
|
RemCompDeferred<DamageableClothingUserComponent>(uid);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
ent-ClothingOuterArmorReflectiveGhetto = самодельный отражающий жилет
|
||||||
|
.desc = Два зеркала соединённые проводами для сомнительной защиты от лазеров.
|
||||||
2
Resources/Locale/ru-RU/White/ghetto-mirror-shield.ftl
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ent-MirrorShieldGhetto = самодельный зеркальный щит
|
||||||
|
.desc = Сделанное на скорую руку зеркало с рукояткой для использования как сомнительная защита от лазеров.
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
- type: entity # WD Engi Exclusive
|
||||||
|
parent: ClothingOuterArmorBasic
|
||||||
|
id: ClothingOuterArmorReflectiveGhetto
|
||||||
|
name: makeshift reflective vest
|
||||||
|
description: Two mirrors connected by wires for dubious laser protection.
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
sprite: White/Clothing/OuterClothing/armor_reflect_ghetto.rsi
|
||||||
|
state: icon
|
||||||
|
- type: Clothing
|
||||||
|
sprite: White/Clothing/OuterClothing/armor_reflect_ghetto.rsi
|
||||||
|
- type: Armor
|
||||||
|
modifiers:
|
||||||
|
coefficients:
|
||||||
|
Slash: 0.9
|
||||||
|
Heat: 0.7
|
||||||
|
- type: Reflect
|
||||||
|
reflectProb: 0.7
|
||||||
|
innate: true
|
||||||
|
placement:
|
||||||
|
- Body
|
||||||
|
reflects:
|
||||||
|
- Energy
|
||||||
|
- type: Construction
|
||||||
|
graph: ClothingOuterArmorReflectiveGhetto
|
||||||
|
node: vest
|
||||||
|
- type: DamageableClothing
|
||||||
|
damageModifier:
|
||||||
|
coefficients:
|
||||||
|
Blunt: 2
|
||||||
|
Slash: 0.9
|
||||||
|
Piercing: 1.5
|
||||||
|
Heat: .5
|
||||||
|
flatReductions:
|
||||||
|
Heat: 0.5
|
||||||
|
- type: Damageable
|
||||||
|
damageContainer: Shield
|
||||||
|
- type: Destructible
|
||||||
|
thresholds:
|
||||||
|
- trigger:
|
||||||
|
!type:DamageTrigger
|
||||||
|
damage: 60
|
||||||
|
behaviors:
|
||||||
|
- !type:DoActsBehavior
|
||||||
|
acts: [ "Destruction" ]
|
||||||
|
- !type:PlaySoundBehavior
|
||||||
|
sound:
|
||||||
|
collection: GlassBreak
|
||||||
|
- !type:SpawnEntitiesBehavior
|
||||||
|
spawn:
|
||||||
|
ShardGlass:
|
||||||
|
min: 3
|
||||||
|
max: 5
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
- type: entity # WD Engi Exclusive
|
||||||
|
name: makeshift mirror shield
|
||||||
|
parent: BaseItem
|
||||||
|
id: MirrorShieldGhetto
|
||||||
|
description: A makeshift mirror with a handle, used as dubious laser protection.
|
||||||
|
components:
|
||||||
|
- type: Sprite
|
||||||
|
sprite: White/Objects/Weapons/ghetto_mirror_shield.rsi
|
||||||
|
state: icon
|
||||||
|
- type: Item
|
||||||
|
sprite: White/Objects/Weapons/ghetto_mirror_shield.rsi
|
||||||
|
size: Ginormous
|
||||||
|
- type: Tag
|
||||||
|
tags:
|
||||||
|
- MirrorShieldGhetto
|
||||||
|
- type: Reflect
|
||||||
|
reflectProb: 0.7
|
||||||
|
innate: true
|
||||||
|
reflects:
|
||||||
|
- Energy
|
||||||
|
- type: Blocking
|
||||||
|
passiveBlockModifier:
|
||||||
|
coefficients:
|
||||||
|
Blunt: 2
|
||||||
|
Slash: 0.9
|
||||||
|
Piercing: 1.5
|
||||||
|
Heat: .6
|
||||||
|
activeBlockModifier:
|
||||||
|
coefficients:
|
||||||
|
Blunt: 2
|
||||||
|
Slash: 0.9
|
||||||
|
Piercing: 1.5
|
||||||
|
Heat: .3
|
||||||
|
flatReductions:
|
||||||
|
Heat: 0.5
|
||||||
|
blockSound: !type:SoundPathSpecifier
|
||||||
|
path: /Audio/Effects/glass_step.ogg
|
||||||
|
- type: MeleeBlock
|
||||||
|
- type: Damageable
|
||||||
|
damageContainer: Shield
|
||||||
|
- type: Construction
|
||||||
|
graph: MirrorShieldGhetto
|
||||||
|
node: shield
|
||||||
|
- type: Destructible
|
||||||
|
thresholds:
|
||||||
|
- trigger:
|
||||||
|
!type:DamageTrigger
|
||||||
|
damage: 40
|
||||||
|
behaviors:
|
||||||
|
- !type:DoActsBehavior
|
||||||
|
acts: [ "Destruction" ]
|
||||||
|
- !type:PlaySoundBehavior
|
||||||
|
sound:
|
||||||
|
collection: GlassBreak
|
||||||
|
- !type:SpawnEntitiesBehavior
|
||||||
|
spawn:
|
||||||
|
ShardGlass:
|
||||||
|
min: 2
|
||||||
|
max: 3
|
||||||
|
- type: StaticPrice
|
||||||
|
price: 50
|
||||||
|
- type: DisarmMalus
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# WD Engi Exclusive
|
||||||
|
- type: constructionGraph
|
||||||
|
id: MirrorShieldGhetto
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: shield
|
||||||
|
steps:
|
||||||
|
- material: Glass
|
||||||
|
amount: 5
|
||||||
|
doAfter: 3
|
||||||
|
- material: Steel
|
||||||
|
amount: 3
|
||||||
|
doAfter: 3
|
||||||
|
- node: shield
|
||||||
|
entity: MirrorShieldGhetto
|
||||||
|
|
||||||
|
- type: constructionGraph
|
||||||
|
id: ClothingOuterArmorReflectiveGhetto
|
||||||
|
start: start
|
||||||
|
graph:
|
||||||
|
- node: start
|
||||||
|
edges:
|
||||||
|
- to: vest
|
||||||
|
steps:
|
||||||
|
- material: Cable
|
||||||
|
amount: 5
|
||||||
|
- tag: MirrorShieldGhetto
|
||||||
|
name: самодельный зеркальный щит
|
||||||
|
icon:
|
||||||
|
sprite: White/Objects/Weapons/ghetto_mirror_shield.rsi
|
||||||
|
state: icon
|
||||||
|
amount: 1
|
||||||
|
- tag: MirrorShieldGhetto
|
||||||
|
name: самодельный зеркальный щит
|
||||||
|
icon:
|
||||||
|
sprite: White/Objects/Weapons/ghetto_mirror_shield.rsi
|
||||||
|
state: icon
|
||||||
|
amount: 1
|
||||||
|
doAfter: 6
|
||||||
|
- node: vest
|
||||||
|
entity: ClothingOuterArmorReflectiveGhetto
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# WD Engi Exclusive
|
||||||
|
- type: construction
|
||||||
|
name: самодельный зеркальный щит
|
||||||
|
id: MirrorShieldGhetto
|
||||||
|
graph: MirrorShieldGhetto
|
||||||
|
startNode: start
|
||||||
|
targetNode: shield
|
||||||
|
category: construction-category-weapons
|
||||||
|
objectType: Item
|
||||||
|
description: Сделанное на скорую руку зеркало с рукояткой для использования как сомнительная защита от лазеров.
|
||||||
|
icon:
|
||||||
|
sprite: White/Objects/Weapons/ghetto_mirror_shield.rsi
|
||||||
|
state: icon
|
||||||
|
|
||||||
|
- type: construction
|
||||||
|
name: самодельный отражающий жилет
|
||||||
|
id: ClothingOuterArmorReflectiveGhetto
|
||||||
|
graph: ClothingOuterArmorReflectiveGhetto
|
||||||
|
startNode: start
|
||||||
|
targetNode: vest
|
||||||
|
category: construction-category-clothing
|
||||||
|
objectType: Item
|
||||||
|
description: Два зеркала соединённые проводами для сомнительной защиты от лазеров.
|
||||||
|
icon:
|
||||||
|
sprite: White/Clothing/OuterClothing/armor_reflect_ghetto.rsi
|
||||||
|
state: icon
|
||||||
@@ -120,3 +120,7 @@
|
|||||||
|
|
||||||
- type: Tag
|
- type: Tag
|
||||||
id: VoiceActivatedBombImplant
|
id: VoiceActivatedBombImplant
|
||||||
|
|
||||||
|
# WD Engi Exclusive
|
||||||
|
- type: Tag
|
||||||
|
id: MirrorShieldGhetto
|
||||||
|
|||||||
|
After Width: | Height: | Size: 576 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 610 B |
|
After Width: | Height: | Size: 607 B |
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"license": "CC-BY-SA-3.0",
|
||||||
|
"copyright": "stepppasha",
|
||||||
|
"size": {
|
||||||
|
"x": 32,
|
||||||
|
"y": 32
|
||||||
|
},
|
||||||
|
"states": [
|
||||||
|
{
|
||||||
|
"name": "icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "equipped-OUTERCLOTHING",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inhand-left",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inhand-right",
|
||||||
|
"directions": 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 330 B |
|
After Width: | Height: | Size: 758 B |
|
After Width: | Height: | Size: 697 B |
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"license": "CC-BY-SA-3.0",
|
||||||
|
"copyright": "Taken from https://github.com/Citadel-Station-13/Citadel-Station-13/commit/84223c65f5caf667a84f3c0f49bc2a41cdc6c4e3",
|
||||||
|
"size": {
|
||||||
|
"x": 32,
|
||||||
|
"y": 32
|
||||||
|
},
|
||||||
|
"states": [
|
||||||
|
{
|
||||||
|
"name": "icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inhand-right",
|
||||||
|
"directions": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "inhand-left",
|
||||||
|
"directions": 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||