Example #1
0
        //cái tham số mặc nhiên để tạm
        public Monster(ContentManager _content, SpriteID _spriteId, eCardType _cardType = eCardType.MONSTER)
            : base(_content, ID.CARD, _spriteId, _cardType)
        {
            this.Original = new MonsterCardData((MonsterCardData)CardProvider.GetInstance().GetCardById(_spriteId.ToString()));
            this.IsEffect = Original.IsEffect;
            this.Attribute = Original.Attribute;
            this.MonsterType = Original.MonsterType;
            this.Level = Original.Level;
            this.Atk = Original.Atk;
            this.Def = Original.Def;
            this.Rank = Original.Rank;
            this.PendulumScale = Original.PendulumScale;
            this.SpellSpeed = Original.SpellSpeed;
            this.CanATK = true;

            this.num_atk = new Num(_content, Vector2.Zero, SpriteID.font_710_whitenum);
            this.num_def = new Num(_content, Vector2.Zero, SpriteID.font_710_whitenum);
            this.num_slash = new Num(_content, Vector2.Zero, SpriteID.font_710_whitenum);
        }
Example #2
0
        public Monster(ContentManager _content, string _cardId)
            : base(_content, ID.CARD, (SpriteID)(Enum.Parse(typeof(SpriteID),"C"+ _cardId)), eCardType.MONSTER)
        {
            this.Original = new MonsterCardData((MonsterCardData)CardProvider.GetInstance().GetCardById("C" + _cardId));
            this.IsEffect = Original.IsEffect;
            this.Attribute = Original.Attribute;
            this.MonsterType = Original.MonsterType;
            this.Level = Original.Level;
            this.Atk = Original.Atk;
            this.Def = Original.Def;
            this.Rank = Original.Rank;
            this.PendulumScale = Original.PendulumScale;
            this.SpellSpeed = Original.SpellSpeed;
            this.CanATK = true;

            this.num_atk = new Num(_content, Vector2.Zero, SpriteID.font_710_whitenum);
            this.num_def = new Num(_content, Vector2.Zero, SpriteID.font_710_whitenum);
            this.num_slash = new Num(_content, Vector2.Zero, SpriteID.font_710_whitenum);
            this.num_slash.FrameWidth = 10;
        }
Example #3
0
 public LP_Change(ContentManager _content, Vector2 _position)
 {
     m_timer = new Timer();
     this.m_position = _position;
     this.m_numsprite = new Num(_content, _position, SpriteID.font_1640_damage);
 }
Example #4
0
 public virtual void Init(ContentManager _content)
 {
     this.m_healthbar = new HealthBar(_content, this);
     this.m_lp_change = new LP_Change(_content, GlobalSetting.Default.CenterField);
     this.m_numsprite = new Num(_content, Vector2.Zero, SpriteID.font_2634_dorangenum);
 }
Example #5
0
 public void Init(ContentManager _content)
 {
     num_sprite = new Num(_content, this.Position + new Vector2(20, 80), SpriteID.font_68_whitenum);
     this.CardAdded += new CardAddedEventHandler(UpdateNum);
     this.CardRemoved += new CardRemoveEventHandler(UpdateNum);
 }
Example #6
0
 public void Init(ContentManager _content, string _deckId)
 {
     this.ListCard = LoadDeck.GetInstance().GetDeck(_content, _deckId);
     foreach (var card in ListCard)
     {
         card.Position = this.Position;
         card.IsFaceUp = false;
     }
     this.Shuffle();
     num_sprite = new Num(_content, this.Position + new Vector2(20, 80), SpriteID.font_68_whitenum);
     this.CardAdded += new CardAddedEventHandler(UpdateNum);
     this.CardRemoved += new CardRemoveEventHandler(UpdateNum);
     //if (ListCard.Count != 0)
     //    this.Sprite = ListCard.First.Value.s_BackSide;
     this.Sprite = new Sprite(SpriteManager.getInstance(_content).GetSprite(SpriteID.CBackSide));
     this.Backside = new Sprite(this.Sprite);
     Backside.Origin = new Vector2(Backside.Size.X / 2, 0);
 }