Пример #1
0
 public PerkEffect(PerkEffectHeader Header, SimpleSubrecord <Byte[]> EffectData, List <PerkCondition> Conditions, SimpleSubrecord <EntryPointFunctionType> EntryPointFunctionType, SimpleSubrecord <Byte[]> EntryPointFunctionData, SimpleSubrecord <String> ButtonLabel, SimpleSubrecord <NoYesShort> RunImmediately, EmbeddedScript Script, SubMarker EndMarker)
 {
     this.Header                 = Header;
     this.EffectData             = EffectData;
     this.Conditions             = Conditions;
     this.EntryPointFunctionType = EntryPointFunctionType;
     this.EntryPointFunctionData = EntryPointFunctionData;
     this.ButtonLabel            = ButtonLabel;
     this.RunImmediately         = RunImmediately;
     this.Script                 = Script;
     this.EndMarker              = EndMarker;
 }
Пример #2
0
 public PerkEffect()
 {
     Header = new PerkEffectHeader();
 }
Пример #3
0
        public override void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Header", false, out subEle))
            {
                if (Header == null)
                {
                    Header = new PerkEffectHeader();
                }

                Header.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EffectData", false, out subEle))
            {
                switch (Header.Type)
                {
                case PerkType.QuestStage:
                    EffectData = new PerkQuestStageData();
                    break;

                case PerkType.Ability:
                    EffectData = new PerkAbilityData();
                    break;

                case PerkType.EntryPoint:
                    EffectData = new PerkEntryPointData();
                    break;
                }

                EffectData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Conditions", false, out subEle))
            {
                if (Conditions == null)
                {
                    Conditions = new List <PerkCondition>();
                }

                foreach (XElement e in subEle.Elements())
                {
                    PerkCondition temp = new PerkCondition();
                    temp.ReadXML(e, master);
                    Conditions.Add(temp);
                }
            }
            if (ele.TryPathTo("EntryPoint/FunctionType", false, out subEle))
            {
                if (EntryPointFunctionType == null)
                {
                    EntryPointFunctionType = new SimpleSubrecord <EntryPointFunctionType>();
                }

                EntryPointFunctionType.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EntryPoint/FunctionData", false, out subEle))
            {
                switch (EntryPointFunctionType.Value)
                {
                case Enums.EntryPointFunctionType.None:
                    EntryPointFunctionData = new SimpleSubrecord <byte[]>();
                    break;

                case Enums.EntryPointFunctionType.Float:
                    EntryPointFunctionData = new SimpleSubrecord <float>();
                    break;

                case Enums.EntryPointFunctionType.FloatFloat:
                    EntryPointFunctionData = new EntryPointRandRange();
                    break;

                case Enums.EntryPointFunctionType.LeveledItem:
                    EntryPointFunctionData = new RecordReference();
                    break;

                case Enums.EntryPointFunctionType.Script:
                    EntryPointFunctionData = new SimpleSubrecord <byte[]>();
                    break;

                case Enums.EntryPointFunctionType.ActorValueMult:
                    EntryPointFunctionData = new EntryPointActorValMult();
                    break;
                }

                EntryPointFunctionData.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ButtonLabel", false, out subEle))
            {
                if (ButtonLabel == null)
                {
                    ButtonLabel = new SimpleSubrecord <String>();
                }

                ButtonLabel.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RunImmediately", false, out subEle))
            {
                if (RunImmediately == null)
                {
                    RunImmediately = new SimpleSubrecord <NoYesShort>();
                }

                RunImmediately.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Script", false, out subEle))
            {
                if (Script == null)
                {
                    Script = new EmbeddedScript();
                }

                Script.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("EndMarker", false, out subEle))
            {
                if (EndMarker == null)
                {
                    EndMarker = new SubMarker();
                }

                EndMarker.ReadXML(subEle, master);
            }
        }