private void Hand_CardAdded(Deck sender, CardEventArgs e) { e.Card.IsFaceUp = true; e.Card.LeftClick += Hand_CardLeftClick; e.Card.RightClick += Hand_CardRightClick; e.Card.Hovered += Hand_CardOnHover; e.Card.OutHovered += Hand_CardOutHover; }
protected virtual void OnCardRemoved(CardEventArgs e) { isListCardChanged = true; if (CardRemoved != null) { CardRemoved(this, e); } }
private void Graveyard_CardAdded_SetPosition(Deck sender, CardEventArgs e) { if (e.Card.STATUS == STATUS.TRIBUTE) return; if ((e.Card as Monster).BattlePosition == eBattlePosition.DEF) e.Card.Sprite.Rotation = 0f; (e.Card as Monster).BattlePosition = eBattlePosition.ATK; e.Card.STATUS = STATUS.NORMAL; e.Card.Sprite.Origin = Vector2.Zero; }
private void MonsterField_CardRemoved(Deck sender, CardEventArgs e) { for (int i = 0; i < m_cardslot.Length; i++) { if (object.ReferenceEquals(m_cardslot[i], e.Card) == true) { m_cardslot[i] = null; return; } } (e.Card as Monster).ClearBattlePoint(); }
private void Hand_CardAdded_ScaleCard(Deck sender, CardEventArgs e) { //e.Card.AddScaleTo(new ScaleTo(0.10f, new Vector2(0.2f, 1.5f))); float dep = (float)1 / this.Hand.Count; int i = 0; foreach (var card in Hand.ListCard) { card.Sprite.Depth = dep * i++; } sender.ListCard.Last.Value.Sprite.WaitFor(MainDeck.Backside); e.Card.Scale = new Vector2(0.0f, 1.5f); e.Card.AddScaleTo(new ScaleTo(0.25f, new Vector2(1.5f, 1.5f))); }
private void MonsterField_CardAdded(Deck sender, CardEventArgs e) { while (m_cardslot[CurrentSlot] != null) { CurrentSlot++; } m_cardslot[CurrentSlot] = e.Card; Vector2 position = Vector2.Zero; if (PlayerID == ePlayerId.PLAYER) { position = GlobalSetting.Default.PlayerMonF + new Vector2(5, 90) + GlobalSetting.Default.FieldSlot.X * CurrentSlot * Vector2.UnitX; } else { position = ComputerSetting.Default.MonsterField + new Vector2(5, 0) - ComputerSetting.Default.FieldSlot.X * CurrentSlot * Vector2.UnitX; } //if (this.PlayerID != ePlayerId.COMPUTER || (e.Card as Monster).BattlePosition != eBattlePosition.DEF) (e.Card as Monster).ShowBattlePoint(position); }
private void Deck_CardAddedPlaySound(Deck sender, CardEventArgs e) { EffectManager.GetInstance().Play(eSoundId.card_move); }
private void MonsterField_CardAdded(Deck sender, CardEventArgs e) { e.Card.Sprite.Depth = 0.5f; }
private void MainDeck_CardRemoved(Deck sender, CardEventArgs e) { if ((sender as MainDeck).Count == 0) this.IsLose = true; }
private void Hand_SetPosition(Deck sender, CardEventArgs e) { int count = sender.Count; if (count == 0) return; Vector2[] _position = new Vector2[sender.Count]; if (count <= 6) //if (true)// { _position[0] = new Vector2( GlobalSetting.Default.CenterField.X + (sender.ListCard.First.Value.Sprite.Bound.Width + GlobalSetting.Default.HandDistance.X) * (count - 2) / 2, sender.Position.Y); for (int i = 1; i < _position.Length; i++) { _position[i] = new Vector2( _position[i - 1].X - sender.ListCard.First.Value.Sprite.Bound.Width - GlobalSetting.Default.HandDistance.X, sender.Position.Y); } }//if else { _position[_position.Length-1] = new Vector2(299,555); int dis = 410 / (count - 1); for (int i = _position.Length - 2; i >= 0; i--) { _position[i] = new Vector2( _position[i + 1].X + dis, _position[i + 1].Y); } }//else sender.ListCard.Last.Value.AddMoveTo(new MoveTo(0.5f, _position[0])); LinkedListNode<Card> node = sender.ListCard.Last.Previous; int j = 1; while (node != null) { node.Value.AddMoveTo(new MoveTo(0.5f, _position[j++])); node = node.Previous; }//while }
protected virtual void OnCardRemoved(CardEventArgs e) { isListCardChanged = true; if (CardRemoved != null) CardRemoved(this, e); }
private void MonsterField_CardRemove(Deck sender, CardEventArgs e) { e.Card.LeftClick -= MonsterField_CardLeftClick; e.Card.RightClick -= MonsterField_CardRightClick; e.Card.OutHovered -= MonsterField_CardOutHover; e.Card.Hovered -= MonsterField_CardOnHover; }
private void MonsterField_CardAdded(Deck sender, CardEventArgs e) { e.Card.IsFaceUp = ((e.Card as Monster).BattlePosition == eBattlePosition.ATK) ? true : false; e.Card.LeftClick += MonsterField_CardLeftClick; e.Card.RightClick += MonsterField_CardRightClick; e.Card.OutHovered += MonsterField_CardOutHover; e.Card.Hovered += MonsterField_CardOnHover; (e.Card as Monster).SwitchBattlePosition = false; }
private void Hand_CardRemoved_ScaleCard(Deck sender, CardEventArgs e) { e.Card.Sprite.Depth = 1.0f; e.Card.AddScaleTo(new ScaleTo(0.5f, new Vector2(1.0f))); }
private void GraveYard_CardRemove(Deck sender, CardEventArgs e) { }
private void MonsterField_CardAdded_SetPosition(Deck sender, CardEventArgs e) { //switch (e.Card.STATUS) //{ // case STATUS.DEF: switch ((e.Card as Monster).BattlePosition) { case eBattlePosition.DEF: e.Card.Origin = new Vector2(e.Card.Sprite.Texture.Bounds.Center.X, e.Card.Sprite.Texture.Bounds.Center.Y); e.Card.AddMoveTo(new MoveTo(0.3f, new Vector2( sender.Position.X + ((MonsterField)sender).CurrentSlot * GlobalSetting.Default.FieldSlot.X + 15, sender.Position.Y + 15) + e.Card.Origin )); e.Card.AddRotateTo(new RotateTo(0.3f, 90)); ((MonsterField)sender).CurrentSlot++; break; case eBattlePosition.ATK: e.Card.AddMoveTo(new MoveTo(0.3f, new Vector2( sender.Position.X + ((MonsterField)sender).CurrentSlot * GlobalSetting.Default.FieldSlot.X + 13, sender.Position.Y + 15))); ((MonsterField)sender).CurrentSlot++; break; default: break; } //switch }
private void SpellField_CardAdded_SetPosition(Deck sender, CardEventArgs e) { e.Card.Position = new Vector2( sender.Position.X + ((SpellField)sender).CurrentSlot * GlobalSetting.Default.FieldSlot.X + 13, sender.Position.Y + 15); ((SpellField)sender).CurrentSlot++; }
private void SpellField_CardAdded(Deck sender, CardEventArgs e) { e.Card.LeftClick += SpellField_CardLeftClick; e.Card.RightClick += SpellField_CardRightClick; e.Card.Hovered += SpellField_CardOnHover; e.Card.OutHovered += SpellField_CardOutHover; }
private void MonsterField_CardRemove(Deck sender, CardEventArgs e) { e.Card.LeftClick -= MonsterField_CardLeftClick; e.Card.RightClick -= MonsterField_CardRightClick; e.Card.OutHovered -= MonsterField_CardOutHover; e.Card.Hovered -= MonsterField_CardOnHover; //if (e.Card.Origin != Vector2.Zero) // e.Card.Origin = Vector2.Zero; }
private void GraveYard_CardAdded(Deck sender, CardEventArgs e) { //if ((e.Card as Monster).BattlePosition == eBattlePosition.DEF) // e.Card.Sprite.Rotation = 0f; //if (e.Card.STATUS == STATUS.TRIBUTE) //{ // e.Card.Sprite.Origin = new Vector2(e.Card.Sprite.Size.X, e.Card.Sprite.Size.Y); // e.Card.Sprite.Position += e.Card.Sprite.Origin; //} //(e.Card as Monster).BattlePosition = eBattlePosition.ATK; if (e.Card.STATUS == STATUS.TRIBUTE) return; if ((e.Card as Monster).BattlePosition == eBattlePosition.DEF) e.Card.Sprite.Rotation = 0f; (e.Card as Monster).BattlePosition = eBattlePosition.ATK; e.Card.STATUS = STATUS.NORMAL; e.Card.Sprite.Origin = Vector2.Zero; }
private void UpdateNum(Deck sender, CardEventArgs e) { this.num_sprite.Show(this.Count, this.Position + new Vector2(22,76)); }
private void Hand_CardAdded_ScaleCard(Deck sender, CardEventArgs e) { float dep = (float)1 / this.Hand.Count; int i = 0; foreach (var card in Hand.ListCard) { card.Sprite.Depth = dep * i++; } e.Card.Scale = new Vector2(1.5f); }
protected override void OnCardAdded(CardEventArgs e) { base.OnCardAdded(e); }
private void Hand_SetPosition(Deck sender, CardEventArgs e) { int count = sender.Count; if (count == 0) return; Vector2[] _position = new Vector2[sender.Count]; if (count <= 6) { _position[0] = new Vector2( GlobalSetting.Default.CenterField.X - (sender.ListCard.First.Value.Sprite.Bound.Width + GlobalSetting.Default.HandDistance.X) * count / 2, sender.Position.Y - sender.ListCard.First.Value.Sprite.Bound.Height); for (int i = 1; i < _position.Length; i++) { _position[i] = new Vector2( _position[i - 1].X + sender.ListCard.First.Value.Sprite.Bound.Width + GlobalSetting.Default.HandDistance.X, sender.Position.Y - sender.ListCard.First.Value.Sprite.Bound.Height); } } else { _position[0] = new Vector2(297, ComputerSetting.Default.Hand.Y - Hand.ListCard.First.Value.Sprite.Bound.Height); int dis = 410 / (count - 1); for (int i = 1; i < count ; i++) { _position[i] = new Vector2( _position[i - 1].X + dis, _position[i - 1].Y); } }//else e.Card.Sprite.WaitFor(this.MainDeck.Backside); sender.ListCard.Last.Value.AddMoveTo(new MoveTo(0.5f, _position[0])); int j = 1; LinkedListNode<Card> node = sender.ListCard.Last.Previous; while (node != null) { node.Value.AddMoveTo(new MoveTo(0.5f,_position[j++])); node = node.Previous; } }
private void MonsterField_CardAdded(Deck sender, CardEventArgs e) { while(m_cardslot[CurrentSlot] != null) { CurrentSlot++; } m_cardslot[CurrentSlot] = e.Card; Vector2 position = Vector2.Zero; if (PlayerID == ePlayerId.PLAYER) { position = GlobalSetting.Default.PlayerMonF + new Vector2(5, 90) + GlobalSetting.Default.FieldSlot.X * CurrentSlot * Vector2.UnitX; } else { position = ComputerSetting.Default.MonsterField + new Vector2(5, 0) - ComputerSetting.Default.FieldSlot.X * CurrentSlot * Vector2.UnitX; } //if (this.PlayerID != ePlayerId.COMPUTER || (e.Card as Monster).BattlePosition != eBattlePosition.DEF) (e.Card as Monster).ShowBattlePoint(position); }
private void MonsterField_CardAdded_SetPosition(Deck sender, CardEventArgs e) { //switch (e.Card.STATUS) //{ // case STATUS.DEF: switch ((e.Card as Monster).BattlePosition) { case eBattlePosition.DEF: e.Card.Sprite.Origin = new Vector2(e.Card.Sprite.Texture.Bounds.Center.X, e.Card.Sprite.Texture.Bounds.Center.Y); var position = new Vector2( sender.Position.X - ((MonsterField)sender).CurrentSlot * ComputerSetting.Default.FieldSlot.X + 15, this.MonsterField.Position.Y + 15); e.Card.AddMoveTo(new MoveTo(0.3f, position +e.Card.Origin)); e.Card.AddRotateTo(new RotateTo(0.3f, 90)); ((MonsterField)sender).CurrentSlot++; //e.Card.Sprite.Rotation = (float)(Math.PI / 2); //e.Card.Sprite.Position += new Vector2(e.Card.Sprite.Bound.Width / 2, e.Card.Sprite.Bound.Width / 2); break; case eBattlePosition.ATK: e.Card.AddMoveTo(new MoveTo(0.3f,new Vector2( sender.Position.X - ((MonsterField)sender).CurrentSlot * ComputerSetting.Default.FieldSlot.X + 13, sender.Position.Y + 15))); ((MonsterField)sender).CurrentSlot++; break; default: break; } //switch }
private void UpdateNum(Deck sender, CardEventArgs e) { this.num_sprite.Show(this.Count, this.Position + new Vector2(20, 76)); }
private void GraveYard_CardAdded(Deck sender, CardEventArgs e) { e.Card.Sprite.Depth = 0.8f; }