From c99709ba0bd5991f7c7a49915ff6d66448f75edf Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Tue, 12 Sep 2023 20:06:02 +0100 Subject: [PATCH 1/4] Update WorldObjectDamageWorker.cs --- .../CombatExtended/WorldObjects/WorldObjectDamageWorker.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs index d4370b5e48..fdfd57740c 100644 --- a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs +++ b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs @@ -37,12 +37,12 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction) var result = FragmentsPotentialDamage(projectile) + ExplosionPotentialDamage(projectile) + FirePotentialDamage(projectile) + EMPPotentialDamage(projectile, empModifier); //Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained result /= 3500f; - //Crit/Miss imitation - result *= Rand.Range(0.4f, 1.5f); if (projectile.projectile is ProjectilePropertiesCE projectileProperties && projectileProperties.shellingProps.damage > 0f) { - result *= projectileProperties.shellingProps.damage; + result = projectileProperties.shellingProps.damage; } + //Crit/Miss imitation + result *= Rand.Range(0.4f, 1.5f); return result; } protected const float fragDamageMultipler = 0.04f; From c5121a846eb729a8ed2d773011dad80cd2a2a648 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Wed, 13 Sep 2023 13:15:31 +0100 Subject: [PATCH 2/4] Update WorldObjectDamageWorker.cs --- .../CombatExtended/WorldObjects/WorldObjectDamageWorker.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs index fdfd57740c..be010fb702 100644 --- a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs +++ b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs @@ -35,12 +35,13 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction) } } var result = FragmentsPotentialDamage(projectile) + ExplosionPotentialDamage(projectile) + FirePotentialDamage(projectile) + EMPPotentialDamage(projectile, empModifier); - //Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained - result /= 3500f; if (projectile.projectile is ProjectilePropertiesCE projectileProperties && projectileProperties.shellingProps.damage > 0f) { result = projectileProperties.shellingProps.damage; } + //Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained + result /= 3500f; + Log.Message(result.ToString()); //Crit/Miss imitation result *= Rand.Range(0.4f, 1.5f); return result; From 7e6f6932f9858922b79cd4b4e081143fa9f9dddb Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Tue, 19 Sep 2023 20:29:16 +0100 Subject: [PATCH 3/4] remove a log I forgot to remove --- .../CombatExtended/WorldObjects/WorldObjectDamageWorker.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs index be010fb702..6d615890b8 100644 --- a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs +++ b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs @@ -41,7 +41,6 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction) } //Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained result /= 3500f; - Log.Message(result.ToString()); //Crit/Miss imitation result *= Rand.Range(0.4f, 1.5f); return result; From ba9658763712dd7da5d0b7d7c96069a60c0471c8 Mon Sep 17 00:00:00 2001 From: CMDR-Bill-Doors Date: Tue, 10 Oct 2023 09:57:14 +0100 Subject: [PATCH 4/4] Update WorldObjectDamageWorker.cs --- .../CombatExtended/WorldObjects/WorldObjectDamageWorker.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs index 6d615890b8..2da6521235 100644 --- a/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs +++ b/Source/CombatExtended/CombatExtended/WorldObjects/WorldObjectDamageWorker.cs @@ -35,12 +35,13 @@ public virtual float CalculateDamage(ThingDef projectile, Faction faction) } } var result = FragmentsPotentialDamage(projectile) + ExplosionPotentialDamage(projectile) + FirePotentialDamage(projectile) + EMPPotentialDamage(projectile, empModifier); + //Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained + result /= 3500f; + //manual overwrite if (projectile.projectile is ProjectilePropertiesCE projectileProperties && projectileProperties.shellingProps.damage > 0f) { result = projectileProperties.shellingProps.damage; } - //Damage calculated as in-map damage, needs to be converted into world object damage. 3500f experimentally obtained - result /= 3500f; //Crit/Miss imitation result *= Rand.Range(0.4f, 1.5f); return result;