Skip to content

Commit

Permalink
Merge pull request #3282 from Rhinous/sos2-ground-defense
Browse files Browse the repository at this point in the history
SOS2 Patch - GroundDefenseMode compatibility
  • Loading branch information
N7Huntsman authored Aug 21, 2024
2 parents e7792d3 + a0f5159 commit a536e77
Show file tree
Hide file tree
Showing 10 changed files with 1,877 additions and 4 deletions.
2 changes: 1 addition & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<li>miho.fortifiedoutremer</li>
<li>co.uk.epicguru.whatsthatmod</li>
<li>sarg.alphagenes</li>
<li>kentington.saveourship2</li>
</loadBefore>
<loadAfter>
<li>brrainz.harmony</li>
Expand All @@ -73,7 +74,6 @@
<li>sgc.moreutilitypacks</li>
<li>OskarPotocki.VFE.Pirates</li>
<li>JGH.MechanoidBench3</li>
<li>VanillaExpanded.VTEXE.SOS2</li>
<li>sarg.alphaanimals</li>
<li>sarg.magicalmenagerie</li>
<li>ObsidiaExpansion.Xenos.Mothoids</li>
Expand Down
85 changes: 85 additions & 0 deletions ModPatches/Save Our Ship 2/Defs/Save Our Ship 2/Projectiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,89 @@
</projectile>
</ThingDef>

<!-- Ship Weapons -->
<!-- Plasma -->
<ThingDef ParentName="Base40x46mmGrenadeBullet">
<thingClass>CombatExtended.Compatibility.SOS2Compat.ShipProjectileCE</thingClass>
<defName>Bullet_SOS2_Plasma_CE</defName>
<label>plasma toroid</label>
<graphicData>
<texPath>Things/Projectile/ShipTurretPlasma</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>TransparentPostLight</shaderType>
<drawSize>(4,4)</drawSize>
</graphicData>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
<explosionRadius>6.9</explosionRadius>
<speed>150</speed>
<damageDef>ShipPlasmaSmall</damageDef>
<damageAmountBase>100</damageAmountBase>
<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
<extraDamages>
<li>
<def>Flame</def>
<amount>20</amount>
<chance>1</chance>
</li>
</extraDamages>
</projectile>
</ThingDef>

<!-- Kinetic -->
<ThingDef ParentName="Base40x46mmGrenadeBullet">
<thingClass>CombatExtended.Compatibility.SOS2Compat.ShipProjectileCE</thingClass>
<defName>Bullet_SOS2_Kinetic_CE</defName>
<label>slug</label>
<graphicData>
<texPath>Things/Projectile/ShipTurretKinetic</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>TransparentPostLight</shaderType>
<drawSize>(4,4)</drawSize>
</graphicData>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
<explosionRadius>2.3</explosionRadius>
<speed>500</speed>
<damageDef>BombKinetic</damageDef>
<damageAmountBase>90</damageAmountBase>
<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
</projectile>
</ThingDef>

<!-- Laser -->
<ThingDef Class="CombatExtended.Lasers.LaserBeamDefCE" ParentName="BaseLaserBulletTextured">
<defName>Bullet_SOS2_Laser_CE</defName>
<label>laser beam</label>
<graphicData>
<drawSize>10</drawSize>
<color>(255,87,103)</color>
</graphicData>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
<explosionRadius>1.9</explosionRadius>
<speed>160</speed>
<damageDef>ShipLaserSmall</damageDef>
<damageAmountBase>30</damageAmountBase>
<isInstant>true</isInstant>
<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
</projectile>
</ThingDef>

<!-- Auto Cannon -->
<ThingDef ParentName="Base40x46mmGrenadeBullet">
<thingClass>CombatExtended.Compatibility.SOS2Compat.ShipProjectileCE</thingClass>
<defName>Bullet_SOS2_ACI_CE</defName>
<label>Autocannon Slug</label>
<graphicData>
<texPath>Things/Projectile/ShipTurretACI</texPath>
<graphicClass>Graphic_Single</graphicClass>
<shaderType>TransparentPostLight</shaderType>
<drawSize>(2,2)</drawSize>
</graphicData>
<projectile Class="CombatExtended.ProjectilePropertiesCE">
<explosionRadius>1.1</explosionRadius>
<speed>160</speed>
<damageDef>BombACI</damageDef>
<damageAmountBase>40</damageAmountBase>
<applyDamageToExplosionCellsNeighbors>true</applyDamageToExplosionCellsNeighbors>
</projectile>
</ThingDef>
</Defs>
301 changes: 301 additions & 0 deletions ModPatches/Save Our Ship 2/Patches/Save Our Ship 2/Turrets_SOS2.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Building_TurretGunCE : Building_Turret
public int burstCooldownTicksLeft;
public int burstWarmupTicksLeft; // Need this public so aim mode can modify it
public LocalTargetInfo currentTargetInt = LocalTargetInfo.Invalid;
private bool holdFire;
protected bool holdFire;
private Thing gunInt; // Better to be private, because Gun is used for access, instead
public TurretTop top;
public CompPowerTrader powerComp;
Expand All @@ -61,12 +61,12 @@ public class Building_TurretGunCE : Building_Turret
public virtual bool Active => (powerComp == null || powerComp.PowerOn) && (dormantComp == null || dormantComp.Awake) && (initiatableComp == null || initiatableComp.Initiated);
public CompEquippable GunCompEq => Gun.TryGetComp<CompEquippable>();
public override LocalTargetInfo CurrentTarget => currentTargetInt;
private bool WarmingUp => burstWarmupTicksLeft > 0;
protected bool WarmingUp => burstWarmupTicksLeft > 0;
public override Verb AttackVerb => Gun == null ? null : GunCompEq.verbTracker.PrimaryVerb;
public bool IsMannable => mannableComp != null;
public bool PlayerControlled => (Faction == Faction.OfPlayer || MannedByColonist) && !MannedByNonColonist;
protected virtual bool CanSetForcedTarget => mannableComp != null && PlayerControlled;
private bool CanToggleHoldFire => PlayerControlled;
protected bool CanToggleHoldFire => PlayerControlled;
public bool IsMortar => def.building.IsMortar;
public bool IsMortarOrProjectileFliesOverhead => Projectile.projectile.flyOverhead || IsMortar;
//Not included: CanExtractShell
Expand Down
Loading

0 comments on commit a536e77

Please sign in to comment.