protected override ThoughtState CurrentStateInternal(Pawn p) { PsychicDroneLevel psychicDroneLevel = PsychicDroneLevel.None; CompPsychicDrone compPsychicDrone = ThoughtWorker_PsychicDrone.PsychicDroneEmanator(p.Map); if (compPsychicDrone != null) { psychicDroneLevel = compPsychicDrone.DroneLevel; } GameCondition_PsychicEmanation activeCondition = p.Map.gameConditionManager.GetActiveCondition <GameCondition_PsychicEmanation>(); if (activeCondition != null && activeCondition.gender == p.gender && activeCondition.def.droneLevel > psychicDroneLevel) { psychicDroneLevel = activeCondition.def.droneLevel; } ThoughtState result; switch (psychicDroneLevel) { case PsychicDroneLevel.None: result = false; break; case PsychicDroneLevel.GoodMedium: result = ThoughtState.ActiveAtStage(0); break; case PsychicDroneLevel.BadLow: result = ThoughtState.ActiveAtStage(1); break; case PsychicDroneLevel.BadMedium: result = ThoughtState.ActiveAtStage(2); break; case PsychicDroneLevel.BadHigh: result = ThoughtState.ActiveAtStage(3); break; case PsychicDroneLevel.BadExtreme: result = ThoughtState.ActiveAtStage(4); break; default: throw new NotImplementedException(); } return(result); }
protected override ThoughtState CurrentStateInternal(Pawn p) { PsychicDroneLevel psychicDroneLevel = PsychicDroneLevel.None; CompPsychicDrone compPsychicDrone = PsychicDroneEmanator(p.Map); if (compPsychicDrone != null) { psychicDroneLevel = compPsychicDrone.DroneLevel; } GameCondition_PsychicEmanation activeCondition = p.Map.gameConditionManager.GetActiveCondition <GameCondition_PsychicEmanation>(); if (activeCondition != null && activeCondition.gender == p.gender && (int)activeCondition.level > (int)psychicDroneLevel) { psychicDroneLevel = activeCondition.level; } switch (psychicDroneLevel) { case PsychicDroneLevel.None: return(false); case PsychicDroneLevel.GoodMedium: return(ThoughtState.ActiveAtStage(0)); case PsychicDroneLevel.BadLow: return(ThoughtState.ActiveAtStage(1)); case PsychicDroneLevel.BadMedium: return(ThoughtState.ActiveAtStage(2)); case PsychicDroneLevel.BadHigh: return(ThoughtState.ActiveAtStage(3)); case PsychicDroneLevel.BadExtreme: return(ThoughtState.ActiveAtStage(4)); default: throw new NotImplementedException(); } }