public void Tick() { this.lifeTime--; Vector3 pos = this.targetCell.ToVector3() + Velocity(-Angle) * Mathf.Lerp(StartZ, 0f, 1f - (float)this.lifeTime / (float)this.maxLifeTime); pos.z += 1.25f; pos.y = AltitudeLayer.MetaOverlays.AltitudeFor(); if (ordnance.HasModExtension <TrailerProjectileExtension>()) { for (int i = 0; i < ordnance.modExtensions.Count; i++) { TrailerProjectileExtension trailer = ordnance.modExtensions[i] as TrailerProjectileExtension; if (trailer != null) { if (lifeTime % trailer.trailerMoteInterval == 0) { for (int ii = 0; ii < trailer.motesThrown; ii++) { // Trail1Thrower.ThrowSmokeTrail(__instance.Position.ToVector3Shifted(), trailer.trailMoteSize, __instance.Map, trailer.trailMoteDef); // TrailThrower.ThrowSmokeTrail(__instance.DrawPos, trailer.trailMoteSize * DistanceCoveredFraction(___origin, ___destination, ___ticksToImpact, __instance.def.projectile.SpeedTilesPerTick), __instance.Map, trailer.trailMoteDef, __instance); Color?DC = null; if (trailer.useGraphicColor) { DC = ordnance.graphicData.color; } else if (trailer.useGraphicColorTwo) { DC = ordnance.graphicData.colorTwo; } TrailThrower.ThrowSprayTrail(pos, map, pos, this.targetCell.ToVector3(), trailer.trailMoteDef, trailer.trailMoteSize * Scale, 240, ordnance.projectile.SpeedTilesPerTick, DC); } } } } } /* * AdeptusMoteMaker.ThrowLightningBolt(pos, map); * AdeptusMoteMaker.ThrowEMPLightningGlow(pos, map, 1.25f); */ }
public static void Postfix(ProjectileCE __instance, int ___ticksToImpact, IntVec3 ___originInt, Vector3 ___destinationInt) { if (__instance != null) { if (__instance.def.HasModExtension <TrailerProjectileExtension>() && __instance.Map != null) { for (int i = 0; i < __instance.def.modExtensions.Count; i++) { TrailerProjectileExtension trailer = __instance.def.modExtensions[i] as TrailerProjectileExtension; if (trailer != null) { if (___ticksToImpact % trailer.trailerMoteInterval == 0) { for (int ii = 0; ii < trailer.motesThrown; ii++) { // Trail1Thrower.ThrowSmokeTrail(__instance.Position.ToVector3Shifted(), trailer.trailMoteSize, __instance.Map, trailer.trailMoteDef); // TrailThrower.ThrowSmokeTrail(__instance.DrawPos, trailer.trailMoteSize * DistanceCoveredFraction(___origin, ___destination, ___ticksToImpact, __instance.def.projectile.SpeedTilesPerTick), __instance.Map, trailer.trailMoteDef, __instance); Color?DC = null; if (trailer.useGraphicColor) { DC = __instance.DrawColor; } else if (trailer.useGraphicColorTwo) { DC = __instance.DrawColorTwo; } TrailThrower.ThrowSprayTrail(__instance.ExactPosition, __instance.Map, ___originInt.ToVector3Shifted(), ___destinationInt, trailer.trailMoteDef, trailer.trailMoteSize, 240, __instance.def.projectile.SpeedTilesPerTick, DC); } } } } } } }