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

@@ -0,0 +1,16 @@
- type: damageContainer
id: Biological
supportedGroups:
- Brute
- Burn
- Toxin
- Airloss
- Genetic
- type: damageContainer
id: Inorganic
supportedGroups:
- Brute
supportedTypes:
- Heat
- Shock

View File

@@ -1,97 +0,0 @@
# Silver: Todo break out into damage_type,damage_class, damage_container yml files when we support loading prototypes by priority.
- type: damageType
id: Blunt
- type: damageType
id: Slash
- type: damageType
id: Piercing
- type: damageType
id: Heat
- type: damageType
id: Shock
- type: damageType
id: Cold
# Poison damage. Generally caused by various reagents being metabolised.
- type: damageType
id: Poison
- type: damageType
id: Radiation
# Damage due to being unable to breathe.
# Represents not enough oxygen (or equivalent) getting to the blood.
# Usually healed automatically if entity can breathe
- type: damageType
id: Asphyxiation
# Damage representing not having enough blood.
# Represents there not enough blood to supply oxygen (or equivalent).
- type: damageType
id: Bloodloss
- type: damageType
id: Cellular
- type: damageGroup
id: Brute
damageTypes:
- Blunt
- Slash
- Piercing
- type: damageGroup
id: Burn
damageTypes:
- Heat
- Shock
- Cold
# Airloss (sometimes called oxyloss)
# Caused by asphyxiation or bloodloss.
# Note that most medicine and damaging effects should probably modify either asphyxiation or
# bloodloss, not this whole group, unless you have a wonder drug that affects both.
- type: damageGroup
id: Airloss
damageTypes:
- Asphyxiation
- Bloodloss
# As with airloss, most medicine and damage effects should probably modify either poison or radiation.
# Though there are probably some radioactive poisons.
- type: damageGroup
id: Toxin
damageTypes:
- Poison
- Radiation
- type: damageGroup
id: Genetic
damageTypes:
- Cellular
- type: damageContainer
id: allDamageContainer
supportAll: true
- type: damageContainer
id: biologicalDamageContainer
supportedGroups:
- Brute
- Burn
- Toxin
- Airloss
- Genetic
- type: damageContainer
id: metallicDamageContainer
supportedGroups:
- Brute
- Burn

View File

@@ -0,0 +1,36 @@
- type: damageGroup
id: Brute
damageTypes:
- Blunt
- Slash
- Piercing
- type: damageGroup
id: Burn
damageTypes:
- Heat
- Shock
- Cold
# Airloss (sometimes called oxyloss)
# Caused by asphyxiation or bloodloss.
# Note that most medicine and damaging effects should probably modify either asphyxiation or
# bloodloss, not this whole group, unless you have a wonder drug that affects both.
- type: damageGroup
id: Airloss
damageTypes:
- Asphyxiation
- Bloodloss
# As with airloss, most medicine and damage effects should probably modify either poison or radiation.
# Though there are probably some radioactive poisons.
- type: damageGroup
id: Toxin
damageTypes:
- Poison
- Radiation
- type: damageGroup
id: Genetic
damageTypes:
- Cellular

View File

@@ -1,134 +1,30 @@
- type: resistanceSet
id: defaultResistances
coefficients:
Blunt: 1.0
Slash: 1.0
Piercing: 1.0
Heat: 1.0
Shock: 1.0
Cold: 1.0
Poison: 1.0
Radiation: 1.0
Asphyxiation: 1.0
Bloodloss: 1.0
Cellular: 1.0
flatReductions:
Blunt: 0
Slash: 0
Piercing: 0
Heat: 0
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
- type: resistanceSet
id: dionaResistances
coefficients:
Blunt: 0.5
Slash: 1.2
Piercing: 0.7
Heat: 1.8
Shock: 0.5
Cold: 1.5
Poison: 0.8
Radiation: 0
Asphyxiation: 1.0
Bloodloss: 1.0
Cellular: 1.0
flatReductions:
Blunt: 0
Slash: 0
Piercing: 0
Heat: 0
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
- type: resistanceSet
id: metallicResistances
id: Metallic
coefficients:
Blunt: 0.7
Slash: 0.5
Piercing: 0.7
Heat: 1.0
Shock: 1.2
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
flatReductions:
Blunt: 5
Slash: 0
Piercing: 0
Heat: 0
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
- type: resistanceSet
id: inflatableResistances
id: Inflatable
coefficients:
Blunt: 0.5
Slash: 1.0
Piercing: 2.0
Heat: 0.5
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
flatReductions:
Blunt: 5
Slash: 0
Piercing: 0
Heat: 0
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
- type: resistanceSet
id: glassResistances
id: Glass
coefficients:
Blunt: 0.5
Slash: 0.5
Piercing: 0.5
Heat: 0
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
flatReductions:
Blunt: 5
Slash: 0
Piercing: 0
Heat: 0
Shock: 0
Cold: 0
Poison: 0
Radiation: 0
Asphyxiation: 0
Bloodloss: 0
Cellular: 0
Blunt: 5

View File

@@ -0,0 +1,38 @@
- type: damageType
id: Blunt
- type: damageType
id: Slash
- type: damageType
id: Piercing
- type: damageType
id: Heat
- type: damageType
id: Shock
- type: damageType
id: Cold
# Poison damage. Generally caused by various reagents being metabolised.
- type: damageType
id: Poison
- type: damageType
id: Radiation
# Damage due to being unable to breathe.
# Represents not enough oxygen (or equivalent) getting to the blood.
# Usually healed automatically if entity can breathe
- type: damageType
id: Asphyxiation
# Damage representing not having enough blood.
# Represents there not enough blood to supply oxygen (or equivalent).
- type: damageType
id: Bloodloss
- type: damageType
id: Cellular