Exemplo n.º 1
0
    public static Boolean UpdateAbilitiesAchievement(Int32 abilId, Boolean autoReport)
    {
        Boolean flag = false;

        if (abilId == 0)
        {
            return(flag);
        }
        if (abilId < 192)
        {
            if (!FF9StateSystem.Achievement.abilities.Contains(abilId))
            {
                FF9StateSystem.Achievement.abilities.Add(abilId);
                flag = true;
            }
        }
        else
        {
            if (!FF9StateSystem.Achievement.abilities.Contains(abilId))
            {
                FF9StateSystem.Achievement.abilities.Add(abilId);
                flag = true;
            }
            if (!FF9StateSystem.Achievement.passiveAbilities.Contains(abilId))
            {
                FF9StateSystem.Achievement.passiveAbilities.Add(abilId);
                flag = true;
            }
        }
        if (autoReport && flag)
        {
            BattleAchievement.SendAbilitiesAchievement();
        }
        return(flag);
    }
Exemplo n.º 2
0
    public Boolean partyadd(Int64 a)
    {
        Int64 num = 0;

        if (!this.partychk((Int32)a))
        {
            a = this.chr2slot((Int32)a);
            if (a >= 0L && a < 9L)
            {
                Int64 index = 0;
                while (index < 4L && this._ff9.party.member[index] != null)
                {
                    ++index;
                }
                num = index < 4L ? 0L : 1L;
                if (num == 0L)
                {
                    ff9play.FF9Play_SetParty((Int32)index, (Int32)a);
                    BattleAchievement.UpdateParty();
                    this.SetupPartyUID();
                }
            }
            else
            {
                num = 1L;
            }
        }
        return(num != 0L);
    }
Exemplo n.º 3
0
    private void DisplayLevelup(Int32 index)
    {
        PLAYER player = FF9StateSystem.Common.FF9.party.member[index];

        BattleAchievement.GetReachLv99Achievement((Int32)(player.level + 1));
        ff9play.FF9Play_GrowLevel((Int32)player.info.slot_no, (Int32)(player.level + 1));
        this.totalLevelUp[index]++;
        this.ShowLevelUpAnimation(index);
    }
Exemplo n.º 4
0
    public static void UpdateEndBattleAchievement()
    {
        Int32       battleMapIndex = FF9StateSystem.Battle.battleMapIndex;
        BTL_SCENE   btl_scene      = FF9StateSystem.Battle.FF9Battle.btl_scene;
        SB2_PATTERN sb2_PATTERN    = btl_scene.PatAddr[(Int32)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum];

        BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.enemy_no, (Int32)sb2_PATTERN.MonCount);
        AchievementManager.ReportAchievement(AcheivementKey.Defeat100, BattleAchievement.achievement.enemy_no);
        AchievementManager.ReportAchievement(AcheivementKey.Defeat1000, BattleAchievement.achievement.enemy_no);
        AchievementManager.ReportAchievement(AcheivementKey.Defeat10000, BattleAchievement.achievement.enemy_no);
        if (battleMapIndex == 932)
        {
            AchievementManager.ReportAchievement(AcheivementKey.DefeatMaliris, 1);
        }
        else if (battleMapIndex == 933)
        {
            AchievementManager.ReportAchievement(AcheivementKey.DefeatTiamat, 1);
        }
        else if (battleMapIndex == 934)
        {
            AchievementManager.ReportAchievement(AcheivementKey.DefeatKraken, 1);
        }
        else if (battleMapIndex == 935)
        {
            AchievementManager.ReportAchievement(AcheivementKey.DefeatLich, 1);
        }
        else if (battleMapIndex == 211 || battleMapIndex == 57)
        {
            AchievementManager.ReportAchievement(AcheivementKey.DefeatOzma, 1);
        }
        else if (battleMapIndex == 634 || battleMapIndex == 627 || battleMapIndex == 755 || battleMapIndex == 753)
        {
            Int32 varManually = PersistenSingleton <EventEngine> .Instance.eBin.getVarManually(50900);

            Int32 num  = varManually >> 3 & 31;
            Int32 num2 = num * 100 / 16;
            if (num2 >= 100)
            {
                AchievementManager.ReportAchievement(AcheivementKey.AllOX, 1);
            }
        }
        else if (battleMapIndex == 920 || battleMapIndex == 921)
        {
            Int32 varManually2 = PersistenSingleton <EventEngine> .Instance.eBin.getVarManually(405732);

            if (varManually2 == 1)
            {
                AchievementManager.ReportAchievement(AcheivementKey.YanBlessing, 1);
            }
        }
        else if (battleMapIndex == 339 && BattleAchievement.IsChallengingPlayerIsGarnet())
        {
            AchievementManager.ReportAchievement(AcheivementKey.DefeatBehemoth, 1);
        }
    }
Exemplo n.º 5
0
    public override void Hide(SceneVoidDelegate afterFinished = null)
    {
        SceneVoidDelegate sceneVoidDelegate = delegate
        {
            SceneDirector.FF9Wipe_FadeInEx(12);
        };

        if (afterFinished != null)
        {
            sceneVoidDelegate = (SceneVoidDelegate)Delegate.Combine(sceneVoidDelegate, afterFinished);
        }
        base.Hide(sceneVoidDelegate);
        BattleAchievement.UpdateParty();
        this.RemoveCursorMemorize();
    }
Exemplo n.º 6
0
        public static Byte StartType(BTL_SCENE_INFO info)
        {
            Byte num1 = 2;

            if (info.SpecialStart != 0)
            {
                if (info.BackAttack != 0)
                {
                    num1 = 0;
                }
            }
            else
            {
                Byte num2 = 24;
                if (btl_abil.CheckPartyAbility(1U, 512U))
                {
                    num2 = 0;
                }
                else if (info.BackAttack != 0)
                {
                    num2 = Byte.MaxValue;
                }
                if (Comn.random8() < num2)
                {
                    num1 = 0;
                }
                else
                {
                    Byte num3 = 16;
                    if (btl_abil.CheckPartyAbility(1U, 1024U))
                    {
                        num3 = 85;
                    }
                    if (Comn.random8() < num3)
                    {
                        num1 = 1;
                    }
                }
            }
            if (num1 == 0)
            {
                BattleAchievement.UpdateBackAttack();
            }
            return(num1);
        }
Exemplo n.º 7
0
        public static UInt32 ManageBattleEnd(FF9StateBattleSystem btlsys)
        {
            FF9StateGlobal       ff9       = FF9StateSystem.Common.FF9;
            FF9StateBattleSystem ff9Battle = FF9StateSystem.Battle.FF9Battle;

            switch (ff9.btl_result)
            {
            case 3:
            case 6:
                if (btlsys.btl_scene.Info.NoGameOver == 0)
                {
                    ff9.btl_result = 6;
                    break;
                }
                for (BTL_DATA next = ff9Battle.btl_list.next; next != null; next = next.next)
                {
                    if (next.bi.player != 0)
                    {
                        SavePlayerData(next, false);
                    }
                }
                break;

            default:
                if (ff9.btl_result == 1 || ff9.btl_result == 2)
                {
                    BattleAchievement.UpdateEndBattleAchievement();
                }
                for (BTL_DATA next = ff9Battle.btl_list.next; next != null; next = next.next)
                {
                    if (next.bi.player != 0)
                    {
                        SavePlayerData(next, false);
                    }
                }
                break;
            }
            return(1);
        }
Exemplo n.º 8
0
    public void SetMasterSkill()
    {
        if (!IsMasterSkill)
        {
            return;
        }
        bool flag = false;

        for (int index1 = 0; index1 < 9; ++index1)
        {
            PLAYER player = FF9StateSystem.Common.FF9.player[index1];
            foreach (FF9ITEM ff9Item in FF9StateSystem.Common.FF9.item)
            {
                if (ff9Item.count > 0 && ff9item.FF9Item_GetEquipPart(ff9Item.id) > -1)
                {
                    foreach (byte num in ff9item._FF9Item_Data[ff9Item.id].ability)
                    {
                        int index2 = ff9abil.FF9Abil_GetIndex(player.info.slot_no, num);
                        if (index2 > -1)
                        {
                            player.pa[index2] = (byte)ff9abil.FF9Abil_GetMax(player.info.slot_no, num);
                            if (BattleAchievement.UpdateAbilitiesAchievement(num, false))
                            {
                                flag = true;
                            }
                        }
                    }
                }
            }
            for (int index2 = 0; index2 < 5; ++index2)
            {
                byte num1 = player.equip[index2];
                if (num1 != byte.MaxValue)
                {
                    foreach (byte num2 in ff9item._FF9Item_Data[num1].ability)
                    {
                        int index3 = ff9abil.FF9Abil_GetIndex(player.info.slot_no, num2);
                        if (index3 > -1)
                        {
                            player.pa[index3] = (byte)ff9abil.FF9Abil_GetMax(player.info.slot_no, num2);
                            if (BattleAchievement.UpdateAbilitiesAchievement(num2, false))
                            {
                                flag = true;
                            }
                        }
                    }
                }
            }
            if (player.info.serial_no == 9)
            {
                foreach (PA_DATA paData in ff9abil._FF9Abil_PaData[player.info.menu_type])
                {
                    if (paData.id != 0 && paData.id < 192)
                    {
                        int index2 = ff9abil.FF9Abil_GetIndex(player.info.slot_no, paData.id);
                        player.pa[index2] = paData.max_ap;
                        if (BattleAchievement.UpdateAbilitiesAchievement(paData.id, false))
                        {
                            flag = true;
                        }
                    }
                }
            }
        }
        if (!flag)
        {
            return;
        }
        BattleAchievement.SendAbilitiesAchievement();
    }
Exemplo n.º 9
0
 public static void RaiseAbilitiesAchievement(Int32 abilityId)
 {
     BattleAchievement.UpdateAbilitiesAchievement(abilityId, true);
 }
Exemplo n.º 10
0
    public static void UpdateCommandAchievement(CMD_DATA cmd)
    {
        Byte cmd_no = cmd.cmd_no;

        if (cmd_no == 4)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.defence_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.Defense50, BattleAchievement.achievement.defence_no);
        }
        else if (cmd_no == 22 || cmd_no == 23)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.blkMag_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.BlkMag100, BattleAchievement.achievement.blkMag_no);
        }
        else if (cmd_no == 17 || cmd_no == 19 || cmd_no == 21)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.whtMag_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.WhtMag200, BattleAchievement.achievement.whtMag_no);
        }
        else if (cmd_no == 24)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.bluMag_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.BluMag100, BattleAchievement.achievement.bluMag_no);
        }
        else if (cmd_no == 16 || cmd_no == 18 || cmd_no == 20)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.summon_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.Summon50, BattleAchievement.achievement.summon_no);
            if (cmd.sub_no == 49)
            {
                BattleAchievement.achievement.summon_shiva = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonShiva, 1);
            }
            else if (cmd.sub_no == 51)
            {
                BattleAchievement.achievement.summon_ifrit = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonIfrit, 1);
            }
            else if (cmd.sub_no == 53)
            {
                BattleAchievement.achievement.summon_ramuh = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonRamuh, 1);
            }
            else if (cmd.sub_no == 55)
            {
                BattleAchievement.achievement.summon_atomos = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonAtomos, 1);
            }
            else if (cmd.sub_no == 58)
            {
                BattleAchievement.achievement.summon_odin = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonOdin, 1);
            }
            else if (cmd.sub_no == 60)
            {
                BattleAchievement.achievement.summon_leviathan = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonLeviathan, 1);
            }
            else if (cmd.sub_no == 62)
            {
                BattleAchievement.achievement.summon_bahamut = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonBahamut, 1);
            }
            else if (cmd.sub_no == 64)
            {
                BattleAchievement.achievement.summon_arc = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonArk, 1);
            }
            else if (cmd.sub_no == 68 || cmd.sub_no == 69 || cmd.sub_no == 70 || cmd.sub_no == 71)
            {
                if (cmd.sub_no == 68)
                {
                    BattleAchievement.achievement.summon_carbuncle_haste = true;
                }
                else if (cmd.sub_no == 69)
                {
                    BattleAchievement.achievement.summon_carbuncle_protect = true;
                }
                else if (cmd.sub_no == 70)
                {
                    BattleAchievement.achievement.summon_carbuncle_reflector = true;
                }
                else if (cmd.sub_no == 71)
                {
                    BattleAchievement.achievement.summon_carbuncle_shell = true;
                }
                AchievementManager.ReportAchievement(AcheivementKey.SummonCarbuncle, 1);
            }
            else if (cmd.sub_no == 66 || cmd.sub_no == 67)
            {
                if (cmd.sub_no == 66)
                {
                    BattleAchievement.achievement.summon_fenrir_earth = true;
                }
                else if (cmd.sub_no == 67)
                {
                    BattleAchievement.achievement.summon_fenrir_wind = true;
                }
                AchievementManager.ReportAchievement(AcheivementKey.SummonFenrir, 1);
            }
            else if (cmd.sub_no == 72)
            {
                BattleAchievement.achievement.summon_phoenix = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonPhoenix, 1);
            }
            else if (cmd.sub_no == 74)
            {
                BattleAchievement.achievement.summon_madeen = true;
                AchievementManager.ReportAchievement(AcheivementKey.SummonMadeen, 1);
            }
        }
        else if (cmd_no == 2)
        {
            Int32 totalProgress = BattleAchievement.achievement.increaseStealCount();
            AchievementManager.ReportAchievement(AcheivementKey.Steal50, totalProgress);
        }
        else if (cmd_no == 58)
        {
            AchievementManager.ReportAchievement(AcheivementKey.RebirthFlame, 1);
        }
    }
Exemplo n.º 11
0
 public static void UpdateTranceStatus()
 {
     BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.trance_no, 1);
     AchievementManager.ReportAchievement(AcheivementKey.Trance1, BattleAchievement.achievement.trance_no);
     AchievementManager.ReportAchievement(AcheivementKey.Trance50, BattleAchievement.achievement.trance_no);
 }
Exemplo n.º 12
0
 public static void UpdateBackAttack()
 {
     BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.backAtk_no, 1);
     AchievementManager.ReportAchievement(AcheivementKey.BackAttack30, BattleAchievement.achievement.backAtk_no);
 }
Exemplo n.º 13
0
 public static void CheckCommandLoop(CMD_DATA cmd)
 {
     if (!SFX.isRunning)
     {
         BTL_DATA btlData = cmd.regist;
         if (!FF9StateSystem.Battle.isDebug && (UIManager.Battle.BtlWorkLibra || UIManager.Battle.BtlWorkPeep))
         {
             return;
         }
         if (cmd.cmd_no == 4)
         {
             if (btl_mot.checkMotion(btlData, 12))
             {
                 if (btlData.evt.animFrame < GeoAnim.geoAnimGetNumFrames(btlData))
                 {
                     return;
                 }
                 btl_mot.setMotion(btlData, 13);
                 btlData.evt.animFrame = 0;
             }
         }
         else if (cmd.cmd_no == 7)
         {
             if (btl_mot.checkMotion(btlData, 9))
             {
                 if (btlData.evt.animFrame < GeoAnim.geoAnimGetNumFrames(btlData, btlData.currentAnimationName))
                 {
                     return;
                 }
                 btl_mot.setMotion(btlData, (byte)(29U + btlData.bi.row));
                 btlData.evt.animFrame = 0;
             }
             if (btl_mot.checkMotion(btlData, (byte)(29U + btlData.bi.row)))
             {
                 ushort numFrames = GeoAnim.geoAnimGetNumFrames(btlData);
                 ushort num1      = btlData.evt.animFrame;
                 if (num1 < numFrames)
                 {
                     ushort num2 = (ushort)(num1 + 1U);
                     btlData.pos[2] = btlData.bi.row == 0 ? 400 * num2 / numFrames - 1960 : -400 * num2 / numFrames - 1560;
                     btlData.gameObject.transform.localPosition = btlData.pos;
                     return;
                 }
                 ExecVfxCommand(btlData);
                 btl_mot.setMotion(btlData, 32);
                 btlData.evt.animFrame = 0;
                 return;
             }
             if (btl_mot.checkMotion(btlData, 32))
             {
                 if (btlData.evt.animFrame < GeoAnim.geoAnimGetNumFrames(btlData))
                 {
                     return;
                 }
                 btl_mot.setMotion(btlData, 0);
                 btlData.evt.animFrame = 0;
             }
         }
         BattleAchievement.UpdateCommandAchievement(cmd);
         ReqFinishCommand();
         if (cmd.cmd_no != 59)
         {
             return;
         }
         btl_stat.SetPresentColor(btlData);
     }
     else
     {
         if (cmd.cmd_no != 59 || SFX.frameIndex != 75)
         {
             return;
         }
         BTL_DATA btl = cmd.regist;
         if (Status.checkCurStat(btl, 16384U))
         {
             btl_vfx.SetTranceModel(btl, true);
             BattleAchievement.UpdateTranceStatus();
         }
         else
         {
             btl_vfx.SetTranceModel(btl, false);
         }
     }
 }
Exemplo n.º 14
0
 private void ApLearned(Int32 id, Int32 abilId)
 {
     FF9Sfx.FF9SFX_Play(1043);
     this.abilityLearned[id].Add(abilId);
     BattleAchievement.UpdateAbilitiesAchievement(abilId, true);
 }
Exemplo n.º 15
0
    public static UInt32 AlterStatus(BTL_DATA btl, UInt32 status)
    {
        BattleUnit unit = new BattleUnit(btl);

        STAT_DATA[] statusData = FF9StateSystem.Battle.FF9Battle.status_data;
        STAT_INFO   stat       = btl.stat;
        UInt32      statTblNo  = 0;

        if (((Int32)stat.invalid & (Int32)status) != 0)
        {
            return(0);
        }
        if (((Int32)stat.permanent & (Int32)status) != 0 || ((Int32)stat.cur & (Int32)status) != 0 && ((Int32)status & -2013200513) != 0)
        {
            return(1);
        }
        UInt32 num1 = 0;
        UInt32 num2 = 0;

        for (; num1 < 32U; ++num1)
        {
            UInt32 num3 = 1U << (Int32)num1;
            if (((Int32)status & (Int32)num3) != 0)
            {
                statTblNo = num1;
            }
            if (((Int32)stat.cur & (Int32)num3) != 0)
            {
                num2 |= statusData[num1].invalid;
            }
        }
        if (btl_cmd.CheckSpecificCommand(btl, 62))
        {
            num2 |= statusData[0].invalid;
        }
        if (((Int32)num2 & (Int32)status) != 0)
        {
            return(1);
        }
        if (((Int32)status & 270008321) == 0)
        {
            if (((Int32)status & 134403) != 0)
            {
                StatusCommandCancel(btl, status);
            }
            stat.cur |= status;
        }
        UInt32 num4 = statTblNo;

        switch (num4)
        {
        case 6:
            if (unit.IsPlayer && !unit.IsUnderStatus(BattleStatus.Trance))
            {
                unit.Trance = 0;
            }

            SetStatusPolyColor(btl);
            break;

        case 8:
            if (unit.CurrentHp > 0)
            {
                btl.fig_info |= 64;
                new BattleUnit(btl).Kill();
            }
            else
            {
                unit.CurrentHp = 0;
            }

            unit.CurrentAtb = 0;

            if (!btl_cmd.CheckUsingCommand(btl.cmd[2]))
            {
                btl_cmd.SetCommand(btl.cmd[2], 60U, 0U, btl.btl_id, 0U);
                if (!unit.IsPlayer)
                {
                    btl_sys.CheckForecastMenuOff(btl);
                }
            }

            btl_cmd.KillSpecificCommand(btl, 59);
            break;

        case 11:
        case 24:
        case 25:
            SetStatusPolyColor(btl);
            break;

        case 12:
            btl_sys.CheckBattlePhase(btl);
            break;

        case 14:
            btl_cmd.SetCommand(btl.cmd[4], 59U, 0U, btl.btl_id, 0U);
            break;

        case 17:
            if (unit.IsPlayer && !btl_mot.checkMotion(btl, 1) && !btl_util.isCurCmdOwner(btl))
            {
                btl_mot.setMotion(btl, 1);
                btl.evt.animFrame = 0;
            }
            break;

        case 19:
            if (Status.checkCurStat(btl, 1048576U))
            {
                RemoveStatus(btl, 1048576U);
                return(2);
            }
            btl_para.InitATB(btl);
            btl.cur.at_coef = (SByte)(btl.cur.at_coef * 3 / 2);
            stat.cur       |= status;
            break;

        case 20:
            if (Status.checkCurStat(btl, 524288U))
            {
                RemoveStatus(btl, 524288U);
                return(2);
            }
            btl_para.InitATB(btl);
            btl.cur.at_coef = (SByte)(btl.cur.at_coef * 2 / 3);
            stat.cur       |= status;
            break;

        case 26:
            btl_mot.HideMesh(btl, btl.mesh_banish, true);
            break;

        case 28:
            stat.cur ^= status;
            if (Status.checkCurStat(btl, 268435456U))
            {
                geo.geoScaleSet(btl, 2048);
                btlshadow.FF9ShadowSetScaleBattle(btl_util.GetFF9CharNo(btl), (Byte)(btl.shadow_x / 2U), (Byte)(btl.shadow_z / 2U));
                break;
            }
            geo.geoScaleReset(btl);
            btlshadow.FF9ShadowSetScaleBattle(btl_util.GetFF9CharNo(btl), btl.shadow_x, btl.shadow_z);
            break;

        default:
            if ((Int32)num4 != 0)
            {
                if ((Int32)num4 == 1)
                {
                    if (FF9StateSystem.Battle.FF9Battle.btl_phase > 2)
                    {
                        btl_sys.CheckBattlePhase(btl);
                    }
                    if (btl.bi.player != 0 && !btl_mot.checkMotion(btl, 1) && !btl_util.isCurCmdOwner(btl))
                    {
                        btl_mot.setMotion(btl, 1);
                        btl.evt.animFrame = 0;
                    }
                }
                break;
            }
            if (!btl_cmd.CheckUsingCommand(btl.cmd[2]))
            {
                if (FF9StateSystem.Battle.FF9Battle.btl_phase > 2)
                {
                    btl_cmd.SetCommand(btl.cmd[2], 62U, 0U, btl.btl_id, 0U);
                    break;
                }
                stat.cur  |= status;
                btl.bi.atb = 0;
                SetStatusClut(btl, true);
            }
            break;
        }
        RemoveStatuses(btl, statusData[statTblNo].clear);
        if (Status.checkCurStat(btl, 1073746177U))
        {
            btl.bi.atb = 0;
        }
        if (((Int32)status & -268500992) != 0)
        {
            Int16 num3 = ((Int32)status & -1693253632) == 0 ? (((Int32)status & 619446272) == 0 ? (Int16)(60 - btl.elem.wpr << 2) : (Int16)(btl.elem.wpr << 3)) : (Int16)(60 - btl.elem.wpr << 3);
            btl.stat.cnt.conti[statTblNo - 16U] = (Int16)(statusData[statTblNo].conti_cnt * num3);
        }
        if (((Int32)status & 327682) != 0)
        {
            SetOprStatusCount(btl, statTblNo);
        }
        HonoluluBattleMain.battleSPS.AddBtlSPSObj(btl, status);
        if (btl.bi.player != 0)
        {
            BattleAchievement.UpdateAbnormalStatus(status);
        }
        return(2);
    }