public override void Draw(SpriteBatch spriteBatch, Vector2 position, Color color, float rotation, float scale) { foreach (Action <ProceduralSpellProj, SpriteBatch, Color> action in SpellDraw.Where(action => action != null)) { action(this, spriteBatch, color); } if (LocalTexture == null) { Initialize(); return; } if (DrawTrail) { for (int i = 0; i < oldPositions.Count; i += 1) { spriteBatch.Draw(LocalTexture, oldPositions.ElementAt(i) - Main.screenPosition + LocalTexture.Bounds.Center(), null, (Lighted ? Color.White : color) * Alpha * (0.04f + 0.09f * i), oldRotations.ElementAt(i), LocalTexture.Bounds.Center(), scale, projectile.spriteDirection >= 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); } oldPositions.Enqueue(position + Main.screenPosition); oldRotations.Enqueue(rotation); if (oldPositions.Count > 5) { oldPositions.Dequeue(); oldRotations.Dequeue(); } } spriteBatch.Draw(LocalTexture, position + LocalTexture.Bounds.Center(), null, (Lighted ? Color.White : color) * Alpha, rotation, LocalTexture.Bounds.Center(), scale, projectile.spriteDirection >= 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); }
private static void Game_OnStart(EventArgs args) { Chat.Print("<font color = '#20b2aa'>Welcome to </font><font color = '#ffffff'> WorthySpells " + Player.Instance.ChampionName + "</font><font color = '#20b2aa'>. Addon in Beta.</font>"); Menu = MainMenu.AddMenu("MenuSpells", "Spells"); Menu.AddLabel("By Worthy"); Spell = Menu.AddSubMenu("Spell"); Spell.Add("Use Igit", new CheckBox("Use Spell", true)); Spell.Add("Min Life", new Slider("Use Min <= {0}, 15,25,50")); Spell.Add("Min", new Slider("Min.Delay(ms)", 1, 0, 1000)); Spell.Add("Max", new Slider("Max. Delay (ms)", 249, 0, 1000)); SpellDraw = Menu.AddSubMenu("Draw", "SpellDraw"); SpellDraw.Add("Draw", new CheckBox("Draw Spell", true)); }
public override void ReceiveExtraAI(BinaryReader reader) { projectile.owner = reader.ReadInt32(); int starType = reader.ReadInt32(); int crossType = reader.ReadInt32(); int moonType = reader.ReadInt32(); projectile.damage = reader.ReadInt32(); bool minionCaster = reader.ReadBoolean(); Caster = minionCaster ? Main.projectile[reader.ReadInt32()] : (Entity)Main.player[reader.ReadInt32()]; List <GlyphModifier> modifiers = new List <GlyphModifier>(); int count = reader.ReadInt32(); for (int i = 0; i < count; i += 1) { modifiers.Add(GlyphModifier.Modifiers[reader.ReadInt32()]); } if (Source == null) { Source = new ProceduralSpell(mod); Source.Glyphs[(byte)GlyphType.Star].SetDefaults(starType, true); Source.Glyphs[(byte)GlyphType.Cross].SetDefaults(crossType, true); Source.Glyphs[(byte)GlyphType.Moon].SetDefaults(moonType, true); Source.ModifierOverride = modifiers; } foreach (Item item in Source.Glyphs) { Glyph glyph = (Glyph)item.modItem; if (glyph.GetAiAction() != null) { Ai.Add(glyph.GetAiAction()); } if (glyph.GetInitAction() != null) { Inits.Add(glyph.GetInitAction()); } if (glyph.GetImpactAction() != null) { Impacts.Add(glyph.GetImpactAction()); } if (glyph.GetKillAction() != null) { Kills.Add(glyph.GetKillAction()); } } foreach (GlyphModifier modifier in modifiers) { if (modifier.Impact != null) { Impacts.Add(modifier.Impact); } if (modifier.Draw != null) { SpellDraw.Add(modifier.Draw); } if (modifier.Init != null) { Inits.Add(modifier.Init); } } Initialize(); }