Beispiel #1
0
        public MonsterSkill(byte value, string name, IList <byte> bytes, MonsterSkill defaults, Context context)
        {
            Ability[] dummyAbilities = AllAbilities.GetDummyAbilities(context);

            Default = defaults;
            Name    = name;
            Value   = value;
            bool[] flags = PatcherLib.Utilities.Utilities.BooleansFromByteMSB(bytes[0]);
            Ability1    = dummyAbilities[flags[0] ? (bytes[1] + 0x100) : bytes[1]];
            Ability2    = dummyAbilities[flags[1] ? (bytes[2] + 0x100) : bytes[2]];
            Ability3    = dummyAbilities[flags[2] ? (bytes[3] + 0x100) : bytes[3]];
            Beastmaster = dummyAbilities[flags[3] ? (bytes[4] + 0x100) : bytes[4]];
        }
Beispiel #2
0
        public Job(Context context, byte value, string name, IList <byte> bytes, Job defaults)
        {
            Value      = value;
            Name       = name;
            ourContext = context;

            int equipEnd = context == Context.US_PSP ? 13 : 12;

            Ability[] dummyAbilities = AllAbilities.GetDummyAbilities(context);

            SkillSet        = context == Context.US_PSP ? SkillSet.PSPSkills[bytes[0]] : SkillSet.PSXSkills[bytes[0]];
            InnateA         = dummyAbilities[PatcherLib.Utilities.Utilities.BytesToUShort(bytes[1], bytes[2])];
            InnateB         = dummyAbilities[PatcherLib.Utilities.Utilities.BytesToUShort(bytes[3], bytes[4])];
            InnateC         = dummyAbilities[PatcherLib.Utilities.Utilities.BytesToUShort(bytes[5], bytes[6])];
            InnateD         = dummyAbilities[PatcherLib.Utilities.Utilities.BytesToUShort(bytes[7], bytes[8])];
            Equipment       = new Equipment(bytes.Sub(9, equipEnd), defaults == null ? null : defaults.Equipment, context);
            HPConstant      = bytes[equipEnd + 1];
            HPMultiplier    = bytes[equipEnd + 2];
            MPConstant      = bytes[equipEnd + 3];
            MPMultiplier    = bytes[equipEnd + 4];
            SpeedConstant   = bytes[equipEnd + 5];
            SpeedMultiplier = bytes[equipEnd + 6];
            PAConstant      = bytes[equipEnd + 7];
            PAMultiplier    = bytes[equipEnd + 8];
            MAConstant      = bytes[equipEnd + 9];
            MAMultiplier    = bytes[equipEnd + 10];
            Move            = bytes[equipEnd + 11];
            Jump            = bytes[equipEnd + 12];
            CEvade          = bytes[equipEnd + 13];
            PermanentStatus = new Statuses(bytes.Sub(equipEnd + 14, equipEnd + 18), defaults == null ? null : defaults.PermanentStatus);
            StatusImmunity  = new Statuses(bytes.Sub(equipEnd + 19, equipEnd + 23), defaults == null ? null : defaults.StatusImmunity);
            StartingStatus  = new Statuses(bytes.Sub(equipEnd + 24, equipEnd + 28), defaults == null ? null : defaults.StartingStatus);
            AbsorbElement   = new Elements(bytes[equipEnd + 29]);
            CancelElement   = new Elements(bytes[equipEnd + 30]);
            HalfElement     = new Elements(bytes[equipEnd + 31]);
            WeakElement     = new Elements(bytes[equipEnd + 32]);

            MPortrait = bytes[equipEnd + 33];
            MPalette  = bytes[equipEnd + 34];
            MGraphic  = bytes[equipEnd + 35];

            if (defaults != null)
            {
                Default = defaults;
                AbsorbElement.Default = defaults.AbsorbElement;
                CancelElement.Default = defaults.CancelElement;
                HalfElement.Default   = defaults.HalfElement;
                WeakElement.Default   = defaults.WeakElement;
            }
        }
Beispiel #3
0
        public SkillSet(byte value, IList <byte> bytes, Context context)
            : this(GetDummySkillSets(context)[value].Name, value)
        {
            List <bool> actions = new List <bool>(16);

            actions.AddRange(PatcherLib.Utilities.Utilities.BooleansFromByteMSB(bytes[0]));
            actions.AddRange(PatcherLib.Utilities.Utilities.BooleansFromByteMSB(bytes[1]));
            List <bool> theRest = new List <bool>(PatcherLib.Utilities.Utilities.BooleansFromByteMSB(bytes[2]));

            Actions = new Ability[16];
            TheRest = new Ability[6];

            for (int i = 0; i < 16; i++)
            {
                Actions[i] = AllAbilities.GetDummyAbilities(context)[(actions[i] ? (bytes[3 + i] + 0x100) : (bytes[3 + i]))];
            }
            for (int i = 0; i < 6; i++)
            {
                TheRest[i] = AllAbilities.GetDummyAbilities(context)[(theRest[i] ? (bytes[19 + i] + 0x100) : (bytes[19 + i]))];
            }
        }