Exemplo n.º 1
0
        public AtavismAbility Clone(GameObject go)
        {
            AtavismAbility clone = go.AddComponent <AtavismAbility>();

            clone.id   = id;
            clone.name = name;
            clone.icon = icon;
            //clone.style = style;
            clone.costProperty   = costProperty;
            clone.rank           = rank;
            clone.cost           = cost;
            clone.distance       = distance;
            clone.castTime       = castTime;
            clone.globalcd       = globalcd;
            clone.weaponcd       = weaponcd;
            clone.cooldownType   = cooldownType;
            clone.cooldownLength = cooldownLength;
            clone.weaponReq      = weaponReq;
            clone.targetType     = targetType;
            clone.tooltip        = tooltip;
            clone.passive        = passive;
            clone.reqLevel       = reqLevel;
            clone.castingInRun   = castingInRun;
            return(clone);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Reset the cursor to its initial state (point)
 /// </summary>
 public void ResetCursor()
 {
     // reset our state
     _cursorItem    = null;
     _cursorAbility = null;
     _cursorBag     = null;
     // Reset the texture
     //	cursorTexture = null;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the cursor item to the specified item. This will result in the items icon replacing the cursor
 /// and allow it to be placed.
 /// </summary>
 /// <param name="item"></param>
 public void SetCursorItem(AtavismInventoryItem item)
 {
     if (item != null)
     {
         _cursorItem    = item;
         _cursorAbility = null;
         _UpdateCursor();
         AtavismLogger.LogDebugMessage("Set cursor item: " + item + "," + item.icon);
     }
 }
Exemplo n.º 4
0
        public AtavismAbility GetPlayerAbility(int abilityID)
        {
            AtavismAbility ability = null;

            foreach (AtavismAbility ab in playerAbilities)
            {
                if (ab.id == abilityID)
                {
                    return(ab);
                }
            }
            return(ability);
        }
Exemplo n.º 5
0
        public AtavismAbility GetAbility(int abilityID)
        {
            // First check if the player has a copy of this ability
            AtavismAbility ability = GetPlayerAbility(abilityID);

            if (ability == null)
            {
                // Player does not have this ability - lets use the template
                if (abilities.ContainsKey(abilityID))
                {
                    return(abilities[abilityID].Clone(tempCombatDataStorage));
                }
            }
            return(ability);
        }
Exemplo n.º 6
0
 void UpdateButton(int abilityID)
 {
     if (abilityID > 0)
     {
         AtavismAbility ability = Abilities.Instance.GetAbility(abilityID);
         action = new AtavismAction();
         action.actionObject = ability;
         GetComponent <Button>().image.sprite = ability.icon;
         GetComponent <Button>().image.color  = new Color(1, 1, 1, 1);
     }
     else
     {
         GetComponent <Button>().image.color = new Color(0, 0, 0, 0);
     }
 }
Exemplo n.º 7
0
        void Start()
        {
            if (instance != null)
            {
                return;
            }
            instance = this;

            tempCombatDataStorage = new GameObject("TemporaryCombatData");
            DontDestroyOnLoad(tempCombatDataStorage);

            playerAbilities = new List <AtavismAbility>();
            //   abilitiesList = new List<AtavismAbility>();

            abilities = new Dictionary <int, AtavismAbility>();
            Object[] abilityPrefabs = Resources.LoadAll("Content/Abilities");
            foreach (Object abilityPrefab in abilityPrefabs)
            {
                GameObject     go          = (GameObject)abilityPrefab;
                AtavismAbility abilityData = go.GetComponent <AtavismAbility>();
                if (!abilities.ContainsKey(abilityData.id))
                {
                    abilities.Add(abilityData.id, abilityData);
                }
            }

            playerEffects = new List <AtavismEffect>();
            effects       = new Dictionary <int, AtavismEffect>();
            Object[] effectPrefabs = Resources.LoadAll("Content/Effects");
            foreach (Object effectPrefab in effectPrefabs)
            {
                GameObject    go         = (GameObject)effectPrefab;
                AtavismEffect effectData = go.GetComponent <AtavismEffect>();
                if (!effects.ContainsKey(effectData.id))
                {
                    effects.Add(effectData.id, effectData);
                }
            }
        }