Esempio n. 1
0
        static private void nameOther()
        {
            Faction local_faction = localFaction();

            if (local_faction == null)
            {
                Verse.Log.Message("FACTION null");
                return;
            }


            IEnumerable <Pawn> others_pawns = from p in Verse.Find.CurrentMap.mapPawns.AllPawnsSpawned
                                              where !p.RaceProps.Animal && p.Name != null && !p.Name.Numerical
                                              select p;

            for (int i = 0; i < others_pawns.Count(); i++)
            {
                try {
                    if (others_pawns.ElementAt(i).Faction != local_faction &&
                        ((Verse.NameTriple)others_pawns.ElementAt(i).Name).First != "Twitch")
                    {
                        string name = getNameFromList();
                        if (name == null || name.Length == 0)
                        {
                            Verse.Log.Message("NO NAMES FOR OTHERS");
                            return;
                        }

                        Verse.NameTriple nametriple = new Verse.NameTriple("Twitch", name, "#" + name);
                        Verse.Log.Message("GIVE NAME (OTHER): " + nametriple.ToString());
                        others_pawns.ElementAt(i).Name = nametriple;
                        //Verse.Log.Message("TITLE: " + others_pawns.ElementAt(i).story.adul);
                    }
                }
                catch (System.Exception e) {
                    Verse.Log.Message("RENAME EXCEPTION " + e.ToString());
                }
            }

            //rename other pawns

            /*for (int i = 0; i < others_pawns.Count(); i++) {
             *
             * try {
             *    if (others_pawns.ElementAt(i).Faction != local_faction
             *    && ((Verse.NameTriple)others_pawns.ElementAt(i).Name).First != "Twitch") {
             *
             *       string one_name_str = "";
             *       bool found_name = false;
             *       for (int f = 0; f < namePool.Count(); f++) {
             *          one_name_str = namePool.ElementAt(f);
             *
             *          if (usedOtherNames.IndexOf(one_name_str) == -1) {
             *             found_name = true;
             *             break;
             *          }
             *       }
             *
             *       if (!found_name) {
             *          Verse.Log.Message("NO UNIQUE NAME FOR OTHERS");
             *          break;
             *       }
             *       usedOtherNames.Add(one_name_str);
             *
             *       string last = "";
             *       /*if (one_name_str == "BonjwaRedpanda") {
             *          others_pawns.ElementAt(i).skills.Learn(RimWorld.SkillDefOf.Shooting, 999999);
             *          last = "The Shooter";
             *
             *          others_pawns.ElementAt(i).story.traits.allTraits.Clear();
             *
             *          RimWorld.Trait shooter = new RimWorld.Trait(RimWorld.TraitDefOf.ShootingAccuracy, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(shooter);
             *
             *          RimWorld.Trait bloodlust = new RimWorld.Trait(RimWorld.TraitDefOf.Bloodlust);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(bloodlust);
             *
             *          RimWorld.Trait beauty = new RimWorld.Trait(RimWorld.TraitDefOf.Beauty, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(beauty);
             *
             *          RimWorld.Trait sens = new RimWorld.Trait(RimWorld.TraitDefOf.PsychicSensitivity, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(sens);
             *       }
             *
             *       if (one_name_str == "Moobot") {
             *          others_pawns.ElementAt(i).skills.Learn(RimWorld.SkillDefOf.Melee, 999999);
             *          last = "will kill you with bare hands";
             *
             *          //strip to drop all weapons and meele fight
             *          others_pawns.ElementAt(i).Strip();
             *
             *          //give traits
             *          others_pawns.ElementAt(i).story.traits.allTraits.Clear();
             *
             *          RimWorld.Trait bloodlust = new RimWorld.Trait(RimWorld.TraitDefOf.Bloodlust);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(bloodlust);
             *
             *          RimWorld.Trait tough = new RimWorld.Trait(RimWorld.TraitDefOf.Tough);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(tough);
             *
             *          RimWorld.Trait brawler = new RimWorld.Trait(RimWorld.TraitDefOf.Brawler);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(brawler);
             *
             *          RimWorld.Trait sens = new RimWorld.Trait(RimWorld.TraitDefOf.PsychicSensitivity, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(sens);
             *       }
             *
             *       if (one_name_str == "Kerrag") {
             *          others_pawns.ElementAt(i).skills.Learn(RimWorld.SkillDefOf.Cooking, 999999);
             *          last = "The Cook";
             *
             *
             *          //give traits
             *          others_pawns.ElementAt(i).story.traits.allTraits.Clear();
             *
             *          RimWorld.Trait sensitive = new RimWorld.Trait(RimWorld.TraitDefOf.PsychicSensitivity, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(sensitive);
             *
             *          RimWorld.Trait trans = new RimWorld.Trait(RimWorld.TraitDefOf.Transhumanist);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(trans);
             *
             *          RimWorld.Trait indu = new RimWorld.Trait(RimWorld.TraitDefOf.Industriousness, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(indu);
             *       }
             *
             *
             *       if (one_name_str == "bonjwahonor") {
             *          others_pawns.ElementAt(i).skills.Learn(RimWorld.SkillDefOf.Social, 999999);
             *          last = "The Nice Guy";
             *
             *          //give traits
             *          others_pawns.ElementAt(i).story.traits.allTraits.Clear();
             *
             *          RimWorld.Trait greed = new RimWorld.Trait(RimWorld.TraitDefOf.Greedy);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(greed);
             *
             *          RimWorld.Trait memory = new RimWorld.Trait(RimWorld.TraitDefOf.GreatMemory);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(memory);
             *
             *          RimWorld.Trait kind = new RimWorld.Trait(RimWorld.TraitDefOf.Kind);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(kind);
             *
             *          RimWorld.Trait pyro = new RimWorld.Trait(RimWorld.TraitDefOf.Pyromaniac);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(pyro);
             *       }
             *
             *       if (one_name_str == "Neandi") {
             *          others_pawns.ElementAt(i).skills.Learn(RimWorld.SkillDefOf.Artistic, 999999);
             *          last = "The Artist";
             *
             *          //give traits
             *          others_pawns.ElementAt(i).story.traits.allTraits.Clear();
             *
             *          RimWorld.Trait drug = new RimWorld.Trait(RimWorld.TraitDefOf.DrugDesire, 1);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(drug);
             *
             *          RimWorld.Trait ascet = new RimWorld.Trait(RimWorld.TraitDefOf.Ascetic);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(ascet);
             *
             *          RimWorld.Trait nudist = new RimWorld.Trait(RimWorld.TraitDefOf.Nudist);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(nudist);
             *
             *          RimWorld.Trait psycho = new RimWorld.Trait(RimWorld.TraitDefOf.Psychopath);
             *          others_pawns.ElementAt(i).story.traits.GainTrait(psycho);
             *       }*
             *
             *
             *       Verse.Log.Message("GIVE NAME (OTHER): " + one_name_str);
             *       Verse.NameTriple nametriple = new Verse.NameTriple("Twitch", one_name_str, last);
             *       others_pawns.ElementAt(i).Name = nametriple;
             *    }
             * }
             * catch (System.Exception) {
             *    Verse.Log.Message("RENAME EXCEPTION ");
             * }
             * }*/
        }