コード例 #1
0
 public AbilityAttributes(string name, UInt16 offset, IList <byte> second, AbilityAttributes defaults)
     : this(name, offset, second)
 {
     if (defaults != null)
     {
         Default          = defaults;
         Elements.Default = defaults.Elements;
     }
 }
コード例 #2
0
        public static void Copy(AbilityAttributes source, AbilityAttributes destination)
        {
            destination.Range    = source.Range;
            destination.Effect   = source.Effect;
            destination.Vertical = source.Vertical;
            source.Elements.CopyTo(destination.Elements);
            destination.Formula           = source.Formula;
            destination.X                 = source.X;
            destination.Y                 = source.Y;
            destination.InflictStatus     = source.InflictStatus;
            destination.CT                = source.CT;
            destination.MPCost            = source.MPCost;
            destination.Blank6            = source.Blank6;
            destination.Blank7            = source.Blank7;
            destination.WeaponRange       = source.WeaponRange;
            destination.VerticalFixed     = source.VerticalFixed;
            destination.VerticalTolerance = source.VerticalTolerance;
            destination.WeaponStrike      = source.WeaponStrike;
            destination.Auto              = source.Auto;
            destination.TargetSelf        = source.TargetSelf;

            destination.HitEnemies      = source.HitEnemies;
            destination.HitAllies       = source.HitAllies;
            destination.Blank8          = source.Blank8;
            destination.FollowTarget    = source.FollowTarget;
            destination.RandomFire      = source.RandomFire;
            destination.LinearAttack    = source.LinearAttack;
            destination.ThreeDirections = source.ThreeDirections;
            destination.HitCaster       = source.HitCaster;

            destination.Reflect      = source.Reflect;
            destination.Arithmetick  = source.Arithmetick;
            destination.Silence      = source.Silence;
            destination.Mimic        = source.Mimic;
            destination.NormalAttack = source.NormalAttack;
            destination.Perservere   = source.Perservere;
            destination.ShowQuote    = source.ShowQuote;
            destination.AnimateMiss  = source.AnimateMiss;

            destination.CounterFlood         = source.CounterFlood;
            destination.CounterMagic         = source.CounterMagic;
            destination.Direct               = source.Direct;
            destination.Shirahadori          = source.Shirahadori;
            destination.RequiresSword        = source.RequiresSword;
            destination.RequiresMateriaBlade = source.RequiresMateriaBlade;
            destination.Evadeable            = source.Evadeable;
            destination.Targeting            = source.Targeting;
        }
コード例 #3
0
ファイル: Ability.cs プロジェクト: reddyashok257/FFTPatcher
        public Ability(string name, UInt16 offset, IList <byte> first, IList <byte> second, Context context)
            : this(name, offset, first, context)
        {
            IsNormal      = ((offset >= 0x000) && (offset <= 0x16F));
            IsItem        = ((offset >= 0x170) && (offset <= 0x17D));
            IsThrowing    = ((offset >= 0x17E) && (offset <= 0x189));
            IsJumping     = ((offset >= 0x18A) && (offset <= 0x195));
            IsCharging    = ((offset >= 0x196) && (offset <= 0x19D));
            IsArithmetick = ((offset >= 0x19E) && (offset <= 0x1A5));
            IsOther       = (offset >= 0x1A6);

            if (IsNormal)
            {
                Attributes = new AbilityAttributes(name, offset, second, context);
            }
            if (IsItem)
            {
                //ItemOffset = second[0];
                SetItemOffset(second[0], context);
            }
            if (IsThrowing)
            {
                Throwing = (ItemSubType)second[0];
            }
            if (IsJumping)
            {
                JumpHorizontal = second[0];
                JumpVertical   = second[1];
            }
            if (IsCharging)
            {
                ChargeCT    = second[0];
                ChargeBonus = second[1];
            }
            if (IsArithmetick)
            {
                ArithmetickSkill = second[0];
            }
            if (IsOther)
            {
                OtherID = second[0];
            }
        }
コード例 #4
0
ファイル: Ability.cs プロジェクト: Wi150nZ/lioneditor
        public Ability( string name, UInt16 offset, IList<byte> first, IList<byte> second )
            : this( name, offset, first )
        {
            IsNormal = ((offset >= 0x000) && (offset <= 0x16F));
            IsItem = ((offset >= 0x170) && (offset <= 0x17D));
            IsThrowing = ((offset >= 0x17E) && (offset <= 0x189));
            IsJumping = ((offset >= 0x18A) && (offset <= 0x195));
            IsCharging = ((offset >= 0x196) && (offset <= 0x19D));
            IsArithmetick = ((offset >= 0x19E) && (offset <= 0x1A5));
            IsOther = (offset >= 0x1A6);

            if( IsNormal )
            {
                Attributes = new AbilityAttributes( name, offset, second );
            }
            if( IsItem )
            {
                ItemOffset = second[0];
            }
            if( IsThrowing )
            {
                Throwing = (ItemSubType)second[0];
            }
            if( IsJumping )
            {
                JumpHorizontal = second[0];
                JumpVertical = second[1];
            }
            if( IsCharging )
            {
                ChargeCT = second[0];
                ChargeBonus = second[1];
            }
            if( IsArithmetick )
            {
                ArithmetickSkill = second[0];
            }
            if( IsOther )
            {
                OtherID = second[0];
            }
        }
コード例 #5
0
 public void CopyTo(AbilityAttributes destination)
 {
     Copy(this, destination);
 }
コード例 #6
0
ファイル: Ability.cs プロジェクト: xjamxx/FFTPatcher
        protected override void ReadXml(XmlReader reader)
        {
            reader.MoveToAttribute("Name");
            Name = reader.ReadContentAsString();
            reader.MoveToAttribute("Offset");
            Offset = (UInt16)reader.ReadContentAsInt();
            reader.MoveToElement();
            reader.ReadStartElement();

            JPCost      = (ushort)reader.ReadElementContentAsInt();
            LearnRate   = (byte)reader.ReadElementContentAsInt();
            AbilityType = (AbilityType)Enum.Parse(typeof(AbilityType), reader.ReadElementContentAsString(), true);
            LearnWithJP = reader.ReadElementContentAsBoolean();
            Action      = reader.ReadElementContentAsBoolean();
            LearnOnHit  = reader.ReadElementContentAsBoolean();
            Blank1      = reader.ReadElementContentAsBoolean();
            Unknown1    = reader.ReadElementContentAsBoolean();
            Unknown2    = reader.ReadElementContentAsBoolean();
            Unknown3    = reader.ReadElementContentAsBoolean();
            Blank2      = reader.ReadElementContentAsBoolean();
            Blank3      = reader.ReadElementContentAsBoolean();
            Blank4      = reader.ReadElementContentAsBoolean();
            Blank5      = reader.ReadElementContentAsBoolean();
            Unknown4    = reader.ReadElementContentAsBoolean();

            AIFlags = new AIFlags();
            ((IXmlSerializable)AIFlags).ReadXml(reader);

            IsNormal      = ((Offset >= 0x000) && (Offset <= 0x16F));
            IsItem        = ((Offset >= 0x170) && (Offset <= 0x17D));
            IsThrowing    = ((Offset >= 0x17E) && (Offset <= 0x189));
            IsJumping     = ((Offset >= 0x18A) && (Offset <= 0x195));
            IsCharging    = ((Offset >= 0x196) && (Offset <= 0x19D));
            IsArithmetick = ((Offset >= 0x19E) && (Offset <= 0x1A5));
            IsOther       = (Offset >= 0x1A6);
            bool IsReaction = Offset >= 422 && Offset <= 453;

            if (IsNormal || IsItem || IsReaction)
            {
                reader.MoveToAttribute("value");
                ushort effectIndex = (ushort)reader.ReadElementContentAsInt();
                reader.MoveToElement();
                reader.ReadStartElement();
                reader.ReadEndElement();

                if (IsItem)
                {
                    effectIndex &= (ushort)~ItemEffectPrefixValue;
                }

                Effect = FFTPatch.Context == Context.US_PSP ? Effect.PSPEffects[effectIndex] : Effect.PSXEffects[effectIndex];
            }

            if (IsNormal)
            {
                Attributes = new AbilityAttributes();
                ((IXmlSerializable)Attributes).ReadXml(reader);
            }
            else if (IsItem)
            {
                ItemOffset = (ushort)reader.ReadElementContentAsInt();
            }
            else if (IsThrowing)
            {
                Throwing = (ItemSubType)Enum.Parse(typeof(ItemSubType),
                                                   reader.ReadElementContentAsString(), true);
            }
            else if (IsJumping)
            {
                reader.ReadStartElement();
                JumpHorizontal = (byte)reader.ReadElementContentAsInt();
                JumpVertical   = (byte)reader.ReadElementContentAsInt();
                reader.ReadEndElement();
            }
            else if (IsCharging)
            {
                reader.ReadStartElement();
                ChargeCT    = (byte)reader.ReadElementContentAsInt();
                ChargeBonus = (byte)reader.ReadElementContentAsInt();
                reader.ReadEndElement();
            }
            else if (IsArithmetick)
            {
                ArithmetickSkill = (byte)reader.ReadElementContentAsInt();
            }
            else if (IsOther)
            {
                OtherID = (byte)reader.ReadElementContentAsInt();
            }
            else
            {
                throw new InvalidOperationException("Invalid item type");
            }


            reader.ReadEndElement();
        }
コード例 #7
0
 public void CopyTo( AbilityAttributes destination )
 {
     Copy( this, destination );
 }
コード例 #8
0
        public static void Copy( AbilityAttributes source, AbilityAttributes destination )
        {
            destination.Range = source.Range;
            destination.Effect = source.Effect;
            destination.Vertical = source.Vertical;
            source.Elements.CopyTo( destination.Elements );
            destination.Formula = source.Formula;
            destination.X = source.X;
            destination.Y = source.Y;
            destination.InflictStatus = source.InflictStatus;
            destination.CT = source.CT;
            destination.MPCost = source.MPCost;
            destination.Blank6 = source.Blank6;
            destination.Blank7 = source.Blank7;
            destination.WeaponRange = source.WeaponRange;
            destination.VerticalFixed = source.VerticalFixed;
            destination.VerticalTolerance = source.VerticalTolerance;
            destination.WeaponStrike = source.WeaponStrike;
            destination.Auto = source.Auto;
            destination.TargetSelf = source.TargetSelf;

            destination.HitEnemies = source.HitEnemies;
            destination.HitAllies = source.HitAllies;
            destination.Blank8 = source.Blank8;
            destination.FollowTarget = source.FollowTarget;
            destination.RandomFire = source.RandomFire;
            destination.LinearAttack = source.LinearAttack;
            destination.ThreeDirections = source.ThreeDirections;
            destination.HitCaster = source.HitCaster;

            destination.Reflect = source.Reflect;
            destination.Arithmetick = source.Arithmetick;
            destination.Silence = source.Silence;
            destination.Mimic = source.Mimic;
            destination.NormalAttack = source.NormalAttack;
            destination.Perservere = source.Perservere;
            destination.ShowQuote = source.ShowQuote;
            destination.AnimateMiss = source.AnimateMiss;

            destination.CounterFlood = source.CounterFlood;
            destination.CounterMagic = source.CounterMagic;
            destination.Direct = source.Direct;
            destination.Shirahadori = source.Shirahadori;
            destination.RequiresSword = source.RequiresSword;
            destination.RequiresMateriaBlade = source.RequiresMateriaBlade;
            destination.Evadeable = source.Evadeable;
            destination.Targeting = source.Targeting;
        }
コード例 #9
0
 public AbilityAttributes( string name, UInt16 offset, IList<byte> second, AbilityAttributes defaults )
     : this( name, offset, second )
 {
     if( defaults != null )
     {
         Default = defaults;
         Elements.Default = defaults.Elements;
     }
 }