コード例 #1
0
 public void ParseEntry(String[] raw)
 {
     Regular1 = (BattleCommandId)CsvParser.Byte(raw[0]);
     Regular2 = (BattleCommandId)CsvParser.Byte(raw[1]);
     Trance1  = (BattleCommandId)CsvParser.Byte(raw[2]);
     Trance2  = (BattleCommandId)CsvParser.Byte(raw[3]);
 }
コード例 #2
0
    public Boolean RequestAction(BattleCommandId cmd, Int32 target, Int32 prm1, Int32 commandAndScript)
    {
        Int32 index;

        for (index = 0; index < 8 && (target & 1) == 0; ++index)
        {
            target >>= 1;
        }

        if (index >= 8)
        {
            return(false);
        }

        Obj p = this._objPtrList[index];

        if (cmd == BattleCommandId.EnemyAtk)
        {
            if (p.level > 3)
            {
                p.btlchk = 2;
                return(true);
            }

            return(false);
        }
        Int32 level     = 2;
        Int32 tagNumber = 7;

        switch (cmd)
        {
        case BattleCommandId.EnemyCounter:
            tagNumber = 6;
            this.SetSysList(0, prm1);
            level = 1;
            break;

        case BattleCommandId.EnemyDying:
            tagNumber = 9;
            this.SetSysList(0, prm1);
            level = 0;
            break;
        }

        _btlCmdPrm = commandAndScript;
        return(this.Request(p, level, tagNumber, false));
    }
コード例 #3
0
 public static void EnqueueConter(BattleUnit unit, BattleCommandId commandId, BattleAbilityId abilityId, UInt16 target)
 {
     btl_cmd.SetCounter(unit.Data, (UInt32)commandId, (Int32)abilityId, target);
 }
コード例 #4
0
 public static void EnqueueCommand(BattleCommand escapeCommand, BattleCommandId commandId, BattleAbilityId abilityId, UInt16 targetId, Boolean isManyTarget)
 {
     btl_cmd.SetCommand(escapeCommand.Data, (UInt32)commandId, (UInt32)abilityId, targetId, isManyTarget ? 1u : 0u);
 }
コード例 #5
0
ファイル: HonoluluBattleMain.cs プロジェクト: ArtReeX/memoria
    public static void playCommand(Int32 characterNo, Int32 slotNo, Int32 target, Boolean isTrance = false)
    {
        if (slotNo < 0 || slotNo > 6)
        {
            Debug.LogError("slot number value can be only 0 to 5");
        }
        else if (characterNo < 0 || characterNo > 4)
        {
            Debug.LogError("character number value can be only 1 to 4");
        }
        else
        {
            BTL_DATA        btlData      = FF9StateSystem.Battle.FF9Battle.btl_data[characterNo];
            Byte            presetId     = FF9StateSystem.Common.FF9.party.member[characterNo].info.menu_type;
            BattleCommandId commandId    = 0;
            Int32           commandIndex = (Int32)commandId;
            UInt32          sub_no       = 0;
            switch (slotNo)
            {
            case 0:
                commandId = BattleCommandId.Attack;
                sub_no    = CharacterCommands.Commands[commandIndex].Ability;
                break;

            case 1:
                commandId = CharacterCommands.CommandSets[presetId].Get(isTrance, 0);
                sub_no    = CharacterCommands.Commands[commandIndex].Ability;
                break;

            case 2:
                commandId = CharacterCommands.CommandSets[presetId].Get(isTrance, 1);
                sub_no    = CharacterCommands.Commands[commandIndex].Ability;
                break;

            case 3:
                commandId = BattleCommandId.Item;
                sub_no    = 236U;
                break;

            case 4:
                commandId = BattleCommandId.Defend;
                break;

            case 5:
                commandId = BattleCommandId.Change;
                sub_no    = CharacterCommands.Commands[commandIndex].Ability;
                break;
            }

            if (CharacterCommands.Commands[commandIndex].Type == CharacterCommandType.Throw)
            {
                sub_no = 1U;
            }

            if (commandId == BattleCommandId.None)
            {
                return;
            }

            CMD_DATA cmd = new CMD_DATA {
                regist = btlData
            };
            btl_cmd.SetCommand(cmd, commandId, sub_no, (UInt16)target, 0U);
        }
    }
コード例 #6
0
    public static void SelectCommandVfx(CMD_DATA cmd)
    {
        BTL_DATA        regist = cmd.regist;
        BattleUnit      caster = regist == null ? null : new BattleUnit(regist);
        BattleCommandId cmd_no = cmd.cmd_no;

        switch (cmd_no)
        {
        case BattleCommandId.EnemyAtk:
            if (cmd.tar_id < 16 && (cmd.aa.Category & 8) != 0 && cmd.info.cursor == 0)
            {
                UInt16 num = btl_abil.CheckCoverAbility(cmd.tar_id);
                if (num != 0)
                {
                    cmd.tar_id     = num;
                    cmd.info.cover = 1;
                }
            }
            btlseq.RunSequence(cmd);
            return;

        case BattleCommandId.Counter:
        case BattleCommandId.RushAttack:
            SetBattleVfx(cmd, (UInt32)(100 + btl_util.getSerialNumber(regist)), null);
            return;

        case BattleCommandId.AutoPotion:
            SetBattleVfx(cmd, (UInt32)ff9item._FF9Item_Info[btl_util.btlItemNum(cmd.sub_no)].info.VfxIndex, null);
            return;

        case BattleCommandId.EnemyCounter:
        case BattleCommandId.EnemyDying:
        case BattleCommandId.EnemyReaction:
            btlseq.RunSequence(cmd);
            return;

        case BattleCommandId.SysTrans:
            SetBattleVfx(cmd, !caster.IsUnderStatus(BattleStatus.Trance) ? 489u : 257u, null);
            return;

        case BattleCommandId.Attack:
            SetBattleVfx(cmd, (UInt32)(100 + btl_util.getSerialNumber(regist)), null);
            return;

        case BattleCommandId.Item:
            SetBattleVfx(cmd, (UInt32)ff9item._FF9Item_Info[btl_util.btlItemNum(cmd.sub_no)].info.VfxIndex, null);
            return;

        case BattleCommandId.Defend:
            UIManager.Battle.SetBattleCommandTitle(cmd);
            btl_mot.setMotion(regist, 12);
            regist.evt.animFrame = 0;
            btl_cmd.ExecVfxCommand(regist);
            return;

        case BattleCommandId.Change:
            UIManager.Battle.SetBattleCommandTitle(cmd);
            btl_mot.setMotion(regist, 9);
            return;

        case BattleCommandId.Steal:
        {
            Byte serialNumber = btl_util.getSerialNumber(regist);
            if (serialNumber == 0)
            {
                SetBattleVfx(cmd, 200u, null);
            }
            else if (serialNumber == 1)
            {
                SetBattleVfx(cmd, 273u, null);
            }
            else if (serialNumber == 14)
            {
                SetBattleVfx(cmd, 19u, null);
            }
            else if (serialNumber == 15)
            {
                SetBattleVfx(cmd, 119u, null);
            }
            else
            {
                SetBattleVfx(cmd, 20u, null);
            }
            return;
        }

        case BattleCommandId.Throw:
            switch (ff9item._FF9Item_Data[(Int32)cmd.sub_no].shape)
            {
            case 1:
                SetBattleVfx(cmd, 272u, null);
                break;

            case 2:
                SetBattleVfx(cmd, 266u, null);
                break;

            case 3:
            case 4:
                SetBattleVfx(cmd, 267u, null);
                break;

            case 5:
                SetBattleVfx(cmd, 268u, null);
                break;

            case 6:
                SetBattleVfx(cmd, 269u, null);
                break;

            case 7:
                SetBattleVfx(cmd, 265u, null);
                break;

            case 8:
            case 9:
            case 10:
                SetBattleVfx(cmd, 270u, null);
                break;

            case 11:
                SetBattleVfx(cmd, 271u, null);
                break;

            case 12:
                SetBattleVfx(cmd, 277u, null);
                break;
            }
            return;

        case BattleCommandId.Phantom:
        {
            FF9StateBattleSystem ff9Battle = FF9StateSystem.Battle.FF9Battle;
            switch (cmd.sub_no)
            {
            case 49:
                ff9Battle.phantom_no = 153;
                break;

            case 51:
                ff9Battle.phantom_no = 154;
                break;

            case 53:
                ff9Battle.phantom_no = 155;
                break;

            case 55:
                ff9Battle.phantom_no = 156;
                break;

            case 58:
                ff9Battle.phantom_no = 157;
                break;

            case 60:
                ff9Battle.phantom_no = 158;
                break;

            case 62:
                ff9Battle.phantom_no = 159;
                break;

            case 64:
                ff9Battle.phantom_no = 160;
                break;
            }

            if ((cmd.aa.Info.Target == TargetType.ManyAny && cmd.info.cursor == 0) || cmd.info.meteor_miss != 0 || cmd.info.short_summon != 0 || cmd.cmd_no == BattleCommandId.HolySword1 || cmd.cmd_no == BattleCommandId.HolySword2)
            {
                SetBattleVfx(cmd, cmd.aa.Vfx2, null);
            }
            else
            {
                SetBattleVfx(cmd, (UInt32)cmd.aa.Info.VfxIndex, null);
            }

            return;
        }

        case BattleCommandId.BoundaryCheck:
        case BattleCommandId.MagicCounter:
        case BattleCommandId.SysEscape:
        case BattleCommandId.SysPhantom:
        case BattleCommandId.SysLastPhoenix:
        case BattleCommandId.Jump:
        case BattleCommandId.Escape:
        case BattleCommandId.FinishBlow:
        default:
            if ((cmd.aa.Info.Target == TargetType.ManyAny && cmd.info.cursor == 0) || cmd.info.meteor_miss != 0 || cmd.info.short_summon != 0 || cmd.cmd_no == BattleCommandId.HolySword1 || cmd.cmd_no == BattleCommandId.HolySword2)
            {
                SetBattleVfx(cmd, cmd.aa.Vfx2, null);
            }
            else
            {
                SetBattleVfx(cmd, (UInt32)cmd.aa.Info.VfxIndex, null);
            }
            return;
        }
    }
コード例 #7
0
ファイル: BattleAchievement.cs プロジェクト: ArtReeX/memoria
    public static void UpdateCommandAchievement(CMD_DATA cmd)
    {
        BattleCommandId cmd_no = cmd.cmd_no;

        if (cmd_no == BattleCommandId.Defend)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.defence_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.Defense50, BattleAchievement.achievement.defence_no);
        }
        else if (cmd_no == BattleCommandId.BlackMagic || cmd_no == BattleCommandId.DoubleBlackMagic)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.blkMag_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.BlkMag100, BattleAchievement.achievement.blkMag_no);
        }
        else if (cmd_no == BattleCommandId.WhiteMagicGarnet || cmd_no == BattleCommandId.WhiteMagicEiko || cmd_no == BattleCommandId.DoubleWhiteMagic)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.whtMag_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.WhtMag200, BattleAchievement.achievement.whtMag_no);
        }
        else if (cmd_no == BattleCommandId.BlueMagic)
        {
            BattleAchievement.IncreseNumber(ref BattleAchievement.achievement.bluMag_no, 1);
            AchievementManager.ReportAchievement(AcheivementKey.BluMag100, BattleAchievement.achievement.bluMag_no);
        }
        else if (cmd_no == BattleCommandId.SummonGarnet || cmd_no == BattleCommandId.Phantom || cmd_no == BattleCommandId.SummonEiko)
        {
            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 == BattleCommandId.Steal)
        {
            Int32 totalProgress = BattleAchievement.achievement.increaseStealCount();
            AchievementManager.ReportAchievement(AcheivementKey.Steal50, totalProgress);
        }
        else if (cmd_no == BattleCommandId.SysLastPhoenix)
        {
            AchievementManager.ReportAchievement(AcheivementKey.RebirthFlame, 1);
        }
    }
コード例 #8
0
    public static void SelectCommandVfx(CMD_DATA cmd)
    {
        BTL_DATA        regist = cmd.regist;
        BattleUnit      caster = regist == null ? null : new BattleUnit(regist);
        BattleCommandId cmd_no = (BattleCommandId)cmd.cmd_no;

        switch ((Int32)cmd_no)
        {
        case 47:
            if (cmd.tar_id < 16 && (cmd.aa.Category & 8) != 0 && cmd.info.cursor == 0)
            {
                UInt16 num = btl_abil.CheckCoverAbility(cmd.tar_id);
                if (num != 0)
                {
                    cmd.tar_id     = num;
                    cmd.info.cover = 1;
                }
            }
            btlseq.RunSequence(cmd);
            return;

        case 48:
        case 50:
        case 56:
        case 57:
        case 58:
IL_4B:
            switch (cmd_no)
            {
            case BattleCommandId.Attack:
                break;

            case BattleCommandId.Steal:
            {
                Byte serialNumber = btl_util.getSerialNumber(regist);
                if (serialNumber != 0)
                {
                    if (serialNumber != 1)
                    {
                        if (serialNumber != 14)
                        {
                            if (serialNumber != 15)
                            {
                                btl_vfx.SetBattleVfx(cmd, 20u, null);
                            }
                            else
                            {
                                btl_vfx.SetBattleVfx(cmd, 119u, null);
                            }
                        }
                        else
                        {
                            btl_vfx.SetBattleVfx(cmd, 19u, null);
                        }
                    }
                    else
                    {
                        btl_vfx.SetBattleVfx(cmd, 273u, null);
                    }
                }
                else
                {
                    btl_vfx.SetBattleVfx(cmd, 200u, null);
                }
                return;
            }

            case BattleCommandId.Jump1:
            case BattleCommandId.Flee:
            case BattleCommandId.FB:
IL_6F:
                switch (cmd_no)
                {
                case BattleCommandId.Item:
                    goto IL_168;

                case BattleCommandId.Throw:
                    switch (ff9item._FF9Item_Data[(Int32)cmd.sub_no].shape)
                    {
                    case 1:
                        btl_vfx.SetBattleVfx(cmd, 272u, null);
                        break;

                    case 2:
                        btl_vfx.SetBattleVfx(cmd, 266u, null);
                        break;

                    case 3:
                    case 4:
                        btl_vfx.SetBattleVfx(cmd, 267u, null);
                        break;

                    case 5:
                        btl_vfx.SetBattleVfx(cmd, 268u, null);
                        break;

                    case 6:
                        btl_vfx.SetBattleVfx(cmd, 269u, null);
                        break;

                    case 7:
                        btl_vfx.SetBattleVfx(cmd, 265u, null);
                        break;

                    case 8:
                    case 9:
                    case 10:
                        btl_vfx.SetBattleVfx(cmd, 270u, null);
                        break;

                    case 11:
                        btl_vfx.SetBattleVfx(cmd, 271u, null);
                        break;

                    case 12:
                        btl_vfx.SetBattleVfx(cmd, 277u, null);
                        break;
                    }
                    return;

                case BattleCommandId.Eidolon:
                {
                    FF9StateBattleSystem ff9Battle = FF9StateSystem.Battle.FF9Battle;
                    switch (cmd.sub_no)
                    {
                    case 49:
                        ff9Battle.phantom_no = 153;
                        break;

                    case 51:
                        ff9Battle.phantom_no = 154;
                        break;

                    case 53:
                        ff9Battle.phantom_no = 155;
                        break;

                    case 55:
                        ff9Battle.phantom_no = 156;
                        break;

                    case 58:
                        ff9Battle.phantom_no = 157;
                        break;

                    case 60:
                        ff9Battle.phantom_no = 158;
                        break;

                    case 62:
                        ff9Battle.phantom_no = 159;
                        break;

                    case 64:
                        ff9Battle.phantom_no = 160;
                        break;
                    }
                    if ((cmd.aa.Info.Target == Memoria.Data.TargetType.ManyAny && cmd.info.cursor == 0) || cmd.info.meteor_miss != 0 || cmd.info.short_summon != 0 || cmd.cmd_no == 32 || cmd.cmd_no == 33)
                    {
                        btl_vfx.SetBattleVfx(cmd, (UInt32)cmd.aa.Vfx2, null);
                    }
                    else
                    {
                        btl_vfx.SetBattleVfx(cmd, (UInt32)cmd.aa.Info.VfxIndex, null);
                    }
                    return;
                }
                }
                if ((cmd.aa.Info.Target == Memoria.Data.TargetType.ManyAny && cmd.info.cursor == 0) || cmd.info.meteor_miss != 0 || cmd.info.short_summon != 0 || cmd.cmd_no == 32 || cmd.cmd_no == 33)
                {
                    btl_vfx.SetBattleVfx(cmd, (UInt32)cmd.aa.Vfx2, null);
                }
                else
                {
                    btl_vfx.SetBattleVfx(cmd, (UInt32)cmd.aa.Info.VfxIndex, null);
                }
                return;

            case BattleCommandId.Defend:
                UIManager.Battle.SetBattleCommandTitle(cmd);
                btl_mot.setMotion(regist, 12);
                regist.evt.animFrame = 0;
                btl_cmd.ExecVfxCommand(regist);
                return;

            case BattleCommandId.Change:
                UIManager.Battle.SetBattleCommandTitle(cmd);
                btl_mot.setMotion(regist, 9);
                return;

            default:
                goto IL_6F;
            }
            break;

        case 49:
        case 52:
            break;

        case 51:
            goto IL_168;

        case 53:
        case 54:
        case 55:
            btlseq.RunSequence(cmd);
            return;

        case 59:
            btl_vfx.SetBattleVfx(cmd, !caster.IsUnderStatus(BattleStatus.Trance) ? 489u : 257u, null);
            return;

        default:
            goto IL_4B;
        }
        btl_vfx.SetBattleVfx(cmd, (UInt32)(100 + btl_util.getSerialNumber(regist)), null);
        return;

IL_168:
        btl_vfx.SetBattleVfx(cmd, (UInt32)ff9item._FF9Item_Info[btl_util.btlItemNum((Int32)cmd.sub_no)].info.VfxIndex, null);
    }