Beispiel #1
0
        public BaseChest(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, region, content, graphics)
        {
            nInventorySlots = 5;
            var objKey = "baseChest";

            storageTierType = "baseChestItem"; // needed for deserialization of burying your own treasure

            List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 4);
            List <InventoryItem>        items     = ItemUtility.CreateNPInventory(itemDrops, team, region, location, content, graphics);

            inventory = Enumerable.Repeat <InventoryItem>(null, nInventorySlots).ToList();

            Texture2D texture   = content.Load <Texture2D>("BaseChest");
            Texture2D textureBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBB = new Texture2D(graphics, texture.Width, texture.Height);
            }
            Asset asset = new Asset(texture, textureBB, 3, 2, 0.5f, objKey, region);

            SetSpriteAsset(asset, location);

            foreach (var i in items)
            {
                if (AddInventoryItem(i))
                {
                    i.inInventory = true;
                }
            }
        }
Beispiel #2
0
        public BaseTribal(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, content, graphics)
        {
            millisecondToDie         = 10000;
            millisecondsPerTurnFrame = 500; // turn speed
            millisecondsPerWalkFrame = 100; // turn speed
            millisecondsCombatMove   = 75;

            combatFrameIndex = 7;

            fullHealth  = 25;
            health      = fullHealth;
            damage      = 0.05f;
            actionState = ActionState.DefenseRoam;
            string objKey = "baseTribal";

            List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 3);

            inventory = ItemUtility.CreateNPInventory(itemDrops, team, region, location, content, graphics);

            Texture2D textureBaseTribal   = content.Load <Texture2D>("Tribal1");
            Texture2D textureBaseTribalBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBaseTribalBB = new Texture2D(graphics, textureBaseTribal.Width, textureBaseTribal.Height);
            }
            Asset baseTribalAsset = new Asset(textureBaseTribal, textureBaseTribalBB, 12, 4, 1.0f, objKey, region);

            SetSpriteAsset(baseTribalAsset, location);
        }
Beispiel #3
0
        public Chicken(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, content, graphics)
        {
            millisecondToDie         = 10000;
            millisecondsPerTurnFrame = 500; // turn speed
            millisecondsPerWalkFrame = 300; // turn speed
            millisecondsCombatMove   = 75;

            idleFreezeColFrame = 5;

            fullHealth  = 10;
            health      = fullHealth;
            damage      = 0.05f;
            actionState = ActionState.PassiveRoam;
            string objKey = "chicken";

            List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 3);

            inventory = ItemUtility.CreateNPInventory(itemDrops, team, region, location, content, graphics);

            Texture2D texture   = content.Load <Texture2D>("Chicken");
            Texture2D textureBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBB = new Texture2D(graphics, texture.Width, texture.Height);
            }
            Asset asset = new Asset(texture, textureBB, 10, 4, 0.7f, objKey, region);

            SetSpriteAsset(asset, location);
        }
Beispiel #4
0
        public BlueBird(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, content, graphics)
        {
            millisecondToDie         = 10000;
            millisecondsPerTurnFrame = 400; // turn speed
            millisecondsPerWalkFrame = 200; // turn speed
            millisecondsCombatMove   = 75;
            msIdleWaitTime           = 6000;

            nIdleRowFrames = 1;

            fullHealth  = 25;
            health      = fullHealth;
            damage      = 0.05f;
            actionState = ActionState.IdleFlee;
            string objKey = "blueBird";

            List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 3);

            inventory = ItemUtility.CreateNPInventory(itemDrops, team, region, location, content, graphics);

            Texture2D texture   = content.Load <Texture2D>("BlueBird");
            Texture2D textureBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBB = new Texture2D(graphics, texture.Width, texture.Height);
            }
            Asset asset = new Asset(texture, textureBB, 4, 5, 0.4f, objKey, region);

            SetSpriteAsset(asset, location);
        }
Beispiel #5
0
 public void UpdateRespawn(GameTime gt)
 {
     respawnTimeCountMs += gt.ElapsedGameTime.Milliseconds;
     if (respawnTimeCountMs > msRespawn)
     {
         SetTileDesignRow(RandomEvents.rand.Next(0, nRows));
         location.X += RandomEvents.rand.Next(-GameOptions.tileWidth, GameOptions.tileWidth);
         location.Y += RandomEvents.rand.Next(-GameOptions.tileHeight, GameOptions.tileHeight);
         List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(bbKey, 2);
         drops              = ItemUtility.CreateNPInventory(itemDrops, team, regionKey, location, _content, _graphics);
         remove             = false;
         respawnTimeCountMs = 0;
         nHits              = 0;
     }
 }
Beispiel #6
0
        public TeePee(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, content, graphics)
        {
            string objKey = "teePee";

            //MapModelMovementVectorValues();
            Texture2D texture   = content.Load <Texture2D>("TeePee");
            Texture2D textureBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBB = new Texture2D(graphics, texture.Width, texture.Height);
            }
            Asset asset = new Asset(texture, textureBB, 4, 1, 0.5f, objKey, region);

            // inventory
            List <Sprite> interiorObjs = null;

            if (team != TeamType.Player)
            {
                List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 5);
                interiorObjs = ItemUtility.CreateInteriorItems(itemDrops, team, region, location, content, graphics);
            }

            structureInterior = new Interior("teePee", this, content, graphics);

            // set the random drops as interior objects
            if (interiorObjs != null)
            {
                foreach (var obj in interiorObjs)
                {
                    structureInterior.interiorObjects.Add(obj);

                    // need to do this for containers so they drop items within ship
                    if (obj is IContainer)
                    {
                        Container c = (Container)obj;
                        c.inInteriorId = structureInterior.interiorId;
                    }
                }
            }

            SetSpriteAsset(asset, location);
        }
Beispiel #7
0
        public BaseBarrel(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, region, content, graphics)
        {
            nHitsToDestroy = 5;
            var objKey = "baseBarrel";

            List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 4);

            drops = ItemUtility.CreateNPInventory(itemDrops, team, region, location, content, graphics);

            Texture2D texture   = content.Load <Texture2D>("Barrel");
            Texture2D textureBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBB = new Texture2D(graphics, texture.Width, texture.Height);
            }
            Asset asset = new Asset(texture, textureBB, 3, 2, 0.5f, objKey, region);

            SetSpriteAsset(asset, location);
        }
Beispiel #8
0
        public Tree2(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, content, graphics)
        {
            nHitsToDestory = 5;
            msRespawn      = GameOptions.GameDayLengthMs / 2;
            string objKey = "tree2";

            List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 2);

            drops = ItemUtility.CreateNPInventory(itemDrops, team, region, location, content, graphics);

            Texture2D textureTree   = content.Load <Texture2D>("Tree2");
            Texture2D textureTreeBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureTreeBB = new Texture2D(graphics, textureTree.Width, textureTree.Height);
            }
            Asset treeAsset = new Asset(textureTree, textureTreeBB, 4, 2, 0.6f, objKey, region);

            SetSpriteAsset(treeAsset, location);
        }
Beispiel #9
0
        public BaseShip(TeamType team, string region, Vector2 location, ContentManager content, GraphicsDevice graphics) : base(team, content, graphics)
        {
            timeSinceLastTurn     = 0;
            millisecondsPerTurn   = 500; // turn speed
            timeSinceStartAnchor  = 0;
            millisecondsToAnchor  = 1000;
            msToRepair            = 5000;
            millisecondsNewShot   = 2000;
            movementSpeed         = 0.2f;
            timeSinceStartSinking = 0;
            millisecondToSink     = 10000;
            nSails            = 1;
            fullHealth        = 40;
            health            = fullHealth;
            stopRange         = 260f;
            maxInventorySlots = 5;

            string objKey = "baseShip";

            //MapModelMovementVectorValues();
            Texture2D textureBaseShip   = content.Load <Texture2D>("BaseShip");
            Texture2D textureBaseShipBB = null;

            if (Gusto.GameOptions.ShowBoundingBox)
            {
                textureBaseShipBB = new Texture2D(graphics, textureBaseShip.Width, textureBaseShip.Height);
            }
            Asset baseShipAsset = new Asset(textureBaseShip, textureBaseShipBB, 1, 8, 0.6f, objKey, region);

            // inventory
            List <Sprite> interiorObjs = null;

            if (team != TeamType.Player)
            {
                List <Tuple <string, int> > itemDrops = RandomEvents.RandomNPDrops(objKey, 5);
                interiorObjs  = ItemUtility.CreateInteriorItems(itemDrops, team, region, location, content, graphics);
                mountedOnShip = new BaseCannon(teamType, regionKey, GetBoundingBox().Center.ToVector2(), content, graphics);
            }

            actionInventory = Enumerable.Repeat <InventoryItem>(null, maxInventorySlots).ToList();

            // TEMPORARY -- hardcode basesail to baseship (later on we want base ship to start without a sail)
            shipSail = new BaseSail(team, region, location, content, graphics);
            shipSail.millisecondsPerFrame = 500; // match turn speed for sail

            shipInterior = new Interior("baseShip", this, content, graphics);

            // set the random drops as interior objects
            if (interiorObjs != null)
            {
                foreach (var obj in interiorObjs)
                {
                    shipInterior.interiorObjects.Add(obj);

                    // need to do this for containers so they drop items within ship
                    if (obj is IContainer)
                    {
                        Container c = (Container)obj;
                        c.inInteriorId = shipInterior.interiorId;
                    }
                }
            }

            // set wake
            wake.MaxParticle      = 5;
            wake.WakeDisplacement = 13;

            SetSpriteAsset(baseShipAsset, location);
        }