Beispiel #1
0
 public void ApplyCooldown(ASpell spell)
 {
     if (spell.Cooldown != 0)
     {
         AddLiveCooldown(spell);
     }
 }
Beispiel #2
0
    protected override void AddLiveCooldown(ASpell spell)
    {
        base.AddLiveCooldown(spell);
        ActionBarSlot slot = actionBar.GetSlotOfSpell(spell);

        slot.InstantiateCooldown(GetLiveCooldown(spell));
    }
Beispiel #3
0
    public override void StopPersistentEffect()
    {
        base.StopPersistentEffect();
        ASpell disintegrate = PlayerCharacter.instance.SpellcastingModule.ActivePlayerSpells[FindDisintegrationIndex()];

        PlayerCharacter.instance.SpellcastingModule.InstantSpellcastingModule.MakeSpellInstant(disintegrate, false);
    }
Beispiel #4
0
 public LiveSpellCooldown(ASpell spell)
 {
     Spell           = spell;
     CurrentCooldown = spell.Cooldown;
     if (spell.Cooldown == GlobalVariables.ETERNAL_COOLDOWN)
     {
         eternal = true;
     }
 }
 public bool IsSpellInstant(ASpell spell)
 {
     if (GetInstantSpell(spell) != null)
     {
         return(GetInstantSpell(spell).IsInstant);
     }
     else
     {
         return(false);
     }
 }
Beispiel #6
0
 protected LiveSpellCooldown GetLiveCooldown(ASpell spell)
 {
     foreach (LiveSpellCooldown lsc in allCooldowns)
     {
         if (lsc.Spell.Equals(spell))
         {
             return(lsc);
         }
     }
     return(null);
 }
 private SpellMadeInstant GetInstantSpell(ASpell playerSpell)
 {
     for (int i = 0; i < spells.Count; i++)
     {
         if (spells[i].Spell.Equals(playerSpell))
         {
             return(spells[i]);
         }
     }
     Debug.LogError("PlayerInstantSpellcasting:GetInstantSpell(ASpell playerSpell) didnt find a spell!");
     return(null);
 }
Beispiel #8
0
        public ASpell DeepCopy(
            IASpellGetter item,
            ASpell.TranslationMask?copyMask = null)
        {
            ASpell ret = (ASpell)((ASpellCommon)((IASpellGetter)item).CommonInstance() !).GetNew();

            ((ASpellSetterTranslationCommon)((IASpellGetter)ret).CommonSetterTranslationInstance() !).DeepCopyIn(
                item: ret,
                rhs: item,
                errorMask: null,
                copyMask: copyMask?.GetCrystal(),
                deepCopy: true);
            return(ret);
        }
Beispiel #9
0
        public ASpell DeepCopy(
            IASpellGetter item,
            ErrorMaskBuilder?errorMask,
            TranslationCrystal?copyMask = null)
        {
            ASpell ret = (ASpell)((ASpellCommon)((IASpellGetter)item).CommonInstance() !).GetNew();

            ((ASpellSetterTranslationCommon)((IASpellGetter)ret).CommonSetterTranslationInstance() !).DeepCopyIn(
                item: ret,
                rhs: item,
                errorMask: errorMask,
                copyMask: copyMask,
                deepCopy: true);
            return(ret);
        }
Beispiel #10
0
        public ASpell DeepCopy(
            IASpellGetter item,
            out ASpell.ErrorMask errorMask,
            ASpell.TranslationMask?copyMask = null)
        {
            var    errorMaskBuilder = new ErrorMaskBuilder();
            ASpell ret = (ASpell)((ASpellCommon)((IASpellGetter)item).CommonInstance() !).GetNew();

            ((ASpellSetterTranslationCommon)((IASpellGetter)ret).CommonSetterTranslationInstance() !).DeepCopyIn(
                ret,
                item,
                errorMask: errorMaskBuilder,
                copyMask: copyMask?.GetCrystal(),
                deepCopy: true);
            errorMask = ASpell.ErrorMask.Factory(errorMaskBuilder);
            return(ret);
        }
    private IEnumerator PlayCastingAnimationCoroutine(float castTime, ASpell spell)
    {
        isCasting = true;
        actionBar.GetSlotOfSpell(spell).TurnFrameYellow();
        GetComponent <PlayerAnimEvents>().AdjustCastingParticleSystemsToCastingSpeed(castTime);
        GetComponent <Animator>().SetFloat("castingSpeedMultiplier", (1f / castTime));
        GetComponent <Animator>().SetBool("casting", true);
        float cTime = 0f;

        while (cTime < castTime)
        {
            cTime += Time.deltaTime;
            yield return(null);
        }
        GetComponent <Animator>().SetBool("casting", false);
        GetComponent <Animator>().SetFloat("castingSpeedMultiplier", 1f);
        actionBar.GetSlotOfSpell(spell).TurnFrameBlack();
        isCasting = false;
    }
Beispiel #12
0
 public SpellMadeInstant(ASpell spell)
 {
     Spell = spell;
 }
Beispiel #13
0
 partial void PostDuplicate(ASpell obj, ASpell rhs, Func <FormKey> getNextFormKey, IList <(IMajorRecordCommon Record, FormKey OriginalFormKey)>?duplicatedRecords);
Beispiel #14
0
 public override object GetNew()
 {
     return(ASpell.GetNew());
 }
 public void MakeSpellInstant(ASpell spell, bool value)
 {
     GetInstantSpell(spell).IsInstant = value;
 }
 public void PlayOnlyCastingAnimation(float castTime, ASpell spell)
 {
     StartCoroutine(PlayCastingAnimationCoroutine(castTime, spell));
 }
Beispiel #17
0
 public void RemoveCooldown(ASpell spell)
 {
     RemoveLiveCooldown(GetLiveCooldown(spell));
 }
Beispiel #18
0
    public ActionBarSlot GetSlotOfSpell(ASpell spell)
    {
        int index = playerSpellcasting.ActivePlayerSpells.IndexOf(spell);

        return(actionBarGrid.transform.GetChild(index).GetComponent <ActionBarSlot>());
    }
Beispiel #19
0
 public bool CheckIfSpellOnCooldown(ASpell spell)
 {
     return(GetLiveCooldown(spell) != null);
 }
Beispiel #20
0
 protected virtual void AddLiveCooldown(ASpell spell)
 {
     allCooldowns.Add(new LiveSpellCooldown(spell));
 }