Beispiel #1
0
        public static void DrawHeadOverlay(Pawn pawn, string patronName)
        {
            Graphic    headmark = AfflictionDrawerUtility.GetHeadGraphic(pawn, patronName);
            Rot4       rot      = pawn.Rotation;
            Quaternion quat     = pawn.Rotation.AsQuat;
            Vector3    b        = quat * pawn.Drawer.renderer.BaseHeadOffsetAt(rot);

            b.y += 0.01f;
            Mesh     mesh4 = headmark.MeshAt(rot);
            Material mat2  = headmark.MatAt(rot);

            GenDraw.DrawMeshNowOrLater(mesh4, pawn.DrawPos + b, quat, mat2, false);
        }
Beispiel #2
0
        public static bool TryGetChaosOverlayGraphics(Pawn pawn, out Graphic headgraphic, out Graphic bodygraphic)
        {
            if (pawn.needs != null && pawn.story != null && !pawn.kindDef.factionLeader && pawn.Drawer.renderer.graphics.AllResolved)
            {
                Need_Soul soul = pawn.needs.TryGetNeed <Need_Soul>();
                if (soul != null && !soul.NoPatron && soul.patronInfo.PatronName != "Slaanesh")
                {
                    headgraphic = AfflictionDrawerUtility.GetHeadGraphic(pawn, soul.patronInfo.PatronName);
                    bodygraphic = AfflictionDrawerUtility.GetBodyOverlay(pawn.story.bodyType, soul.patronInfo.PatronName);
                    return(true);
                }
            }

            headgraphic = null;
            bodygraphic = null;
            return(false);
        }
        public static bool TryGetAfflictionDrawer(Pawn pawn, Need_Soul soul, string patronName, BodyType bodyType, out ApparelGraphicRecord recBody, out ApparelGraphicRecord recHead, out ApparelGraphicRecord recHair)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting overlay graphic with undefined body type.");
                bodyType = BodyType.Male;
            }
            soul = pawn.needs.TryGetNeed <Need_Soul>();
            Graphic headgraphic    = AfflictionDrawerUtility.GetHeadGraphic(pawn, patronName);
            Graphic bodygraphic    = AfflictionDrawerUtility.GetBodyOverlay(pawn.story.BodyType, patronName);
            string  hairpath       = pawn.Drawer.renderer.graphics.hairGraphic.path;
            Graphic oldhairgraphic = GraphicDatabase.Get <Graphic_Multi>(hairpath, ShaderDatabase.Cutout, Vector2.one, pawn.story.hairColor);
            Apparel temp1          = new Apparel();
            Apparel temp2          = new Apparel();
            Apparel temp3          = new Apparel();

            temp1.def = CorruptionDefOfs.Overlay_Head;
            temp2.def = CorruptionDefOfs.Overlay_Hair;
            temp3.def = AfflictionDrawerUtility.GetOverlayDef(patronName);
            recHead   = new ApparelGraphicRecord(headgraphic, temp1);
            recHair   = new ApparelGraphicRecord(oldhairgraphic, temp2);
            recBody   = new ApparelGraphicRecord(bodygraphic, temp3);
            return(true);
        }