예제 #1
0
 public CollisionManager(ReadManager rm, CombatManager com, Game1 g)
 {
     this.rm  = rm;
     this.g   = g;
     this.com = com;
     mRace    = MonsterRace.None;
 }
예제 #2
0
        protected void AttackUpdate(GameTime gameTime, ReadManager rm)
        {
            foreach (Hero h in rm.heroes)
            {
                if (position.X >= savedCombatPos.X)
                {
                    if (combatMovement)
                    {
                        h.yourTurn   = true;
                        acceleration = 2;
                    }
                    combatMovement = false;
                }
                else if (position.X <= h.savedCombatPos.X + texture.Width)
                {
                    combatMovement = true;
                    h.health      -= (Damage - (h.defense / 2));
                }
            }

            acceleration += 0.03f;
            float currentSpeed;

            if (!combatMovement)
            {
                currentSpeed = -2 * acceleration;
                position.X  += currentSpeed;
            }
            else
            {
                currentSpeed = 2 * acceleration;
                position.X  += currentSpeed;
            }
        }
예제 #3
0
 public Warrior(Texture2D texture, Vector2 position, bool isWall, Rectangle hitbox, ReadManager rm, ContentManager content) : base(texture, position, isWall, hitbox, rm, content)
 {
     // Booleans
     doThisOnce       = true;
     ManaCostOnce     = true;
     healingRecharged = true;
     // ints and floats
     roundDuration  = 3;
     roundEffectEnd = 100;
     // Extra
     this.rm = rm;
     // Stats
     maxHealth    = 120;
     health       = 120;
     maxMana      = 80;
     mana         = 80;
     strength     = 15;
     intelligence = 5;
     agility      = 10;
     spellDamage  = 0;
     // Spells
     spell1Name = "Warrior's Blessing";
     spell2Name = "Quick Attack";
     spell3Name = "Battle Joy";
     spell4Name = "Ultimate";
     spell1Desc = "Pray to the God of War Ares, and recieve his boon. Double your size and increase your strength by 15 * spell rank.";
     spell2Desc = "Catch your opponent off guard with a quick attack, doing 15 + (20 * spell rank) damage.";
     manaCost1  = 15;
     manaCost2  = 30;
     manaCost3  = 20;
     manaCost4  = 80;
 }
예제 #4
0
 public Interface(ReadManager rm, Game1 g, CombatManager com)
 {
     this.g     = g;
     this.rm    = rm;
     this.com   = com;
     doThisOnce = false;
 }
예제 #5
0
 public CollisionManager(ReadManager rm, CombatManager com, Game1 g, Enums enums)
 {
     this.rm    = rm;
     this.g     = g;
     this.com   = com;
     this.enums = enums;
 }
예제 #6
0
 protected override void LoadContent()
 {
     spriteBatch           = new SpriteBatch(GraphicsDevice);
     vars.floor            = Content.Load <Texture2D>("floor");
     vars.hero             = Content.Load <Texture2D>("heroSS");
     vars.menuBG           = Content.Load <Texture2D>("bg");
     vars.gameBG           = Content.Load <Texture2D>("gameBG");
     vars.greenMonster     = Content.Load <Texture2D>("greenMonster");
     vars.chestClosed      = Content.Load <Texture2D>("chestClosed");
     vars.chestOpen        = Content.Load <Texture2D>("chestOpen");
     vars.fakeTextureHero  = Content.Load <Texture2D>("fakeHitbox");
     vars.spikeTrapSS      = Content.Load <Texture2D>("spikeTrapSS");
     vars.fakeTextureSpike = Content.Load <Texture2D>("fakeHitboxSpike");
     vars.restoFloor       = Content.Load <Texture2D>("restoFloor");
     vars.leverTex         = Content.Load <Texture2D>("lever");
     rm         = new ReadManager(vars, this, enums);
     com        = new CombatManager(rm, this, enums);
     interfaces = new Interface(rm, this, com, enums);
     cm         = new CollisionManager(rm, com, this, enums);
     im         = new InventoryManager(rm);
     rnd        = new Random();
     interfaces.Menu();
     game     = true;
     menu     = true;
     combat   = true;
     gameOver = false;
 }
예제 #7
0
 public CombatManager(ReadManager rm, Game1 g, Enums enums)
 {
     this.rm     = rm;
     this.g      = g;
     this.enums  = enums;
     doThisOnce  = true;
     doThisOnce1 = true;
     levelRepeat = true;
 }
예제 #8
0
 public CombatManager(ReadManager rm, Game1 g)
 {
     this.rm     = rm;
     this.g      = g;
     doThisOnce  = true;
     doThisOnce1 = true;
     levelRepeat = true;
     pClass      = PlayerClass.Mage;
 }
예제 #9
0
 public GameManager(Game1 g, Camera camera, ReadManager rm, CombatManager com, CollisionManager cm, Variables vars, Interface interfaces)
 {
     this.g          = g;
     this.rm         = rm;
     this.com        = com;
     this.cm         = cm;
     this.vars       = vars;
     this.interfaces = interfaces;
     this.camera     = camera;
 }
예제 #10
0
        public Green(Texture2D texture, Vector2 position, bool isWall, Rectangle hitbox, ReadManager rm) : base(texture, position, isWall, hitbox)
        {
            textureData = new Color[texture.Width * texture.Height];
            texture.GetData(textureData);
            this.rm         = rm;
            CurrentPosition = position;

            // Stats
            Health  = 100;
            Mana    = 100;
            Damage  = rnd.Next(5, 15);
            Defense = 2;
        }
예제 #11
0
        public Hero(Texture2D texture, Vector2 position, bool isWall, Rectangle hitbox, ReadManager rm, ContentManager content, Texture2D fakeTexture) : base(texture, position, isWall, hitbox)
        {
            // TextureData for pixel collision
            textureData = new Color[fakeTexture.Width * fakeTexture.Height];
            fakeTexture.GetData(textureData);
            // Vectors
            centre         = new Vector2(5, 5);
            savedCombatPos = new Vector2(0, 74);
            // Booleans
            hasJumped      = true;
            attack         = false;
            yourTurn       = true;
            combatMovement = false;
            spell1         = false;
            spell3         = false;
            spell4         = false;
            loadParticles  = true;
            drawParticles  = false;
            // ints and floats
            rotation      = 0;
            acceleration  = 2;
            size          = 1;
            frame         = 3;
            frameTimer    = 100;
            frameInterval = 100;
            // Extra
            rnd             = new Random();
            this.rm         = rm;
            this.content    = content;
            this.fakeHitbox = fakeTexture;
            pClass          = PlayerClass.Mage;

            // Stats
            damage     = 10 + (int)((strength / 10) * rnd.Next(1, 3));
            speed      = 2 + (int)(agility * 0.1);
            level      = 1;
            currentExp = 0;
            maxExp     = 200 + (level * 200);
            skillPoint = 0;
            // Skills
            spell1Rank = 1;
            spell2Rank = 1;
            spell3Rank = 1;
            spell4Rank = 1;
            // Animation
            particleTextures.Add(content.Load <Texture2D>("floor"));
            pe = new ParticleEngine(particleTextures, position + new Vector2(110, 730));
        }
예제 #12
0
 protected override void LoadContent()
 {
     spriteBatch       = new SpriteBatch(GraphicsDevice);
     vars.floor        = Content.Load <Texture2D>("floor");
     vars.hero         = Content.Load <Texture2D>("hero");
     vars.menuBG       = Content.Load <Texture2D>("bg");
     vars.gameBG       = Content.Load <Texture2D>("gameBG");
     vars.greenMonster = Content.Load <Texture2D>("greenMonster");
     rm         = new ReadManager(vars, this);
     com        = new CombatManager(rm, this);
     interfaces = new Interface(rm, this, com);
     cm         = new CollisionManager(rm, com, this);
     interfaces.Menu();
     game   = true;
     menu   = true;
     combat = true;
     im     = new InventoryManager(rm);
     lel    = new RuneOfWind(vars.floor, new Vector2(0, 0), "Rune of Wind");
 }
예제 #13
0
 public Monster(Texture2D texture, Vector2 position, bool isWall, Rectangle hitbox, ReadManager rm) : base(texture, position, isWall, hitbox)
 {
     // TextureData for pixel collision
     textureData = new Color[texture.Width * texture.Height];
     texture.GetData(textureData);
     // Vectors
     centre         = new Vector2(texture.Width / 2, texture.Height / 2);
     savedCombatPos = new Vector2(700, 75);
     // Booleans
     isAlive        = true;
     wanderMovement = true;
     combatMovement = false;
     // int and float
     acceleration  = 2;
     maxSpeed      = 2;
     chaseDistance = 250;
     hysteresis    = 15;
     // Extra
     this.rm = rm;
 }
예제 #14
0
 public CollisionManager(ReadManager rm, Game1 g)
 {
     this.rm = rm;
     this.g  = g;
 }