private void RpcCollided() { SoundManager.sharedInstance.breakWalls_SND.Play(); switch (state) { case BrokenState.full: state = BrokenState.cracked; childModelCracked = InstantiateNewModel(crackedVersion, childModelFull, transform); Destroy(childModelFull); StartCoroutine(CanBreakAgain()); break; case BrokenState.cracked: state = BrokenState.veryCracked; childModelVeryCracked = InstantiateNewModel(veryCrackedVersion, childModelCracked, transform); Destroy(childModelCracked); StartCoroutine(CanBreakAgain()); break; case BrokenState.veryCracked: state = BrokenState.broken; InstantiateNewModel(brokenVersion, childModelVeryCracked, transform); Destroy(childModelVeryCracked); break; } }
private void Crash() { if (Crashed) { return; } lastCrashTime = Find.TickManager.TicksGame; if (mindState.breaker.TryDoMentalBreak(Defs.CrashedDef)) { return; } //if (jobs == null) return; // Recover insanity? if (BrokenStateDef != null && Rand.Value < 0.35f) { MoteThrower.ThrowStatic(Position, ThingDefOf.Mote_ShotFlash, Rand.Range(5f, 10f)); BrokenState.RecoverFromState(); } //if (jobs != null) //{ // if (jobs.curJob != null) // { // if (!InStandby) // { // jobs.StopAll(); // } // } // //jobs.StartJob(new Job(rebootJobDef, Position)); //} //MoteThrower.ThrowMetaPuffs(Position); //for (int i = 0; i < Rand.Range(1, 4); i++) //{ // MoteThrower.ThrowStatic(Position, ThingDefOf.Mote_ShotHit_Spark, Rand.Range(0.5f, 2.5f)); //} }