Inheritance: MonoBehaviour
    // Use this for initialization
    void Awake()
    {
        previousRotation = barrel.rotation;

        // Uses the ballista's method (because i'm lazy to recode) to convert the list in the
        // inspector to the queue. Because queue's aren't available to be shown in the inspector :(
        cannonBallQueue = Ballista.ListToGameObjectQueue <CannonBall.CannonBallType>(cannonBallListQueue, cannonBallPrefabs);
    }
示例#2
0
文件: DesignScript.cs 项目: Bubu/LD36
    public void selectWeapon(int weaponIndex, int blueprintNo)
    {
        Weapon selectedWeapon = null;

        if (weaponIndex == 0)
        {
            selectedWeapon = new Catapult();
        }
        else if (weaponIndex == 1)
        {
            selectedWeapon = new Ballista();
        }
        else
        {
            selectedWeapon = new Ram();
        }
        warplan.blueprints[blueprintNo].weapon = selectedWeapon;
    }
    // Start is called before the first frame update
    void Start()
    {
        spriteRenderer = GetComponent <SpriteRenderer>();

        Ballista         = GetComponent <Ballista>();
        Bat              = GetComponent <BatController>();
        BoundTrap        = GetComponent <BoundTrapController>();
        Bush             = GetComponent <BushController>();
        Button           = GetComponent <ButtonController>();
        Crocodile        = GetComponent <CrocodileController>();
        Drop             = GetComponent <DropController>();
        FallingPlataform = GetComponent <FallingPlataform>();
        //Pajaro = GameObject.FindGameObjectsWithTag("").GetComponent<ButtonController>();
        Mole       = GetComponent <MoloController>();
        Mushroom   = GetComponent <MushroomController>();
        Rat        = GetComponent <RatController>();
        Rock       = GetComponent <RockController>();
        RotateTrap = GetComponent <RotateTrapController>();
        Spawner    = GetComponent <Spawner>();
        Spikes     = GetComponent <SpikesController>();
        Thorms     = GetComponent <ThormsController>();
        Trap       = GetComponent <TrapController>();

        spriteRenderer.enabled = false;
        //Ballista.enabled = false;
        Bat.enabled              = false;
        BoundTrap.enabled        = false;
        Bush.enabled             = false;
        Button.enabled           = false;
        Crocodile.enabled        = false;
        Drop.enabled             = false;
        FallingPlataform.enabled = false;
        //Pajaro.enabled = false;
        Mole.enabled       = false;
        Mushroom.enabled   = false;
        Rat.enabled        = false;
        Rock.enabled       = false;
        RotateTrap.enabled = false;
        Spawner.enabled    = false;
        Spikes.enabled     = false;
        Thorms.enabled     = false;
        Trap.enabled       = false;
    }
示例#4
0
        public override void Create()
        {
            Drawable.setEngine(Engine);
            CollisionSprite.Init(new CollisionManager());
            if (!demo)
            {
                Engine.Borderless();
                Console.Title = "LuxC";
            }
            else
            {
                Console.Title = "LuxC Demo";
            }

            Engine.SetBackground(8);

            Parade   = new Parade();
            ballista = new Ballista(Parade);

            palette.Position = new Point(236, 128);
        }
 public BallistaAI(Ballista ballista)
     : base((RangedSiegeWeapon)ballista)
 {
 }
示例#6
0
        // Creates the initial game state - this will probably be a huge method at the end of it.. TODO: find way to dynamically create items/npc/etc and place them in appropriate region
        public void CreateNewGame()
        {
            //TEMPORARY NEED TO CREATE SOME SORT OF GAME SETUP / REGION SETUP that is easily scalable
            List <Sprite> giannaLandTiles = BoundingBoxLocations.RegionMap["Gianna"].RegionLandTiles;
            List <Sprite> scLandTiles     = BoundingBoxLocations.RegionMap["SnooCat"].RegionLandTiles;
            List <Sprite> usoppLandTiles  = BoundingBoxLocations.RegionMap["Usopp"].RegionLandTiles;
            var           screenCenter    = new Vector2(_graphics.Viewport.Bounds.Width / 2, _graphics.Viewport.Bounds.Height / 2);

            ShortShip shortShip = new ShortShip(TeamType.Player, "GustoMap", new Vector2(-100, -600), _content, _graphics);

            shortShip.shipInterior.interiorId = Guid.NewGuid();
            BoundingBoxLocations.interiorMap.Add(shortShip.shipInterior.interiorId, shortShip.shipInterior);

            BaseShip baseShip = new BaseShip(TeamType.Player, "GustoMap", new Vector2(-300, -600), _content, _graphics);

            baseShip.shipInterior.interiorId = Guid.NewGuid();
            BoundingBoxLocations.interiorMap.Add(baseShip.shipInterior.interiorId, baseShip.shipInterior);

            BaseShip baseShipAI = new BaseShip(TeamType.A, "Usopp", new Vector2(500, -140), _content, _graphics);

            baseShipAI.shipInterior.interiorId = Guid.NewGuid();
            BoundingBoxLocations.interiorMap.Add(baseShipAI.shipInterior.interiorId, baseShipAI.shipInterior);

            TeePee teePee = new TeePee(TeamType.A, "Gianna", new Vector2(340, -850), _content, _graphics);

            teePee.structureInterior.interiorId = Guid.NewGuid();
            BoundingBoxLocations.interiorMap.Add(teePee.structureInterior.interiorId, teePee.structureInterior);

            BaseTribal    baseTribalLand = new BaseTribal(TeamType.A, "Gianna", giannaLandTiles[RandomEvents.rand.Next(giannaLandTiles.Count)].location, _content, _graphics);
            BaseCat       baseCatLand    = new BaseCat(TeamType.B, "SnooCat", scLandTiles[RandomEvents.rand.Next(scLandTiles.Count)].location, _content, _graphics);
            Chicken       chickenLand    = new Chicken(TeamType.Animal, "Gianna", giannaLandTiles[RandomEvents.rand.Next(giannaLandTiles.Count)].location, _content, _graphics);
            Snake         snakeLand      = new Snake(TeamType.Animal, "Usopp", usoppLandTiles[RandomEvents.rand.Next(usoppLandTiles.Count)].location, _content, _graphics);
            BlueBird      blueBird       = new BlueBird(TeamType.Animal, "Usopp", usoppLandTiles[RandomEvents.rand.Next(usoppLandTiles.Count)].location, _content, _graphics);
            Tower         tower          = new BaseTower(TeamType.B, "GustoMap", new Vector2(-1600, -1500), _content, _graphics);
            ClayFurnace   furnace        = new ClayFurnace(TeamType.Player, "GustoMap", new Vector2(180, 140), _content, _graphics);
            CraftingAnvil craftingAnvil  = new CraftingAnvil(TeamType.Player, "GustoMap", new Vector2(120, 40), _content, _graphics);
            BaseBarrel    barrelLand     = new BaseBarrel(TeamType.A, "GustoMap", new Vector2(-20, -160), _content, _graphics);
            BaseBarrel    barrelOcean    = new BaseBarrel(TeamType.A, "GustoMap", new Vector2(380, -90), _content, _graphics);
            BaseChest     chestLand      = new BaseChest(TeamType.A, "GustoMap", new Vector2(100, -120), _content, _graphics);
            CampFire      campfire       = new CampFire(TeamType.A, "GustoMap", new Vector2(70, -350), _content, _graphics);

            Shovel shovel = new Shovel(TeamType.A, "GustoMap", new Vector2(200, -330), _content, _graphics);

            shovel.onGround = true;
            Pickaxe pickaxe = new Pickaxe(TeamType.Player, "GustoMap", new Vector2(130, -430), _content, _graphics);

            pickaxe.onGround = true;
            //Pistol pistol = new Pistol(TeamType.A, "GustoMap", new Vector2(250, -300), _content, _graphics);
            //pistol.amountStacked = 1;
            //pistol.onGround = true;
            BaseCannon cannon = new BaseCannon(TeamType.A, "GustoMap", new Vector2(0, -450), _content, _graphics);

            cannon.onGround = true;
            Ballista ballista = new Ballista(TeamType.A, "GustoMap", new Vector2(-120, -550), _content, _graphics);

            ballista.onGround = true;
            CrossBow crossBow = new CrossBow(TeamType.A, "GustoMap", new Vector2(220, -350), _content, _graphics);

            crossBow.amountStacked = 1;
            crossBow.onGround      = true;
            ArrowItem arrows = new ArrowItem(TeamType.A, "GustoMap", new Vector2(210, -340), _content, _graphics);

            arrows.onGround      = true;
            arrows.amountStacked = 10;
            //PistolShotItem pistolAmmo = new PistolShotItem(TeamType.A, "GustoMap", new Vector2(220, -300), _content, _graphics);
            //pistolAmmo.amountStacked = 14;
            //pistolAmmo.onGround = true;
            CannonBallItem cannonAmmo = new CannonBallItem(TeamType.A, "GustoMap", new Vector2(200, -300), _content, _graphics);

            cannonAmmo.amountStacked = 10;
            cannonAmmo.onGround      = true;
            RustyHarpoonItem harpoonAmmo = new RustyHarpoonItem(TeamType.A, "GustoMap", new Vector2(-120, -550), _content, _graphics);

            harpoonAmmo.amountStacked = 10;
            harpoonAmmo.onGround      = true;
            Lantern lantern = new Lantern(TeamType.A, "GustoMap", new Vector2(180, -300), _content, _graphics);

            lantern.onGround = true;
            BasePlank basePlank = new BasePlank(TeamType.A, "GustoMap", new Vector2(150, -300), _content, _graphics);

            basePlank.onGround      = true;
            basePlank.amountStacked = 10;

            // Item utility is global and is accessed in main update, all items that are "dropped" or placed on the world view ground exist in this list (placable, invetory, etc)
            ItemUtility.ItemsToUpdate.Add(lantern);
            ItemUtility.ItemsToUpdate.Add(furnace);
            ItemUtility.ItemsToUpdate.Add(craftingAnvil);
            ItemUtility.ItemsToUpdate.Add(barrelLand);
            ItemUtility.ItemsToUpdate.Add(barrelOcean);
            ItemUtility.ItemsToUpdate.Add(chestLand);
            ItemUtility.ItemsToUpdate.Add(shovel);
            //ItemUtility.ItemsToUpdate.Add(pistol);
            ItemUtility.ItemsToUpdate.Add(cannon);
            ItemUtility.ItemsToUpdate.Add(ballista);
            ItemUtility.ItemsToUpdate.Add(crossBow);
            ItemUtility.ItemsToUpdate.Add(arrows);
            ItemUtility.ItemsToUpdate.Add(pickaxe);
            //ItemUtility.ItemsToUpdate.Add(pistolAmmo);
            ItemUtility.ItemsToUpdate.Add(cannonAmmo);
            ItemUtility.ItemsToUpdate.Add(harpoonAmmo);
            ItemUtility.ItemsToUpdate.Add(basePlank);
            ItemUtility.ItemsToUpdate.Add(campfire);

            UpdateOrder.Add(shortShip);
            UpdateOrder.Add(baseShip);
            UpdateOrder.Add(baseShipAI);
            UpdateOrder.Add(player);
            UpdateOrder.Add(baseTribalLand);
            UpdateOrder.Add(baseCatLand);
            UpdateOrder.Add(chickenLand);
            UpdateOrder.Add(blueBird);
            UpdateOrder.Add(snakeLand);
            UpdateOrder.Add(tower);
            UpdateOrder.Add(teePee);

            // interior set
            BaseTribal baseTribalInShip = new BaseTribal(TeamType.A, "GustoMap", Vector2.Zero, _content, _graphics);

            baseTribalInShip.npcInInterior = baseShipAI.shipInterior;
            baseShipAI.shipInterior.interiorObjects.Add(baseTribalInShip);

            ready = true;
        }
 void Awake()
 {
     catapult = GetComponent<Catapult>();
     ballista = GetComponent<Ballista>();
 }