public override void Compute(MagicCoreAttributes Attributes, MagicUserContext GlobalContext) { base.Compute(Attributes, GlobalContext); Attributes.CurrentSkill.CurrentSkillLevel.ListActivation[0].ListEffect.Add(new ChannelInternalManaEffect(MagicParams)); Attributes.CurrentSkill.CurrentSkillLevel.ListActivation[0].ListEffectTargetReal.Add(new List<AutomaticSkillTargetType>() { new EffectActivationExecuteOnly() }); }
public MagicSpell(string Name, IMagicUser Owner, MagicUserContext GlobalContext, Dictionary <string, MagicElement> DicMagicElement) { this.Name = Name; ListMagicSpell = new List <BaseAutomaticSkill>(); ListMagicCore = new List <MagicCore>(); this.GlobalContext = GlobalContext; this.GlobalContext.ActiveUser = Owner; this.GlobalContext.ActiveTarget = Owner; FileStream FS = new FileStream("Content/Spells/" + Name + ".pes", FileMode.Open, FileAccess.Read); BinaryReader BR = new BinaryReader(FS, Encoding.UTF8); int ListMagicCoreCount = BR.ReadInt32(); for (int C = 0; C < ListMagicCoreCount; ++C) { string NewMagicCoreName = BR.ReadString(); MagicCore NewMagicCore = (MagicCore)DicMagicElement[NewMagicCoreName].Copy(); NewMagicCore.Load(BR, DicMagicElement); ListMagicCore.Add(NewMagicCore); } FS.Close(); BR.Close(); }
public MagicSpell(IMagicUser Owner, IMagicUser Target) { ListMagicSpell = new List <BaseAutomaticSkill>(); ListMagicCore = new List <MagicCore>(); GlobalContext = new MagicUserContext(); GlobalContext.ActiveUser = Owner; GlobalContext.ActiveTarget = Target; }
public virtual void Compute(MagicCoreAttributes Attributes, MagicUserContext GlobalContext) { Attributes.TotalManaCost += ManaCost; foreach (MagicElement ActiveListMagicElement in ListLinkedMagicElement) { ActiveListMagicElement.Compute(Attributes, GlobalContext); } }
public MagicUserParams(MagicUserParams Clone) { GlobalContext = Clone.GlobalContext; LocalContext = new MagicUserContext(); LocalContext.ActiveUser = Clone.LocalContext.ActiveUser; LocalContext.ActiveTarget = Clone.LocalContext.ActiveTarget; CopyGlobalIntoLocal(); }
private BaseAutomaticSkill CreateSpell(BaseEffect CurrentSpell, MagicUserContext GlobalContext) { BaseAutomaticSkill NewSkill = BaseAutomaticSkill.CreateDummy(Name); //Insert a second activation use only for passive effects, should never have any requirement. Insert at 0 so they're processed before the spell requirements. NewSkill.CurrentSkillLevel.ListActivation.Insert(0, new BaseSkillActivation()); NewSkill.CurrentSkillLevel.ListActivation[1].ListEffect.Add(CurrentSpell); NewSkill.CurrentSkillLevel.ListActivation[1].ListEffectTargetReal.Add(new List <AutomaticSkillTargetType>() { new EffectActivationSelf(GlobalContext) }); return(NewSkill); }
public MagicSpell(MagicSpell Other, IMagicUser Owner) { Name = Other.Name; ListMagicSpell = new List <BaseAutomaticSkill>(); ListMagicCore = new List <MagicCore>(); GlobalContext = Other.GlobalContext; GlobalContext.ActiveUser = Owner; GlobalContext.ActiveTarget = Owner; for (int C = 0; C < Other.ListMagicCore.Count; ++C) { MagicCore NewMagicCore = (MagicCore)Other.ListMagicCore[C].Copy(); NewMagicCore.CopyElements(Other.ListMagicCore[C]); ListMagicCore.Add(NewMagicCore); } }
public override void Compute(MagicCoreAttributes Attributes, MagicUserContext GlobalContext) { IMagicUser OriginalUser = GlobalContext.ActiveUser; IMagicUser OriginalTarget = GlobalContext.ActiveTarget; Attributes.TotalManaCost += RequiredMana; MagicEffect SpellEffect = GetSpellEffect(); BaseAutomaticSkill BaseSkill = CreateSpell(SpellEffect, GlobalContext); GlobalContext.ActiveTarget = SpellEffect; //Linked magic cores are considered as following skills if (Attributes.CurrentSpell != null) { GlobalContext.ActiveUser = OriginalTarget; Attributes.CurrentSpell.ListFollowingSkill.Add(BaseSkill); BaseSkill.CurrentSkillLevel.ListActivation[1].ListRequirement.Add(new ManaChanneledRequirement(Attributes.TotalManaCost, MagicParams)); } else { BaseSkill.CurrentSkillLevel.ListActivation[1].ListRequirement.Add(new ManaChanneledRequirement(Attributes.TotalManaCost, MagicParams)); //Add a final effect that will empty the channeled mana on its own after every other effects are executed. BaseSkill.CurrentSkillLevel.ListActivation[1].ListEffect.Add(new EmptyChanneledManaEffect(MagicParams)); } Attributes.CurrentSkill = BaseSkill; Attributes.CurrentSpell = SpellEffect; foreach (MagicElement ActiveListMagicElement in ListLinkedMagicElement) { ActiveListMagicElement.Compute(Attributes, GlobalContext); Attributes.CurrentSkill = BaseSkill; Attributes.CurrentSpell = SpellEffect; } BaseSkill.CurrentSkillLevel.ListActivation[1].ListEffectTargetReal.Add(new List <AutomaticSkillTargetType>() { new EffectActivationExecuteOnly() }); GlobalContext.ActiveUser = OriginalUser; GlobalContext.ActiveTarget = OriginalTarget; }
public override void Compute(MagicCoreAttributes Attributes, MagicUserContext GlobalContext) { Attributes.CurrentSkill.CurrentSkillLevel.ListActivation[1].ListRequirement.Add(new TimeEllapsedRequirement(MagicParams, SecondsToWait)); }
public MagicUserParams(MagicUserContext GlobalContext) { this.GlobalContext = GlobalContext; LocalContext = new MagicUserContext(); }
public EffectActivationSelf(MagicUserContext GlobalContext) : base(Name) { this.GlobalContext = GlobalContext; }