Example #1
0
 override protected void Awake()
 {
     base.Awake();
     _buffHandler = GameObject.FindGameObjectWithTag("Player").GetComponent <BuffHandler>();
     _statHandler = GameObject.FindGameObjectWithTag("Player").GetComponent <StatHandler>();
     UpdateSprite(AbilityUtil.GetAbilityHUDElement(ElementEnum.heal).Sprite);
 }
Example #2
0
    private Item GetRandomItem()
    {
        Item item;

        switch (Random.Range(0, 3))
        {
        case 0:
            item = new ElementItem(Random.Range(1, Item.TIER_RANGE + 1), AbilityUtil.GetRandomElement());
            Debug.Log(Item.TIER_RANGE);
            break;

        case 1:
            item = new WildcardItem(Random.Range(1, Item.TIER_RANGE + 1), AbilityUtil.GetRandomWildcard());
            break;

        case 2:
            item = new WeaponItem(Random.Range(1, Item.TIER_RANGE + 1), AbilityUtil.GetRandomWeapon());
            break;

        default:
            item = new NullItem();
            Debug.Log("Default Case");
            break;
        }
        return(item);
    }
    private void Start()
    {
        AbilityHUDElement info = AbilityUtil.GetNullHUDElement();

        SyncElement(info);
        SyncWeapon(info);
        SyncWildcard(info);
    }
Example #4
0
 virtual protected void Start()
 {
     if (_playerHealthBar)
     {
         _statHandler = GameObject.FindGameObjectWithTag("Player").GetComponent <StatHandler>();
     }
     _slider     = GetComponent <Slider>();
     _fill.color = _color;
     if (_elementIcon != null)
     {
         _elementIcon.sprite = AbilityUtil.GetAbilityHUDElement(_statHandler.Element).Sprite;
     }
 }
Example #5
0
    public static Item GetItemToDrop(EnemyStatHandler statHandler)
    {
        int random = UnityEngine.Random.Range(1, 11);
        int value  = 10 - random;

        if (value > 8)
        {
            return(new WildcardItem(1, AbilityUtil.GetRandomWildcard()));
        }
        if (value > 6)
        {
            if (statHandler.sword != null)
            {
                return(new WeaponItem(1, WeaponEnum.blade));
            }
            if (statHandler.shield != null)
            {
                return(new WeaponItem(1, WeaponEnum.magiccore));
            }
            return(new WeaponItem(1, WeaponEnum.barrel));
        }
        return(new ElementItem(1, statHandler.Element));
    }
Example #6
0
 override protected void Start()
 {
     base.Start();
     _elementIcon.sprite = AbilityUtil.GetAbilityHUDElement(_statHandler.Element).Sprite;
 }