Example #1
0
    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);
    }
Example #2
0
    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;
    }
Example #3
0
    public SchoolRune Clone()
    {
        SchoolRune temp = new SchoolRune();

        temp.runeName        = runeName;
        temp.runeDescription = runeDescription;
        temp.rank            = rank;
        temp.harmful         = harmful;
        temp.helpful         = helpful;
        temp.selfHarm        = selfHarm;
        temp.schoolRuneType  = schoolRuneType;
        return(temp);
    }
Example #4
0
    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;
    }