public override int ChoosePrefix(Item item, UnifiedRandom rand) { if (item.accessory && item.stack == 1 && rand.NextBool(40)) { string pref = "Yeeting"; switch (rand.Next(4)) { case 0: pref = "Swift"; break; case 1: pref = "Speedy"; break; case 2: pref = "Zippy"; break; default: pref = "Yeeting"; break; } return(mod.PrefixType(pref)); } return(-1); }
public override int ChoosePrefix(Item item, UnifiedRandom rand) { if ((item.accessory || item.damage > 0) && item.maxStack == 1 && rand.NextBool(30)) { return(mod.PrefixType(rand.Next(2) == 0 ? "Awesome" : "ReallyAwesome")); } return(-1); }
public override int ChoosePrefix(Item item, UnifiedRandom rand) { if ((item.accessory || item.damage > 0) && item.maxStack == 1 && rand.NextBool(30)) { //return mod.PrefixType(rand.Next(2) == 0 ? "Terrifying" : "Truly Terrifying"); } return(-1); }
public override int ChoosePrefix(Item item, UnifiedRandom rand) { if (item.damage > 0 && item.maxStack == 1) { if (rand.NextBool(30) && DRGNModWorld.MentalMode) { return(mod.PrefixType("Mental")); } } else if (item.accessory && item.maxStack == 1) { if (rand.NextBool(30)) { return(mod.PrefixType("Wrathful")); } if (rand.NextBool(30)) { return(mod.PrefixType("Shielding")); } if (rand.NextBool(30)) { return(mod.PrefixType("Weighted")); } if (rand.NextBool(30)) { return(mod.PrefixType("Rapid")); } if (rand.NextBool(30)) { return(mod.PrefixType("Beserk")); } } return(-1); }
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { Texture2D tex = ModContent.GetTexture("SGAmod/Projectiles/FieryRock"); Vector2 drawOrigin = new Vector2(tex.Width, tex.Height) / 2f; Vector2 drawPos = ((npc.Center - Main.screenPosition)); Color color = Color.Lerp(drawColor, Color.White, 0.5f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Texture, blind, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); for (float valez = 34f; valez > 4f; valez -= 0.2f) { spriteBatch.Draw(tex, drawPos, null, color * 0.05f, (((npc.localAI[0] + valez * 0.05f) / 45f) * ((36f - valez) / 15f)), drawOrigin, npc.scale * valez, SpriteEffects.FlipHorizontally, 0f); } Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); for (float valez = 0.1f; valez < 10f; valez += 0.2f) { spriteBatch.Draw(tex, drawPos, null, color * 0.05f, (((npc.localAI[0] / 15f) * (6f - valez)) + (valez / 3.12612f)) / 3f, drawOrigin, (npc.scale * valez) * 0.75f, SpriteEffects.FlipVertically, 0f); } //Main.spriteBatch.End(); //Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.ZoomMatrix); if (BirthdayParty.PartyIsUp) { UnifiedRandom rando = new UnifiedRandom(npc.whoAmI); for (int i = 0; i < 5; i += 1) { int[] offsets = { 0, 16, 17, 18, 19 }; float anglz = (Main.GlobalTime * rando.NextFloat(0.25f, 2f) * (rando.NextBool() ? 1f : -1f)); float dist = 24f + rando.NextFloat(0f, 72f) + (float)Math.Sin(Main.GlobalTime * (rando.NextFloat(0.25f, 1.25f))) * rando.NextFloat(8f, 54f); Vector2 angelz = new Vector2((float)Math.Cos(anglz), (float)Math.Sin(anglz)) * dist; float angle = Main.GlobalTime * rando.NextFloat(0.25f, 3f); tex = Main.extraTexture[72]; int scalehalf = (tex.Width / 20); spriteBatch.Draw(tex, npc.Center + angelz - Main.screenPosition, new Rectangle((int)(scalehalf) * offsets[i], 0, (int)(tex.Width / 20), tex.Height), Color.Gray, angle, new Vector2(scalehalf / 2f, tex.Height / 2f), new Vector2(1, 1), SpriteEffects.None, 0f); } } return(false); }
public override int ChoosePrefix(Item item, UnifiedRandom rand) { if (item.accessory && item.maxStack == 1 && rand.NextBool(30)) { switch (rand.Next(3)) { case 0: return(mod.PrefixType("SoulSiphon")); case 1: return(mod.PrefixType("SoulStealing")); default: return(mod.PrefixType("SoulReaping")); } } return(-1); }
public override int ChoosePrefix(Item item, UnifiedRandom rand) { if (item.accessory && item.stack == 1 && rand.NextBool(80)) { byte pref; switch (rand.Next(4)) { /*case 0: * pref = ModContent.PrefixType<Swift>(); * break; * case 1: * pref = ModContent.PrefixType<Speedy>(); * break; * case 2: * pref = ModContent.PrefixType<Zippy>(); * break;*/ default: pref = ModContent.PrefixType <Yeeting>(); break; } return(pref); } if (item.ranged && Main.rand.Next(30) == 0) { return(ModContent.PrefixType <CarefulPrefix>()); } if (item.melee && Main.rand.Next(30) == 0) { if (Main.rand.Next(2) == 0) { return(ModContent.PrefixType <ColossalPrefix>()); } return(ModContent.PrefixType <HallowedPrefix>()); } if (item.magic && Main.rand.Next(30) == 0) { return(ModContent.PrefixType <KnowledgeablePrefix>()); } return(-1); }
public override int ChoosePrefix(Item item, UnifiedRandom rand) { if (item.GetGlobalItem <ShapeShifterItem>().morphType == ShapeShifterItem.StableShiftType) { int random = rand.Next(100); if (random == 0) { return(mod.PrefixType("Pathetic")); } else if (random >= 1 && random <= 5) { return(mod.PrefixType("Weak")); } else if (random >= 6 && random <= 10) { return(mod.PrefixType("Vulnerable")); } else if (random >= 11 && random <= 15) { return(mod.PrefixType("Flimsey")); } else if (random >= 16 && random <= 25) { return(mod.PrefixType("Sturdy")); } else if (random >= 26 && random <= 35) { return(mod.PrefixType("Damaging")); } else if (random >= 36 && random <= 45) { return(mod.PrefixType("Hunting")); } else if (random >= 46 && random <= 53) { return(mod.PrefixType("Plated")); } else if (random >= 54 && random <= 61) { return(mod.PrefixType("Shredding")); } else if (random >= 62 && random <= 69) { return(mod.PrefixType("Predatory")); } else if (random >= 70 && random <= 79) { return(mod.PrefixType("Feral")); } else if (random >= 80 && random <= 89) { return(mod.PrefixType("Stiff")); } else if (random >= 80 && random <= 88) { return(mod.PrefixType("Glass")); } else if (random == 99) { return(mod.PrefixType("Excellent")); } else { return(mod.PrefixType("Sturdy")); } /* * // mod.AddPrefix("Sturdy", new StableMorphPrefix(0, 0, 5, 0, 0)); * //mod.AddPrefix("Plated", new StableMorphPrefix(0, 0, 10, 0, 0)); * //mod.AddPrefix("Damaging", new StableMorphPrefix(10, 0, 0, 0, 0)); * //mod.AddPrefix("Shredding", new StableMorphPrefix(15, 0, 0, 0, 0)); * //mod.AddPrefix("Feral", new StableMorphPrefix(15, 5, 0, 0, 5)); * mod.AddPrefix("Glass", new StableMorphPrefix(20, 0, 0, 0, 10)); * //mod.AddPrefix("Stiff", new StableMorphPrefix(0, 0, 15, 10, 0)); * //mod.AddPrefix("Hunting", new StableMorphPrefix(0, 5, 0, 0, 0)); * // mod.AddPrefix("Predatory", new StableMorphPrefix(0, 10, 0, 0, 0)); * mod.AddPrefix("Excellent", new StableMorphPrefix(15, 5, 10, 0, 0)); * * //mod.AddPrefix("Weak", new StableMorphPrefix(0, 0, 0, 10, 5)); * // mod.AddPrefix("Pathetic", new StableMorphPrefix(0, 0, 0, 30, 15)); * //mod.AddPrefix("Vulnerable", new StableMorphPrefix(0, 0, 0, 0, 10)); * //mod.AddPrefix("Flimsey", new StableMorphPrefix(0, 0, 0, 20, 0));*/ } else if (item.GetGlobalItem <ShapeShifterItem>().morphType == ShapeShifterItem.QuickShiftType) { int random = rand.Next(31); if (random == 0 || random == 1) { return(PrefixID.Keen); } if (random == 2 || random == 3) { return(PrefixID.Forceful); } if (random == 4 || random == 5) { return(PrefixID.Damaged); } if (random == 6 || random == 7) { return(PrefixID.Hurtful); } if (random == 8 || random == 9) { return(PrefixID.Strong); } if (random == 10 || random == 11) { return(PrefixID.Weak); } if (random == 12 || random == 13) { return(PrefixID.Ruthless); } if (random == 14 || random == 15) { return(PrefixID.Zealous); } if (random == 16) { return(PrefixID.Superior); } if (random == 17) { return(PrefixID.Broken); } if (random == 18) { return(PrefixID.Shoddy); } if (random == 19) { return(PrefixID.Unpleasant); } if (random == 20) { return(PrefixID.Godly); } if (random == 21) { return(PrefixID.Demonic); } if (random == 22 || random == 23) { return(mod.PrefixType("Refreshing")); } if (random == 24 || random == 25) { return(mod.PrefixType("Clumsy")); } if (random == 26) { return(mod.PrefixType("Rejuvenating")); } if (random == 27) { return(mod.PrefixType("Frenzied")); } if (random == 28) { return(mod.PrefixType("Powerful")); } if (random == 29) { return(mod.PrefixType("Aggressive")); } return(rand.NextBool() ? mod.PrefixType("Rigorous") : mod.PrefixType("Clumsy")); /* * mod.AddPrefix("Refreshing", new QuickMorphPrefix(1f, 0, 1f, .9f)); * mod.AddPrefix("Rejuvenating", new QuickMorphPrefix(1f, 0, 1f, .8f)); * mod.AddPrefix("Frenzied", new QuickMorphPrefix(.5f, 0, 1f, .5f)); * mod.AddPrefix("Powerful", new QuickMorphPrefix(1.5f, 0, 1f, 1.5f)); * mod.AddPrefix("Aggressive", new QuickMorphPrefix(1f, 5, 1.15f, .9f)); * mod.AddPrefix("Rigorous", new QuickMorphPrefix(1.15f, 5, 1.15f, .8f)); * * mod.AddPrefix("Clumsy", new QuickMorphPrefix(1f, 0, 1f, 1.1f));*/ } return(-1); }
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (!Main.dedServ) { /* * Vector3 loc = new Vector3(Main.MouseScreen.X, Main.MouseScreen.Y, 0); * * VertexPositionColor[] vertices = new VertexPositionColor[3]; * vertices[0] = new VertexPositionColor(loc+new Vector3(0, 100f, 0), Color.Red); * vertices[1] = new VertexPositionColor(loc+new Vector3(+100f, -100f, 0), Color.Green); * vertices[2] = new VertexPositionColor(loc+new Vector3(-100f, -100f, 0), Color.Blue); * * DrawOverride.vertexBuffer = new VertexBuffer(Main.graphics.GraphicsDevice, typeof(VertexPositionColor), vertices.Length, BufferUsage.WriteOnly); * DrawOverride.vertexBuffer.SetData<VertexPositionColor>(vertices); * * //GraphicsDevice device = Main.graphics.GraphicsDevice; * * Vector2 zoom = Main.GameViewMatrix.Zoom; * view = WVP.View(zoom); * projection = WVP.Projection(); * * basicEffect.World = world; * basicEffect.View = view; * basicEffect.Projection = projection; * basicEffect.VertexColorEnabled = true; * * Main.graphics.GraphicsDevice.SetVertexBuffer(vertexBuffer); * * RasterizerState rasterizerState = new RasterizerState(); * rasterizerState.CullMode = CullMode.None; * Main.graphics.GraphicsDevice.RasterizerState = rasterizerState; * * foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes) * { * pass.Apply(); * Main.graphics.GraphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, 1); * }*/ PrismShardHinted.Draw(spriteBatch, lightColor); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); foreach (Player player in Main.player) { if (player == null || !player.active) { break; } if (player.dead) { continue; } SGAPlayer sgaply = player.SGAPly(); if (sgaply.valkyrieSet.Item2 > 0) { UnifiedRandom rando = new UnifiedRandom(player.whoAmI + Main.worldName.GetHashCode()); Texture2D extra = Main.extraTexture[89]; Vector2 sizehalf = extra.Size() / 2f; float counter = sgaply.valkyrieSet.Item2 * 1f; for (int i = 0; i < counter; i += 1) { float alphaxxx = MathHelper.Clamp((counter - i), 0f, 1f) * 0.75f; Matrix aurashards = Matrix.CreateFromYawPitchRoll(rando.NextFloat(MathHelper.TwoPi) + (Main.GlobalTime * (rando.NextFloat(0.25f, 1f) * (rando.NextBool() ? 1f : -1f))) + (player.Center.X / 120f), 0, rando.NextFloat(-MathHelper.Pi / 1f, MathHelper.Pi / 1f)); Vector3 loc = Vector3.Transform(Vector3.UnitX, aurashards); spriteBatch.Draw(extra, (player.MountedCenter + new Vector2(loc.X, loc.Y) * (48f * sgaply.valkyrieSet.Item4)) - Main.screenPosition, null, Main.hslToRgb(rando.NextFloat(1f), 0.45f, 0.75f) * MathHelper.Clamp(loc.Z, 0f, 1f) * alphaxxx, 0, sizehalf, 1f, SpriteEffects.None, 0f); } } if (sgaply.GetEnergyShieldAmmountAndRecharge.Item1 > 0) { //Main.NewText("test"); Texture2D noise = SGAmod.Instance.GetTexture(sgaply.jellybruSet ? "NPCs/Prismicbansheerealtex" : "Perlin"); Vector2 noisesize = noise.Size(); float alphapercent = (sgaply.GetEnergyShieldAmmountAndRecharge.Item1 / (float)sgaply.GetEnergyShieldAmmountAndRecharge.Item2); if (false)//sgaply.jellybruSet) { Effect hallowed = SGAmod.HallowedEffect; hallowed.Parameters["alpha"].SetValue(alphapercent); hallowed.Parameters["prismColor"].SetValue(Color.Magenta.ToVector3()); hallowed.Parameters["prismAlpha"].SetValue(0f); hallowed.Parameters["overlayTexture"].SetValue(mod.GetTexture("Stain")); hallowed.Parameters["overlayProgress"].SetValue(new Vector3(Main.GlobalTime / 5f, Main.GlobalTime / 3f, 0f)); hallowed.Parameters["overlayAlpha"].SetValue(0.25f); hallowed.Parameters["overlayStrength"].SetValue(new Vector3(2f, 0.10f, Main.GlobalTime / 4f)); hallowed.Parameters["overlayMinAlpha"].SetValue(0f); hallowed.Parameters["rainbowScale"].SetValue(0.8f); hallowed.Parameters["overlayScale"].SetValue(new Vector2(1f, 1f)); hallowed.CurrentTechnique.Passes["Prism"].Apply(); Texture2D bubbles = ModContent.GetTexture("Terraria/NPC_" + NPCID.DetonatingBubble); Vector2 half = new Vector2(bubbles.Width, bubbles.Height / 2f) / 2f; spriteBatch.Draw(bubbles, (player.MountedCenter) - Main.screenPosition, new Rectangle(0, bubbles.Height / 2, bubbles.Width, bubbles.Height / 2), Color.LightPink * alphapercent, -(float)Math.Sin(Main.GlobalTime) / 4f, half, (Vector2.One * 1.5f) + (new Vector2((float)Math.Sin(Main.GlobalTime), (float)Math.Cos(Main.GlobalTime))) * 0.25f, SpriteEffects.None, 0f); spriteBatch.Draw(bubbles, (player.MountedCenter) - Main.screenPosition, new Rectangle(0, bubbles.Height / 2, bubbles.Width, bubbles.Height / 2), Color.LightPink * alphapercent, (float)Math.Sin(Main.GlobalTime) / 4f, half, (Vector2.One * 1.5f) + (new Vector2((float)Math.Cos(Main.GlobalTime + MathHelper.PiOver2), (float)Math.Sin(Main.GlobalTime - MathHelper.PiOver2))) * 0.25f, SpriteEffects.None, 0f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); } else { DrawData value9 = new DrawData(noise, new Vector2(300f, 300f), new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, (int)noisesize.X, (int)noisesize.Y)), Microsoft.Xna.Framework.Color.White, 0, noise.Size() / 2f, 1f, SpriteEffects.None, 0); var deathShader = GameShaders.Misc["ForceField"]; deathShader.UseColor(new Vector3(1f, 1f, 1f)); GameShaders.Misc["ForceField"].Apply(new DrawData?(value9)); deathShader.UseOpacity(1f); float angle = MathHelper.Pi; Vector2 loc = new Vector2((float)((Math.Cos(angle) * 0f)), (float)((Math.Sin(angle) * 0f))); Color basecolor = Color.Lerp(Color.LightBlue, player.GetImmuneAlpha(Color.White, 0.5f), 0.5f) * 0.75f; if (sgaply.jellybruSet) { basecolor = Color.Lerp(Color.Magenta, player.GetImmuneAlpha(Color.LightPink, 0.5f), 0.75f) * 1f; } Color lighting = Lighting.GetColor((int)(player.MountedCenter.X) >> 4, (int)(player.MountedCenter.Y) >> 4, Color.White); spriteBatch.Draw(noise, (player.MountedCenter + loc) - Main.screenPosition, null, basecolor * alphapercent * (((lighting.R + lighting.G + lighting.B) / 255f) / 3f), angle, noise.Size() / 2f, (new Vector2(200f, 150f) / noisesize) * 0.6f, SpriteEffects.None, 0f); } } } Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); DimDingeonsWorld.DrawSectors(); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Texture, BlendState.AlphaBlend, default, default, default, null, Main.GameViewMatrix.TransformationMatrix);
public virtual void AGenPass(GenerationProgress prog) { UniRand = new UnifiedRandom(DimDungeonsProxy.DungeonSeeds); int lastseed = WorldGen._genRandSeed; WorldGen._genRandSeed = DimDungeonsProxy.DungeonSeeds; enemyseed = (DimDungeonsProxy.DungeonSeeds); prog.Message = "Loading"; //Sets the text above the worldgen progress bar Main.worldSurface = Main.maxTilesY - 2; //Hides the underground layer just out of bounds Main.rockLayer = Main.maxTilesY; //Hides the cavern layer way out of bounds //Main.spawnTileX = (Main.maxTilesX / 2) / 16; prog.Message = "Once was nothing..."; Restart: //Rectangle BoxedArea = new Rectangle(bufferSize, bufferSize + surfaceDeep, width - bufferSize * 2, (height - surfaceDeep) - (bufferSize * 2)); //currentPosition = new Point16(width / 2 + (UniRand.Next(12) * sizeCheck) - sizeCheck * 6, height-200); currentPosition = new Point16(width / 2, height / 2); BossRoom = new Rectangle(currentPosition.X - 160, currentPosition.Y - 100, 320, 200); BossRoomInside = new Rectangle(BossRoom.Center.X - 100, BossRoom.Center.Y - 60, 200, 120); currentPosition = new Point16(currentPosition.X + (UniRand.NextBool() ? 1 : -1) * ((BossRoom.Width / 2) + sizeCheck / 2), currentPosition.Y); int xloc = 200 + UniRand.Next(width - 400); Vector2 center = new Vector2(width, height) / 2f; for (int x = 0; x < width; x += 1) { for (int y = 0; y < height; y += 1) { prog.Message = ((x * y) + y) / (float)(width * height) * 100f + "%"; float dist = (new Vector2(x, y) - center).LengthSquared(); Main.tile[x, y].type = (BossRoom.Contains(x, y) || dist > (height * height) / 8f) ? TileID.Adamantite : TileID.CobaltBrick; Main.tile[x, y].active(true); } } for (int i = 0; i < 70; i += 1) { int randomx = UniRand.Next(Main.maxTilesX); int randomy = UniRand.Next(surfaceDeep, Main.maxTilesY); Vector2 vex = new Vector2(randomx, randomy); if ((currentPosition.ToVector2() - vex).LengthSquared() > bufferSize * bufferSize) { IDGWorldGen.TileRunner(randomx, randomy, (double)UniRand.Next(30, 100), UniRand.Next(15, 45) + i, TileID.Adamantite, false, 0f, 0f, true, true, UniRand); } } Noisegen = new NoiseGenerator(DimDungeonsProxy.DungeonSeeds); Noisegen.Amplitude = 1; Noisegen.Frequency *= 0.50; gen = 0; mazePainter = new List <MazeRoom>();// HashSet<MazeRoom>(); mazeRooms = new List <MazeRoom>(); MazeGenerator(currentPosition, 0, 20000, prog); NoiseGenerator Noisegen2 = new NoiseGenerator(DimDungeonsProxy.DungeonSeeds); Noisegen2.Amplitude = 1; Noisegen2.Frequency *= 0.050; int adder = 0; int noisy = 0; for (int x = 0; x < width; x += 1) { for (int y = 0; y < height; y += 1) { Tile tile = Main.tile[x, (height - 1) - y]; tile.type = TileID.CobaltBrick; tile.active(false); prog.Value = (((x + (y * x)) / (float)(width * height)) * 1f); float dist = (new Vector2(x, y) - center).LengthSquared(); if (!(dist > (height * height) / 8f)) { tile.type = (ushort)ModContent.TileType <HardenedFabric>(); tile.active(true); } int dister = (height * height) / 5; if (adder == 0) { noisy = (int)(Noisegen2.Noise(x, y) * (1000 * 1000)); } adder = (adder + 1) % noiseDetail; if ((tile.wall == WallID.DirtUnsafe || tile.wall == WallID.DirtUnsafe1 || tile.wall == WallID.DirtUnsafe2 || tile.wall == WallID.DirtUnsafe3 || tile.wall == WallID.DirtUnsafe4) || (dist > noisy + (dister + (y * y) / 4f))) { tile.type = (ushort)ModContent.TileType <HardenedFabric>(); tile.wall = 0; tile.active(true); } } } MazePainter(); RoomFiller(); PokeExits(5); BossBox(); Main.spawnTileX = width / 2; Main.spawnTileY = 100; //Celular Crap /*for(int passes = 0; passes < 5; passes += 1) { * for (int x = 0; x < Main.maxTilesX; x += 1) * { * for (int y = 0; y < Main.maxTilesY; y += 1) * { * if (GetTilesAround(x,y,1)>4) * Main.tile[x, y].active(true); * else * Main.tile[x, y].active(false); * } * } * }*/ }