Beispiel #1
0
 void Start()
 {
     battlegenerator_CS   = GetComponent <BattleGenerator>(); //podłączam battlegenerator.cs
     MapCanvas.enabled    = true;
     BattleCanvas.enabled = false;
     BattleSetUp();
 }
Beispiel #2
0
    public override void Effect(BattleGenerator battlegenerator_CS)
    {
        battlegenerator_CS.enemyGenerator_CS.SetEnemies(3);
        battlegenerator_CS.hud_CS.UpdateHUD();

        //pojedynczy
    }
Beispiel #3
0
        public async Task <IActionResult> Index([FromServices] BattleGenerator battleGenerator)
        {
            var battle = await battleGenerator.GenerateBattleAsync();

            if (battle == null)
            {
                _logger.LogWarning("No battle found");

                return(View("Empty"));
            }

            _logger.LogInformation($"Requesting {battle.Dog.Name} vs {battle.Cat.Name}");

            var model = new VoteViewModel
            {
                DogId        = battle.Dog.Id,
                DogName      = battle.Dog.Name,
                DogImagePath = battle.Dog.Image,
                CatId        = battle.Cat.Id,
                CatName      = battle.Cat.Name,
                CatImagePath = battle.Cat.Image
            };

            return(View(model));
        }
Beispiel #4
0
    public void CardPlay(BattleGenerator battlegenerator_CS, int cardNumer)
    {
        if (!(cardOnSlot[cardNumer - 1].requiresTarget) || !(battlegenerator_CS.targetedEnemy is null))
        {
            if (cardOnSlot[cardNumer - 1].cardCost <= battlegenerator_CS.hero_CS.energy)
            {
                cardOnSlot[cardNumer - 1].Effect(battlegenerator_CS);
                if (cardOnSlot[cardNumer - 1].isExhaust == true)
                {
                    exhaustList.Add(cardOnSlot[cardNumer - 1]);
                }
                else
                {
                    graveyardList.Add(cardOnSlot[cardNumer - 1]);
                }

                if (deckList.Count == 0)
                {
                    cardOnSlot[cardNumer - 1] = new BlankCard();
                    cardOnSlot[cardNumer - 1].Replace();
                    battlegenerator_CS.hud_CS.CardUpdate(cardOnSlot[cardNumer - 1], cardNumer);
                    battlegenerator_CS.hud_CS.DeckUpdate(deckList.Count, graveyardList.Count, exhaustList.Count);
                }
                else
                {
                    CardDraw(cardNumer);
                }
                battlegenerator_CS.pointer_CS.HideThis();
            }
        }
    }
Beispiel #5
0
    void GenerateEnvironment(Vector3 center, SunSystem sunSystem)
    {
        List <SpaceBody> spaceBodies = new List <SpaceBody>();

        BattleGenerator.GenerateGalaxy(center, sunSystem, navigation, spaceBodies, AP);
        otherObjects.Add(new SunSystemUpdater(spaceBodies));
        sun = spaceBodies.First(b => b is SunBehaviour) as SunBehaviour;
    }
Beispiel #6
0
 public Enemy copyIntoThis(Enemy copiedFrom)
 {
     this.intentText         = copiedFrom.intentText;
     this.enemyHP            = copiedFrom.enemyHP;
     this.enemyShield        = copiedFrom.enemyShield;
     this.battlegenerator_CS = copiedFrom.battlegenerator_CS;
     return(this);
 }
	// Use this for initialization
	void Start () {
        currentState = BattleState.START;
        battleGenerator = new BattleGenerator();
        this.turnQueue = battleGenerator.generateBattle();
        this.alliedCharacters = battleGenerator.alliedCharacters;
        this.enemies = battleGenerator.enemies;
        currentState = BattleState.START;
        
    }
Beispiel #8
0
    void Respawn(List <ShipDriver> drivers)
    {
        int count = drivers.Count;

        Vector3 forward = (BattleBehaviour.current.battleCenter - point.position).normalized;
        Vector3 right   = Vector3.Cross(point.up, forward);

        Quaternion rotation = Quaternion.LookRotation(forward);
        Vector3    position = forward * -distanceToCenter;

        DistributionCube cube = new DistributionCube(count * 40, count * 20, count * 20, 4, 2, 2);

        BattleGenerator.GenerateShips(
            drivers,
            position,
            rotation,
            point.up,
            right,
            forward,
            cube,
            shipContainer
            );
    }
Beispiel #9
0
 void Start()
 {
     battlegenerator_CS = GetComponent <BattleGenerator>();
     battleSystem_CS    = GetComponent <BattleSystem>();
 }
Beispiel #10
0
    void GenerateShips(Vector3 team1Pos, Vector3 team2Pos)
    {
        int playerTeam = Random.Range(0, 2);

        //Get ships from assets. Distribute them in arrays by classes
        var shipModels = GameResources.GetAllShips();

        int shipAmount = config.shipsAmount.value;

        //Get ships distribution by classes { 1, 2, 3 }
        if (config.lightShipsWeight == 0 && config.averageShipsWeight == 0 && config.heavyShipsWeight == 0f)
        {
            config.lightShipsWeight.value   = 1;
            config.averageShipsWeight.value = 1;
            config.heavyShipsWeight.value   = 1;
        }

        BattleGenerator.ShipIndexPair[] playerShip;
        int playerPosition = Random.Range(0, shipAmount);

        switch (config.playerShip.type)
        {
        case PlayerShip.ShipType.Concrete:
            playerShip = new BattleGenerator.ShipIndexPair[] { new BattleGenerator.ShipIndexPair(shipModels.First(m => m.name == config.playerShip.shipName), playerPosition) };
            break;

        case PlayerShip.ShipType.RandomOfClass:
            playerShip = new BattleGenerator.ShipIndexPair[] { new BattleGenerator.ShipIndexPair(config.playerShip.shipClass, playerPosition) };
            break;

        default:
            playerShip = null;
            break;
        }

        DistributionCube cube = new DistributionCube(500, 500, 200, 5, 10, 2);

        BattleGenerator.GenerateShips(
            BattleGenerator.GenerateShipModels(shipModels, shipAmount, config.lightShipsWeight, config.averageShipsWeight, config.heavyShipsWeight, playerShip),
            BattleGenerator.GenerateDrivers(teams[0], shipAmount, playerTeam == 0 ? playerPosition : -1),
            team1Pos,
            Quaternion.LookRotation(-Vector3.forward, Vector3.up),
            Vector3.up,
            Vector3.right,
            -Vector3.forward,
            cube,
            this.ships
            );

        BattleGenerator.GenerateShips(
            BattleGenerator.GenerateShipModels(shipModels, shipAmount, config.lightShipsWeight, config.averageShipsWeight, config.heavyShipsWeight, playerShip),
            BattleGenerator.GenerateDrivers(teams[1], shipAmount, playerTeam == 1 ? playerPosition : -1),
            team2Pos,
            Quaternion.LookRotation(Vector3.forward, Vector3.up),
            Vector3.up,
            -Vector3.right,
            Vector3.forward,
            cube,
            this.ships
            );
    }
Beispiel #11
0
 public override void GetModifiers(BattleGenerator battlegenerator_CS)
 {
 }
Beispiel #12
0
 public override void Effect(BattleGenerator battlegenerator_CS)
 {
 }
Beispiel #13
0
 public abstract void GetModifiers(BattleGenerator battlegenerator_CS);
Beispiel #14
0
 public abstract void Effect(BattleGenerator tmp);
Beispiel #15
0
 public override void Effect(BattleGenerator battlegenerator_CS)
 {
     battlegenerator_CS.enemyGenerator_CS.SetEnemies(1);
     battlegenerator_CS.hud_CS.UpdateHUD();
     //wielu
 }