Пример #1
0
        public void ResolveAllGraphics()
        {
            ClearCache();
            if (pawn.RaceProps.Humanlike)
            {
                nakedGraphic               = GraphicDatabase.Get <Graphic_Multi>(pawn.story.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, Vector2.one, pawn.story.SkinColor);
                rottingGraphic             = GraphicDatabase.Get <Graphic_Multi>(pawn.story.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, Vector2.one, RottingColor);
                dessicatedGraphic          = GraphicDatabase.Get <Graphic_Multi>(pawn.story.bodyType.bodyDessicatedGraphicPath, ShaderDatabase.Cutout);
                headGraphic                = GraphicDatabaseHeadRecords.GetHeadNamed(pawn.story.HeadGraphicPath, pawn.story.SkinColor);
                desiccatedHeadGraphic      = GraphicDatabaseHeadRecords.GetHeadNamed(pawn.story.HeadGraphicPath, RottingColor);
                skullGraphic               = GraphicDatabaseHeadRecords.GetSkull();
                headStumpGraphic           = GraphicDatabaseHeadRecords.GetStump(pawn.story.SkinColor);
                desiccatedHeadStumpGraphic = GraphicDatabaseHeadRecords.GetStump(RottingColor);
                hairGraphic                = GraphicDatabase.Get <Graphic_Multi>(pawn.story.hairDef.texPath, ShaderDatabase.Cutout, Vector2.one, pawn.story.hairColor);
                ResolveApparelGraphics();
                return;
            }
            PawnKindLifeStage curKindLifeStage = pawn.ageTracker.CurKindLifeStage;

            if (pawn.gender != Gender.Female || curKindLifeStage.femaleGraphicData == null)
            {
                nakedGraphic = curKindLifeStage.bodyGraphicData.Graphic;
            }
            else
            {
                nakedGraphic = curKindLifeStage.femaleGraphicData.Graphic;
            }
            if (pawn.RaceProps.packAnimal)
            {
                packGraphic = GraphicDatabase.Get <Graphic_Multi>(nakedGraphic.path + "Pack", ShaderDatabase.Cutout, nakedGraphic.drawSize, Color.white);
            }
            rottingGraphic = nakedGraphic.GetColoredVersion(ShaderDatabase.CutoutSkin, RottingColor, RottingColor);
            if (curKindLifeStage.dessicatedBodyGraphicData != null)
            {
                if (pawn.gender != Gender.Female || curKindLifeStage.femaleDessicatedBodyGraphicData == null)
                {
                    dessicatedGraphic = curKindLifeStage.dessicatedBodyGraphicData.GraphicColoredFor(pawn);
                }
                else
                {
                    dessicatedGraphic = curKindLifeStage.femaleDessicatedBodyGraphicData.GraphicColoredFor(pawn);
                }
            }
            if (!pawn.kindDef.alternateGraphics.NullOrEmpty())
            {
                Rand.PushState(pawn.thingIDNumber ^ 0xB415);
                if (Rand.Value <= pawn.kindDef.alternateGraphicChance)
                {
                    nakedGraphic = pawn.kindDef.alternateGraphics.RandomElementByWeight((AlternateGraphic x) => x.Weight).GetGraphic(nakedGraphic);
                }
                Rand.PopState();
            }
        }
Пример #2
0
 public void ResolveAllGraphics()
 {
     ClearCache();
     if (pawn.RaceProps.Humanlike)
     {
         nakedGraphic               = GraphicDatabase.Get <Graphic_Multi>(pawn.story.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, Vector2.one, pawn.story.SkinColor);
         rottingGraphic             = GraphicDatabase.Get <Graphic_Multi>(pawn.story.bodyType.bodyNakedGraphicPath, ShaderDatabase.CutoutSkin, Vector2.one, RottingColor);
         dessicatedGraphic          = GraphicDatabase.Get <Graphic_Multi>(pawn.story.bodyType.bodyDessicatedGraphicPath, ShaderDatabase.Cutout);
         headGraphic                = GraphicDatabaseHeadRecords.GetHeadNamed(pawn.story.HeadGraphicPath, pawn.story.SkinColor);
         desiccatedHeadGraphic      = GraphicDatabaseHeadRecords.GetHeadNamed(pawn.story.HeadGraphicPath, RottingColor);
         skullGraphic               = GraphicDatabaseHeadRecords.GetSkull();
         headStumpGraphic           = GraphicDatabaseHeadRecords.GetStump(pawn.story.SkinColor);
         desiccatedHeadStumpGraphic = GraphicDatabaseHeadRecords.GetStump(RottingColor);
         hairGraphic                = GraphicDatabase.Get <Graphic_Multi>(pawn.story.hairDef.texPath, ShaderDatabase.Cutout, Vector2.one, pawn.story.hairColor);
         ResolveApparelGraphics();
     }
     else
     {
         PawnKindLifeStage curKindLifeStage = pawn.ageTracker.CurKindLifeStage;
         if (pawn.gender != Gender.Female || curKindLifeStage.femaleGraphicData == null)
         {
             nakedGraphic = curKindLifeStage.bodyGraphicData.Graphic;
         }
         else
         {
             nakedGraphic = curKindLifeStage.femaleGraphicData.Graphic;
         }
         rottingGraphic = nakedGraphic.GetColoredVersion(ShaderDatabase.CutoutSkin, RottingColor, RottingColor);
         if (pawn.RaceProps.packAnimal)
         {
             packGraphic = GraphicDatabase.Get <Graphic_Multi>(nakedGraphic.path + "Pack", ShaderDatabase.Cutout, nakedGraphic.drawSize, Color.white);
         }
         if (curKindLifeStage.dessicatedBodyGraphicData != null)
         {
             if (pawn.gender != Gender.Female || curKindLifeStage.femaleDessicatedBodyGraphicData == null)
             {
                 dessicatedGraphic = curKindLifeStage.dessicatedBodyGraphicData.GraphicColoredFor(pawn);
             }
             else
             {
                 dessicatedGraphic = curKindLifeStage.femaleDessicatedBodyGraphicData.GraphicColoredFor(pawn);
             }
         }
     }
 }