public static void ThrowBigExplode(Vector3 loc, float size) { if (!loc.ShouldSpawnMotesAt()) { return; } MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(ThingDef.Named("Mote_BigExplode"), null); moteThrown.ScaleUniform = Rand.Range(5f, 6f) * size; moteThrown.exactRotationRate = Rand.Range(0f, 0f); moteThrown.exactPosition = loc; moteThrown.SetVelocityAngleSpeed((float)Rand.Range(6, 8), Rand.Range(0.002f, 0.003f)); GenSpawn.Spawn(moteThrown, loc.ToIntVec3()); }
public static void ThrowFireTrail(Vector3 loc, float size) { if (!loc.ShouldSpawnMotesAt() || MoteCounter.SaturatedLowPriority) { return; } MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(ThingDef.Named("Mote_Firetrail"), null); moteThrown.ScaleUniform = Rand.Range(1.5f, 2.5f) * size; moteThrown.exactRotationRate = Rand.Range(-0.5f, 0.5f); moteThrown.exactPosition = loc; moteThrown.SetVelocityAngleSpeed((float)Rand.Range(30, 40), Rand.Range(0.008f, 0.012f)); GenSpawn.Spawn(moteThrown, loc.ToIntVec3()); }
/// <summary> /// Throw a bubble. /// </summary> public static Mote ThrowBubble(IntVec3 cell) { if (!cell.ShouldSpawnMotesAt()) { return(null); } MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(Util_FishIndustry.MoteBubbleDef, null); moteThrown.ScaleUniform = 0.3f; moteThrown.exactRotationRate = Rand.Range(-0.15f, 0.15f); moteThrown.exactPosition = cell.ToVector3Shifted(); moteThrown.SetVelocityAngleSpeed((float)Rand.Range(-30, 30), 0.009f); GenSpawn.Spawn(moteThrown, cell); return(moteThrown); }
public static void ThrowEmptyCasing(Vector3 loc, ThingDef casingMoteDef, float size = 1f) { if (!loc.ShouldSpawnMotesAt() || MoteCounter.SaturatedLowPriority) { return; } MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(casingMoteDef, null); moteThrown.ScaleUniform = Rand.Range(0.5f, 0.3f) * size; moteThrown.exactRotationRate = Rand.Range(-3f, 4f); moteThrown.exactPosition = loc; moteThrown.airTicksLeft = 60; moteThrown.SetVelocityAngleSpeed((float)Rand.Range(160, 200), Rand.Range(0.020f, 0.0115f)); GenSpawn.Spawn(moteThrown, loc.ToIntVec3()); }
public static void ThrowSmokeForRocketsandMortars(Vector3 loc, float size) { IntVec3 intVec = loc.ToIntVec3(); if (!intVec.InBounds()) { return; } MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(ThingDefOf.Mote_Smoke, null); moteThrown.ScaleUniform = Rand.Range(1.5f, 2.5f) * size; moteThrown.exactRotationRate = Rand.Range(-0.5f, 0.5f); moteThrown.exactPosition = loc; moteThrown.SetVelocityAngleSpeed((float)Rand.Range(30, 40), Rand.Range(0.008f, 0.012f)); GenSpawn.Spawn(moteThrown, loc.ToIntVec3()); }
public static void ThrowBloodSplatter(Vector3 loc) { if (!loc.ShouldSpawnMotesAt()) { return; } MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(ThingDef.Named("Mote_BloodSplatter"), null); moteThrown.ScaleUniform = Rand.Range(2.4f, 2.7f); moteThrown.exactRotationRate = Rand.Range(0f, 0f); moteThrown.exactPosition = loc; moteThrown.exactPosition -= new Vector3(0.1f, 0f, 0.1f); moteThrown.exactPosition += new Vector3(Rand.Value, 0f, Rand.Value); moteThrown.SetVelocityAngleSpeed((float)Rand.Range(6, 8), Rand.Range(0.002f, 0.002f)); GenSpawn.Spawn(moteThrown, loc.ToIntVec3()); }
public static void ThrowSmokeBlack(Vector3 loc, float size) { // Only throw smoke every 10 ticks if (Find.TickManager.TicksGame % 10 != 0) { return; } // Make the mote MoteThrown moteThrown = (MoteThrown)ThingMaker.MakeThing(ThingDef.Named("Mote_SmokeBlack"), null); // Set a size moteThrown.ScaleUniform = Rand.Range(1.5f, 2.5f) * size; // Set a rotation moteThrown.exactRotationRate = Rand.Range(-0.5f, 0.5f); // Set a position moteThrown.exactPosition = loc; // Set angle and speed moteThrown.SetVelocityAngleSpeed((float)Rand.Range(30, 40), Rand.Range(0.008f, 0.012f)); // Spawn mote GenSpawn.Spawn(moteThrown, loc.ToIntVec3()); }