--- /dev/null
+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();
+}
--- /dev/null
+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);
+ }
+}
--- /dev/null
+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
\ No newline at end of file
.desc = { ent-CrateFunATV.desc }
ent-FunWaterGuns = { ent-CrateFunWaterGuns }
- .desc = { ent-CrateFunWaterGuns.desc }
+ .desc = { ent-CrateFunWaterGuns.desc }
ent-FunParty = { ent-CrateFunParty }
- .desc = { ent-CrateFunParty.desc }
\ No newline at end of file
+ .desc = { ent-CrateFunParty.desc }
+
+ent-FunDartsSet = { ent-CrateFunDartsSet }
+ .desc = { ent-CrateFunDartsSet.desc }
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.
product: CrateFunMysteryFigurines
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
\ No newline at end of file
- type: Sprite
state: box
- type: RadiationBlockingContainer
- resistance: 2
\ No newline at end of file
+ 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
\ No newline at end of file
- 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
+
--- /dev/null
+- 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" ]
--- /dev/null
+{
+ "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
+ }
+ ]
+}
--- /dev/null
+{
+ "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
+ }
+ ]
+}
--- /dev/null
+{
+ "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
+ }
+ ]
+}
--- /dev/null
+{
+ "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
+ }
+ ]
+}
--- /dev/null
+{
+ "version": 1,
+ "license": "CC-BY-SA-3.0",
+ "copyright": "Made by TheShuEd (github) for ss14",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "target_dart"
+ }
+ ]
+}
{
"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
},
{
"name": "ziptie"
+ },
+ {
+ "name": "darts"
}
]
}