コード例 #1
0
        public static void DrawilluminantLayer(PlayerDrawInfo drawInfo, bool front)
        {
            Player    drawPlayer = drawInfo.drawPlayer;
            SGAmod    mod        = SGAmod.Instance;
            SGAPlayer modply     = drawPlayer.GetModPlayer <SGAPlayer>();


            int activestacks = modply.activestacks;

            if (activestacks > 0)
            {
                List <Vector4> whichone = new List <Vector4>();
                UnifiedRandom  rando    = new UnifiedRandom(drawPlayer.whoAmI);

                for (int i = 0; i < activestacks; i += 1)
                {
                    float   percent = rando.NextFloat(1f) * MathHelper.TwoPi;
                    Matrix  mxatrix = Matrix.CreateRotationY((Main.GlobalTime * 2f) + percent) * Matrix.CreateRotationZ(((i / (float)activestacks) * MathHelper.TwoPi) + (Main.GlobalTime * (rando.NextFloat(0.4f, 0.6f))));
                    Vector3 vec3    = Vector3.Transform(Vector3.UnitX, mxatrix);
                    float   alpha   = 1f;
                    if (modply.CooldownStacks.Count >= i)
                    {
                        alpha = MathHelper.Clamp((modply.CooldownStacks[i].timeleft / (float)modply.CooldownStacks[i].maxtime) * 3f, 0f, 1f);
                    }

                    whichone.Add(new Vector4(vec3, alpha));
                }
                whichone = whichone.OrderBy((x) => x.Z).ToList();

                if (whichone.Count > 0)
                {
                    for (int a = 0; a < whichone.Count; a += 1)
                    {
                        Vector4 theplace = whichone[a];
                        float   scaler   = 1 + theplace.Z;

                        if ((scaler >= 1f && front) || (scaler < 1f && !front))
                        {
                            Texture2D texture = SGAmod.Instance.GetTexture("Extra_57b");

                            Vector2  drawhere = new Vector2(theplace.X, theplace.Y) * 64f;
                            DrawData data     = new DrawData(texture, drawPlayer.MountedCenter + drawhere - Main.screenPosition, null, Color.Magenta * (theplace.W * 0.75f), (float)Math.Sin(theplace.X), texture.Size() / 2f, 0.5f + (scaler - 1f) * 0.25f, (drawPlayer.gravDir > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically), 0);
                            //data.shader = (int)drawPlayer.dye[2].dye;
                            Main.playerDrawData.Add(data);
                        }
                    }
                }
            }
        }
コード例 #2
0
        public static void drawdigistuff(PlayerDrawInfo drawInfo, bool front)
        {
            Player    drawPlayer = drawInfo.drawPlayer;
            SGAmod    mod        = SGAmod.Instance;
            SGAPlayer modply     = drawPlayer.GetModPlayer <SGAPlayer>();


            int bonusattacks = (int)(((float)modply.digiStacks / (float)modply.digiStacksMax) * (float)modply.digiStacksCount);

            if (bonusattacks > 0)
            {
                List <Vector2> whichone = new List <Vector2>();
                for (int i = 0; i < bonusattacks; i += 1)
                {
                    float angle  = MathHelper.ToRadians(modply.timer + ((((float)i - 1) / (float)bonusattacks) * 360f));
                    float scaler = 1f + ((float)Math.Sin(angle) * 0.25f);
                    whichone.Add(new Vector2(scaler, angle));
                    //Vector2 apos = new Vector2((float)Math.Cos(angle) * 64, (float)Math.Sin(angle) * 24);
                }
                whichone = whichone.OrderBy((x) => x.X).ToList();

                if (whichone.Count > 0)
                {
                    for (int a = 0; a < whichone.Count; a += 1)
                    {
                        Vector2 theplace = whichone[a];
                        float   scaler   = theplace.X;

                        if ((scaler >= 1f && front) || (scaler < 1f && !front))
                        {
                            float angle = theplace.Y;

                            Vector2 apos = new Vector2((float)Math.Cos(angle) * 64, (float)Math.Sin(angle) * 12);

                            Texture2D texture = Main.itemTexture[ItemID.ManaCrystal];

                            int      drawX = (int)((drawPlayer.Center.X + apos.X) - Main.screenPosition.X);
                            int      drawY = (int)((drawPlayer.MountedCenter.Y + apos.Y) - Main.screenPosition.Y);                       //gravDir
                            DrawData data  = new DrawData(texture, new Vector2(drawX, drawY), null, Color.White, (float)0, new Vector2(texture.Width / 2, texture.Height / 2), scaler, (drawPlayer.gravDir > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically), 0);
                            //data.shader = (int)drawPlayer.dye[2].dye;
                            Main.playerDrawData.Add(data);
                        }
                    }
                }
            }
        }
コード例 #3
0
        public void DoApoco(NPC npc, Projectile projectile, Player player, Item item, ref int damage, ref float knockback, ref bool crit, int bitBoldedEffects = 7, bool always = false)
        {
            bool effectSound     = (bitBoldedEffects & (1 << 1 - 1)) != 0;
            bool effectText      = (bitBoldedEffects & (1 << 2 - 1)) != 0;
            bool effectShockwave = (bitBoldedEffects & (1 << 3 - 1)) != 0;

            SGAPlayer moddedplayer = player.GetModPlayer <SGAPlayer>();
            int       chance       = -1;

            if (projectile != null)
            {
                if (projectile.melee)
                {
                    chance = 0;
                }
                if (projectile.ranged)
                {
                    chance = 1;
                }
                if (projectile.magic)
                {
                    chance = 2;
                }
                if (projectile.thrown || projectile.Throwing().thrown)
                {
                    chance = 3;
                }
            }
            if (item != null)
            {
                if (item.melee)
                {
                    chance = 0;
                }
                if (item.ranged)
                {
                    chance = 1;
                }
                if (item.magic)
                {
                    chance = 2;
                }
                if (item.thrown || item.Throwing().thrown)
                {
                    chance = 3;
                }
            }
            if (npc != null && (always || chance > -1))
            {
                double chanceboost = 0;
                if (projectile != null)
                {
                    chanceboost += projectile.GetGlobalProjectile <SGAprojectile>().extraApocoChance;
                }

                if (always || (crit && Main.rand.Next(0, 100) < (moddedplayer.apocalypticalChance[chance] + chanceboost)))
                {
                    if (moddedplayer.HoE && projectile != null)
                    {
                        float ammount = damage;
                        if (moddedplayer.lifestealentropy > 0)
                        {
                            projectile.vampireHeal((int)((ammount * moddedplayer.apocalypticalStrength)), npc.Center);
                            moddedplayer.lifestealentropy -= ammount;
                        }
                    }

                    if (moddedplayer.ninjaSash > 2)
                    {
                        for (int i = 0; i < Main.maxProjectiles; i += 1)
                        {
                            Projectile proj = Main.projectile[i];
                            if (proj.active && proj.owner == player.whoAmI)
                            {
                                if (proj.Throwing().thrown || proj.thrown)
                                {
                                    proj.SGAProj().Embue(projectile);
                                }
                            }
                        }
                    }

                    if (moddedplayer.SybariteGem)
                    {
                        float mul     = moddedplayer.apocalypticalStrength * (((float)damage * 3f) / (float)npc.lifeMax);
                        int   ammount = (int)((float)npc.value * mul);


                        Vector2 pos = new Vector2((int)npc.position.X, (int)npc.position.Y);
                        pos += new Vector2(Main.rand.Next(npc.width), Main.rand.Next(npc.height));
                        SGAUtils.SpawnCoins(pos, ammount, 10f + Math.Min(3f * mul, 20f));
                    }

                    if (moddedplayer.dualityshades)
                    {
                        int ammo = 0;
                        for (int i = 0; i < 4; i += 1)
                        {
                            if (moddedplayer.ammoinboxes[i] > 0)
                            {
                                int  ammox = moddedplayer.ammoinboxes[i];
                                Item itemx = new Item();
                                itemx.SetDefaults(ammox);
                                if (itemx.ammo == AmmoID.Bullet)
                                {
                                    ammo = ammox;
                                    break;
                                }
                            }
                        }
                        if (ammo > 0)
                        {
                            Item itemy = new Item();
                            itemy.SetDefaults(ammo);
                            int shootype = itemy.shoot;

                            for (int i = 128; i < 260; i += 128)
                            {
                                Vector2 anglez = new Vector2(Main.rand.Next(-8000, 8000), Main.rand.Next(-8000, 8000));
                                anglez.Normalize();

                                Main.PlaySound(SoundID.Item, (int)((npc.Center.X) + (anglez.X * i)), (int)((npc.Center.Y) + (anglez.Y * i)), 25, 0.5f, Main.rand.NextFloat(-0.9f, -0.25f));

                                int thisoned = Projectile.NewProjectile(npc.Center + (anglez * i), anglez * -16f, shootype, (int)(damage * 1.50f * moddedplayer.apocalypticalStrength), 0f, Main.myPlayer);
                                Main.projectile[thisoned].ranged = false;


                                for (float gg = 4f; gg > 0.25f; gg -= 0.15f)
                                {
                                    int  dustIndex = Dust.NewDust(npc.Center + new Vector2(-8, -8) + (anglez * i), 16, 16, DustID.AncientLight, -anglez.X * gg, -anglez.Y * gg, 150, Color.Purple, 3f);
                                    Dust dust      = Main.dust[dustIndex];
                                    dust.noGravity = true;
                                }

                                player.ConsumeItemRespectInfiniteAmmoTypes(ammo);
                            }
                        }
                    }

                    if (moddedplayer.RadSuit)
                    {
                        //IrradiatedAmmount = Math.Max(IrradiatedAmmount, 25);

                        IrradiatedExplosion(npc, (int)(damage * 1f * moddedplayer.apocalypticalStrength));

                        SoundEffectInstance sound = Main.PlaySound(SoundID.DD2_DarkMageHealImpact, (int)npc.Center.X, (int)npc.Center.Y);
                        if (sound != null)
                        {
                            sound.Pitch += 0.525f;
                        }

                        int proj;

                        if (projectile != null)
                        {
                            proj = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType <RadioactivePool>(), (int)(damage * 0.5f * moddedplayer.apocalypticalStrength), projectile.knockBack, projectile.owner);
                        }
                        else
                        {
                            proj = Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType <RadioactivePool>(), (int)(damage * 0.5f * moddedplayer.apocalypticalStrength), knockback, player.whoAmI);
                        }

                        Main.projectile[proj].width    += 80;
                        Main.projectile[proj].height   += 80;
                        Main.projectile[proj].timeLeft += (int)(30 * moddedplayer.apocalypticalStrength);
                        Main.projectile[proj].Center   -= new Vector2(40, 40);
                        Main.projectile[proj].netUpdate = true;
                    }

                    if (moddedplayer.CalamityRune)
                    {
                        Main.PlaySound(SoundID.Item45, npc.Center);
                        int boom = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("BoulderBlast"), (int)((damage * 2) * moddedplayer.apocalypticalStrength), knockback * 2f, player.whoAmI, 0f, 0f);
                        Main.projectile[boom].usesLocalNPCImmunity = true;
                        Main.projectile[boom].localNPCHitCooldown  = -1;
                        Main.projectile[boom].netUpdate            = true;
                        IdgProjectile.AddOnHitBuff(boom, BuffID.Daybreak, (int)(60f * moddedplayer.apocalypticalStrength));
                        IdgProjectile.AddOnHitBuff(boom, mod.BuffType("EverlastingSuffering"), (int)(400f * moddedplayer.apocalypticalStrength));
                    }

                    damage = (int)(damage * (3f + (moddedplayer.apocalypticalStrength - 1f)));

                    if (moddedplayer.magatsuSet && npc.HasBuff(ModContent.BuffType <Watched>()))
                    {
                        Projectile.NewProjectile(npc.Center, Vector2.Zero, ModContent.ProjectileType <Items.Armors.Magatsu.ExplosionDarkSectorEye>(), 0, 0);

                        Point location;

                        if (projectile != null)
                        {
                            location = new Point((int)projectile.Center.X, (int)projectile.Center.Y);
                        }
                        else
                        {
                            location = new Point((int)npc.Center.X, (int)npc.Center.Y);
                        }

                        SoundEffectInstance sound = Main.PlaySound(SoundID.DD2_WyvernScream, (int)location.X, (int)location.Y);
                        if (sound != null)
                        {
                            sound.Pitch = 0.925f;
                        }

                        foreach (NPC enemy in Main.npc.Where(testby => testby.active && !testby.dontTakeDamage && !testby.friendly && testby != npc && (testby.Center - npc.Center).LengthSquared() < 400 * 400))
                        {
                            int damazz = Main.DamageVar(damage);
                            enemy.StrikeNPC(damazz, 16, -enemy.spriteDirection, true);

                            if (Main.netMode != 0)
                            {
                                NetMessage.SendData(MessageID.StrikeNPC, -1, -1, null, npc.whoAmI, damazz, 16f, (float)1, 0, 0, 0);
                            }
                        }
                    }

                    if (effectText)
                    {
                        CombatText.NewText(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), Color.DarkRed, "Apocalyptical!", true, false);
                    }
                    if (SGAConfigClient.Instance.EpicApocalypticals)
                    {
                        if (effectShockwave)
                        {
                            RippleBoom.MakeShockwave(npc.Center, 8f, 1f, 10f, 60, 1f);
                            if (SGAmod.ScreenShake < 32)
                            {
                                SGAmod.AddScreenShake(24f, 1200, player.Center);
                            }
                        }
                        if (effectSound)
                        {
                            Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/crit_hit").WithVolume(.7f).WithPitchVariance(.25f), npc.Center);
                        }
                    }
                }
            }
        }
コード例 #4
0
        public static bool DrawHUD()
        {
            if (Main.gameMenu || SGAmod.Instance == null && !Main.dedServ)
            {
                return(true);
            }
            Player locply = Main.LocalPlayer;

            if (locply != null && locply.whoAmI == Main.myPlayer)
            {
                SpriteBatch spriteBatch = Main.spriteBatch;

                if (locply.HeldItem.type == SGAmod.Instance.ItemType("CaliburnCompess"))
                {
                    spriteBatch.End();
                    //Matrix Custommatrix = Matrix.CreateScale(Main.screenWidth / 1920f, Main.screenHeight / 1024f, 0f);
                    spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.CreateScale(1, 1, 0f));
                    for (int i = 0; i < SGAWorld.CaliburnAlterCoordsX.Length; i += 1)
                    {
                        string[]  texs = { "SGAmod/Items/Weapons/Caliburn/CaliburnTypeA", "SGAmod/Items/Weapons/Caliburn/CaliburnTypeB", "SGAmod/Items/Weapons/Caliburn/CaliburnTypeC" };
                        Texture2D tex  = ModContent.GetTexture(texs[i]);

                        Vector2 drawOrigin = new Vector2(tex.Width, tex.Height) / 2f;

                        Vector2 drawPos = (new Vector2(Main.screenWidth, Main.screenHeight) / 2f) * Main.UIScale;

                        Vector2 Vecd       = (new Vector2(SGAWorld.CaliburnAlterCoordsX[i], SGAWorld.CaliburnAlterCoordsY[i] + 96) - (drawPos + Main.screenPosition));
                        float   pointthere = Vecd.ToRotation();
                        bool    flip       = Vecd.X > 0;

                        spriteBatch.Draw(tex, drawPos + (pointthere.ToRotationVector2() * 64f) + (pointthere.ToRotationVector2() * (float)Math.Pow(Vecd.Length(), 0.9) / 50), null, Color.White, pointthere + MathHelper.ToRadians(45) + (flip ? MathHelper.ToRadians(-90) * 3f : 0), drawOrigin, Main.UIScale, flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
                        //spriteBatch.Draw(tex, new Vector2(150, 150), null, Color.White, Main.GlobalTime, drawOrigin, 1, flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0f);
                    }
                    spriteBatch.End();
                    spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.GameViewMatrix.ZoomMatrix);
                }
                if (SGAmod.UsesPlasma.ContainsKey(locply.HeldItem.type))
                {
                    if (!locply.dead)
                    {
                        SGAmod    mod    = SGAmod.Instance;
                        SGAPlayer modply = locply.GetModPlayer <SGAPlayer>();
                        int       maxclip;
                        bool      check = SGAmod.UsesPlasma.TryGetValue(locply.HeldItem.type, out maxclip);

                        if (check)
                        {
                            Color     color   = Lighting.GetColor((int)locply.Center.X / 16, (int)locply.Center.Y / 16);
                            Texture2D texture = mod.GetTexture("Items/PlasmaCell");
                            int       drawX   = (int)(((0)));
                            int       drawY   = (int)(((-36)));                    //gravDir

                            spriteBatch.End();
                            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.CreateScale(Main.UIScale) * Matrix.CreateTranslation(locply.Center.X - Main.screenPosition.X, locply.Center.Y - Main.screenPosition.Y, 0));


                            float percent = ((float)modply.plasmaLeftInClip / (float)modply.plasmaLeftInClipMax);

                            //DrawData data = new DrawData(texture, new Vector2(drawX, drawY), null, Color.Lerp(Color.Black, Color.DarkGray, 0.25f), (float)Math.PI, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);
                            //DrawData data2 = new DrawData(texture, new Vector2(drawX, drawY), new Rectangle(0, 0, texture.Width, (int)((float)texture.Height * percent)), Color.White, (float)Math.PI, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);

                            spriteBatch.Draw(texture, new Vector2(drawX, drawY), null, Color.Lerp(Color.Black, Color.DarkGray, 0.25f), (float)Math.PI, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);
                            spriteBatch.Draw(texture, new Vector2(drawX, drawY), new Rectangle(0, 0, texture.Width, (int)((float)texture.Height * percent)), Color.White, (float)Math.PI, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);
                        }
                    }
                }

                if (SGAmod.UsesClips.ContainsKey(locply.HeldItem.type))
                {
                    if (!locply.dead)
                    {
                        SGAmod    mod    = SGAmod.Instance;
                        SGAPlayer modply = locply.GetModPlayer <SGAPlayer>();
                        int       maxclip;
                        bool      check = SGAmod.UsesClips.TryGetValue(locply.HeldItem.type, out maxclip);

                        if (check)
                        {
                            Color     color   = Lighting.GetColor((int)locply.Center.X / 16, (int)locply.Center.Y / 16);
                            Texture2D texture = mod.GetTexture("AmmoHud");
                            int       drawX   = (int)(((-texture.Width / 2f)));
                            int       drawY   = (int)(((-32)));                    //gravDir

                            spriteBatch.End();
                            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.CreateScale(Main.UIScale) * Matrix.CreateTranslation(locply.Center.X - Main.screenPosition.X, locply.Center.Y - Main.screenPosition.Y, 0));


                            for (int q = 0; q < modply.ammoLeftInClip; q++)
                            {
                                //DrawData data = new DrawData(texture, new Vector2((drawX - (q * texture.Width)) + (int)((maxclip * texture.Width) / 2), drawY), null, Color.White, 0f, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);
                                spriteBatch.Draw(texture, new Vector2((drawX - (q * texture.Width)) + (int)((maxclip * texture.Width) / 2), drawY), null, Color.White, 0f, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);
                            }
                        }
                    }
                }

                //if (SGAmod.UsesClips.ContainsKey(locply.HeldItem.type))
                //{
                if (!locply.dead)
                {
                    SGAmod    mod    = SGAmod.Instance;
                    SGAPlayer modply = locply.GetModPlayer <SGAPlayer>();

                    float perc = (float)modply.boosterPowerLeft / (float)modply.boosterPowerLeftMax;
                    if (perc > 0)
                    {
                        spriteBatch.End();

                        Vector2 scaler = new Vector2(modply.boosterPowerLeftMax / 300f, 1);
                        int     drawX  = (int)(((locply.position.X + (locply.width / 2))) - Main.screenPosition.X);
                        int     drawY  = (int)((locply.position.Y + (locply.gravDir == 1 ? locply.height + 10 : -10)) - Main.screenPosition.Y);                   //gravDir

                        spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Matrix.CreateScale(Main.UIScale) * Matrix.CreateTranslation(drawX, drawY, 0));

                        float     drawcolortrans = MathHelper.Clamp((modply.boosterdelay + 100) / 100f, 0f, 1f);
                        Texture2D texture        = mod.GetTexture("BoostBar");
                        //DrawData data = new DrawData(texture, new Vector2((drawX - (q * texture.Width)) + (int)((maxclip * texture.Width) / 2), drawY), null, Color.White, 0f, new Vector2(texture.Width / 2, texture.Height / 2), 1f, SpriteEffects.None, 0);
                        spriteBatch.Draw(texture, new Vector2(-scaler.X - 2, 0), new Rectangle(0, 0, 2, texture.Height), Color.White * drawcolortrans, 0f, new Vector2(0, 0), 1f, SpriteEffects.None, 0);
                        spriteBatch.Draw(texture, new Vector2(-scaler.X, 0), new Rectangle(2, 0, 2, texture.Height), Color.DarkGray * drawcolortrans, 0f, new Vector2(0, 0), scaler, SpriteEffects.None, 0);
                        spriteBatch.Draw(texture, new Vector2(-scaler.X, 0), new Rectangle(2, 0, 2, texture.Height), Color.Orange * drawcolortrans, 0f, new Vector2(0, 0), new Vector2(scaler.X * perc, scaler.Y), SpriteEffects.None, 0);
                        spriteBatch.Draw(texture, new Vector2(+scaler.X, 0), new Rectangle(4, 0, 2, texture.Height), Color.White * drawcolortrans, 0f, new Vector2(0, 0), 1f, SpriteEffects.None, 0);
                    }
                }

                spriteBatch.End();
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.Default, RasterizerState.CullNone, null, Main.UIScaleMatrix);
            }
            return(true);
        }
コード例 #5
0
 public static void RecreateRenderTargetsOnScreenChange(On.Terraria.Main.orig_SetDisplayMode orig, int width, int height, bool fullscreen)
 {
     SGAmod.CreateRenderTarget2Ds(width, height, fullscreen);
     orig(width, height, fullscreen);
 }
コード例 #6
0
        public override void PostUpdate()
        {
            if ((Main.netMode < 1 || Main.myPlayer == 0) && Main.expertMode)
            {
                NightmareHardcore = Main.LocalPlayer.GetModPlayer <SGAPlayer>().nightmareplayer ? 1 : 0;
            }

            WorldIsTin         = (WorldGen.CopperTierOre == 7 ? false : true);
            SGAWorld.modtimer += 1;
            if (Main.dayTime == true)
            {
                harbingercounter = 0;
            }
            if (NPC.CountNPCS(NPCID.Golem) > 0 && SGAConfig.Instance.GolemImprovement)
            {
                golemchecker = 1;
                if (NPC.CountNPCS(mod.NPCType("SGAGolemBoss")) < 1)
                {
                    NPC myowner = Main.npc[NPC.FindFirstNPC(NPCID.Golem)];
                    NPC.NewNPC((int)myowner.position.X, (int)myowner.position.Y, mod.NPCType("SGAGolemBoss"));
                    //Main.NewText("Test: modded golem npc spawned", 25, 25, 80);
                }
            }
            else
            {
                golemchecker = 0;
            }

            harbingercounter += 1;
            if (NPC.downedAncientCultist)
            {
                stolecrafting += 1;
            }
            if (Main.netMode < 1)
            {
                if (harbingercounter == 5)
                {
                    if (Main.rand.Next(0, 10) < 5 && bossprgressor == 1 && downedHarbinger == false && DD2Event.DownedInvasionT3 && NPC.downedMartians)
                    {
                        harbingercounter = -600;
                        Idglib.Chat("You feel a darker presence watching over you...", 0, 0, 75);
                    }
                }
                if (harbingercounter == -5)
                {
                    harbingercounter = 6;
                    SGAmod.CalamityNoRevengenceNoDeathNoU();
                    NPC.SpawnOnPlayer(Main.rand.Next(0, Main.PlayerList.Count), mod.NPCType("Harbinger"));
                }
            }

            questvars[11] = Math.Max(questvars[11] - 1, 0);
            if (questvars[10] > 100 && questvars[10] < 1000)
            {
                questvars[10] += 1;
                questvars[11]  = 120;
                Hellion hellinstance = new Hellion();
                if (questvars[10] == 250)
                {
                    hellinstance.HellionTaunt("...");
                }
                if (questvars[10] == 400)
                {
                    hellinstance.HellionTaunt("I see...");
                }
                if (questvars[10] == 600)
                {
                    hellinstance.HellionTaunt("A new challenger rises...");
                }
                if (questvars[10] == 800)
                {
                    hellinstance.HellionTaunt("Curious...");
                }
            }

            if (questvars[10] > 1100 && questvars[10] < 2300)
            {
                questvars[10] += 1;
                questvars[11]  = 120;
                Hellion hellinstance = new Hellion();
                if (questvars[10] == 1200)
                {
                    hellinstance.HellionTaunt("Another emmessary...");
                }
                if (questvars[10] == 1400)
                {
                    hellinstance.HellionTaunt("Fallen. hmp...?");
                }
                if (questvars[10] == 1600)
                {
                    hellinstance.HellionTaunt("The dragon?");
                }
                if (questvars[10] == 1800)
                {
                    hellinstance.HellionTaunt("'Planets.System.FindDraken'");
                }
                if (questvars[10] == 2000)
                {
                    hellinstance.HellionTaunt("Who is this who is slaying my emissaries?");
                }
                if (questvars[10] == 2200)
                {
                    hellinstance.HellionTaunt("No matter... We'll be meeting soon enough...");
                }
            }

            if (questvars[10] > 2400 && questvars[10] < 3750)
            {
                questvars[10] += 1;
                questvars[11]  = 120;
                Hellion hellinstance = new Hellion();
                if (questvars[10] == 2400)
                {
                    hellinstance.HellionTaunt("There is no mistake");
                }
                if (questvars[10] == 2600)
                {
                    hellinstance.HellionTaunt("the failures found the dragon");
                }
                if (questvars[10] == 2800)
                {
                    hellinstance.HellionTaunt("You there, human");
                }
                if (questvars[10] == 3000)
                {
                    hellinstance.HellionTaunt("Hand over the dragon, and I'll spare your world");
                }
                if (questvars[10] == 3200)
                {
                    hellinstance.HellionTaunt("After all, we're old acquaintances");
                }
                if (questvars[10] == 3400)
                {
                    hellinstance.HellionTaunt("And thanks to the incompetence of my minions, my mission will finally be complete");
                }
                if (questvars[10] == 3600)
                {
                    hellinstance.HellionTaunt("I'm sure your dragon will have something to say about this");
                }
                if (questvars[10] == 3700)
                {
                    Main.PlaySound(29, -1, -1, 105, 1f, -0.6f);
                    hellinstance.HellionTaunt("I'll be waiting...");
                }
            }

            if (stolecrafting == -400)
            {
                Idglib.Chat("Bet you were expecting him to drop an Ancient Manipulator huh?", 25, 25, 80);
            }
            if (stolecrafting == -200)
            {
                Idglib.Chat("Welp, we stole that from him, come fight us if you want it", 25, 25, 80);
            }
            if (stolecrafting == -50)
            {
                Idglib.Chat("We want our wraith core fragments back you son of a bitch...", 25, 25, 80);
            }

            if (tf2quest == 1)
            {
                tf2questcounter = tf2questcounter + 1;
                if (tf2questcounter == 60)
                {
                    SgaLib.Chat("<Administrator> Greeting mercenary", 150, 150, 150);
                }
                if (tf2questcounter == 150)
                {
                    SgaLib.Chat("<Administrator> You have just agreed to our contract terms", 150, 150, 150);
                }
                if (tf2questcounter == 280)
                {
                    SgaLib.Chat("<Administrator> To fight for our new division, Terraria Co", 150, 150, 150);
                }
                if (tf2questcounter == 510)
                {
                    SgaLib.Chat("<Administrator> I'll spare you the details, other than your first job", 150, 150, 150);
                }
                if (tf2questcounter == 640)
                {
                    SgaLib.Chat("<Administrator> Kill a total of 1000 enemies; prove your even worth looking at", 150, 150, 150);
                }
                if (tf2questcounter == 770)
                {
                    SgaLib.Chat("<Administrator> When your done, check your contracter. DO NOT Disapointment me...", 150, 150, 150);
                }
                if (tf2questcounter == 850)
                {
                    tf2quest = 2; tf2questcounter = 0;
                }
            }
            if (tf2quest == 3)
            {
                tf2questcounter = tf2questcounter + 1;
                if (tf2questcounter == 60)
                {
                    SgaLib.Chat("<Administrator> Very good", 150, 150, 150);
                }
                if (tf2questcounter == 150)
                {
                    SgaLib.Chat("<Administrator> You've proven your, somewhat confident in your work", 150, 150, 150);
                }
                if (tf2questcounter == 280)
                {
                    SgaLib.Chat("<Administrator> Now then, if I am to take back Mann Co I need resources", 150, 150, 150);
                }
                if (tf2questcounter == 510)
                {
                    SgaLib.Chat("<Administrator> Most effectively... Australium...", 150, 150, 150);
                }
                if (tf2questcounter == 640)
                {
                    SgaLib.Chat("<Administrator> I have added functions to your contracker, it will reveal veins of Australium in this world when used", 150, 150, 150);
                }
                if (tf2questcounter == 770)
                {
                    SgaLib.Chat("<Administrator> You need to have 100 Gold Ingots in your inventory for it to work; it will not take Platinum!", 150, 150, 150);
                }
                if (tf2questcounter == 900)
                {
                    SgaLib.Chat("<Administrator> However accessing this function may attract unwanted attention too early, I'm sure it's nothing you can't handle", 150, 150, 150);
                }
                if (tf2questcounter == 1030)
                {
                    SgaLib.Chat("<Administrator> When your done, check your contracter. Try not to be a Disapointment.", 150, 150, 150);
                }
                if (tf2questcounter == 1050)
                {
                    tf2quest = 4; tf2questcounter = 0;
                }
            }
            if (tf2quest == 5)
            {
                tf2questcounter = tf2questcounter + 1;
                if (tf2questcounter == 60)
                {
                    SgaLib.Chat("<Administrator> Australium... A bountiful ammount of 100 veins", 150, 150, 150);
                }
                if (tf2questcounter == 150)
                {
                    SgaLib.Chat("<Administrator> My plan is going accordingly", 150, 150, 150);
                }
                if (tf2questcounter == 280)
                {
                    SgaLib.Chat("<Administrator> I think your due a promotion, to Commando", 150, 150, 150);
                }
                if (tf2questcounter == 510)
                {
                    SgaLib.Chat("<Administrator> You have been granted knowledge of how to make higher tier items, including more TF2 emblems", 150, 150, 150);
                }
                if (tf2questcounter == 640)
                {
                    SgaLib.Chat("<Administrator> Now for the next phase. I need 50 Australium bars", 150, 150, 150);
                }
                if (tf2questcounter == 770)
                {
                    SgaLib.Chat("<Administrator> Minedown and smelt the ores you find, then report back right away", 150, 150, 150);
                }
                if (tf2questcounter == 900)
                {
                    SgaLib.Chat("<Administrator> However accessing this function may attract unwanted attention too early, I'm sure it's nothing you can't handle", 150, 150, 150);
                }
                if (tf2questcounter == 1030)
                {
                    SgaLib.Chat("<Administrator> When your done, check your contracter. Try not to be a Disapointment.", 150, 150, 150);
                }
                if (tf2questcounter == 1050)
                {
                    tf2quest = 6; tf2questcounter = 0;
                }
            }
        }
コード例 #7
0
        public static void DrawGlowmasks(PlayerDrawInfo drawInfo, int index)
        {
            Player    drawPlayer = drawInfo.drawPlayer;
            SGAmod    mod        = SGAmod.Instance;
            SGAPlayer modply     = drawPlayer.GetModPlayer <SGAPlayer>();
            Color     GlowColor  = modply.armorglowcolor[index](drawPlayer, index);

            Color color = (Color.Lerp(drawInfo.bodyColor, GlowColor, drawPlayer.stealth * ((float)drawInfo.bodyColor.A / 255f)));

            if (drawPlayer.immune && !drawPlayer.immuneNoBlink && drawPlayer.immuneTime > 0)
            {
                color = drawInfo.bodyColor * drawInfo.bodyColor.A;
            }

            if (modply.armorglowmasks[index] != null && !drawPlayer.mount.Active)
            {
                Texture2D texture = ModContent.GetTexture(modply.armorglowmasks[index]);

                if (index == 1 && !drawPlayer.Male && modply.armorglowmasks[4] != null)
                {
                    texture = ModContent.GetTexture(modply.armorglowmasks[4]);
                }

                int      drawX = (int)((drawInfo.position.X + drawPlayer.bodyPosition.X + 10) - Main.screenPosition.X);
                int      drawY = (int)(((drawPlayer.bodyPosition.Y - 3) + drawPlayer.MountedCenter.Y) + drawPlayer.gfxOffY - Main.screenPosition.Y);           //gravDir
                DrawData data;
                if (index == 3)
                {
                    data = new DrawData(texture, new Vector2(drawX, drawY), new Rectangle(0, drawPlayer.legFrame.Y, drawPlayer.legFrame.Width, drawPlayer.legFrame.Height), color, (float)drawPlayer.fullRotation, new Vector2(drawPlayer.legFrame.Width / 2, drawPlayer.legFrame.Height / 2), 1f, (drawPlayer.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) | (drawPlayer.gravDir > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically), 0);
                }
                else
                {
                    data = new DrawData(texture, new Vector2(drawX, drawY), new Rectangle(0, drawPlayer.bodyFrame.Y, drawPlayer.bodyFrame.Width, drawPlayer.bodyFrame.Height), color, (float)drawPlayer.fullRotation, new Vector2(drawPlayer.bodyFrame.Width / 2, drawPlayer.bodyFrame.Height / 2), 1f, (drawPlayer.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) | (drawPlayer.gravDir > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically), 0);
                }
                data.shader = (int)drawPlayer.dye[index > 1 ? index - 1 : index].dye;

                Main.playerDrawData.Add(data);

                if (modply.valkyrieSet.Item3)
                {
                    int indexer = drawPlayer.FindBuffIndex(ModContent.BuffType <Items.Armors.Valkyrie.RagnarokBuff>());
                    if (indexer >= 0)
                    {
                        for (float f = 0; f < MathHelper.TwoPi; f += MathHelper.Pi / 8f)
                        {
                            float distance = (2f + (float)Math.Sin(Main.GlobalTime * 3f) * 2f) + (20f * (modply.valkyrieSet.Item4 - 0.25f));
                            float drawX2   = (float)(drawX + Math.Cos(Main.GlobalTime + f) * distance);
                            float drawY2   = (float)(drawY + Math.Sin(Main.GlobalTime + f) * distance) + drawPlayer.gfxOffY;

                            Color colorz = Color.White * MathHelper.Clamp(drawPlayer.buffTime[indexer] / 200f, 0f, 1f);

                            if (index == 3)
                            {
                                data = new DrawData(texture, new Vector2(drawX2, drawY2), new Rectangle(0, drawPlayer.legFrame.Y, drawPlayer.legFrame.Width, drawPlayer.legFrame.Height), colorz * 0.05f, (float)drawPlayer.fullRotation, new Vector2(drawPlayer.bodyFrame.Width / 2, drawPlayer.bodyFrame.Height / 2), 1f, (drawPlayer.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) | (drawPlayer.gravDir > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically), 0);
                            }
                            else
                            {
                                data = new DrawData(texture, new Vector2(drawX2, drawY2), new Rectangle(0, drawPlayer.bodyFrame.Y, drawPlayer.bodyFrame.Width, drawPlayer.bodyFrame.Height), colorz * 0.05f, (float)drawPlayer.fullRotation, new Vector2(drawPlayer.bodyFrame.Width / 2, drawPlayer.bodyFrame.Height / 2), 1f, (drawPlayer.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None) | (drawPlayer.gravDir > 0 ? SpriteEffects.None : SpriteEffects.FlipVertically), 0);
                            }
                            data.shader = (int)drawPlayer.dye[index > 1 ? index - 1 : index].dye;

                            Main.playerDrawData.Add(data);
                        }
                    }
                }
            }
        }