Skip to content

Commit

Permalink
moved to ProjectileProps
Browse files Browse the repository at this point in the history
  • Loading branch information
CMDR-Bill-Doors committed Sep 6, 2024
1 parent 21d1f0d commit 68119b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions Defs/Ammo/Pistols/45ACP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<!-- ================== Projectiles ================== -->

<ThingDef Class="CombatExtended.AmmoDef" Name="Base45ACPBullet" ParentName="BaseBulletCE" Abstract="true">
<ThingDef Name="Base45ACPBullet" ParentName="BaseBulletCE" Abstract="true">
<graphicData>
<texPath>Things/Projectile/Bullet_Small</texPath>
<graphicClass>Graphic_Single</graphicClass>
Expand All @@ -108,11 +108,11 @@
<dropsCasings>true</dropsCasings>
<casingMoteDefname>Fleck_PistolAmmoCasings</casingMoteDefname>
<casingFilthDefname>Filth_PistolAmmoCasings</casingFilthDefname>
<genericLabelOverride>pistol</genericLabelOverride>
</projectile>
<genericLabelOverride>pistol</genericLabelOverride>
</ThingDef>

<ThingDef Class="CombatExtended.AmmoDef" ParentName="Base45ACPBullet">
<ThingDef ParentName="Base45ACPBullet">
<defName>Bullet_45ACP_FMJ</defName>
<label>.45 ACP bullet (FMJ)</label>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
Expand All @@ -122,7 +122,7 @@
</projectile>
</ThingDef>

<ThingDef Class="CombatExtended.AmmoDef" ParentName="Base45ACPBullet">
<ThingDef ParentName="Base45ACPBullet">
<defName>Bullet_45ACP_AP</defName>
<label>.45 ACP bullet (AP)</label>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
Expand All @@ -132,7 +132,7 @@
</projectile>
</ThingDef>

<ThingDef Class="CombatExtended.AmmoDef" ParentName="Base45ACPBullet">
<ThingDef ParentName="Base45ACPBullet">
<defName>Bullet_45ACP_HP</defName>
<label>.45 ACP bullet (HP)</label>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
Expand Down
2 changes: 1 addition & 1 deletion Source/CombatExtended/CombatExtended/AmmoGeneralizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static AmmoGeneralizer()
var sameClass = ammoSource.ammoTypes.Find(x => x.ammo.ammoClass == link.ammo.ammoClass);
if (sameClass != null)
{
string labelNew = (link.projectile is AmmoDef ammodef && ammodef.genericLabelOverride != null) ? ammodef.genericLabelOverride : ammoSource.label;
string labelNew = (link.projectile.projectile is ProjectilePropertiesCE projPropCE && projPropCE.genericLabelOverride != null) ? projPropCE.genericLabelOverride : ammoSource.label;
link.projectile.label = labelNew + " " + "CE_GenericBullet".Translate() + " (" + link.ammo.ammoClass.labelShort + ")";
newAmmos.Add(new AmmoLink { ammo = sameClass.ammo, projectile = link.projectile });
}
Expand Down
2 changes: 0 additions & 2 deletions Source/CombatExtended/CombatExtended/Defs/AmmoDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ public class AmmoDef : ThingDef
public SoundDef cookOffSound = null;
public SoundDef cookOffTailSound = null;
public ThingDef detonateProjectile = null;
[MustTranslate]
public string genericLabelOverride = null;

// mortar ammo should still availabe when the ammo system is off
public bool isMortarAmmo = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class ProjectilePropertiesCE : ProjectileProperties
public ThingDef detonateMoteDef;
public FleckDef detonateFleckDef;
public float detonateEffectsScaleOverride = -1;
[MustTranslate]
public string genericLabelOverride = null;

#region Bunker Buster fields
/// <summary>
Expand Down

0 comments on commit 68119b0

Please sign in to comment.