diff --git a/About/About.xml b/About/About.xml
index 1cdf784075..ca7b636035 100644
--- a/About/About.xml
+++ b/About/About.xml
@@ -2,7 +2,6 @@
Combat Extended
CE Team
- https://ludeon.com/forums/index.php?topic=27374.0
- 0.17.1546
+ 0.17.1546
Version: 0.4.0\n\nExtends combat mechanics to make them deeper and more tactical.
diff --git a/Assemblies/CombatExtended.dll b/Assemblies/CombatExtended.dll
index d257dc0ddd..eb90dfa548 100644
Binary files a/Assemblies/CombatExtended.dll and b/Assemblies/CombatExtended.dll differ
diff --git a/Defs/Ammo/Advanced/30x64mmFuelCell.xml b/Defs/Ammo/Advanced/30x64mmFuelCell.xml
index 156d9aa81b..0a0a4058fe 100644
--- a/Defs/Ammo/Advanced/30x64mmFuelCell.xml
+++ b/Defs/Ammo/Advanced/30x64mmFuelCell.xml
@@ -86,7 +86,7 @@
TransparentPostLight
- 60
+ 40
false
diff --git a/Defs/Ammo/Advanced/5x35mmCharged.xml b/Defs/Ammo/Advanced/5x35mmCharged.xml
index 54e675cd5f..947550cb5a 100644
--- a/Defs/Ammo/Advanced/5x35mmCharged.xml
+++ b/Defs/Ammo/Advanced/5x35mmCharged.xml
@@ -57,7 +57,7 @@
Bullet
10
- 170
+ 200
Bomb_Secondary
diff --git a/Defs/Ammo/Advanced/80x256mmFuelCell.xml b/Defs/Ammo/Advanced/80x256mmFuelCell.xml
index 92faa5b106..258e424067 100644
--- a/Defs/Ammo/Advanced/80x256mmFuelCell.xml
+++ b/Defs/Ammo/Advanced/80x256mmFuelCell.xml
@@ -68,7 +68,7 @@
Flame
100
- 60
+ 100
false
3.5
FilthFuel
diff --git a/Defs/Ammo/Shell/90mmCannon.xml b/Defs/Ammo/Shell/90mmCannon.xml
index 0b046569a5..cefb195e1f 100644
--- a/Defs/Ammo/Shell/90mmCannon.xml
+++ b/Defs/Ammo/Shell/90mmCannon.xml
@@ -33,7 +33,7 @@
200
- 4.6
+ 10
7
30
diff --git a/Defs/ThingDefs_Misc/Apparel_Shield.xml b/Defs/ThingDefs_Misc/Apparel_Shield.xml
index 05e8d9b182..adf87540aa 100644
--- a/Defs/ThingDefs_Misc/Apparel_Shield.xml
+++ b/Defs/ThingDefs_Misc/Apparel_Shield.xml
@@ -60,9 +60,19 @@
TribalShield
- CE_Shield
+
+
+
+ Hands
+ Arms
+ Shoulders
+ Torso
+ Neck
+
+
+
@@ -97,9 +107,24 @@
OutlanderShield
- CE_BallisticShield
+
+
+
+ Hands
+ Arms
+ Shoulders
+ Torso
+ Neck
+ FullHead
+
+
+ Legs
+
+ true
+
+
diff --git a/Defs/ThingDefs_Misc/Weapons_Turrets.xml b/Defs/ThingDefs_Misc/Weapons_Turrets.xml
index 863bd7357a..5ee9d55c1b 100644
--- a/Defs/ThingDefs_Misc/Weapons_Turrets.xml
+++ b/Defs/ThingDefs_Misc/Weapons_Turrets.xml
@@ -38,20 +38,20 @@
InteractChargeRifle
2000
- 1.25
+ 0.5
0.08
- 0.23
- 1.5
+ 1.4
+ 0.36
Mounted
- 0.41
+ 0.53
CombatExtended.Verb_ShootCE
true
Bullet_6x24mmCharged
- 2
- 40
+ 1.1
+ 55
5
10
ShotChargeBlaster
@@ -61,8 +61,8 @@
- 300
- 420
+ 100
+ 7.8
true
AmmoSet_6x24mmCharged
@@ -81,20 +81,20 @@
Large caliber gun on a turret mount.
2000
- 1.25
- 0.08
- 1.2
- 1.5
+ 0.5
+ 0.01
+ 7.70
+ 0.36
Mounted
- 0.78
+ 0.95
CombatExtended.Verb_ShootCE
true
Bullet_145x114mm_FMJ
- 2.5
- 40
+ 1.1
+ 55
6
10
HeavyMG
@@ -104,8 +104,8 @@
- 100
- 420
+ 40
+ 7.8
true
AmmoSet_145x114mm
@@ -124,19 +124,19 @@
Heavy machine gun for use against light vehicles.
2000
- 1.25
- 0.08
- 1.18
- 1.5
+ 0.5
+ 0.01
+ 6.88
+ 0.36
Mounted
- 0.79
+ 1.08
CombatExtended.Verb_ShootCE
true
Bullet_145x114mm_FMJ
- 2.5
+ 1.1
86
6
10
@@ -148,7 +148,7 @@
40
- 420
+ 7.8
true
AmmoSet_145x114mm
@@ -171,20 +171,20 @@
2000
0.50
- 0.08
- 0.24
- 1.5
+ 0.04
+ 2.51
+ 0.36
Mounted
- 0.51
+ 0.60
CombatExtended.Verb_ShootCE
true
Bullet_762x51mmNATO_FMJ
- 1.5
+ 1.1
75
- 4
+ 6
10
MediumMG
GunTail_Medium
@@ -194,7 +194,7 @@
100
- 510
+ 7.8
true
AmmoSet_762x51mmNATO
@@ -217,10 +217,10 @@
ArtilleryShellLoaded
2000
- 1.25
- 0.1
- 1.5
- 1.5
+ 0.6
+ 0.01
+ 2.99
+ 2.57
@@ -243,7 +243,7 @@
1
- 750
+ 9.8
true
AmmoSet_90mmCannonShell
@@ -263,20 +263,20 @@
AGS-30 attached to a tripod.
2000
- 1.25
- 0.08
- 0.25
- 1.5
+ 0.77
+ 0.15
+ 2.19
+ 0.40
Mounted
- 0.80
+ 4.90
CombatExtended.Verb_ShootCE
true
Bullet_30x29mmGrenade_HE
true
- 2
+ 1.37
8
75
9
@@ -292,7 +292,7 @@
30
- 420
+ 7.8
true
AmmoSet_30x29mmGrenade
diff --git a/Patches/Core/DamageDefs/Damages_LocalInjury.xml b/Patches/Core/DamageDefs/Damages_LocalInjury.xml
index b89f0a8e39..d5d79cd038 100644
--- a/Patches/Core/DamageDefs/Damages_LocalInjury.xml
+++ b/Patches/Core/DamageDefs/Damages_LocalInjury.xml
@@ -102,5 +102,14 @@
BurnDamage
+
+
+
+ */DamageDef[defName="Bomb"]/hediff
+
+ Blast
+
+
+
diff --git a/Patches/Core/ThingDefs_Buildings/Buildings_Security.xml b/Patches/Core/ThingDefs_Buildings/Buildings_Security.xml
index 5262ec2a7d..cdca9c50be 100644
--- a/Patches/Core/ThingDefs_Buildings/Buildings_Security.xml
+++ b/Patches/Core/ThingDefs_Buildings/Buildings_Security.xml
@@ -121,7 +121,7 @@
1
- 300
+ 300
true
AmmoSet_81mmMortarShell
diff --git a/Patches/Core/ThingDefs_Misc/Weapons_Guns.xml b/Patches/Core/ThingDefs_Misc/Weapons_Guns.xml
index c5321d8cb3..32b891ef12 100644
--- a/Patches/Core/ThingDefs_Misc/Weapons_Guns.xml
+++ b/Patches/Core/ThingDefs_Misc/Weapons_Guns.xml
@@ -26,14 +26,14 @@
*/ThingDef[defName="Gun_Pistol"]/statBases/Mass
- 1
+ 1.11
*/ThingDef[defName="Gun_Pistol"]/statBases/RangedWeapon_Cooldown
- 0.25
+ 0.38
@@ -41,8 +41,8 @@
*/ThingDef[defName="Gun_Pistol"]/statBases
0.35
- 0.16
- 1.03
+ 0.17
+ 1.32
2.10
@@ -55,7 +55,7 @@
CombatExtended.Verb_ShootCE
true
Bullet_45ACP_FMJ
- 0.3
+ 0.6
12
ShotPistol
GunTail_Light
@@ -88,7 +88,7 @@
7
- 180
+ 3
AmmoSet_45ACP
@@ -139,16 +139,17 @@
*/ThingDef[defName="Gun_PumpShotgun"]/statBases/RangedWeapon_Cooldown
- 1.5
+ 1.0
*/ThingDef[defName="Gun_PumpShotgun"]/statBases
- 0.15
- 0.77
- 8.10
+ 0.14
+ 1.20
+ 9.0
+ 0.5
@@ -193,13 +194,10 @@
5
- 240
+ 3.5
AmmoSet_12Gauge
-
- FALSE
- FALSE
-
+
@@ -242,7 +240,7 @@
*/ThingDef[defName="Gun_ChainShotgun"]/statBases/RangedWeapon_Cooldown
- 0.66
+ 0.39
@@ -250,8 +248,9 @@
*/ThingDef[defName="Gun_ChainShotgun"]/statBases
0.15
- 0.89
- 6.83
+ 1.26
+ 7.90
+ 0.5
@@ -268,10 +267,9 @@
ShotShotgun
GunTail_Heavy
9
- 3
15
Regular
- 0.51
+ 4.34
@@ -299,15 +297,11 @@
*/ThingDef[defName="Gun_ChainShotgun"]/comps
- 10
- 240
+ 8
+ 3
AmmoSet_12Gauge
-
- 2
- FALSE
- FALSE
-
+
@@ -343,14 +337,14 @@
*/ThingDef[defName="Gun_BoltActionRifle"]/statBases/Mass
- 4.00
+ 4.19
*/ThingDef[defName="Gun_BoltActionRifle"]/statBases/RangedWeapon_Cooldown
- 1.2
+ 1.17
@@ -358,9 +352,9 @@
*/ThingDef[defName="Gun_BoltActionRifle"]/statBases
0.50
- 0.08
- 0.96
- 9.50
+ 0.02
+ 1.68
+ 12.60
@@ -372,7 +366,7 @@
CombatExtended.Verb_ShootCE
true
Bullet_303British_FMJ
- 1.25
+ 1.4
55
ShotBoltActionRifle
GunTail_Heavy
@@ -405,11 +399,10 @@
10
- 180
+ 3.3
AmmoSet_303British
- FALSE
TRUE
@@ -447,14 +440,14 @@
*/ThingDef[defName="Gun_AssaultRifle"]/statBases/Mass
- 3.40
+ 3.26
*/ThingDef[defName="Gun_AssaultRifle"]/statBases/RangedWeapon_Cooldown
- 0.4
+ 0.36
@@ -462,8 +455,8 @@
*/ThingDef[defName="Gun_AssaultRifle"]/statBases
0.50
- 0.08
- 0.89
+ 0.07
+ 1.33
10.03
@@ -474,11 +467,11 @@
Regular
- 0.96
+ 1.18
CombatExtended.Verb_ShootCE
true
Bullet_556x45mmNATO_FMJ
- 1.25
+ 1.1
55
6
4
@@ -513,7 +506,7 @@
30
- 300
+ 3
AmmoSet_556x45mmNATO
@@ -563,7 +556,7 @@
*/ThingDef[defName="Gun_SniperRifle"]/statBases/RangedWeapon_Cooldown
- 0.5
+ 1.16
@@ -571,8 +564,8 @@
*/ThingDef[defName="Gun_SniperRifle"]/statBases
1.5
- 0.04
- 1.3
+ 0.05
+ 1.92
10.92
@@ -585,7 +578,7 @@
CombatExtended.Verb_ShootCE
true
Bullet_762x51mmNATO_FMJ
- 1.4
+ 2.1
75
ShotSniperRifle
GunTail_Heavy
@@ -618,11 +611,10 @@
5
- 300
+ 3
AmmoSet_762x51mmNATO
- FALSE
TRUE
@@ -667,7 +659,7 @@
*/ThingDef[defName="Gun_MachinePistol"]/statBases/RangedWeapon_Cooldown
- 0.33
+ 0.36
@@ -676,8 +668,8 @@
0.50
0.12
- 0.74
- 5.44
+ 0.99
+ 5.55
@@ -687,11 +679,11 @@
Regular
- 0.19
+ 0.91
CombatExtended.Verb_ShootCE
true
Bullet_9x19mmPara_FMJ
- 0.75
+ 0.6
20
6
6
@@ -726,7 +718,7 @@
32
- 240
+ 3
AmmoSet_9x19mmPara
@@ -778,7 +770,7 @@
*/ThingDef[defName="Gun_HeavySMG"]/statBases/RangedWeapon_Cooldown
- 0.33
+ 0.37
@@ -786,9 +778,9 @@
*/ThingDef[defName="Gun_HeavySMG"]/statBases
0.35
- 0.12
- 0.58
- 5.00
+ 0.17
+ 1.46
+ 3.17
@@ -798,14 +790,14 @@
Regular
- 0.47
+ 2.16
CombatExtended.Verb_ShootCE
true
Bullet_45ACP_FMJ
- 0.75
+ 0.6
16
6
- 7
+ 9
ShotHeavySMG
GunTail_Heavy
9
@@ -837,8 +829,8 @@
20
- 240
- AmmoSet_45ACP
+ 3
+ AmmoSet_9x19mmPara
3
@@ -882,14 +874,14 @@
*/ThingDef[defName="Gun_IncendiaryLauncher"]/statBases/Mass
- 6
+ 8
*/ThingDef[defName="Gun_IncendiaryLauncher"]/statBases/RangedWeapon_Cooldown
- 0.4
+ 0.43
@@ -897,9 +889,9 @@
*/ThingDef[defName="Gun_IncendiaryLauncher"]/statBases
0.50
- 0.17
- 1.04
- 11.25
+ 0.15
+ 1.8
+ 10
@@ -912,9 +904,9 @@
true
Bullet_30x64mmFuel_Incendiary
true
- 1.25
+ 1.1
40
- 1
+ 0
ShotIncendiaryLauncher
GunTail_Medium
14
@@ -949,7 +941,7 @@
5
- 300
+ 3
AmmoSet_30x64mmFuel
@@ -999,7 +991,7 @@
*/ThingDef[defName="Gun_LMG"]/statBases/RangedWeapon_Cooldown
- 1
+ 0.56
@@ -1007,9 +999,9 @@
*/ThingDef[defName="Gun_LMG"]/statBases
0.50
- 0.08
- 1.96
- 15.24
+ 0.05
+ 2.08
+ 13.7
@@ -1019,14 +1011,14 @@
Mounted
- 0.43
+ 0.82
CombatExtended.Verb_ShootCE
true
Bullet_762x54mmR_FMJ
- 1.6
- 78
+ 1.25
+ 75
7
- 10
+ 300
ShotMinigun
GunTail_Medium
9
@@ -1061,7 +1053,7 @@
47
- 420
+ 3.9
AmmoSet_762x54mmR
@@ -1105,24 +1097,24 @@
*/ThingDef[defName="Gun_ChargeRifle"]/statBases/Mass
- 3.50
+ 3.0
*/ThingDef[defName="Gun_ChargeRifle"]/statBases/RangedWeapon_Cooldown
- 0.4
+ 0.36
*/ThingDef[defName="Gun_ChargeRifle"]/statBases
- 0.50
- 0.05
- 0.95
- 11.00
+ 0.60
+ 0.08
+ 1.20
+ 9.00
@@ -1132,12 +1124,12 @@
Regular
- 0.59
+ 1.13
CombatExtended.Verb_ShootCE
true
Bullet_6x24mmCharged
- 1.25
- 59
+ 1.0
+ 55
5
6
ShotChargeRifle
@@ -1170,8 +1162,8 @@
*/ThingDef[defName="Gun_ChargeRifle"]/comps
- 60
- 300
+ 30
+ 3
AmmoSet_6x24mmCharged
@@ -1214,17 +1206,17 @@
*/ThingDef[defName="Gun_TurretImprovised"]/statBases/RangedWeapon_Cooldown
- 0.4
+ 0.35
*/ThingDef[defName="Gun_TurretImprovised"]/statBases
- 0.35
- 0.08
- 0.85
- 7.00
+ 0.5
+ 0.07
+ 1.80
+ 8.00
@@ -1234,12 +1226,12 @@
Mounted
- 0.72
+ 0.22
CombatExtended.Verb_ShootCE
true
Bullet_556x45mmNATO_FMJ
- 1.5
- 31
+ 1.1
+ 48
5
10
GunShotA
@@ -1272,8 +1264,8 @@
*/ThingDef[defName="Gun_TurretImprovised"]/comps
- 300
- 300
+ 200
+ 7.8
true
AmmoSet_556x45mmNATO
@@ -1293,24 +1285,24 @@
*/ThingDef[defName="Gun_Minigun"]/statBases/Mass
- 20.00
+ 39.00
*/ThingDef[defName="Gun_Minigun"]/statBases/RangedWeapon_Cooldown
- 1.5
+ 0.35
*/ThingDef[defName="Gun_Minigun"]/statBases
- 1.25
- 0.08
- 2.10
- 16.00
+ 50
+ 0.06
+ 4.70
+ 8.02
@@ -1320,13 +1312,13 @@
Mounted
- 0.90
+ 0.09
CombatExtended.Verb_ShootCE
true
Bullet_762x51mmNATO_FMJ
- 4
+ 1.1
75
- 300
+ 10
1
ShotMinigun
GunTail_Medium
@@ -1359,12 +1351,12 @@
600
- 300
+ 9.2
AmmoSet_762x51mmNATO
FALSE
- TRUE
+ FALSE
@@ -1482,7 +1474,7 @@
*/ThingDef[defName="Gun_DoomsdayRocket"]/statBases/Mass
- 11.00
+ 20.00
@@ -1496,10 +1488,10 @@
*/ThingDef[defName="Gun_DoomsdayRocket"]/statBases
- 1.25
+ 0.9
0.2
- 2.20
- 17.50
+ 3.24
+ 12.00
@@ -1512,8 +1504,8 @@
true
Bullet_DoomsdayRocket
0.0
- 4.5
- 62
+ 2.3
+ 48
1
InfernoCannon_Fire
GunTail_Heavy
@@ -1656,7 +1648,7 @@
*/ThingDef[defName="Gun_TripleRocket"]/statBases/Mass
- 9.00
+ 12.00
@@ -1670,10 +1662,10 @@
*/ThingDef[defName="Gun_TripleRocket"]/statBases
- 1.25
+ 0.5
0.2
- 2.00
- 17.50
+ 2.20
+ 10.00
@@ -1686,8 +1678,8 @@
true
Bullet_Rocket
2.0
- 5
- 62
+ 1.9
+ 40
20
3
InfernoCannon_Fire
@@ -1725,7 +1717,6 @@
*/ThingDef[defName="Gun_TripleRocket"]/comps
- 1
FALSE
TRUE
true
@@ -1785,24 +1776,24 @@
*/ThingDef[defName="Gun_ChargeBlasterHeavy"]/statBases/Mass
- 25.00
+ 35.00
*/ThingDef[defName="Gun_ChargeBlasterHeavy"]/statBases/RangedWeapon_Cooldown
- 1.5
+ 0.36
*/ThingDef[defName="Gun_ChargeBlasterHeavy"]/statBases
- 1.25
- 0.04
- 4.50
- 24.00
+ 0.5
+ 0.01
+ 4.80
+ 13.00
@@ -1812,14 +1803,14 @@
Mounted
- 0.54
+ 0.75
CombatExtended.Verb_ShootCE
true
Bullet_12x64mmCharged
2.9
- 3
- 68
- 5
+ 1.1
+ 86
+ 6
20
ShotChargeBlaster
GunTail_Heavy
@@ -1852,13 +1843,13 @@
100
- 300
+ 9.2
AmmoSet_12x64mmCharged
- 10
+ 5
FALSE
- TRUE
+ FALSE
@@ -1895,24 +1886,24 @@
*/ThingDef[defName="Gun_InfernoCannon"]/statBases/Mass
- 100.00
+ 300.00
*/ThingDef[defName="Gun_InfernoCannon"]/statBases/RangedWeapon_Cooldown
- 1.5
+ 2.53
*/ThingDef[defName="Gun_InfernoCannon"]/statBases
- 1.25
- 0.1
- 15.50
- 37.50
+ 0.5
+ 0.01
+ 0.82
+ 20.00
@@ -1925,8 +1916,8 @@
true
Bullet_80x256mmFuel_Thermobaric
true
- 4
- 62
+ 4.1
+ 86
1
InfernoCannon_Fire
GunTail_Light
@@ -1959,7 +1950,7 @@
1
- 600
+ 9.8
AmmoSet_80x256mmFuel
@@ -2001,24 +1992,24 @@
*/ThingDef[defName="Gun_ChargeLance"]/statBases/Mass
- 7.00
+ 8.00
*/ThingDef[defName="Gun_ChargeLance"]/statBases/RangedWeapon_Cooldown
- 0.5
+ 0.35
*/ThingDef[defName="Gun_ChargeLance"]/statBases
- 1.25
- 0.017
- 2.30
- 18.00
+ 0.5
+ 0.01
+ 2.10
+ 13.00
@@ -2030,8 +2021,8 @@
CombatExtended.Verb_ShootCE
true
Bullet_5x35mmCharged
- 1.4
- 81
+ 1.1
+ 62
1
ChargeLance_Fire
GunTail_Heavy
@@ -2063,7 +2054,8 @@
*/ThingDef[defName="Gun_ChargeLance"]/comps
- 0
+ 1
+ 1.6
AmmoSet_5x35mmCharged
diff --git a/Patches/Core/ThingDefs_Races/Races_Animal_Rodentlike.xml b/Patches/Core/ThingDefs_Races/Races_Animal_Rodentlike.xml
index 74de230ff5..f7abaee436 100644
--- a/Patches/Core/ThingDefs_Races/Races_Animal_Rodentlike.xml
+++ b/Patches/Core/ThingDefs_Races/Races_Animal_Rodentlike.xml
@@ -276,6 +276,35 @@
+
+ Always
+
+
+ */ThingDef[defName="Boomrat"]/comps
+ Invert
+
+
+ */ThingDef[defName="Boomrat"]
+
+
+
+
+
+
+
+
+ */ThingDef[defName="Boomrat"]/comps
+
+
+ CombatExtended.CompShearableRenameable
+ Chemical fullness
+ 5
+ 1
+ FSX
+
+
+
+
diff --git a/Patches/Core/ThingDefs_Races/Races_Animal_Tropical.xml b/Patches/Core/ThingDefs_Races/Races_Animal_Tropical.xml
index 3a94f30741..f7856cf01f 100644
--- a/Patches/Core/ThingDefs_Races/Races_Animal_Tropical.xml
+++ b/Patches/Core/ThingDefs_Races/Races_Animal_Tropical.xml
@@ -141,8 +141,8 @@
CombatExtended.CompShearableRenameable
Chemical fullness
- 5
- 5
+ 20
+ 20
FSX
diff --git a/Source/CombatExtended/CombatExtended.csproj b/Source/CombatExtended/CombatExtended.csproj
index 41e9623819..a8cb2306e6 100644
--- a/Source/CombatExtended/CombatExtended.csproj
+++ b/Source/CombatExtended/CombatExtended.csproj
@@ -123,6 +123,7 @@
+
diff --git a/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs b/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs
index 128d2afa39..160f487316 100644
--- a/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs
+++ b/Source/CombatExtended/CombatExtended/ArmorUtilityCE.cs
@@ -14,8 +14,6 @@ public static class ArmorUtilityCE
private const float PenetrationRandVariation = 0.05f; // Armor penetration will be randomized by +- this amount
private const float SoftArmorMinDamageFactor = 0.2f; // Soft body armor will always take at least original damage * this number from sharp attacks
- public const string ShieldTag = "CE_Shield"; // Identify shields by this apparel tag
- public const string BallisticShieldTag = "CE_BallisticShield";
#endregion
@@ -34,9 +32,12 @@ public static class ArmorUtilityCE
/// The pre-armor damage info
/// The damaged pawn
/// The pawn's body part that has been hit
+ /// Returns true if attack did not penetrate pawn's melee shield
/// If shot is deflected returns a new dinfo cloned from the original with damage amount, Def and ForceHitPart adjusted for deflection, otherwise a clone with only the damage adjusted
- public static DamageInfo GetAfterArmorDamage(DamageInfo originalDinfo, Pawn pawn, BodyPartRecord hitPart)
+ public static DamageInfo GetAfterArmorDamage(DamageInfo originalDinfo, Pawn pawn, BodyPartRecord hitPart, out bool shieldAbsorbed)
{
+ shieldAbsorbed = false;
+
if (originalDinfo.Def.armorCategory == null) return originalDinfo;
DamageInfo dinfo = new DamageInfo(originalDinfo);
@@ -59,28 +60,48 @@ public static DamageInfo GetAfterArmorDamage(DamageInfo originalDinfo, Pawn pawn
List apparel = pawn.apparel.WornApparel;
// Check for shields first
- Apparel shield = apparel.FirstOrDefault(x => x.def.apparel.tags.Any(t => t == ShieldTag || t == BallisticShieldTag));
+ Apparel shield = apparel.FirstOrDefault(x => x is Apparel_Shield);
if (shield != null)
{
// Determine whether the hit is blocked by the shield
bool blockedByShield = false;
if (!(dinfo.WeaponGear?.IsMeleeWeapon ?? false))
{
- if (hitPart.height == BodyPartHeight.Middle)
+ var shieldDef = shield.def.GetModExtension();
+ if (shieldDef == null)
{
- // Torso hits are always deflected but right arm is vulnerable during warmup/attack/cooldown
- blockedByShield = !(pawn.stances?.curStance?.StanceBusy ?? false && hitPart.IsInGroup(DefDatabase.GetNamed("Arms")) && hitPart.def.defName.Contains("Right"));
+ Log.ErrorOnce("CE :: shield " + shield.def.ToString() + " is Apparel_Shield but has no ShieldDefExtension", shield.def.GetHashCode() + 12748102);
}
- else if (shield.def.apparel.tags.Contains(BallisticShieldTag))
+ else
{
- // Feet are always vulnerable, legs and pelvis only while not crouching
- blockedByShield = hitPart.height != BodyPartHeight.Bottom || (!hitPart.IsInGroup(DefDatabase.GetNamed("Feet")) && pawn.IsCrouching());
+ bool hasCoverage = shieldDef.PartIsCoveredByShield(hitPart, pawn);
+ if (hasCoverage)
+ {
+ // Right arm is vulnerable during warmup/attack/cooldown
+ blockedByShield = !((pawn.stances?.curStance as Stance_Busy)?.verb != null && hitPart.IsInGroup(DefDatabase.GetNamed("Arms")) && hitPart.def.defName.Contains("Right"));
+ }
}
}
// Try to penetrate the shield
if (blockedByShield && !TryPenetrateArmor(dinfo.Def, shield.GetStatValue(dinfo.Def.armorCategory.deflectionStat), ref penAmount, ref dmgAmount, shield))
{
+ shieldAbsorbed = true;
dinfo.SetAmount(0);
+
+ // Apply secondary damage to shield
+ var props = dinfo.WeaponGear.projectile as ProjectilePropertiesCE;
+ if (props != null && !props.secondaryDamage.NullOrEmpty())
+ {
+ foreach(SecondaryDamage sec in props.secondaryDamage)
+ {
+ if (shield.Destroyed) break;
+ var secDinfo = sec.GetDinfo();
+ var pen = GetPenetrationValue(originalDinfo);
+ var dmg = (float)secDinfo.Amount;
+ TryPenetrateArmor(secDinfo.Def, shield.GetStatValue(secDinfo.Def.armorCategory.deflectionStat), ref pen, ref dmg, shield);
+ }
+ }
+
return dinfo;
}
}
diff --git a/Source/CombatExtended/CombatExtended/Comps/CompAmmoUser.cs b/Source/CombatExtended/CombatExtended/Comps/CompAmmoUser.cs
index ee3363fe48..cecb843be4 100644
--- a/Source/CombatExtended/CombatExtended/Comps/CompAmmoUser.cs
+++ b/Source/CombatExtended/CombatExtended/Comps/CompAmmoUser.cs
@@ -484,7 +484,7 @@ public override string GetDescriptionPart()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.AppendLine("CE_MagazineSize".Translate() + ": " + GenText.ToStringByStyle(Props.magazineSize, ToStringStyle.Integer));
- stringBuilder.AppendLine("CE_ReloadTime".Translate() + ": " + GenText.ToStringByStyle((Props.reloadTicks / 60), ToStringStyle.Integer) + " s");
+ stringBuilder.AppendLine("CE_ReloadTime".Translate() + ": " + GenText.ToStringByStyle((Props.reloadTime), ToStringStyle.Integer) + " s");
if (useAmmo)
{
// Append various ammo stats
@@ -495,7 +495,7 @@ public override string GetDescriptionPart()
stringBuilder.AppendLine(label + ":\n" + cur.projectile.GetProjectileReadout());
}
}
- return stringBuilder.ToString();
+ return stringBuilder.ToString().TrimEndNewlines();
}
#endregion Methods
diff --git a/Source/CombatExtended/CombatExtended/Comps/CompFireModes.cs b/Source/CombatExtended/CombatExtended/Comps/CompFireModes.cs
index 4fc82bd3ac..255f6998e3 100644
--- a/Source/CombatExtended/CombatExtended/Comps/CompFireModes.cs
+++ b/Source/CombatExtended/CombatExtended/Comps/CompFireModes.cs
@@ -205,7 +205,7 @@ public override string GetDescriptionPart()
stringBuilder.AppendLine("CE_AimedBurstCount".Translate() + ": " + GenText.ToStringByStyle(Props.aimedBurstShotCount, ToStringStyle.Integer));
}
}
- return stringBuilder.ToString();
+ return stringBuilder.ToString().TrimEndNewlines();
}
}
}
diff --git a/Source/CombatExtended/CombatExtended/Comps/CompProperties_AmmoUser.cs b/Source/CombatExtended/CombatExtended/Comps/CompProperties_AmmoUser.cs
index 86a5089e58..fd07ac9090 100644
--- a/Source/CombatExtended/CombatExtended/Comps/CompProperties_AmmoUser.cs
+++ b/Source/CombatExtended/CombatExtended/Comps/CompProperties_AmmoUser.cs
@@ -11,7 +11,7 @@ namespace CombatExtended
public class CompProperties_AmmoUser : CompProperties
{
public int magazineSize = 0;
- public int reloadTicks = 300;
+ public float reloadTime = 1;
public bool throwMote = true;
public AmmoSetDef ammoSet = null;
public bool spawnUnloaded = false;
diff --git a/Source/CombatExtended/CombatExtended/DamageWorkers/DamageWorker_AddInjuryCE.cs b/Source/CombatExtended/CombatExtended/DamageWorkers/DamageWorker_AddInjuryCE.cs
index 5d6122a287..092ac375a6 100644
--- a/Source/CombatExtended/CombatExtended/DamageWorkers/DamageWorker_AddInjuryCE.cs
+++ b/Source/CombatExtended/CombatExtended/DamageWorkers/DamageWorker_AddInjuryCE.cs
@@ -83,7 +83,7 @@ private float ApplyToPawn(DamageInfo dinfo, Pawn pawn)
}
if (!this.FragmentDamageForDamageType(dinfo, pawn, ref localInjuryResult))
{
- this.ApplyDamagePartial(dinfo, pawn, ref localInjuryResult);
+ this.ApplyDamageToPart(dinfo, pawn, ref localInjuryResult);
this.CheckDuplicateSmallPawnDamageToPartParent(dinfo, pawn, ref localInjuryResult);
}
if (localInjuryResult.wounded)
@@ -121,6 +121,10 @@ private float ApplyToPawn(DamageInfo dinfo, Pawn pawn)
private void CheckApplySpreadDamage(DamageInfo dinfo, Thing t)
{
+ if (dinfo.Def == DamageDefOf.Flame && !t.FlammableNow)
+ {
+ return;
+ }
if (UnityEngine.Random.value < 0.5f)
{
dinfo.SetAmount(Mathf.CeilToInt((float)dinfo.Amount * Rand.Range(0.35f, 0.7f)));
@@ -130,26 +134,7 @@ private void CheckApplySpreadDamage(DamageInfo dinfo, Thing t)
private bool FragmentDamageForDamageType(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCE.LocalInjuryResult result)
{
- if (!dinfo.AllowDamagePropagation)
- {
- return false;
- }
- if (dinfo.Amount < 9)
- {
- return false;
- }
- if (!dinfo.Def.spreadOut)
- {
- return false;
- }
- int num = Rand.RangeInclusive(3, 4);
- for (int i = 0; i < num; i++)
- {
- DamageInfo dinfo2 = dinfo;
- dinfo2.SetAmount(dinfo.Amount / num);
- this.ApplyDamagePartial(dinfo2, pawn, ref result);
- }
- return true;
+ return dinfo.AllowDamagePropagation && dinfo.Amount >= 9 && dinfo.Def.spreadOut;
}
private void CheckDuplicateSmallPawnDamageToPartParent(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCE.LocalInjuryResult result)
@@ -162,11 +147,11 @@ private void CheckDuplicateSmallPawnDamageToPartParent(DamageInfo dinfo, Pawn pa
{
DamageInfo dinfo2 = dinfo;
dinfo2.SetForcedHitPart(result.lastHitPart.parent);
- this.ApplyDamagePartial(dinfo2, pawn, ref result);
+ this.ApplyDamageToPart(dinfo2, pawn, ref result);
}
}
- private void ApplyDamagePartial(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCE.LocalInjuryResult result)
+ private void ApplyDamageToPart(DamageInfo dinfo, Pawn pawn, ref DamageWorker_AddInjuryCE.LocalInjuryResult result)
{
BodyPartRecord exactPartFromDamageInfo = DamageWorker_AddInjuryCE.GetExactPartFromDamageInfo(dinfo, pawn);
if (exactPartFromDamageInfo == null)
@@ -175,12 +160,14 @@ private void ApplyDamagePartial(DamageInfo dinfo, Pawn pawn, ref DamageWorker_Ad
}
bool involveArmor = !dinfo.InstantOldInjury;
DamageInfo postArmorDinfo = dinfo;
+ bool shieldAbsorbed = false;
if (involveArmor)
{
- //dmgAmount = ArmorUtility.GetAfterArmorDamage(pawn, postArmorDinfo.Amount, exactPartFromDamageInfo, postArmorDinfo.Def);
- postArmorDinfo = ArmorUtilityCE.GetAfterArmorDamage(dinfo, pawn, exactPartFromDamageInfo);
+ postArmorDinfo = ArmorUtilityCE.GetAfterArmorDamage(dinfo, pawn, exactPartFromDamageInfo, out shieldAbsorbed);
if (postArmorDinfo.ForceHitPart != null && exactPartFromDamageInfo != postArmorDinfo.ForceHitPart) exactPartFromDamageInfo = postArmorDinfo.ForceHitPart; // If the shot was deflected, update our body part
}
+
+ // Vanilla code - apply hediff
if ((double)postArmorDinfo.Amount < 0.001)
{
result.deflected = true;
@@ -224,6 +211,22 @@ private void ApplyDamagePartial(DamageInfo dinfo, Pawn pawn, ref DamageWorker_Ad
this.FinalizeAndAddInjury(pawn, hediff_Injury, postArmorDinfo, ref result);
this.CheckPropagateDamageToInnerSolidParts(postArmorDinfo, pawn, hediff_Injury, involveArmor, ref result);
this.CheckDuplicateDamageToOuterParts(postArmorDinfo, pawn, hediff_Injury, involveArmor, ref result);
+
+ // Apply secondary damage
+ if (!shieldAbsorbed)
+ {
+ var props = dinfo.WeaponGear?.projectile as ProjectilePropertiesCE;
+ if (props != null && !props.secondaryDamage.NullOrEmpty() && dinfo.Def == props.damageDef)
+ {
+ foreach (SecondaryDamage sec in props.secondaryDamage)
+ {
+ if (pawn.Dead) return;
+ var secDinfo = sec.GetDinfo(postArmorDinfo);
+ secDinfo.SetForcedHitPart(exactPartFromDamageInfo);
+ pawn.TakeDamage(secDinfo);
+ }
+ }
+ }
}
private void FinalizeAndAddInjury(Pawn pawn, Hediff_Injury injury, DamageInfo dinfo, ref DamageWorker_AddInjuryCE.LocalInjuryResult result)
diff --git a/Source/CombatExtended/CombatExtended/Defs/ShieldDefExtension.cs b/Source/CombatExtended/CombatExtended/Defs/ShieldDefExtension.cs
new file mode 100644
index 0000000000..5781ae0700
--- /dev/null
+++ b/Source/CombatExtended/CombatExtended/Defs/ShieldDefExtension.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using RimWorld;
+using Verse;
+using UnityEngine;
+
+namespace CombatExtended
+{
+ public class ShieldDefExtension : DefModExtension
+ {
+ public List shieldCoverage = new List();
+ public List crouchCoverage = new List();
+ public bool drawAsTall = false;
+
+ public bool PartIsCoveredByShield(BodyPartRecord part, Pawn pawn)
+ {
+ if (!shieldCoverage.NullOrEmpty())
+ {
+ foreach(BodyPartGroupDef group in shieldCoverage)
+ {
+ if (part.IsInGroup(group)) return true;
+ }
+ }
+ if (!crouchCoverage.NullOrEmpty() && pawn.IsCrouching())
+ {
+ foreach(BodyPartGroupDef group in crouchCoverage)
+ {
+ if (part.IsInGroup(group)) return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_Reload.cs b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_Reload.cs
index 29fe5911c2..de48b83af0 100644
--- a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_Reload.cs
+++ b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_Reload.cs
@@ -142,7 +142,7 @@ protected override IEnumerable MakeNewToils()
Toil waitToil = new Toil() { actor = pawn }; // actor was always null in testing...
waitToil.initAction = () => waitToil.actor.pather.StopDead();
waitToil.defaultCompleteMode = ToilCompleteMode.Delay;
- waitToil.defaultDuration = Mathf.CeilToInt(compReloader.Props.reloadTicks / pawn.GetStatValue(CE_StatDefOf.ReloadSpeed));
+ waitToil.defaultDuration = Mathf.CeilToInt(compReloader.Props.reloadTime.SecondsToTicks() / pawn.GetStatValue(CE_StatDefOf.ReloadSpeed));
yield return waitToil.WithProgressBarToilDelay(indReloader);
//Actual reloader
diff --git a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs
index 19fb01fe4a..ebb1b33d58 100644
--- a/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs
+++ b/Source/CombatExtended/CombatExtended/Jobs/JobDriver_ReloadTurret.cs
@@ -109,7 +109,7 @@ protected override IEnumerable MakeNewToils()
compReloader.TryUnload();
};
waitToil.defaultCompleteMode = ToilCompleteMode.Delay;
- waitToil.defaultDuration = Mathf.CeilToInt(compReloader.Props.reloadTicks / pawn.GetStatValue(CE_StatDefOf.ReloadSpeed));
+ waitToil.defaultDuration = Mathf.CeilToInt(compReloader.Props.reloadTime.SecondsToTicks() / pawn.GetStatValue(CE_StatDefOf.ReloadSpeed));
yield return waitToil.WithProgressBarToilDelay(TargetIndex.A);
//Actual reloader
diff --git a/Source/CombatExtended/CombatExtended/Jobs/JobGiver_TakeAndEquip.cs b/Source/CombatExtended/CombatExtended/Jobs/JobGiver_TakeAndEquip.cs
index 7897f8965e..ac11bf5482 100644
--- a/Source/CombatExtended/CombatExtended/Jobs/JobGiver_TakeAndEquip.cs
+++ b/Source/CombatExtended/CombatExtended/Jobs/JobGiver_TakeAndEquip.cs
@@ -99,7 +99,7 @@ private WorkPriority GetPriorityWork(Pawn pawn)
public override float GetPriority(Pawn pawn)
{
- if (!Controller.settings.AutoTakeAmmo || !Controller.settings.EnableAmmoSystem) return 0f;
+ if ((!Controller.settings.AutoTakeAmmo && pawn.IsColonist) || !Controller.settings.EnableAmmoSystem) return 0f;
var priority = GetPriorityWork(pawn);
@@ -285,17 +285,11 @@ select w
int numToThing = 0;
if (inventory.CanFitInInventory(thing, out numToThing))
{
- if (thing.Position == pawn.Position || thing.Position.AdjacentToCardinal(pawn.Position))
+ return new Job(JobDefOf.Equip, thing)
{
- return new Job(JobDefOf.Equip, thing)
- {
- checkOverrideOnExpire = true,
- expiryInterval = 100,
- canBash = true,
- locomotionUrgency = LocomotionUrgency.Sprint
- };
- }
- return GotoForce(pawn, thing, PathEndMode.Touch);
+ checkOverrideOnExpire = true,
+ expiryInterval = 100
+ };
}
} else {
// pickup a CE ranged weapon...
@@ -321,17 +315,11 @@ select t
int numToThing = 0;
if (inventory.CanFitInInventory(thing, out numToThing))
{
- if (thing.Position == pawn.Position || thing.Position.AdjacentToCardinal(pawn.Position))
+ return new Job(JobDefOf.Equip, thing)
{
- return new Job(JobDefOf.Equip, thing)
- {
- checkOverrideOnExpire = true,
- expiryInterval = 100,
- canBash = true,
- locomotionUrgency = LocomotionUrgency.Sprint
- };
- }
- return GotoForce(pawn, thing, PathEndMode.Touch);
+ checkOverrideOnExpire = true,
+ expiryInterval = 100
+ };
}
}
}
@@ -346,20 +334,13 @@ select t
Thing meleeWeapon = allWeapons.FirstOrDefault(w => !w.def.IsRangedWeapon && w.def.IsMeleeWeapon);
if (meleeWeapon != null)
- {
- if (meleeWeapon.Position == pawn.Position || meleeWeapon.Position.AdjacentToCardinal(pawn.Position))
- {
- return new Job(JobDefOf.Equip, meleeWeapon)
- {
- checkOverrideOnExpire = true,
- expiryInterval = 100,
- canBash = true,
- locomotionUrgency = LocomotionUrgency.Sprint
- };
- }
-
- return GotoForce(pawn, meleeWeapon, PathEndMode.Touch);
- }
+ {
+ return new Job(JobDefOf.Equip, meleeWeapon)
+ {
+ checkOverrideOnExpire = true,
+ expiryInterval = 100
+ };
+ }
}
}
}
@@ -422,22 +403,16 @@ select t
}
else
{
- if (th.Position == pawn.Position || th.Position.AdjacentToCardinal(pawn.Position))
+ int numToCarry = 0;
+ if (inventory.CanFitInInventory(th, out numToCarry))
{
- int numToCarry = 0;
- if (inventory.CanFitInInventory(th, out numToCarry))
+ return new Job(JobDefOf.TakeInventory, th)
{
- return new Job(JobDefOf.TakeInventory, th)
- {
- count = Mathf.RoundToInt(numToCarry * 0.8f),
- expiryInterval = 150,
- checkOverrideOnExpire = true,
- canBash = true,
- locomotionUrgency = LocomotionUrgency.Sprint
- };
- }
+ count = Mathf.RoundToInt(numToCarry * 0.8f),
+ expiryInterval = 150,
+ checkOverrideOnExpire = true
+ };
}
- return GotoForce(pawn, th, PathEndMode.Touch);
}
}
}
diff --git a/Source/CombatExtended/CombatExtended/Projectiles/BulletCE.cs b/Source/CombatExtended/CombatExtended/Projectiles/BulletCE.cs
index 29d61e94a7..02a0b832e0 100644
--- a/Source/CombatExtended/CombatExtended/Projectiles/BulletCE.cs
+++ b/Source/CombatExtended/CombatExtended/Projectiles/BulletCE.cs
@@ -37,42 +37,8 @@ protected override void Impact(Thing hitThing)
dinfo.SetBodyRegion(partHeight, partDepth);
if (damDefCE != null && damDefCE.harmOnlyOutsideLayers) dinfo.SetBodyRegion(BodyPartHeight.Undefined, BodyPartDepth.Outside);
- ProjectilePropertiesCE propsCE = def.projectile as ProjectilePropertiesCE;
- if (propsCE != null && !propsCE.secondaryDamage.NullOrEmpty())
- {
- // Get the correct body part
- Pawn pawn = hitThing as Pawn;
- if (pawn != null && def.projectile.damageDef.workerClass == typeof(DamageWorker_AddInjuryCE))
- {
- //BodyPartRecord exactPartFromDamageInfo = DamageWorker_AddInjuryCE.GetExactPartFromDamageInfo(dinfo, pawn);
- dinfo = new DamageInfo(
- dinfo.Def,
- dinfo.Amount,
- dinfo.Angle,
- dinfo.Instigator,
- DamageWorker_AddInjuryCE.GetExactPartFromDamageInfo(dinfo, pawn),
- dinfo.WeaponGear);
- }
- List dinfoList = new List() { dinfo };
- foreach (SecondaryDamage secDamage in propsCE.secondaryDamage)
- {
- dinfoList.Add(new DamageInfo(
- secDamage.def,
- secDamage.amount,
- dinfo.Angle,
- dinfo.Instigator,
- dinfo.ForceHitPart,
- dinfo.WeaponGear));
- }
- foreach (DamageInfo curDinfo in dinfoList)
- {
- hitThing.TakeDamage(curDinfo);
- }
- }
- else
- {
- hitThing.TakeDamage(dinfo);
- }
+ // Apply primary damage
+ hitThing.TakeDamage(dinfo);
}
else
{
diff --git a/Source/CombatExtended/CombatExtended/SecondaryDamage.cs b/Source/CombatExtended/CombatExtended/SecondaryDamage.cs
index 254244d757..1e606e27d8 100644
--- a/Source/CombatExtended/CombatExtended/SecondaryDamage.cs
+++ b/Source/CombatExtended/CombatExtended/SecondaryDamage.cs
@@ -1,4 +1,8 @@
-using RimWorld;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using RimWorld;
using Verse;
using UnityEngine;
@@ -8,5 +12,22 @@ public class SecondaryDamage
{
public DamageDef def;
public int amount;
+
+ public DamageInfo GetDinfo()
+ {
+ return new DamageInfo(def, amount);
+ }
+
+ public DamageInfo GetDinfo(DamageInfo primaryDinfo)
+ {
+ var dinfo = new DamageInfo(def,
+ amount,
+ primaryDinfo.Angle,
+ primaryDinfo.Instigator,
+ primaryDinfo.ForceHitPart,
+ primaryDinfo.WeaponGear);
+ dinfo.SetBodyRegion(primaryDinfo.Height, primaryDinfo.Depth);
+ return dinfo;
+ }
}
}
\ No newline at end of file
diff --git a/Source/CombatExtended/CombatExtended/Things/AmmoThing.cs b/Source/CombatExtended/CombatExtended/Things/AmmoThing.cs
index e048d41454..b4c3abb6ca 100644
--- a/Source/CombatExtended/CombatExtended/Things/AmmoThing.cs
+++ b/Source/CombatExtended/CombatExtended/Things/AmmoThing.cs
@@ -39,7 +39,7 @@ public override string GetDescription()
stringBuilder.AppendLine(" -" + user.LabelCap);
}
- return stringBuilder.ToString();
+ return stringBuilder.ToString().TrimEndNewlines();
}
return base.GetDescription();
}
diff --git a/Source/CombatExtended/CombatExtended/Things/Apparel_Shield.cs b/Source/CombatExtended/CombatExtended/Things/Apparel_Shield.cs
index a2ee829651..b83d7e1a27 100644
--- a/Source/CombatExtended/CombatExtended/Things/Apparel_Shield.cs
+++ b/Source/CombatExtended/CombatExtended/Things/Apparel_Shield.cs
@@ -12,7 +12,7 @@ public class Apparel_Shield : Apparel
{
public const string OneHandedTag = "CE_OneHandedWeapon";
private bool drawShield => Wearer.Drafted || (Wearer.CurJob?.def.alwaysShowWeapon ?? false) || (Wearer.mindState.duty?.def.alwaysShowWeapon ?? false); // Copied from PawnRenderer.CarryWeaponOpenly(), we show the shield whenever weapons are drawn
- private bool isTall => def.apparel.tags.Contains(ArmorUtilityCE.BallisticShieldTag);
+ private bool IsTall => def.GetModExtension()?.drawAsTall ?? false;
public override bool AllowVerbCast(IntVec3 root, Map map, LocalTargetInfo targ)
{
@@ -33,7 +33,7 @@ public override void DrawWornExtras()
{
//vector.y = Altitudes.AltitudeFor(AltitudeLayer.Pawn);
vector.x -= 0.1f;
- vector.z -= isTall ? -0.1f : 0.2f;
+ vector.z -= IsTall ? -0.1f : 0.2f;
}
else
{
@@ -42,15 +42,15 @@ public override void DrawWornExtras()
//vector.y = Altitudes.AltitudeFor(AltitudeLayer.MoteOverhead);
vector.y += 0.0375f;
vector.x += 0.1f;
- vector.z -= isTall ? -0.05f : 0.2f;
+ vector.z -= IsTall ? -0.05f : 0.2f;
}
else
{
if (this.Wearer.Rotation == Rot4.East)
{
//vector.y = Altitudes.AltitudeFor(AltitudeLayer.Pawn);
- if (isTall) vector.x += 0.1f;
- vector.z -= isTall ? -0.05f : 0.2f;
+ if (IsTall) vector.x += 0.1f;
+ vector.z -= IsTall ? -0.05f : 0.2f;
num = 22.5f;
}
else
@@ -59,8 +59,8 @@ public override void DrawWornExtras()
{
//vector.y = Altitudes.AltitudeFor(AltitudeLayer.MoteOverhead);
vector.y += 0.0425f;
- if (isTall) vector.x -= 0.1f;
- vector.z -= isTall ? -0.05f : 0.2f;
+ if (IsTall) vector.x -= 0.1f;
+ vector.z -= IsTall ? -0.05f : 0.2f;
num = 337.5f;
}
}
diff --git a/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs b/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs
index 0334ef2cf2..b316189046 100644
--- a/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs
+++ b/Source/CombatExtended/CombatExtended/Things/Building_TurretGunCE.cs
@@ -251,6 +251,7 @@ public override void ExposeData()
Scribe_Values.Look(ref burstWarmupTicksLeft, "burstWarmupTicksLeft", 0);
Scribe_Values.Look(ref isReloading, "isReloading", false);
Scribe_Values.Look(ref ticksUntilAutoReload, "ticksUntilAutoReload", 0);
+ // gunInt saving disabled until we can figure out a fix for the bug where it'll lose track of its verbs -NIA
//Scribe_Deep.Look(ref gunInt, "gunInt");
}