Beispiel #1
0
 public ShieldCommand(BaseCharacter actor, float castTime, float blockAmount)
 {
     this.actor = (PlayerModel)actor;
     this.castTime = castTime;
     this.blockAmount = blockAmount;
     this.iconPath = "ui/icons/shieldSymbol";
 }
Beispiel #2
0
 private void Start()
 {
     playerModel = new PlayerModel();
     dungeonManager = GetComponentInChildren<DungeonManager>();
     inventoryManager = GetComponentInChildren<InventoryManager>();
     battleManager = GetComponentInChildren<BattleManager>();
     resetGame();
 }
Beispiel #3
0
        public EnemyAI(EnemyModel enemy, PlayerModel player)
        {
            this.enemy = enemy;
            this.player = player;

            nextMove = 3.0f;
            // make depending on type of enemy
        }
Beispiel #4
0
        public void enterBattle(PlayerModel player, EnemyType enemyType)
        {
            playerModel = player;
            enemyModel = EnemyFactory.fromType(enemyType);

            initBattleViews();
            enemyAI = new EnemyAI(enemyModel, playerModel);
            initQueues();
        }
Beispiel #5
0
        public void openInventory(PlayerModel playerModel)
        {
            GameObject inventoryObj = GameObject.Instantiate(Resources.Load("ui/InventroryView", typeof(GameObject))) as GameObject;
            inventoryObj.transform.SetParent(transform);
            inventoryObj.transform.localScale = Vector3.one;
            inventoryObj.transform.localPosition = Positions.CENTER;

            inventory = inventoryObj.GetComponent<InventoryView>();
            inventory.init(playerModel);
        }
Beispiel #6
0
        public void initBattle(PlayerModel player, EnemyModel enemy)
        {
            instantiateViews();

            //initBattle all Three
            playerView.init(player);
            enemyView.init(enemy);
            battleUIView.init(player, enemy);

            updateView(player, enemy);
        }
Beispiel #7
0
        // level? special room?
        public Loot generate(PlayerModel player, EnemyModel enemy)
        {
            float rnd = Random.Range(0.0f, 1.0f);

            if (rnd < 0.1)
            {
                return new Loot(LootType.DAGGER, 1);
            }

            return new Loot(LootType.NONE);
        }
Beispiel #8
0
        public void init(PlayerModel playerModel)
        {
            this.playerModel = playerModel;
            inventoryItems = new List<InventoryItem>();
            equippedView = GetComponentInChildren<EquippedView>();
            equippedView.Init();

            for (int i = 0; i < playerModel.inventory.Count; i++)
            {
                addItem(playerModel.inventory[i]);
            }

            updateView();
            itemInfo.close();
        }
Beispiel #9
0
        public void init(PlayerModel player, BaseCharacter enemy)
        {
            Vector3 pos = new Vector3(-282, -342, 0);
            AbilityCommand tmpCommand;

            for (int i = 0; i < player.inventory.Count; i++)
            {
                if (player.inventory[i].equipped)
                {
                    tmpCommand = player.inventory[i].getCommand(player, enemy);
                    addAbilityBtn(tmpCommand, pos, player.inventory[i].iconPath);
                    pos.x += 200;
                }
            }
        }
Beispiel #10
0
 public void updateView(PlayerModel player, EnemyModel enemy)
 {
     playerView.updateView(player);
     enemyView.updateView(enemy);
 }
Beispiel #11
0
 public void updateView(PlayerModel model)
 {
     updateHealth(model.hp);
 }
Beispiel #12
0
 public void init(PlayerModel model)
 {
     updateHealth(model.hp);
     shield.enabled = false;
 }