Пример #1
0
 public CasterBuff(CASTERBUFF _ID, float _duration, Caster _caster)
 {
     ID          = _ID;
     maxDuration = _duration;
     duration    = maxDuration;
     myParent    = GameCore.Core;
     myCaster    = _caster;
 }
Пример #2
0
    private bool ConsumeCasterBuff(CASTERBUFF myb)
    {
        CasterBuff temp = buffSystem.FindBuff(myb);

        if (temp != null)
        {
            temp.Remove();
            return(true);
        }
        return(false);
    }
Пример #3
0
 public CasterBuff FindBuff(CASTERBUFF bufftype)
 {
     if (BuffsAmount > 0)
     {
         for (int i = 0; i < BuffsAmount; i++)
         {
             if (Buffs[i].ID == bufftype)
             {
                 return(Buffs[i]);
             }
         }
     }
     return(null);
 }
Пример #4
0
    public static Sprite GetCasterBuffResource(CASTERBUFF _buff)
    {
        switch (_buff)
        {
        case 0: return(Resources.Load <Sprite>("CasterBuffsIcons/VisionsOfAncientKings"));

        case CASTERBUFF.VISIONS_OF_ANCIENT_KINGS: return(Resources.Load <Sprite>("TalentIcons/VisionsOfAncientKings"));

        case CASTERBUFF.DIVINE_INTERVENTION: return(Resources.Load <Sprite>("CasterBuffsIcons/DivineIntervention"));

        case CASTERBUFF.BOOK_OF_PRIME_SHADOWS: return(Resources.Load <Sprite>("CasterBuffsIcons/BookOfPrimeShadows"));

        case CASTERBUFF.HAND_OF_LIGHT: return(Resources.Load <Sprite>("TalentIcons/HandOfLight"));

        case CASTERBUFF.CONSECRATION: return(Resources.Load <Sprite>("TalentIcons/Consecration"));

        case CASTERBUFF.FLASH_OF_FUTURE_FAITH: return(Resources.Load <Sprite>("CasterBuffsIcons/FlashOfFutureFaith"));

        case CASTERBUFF.FLASH_OF_FUTURE_LIGHT: return(Resources.Load <Sprite>("CasterBuffsIcons/FlashOfFutureLight"));

        default: return(Resources.Load <Sprite>("CasterBuffsIcons/VisionsOfAncientKings"));
        }
    }
Пример #5
0
    public void BuffMe(CASTERBUFF bufftype, float buffdur, Caster _caster, int startingStacks = 1)
    {
        CasterBuff myBuff = FindBuff(bufftype);

        if (myBuff == null)
        {
            Buffs[BuffsAmount]        = new CasterBuff(bufftype, buffdur, _caster);
            Buffs[BuffsAmount].stacks = startingStacks;

            Buffs[BuffsAmount].icon = Object.Instantiate(Resources.Load("CasterBuffIcon"), basePos + new Vector3(0.25f * BuffsAmount, 0, 0), GameCore.zero) as GameObject;
            //Buffs[BuffsAmount].myText = Object.Instantiate(Resources.Load("BuffDurationText"), basePos + new Vector3(0.1f + 0.25f * BuffsAmount, -0.1f, -1), GameCore.zero) as GameObject;
            Buffs[BuffsAmount].icon.GetComponent <Image>().sprite = CasterBuff.GetCasterBuffResource(bufftype);
            Buffs[BuffsAmount].icon.transform.SetParent(GameObject.Find("Canvas").transform);
            Buffs[BuffsAmount].icon.transform.localScale             = new Vector3(1, 1, 1);
            Buffs[BuffsAmount].icon.GetComponent <BuffScript>().myid = BuffsAmount;

            BuffsAmount++;
        }
        else
        {
            myBuff.Refresh(0);
        }
    }
Пример #6
0
 public void ExecuteBuff(CASTERBUFF bufftype, int buffid)
 {
     Buffs[buffid].Update();
 }