コード例 #1
0
ファイル: AndromedonItem.cs プロジェクト: Tea-Mod-Loader/Tea
        public static PlayerLayer CreateShaderLayer(string name, PlayerLayer parent, Func <PlayerDrawInfo, DrawDataInfo> getDataFunc)
        {
            return(new PlayerLayer("ModLoaderMod", name, parent, (drawInfo) => {
                if (drawInfo.shadow != 0f || drawInfo.drawPlayer.invis)
                {
                    return;
                }

                DrawDataInfo drawDataInfo = getDataFunc.Invoke(drawInfo);
                Player drawPlayer = drawInfo.drawPlayer;
                var devPlayer = DeveloperPlayer.GetPlayer(drawPlayer);
                SpriteEffects effects = SpriteEffects.None;
                if (drawPlayer.direction == -1)
                {
                    effects |= SpriteEffects.FlipHorizontally;
                }

                if (drawPlayer.gravDir == -1)
                {
                    effects |= SpriteEffects.FlipVertically;
                }

                var data = new DrawData(
                    drawDataInfo.Texture,
                    drawDataInfo.Position,
                    drawDataInfo.Frame,
                    Color.White * Main.essScale * devPlayer.AndromedonEffect.LayerStrength * devPlayer.AndromedonEffect.ShaderStrength,
                    drawDataInfo.Rotation,
                    drawDataInfo.Origin,
                    1f,
                    effects,
                    0);

                BeginShaderBatch(Main.spriteBatch);
                ShaderId ??= GameShaders.Armor.GetShaderIdFromItemId(ItemID.LivingRainbowDye);
                GameShaders.Armor.Apply(ShaderId.Value, drawPlayer, data);
                var centerPos = data.position;

                for (int i = 0; i < ShaderNumSegments; i++)
                {
                    data.position = centerPos + GetDrawOffset(i);
                    data.Draw(Main.spriteBatch);
                }

                data.position = centerPos;
            }));
        }
コード例 #2
0
ファイル: AndromedonItem.cs プロジェクト: Tea-Mod-Loader/Tea
        public static PlayerLayer CreateGlowLayer(string name, PlayerLayer parent, Func <PlayerDrawInfo, DrawDataInfo> getDataFunc)
        {
            return(new PlayerLayer("ModLoaderMod", name, parent, (drawInfo) => {
                if (drawInfo.shadow != 0f || drawInfo.drawPlayer.invis)
                {
                    return;
                }

                DrawDataInfo drawDataInfo = getDataFunc.Invoke(drawInfo);
                Player drawPlayer = drawInfo.drawPlayer;
                var devPlayer = DeveloperPlayer.GetPlayer(drawPlayer);
                SpriteEffects effects = SpriteEffects.None;

                if (drawPlayer.direction == -1)
                {
                    effects |= SpriteEffects.FlipHorizontally;
                }

                if (drawPlayer.gravDir == -1)
                {
                    effects |= SpriteEffects.FlipVertically;
                }

                var data = new DrawData(
                    drawDataInfo.Texture,
                    drawDataInfo.Position,
                    drawDataInfo.Frame,
                    Color.White * Main.essScale * devPlayer.AndromedonEffect.LayerStrength,
                    drawDataInfo.Rotation,
                    drawDataInfo.Origin,
                    1f,
                    effects,
                    0);

                if (devPlayer.AndromedonEffect.HasAura)
                {
                    ShaderId ??= GameShaders.Armor.GetShaderIdFromItemId(ItemID.LivingRainbowDye);
                    data.shader = ShaderId.Value;
                }

                throw new NotImplementedException();                 //TODO: Reimplement //Main.playerDrawData.Add(data);
            }));
        }
コード例 #3
0
 public override void UpdateVanitySet(Player player)
 {
     DeveloperPlayer.GetPlayer(player).AndromedonEffect.HasSetBonus = true;
 }