Blocking and Shields (#8584)
* Blocking * Fixes Bodytype bug * Blocking Damage Modifier * Storing bodytype * Consolidates Stop Blocking code * Consolidates more methods * Some cleanup, hitbox fix * Shield Textures * Passive blocking modifier check * Localization, popups, and more cleanup * Small cleanup * Relay event * Fixes a shutdown bug, adds specific containers and sets * Popups and sounds * Fixes typo * Removes whitespace, adds comment * Some requested changes * Remove Shared * Audio fix * More changes * More requested changes * Properly remove on shutdown * Adds riot shields to seclathes * SecTech Riot shield * Constant variable * Relay transfer to user blocking system * More destruction behavior * Adds a shape field * Riot shield cleanup * More requested changes. * Prevents blocking attempt where a user cannot be anchored * Listen for anchor change * Unused using cleanup * More shields. * Buckler * Construction * Linter fix
This commit is contained in:
@@ -54,3 +54,11 @@
|
||||
description: vending-machine-action-description
|
||||
useDelay: 30
|
||||
event: !type:VendingMachineSelfDispenseEvent
|
||||
|
||||
- type: instantAction
|
||||
id: ToggleBlock
|
||||
name: action-name-blocking
|
||||
description: action-description-blocking
|
||||
icon: Objects/Weapons/Melee/shields.rsi/teleriot-icon.png
|
||||
iconOn: Objects/Weapons/Melee/shields.rsi/teleriot-on.png
|
||||
event: !type:ToggleActionEvent
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
- Flash
|
||||
- Handcuffs
|
||||
- Stunbaton
|
||||
- RiotShield
|
||||
- FlashPayload
|
||||
|
||||
- type: technology
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
ClothingEyesGlassesSunglasses: 2
|
||||
ClothingBeltSecurityWebbing: 5
|
||||
Zipties: 12
|
||||
RiotShield: 2
|
||||
RiotLaserShield: 2
|
||||
RiotBulletShield: 2
|
||||
# security officers need to follow a diet regimen!
|
||||
contrabandInventory:
|
||||
FoodDonutHomer: 12
|
||||
|
||||
@@ -15,3 +15,12 @@
|
||||
- Heat
|
||||
- Shock
|
||||
- Structural # this probably should be in separate container
|
||||
|
||||
- type: damageContainer
|
||||
id: Shield
|
||||
supportedGroups:
|
||||
- Brute
|
||||
supportedTypes:
|
||||
- Heat
|
||||
|
||||
|
||||
|
||||
@@ -151,3 +151,138 @@
|
||||
Bloodloss: 0.0 # no double dipping
|
||||
Cellular: 0.0
|
||||
|
||||
# Represents what a riot shield should block passively
|
||||
# Each shield will probably have their own passive and active modifier sets
|
||||
# Honestly it should not be too high
|
||||
- type: damageModifierSet
|
||||
id: PassiveRiotShieldBlock
|
||||
coefficients:
|
||||
Blunt: 0.9
|
||||
Slash: 0.9
|
||||
Piercing: 0.9
|
||||
Heat: 0.9
|
||||
|
||||
# Represents what a riot shield should block while active
|
||||
# Should be a higher reduction because you're anchored
|
||||
- type: damageModifierSet
|
||||
id: ActiveRiotShieldBlock
|
||||
coefficients:
|
||||
Blunt: 0.8
|
||||
Slash: 0.8
|
||||
Piercing: 0.8
|
||||
Heat: 0.8
|
||||
flatReductions:
|
||||
Blunt: 1
|
||||
Slash: 1
|
||||
Piercing: 1
|
||||
Heat: 1
|
||||
|
||||
- type: damageModifierSet
|
||||
id: PassiveRiotLaserShieldBlock
|
||||
coefficients:
|
||||
Heat: 0.8
|
||||
|
||||
- type: damageModifierSet
|
||||
id: ActiveRiotLaserShieldBlock
|
||||
coefficients:
|
||||
Heat: 0.7
|
||||
flatReductions:
|
||||
Heat: 2
|
||||
|
||||
- type: damageModifierSet
|
||||
id: PassiveRiotBulletShieldBlock
|
||||
coefficients:
|
||||
Blunt: 0.8
|
||||
Piercing: 0.8
|
||||
|
||||
- type: damageModifierSet
|
||||
id: ActiveRiotBulletShieldBlock
|
||||
coefficients:
|
||||
Blunt: 0.7
|
||||
Piercing: 0.7
|
||||
flatReductions:
|
||||
Blunt: 1.5
|
||||
Piercing: 1.5
|
||||
|
||||
#It's made from wood, so it should probably take more heat/laser damage
|
||||
- type: damageModifierSet
|
||||
id: PassiveBucklerBlock
|
||||
coefficients:
|
||||
Blunt: 0.95
|
||||
Slash: 0.95
|
||||
Piercing: 0.95
|
||||
Heat: 2
|
||||
|
||||
- type: damageModifierSet
|
||||
id: ActiveBucklerBlock
|
||||
coefficients:
|
||||
Blunt: 0.85
|
||||
Slash: 0.85
|
||||
Piercing: 0.85
|
||||
Heat: 2
|
||||
flatReductions:
|
||||
Blunt: 1
|
||||
Slash: 1
|
||||
Piercing: 1
|
||||
|
||||
#It's a really crummy shield
|
||||
- type: damageModifierSet
|
||||
id: PassiveMakeshiftBlock
|
||||
coefficients:
|
||||
Blunt: 0.95
|
||||
Slash: 0.95
|
||||
Piercing: 0.95
|
||||
Heat: 0.9
|
||||
|
||||
- type: damageModifierSet
|
||||
id: ActiveMakeshiftBlock
|
||||
coefficients:
|
||||
Blunt: 0.85
|
||||
Slash: 0.85
|
||||
Piercing: 0.85
|
||||
Heat: 0.8
|
||||
flatReductions:
|
||||
Blunt: 0.5
|
||||
Slash: 0.5
|
||||
Piercing: 0.5
|
||||
Heat: 1
|
||||
|
||||
#Clockwork generally takes more laser/heat damage
|
||||
- type: damageModifierSet
|
||||
id: PassiveClockworkShieldBlock
|
||||
coefficients:
|
||||
Blunt: 0.8
|
||||
Slash: 0.8
|
||||
Piercing: 0.8
|
||||
Heat: 1.5
|
||||
|
||||
- type: damageModifierSet
|
||||
id: ActiveClockworkShieldBlock
|
||||
coefficients:
|
||||
Blunt: 0.7
|
||||
Slash: 0.7
|
||||
Piercing: 0.7
|
||||
Heat: 1.5
|
||||
flatReductions:
|
||||
Blunt: 1
|
||||
Slash: 1
|
||||
Piercing: 1
|
||||
|
||||
#Mirror shield should reflect heat/laser eventually, but be relatively weak to everything else.
|
||||
- type: damageModifierSet
|
||||
id: PassiveMirrorShieldBlock
|
||||
coefficients:
|
||||
Blunt: 1.2
|
||||
Slash: 1.2
|
||||
Piercing: 1.2
|
||||
Heat: .7
|
||||
|
||||
- type: damageModifierSet
|
||||
id: ActiveMirrorShieldBlock
|
||||
coefficients:
|
||||
Blunt: 1.2
|
||||
Slash: 1.2
|
||||
Piercing: 1.2
|
||||
Heat: .6
|
||||
flatReductions:
|
||||
Heat: 1
|
||||
|
||||
194
Resources/Prototypes/Entities/Objects/Shields/shields.yml
Normal file
194
Resources/Prototypes/Entities/Objects/Shields/shields.yml
Normal file
@@ -0,0 +1,194 @@
|
||||
- type: entity
|
||||
name: base shield
|
||||
parent: BaseItem
|
||||
id: BaseShield
|
||||
description: A shield!
|
||||
abstract: true
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Weapons/Melee/shields.rsi
|
||||
state: riot-icon
|
||||
netsync: false
|
||||
- type: Item
|
||||
sprite: Objects/Weapons/Melee/shields.rsi
|
||||
size: 100
|
||||
HeldPrefix: riot
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveRiotShieldBlock
|
||||
activeBlockModifier: ActiveRiotShieldBlock
|
||||
blockingToggleAction:
|
||||
name: action-name-blocking
|
||||
description: action-description-blocking
|
||||
icon: Objects/Weapons/Melee/shields.rsi/teleriot-icon.png
|
||||
iconOn: Objects/Weapons/Melee/shields.rsi/teleriot-on.png
|
||||
event: !type:ToggleActionEvent
|
||||
- type: Damageable
|
||||
damageContainer: Shield
|
||||
- type: Destructible
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 40 #This is probably enough damage before it breaks
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- !type:PlaySoundBehavior
|
||||
sound: /Audio/Effects/metalbreak.ogg
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel:
|
||||
min: 5
|
||||
max: 5
|
||||
SheetGlass:
|
||||
min: 5
|
||||
max: 5
|
||||
|
||||
#Security Shields
|
||||
|
||||
- type: entity
|
||||
name: riot shield
|
||||
parent: BaseShield
|
||||
id: RiotShield
|
||||
description: A large tower shield. Good for controlling crowds.
|
||||
|
||||
- type: entity
|
||||
name: riot laser shield
|
||||
parent: BaseShield
|
||||
id: RiotLaserShield
|
||||
description: A riot shield built for withstanding lasers, but not much else.
|
||||
components:
|
||||
- type: Sprite
|
||||
state: riot_laser-icon
|
||||
- type: Item
|
||||
HeldPrefix: riot_laser
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveRiotLaserShieldBlock
|
||||
activeBlockModifier: ActiveRiotLaserShieldBlock
|
||||
|
||||
- type: entity
|
||||
name: riot bullet shield
|
||||
parent: BaseShield
|
||||
id: RiotBulletShield
|
||||
description: A ballistic riot shield built for withstanding bullets, but not much else.
|
||||
components:
|
||||
- type: Sprite
|
||||
state: riot_bullet-icon
|
||||
- type: Item
|
||||
HeldPrefix: riot_bullet
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveRiotBulletShieldBlock
|
||||
activeBlockModifier: ActiveRiotBulletShieldBlock
|
||||
|
||||
#Craftable shields
|
||||
|
||||
- type: entity
|
||||
name: wooden buckler
|
||||
parent: BaseShield
|
||||
id: WoodenBuckler
|
||||
description: A small round wooden makeshift shield.
|
||||
components:
|
||||
- type: Sprite
|
||||
state: buckler-icon
|
||||
- type: Item
|
||||
HeldPrefix: buckler
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveBucklerBlock
|
||||
activeBlockModifier: ActiveBucklerBlock
|
||||
- type: Construction
|
||||
graph: WoodenBuckler
|
||||
node: woodenBuckler
|
||||
- type: Destructible
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 30 #Weaker shield
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- !type:PlaySoundBehavior
|
||||
sound: /Audio/Effects/metalbreak.ogg
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
MaterialWoodPlank:
|
||||
min: 5
|
||||
max: 5
|
||||
|
||||
- type: entity
|
||||
name: makeshift shield
|
||||
parent: BaseShield
|
||||
id: MakeshiftShield
|
||||
description: A rundown looking shield, not good for much.
|
||||
components:
|
||||
- type: Sprite
|
||||
state: makeshift-icon
|
||||
- type: Item
|
||||
HeldPrefix: metal
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveMakeshiftBlock
|
||||
activeBlockModifier: ActiveMakeshiftBlock
|
||||
- type: Construction
|
||||
graph: MakeshiftShield
|
||||
node: makeshiftShield
|
||||
- type: Destructible
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 20 #Very weak shield
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- !type:PlaySoundBehavior
|
||||
sound: /Audio/Effects/metalbreak.ogg
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel:
|
||||
min: 1
|
||||
max: 2
|
||||
|
||||
#Magic/Cult Shields (give these to wizard for now)
|
||||
|
||||
- type: entity
|
||||
name: Clockwork Shield
|
||||
parent: BaseShield
|
||||
id: ClockworkShield
|
||||
description: Ratvar oyrffrf lbh jvgu uvf cebgrpgvba.
|
||||
components:
|
||||
- type: Sprite
|
||||
state: ratvarian-icon
|
||||
- type: Item
|
||||
HeldPrefix: ratvarian
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveClockworkShieldBlock
|
||||
activeBlockModifier: ActiveClockworkShieldBlock
|
||||
#Have it break into brass when clock cult is in
|
||||
|
||||
- type: entity
|
||||
name: Mirror Shield
|
||||
parent: BaseShield
|
||||
id: MirrorShield
|
||||
description: Eerily glows red... you hear the geometer whispering
|
||||
components:
|
||||
- type: Sprite
|
||||
state: mirror-icon
|
||||
- type: Item
|
||||
HeldPrefix: mirror
|
||||
- type: Blocking
|
||||
passiveBlockModifier: PassiveMirrorShieldBlock
|
||||
activeBlockModifier: ActiveMirrorShieldBlock
|
||||
blockSound: !type:SoundPathSpecifier
|
||||
path: /Audio/Effects/glass_step.ogg
|
||||
- type: Destructible
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 40
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- !type:PlaySoundBehavior
|
||||
sound: /Audio/Effects/glass_break1.ogg
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetGlass:
|
||||
min: 5
|
||||
max: 5
|
||||
@@ -305,6 +305,7 @@
|
||||
- Flash
|
||||
- Handcuffs
|
||||
- Stunbaton
|
||||
- RiotShield
|
||||
- CartridgePistol
|
||||
- ShellShotgun
|
||||
- CartridgeLightRifle
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
- type: constructionGraph
|
||||
id: MakeshiftShield
|
||||
start: start
|
||||
graph:
|
||||
- node: start
|
||||
edges:
|
||||
- to: makeshiftShield
|
||||
steps:
|
||||
- material: Cable
|
||||
amount: 15
|
||||
doAfter: 2
|
||||
- material: Steel
|
||||
amount: 30
|
||||
doAfter: 2
|
||||
|
||||
- node: makeshiftShield
|
||||
entity: MakeshiftShield
|
||||
@@ -0,0 +1,24 @@
|
||||
- type: constructionGraph
|
||||
id: WoodenBuckler
|
||||
start: start
|
||||
graph:
|
||||
- node: start
|
||||
edges:
|
||||
- to: woodenBuckler
|
||||
steps:
|
||||
- tag: Handcuffs
|
||||
icon:
|
||||
sprite: Objects/Misc/cablecuffs.rsi
|
||||
state: cuff
|
||||
color: red
|
||||
name: cuffs
|
||||
doAfter: 2
|
||||
- material: WoodPlank
|
||||
amount: 20
|
||||
doAfter: 2
|
||||
- material: Steel
|
||||
amount: 10
|
||||
doAfter: 2
|
||||
|
||||
- node: woodenBuckler
|
||||
entity: WoodenBuckler
|
||||
@@ -31,3 +31,24 @@
|
||||
icon: Objects/Weapons/Guns/Battery/makeshift.rsi/icon.png
|
||||
objectType: Item
|
||||
|
||||
- type: construction
|
||||
name: wooden buckler
|
||||
id: WoodenBuckler
|
||||
graph: WoodenBuckler
|
||||
startNode: start
|
||||
targetNode: woodenBuckler
|
||||
category: Weapons
|
||||
description: A nicely carved wooden shield!
|
||||
icon: Objects/Weapons/Melee/shields.rsi/buckler-icon.png
|
||||
objectType: Item
|
||||
|
||||
- type: construction
|
||||
name: makeshift shield
|
||||
id: MakeshiftShield
|
||||
graph: MakeshiftShield
|
||||
startNode: start
|
||||
targetNode: makeshiftShield
|
||||
category: Weapons
|
||||
description: Crude and falling apart. Why would you make this?
|
||||
icon: Objects/Weapons/Melee/shields.rsi/makeshift-icon.png
|
||||
objectType: Item
|
||||
|
||||
@@ -19,6 +19,17 @@
|
||||
Steel: 300
|
||||
Plastic: 300
|
||||
|
||||
- type: latheRecipe
|
||||
id: RiotShield
|
||||
icon:
|
||||
sprite: Objects/Weapons/Melee/shields.rsi
|
||||
state: riot-icon
|
||||
result: RiotShield
|
||||
completetime: 4
|
||||
materials:
|
||||
Steel: 400
|
||||
Glass: 400
|
||||
|
||||
- type: latheRecipe
|
||||
id: Flash
|
||||
icon:
|
||||
|
||||
Reference in New Issue
Block a user