Ejemplo n.º 1
0
        public PowerEntry(int iLevel = -1, IPower power = null, bool chosen = false)
        {
            StatInclude = false;
            Level       = iLevel;
            Chosen      = chosen;
            if (power != null)
            {
                NIDPowerset = power.PowerSetID;
                IDXPower    = power.PowerSetIndex;
                NIDPower    = power.PowerIndex;
                if (power.NIDSubPower.Length > 0)
                {
                    SubPowers = new PowerSubEntry[power.NIDSubPower.Length];
                    for (var index = 0; index <= SubPowers.Length - 1; ++index)
                    {
                        SubPowers[index] = new PowerSubEntry
                        {
                            nIDPower = power.NIDSubPower[index]
                        };
                        SubPowers[index].Powerset = DatabaseAPI.Database.Power[SubPowers[index].nIDPower].PowerSetID;
                        SubPowers[index].Power    = DatabaseAPI.Database.Power[SubPowers[index].nIDPower].PowerSetIndex;
                    }
                }
                else
                {
                    SubPowers = new PowerSubEntry[0];
                }

                if (power.Slottable & (power.GetPowerSet().GroupName != "Incarnate"))
                {
                    Slots = new SlotEntry[1];
                    Slots[0].Enhancement        = new I9Slot();
                    Slots[0].FlippedEnhancement = new I9Slot();
                    Slots[0].Level = iLevel;
                }
                else
                {
                    Slots = new SlotEntry[0];
                }

                if (power.AlwaysToggle | (power.PowerType == Enums.ePowerType.Auto_))
                {
                    StatInclude = true;
                }
            }
            else
            {
                IDXPower    = -1;
                NIDPowerset = -1;
                NIDPower    = -1;
                Slots       = new SlotEntry[0];
                SubPowers   = new PowerSubEntry[0];
            }

            Tag           = false;
            VariableValue = 0;
            ProcInclude   = false;
        }
Ejemplo n.º 2
0
        public int AddSlot(int iLevel)
        {
            int num1;

            if ((Slots.Length > 5) | !DatabaseAPI.Database.Power[NIDPower].Slottable)
            {
                num1 = -1;
            }
            else
            {
                int index1;
                if (Slots.Length == 0)
                {
                    Slots  = new SlotEntry[1];
                    index1 = 0;
                }
                else
                {
                    var num2 = 0;
                    for (var index2 = 1; index2 < Slots.Length; ++index2)
                    {
                        if (Slots[index2].Level <= iLevel)
                        {
                            num2 = index2;
                        }
                    }
                    index1 = num2 + 1;
                    var slotEntryArray = new SlotEntry[Slots.Length + 1];
                    var index3         = -1;
                    for (var index2 = 0; index2 < slotEntryArray.Length; ++index2)
                    {
                        if (index2 == index1)
                        {
                            continue;
                        }
                        ++index3;
                        slotEntryArray[index2].Assign(Slots[index3]);
                    }

                    Slots = new SlotEntry[slotEntryArray.Length];
                    for (var index2 = 0; index2 < Slots.Length; ++index2)
                    {
                        if (index2 != index1)
                        {
                            Slots[index2].Assign(slotEntryArray[index2]);
                        }
                    }
                }

                Slots[index1].Enhancement        = new I9Slot();
                Slots[index1].FlippedEnhancement = new I9Slot();
                Slots[index1].Level = iLevel;
                num1 = index1;
            }

            return(num1);
        }
Ejemplo n.º 3
0
 public void Reset()
 {
     NIDPowerset = -1;
     IDXPower    = -1;
     NIDPower    = -1;
     Tag         = false;
     StatInclude = false;
     ProcInclude = false;
     SubPowers   = new PowerSubEntry[0];
     if (Slots.Length != 1 || Slots[0].Enhancement.Enh != -1)
     {
         return;
     }
     Slots = new SlotEntry[0];
 }
Ejemplo n.º 4
0
        public PowerEntry(IPower power)
        {
            StatInclude = false;
            Level       = -1;
            if (power == null)
            {
                IDXPower    = -1;
                NIDPowerset = -1;
                NIDPower    = -1;
            }
            else
            {
                IDXPower    = power.PowerSetIndex;
                NIDPower    = power.PowerIndex;
                NIDPowerset = power.PowerSetID;
            }

            Tag           = false;
            Slots         = new SlotEntry[0];
            SubPowers     = new PowerSubEntry[0];
            VariableValue = 0;
            ProcInclude   = false;
        }
Ejemplo n.º 5
0
        public void Assign(PowerEntry iPe)
        {
            Level         = iPe.Level;
            NIDPowerset   = iPe.NIDPowerset;
            IDXPower      = iPe.IDXPower;
            NIDPower      = iPe.NIDPower;
            Tag           = iPe.Tag;
            StatInclude   = iPe.StatInclude;
            VariableValue = iPe.VariableValue;
            ProcInclude   = iPe.ProcInclude;
            if (iPe.Slots != null)
            {
                Slots = new SlotEntry[iPe.Slots.Length];
                for (var index = 0; index <= Slots.Length - 1; ++index)
                {
                    Slots[index].Assign(iPe.Slots[index]);
                }
            }
            else
            {
                Slots = new SlotEntry[0];
            }

            if (iPe.SubPowers != null)
            {
                SubPowers = new PowerSubEntry[iPe.SubPowers.Length];
                for (var index = 0; index <= SubPowers.Length - 1; ++index)
                {
                    SubPowers[index].Assign(iPe.SubPowers[index]);
                }
            }
            else
            {
                SubPowers = new PowerSubEntry[0];
            }
        }