public void CreateAbility() { NewAbility = null; NewAbility = new Ability(); NewAbility.abilityID = Guid.NewGuid(); FormRune newForm = ActiveFormRune; NewAbility.aFormRune = newForm.Clone(); NewAbility.aFormRune.rank = int.Parse(FormRuneRank.text); CastModeRune newCast = ActiveCastModeRune; NewAbility.aCastModeRune = newCast.Clone(); NewAbility.aCastModeRune.rank = int.Parse(CastModeRuneRank.text); SchoolRune newSchool = ActiveSchoolRune; NewAbility.aSchoolRune = newSchool.Clone(); NewAbility.aSchoolRune.rank = int.Parse(SchoolRuneRank.text); NewAbility.aEffectRunes = new List <EffectRune>(); if (ActiveEffectRune != null) { EffectRune newEffect = (EffectRune)Activator.CreateInstance(ActiveEffectRune.GetType()); newEffect.rank = int.Parse(EffectRuneRank.text); NewAbility.aEffectRunes.Add(newEffect); } NewAbility.initialized = true; NewAbility.harmful = true; abilitySlot.abilityInSlot = NewAbility; abilitySlot.abilityInSlot.NameSelf(); abilitySlot.slotImage.SetImage(NewAbility); }
internal void Construct(WorldAbility ability, Guid owner) { worldAbilityID = Guid.NewGuid(); abilityOwner = owner; wFormRune = ability.wFormRune; wEffectRunes = null; wSchoolRune = ability.wSchoolRune; abilityToTrigger = null; harmful = ability.harmful; helpful = ability.helpful; selfHarm = ability.selfHarm; }
public FormRune Clone() { FormRune temp = new FormRune(); temp.runeName = runeName; temp.runeDescription = runeDescription; temp.rank = rank; temp.harmful = harmful; temp.helpful = helpful; temp.selfHarm = selfHarm; temp.formRuneType = formRuneType; temp.formDamageMod = formDamageMod; return(temp); }
internal void Construct(Ability ability, Guid owner) { worldAbilityID = Guid.NewGuid(); abilityOwner = owner; wFormRune = ability.aFormRune; wEffectRunes = ability.aEffectRunes; wSchoolRune = ability.aSchoolRune; if (ability.abilityToTrigger != null && UtilityService.CanFormTriggerForm(wFormRune.formRuneType, ability.abilityToTrigger.aFormRune.formRuneType)) { abilityToTrigger = ability.abilityToTrigger; } else { abilityToTrigger = null; } harmful = ability.harmful; helpful = ability.helpful; selfHarm = ability.selfHarm; }