Exemplo n.º 1
0
        public void Unload()
        {
            Log.Info(Log.LogSource.PoxDB, "Database.Unload() called");
            if (!ready)
            {
                return;
            }
            // todo: what if it is loading?

            Champions.Clear();
            Abilities.Clear();
            Abilities_similar.Clear();
            Spells.Clear();
            Relics.Clear();
            Equipments.Clear();

            Factions.Clear();
            Races.Clear();
            Classes.Clear();
            Rarities.Clear();
            Expansions.Clear();
            AbilityNames.Clear();

            ready = false;
        }
Exemplo n.º 2
0
    public void castAbility(AbilityNames _abilityNames, Transform _myTransform, int ID)
    {
        // if the ability cooldown timer is enabled and the inputed ability number is correct compared to the number of abilities in roster is valid.
        //EX: Timer is not enabled and ability chosen is 2. Cast ability number 2 and set timer on so that this code doesnt run again.
        // This making it so that the ability CANT cooldown twice.


        // when i cast the ability i want thewre to be a ability castiung time. WWhen ability casting time is happening.
        // Players will be able to switch abilities before casting time is done but will suffer the cost of their original option
        // Ex: Abilities Mana Cost and the player will be forced to wait for the cooldown of the ability.
        if ((!myAbilityTimerList[ID].isEnabled) && (ID <= myAbilityNames.Count))
        {
            tempCastingAbilityHold = abilityManager.getAbilityObject(_abilityNames);
            //Instantiate(abilityManager.getAbilityObject(_abilityNames), _myTransform.position, _myTransform.rotation);
            abilityManager.TurnOnCooldownTimer(myAbilityTimerList[ID], true);

            abilityCastingTimer.ResetTimer();
            currentAbilityBeingCasted = ID;                                     // Store ability index number (This is associated with players chose of 1,2,3,4)
            abilityBeingCasted        = true;                                   // Store true so that we know if ability is being casted. If player decides to change mid way through cast then Look at GDD on changing abilities mid cast. (Combat System)

            abilityCastingTimer.timerCountMax = myAbilityStats[ID].castingTime; // Set the AbilityCasting timer to the indexed abillities stored casting time.
            abilityManager.startCasting(myAbilityNames[currentAbilityBeingCasted]);
            abilityCastingTimer.isEnabled = true;

            if (whatAmI == WhatAmI.Player)
            {
                abilityManager.TurnOnSlot(myActiveAbilitySlots[ID]);
            }
        }
    }
Exemplo n.º 3
0
    public void SetTimers(AbilityNames _AbilityName, Timer _timer, int _countDownInterval = 1)
    {
        GameObject   _abilityObject = getAbilityObject(_AbilityName);
        AbilityStats _abilityStats  = null;

        _abilityStats             = _abilityObject.GetComponent <AbilityStats>();
        _timer.timerCountMax      = _abilityStats.coolingDownTime;
        _timer.timerCountInterval = _countDownInterval;
    }
Exemplo n.º 4
0
    public void SetDynamicAbility(AbilityNames abilityName)
    {
        ResetDynamicAbility();
        switch (abilityName)
        {
        case AbilityNames.DoubleJump:
            EnableDoubleJump();
            break;

        case AbilityNames.Dash:
            EnableDash();
            break;
        }
    }
Exemplo n.º 5
0
    public GameObject getAbilityObject(AbilityNames _AbilityName)
    {
        GameObject _abilityObject = null;

        for (int i = 0; i < resource_AllAbilityObjects.Length; i++)
        {
            if (resource_AllAbilityObjects[i].name == _AbilityName.ToString())
            {
                _abilityObject = resource_AllAbilityObjects[i];
            }
        }

        return(_abilityObject);
    }
Exemplo n.º 6
0
    public void startCasting(AbilityNames _abilityName)
    {
        // THIS FUNCTION DOES NOT INSTANTIATE ANY GAMEOBJECT.


        abilityCastingTimerOverlay.SetActive(true);                 // Lets player have a visual on its casting time.
        GameObject _abilityObject = getAbilityObject(_abilityName); // gets the ability object/

        AbilityStats currentAbilityStat = _abilityObject.GetComponent <AbilityStats>();

        fillImage      = abilityCastingTimerOverlay.transform.GetChild(0).GetComponent <Image>(); // fill image is in the order of the child number indicated in code.
        abilityNameTxt = abilityCastingTimerOverlay.transform.GetChild(1).GetComponent <Text>();

        abilityCastingTime   = currentAbilityStat.castingTime; // Sets the
        fillImage.fillAmount = 0;
        abilityNameTxt.text  = _abilityName.ToString();
    }
Exemplo n.º 7
0
        /// <summary>
        /// Loads all data. Should be positioned on the start
        /// if the second data hunk.
        /// </summary>
        /// <param name="dataReader"></param>
        public ExecutableData(IDataReader dataReader)
        {
            // TODO: For now we search the offset of the filelist manually
            //       until we decode all of the data.
            dataReader.Position = (int)dataReader.FindString("0Map_data.amb", 0) - 184;

            // TODO ...
            FileList   = new FileList(dataReader);
            WorldNames = new WorldNames(dataReader);
            Messages   = new Messages(dataReader);
            if (dataReader.ReadDword() != 0)
            {
                throw new AmbermoonException(ExceptionScope.Data, "Invalid executable data.");
            }
            AutomapNames   = new AutomapNames(dataReader);
            OptionNames    = new OptionNames(dataReader);
            SongNames      = new SongNames(dataReader);
            SpellTypeNames = new SpellTypeNames(dataReader);
            SpellNames     = new SpellNames(dataReader);
            LanguageNames  = new LanguageNames(dataReader);
            ClassNames     = new ClassNames(dataReader);
            RaceNames      = new RaceNames(dataReader);
            AbilityNames   = new AbilityNames(dataReader);
            AttributeNames = new AttributeNames(dataReader);
            AbilityNames.AddShortNames(dataReader);
            AttributeNames.AddShortNames(dataReader);
            ItemTypeNames = new ItemTypeNames(dataReader);
            AilmentNames  = new AilmentNames(dataReader);
            UITexts       = new UITexts(dataReader);

            // TODO: There is a bunch of binary data (gfx maybe?)

            // TODO: Then finally the item data comes ...

            // TODO ...
        }
Exemplo n.º 8
0
	public int GetAbilityModifier(AbilityNames pmName)
	{
		return mAbilities [pmName].Modifier;
	}
Exemplo n.º 9
0
	public int GetAbilityValue(AbilityNames pmName)
	{
		return mAbilities [pmName].Value;
	}
Exemplo n.º 10
0
	public void SetAbility(AbilityNames pmName, int pmScore)
	{
		mAbilities.Remove (pmName);
		mAbilities.Add (pmName, new Ability(pmScore));
	}
Exemplo n.º 11
0
	public Skill (string name, AbilityNames ability, bool isProficient)
	{
		this.name = name;
		this.ability = ability;
		this.isProficient = isProficient;
	}