Esempio n. 1
0
    //----------------------------------------------------------------------------

    /*!
     *      @brief	戦闘リクエスト操作:リクエスト発行
     *      @param[in]		PacketStructQuestBuild			(quest_param)		クエスト構築情報
     *      @param[in]		PacketStructQuestBuildBattle	(battle_param)		戦闘構築情報
     *      @param[in]		bool							(boss)				この戦闘はボス戦闘か?
     *      @param[in]		bool							(chain)				この戦闘は連鎖戦闘か?
     *      @param[in]		int								(turn_offset)		有利不利ターン
     */
    //----------------------------------------------------------------------------
    public bool BattleRequestAdd(PacketStructQuestBuild quest_param,
                                 PacketStructQuestBuildBattle battle_param,
                                 bool boss, bool chain, int turn_offset)
    {
        //--------------------------------
        // バッファに空きがあるかチェック
        //--------------------------------
        if ((m_BattleRequestInput - m_BattleRequestAccess - 1) > m_BattleRequest.Length)
        {
            Debug.LogError("BattleRequest Buffer Over!!");
            return(false);
        }


        //--------------------------------
        // バッファに空きがある
        // →リクエスト情報を受理
        //--------------------------------
        int nInputIndex = m_BattleRequestInput % m_BattleRequest.Length;

        m_BattleRequestInput  = m_BattleRequestInput + 1;
        m_BattleRequestActive = true;


        //--------------------------------
        //	リクエストデータ設定
        //--------------------------------
        m_BattleRequest[nInputIndex].SetupBattleReq(m_BattleUniqueID++, false,
                                                    turn_offset, boss, chain,
                                                    quest_param, battle_param);


        return(true);
    }
Esempio n. 2
0
    /// <summary>
    /// Quest1 のデータを Quest2 のデータへ変換
    /// </summary>
    /// <param name="src_data"></param>
    /// <param name="dst_data"></param>
    public static void convQuestToQuest2(PacketStructQuestBuild src_data, PacketStructQuest2Build dst_data)
    {
        dst_data.boss        = src_data.boss;
        dst_data.list_battle = new PacketStructQuest2BuildBattle[src_data.list_battle.Length];
        for (int idx = 0; idx < dst_data.list_battle.Length; idx++)
        {
            PacketStructQuestBuildBattle  src_build_battle = src_data.list_battle[idx];
            PacketStructQuest2BuildBattle dst_build_battle = new PacketStructQuest2BuildBattle();

            convQuestToQuest2(src_build_battle, dst_build_battle);
        }

        dst_data.list_drop = new PacketStructQuest2BuildDrop[src_data.list_drop.Length];
        for (int idx = 0; idx < dst_data.list_drop.Length; idx++)
        {
            PacketStructQuestBuildDrop  src_drop = src_data.list_drop[idx];
            PacketStructQuest2BuildDrop dst_drop = new PacketStructQuest2BuildDrop();

            dst_drop.unique_id = src_drop.unique_id;
            dst_drop.setKindType(PacketStructQuest2BuildDrop.KindType.UNIT);
            dst_drop.item_id  = (int)src_drop.unit_id;
            dst_drop.plus_pow = src_drop.plus_pow;
            dst_drop.plus_hp  = src_drop.plus_hp;

            dst_drop.num = 0;

            dst_drop.floor = src_drop.floor;
        }

        dst_data.list_used_item = src_data.list_used_item;

        dst_data.list_e_param    = src_data.list_e_param;
        dst_data.list_e_acttable = src_data.list_e_acttable;
        dst_data.list_e_actparam = src_data.list_e_actparam;
    }
Esempio n. 3
0
    //----------------------------------------------------------------------------
    //	@brief		データ設定
    //----------------------------------------------------------------------------
    public bool SetupBattleReq(int uniqueID, bool attach,
                               int turn_offset, bool boss, bool chain,
                               PacketStructQuestBuild quest_param,
                               PacketStructQuestBuildBattle battle_param)
    {
        // Quest2 系へ変換
        PacketStructQuest2Build dst_quest_param = new PacketStructQuest2Build();

        convQuestToQuest2(quest_param, dst_quest_param);

        PacketStructQuest2BuildBattle dst_battle_param = new PacketStructQuest2BuildBattle();

        convQuestToQuest2(battle_param, dst_battle_param);

        return(SetupBattleReq(uniqueID, attach, turn_offset, boss, chain, dst_quest_param, dst_battle_param));
    }