public ShieldCommand(BaseCharacter actor, float castTime, float blockAmount) { this.actor = (PlayerModel)actor; this.castTime = castTime; this.blockAmount = blockAmount; this.iconPath = "ui/icons/shieldSymbol"; }
private void Start() { playerModel = new PlayerModel(); dungeonManager = GetComponentInChildren<DungeonManager>(); inventoryManager = GetComponentInChildren<InventoryManager>(); battleManager = GetComponentInChildren<BattleManager>(); resetGame(); }
public EnemyAI(EnemyModel enemy, PlayerModel player) { this.enemy = enemy; this.player = player; nextMove = 3.0f; // make depending on type of enemy }
public void enterBattle(PlayerModel player, EnemyType enemyType) { playerModel = player; enemyModel = EnemyFactory.fromType(enemyType); initBattleViews(); enemyAI = new EnemyAI(enemyModel, playerModel); initQueues(); }
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); }
public void initBattle(PlayerModel player, EnemyModel enemy) { instantiateViews(); //initBattle all Three playerView.init(player); enemyView.init(enemy); battleUIView.init(player, enemy); updateView(player, enemy); }
// 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); }
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(); }
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; } } }
public void updateView(PlayerModel player, EnemyModel enemy) { playerView.updateView(player); enemyView.updateView(enemy); }
public void updateView(PlayerModel model) { updateHealth(model.hp); }
public void init(PlayerModel model) { updateHealth(model.hp); shield.enabled = false; }