public override void Load(Imbue imbue) { if (imbue.colliderGroup.collisionHandler.item is Item item && item.itemId == itemId && (item.GetComponent <DaggerBehaviour>()?.CanImbue(null) ?? true)) { Player.currentCreature.mana.ConsumeMana(IMBUE_MANA_AMOUNT); item.gameObject.GetOrAddComponent <DaggerBehaviour>(); base.Load(imbue); }
public static IEnumerator TransferDeltaEnergy(Imbue itemImbue, SpellCastCharge activeSpell, float energyDelta = 20.0f, int counts = 5) { for (int i = 0; i < counts; i++) { try { itemImbue.Transfer(activeSpell, energyDelta); } catch { } yield return(new WaitForSeconds(0.01f)); } yield return(null); }
public override void Load(Imbue imbue) { if (imbue.colliderGroup.collisionHandler.item == summonedDagger) { return; } base.Load(imbue); TrackingHandler handler = imbue.colliderGroup.collisionHandler.item.gameObject.AddComponent <TrackingHandler>(); handler.imbue = imbue; }
public void Load(ColliderGroupData colliderGroupData) { data = colliderGroupData.Clone() as ColliderGroupData; if (data.imbueType != ColliderGroupData.ImbueType.None) { imbue = this.gameObject.AddComponent <Imbue>(); } else if (imbue) { Destroy(imbue); } }
private void TryGetItemImbue() { try { if (item.imbues.Count > 0) { itemMainImbue = item.imbues[0]; } else { itemMainImbue = null; } } catch { Debug.LogError(string.Format("[Fisher-ImbuementController] Exception! Unable to Find/Set main Imbue for item {0}", item.name)); } }
private IEnumerator TransferDeltaEnergy(Imbue itemImbue, SpellCastCharge activeSpell, float energyDelta = 1.0f) { int counts = (int)Mathf.Round(200.0f / energyDelta); isActive = true; for (int i = 0; i < counts; i++) { try { itemImbue.Transfer(activeSpell, energyDelta); if (itemImbue.energy >= itemImbue.maxEnergy) { break; } } catch { } yield return(null); } isActive = false; yield return(null); }
private IEnumerator SafeChargeDrain(Imbue itemImbue, float energyDelta = 1.0f) { isActive = true; while (itemImbue.energy > 0.1f) { try { if (itemImbue.CanConsume(energyDelta)) { itemImbue.ConsumeInstant(energyDelta); } else if (itemImbue.CanConsume(itemImbue.energy - 0.1f)) { itemImbue.ConsumeInstant(itemImbue.energy - 0.1f); break; } } catch { } yield return(null); } isActive = false; yield return(null); }
public static bool IsImbuedForDPS(WoWItem item) { Imbue imb = GetImbue(item); return(imb == Imbue.Flametongue); }
public static string ToSpellName(this Imbue i) { return(i.ToString() + " Weapon"); }
public override void RestoreFromBundle(Bundle bundle) { base.RestoreFromBundle(bundle); enchantment = (Enchantment)bundle.Get(ENCHANTMENT); imbue = bundle.GetEnum <Imbue>(IMBUE); }