Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ public override void ExposeData()
public override void Launch(Thing launcher, Vector2 origin, float shotAngle, float shotRotation, float shotHeight = 0f, float shotSpeed = -1f, Thing equipment = null, float distance = -1)
{
int armingDelay = 0;
float airburstDistanceOffset = 0f;
if (def.projectile is ProjectilePropertiesCE props)
{
armingDelay = props.armingDelay;
this.castShadow = props.castShadow;
this.GravityPerWidth = props.GravityPerWidth;
airburstDistanceOffset = props.airburstDistanceOffset;
}
if (distance > 0)
{
float cosine = (float)Math.Cos((double)shotAngle);

float fuzeTiming = distance / ((shotSpeed / 60) * cosine);
float fuzeTiming = (distance + airburstDistanceOffset) / ((shotSpeed / 60) * cosine);
#if DEBUG
Log.Message("Distance = " + distance);
Log.Message("ShotSpeed = " + shotSpeed / 60);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class ProjectilePropertiesCE : ProjectileProperties

public int armingDelay = 0;
public float aimHeightOffset = 0;
public float airburstDistanceOffset = 0f;

public float empShieldBreakChance = 1f;
public float collideDistance = 1f;
Expand Down