Change all of body system to use entities and components (#2074)

* Early commit

* Early commit 2

* merging master broke my git

* does anyone even read these

* life is fleeting

* it just works

* this time passing integration tests

* Remove hashset yaml serialization for now

* You got a license for those nullables?

* No examine, no context menu, part and mechanism parenting and visibility

* Fix wrong brain sprite state

* Removing layers was a mistake

* just tear body system a new one and see if it still breathes

* Remove redundant code

* Add that comment back

* Separate damage and body, component states, stomach rework

* Add containers for body parts

* Bring layers back pls

* Fix parts magically changing color

* Reimplement sprite layer visibility

* Fix tests

* Add leg test

* Active legs is gone

Crab rave

* Merge fixes, rename DamageState to CurrentState

* Remove IShowContextMenu and ICanExamine
This commit is contained in:
DrSmugleaf
2020-10-10 15:25:13 +02:00
committed by GitHub
parent 73c730d06c
commit dd385a0511
165 changed files with 4232 additions and 4650 deletions

View File

@@ -1,90 +1,101 @@
- type: entity
parent: BaseDroppedMechanism
id: HeartMechanismDebug
name: "human heart (debug)"
id: BrainHuman
name: "human brain"
description: "The source of incredible, unending intelligence. Honk."
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: brain
- type: Mechanism
durability: 10
size: 1
compatibility: Biological
- type: Brain
- type: entity
id: EyesHuman
name: "human eyes"
description: "Ocular organ capable of turning light into a colorful visual."
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: eyeballs
- type: Mechanism
durability: 10
size: 1
compatibility: Biological
- type: entity
id: HeartHuman
name: "human heart"
description: "Pumps blood throughout a body. Essential for any entity with blood."
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: heart-on
- type: DroppedMechanism
debugLoadMechanismData: mechanism.Heart.BasicHuman
behaviors:
- Content.Server.Body.Mechanisms.Behaviors.HeartBehavior
- type: Mechanism
durability: 10
size: 1
compatibility: Biological
- type: Heart
- type: mechanism
id: mechanism.Brain.BasicHuman
name: "human brain"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "brain_human"
description: "The source of incredible, unending intelligence. Honk."
durability: 10
size: 1
compatibility: Biological
behaviors:
- Content.Server.Body.Mechanisms.Behaviors.BrainBehavior
- type: mechanism
id: mechanism.Eyes.BasicHuman
name: "human eyes"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "eyeballs"
description: "Ocular organ capable of turning light into a colorful visual."
durability: 10
size: 1
compatibility: Biological
- type: mechanism
id: mechanism.Heart.BasicHuman
name: "human heart"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "heart-on"
description: "Pumps blood throughout a body. Essential for any entity with blood."
durability: 10
size: 1
compatibility: Biological
behaviors:
- Content.Server.Body.Mechanisms.Behaviors.HeartBehavior
- type: mechanism
id: mechanism.Lungs.BasicHuman
- type: entity
id: LungsHuman
name: "human lungs"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "lungs"
description: "Filters oxygen from an atmosphere, which is then sent into the bloodstream to be used as an electron carrier."
durability: 13
size: 1
compatibility: Biological
behaviors:
- Content.Server.Body.Mechanisms.Behaviors.LungBehavior
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: lungs
- type: Mechanism
durability: 13
size: 1
compatibility: Biological
- type: Lung
- type: mechanism
id: mechanism.Stomach.BasicHuman
- type: entity
id: StomachHuman
name: "human stomach"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "stomach"
description: "Gross. This is hard to stomach."
durability: 13
size: 1
compatibility: Biological
behaviors:
- Content.Server.Body.Mechanisms.Behaviors.StomachBehavior
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: stomach
- type: Mechanism
durability: 13
size: 1
compatibility: Biological
- type: Stomach
- type: mechanism
id: mechanism.Liver.BasicHuman
- type: entity
id: LiverHuman
name: "human liver"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "liver"
description: "Filters impurities out of a bloodstream and provides other important functionality to a human."
durability: 15
size: 1
compatibility: Biological
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: liver
- type: Mechanism
durability: 15
size: 1
compatibility: Biological
- type: mechanism
id: mechanism.Kidneys.BasicHuman
- type: entity
id: KidneysHuman
name: "human kidneys"
rsiPath: Mobs/Species/Human/organs.rsi
rsiState: "kidneys"
description: "Filters toxins out of a bloodstream."
durability: 20
size: 1
compatibility: Biological
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/organs.rsi
state: kidneys
- type: Mechanism
durability: 20
size: 1
compatibility: Biological

View File

@@ -1,18 +1,26 @@
- type: mechanism
id: mechanism.EMPStriker
- type: entity
id: MechanismEMPStriker
name: "EMP striker"
description: "When activated, this arm implant will apply a small EMP on the target of a physical strike for 10 watts per use."
durability: 80
size: 4
compatibility: Universal
implantableParts:
- Arm
- Hand
components:
- type: Sprite
- type: Icon
- type: Mechanism
durability: 80
size: 4
compatibility: Universal
implantableParts:
- Arm
- Hand
- type: mechanism
id: mechanism.HonkModule
- type: entity
id: MechanismHonkModule
name: "HONK module 3000"
description: "Mandatory implant for all clowns after the Genevo Convention of 2459."
durability: 50
size: 3
compatibility: Universal
components:
- type: Sprite
- type: Icon
- type: Mechanism
durability: 50
size: 3
compatibility: Universal

View File

@@ -1,193 +1,281 @@
- type: bodyPart
id: bodyPart.Torso.BasicHuman
- type: entity
id: PartHuman
name: "human body part"
abstract: true
- type: entity
id: TorsoHuman
name: "human torso"
plural: "human torsos"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: "torso_m"
partType: Torso
durability: 100
destroyThreshold: -150
size: 14
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
mechanisms:
- mechanism.Heart.BasicHuman
- mechanism.Lungs.BasicHuman
- mechanism.Stomach.BasicHuman
- mechanism.Liver.BasicHuman
- mechanism.Kidneys.BasicHuman
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "torso_m"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "torso_m"
- type: BodyPart
plural: "human torsos"
partType: Torso
size: 14
compatibility: Biological
mechanisms:
- HeartHuman
- LungsHuman
- StomachHuman
- LiverHuman
- KidneysHuman
- type: BiologicalSurgeryData
- type: Damageable
# TODO BODY DettachableDamageableComponent?
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 100
deadThreshold: 150
- type: bodyPart
id: bodyPart.Head.BasicHuman
- type: entity
id: HeadHuman
name: "human head"
plural: "human heads"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: head_m
partType: Head
durability: 50
destroyThreshold: -120
size: 7
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
isVital: true
mechanisms:
- mechanism.Brain.BasicHuman
- mechanism.Eyes.BasicHuman
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "head_m"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "head_m"
- type: BodyPart
plural: "human heads"
partType: Head
size: 7
compatibility: Biological
isVital: true
mechanisms:
- BrainHuman
- EyesHuman
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 50
deadThreshold: 120
- type: bodyPart
id: bodyPart.LArm.BasicHuman
- type: entity
id: LeftArmHuman
name: "left human arm"
plural: "left human arms"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: l_arm
partType: Arm
durability: 40
destroyThreshold: -80
size: 5
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:ExtensionProperty
active: true
reachDistance: 2.4
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "l_arm"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "l_arm"
- type: BodyPart
plural: "left human arms"
partType: Arm
size: 5
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 40
deadThreshold: 80
- type: Extension
distance: 2.4
- type: bodyPart
id: bodyPart.RArm.BasicHuman
- type: entity
id: RightArmHuman
name: "right human arm"
plural: "right human arms"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: r_arm
partType: Arm
durability: 40
destroyThreshold: -80
size: 5
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:ExtensionProperty
active: true
reachDistance: 2.4
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "r_arm"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "r_arm"
- type: BodyPart
plural: "right human arms"
partType: Arm
size: 5
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 40
deadThreshold: 80
- type: Extension
distance: 2.4
- type: bodyPart
id: bodyPart.LHand.BasicHuman
- type: entity
id: LeftHandHuman
name: "left human hand"
plural: "left human hands"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: l_hand
partType: Hand
durability: 30
destroyThreshold: -60
size: 3
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:GraspProperty
active: true
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "l_hand"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "l_hand"
- type: BodyPart
plural: "left human hands"
partType: Hand
size: 3
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 30
deadThreshold: 60
- type: Grasp
- type: bodyPart
id: bodyPart.RHand.BasicHuman
- type: entity
id: RightHandHuman
name: "right human hand"
plural: "right human hands"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: r_hand
partType: Hand
durability: 30
destroyThreshold: -60
size: 3
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:GraspProperty
active: true
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "r_hand"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "r_hand"
- type: BodyPart
plural: "right human hands"
partType: Hand
durability: 30
destroyThreshold: -60
size: 3
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 30
deadThreshold: 60
- type: Grasp
- type: bodyPart
id: bodyPart.LLeg.BasicHuman
- type: entity
id: LeftLegHuman
name: "left human leg"
plural: "left human legs"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: l_leg
partType: Leg
durability: 45
destroyThreshold: -90
size: 6
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:ExtensionProperty
active: true
reachDistance: 3.0
- !type:LegProperty
active: true
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "l_leg"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "l_leg"
- type: BodyPart
plural: "left human legs"
partType: Leg
size: 6
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 45
deadThreshold: 90
- type: Leg
speed: 2.6
- type: Extension
distance: 3.0
- type: bodyPart
id: bodyPart.RLeg.BasicHuman
- type: entity
id: RightLegHuman
name: "right human leg"
plural: "right human legs"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: r_leg
partType: Leg
durability: 45
destroyThreshold: -90
size: 6
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:ExtensionProperty
active: true
reachDistance: 3.0
- !type:LegProperty
active: true
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "r_leg"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "r_leg"
- type: BodyPart
plural: "right human legs"
partType: Leg
durability: 45
destroyThreshold: -90
size: 6
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 45
deadThreshold: 90
- type: Leg
speed: 2.6
- type: Extension
distance: 3.0
- type: bodyPart
id: bodyPart.LFoot.BasicHuman
- type: entity
id: LeftFootHuman
name: "left human foot"
plural: "left human feet"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: l_foot
partType: Foot
durability: 30
destroyThreshold: -60
size: 2
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:FootProperty
active: true
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "l_foot"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "l_foot"
- type: BodyPart
plural: "left human feet"
partType: Foot
size: 2
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 30
deadThreshold: 60
- type: bodyPart
id: bodyPart.RFoot.BasicHuman
- type: entity
id: RightFootHuman
name: "right human foot"
plural: "right human feet"
rsiPath: Mobs/Species/Human/parts.rsi
rsiState: r_foot
partType: Foot
durability: 30
destroyThreshold: -60
size: 2
compatibility: Biological
damageContainer: biologicalDamageContainer
resistances: defaultResistances
surgeryDataType: Content.Server.Body.Surgery.BiologicalSurgeryData
properties:
- !type:FootProperty
active: true
parent: PartHuman
components:
- type: Sprite
netsync: false
sprite: Mobs/Species/Human/parts.rsi
state: "r_foot"
- type: Icon
sprite: Mobs/Species/Human/parts.rsi
state: "r_foot"
- type: BodyPart
plural: "right human feet"
partType: Foot
size: 2
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
criticalThreshold: 30
deadThreshold: 60

View File

@@ -1,14 +1,14 @@
- type: bodyPreset
name: "basic human"
id: bodyPreset.BasicHuman
name: "human"
id: HumanPreset
partIDs:
head: bodyPart.Head.BasicHuman
torso: bodyPart.Torso.BasicHuman
right arm: bodyPart.RArm.BasicHuman
left arm: bodyPart.LArm.BasicHuman
right hand: bodyPart.RHand.BasicHuman
left hand: bodyPart.LHand.BasicHuman
right leg: bodyPart.RLeg.BasicHuman
left leg: bodyPart.LLeg.BasicHuman
right foot: bodyPart.RFoot.BasicHuman
left foot: bodyPart.LFoot.BasicHuman
head: HeadHuman
torso: TorsoHuman
right arm: RightArmHuman
left arm: LeftArmHuman
right hand: RightHandHuman
left hand: LeftHandHuman
right leg: RightLegHuman
left leg: LeftLegHuman
right foot: RightFootHuman
left foot: LeftFootHuman

View File

@@ -1,5 +1,5 @@
- type: bodyTemplate
id: bodyTemplate.Humanoid
id: HumanoidTemplate
name: "humanoid"
centerSlot: "torso"
slots:
@@ -29,16 +29,3 @@
- left foot
right leg:
- right foot
layers:
head: "enum.HumanoidVisualLayers.Head"
torso: "enum.HumanoidVisualLayers.Chest"
left arm: "enum.HumanoidVisualLayers.LArm"
left hand: "enum.HumanoidVisualLayers.LHand"
right arm: "enum.HumanoidVisualLayers.RArm"
right hand: "enum.HumanoidVisualLayers.RHand"
left leg: "enum.HumanoidVisualLayers.LLeg"
left foot: "enum.HumanoidVisualLayers.LFoot"
right leg: "enum.HumanoidVisualLayers.RLeg"
right foot: "enum.HumanoidVisualLayers.RFoot"
mechanismLayers:
mechanism.Eyes.BasicHuman: "enum.HumanoidVisualLayers.Eyes"

View File

@@ -1,5 +1,5 @@
- type: bodyTemplate
id: bodyTemplate.Quadrupedal
id: QuadrupedalTemplate
name: "quadrupedal"
centerSlot: "torso"
slots: