Ejemplo n.º 1
0
    /********************************************************************************************/
    /************************************* Initialization ***************************************/
    /********************************************************************************************/

    // Use this for initialization
    void Start()
    {
        // Get the instance of Combat Tracker to switch turns and stuff
        combat     = combat.GetComponent <CombatTracker> ();
        TR         = GetComponent <Transform> ();
        battlemenu = battlemenu.GetComponent <BattleMenu>();
    }
Ejemplo n.º 2
0
        public HUD(EquipmentTracker equipmentTracker, InventoryTracker inventoryTracker, ProfitLossTracker profitLossTracker, CombatTracker combatTracker)
        {
            try
            {
                this.equipmentTracker  = equipmentTracker;
                this.inventoryTracker  = inventoryTracker;
                this.profitLossTracker = profitLossTracker;
                this.combatTracker     = combatTracker;

                profitLossTracker.ItemChanged += new Action <TrackedProfitLoss>(profitLossTracker_ItemChanged);

                hudUpdateTimer.Tick    += new EventHandler(hudUpdateTimer_Tick);
                hudUpdateTimer.Interval = 1000;
                hudUpdateTimer.Start();

                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Mana", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Comps Time 1h", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Net Profit 5m", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Net Profit 1h", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "DPS Out 1m", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "DPS Out 5m", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "DPS Out 1h", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "DPS In 1m", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "DPS In 5m", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "DPS In 1h", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Players", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Monsters", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "Pack Slots", "");
                VirindiHUDs.UIs.StatusModel.UpdateEntry("Mag-Tools", "ID Queue", "I");
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 3
0
    private void Start()
    {
        CombatTracker combatTracker = new CombatTracker();

        combatTracker = GameObject.FindObjectOfType <CombatTracker>();

        //combatTracker.AddUnit(gameObject);
    }
Ejemplo n.º 4
0
    /********************************************************************************************/
    /**************************************** Initialization ************************************/
    /********************************************************************************************/

    // Use this for initialization
    void Start()
    {
        // Initialize the Buttons
        Attack  = Attack.GetComponent <Button> ();
        Special = Special.GetComponent <Button> ();
        Item    = Item.GetComponent <Button> ();
        Run     = Run.GetComponent <Button> ();
        // Get the instance of Combat Tracker to switch turns and stuff
        combat = combat.GetComponent <CombatTracker> ();
    }
Ejemplo n.º 5
0
        public void Detach()
        {
            CombatTracker.SafeDestroy();
            CombatTracker = null;

            AttackIndicator.SafeDestroy();
            AttackIndicator = null;

            MovementIndicator.SafeDestroy();
            MovementIndicator = null;
        }
Ejemplo n.º 6
0
 private void ShowCombatTracker()
 {
     if (_FormTracker == null || _FormTracker.IsDisposed)
     {
         _FormTracker = new CombatTracker(this);
         _FormTracker.Show();
     }
     else
     {
         _FormTracker.BringToFront();
     }
 }
Ejemplo n.º 7
0
        public CombatTrackerGUI(CombatTracker combatTracker, HudList monsterList, HudList damageInfoList)
        {
            try
            {
                if (combatTracker == null)
                {
                    return;
                }

                this.combatTracker = combatTracker;
                this.monsterList   = monsterList;

                combatTrackerGUIInfo = new CombatTrackerGUIInfo(damageInfoList);

                monsterList.ClearColumnsAndRows();

                // Each character is a max of 6 pixels wide
                monsterList.AddColumn(typeof(HudStaticText), 5, null);
                monsterList.AddColumn(typeof(HudStaticText), 111, null);
                monsterList.AddColumn(typeof(HudStaticText), 37, null);
                monsterList.AddColumn(typeof(HudStaticText), 55, null);                 // This cannot go any smaller without pruning text
                monsterList.AddColumn(typeof(HudStaticText), 77, null);

                HudList.HudListRowAccessor newRow = monsterList.AddRow();
                ((HudStaticText)newRow[2]).Text          = "KB's";
                ((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[3]).Text          = "Dmg Rcvd";
                ((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[4]).Text          = "Dmg Givn";
                ((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right;

                newRow = monsterList.AddRow();
                ((HudStaticText)newRow[0]).Text          = "*";
                ((HudStaticText)newRow[1]).Text          = "All";
                ((HudStaticText)newRow[2]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[3]).TextAlignment = VirindiViewService.WriteTextFormats.Right;
                ((HudStaticText)newRow[4]).TextAlignment = VirindiViewService.WriteTextFormats.Right;

                selectedRow = 1;

                monsterList.Click += new HudList.delClickedControl(monsterList_Click);

                combatTracker.InfoCleared         += new Action <bool>(combatTracker_InfoCleared);
                combatTracker.StatsLoaded         += new Action <List <CombatInfo> >(combatTracker_StatsLoaded);
                combatTracker.CombatInfoUpdated   += new Action <CombatInfo>(combatTracker_CombatInfoUpdated);
                combatTracker.AetheriaInfoUpdated += new Action <AetheriaInfo>(combatTracker_AetheriaInfoUpdated);
                combatTracker.CloakInfoUpdated    += new Action <CloakInfo>(combatTracker_CloakInfoUpdated);
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
Ejemplo n.º 8
0
        public void TryAttack(Unit targetUnit)
        {
            var  screen    = FlatRedBall.Screens.ScreenManager.CurrentScreen;
            bool canAttack = screen.PauseAdjustedSecondsSince(lastDamageDealt) >= DamageFrequency;

            if (canAttack)
            {
                CombatTracker.RegisterUnitForCombat(this);
                CombatTracker.RegisterUnitForCombat(targetUnit);

                lastDamageDealt = screen.PauseAdjustedCurrentTime;

                targetUnit.TakeDamage(UnitData.AttackDamage);
                TryPlayAttackSound(this);
                TryPlayWeaponsSound(this);
            }
        }
Ejemplo n.º 9
0
        private void btnAddToCombat_Click(object sender, EventArgs e)
        {
            if (_FormTracker == null || _FormTracker.IsDisposed)
            {
                _FormTracker = new CombatTracker(this);
                _FormTracker.Show();
                _FormTracker.SendToBack();
            }

            if (lbxMon.SelectedIndex >= 0)
            {
                var mon = pfdb.Bestiaries.ToList().ElementAtOrDefault(lbxMonIds[lbxMon.SelectedIndex] - 1);                 // Offset zero-based index
                if (mon != null)
                {
                    _FormTracker.AddBestiary(mon.BestiaryId);
                }
            }
        }
Ejemplo n.º 10
0
        private void PerformDeath()
        {
            TryPlayDeathSound(this);
            CombatTracker.RemoveUnit(this);
            this.SpriteInstance.CurrentChainName = "Death";
            this.SpriteInstance.RelativeY        = this.SpriteInstance.Height / 2.0f;

            this.deathTextureOriginalHeight = this.SpriteInstance.Height;
            this.deathStartTime             = ScreenManager.CurrentScreen.PauseAdjustedCurrentTime;

            this.ShadowSprite.CurrentChainName    = "ShadowSmall";
            this.HealthBarRuntimeInstance.Visible = false;

            this.Velocity = Vector3.Zero;
            if (UnitData.IsEnemy == false)
            {
                var screen = ScreenManager.CurrentScreen as Screens.GameScreen;
                screen.CurrentCapacityUsed -= UnitData.Capacity;
                screen.UpdateResourceDisplay();
            }
            Died?.Invoke(this, null);
            this.Call(Destroy).After(DeathSpriteDuration);
        }