//Unmodified public override void Tick() { base.Tick(); if (landed) { return; } Vector3 exactPosition = ExactPosition; ticksToImpact--; if (!ExactPosition.InBounds(base.Map)) { ticksToImpact++; Position = ExactPosition.ToIntVec3(); Destroy(DestroyMode.Vanish); return; } Vector3 exactPosition2 = ExactPosition; if (!def.projectile.flyOverhead && canFreeIntercept && CheckForFreeInterceptBetween(exactPosition, exactPosition2)) { return; } Position = ExactPosition.ToIntVec3(); if (ticksToImpact == 60f && Find.TickManager.CurTimeSpeed == TimeSpeed.Normal && def.projectile.soundImpactAnticipate != null) { def.projectile.soundImpactAnticipate.PlayOneShot(this); } if (ticksToImpact <= 0) { if (DestinationCell.InBounds(base.Map)) { Position = DestinationCell; } ImpactSomething(); return; } if (ambientSustainer != null) { ambientSustainer.Maintain(); } // attack shooting expression if (this.launcher is Building_TurretGunCR == false) { if (Rand.Value > 0.7 && this.launcher.def.race.Humanlike && !robotBodyList.Contains(this.launcher.def.race.body.defName) && Gen.IsHashIntervalTick(launcher, Rand.Range(280, 700))) { AGAIN : string rndswear = RulePackDef.Named("AttackMote").Rules.RandomElement().Generate(); if (rndswear == "[swear]" || rndswear == "" || rndswear == " ") { goto AGAIN; } MoteMaker.ThrowText(launcher.Position.ToVector3Shifted(), this.launcher.Map, rndswear); } } }
public override void Tick() { if (AllComps != null) { int i = 0; int count = AllComps.Count; while (i < count) { AllComps[i].CompTick(); i++; } } if (landed) { return; } Vector3 exactPosition = ExactPosition; ticksToImpact--; if (!ExactPosition.InBounds(Map)) { ticksToImpact++; Position = ExactPosition.ToIntVec3(); Destroy(DestroyMode.Vanish); return; } Vector3 exactPosition2 = ExactPosition; if (CheckForFreeInterceptBetween(exactPosition, exactPosition2)) { return; } Position = ExactPosition.ToIntVec3(); if (ticksToImpact == 60 && Find.TickManager.CurTimeSpeed == TimeSpeed.Normal && this.def.projectile.soundImpactAnticipate != null) { def.projectile.soundImpactAnticipate.PlayOneShot(this); } if (ticksToImpact <= 0) { if (DestinationCell.InBounds(Map)) { Position = DestinationCell; } ImpactSomething(); return; } if (ambientSustainer != null) { ambientSustainer.Maintain(); } }
public override void Tick() { base.Tick(); if (landed) { return; } LastPos = ExactPosition; ticksToImpact--; if (!ExactPosition.InBounds(Map)) { Position = LastPos.ToIntVec3(); Destroy(); return; } if (CheckForCollisionBetween()) { return; } Position = ExactPosition.ToIntVec3(); if (ticksToImpact == 60 && Find.TickManager.CurTimeSpeed == TimeSpeed.Normal && def.projectile.soundImpactAnticipate != null) { def.projectile.soundImpactAnticipate.PlayOneShot(this); } //TODO : It appears that the final steps in the arc (past ticksToImpact == 0) don't CheckForCollisionBetween. if (ticksToImpact <= 0) { ImpactSomething(); return; } if (ambientSustainer != null) { ambientSustainer.Maintain(); } if (def.HasModExtension <TrailerProjectileExtension>()) { var trailer = def.GetModExtension <TrailerProjectileExtension>(); if (trailer != null) { if (ticksToImpact % trailer.trailerMoteInterval == 0) { for (int i = 0; i < trailer.motesThrown; i++) { TrailThrower.ThrowSmoke(DrawPos, trailer.trailMoteSize, Map, trailer.trailMoteDef); } } } } }
public override void Tick() { base.Tick(); if (landed) { return; } Vector3 exactPosition = ExactPosition; ticksToImpact--; if (!ExactPosition.InBounds(base.Map)) { ticksToImpact++; base.Position = ExactPosition.ToIntVec3(); Destroy(); return; } Vector3 exactPosition2 = ExactPosition; if (CheckForFreeInterceptBetween(exactPosition, exactPosition2)) { return; } base.Position = ExactPosition.ToIntVec3(); if (ticksToImpact == 60 && Find.TickManager.CurTimeSpeed == TimeSpeed.Normal && def.projectile.soundImpactAnticipate != null) { def.projectile.soundImpactAnticipate.PlayOneShot(this); } if (ticksToImpact <= 0) { if (DestinationCell.InBounds(base.Map)) { base.Position = DestinationCell; } ImpactSomething(); } else if (ambientSustainer != null) { ambientSustainer.Maintain(); } }
public override void Tick() { base.Tick(); if (!Spawned) { return; } if (!ExactPosition.InBounds(Map)) { return; } foreach (var th in Map.thingGrid.ThingsAt(ExactPosition.ToIntVec3())) { if (th is Pawn) { aImpact(th); } } }
//Unmodified public override void Tick() { base.Tick(); if (landed) { return; } Vector2 lastExactPosition = Vec2Position; ticksToImpact--; if (!ExactPosition.InBounds(base.Map)) { ticksToImpact++; Position = ExactPosition.ToIntVec3(); Destroy(DestroyMode.Vanish); return; } heightOutdated = true; if (ticksToImpact >= 0 && !def.projectile.flyOverhead && CheckForCollisionBetween(lastExactPosition, Vec2Position)) { return; } Position = ExactPosition.ToIntVec3(); if (ticksToImpact == 60 && Find.TickManager.CurTimeSpeed == TimeSpeed.Normal && def.projectile.soundImpactAnticipate != null) { def.projectile.soundImpactAnticipate.PlayOneShot(this); } if (ticksToImpact <= 0) { ImpactSomething(); return; } if (ambientSustainer != null) { ambientSustainer.Maintain(); } }
public override void Tick() { base.Tick(); if (landed) { return; } LastPos = ExactPosition; ticksToImpact--; if (!ExactPosition.InBounds(base.Map)) { Position = LastPos.ToIntVec3(); Destroy(DestroyMode.Vanish); return; } if (ticksToImpact >= 0 && !def.projectile.flyOverhead && CheckForCollisionBetween()) { return; } Position = ExactPosition.ToIntVec3(); if (ticksToImpact == 60 && Find.TickManager.CurTimeSpeed == TimeSpeed.Normal && def.projectile.soundImpactAnticipate != null) { def.projectile.soundImpactAnticipate.PlayOneShot(this); } //TODO : It appears that the final steps in the arc (past ticksToImpact == 0) don't CheckForCollisionBetween. if (ticksToImpact <= 0) { ImpactSomething(); return; } if (ambientSustainer != null) { ambientSustainer.Maintain(); } }