public void ApplyCooldown(ASpell spell) { if (spell.Cooldown != 0) { AddLiveCooldown(spell); } }
protected override void AddLiveCooldown(ASpell spell) { base.AddLiveCooldown(spell); ActionBarSlot slot = actionBar.GetSlotOfSpell(spell); slot.InstantiateCooldown(GetLiveCooldown(spell)); }
public override void StopPersistentEffect() { base.StopPersistentEffect(); ASpell disintegrate = PlayerCharacter.instance.SpellcastingModule.ActivePlayerSpells[FindDisintegrationIndex()]; PlayerCharacter.instance.SpellcastingModule.InstantSpellcastingModule.MakeSpellInstant(disintegrate, false); }
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); } }
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); }
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); }
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); }
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; }
public SpellMadeInstant(ASpell spell) { Spell = spell; }
partial void PostDuplicate(ASpell obj, ASpell rhs, Func <FormKey> getNextFormKey, IList <(IMajorRecordCommon Record, FormKey OriginalFormKey)>?duplicatedRecords);
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)); }
public void RemoveCooldown(ASpell spell) { RemoveLiveCooldown(GetLiveCooldown(spell)); }
public ActionBarSlot GetSlotOfSpell(ASpell spell) { int index = playerSpellcasting.ActivePlayerSpells.IndexOf(spell); return(actionBarGrid.transform.GetChild(index).GetComponent <ActionBarSlot>()); }
public bool CheckIfSpellOnCooldown(ASpell spell) { return(GetLiveCooldown(spell) != null); }
protected virtual void AddLiveCooldown(ASpell spell) { allCooldowns.Add(new LiveSpellCooldown(spell)); }