public override IEnumerable <Gizmo> CompGetGizmosExtra() { if (Prefs.DevMode) { Command_Action command_Action = new Command_Action(); command_Action.defaultLabel = gender.GetLabel(); command_Action.action = delegate { if (gender == Gender.Female) { gender = Gender.Male; } else { gender = Gender.Female; } ReSetupAllConditions(); }; command_Action.hotKey = KeyBindingDefOf.Misc1; yield return(command_Action); Command_Action command_Action2 = new Command_Action(); command_Action2.defaultLabel = droneLevel.GetLabel(); command_Action2.action = delegate { IncreaseDroneLevel(); ReSetupAllConditions(); }; command_Action2.hotKey = KeyBindingDefOf.Misc2; yield return(command_Action2); } }
private void IncreaseDroneLevel() { if (droneLevel != PsychicDroneLevel.BadExtreme) { droneLevel++; TaggedString taggedString = "LetterPsychicDroneLevelIncreased".Translate(gender.GetLabel()); Find.LetterStack.ReceiveLetter("LetterLabelPsychicDroneLevelIncreased".Translate(), taggedString, LetterDefOf.NegativeEvent); SoundDefOf.PsychicPulseGlobal.PlayOneShotOnCamera(parent.Map); ReSetupAllConditions(); } }
public override void RandomizeSettings(float points, Map map, List <Rule> outExtraDescriptionRules, Dictionary <string, string> outExtraDescriptionConstants) { if (def.defaultDroneLevel == PsychicDroneLevel.GoodMedium) { level = PsychicDroneLevel.GoodMedium; } else if (points < 800f) { level = PsychicDroneLevel.BadLow; } else if (points < 2000f) { level = PsychicDroneLevel.BadMedium; } else { level = PsychicDroneLevel.BadHigh; } if (map.mapPawns.FreeColonistsCount > 0) { gender = map.mapPawns.FreeColonists.RandomElement().gender; } else { gender = Rand.Element(Gender.Male, Gender.Female); } outExtraDescriptionRules.Add(new Rule_String("psychicDroneLevel", level.GetLabel())); outExtraDescriptionRules.Add(new Rule_String("psychicDroneGender", gender.GetLabel())); }
public override void RandomizeSettings(float points, Map map, List <Rule> outExtraDescriptionRules, Dictionary <string, string> outExtraDescriptionConstants) { base.RandomizeSettings(points, map, outExtraDescriptionRules, outExtraDescriptionConstants); if (map.mapPawns.FreeColonistsCount > 0) { gender = map.mapPawns.FreeColonists.RandomElement().gender; } else { gender = Rand.Element(Gender.Male, Gender.Female); } outExtraDescriptionRules.Add(new Rule_String("psychicSuppressorGender", gender.GetLabel())); }
public override IEnumerable <Gizmo> CompGetGizmosExtra() { if (!Prefs.DevMode) { yield break; } Command_Action command_Action = new Command_Action(); command_Action.defaultLabel = gender.GetLabel(); command_Action.action = delegate { if (gender == Gender.Female) { gender = Gender.Male; } else { gender = Gender.Female; } ReSetupAllConditions(); }; command_Action.hotKey = KeyBindingDefOf.Misc1; yield return(command_Action); }
private static string ResolveGenderSymbol(Gender gender, bool animal, string args, string fullStringForReference) { if (args.NullOrEmpty()) { return(gender.GetLabel(animal)); } switch (GetArgsCount(args)) { case 2: return(gender switch { Gender.Male => GetArg(args, 0), Gender.Female => GetArg(args, 1), Gender.None => GetArg(args, 0), _ => "", });
protected override void DoConditionAndLetter(Map map, int duration, Gender gender, float points) { if (points < 0f) { points = StorytellerUtility.DefaultThreatPointsNow(map); } PsychicDroneLevel level; if (points < 800f) { level = PsychicDroneLevel.BadLow; } else if (points < 2000f) { level = PsychicDroneLevel.BadMedium; } else { level = PsychicDroneLevel.BadHigh; } GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicDrone, duration, 0); gameCondition_PsychicEmanation.gender = gender; gameCondition_PsychicEmanation.level = level; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); string label = string.Concat(new string[] { "LetterLabelPsychicDrone".Translate(), " (", level.GetLabel(), ", ", gender.GetLabel(false), ")" }); string text = "LetterIncidentPsychicDrone".Translate(gender.ToString().Translate().ToLower(), level.GetLabel()); if (Quote != null) { text += "\n\n"; text += Quote; } Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NegativeEvent, null); }
protected override void DoConditionAndLetter(Map map, int duration, Gender gender, float points) { if (points < 0f) { points = StorytellerUtility.DefaultThreatPointsNow(map); } PsychicDroneLevel level = (points < 800f) ? PsychicDroneLevel.BadLow : ((!(points < 2000f)) ? PsychicDroneLevel.BadHigh : PsychicDroneLevel.BadMedium); GameCondition_PsychicEmanation gameCondition_PsychicEmanation = (GameCondition_PsychicEmanation)GameConditionMaker.MakeCondition(GameConditionDefOf.PsychicDrone, duration); gameCondition_PsychicEmanation.gender = gender; gameCondition_PsychicEmanation.level = level; map.gameConditionManager.RegisterCondition(gameCondition_PsychicEmanation); string label = "LetterLabelPsychicDrone".Translate() + " (" + level.GetLabel() + ", " + gender.GetLabel() + ")"; string text = "LetterIncidentPsychicDrone".Translate(gender.ToString().Translate().ToLower(), level.GetLabel()); Find.LetterStack.ReceiveLetter(label, text, LetterDefOf.NegativeEvent); }