public Character(Sprite b, Sprite j, Texture2D sb, Texture2D it, Cname t, Attribute atb1, Attribute atb2) { body = b; judge = j; selfb = sb; type = t; mattribute = atb1; sattribute = atb2; body.position = new Vector2(224f, 420f); body.origin = new Vector2(30f, 25f); body.rect = new Rectangle(0, (int)(type - 1) * 60, 60, 60); body.scale = new Vector2(1f, 1f); judge.position = body.position; judge.origin = new Vector2(35f, 36f); if (Main.Mode == Modes.SINGLE) { rangex = new Vector2(42f, 406f); rangey = new Vector2(43f, 453f); } else { rangex = new Vector2(10f, 630f); rangey = new Vector2(20f, 465f); } Ban = true; equip = new Equipment(selfb); Program.game.game.DrawJudge += new Game.DrawDelegate2(DrawJudge); praticle = new Praticle(false, true, new Rectangle(49, 48, 14, 13), new Vector4(body.position.X, body.position.Y, 0.0f, 0.0f), new Vector2(7f, 7f), 18, 5, 30, 3f, 0.0f, new Vector2(0.0f, 360f), 10f); praticle.scale = new Vector4(1.2f, 0.4f, 0.0f, 0.0f); praticle.calpha = 1f; praticle.stop = true; speedadd = new Vector2(1f, 1f); }
public Enemy( List <float[]> enemyset_l, EnemyManager e, CSManager csm, Hashtable barragec, int type_i, Vector2 pos, float speed_f, float speedf_f, int life_i, int hp_i, int stage, int barrageid_i, int id_i) { this.enemyset = enemyset_l; this.type = type_i; this.InitType(this.type); this.Position = pos; this.speed = speed_f; this.speedf = speedf_f; this.life = life_i; this.hp = hp_i; this.ohp = this.hp; this.barrageid = barrageid_i; this.id = id_i; this.tex = e.tex; this.copy = new Enemy(); this.copy.type = this.type; this.copy.Position = new Vector2(this.Position.X, this.Position.Y); this.copy.speed = this.speed; this.copy.speedf = this.speedf; this.copy.life = this.life; this.copy.hp = this.hp; this.copy.barrageid = this.barrageid; this.copy.id = this.id; this.EventArray = new List <EnemyEvent>(); this.se = SpriteEffects.None; if (this.barrageid != -1) { this.barrage = csm.Createnew(stage, this.barrageid, barragec); } this.praticle = new Praticle(false, true, new Rectangle(49, 48, 14, 13), new Vector4(pos.X - 10f, pos.Y - 10f, 20f, 20f), new Vector2(7f, 7f), 1, 5, 30, 3f, -0.1f, new Vector2(0.0f, 360f), 10f); this.praticle.scale = new Vector4(1.2f, 0.5f, 0.0f, 0.0f); this.praticle.calpha = 1f; this.praticle.stop = true; e.EnemyArray.Add(this); }
private void InitSpecial() { switch (this.typeid) { case 2: this.esprite = new Sprite(PraticleManager.practile); this.esprite.rect = new Rectangle((this.type - 11) * 60, 171, 60, 60); this.esprite.origin = new Vector2(30f, 30f); this.esprite.scale = new Vector2(2f, 2f); break; case 3: this.epraticle = new Praticle(false, true, new Rectangle((this.type - 15) * 21, 129, 21, 21), new Vector4(this.Position.X - 10f, this.Position.Y - 10f, 20f, 20f), new Vector2(10f, 10f), 30, 0, 30, 0.5f, 0.05f, new Vector2(90f, 0.0f), 60f); this.epraticle.scale = new Vector4(1.7f, 1.7f, 0.3f, 0.3f); this.epraticle.calpha = 1f; this.esprite = new Sprite(PraticleManager.practile); this.esprite.rect = new Rectangle((this.type - 15) * 21, 150, 21, 21); this.esprite.origin = new Vector2(10f, 10f); this.esprite.scale = new Vector2(5.5f, 5.5f); break; } }
public Boss( Texture2D tex_t, Texture2D bosslist_t, Hashtable[] spellcard_h, Sprite dialog_s, Sprite dm_s, Sprite[] db_s, Sprite name_s, int stage, int bgtype, Cname c, Effect force_e, List <float[]> bossset_l, int type_i, int dialog_i, int entype_i, int letype_i, int cards_i, int color_i) { this.fsposition = new Dictionary <string, Vector2>(); this.fscenter = new Dictionary <string, Vector2>(); this.fsrect = new Dictionary <string, Rectangle>(); this.fsscale = new Dictionary <string, float>(); this.fsframe = new Dictionary <string, int>(); this.imageid = stage.ToString() + bgtype.ToString(); this.tex = tex_t; this.bosslist = bosslist_t; this.spellcard = spellcard_h; this.bossset = bossset_l; this.force = force_e; this.type = type_i; this.InitType(this.type); this.dialog = dialog_i; this.colortype = color_i; if (this.dialog != -1) { if (File.Exists("Content/Data/d" + stage.ToString() + this.dialog.ToString() + ((int)c).ToString() + ".xna")) { this.dialogm = new Dialog(dialog_s, dm_s, db_s, name_s, stage, c, this.dialog, this); this.wait = true; goto label_4; } } this.wait = false; label_4: this.entype = entype_i; this.InitEnType(this.entype); this.letype = letype_i; this.passedCards = 0; this.praticle = new Praticle(false, true, new Rectangle(49, 48, 14, 13), new Vector4(this.Position.X - 15f, this.Position.Y - 15f, 30f, 30f), new Vector2(7f, 7f), 1, 5, 30, 3f, -0.1f, new Vector2(0.0f, 360f), 10f); this.praticle.scale = new Vector4(1.2f, 0.5f, 0.0f, 0.0f); this.praticle.calpha = 1f; this.praticle.stop = true; this.praticle2 = new Praticle(true, true, new Rectangle(2, 37, 38, 38), new Vector4(this.Position.X - 15f, this.Position.Y - 15f, 45f, 45f), new Vector2(19f, 19f), 60, 0, 40, 0.0f, 0.08f, new Vector2(-90f, 0.0f), 10f); this.praticle2.scale = new Vector4(1.2f, 0.4f, 0.5f, 0.0f); this.sppraticle = new Praticle(true, true, new Rectangle(2, 37, 38, 38), new Vector4(this.Position.X - 15f, this.Position.Y - 15f, 45f, 45f), new Vector2(19f, 19f), 60, 0, 40, 0.0f, 0.08f, new Vector2(-90f, 0.0f), 10f); this.sppraticle.scale = new Vector4(1.2f, 0.4f, 0.5f, 0.0f); this.sppraticle.stop = true; this.sppraticle2 = new Praticle(true, true, new Rectangle(2, 37, 38, 38), new Vector4(this.Position.X - 15f, this.Position.Y - 15f, 45f, 45f), new Vector2(19f, 19f), 60, 0, 40, 0.0f, 0.08f, new Vector2(-90f, 0.0f), 10f); this.sppraticle2.scale = new Vector4(1.2f, 0.4f, 0.5f, 0.0f); this.sppraticle2.stop = true; this.praticle3 = new Praticle(false, true, new Rectangle(71, 48, 76, 76), new Vector4(this.Position.X - 5f, this.Position.Y - 5f, 10f, 10f), new Vector2(38f, 38f), 150, 30, 100, 2f, 0.0f, new Vector2(0.0f, 360f), 30f); this.praticle3.speedr = 3f; this.praticle3.calpha = 1f; this.praticle3.rotation = new Vector4(0.0f, 90f, 90f, 180f); this.praticle3.scale = new Vector4(0.5f, 2.5f, 0.5f, 0.5f); this.praticle3.stop = true; this.CardArray = new List <BossCard>(); this.SpecialInit(); }
public void Update() { if (this.quantity - 60 <= 0 && this.TIME % (60 / this.quantity) == 0 & !this.stop) { Praticle praticle = (Praticle)this.MemberwiseClone(); praticle.alpha = this.calpha; praticle.speed += MathHelper.Lerp(0.0f, this.speedr, (float)Main.rand.NextDouble()); praticle.posrect.X += MathHelper.Lerp(0.0f, this.posrect.Z, (float)Main.rand.NextDouble()); praticle.posrect.Y += MathHelper.Lerp(0.0f, this.posrect.W, (float)Main.rand.NextDouble()); praticle.scale.X += MathHelper.Lerp(-praticle.scale.Y, praticle.scale.Y, (float)Main.rand.NextDouble()); praticle.scale.Z += MathHelper.Lerp(-praticle.scale.W, praticle.scale.W, (float)Main.rand.NextDouble()); praticle.rotation.X += MathHelper.Lerp(-praticle.rotation.Y, praticle.rotation.Y, (float)Main.rand.NextDouble()); praticle.rotation.Z += MathHelper.Lerp(-praticle.rotation.W, praticle.rotation.W, (float)Main.rand.NextDouble()); praticle.angle.X += MathHelper.Lerp(-praticle.angle.Y, praticle.angle.Y, (float)Main.rand.NextDouble()); this.Mine.Add(praticle); } if (this.quantity - 60 > 0 & !this.stop) { for (int index = 0; index < this.quantity - 60; ++index) { Praticle praticle = (Praticle)this.MemberwiseClone(); praticle.alpha = this.calpha; praticle.speed += MathHelper.Lerp(0.0f, this.speedr, (float)Main.rand.NextDouble()); praticle.posrect.X += MathHelper.Lerp(0.0f, this.posrect.Z, (float)Main.rand.NextDouble()); praticle.posrect.Y += MathHelper.Lerp(0.0f, this.posrect.W, (float)Main.rand.NextDouble()); praticle.scale.X += MathHelper.Lerp(-praticle.scale.Y, praticle.scale.Y, (float)Main.rand.NextDouble()); praticle.scale.Z += MathHelper.Lerp(-praticle.scale.W, praticle.scale.W, (float)Main.rand.NextDouble()); praticle.rotation.X += MathHelper.Lerp(-praticle.rotation.Y, praticle.rotation.Y, (float)Main.rand.NextDouble()); praticle.rotation.Z += MathHelper.Lerp(-praticle.rotation.W, praticle.rotation.W, (float)Main.rand.NextDouble()); praticle.angle.X += MathHelper.Lerp(-praticle.angle.Y, praticle.angle.Y, (float)Main.rand.NextDouble()); this.Mine.Add(praticle); } this.stop = true; } foreach (Praticle praticle in this.Mine) { if (praticle.time <= praticle.life) { if ((double)praticle.time <= (double)praticle.fade) { praticle.alpha += 1f / praticle.fade; if ((double)praticle.alpha >= 1.0) { praticle.alpha = 1f; } } if ((double)praticle.time >= (double)praticle.life - (double)praticle.fade) { praticle.alpha -= 1f / praticle.fade; if ((double)praticle.alpha <= 0.0) { praticle.alpha = 0.0f; } } praticle.scale.X += (praticle.scale.Z - praticle.scale.X) / (float)praticle.life; praticle.speed += praticle.acced; praticle.posrect.X += praticle.speed * (float)Math.Cos((double)MathHelper.ToRadians(praticle.angle.X)); praticle.posrect.Y += praticle.speed * (float)Math.Sin((double)MathHelper.ToRadians(praticle.angle.X)); praticle.rotation.X += (praticle.rotation.Z - praticle.rotation.X) / (float)praticle.life; ++praticle.time; } } ++this.TIME; if (this.TIME < this.LIFE || this.LIFE == 0) { return; } this.stop = true; }