ECS damageable (#4529)

* ECS and damage Data

* Comments and newlines

* Added Comments

* Make TryChangeDamageEvent immutable

* Remove SetAllDamage event

Use public SetAllDamage function instead

* Undo destructible mistakes

That was some shit code.

* Rename DamageData to DamageSpecifier

And misc small edits

misc

* Cache trigger prototypes.

* Renaming destructible classes & functions

* Revert "Cache trigger prototypes."

This reverts commit 86bae15ba6616884dba75f552dfdfbe2d1fb6586.

* Replace prototypes with prototype IDs.

* Split damage.yml into individual files

* move get/handle component state to system

* Update HealthChange doc

* Make godmode call Dirty() on damageable component

* Add Initialize() to fix damage test

* Make non-static

* uncache resistance set prototype and trim DamageableComponentState

* Remove unnecessary Dirty() calls during initialization

* RemoveTryChangeDamageEvent

* revert Dirty()

* Fix MobState relying on DamageableComponent.Dirty()

* Fix DisposalUnit Tests.

These were previously failing, but because the async was not await-ed, this never raised the exception.

After I fixed MobState component, this exception stopped happening and instead the assertions started being tested & failing

* Disposal test 2: electric boogaloo

* Fix typos/mistakes

also add comments and fix spacing.

* Use Uids instead of IEntity

* fix merge

* Comments, a merge issue, and making some damage ignore resistances

* Extend DamageSpecifier and use it for DamageableComponent

* fix master merge

* Fix Disposal unit test. Again.

Snapgrids were removed in master

* Execute Exectute
This commit is contained in:
Leon Friedrich
2021-09-15 03:07:37 +10:00
committed by GitHub
parent 22cc42ff50
commit df584ad446
212 changed files with 2876 additions and 3441 deletions

View File

@@ -103,6 +103,8 @@
behaviors:
- !type:LungBehavior {}
# TODO DAMAGE UNITS. Some of these damage effects were scaled up to integers.
# Scale back down when damage units are in.
- type: entity
id: OrganHumanHeart
parent: BaseHumanOrgan
@@ -124,36 +126,40 @@
Arithrazine:
effects:
- !type:HealthChange
damageGroup: Toxin
healthChange: -1
- !type:HealthChange
damageGroup: Brute
healthChange: 0.5
damage:
groups:
Toxin: -2 # -1 Multiplying by 2. pls give damage units
Brute: 1 # 0.5
Bicaridine:
effects:
- !type:HealthChange
damageGroup: Brute
healthChange: -2
damage:
groups:
Brute: -2
Dermaline:
effects:
- !type:HealthChange
damageGroup: Burn
healthChange: -3
damage:
groups:
Burn: -3
Dexalin:
effects:
- !type:HealthChange
damageGroup: Airloss
healthChange: -1
damage:
types:
Asphyxiation: -1
DexalinPlus:
effects:
- !type:HealthChange
damageGroup: Airloss
healthChange: -3
damage:
types:
Asphyxiation: -3
Dylovene:
effects:
- !type:HealthChange
damageGroup: Toxin
healthChange: -1
damage:
types:
Poison: -1
Ephedrine:
effects:
- !type:MovespeedModifier
@@ -162,45 +168,45 @@
HeartbreakerToxin:
effects:
- !type:HealthChange
damageGroup: Airloss
healthChange: 4
damage:
types:
Asphyxiation: 4
Kelotane:
effects:
- !type:HealthChange
damageGroup: Burn
healthChange: -1
- !type:HealthChange
damage:
groups:
Burn: -1
Lexorin:
effects:
- !type:HealthChange
damageGroup: Airloss
healthChange: 7
damage:
groups:
Airloss: 7
Meth:
effects:
- !type:HealthChange
healthChange: 2.5
damageGroup: Toxin
- !type:MovespeedModifier
walkSpeedModifier: 1.3
sprintSpeedModifier: 1.3
- !type:HealthChange
damage:
types:
Poison: 3 # 2.5
- !type:MovespeedModifier
walkSpeedModifier: 1.3
sprintSpeedModifier: 1.3
Omnizine:
effects:
- !type:HealthChange
healthChange: -2
damageGroup: Burn
- !type:HealthChange
healthChange: -2
damageGroup: Toxin
- !type:HealthChange
healthChange: -2
damageGroup: Airloss
- !type:HealthChange
healthChange: -2
damageGroup: Brute
damage:
groups:
Burn: -3 # -2. w/o damage units did not divide into 3 types
Toxin: -2
Airloss: -2
Brute: -3 # -2. w/o damage units did not divide into 3 types
Synaptizine:
effects:
- !type:HealthChange
damageGroup: Toxin
healthChange: 0.5
- !type:HealthChange
damage:
types:
Poison: 1 # 0.5 pls damage units
- type: entity
id: OrganHumanStomach
@@ -261,8 +267,9 @@
effects:
- !type:SatiateThirst
- !type:HealthChange
damageGroup: Toxin
healthChange: 1
damage:
types:
Poison: 1
JuiceWatermelon:
effects:
- !type:SatiateThirst
@@ -306,8 +313,9 @@
- !type:SatiateThirst
hydrationFactor: 2
- !type:HealthChange
damageGroup: Toxin
healthChange: 1
damage:
types:
Poison: 1
- type: entity
id: OrganHumanLiver

View File

@@ -5,6 +5,9 @@
parent: BaseItem
name: "human body part"
abstract: true
components:
- type: Damageable
damageContainer: Biological
- type: entity
id: TorsoHuman
@@ -29,10 +32,6 @@
- OrganHumanLiver
- OrganHumanKidneys
- type: BiologicalSurgeryData
- type: Damageable
# TODO BODY DettachableDamageableComponent?
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 100
# deadThreshold: 150
@@ -57,9 +56,6 @@
- OrganHumanBrain
- OrganHumanEyes
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 50
# deadThreshold: 120
- type: Input
@@ -85,9 +81,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 40
# deadThreshold: 80
- type: Extension
@@ -111,9 +104,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 40
# deadThreshold: 80
- type: Extension
@@ -137,9 +127,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
- type: Grasp
@@ -162,9 +149,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
- type: Grasp
@@ -187,9 +171,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 45
# deadThreshold: 90
- type: Leg
@@ -215,9 +196,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 45
# deadThreshold: 90
- type: Leg
@@ -243,9 +221,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
@@ -267,8 +242,5 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60

View File

@@ -4,6 +4,9 @@
parent: BaseItem
name: "slime body part"
abstract: true
components:
- type: Damageable
damageContainer: Biological
- type: entity
id: TorsoSlime
@@ -28,10 +31,6 @@
- OrganHumanLiver
- OrganHumanKidneys
- type: BiologicalSurgeryData
- type: Damageable
# TODO BODY DettachableDamageableComponent?
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 100
# deadThreshold: 150
@@ -56,9 +55,6 @@
- OrganHumanBrain
- OrganHumanEyes
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 50
# deadThreshold: 120
- type: Input
@@ -84,9 +80,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 40
# deadThreshold: 80
- type: Extension
@@ -110,9 +103,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 40
# deadThreshold: 80
- type: Extension
@@ -136,9 +126,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
- type: Grasp
@@ -161,9 +148,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
- type: Grasp
@@ -186,11 +170,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 45
# deadThreshold: 90
- type: Leg
speed: 2.6
- type: Extension
@@ -214,9 +193,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 45
# deadThreshold: 90
- type: Leg
@@ -242,9 +218,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
@@ -266,8 +239,5 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60

View File

@@ -5,7 +5,10 @@
parent: BaseItem
name: "vox body part"
abstract: true
components:
- type: Damageable
damageContainer: Biological
- type: entity
id: TorsoVox
name: "vox torso"
@@ -29,10 +32,7 @@
- OrganHumanLiver
- OrganHumanKidneys
- type: BiologicalSurgeryData
- type: Damageable
# TODO BODY DettachableDamageableComponent?
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 100
# deadThreshold: 150
@@ -57,9 +57,6 @@
- OrganHumanBrain
- OrganHumanEyes
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 50
# deadThreshold: 120
- type: Input
@@ -85,9 +82,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 40
# deadThreshold: 80
- type: Extension
@@ -111,9 +105,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 40
# deadThreshold: 80
- type: Extension
@@ -137,9 +128,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
- type: Grasp
@@ -162,9 +150,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
- type: Grasp
@@ -187,9 +172,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 45
# deadThreshold: 90
- type: Leg
@@ -215,9 +197,6 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 45
# deadThreshold: 90
- type: Leg
@@ -243,9 +222,6 @@
compatibility: Biological
symmetry: Left
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60
@@ -267,8 +243,5 @@
compatibility: Biological
symmetry: Right
- type: BiologicalSurgeryData
- type: Damageable
damageContainer: biologicalDamageContainer
resistances: defaultResistances
# criticalThreshold: 30
# deadThreshold: 60