protected MobileEntity(Texture2D sprite, Vector2 position, Stats entStats)
        {
            this.sprite = sprite;
            this.position = position;

            if (sprite != null)
            {
                this.boundingBox = sprite.Bounds;               //hacky and temporary
                this.boundingBox.Location = new Point((int)position.X, (int)position.Y);
            }
            else
            {
                this.boundingBox = new Rectangle();
            }

            this.collisionTree = GamePlayLogicManager.GetInstance().CollisionTree;
            this.droppedItems = GamePlayLogicManager.GetInstance().DroppedItems;

            this.entityIsActive = true;

            this.entStats = entStats;
            this.entStats = new HeadStat(this.entStats);

            this.curHealth = entStats.MaxHP;

            this.entInv = new InventoryHumanoid(this);
        }
Example #2
0
 public Item(Texture2D sprite, string name, Stats stats)
 {
     this.sprite = sprite;
     this.stats = stats;
     this.modifyingStats = new StatModifier(0, 0, 0, null, this.stats);
     this.stats = new HeadStat(this.stats);
     this.name = name;
 }
        public TestMonster(Texture2D sprite, Vector2 position, Stats entStats)
            : base(sprite, position, entStats)
        {
            actionTimer = 0;

            passive = new PassiveAttack(new Rectangle(0, 0, sprite.Bounds.Width + 2, sprite.Bounds.Height + 2), this, .5f, 15);

            entRNG = new Random();
        }
 public HeadStat(Stats child)
     : base(0,0,0)
 {
     if(child != null){
         this.child = child;
         this.parent = null;
         this.child.Parent = this;
     }
 }
 public StatModifier(int maxHP, int attack, int speed, Stats parent, Stats inner)
     : base(maxHP, attack, speed)
 {
     if (parent != null && child != null)
     {
         base.parent = parent;
         base.child = base.parent.Child;
         base.child.Parent = this;
         base.parent.Child = this;
     }
     this.inner = inner;
 }
Example #6
0
        public Player(Texture2D sprite, Vector2 position, PlayerIndex playerNum, Stats entStats, GameUIElement playerUI)
            : base(sprite, position, entStats)
        {
            this.playerNum = playerNum;
            curState = PlayerState.PLAYER_OTHER;

            this.playerUI = playerUI;

            this.testAttack = new SimpleAttack(new Rectangle(0, 0, 32, 16), this, 1.5f, 50);

            this.playerCenter = new Vector2(sprite.Width / 2, sprite.Height / 2);

            this.logicManager = GamePlayLogicManager.GetInstance();
            this.drawManager = GamePlayDrawManager.GetInstance();
            this.playerManager = PlayerManager.GetInstance();
        }
Example #7
0
 public Weapon(Texture2D sprite, string name, Stats weaponStats)
     : base(sprite, name, weaponStats)
 {
 }
 public void Insert(Stats parent, Stats child)
 {
     parent.Child = this;
     child.Parent = this;
     this.child = child;
     this.parent = parent;
 }