Added fun: Darts (#20582)

* add textures

* fix cargo/cargo-fun.ftl

* fix cargo/cargo-fun.ftl again

* update icons and resize hitbox

* really fixed cargo.ftl

* fix soundSpecifier

* balance changes: solution transfer has been reduced from 2 to 1. Now the transfer does not work on targets wearing anything in the outerclothing slot

* add hypodart to uplink

* return of darts solution capacity to 2u

* Update uplink-catalog.ftl

* Update uplink_catalog.yml

* Update darts.yml

* remove hypodart sprite

* Update darts.yml

* Update fun.yml

* add random popups component, resprite dartboard

* localize darts

* fix

* Update darts.yml
This commit is contained in:
Ed
2023-10-19 06:55:30 +03:00
committed by GitHub
parent 8d070d4758
commit 9bb62181de
29 changed files with 389 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
using Content.Server.Damage.Systems;
namespace Content.Server.Damage.Components;
[RegisterComponent, Access(typeof(DamageRandomPopupSystem))]
/// <summary>
/// Outputs a random pop-up from the list when an object receives damage
/// </summary>
public sealed partial class DamageRandomPopupComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public List<LocId> Popups = new();
}

View File

@@ -0,0 +1,27 @@
using Content.Server.Damage.Components;
using Content.Server.Popups;
using Content.Shared.Damage;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.Damage.Systems;
/// <summary>
/// Outputs a random pop-up from the strings list when an object receives damage
/// </summary>
public sealed class DamageRandomPopupSystem : EntitySystem
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<DamageRandomPopupComponent, DamageChangedEvent>(OnDamageChange);
}
private void OnDamageChange(EntityUid uid, DamageRandomPopupComponent component, DamageChangedEvent args)
{
_popupSystem.PopupEntity(Loc.GetString(_random.Pick(component.Popups)), uid);
}
}

View File

@@ -0,0 +1,6 @@
darts-popup-bullseye = Bullseye! 50 points!
darts-popup-25 = 25 points
darts-popup-10 = 10 points
darts-popup-5 = 5 points
darts-popup-1 = 1 point
darts-popup-miss = Miss

View File

@@ -21,3 +21,6 @@ ent-FunWaterGuns = { ent-CrateFunWaterGuns }
ent-FunParty = { ent-CrateFunParty }
.desc = { ent-CrateFunParty.desc }
ent-FunDartsSet = { ent-CrateFunDartsSet }
.desc = { ent-CrateFunDartsSet.desc }

View File

@@ -51,3 +51,6 @@ ent-CrateFunBikeHornImplants = Bike Horn Implants
ent-CrateFunMysteryFigurines = Mystery Figure Crate
.desc = A collection of 10 Mystery Figurine boxes. Duplicates non refundable.
ent-CrateFunDartsSet = Dartboard Box Set
.desc = A box with everything you need for a fun game of darts.

View File

@@ -187,3 +187,13 @@
cost: 4000
category: Fun
group: market
- type: cargoProduct
id: FunDartsSet
icon:
sprite: Objects/Fun/Darts/dart_red.rsi
state: icon
product: CrateFunDartsSet
cost: 900
category: Fun
group: market

View File

@@ -426,3 +426,28 @@
state: box
- type: RadiationBlockingContainer
resistance: 2
- type: entity
name: darts box
parent: BoxCardboard
id: BoxDarts
description: This box filled with colorful darts.
components:
- type: Item
size: 40
- type: StorageFill
contents:
- id: Dart
amount: 5
- id: DartBlue
amount: 5
- id: DartPurple
amount: 5
- id: DartYellow
amount: 5
- type: Storage
capacity: 40
- type: Sprite
layers:
- state: box
- state: darts

View File

@@ -290,3 +290,20 @@
- id: MysteryFigureBox
amount: 15
prob: 0.05
- type: entity
name: Dartboard Box Set
description: A box with everything you need for a fun game of darts.
id: CrateFunDartsSet
parent: CratePlastic
components:
- type: StorageFill
contents:
- id: TargetDarts
amount: 1
- id: BoxDarts
amount: 1
- id: BoxDarts
amount: 1
prob: 0.05

View File

@@ -0,0 +1,176 @@
- type: entity
name: dart
description: light throwing dart for playing darts. Don't get in the eye!
parent: BaseItem
id: Dart
components:
- type: EmbeddableProjectile
minimumSpeed: 3
removalTime: 0.5
offset: 0.0,0.0
- type: ThrowingAngle
angle: 315
- type: Fixtures
fixtures:
fix1:
shape: !type:PolygonShape
vertices:
- -0.20,0.10
- -0.10,0.20
- 0.20,-0.10
- 0.10,-0.20
density: 20
mask:
- ItemMask
restitution: 0.3
friction: 0.2
- type: Sprite
sprite: Objects/Fun/Darts/dart_red.rsi
state: icon
- type: MeleeWeapon
damage:
types:
Piercing: 2
angle: 0
animation: WeaponArcThrust
soundHit:
path: /Audio/Weapons/pierce.ogg
- type: DamageOtherOnHit
damage:
types:
Piercing: 4
- type: Item
size: 2
sprite: Objects/Fun/Darts/dart_red.rsi
- type: ItemCooldown
- type: SolutionContainerManager
solutions:
melee:
maxVol: 2
- type: MeleeChemicalInjector
solution: melee
- type: RefillableSolution
solution: melee
- type: InjectableSolution
solution: melee
- type: SolutionInjectOnCollide
transferAmount: 2
blockSlots: OUTERCLOTHING
- type: SolutionTransfer
maxTransferAmount: 2
- type: Damageable
damageContainer: Inorganic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 30 #excess damage avoids cost of spawning entities.
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 20
behaviors:
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
- !type:SpawnEntitiesBehavior
spawn:
PartRodMetal1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Appearance
- type: SolutionContainerVisuals
maxFillLevels: 1
fillBaseName: dart
- type: entity
parent: Dart
id: DartBlue
components:
- type: Sprite
sprite: Objects/Fun/Darts/dart_blue.rsi
- type: Item
sprite: Objects/Fun/Darts/dart_blue.rsi
- type: entity
parent: Dart
id: DartPurple
components:
- type: Sprite
sprite: Objects/Fun/Darts/dart_purple.rsi
- type: Item
sprite: Objects/Fun/Darts/dart_purple.rsi
- type: entity
parent: Dart
id: DartYellow
components:
- type: Sprite
sprite: Objects/Fun/Darts/dart_yellow.rsi
- type: Item
sprite: Objects/Fun/Darts/dart_yellow.rsi
- type: entity
name: dartboard
id: TargetDarts
parent: BaseStructureDynamic
description: A target for playing darts.
components:
- type: Sprite
sprite: Objects/Fun/Darts/target.rsi
state: target_dart
noRot: true
- type: Fixtures
fixtures:
fix1:
shape:
!type:PhysShapeCircle
radius: 0.35
density: 50
mask:
- FullTileMask
layer:
- WallLayer
- type: InteractionOutline
- type: Physics
- type: Damageable
- type: DamageRandomPopup
popups:
- darts-popup-bullseye
- darts-popup-25
- darts-popup-10
- darts-popup-10
- darts-popup-5
- darts-popup-5
- darts-popup-5
- darts-popup-1
- darts-popup-1
- darts-popup-1
- darts-popup-miss
- darts-popup-miss
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 500
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 300
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
MaterialWoodPlank:
min: 5
max: 5
- !type:PlaySoundBehavior
sound:
path: /Audio/Effects/tree_fell.ogg
- !type:DoActsBehavior
acts: [ "Destruction" ]

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

View File

@@ -0,0 +1,22 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "icon"
},
{
"name": "inhand-left",
"directions": 4
},
{
"name": "inhand-right",
"directions": 4
}
]
}

View File

@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "target_dart"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

View File

@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/cc65477c04f7403ca8a457bd5bae69a01abadbf0, encryptokey was taken from Baystation12 at https://github.com/infinitystation/Baystation12/blob/073f678cdce92edb8fcd55f9ffc9f0523bf31506/icons/obj/radio.dmi and modified by lapatison. boxwidetoy, shelltoy, swab, flare, inflatable, trashbag, magazine, holo and forensic created by potato1234x (github) for ss14 based on toys.rsi, mouth_swab.rsi, flare.rsi, inflatable_wall.rsi, trashbag.rsi, caseless_pistol_mag.rsi, guardians.rsi and bureaucracy.rsi respectively",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/cc65477c04f7403ca8a457bd5bae69a01abadbf0, encryptokey was taken from Baystation12 at https://github.com/infinitystation/Baystation12/blob/073f678cdce92edb8fcd55f9ffc9f0523bf31506/icons/obj/radio.dmi and modified by lapatison. boxwidetoy, shelltoy, swab, flare, inflatable, trashbag, magazine, holo and forensic created by potato1234x (github) for ss14 based on toys.rsi, mouth_swab.rsi, flare.rsi, inflatable_wall.rsi, trashbag.rsi, caseless_pistol_mag.rsi, guardians.rsi and bureaucracy.rsi respectively, darts made by TheShuEd (github) for ss14",
"size": {
"x": 32,
"y": 32
@@ -196,6 +196,9 @@
},
{
"name": "ziptie"
},
{
"name": "darts"
}
]
}