Ejemplo n.º 1
0
    private void InitSpritesHook(On.PlayerGraphics.orig_InitiateSprites orig, PlayerGraphics self, RoomCamera.SpriteLeaser sLeaser, RoomCamera rCam)
    {
        if (self.player.playerState.slugcatCharacter == PlayerManager.GetCustomPlayer("Electric").SlugcatIndex)
        {
            sLeaser.sprites = new FSprite[14];
        }
        else
        {
            sLeaser.sprites = new FSprite[12];
        }
        sLeaser.sprites[0]         = new FSprite("BodyA", true);
        sLeaser.sprites[0].anchorY = 0.7894737f;
        sLeaser.sprites[1]         = new FSprite("HipsA", true);
        TriangleMesh.Triangle[] tris = new TriangleMesh.Triangle[]
        {
            new TriangleMesh.Triangle(0, 1, 2),
            new TriangleMesh.Triangle(1, 2, 3),
            new TriangleMesh.Triangle(4, 5, 6),
            new TriangleMesh.Triangle(5, 6, 7),
            new TriangleMesh.Triangle(8, 9, 10),
            new TriangleMesh.Triangle(9, 10, 11),
            new TriangleMesh.Triangle(12, 13, 14),
            new TriangleMesh.Triangle(2, 3, 4),
            new TriangleMesh.Triangle(3, 4, 5),
            new TriangleMesh.Triangle(6, 7, 8),
            new TriangleMesh.Triangle(7, 8, 9),
            new TriangleMesh.Triangle(10, 11, 12),
            new TriangleMesh.Triangle(11, 12, 13)
        };
        TriangleMesh triangleMesh = new TriangleMesh("Futile_White", tris, false, false);

        sLeaser.sprites[2]         = triangleMesh;
        sLeaser.sprites[3]         = new FSprite("HeadA0", true);
        sLeaser.sprites[4]         = new FSprite("LegsA0", true);
        sLeaser.sprites[4].anchorY = 0.25f;
        sLeaser.sprites[5]         = new FSprite("PlayerArm0", true);
        sLeaser.sprites[5].anchorX = 0.9f;
        sLeaser.sprites[5].scaleY  = -1f;
        sLeaser.sprites[6]         = new FSprite("PlayerArm0", true);
        sLeaser.sprites[6].anchorX = 0.9f;
        sLeaser.sprites[7]         = new FSprite("OnTopOfTerrainHand", true);
        sLeaser.sprites[8]         = new FSprite("OnTopOfTerrainHand", true);
        sLeaser.sprites[8].scaleX  = -1f;
        sLeaser.sprites[9]         = new FSprite("FaceA0", true);
        sLeaser.sprites[11]        = new FSprite("pixel", true);
        sLeaser.sprites[11].scale  = 5f;
        sLeaser.sprites[10]        = new FSprite("Futile_White", true);
        sLeaser.sprites[10].shader = rCam.game.rainWorld.Shaders["FlatLight"];
        if (self.player.playerState.slugcatCharacter == PlayerManager.GetCustomPlayer("Electric").SlugcatIndex)
        {
            sLeaser.sprites[12]         = new FSprite("pixel", false);
            sLeaser.sprites[12].scaleY  = 4f;
            sLeaser.sprites[12].scaleX  = 1f;
            sLeaser.sprites[12].anchorY = -1.02f;
            sLeaser.sprites[13]         = new FSprite("pixel", false);
            sLeaser.sprites[13].scale   = 2.3f;
            sLeaser.sprites[13].anchorY = -3.1f;
        }
        self.AddToContainer(sLeaser, rCam, null);
    }