Skip to content

Commit

Permalink
Now it's possible to specify unavailable projectiles for Verb (can be…
Browse files Browse the repository at this point in the history
… useful for CIWS)
  • Loading branch information
MaxDorob committed Nov 30, 2024
1 parent fb38321 commit b8d4434
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ public virtual void TryStartShootSomething(bool canBeginBurstImmediately) //

public virtual LocalTargetInfo TryFindNewTarget() // Core method
{
if (!AttackVerb.Available())
{
return null;
}
IAttackTargetSearcher attackTargetSearcher = this.TargSearcher();
Faction faction = attackTargetSearcher.Thing.Faction;
float range = this.AttackVerb.verbProps.range;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public class VerbPropertiesCE : VerbProperties
public bool ejectsCasings = true;
public bool ignorePartialLoSBlocker = false;
public bool interruptibleBurst = true;
public List<ThingDef> cantShotWith = new List<ThingDef>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public override bool Available()
}
}

return Projectile != null;
return Projectile != null && !VerbPropsCE.cantShotWith.Contains(Projectile);
}

/// <summary>
Expand Down

0 comments on commit b8d4434

Please sign in to comment.