Esempio n. 1
0
    /// <summary>
    /// パーティキャラ設定UIへ値を反映
    /// </summary>
    private void setup_for_screen()
    {
        for (int idx = 0; idx < (int)GlobalDefine.PartyCharaIndex.MAX; idx++)
        {
            BattleSceneStartCharaUI chara_ui      = gameObject.transform.Find("SetupUI/" + menber_ids[idx] + "/Main/BattleDebugCharaSettingUI").GetComponent <BattleSceneStartCharaUI>();
            BattleSceneStartCharaUI chara_ui_link = gameObject.transform.Find("SetupUI/" + menber_ids[idx] + "/Link/BattleDebugCharaSettingUI").GetComponent <BattleSceneStartCharaUI>();

            int chara_id    = chara_ui.getCharaID();
            int chara_level = chara_ui.getCharaLevel();

            int chara_id_link    = chara_ui_link.getCharaID();
            int chara_level_link = chara_ui_link.getCharaLevel();

            if (BattleParam.m_PlayerParty != null)
            {
                CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)idx, CharaParty.CharaCondition.EXIST);
                if (chara_once != null)
                {
                    chara_id = (int)chara_once.m_CharaMasterDataParam.fix_id;

                    if (chara_once.m_LinkParam != null && chara_once.m_LinkParam.m_CharaID != 0)
                    {
                        MasterDataParamChara master_chara_link = BattleParam.m_MasterDataCache.useCharaParam(chara_once.m_LinkParam.m_CharaID);
                        chara_id_link = (int)master_chara_link.fix_id;
                    }
                }
            }

            if (chara_id != 0)
            {
                chara_ui.setOn(true);
                chara_ui.setup(chara_id, chara_level);
            }
            else
            {
                chara_ui.setOn(false);
            }

            if (chara_id_link != 0)
            {
                chara_ui_link.setOn(true);
                chara_ui_link.setup(chara_id_link, chara_level_link);
            }
            else
            {
                chara_ui_link.setOn(false);
            }
        }

        for (int idx = 0; idx < enemy_gropus.Length; idx++)
        {
            GameObject enemy_ui_obj = gameObject.transform.Find("SetupUI/" + enemy_gropus[idx]).gameObject;
            if (enemy_ui_obj != null)
            {
                enemy_ui_obj.SetActive(m_IsEnableEnemyUI);
            }
        }

        gameObject.transform.Find("SetupUI").gameObject.SetActive(true);
    }
Esempio n. 2
0
        /// <summary>
        /// 属性配置優先順を取得
        /// </summary>
        /// <param name="member_order"></param>
        /// <returns></returns>
        public CostInfo[] getElementOrder(PanelInfo panel_info, GlobalDefine.PartyCharaIndex[] member_order)
        {
            List <CostInfo> cost_info_order = new List <CostInfo>();

            // 復活があるときは回復を最優先で置く
            if (m_IsTryResurrect)
            {
                int sp = BattleParam.m_PlayerParty.GetSP();
                if (sp > 0)
                {
                    CharaOnce[] dead_charas = BattleParam.m_PlayerParty.getPartyMembers(CharaParty.CharaCondition.DEAD);
                    if (dead_charas.Length > 0)
                    {
                        for (int field_idx = 0; field_idx < panel_info.m_IsBoosts.Length; field_idx++)
                        {
                            if (panel_info.m_IsBoosts[field_idx])
                            {
                                cost_info_order.Add(new CostInfo(MasterDataDefineLabel.ElementType.HEAL, MasterDataDefineLabel.ElementType.HEAL, MasterDataDefineLabel.ElementType.HEAL, MasterDataDefineLabel.ElementType.HEAL, MasterDataDefineLabel.ElementType.HEAL));
                                break;
                            }
                        }
                    }
                }
            }

            // メインユニットのLEADER,MOB_1,MOB2,MOB3,FRIEND,リンクユニットのLEADER,MOB_1,MOB2,MOB3,FRIENDの順に並べる
            for (int skill_idx = 0; skill_idx < m_SkillCosts.GetLength(2); skill_idx++)
            {
                for (int link_idx = 0; link_idx < m_SkillCosts.GetLength(0); link_idx++)
                {
                    for (int member_idx = 0; member_idx < member_order.Length; member_idx++)
                    {
                        GlobalDefine.PartyCharaIndex member_type = member_order[member_idx];
                        SkillCost skill_cost = m_SkillCosts[link_idx, (int)member_type, skill_idx];
                        if (skill_cost != null &&
                            skill_cost.m_CostInfo != null
                            )
                        {
                            bool is_enable_skill = true;
                            {
                                CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(member_type, CharaParty.CharaCondition.ALIVE);
                                if (chara_once == null)
                                {
                                    is_enable_skill = false;
                                }
                            }

                            if (is_enable_skill)
                            {
                                cost_info_order.Add(skill_cost.m_CostInfo);
                            }
                        }
                    }
                }
            }

            CostInfo[] ret_val = cost_info_order.ToArray();

            return(ret_val);
        }
    /// <summary>
    /// パーティメンバー個別へのダメージ演出(ダメージ数値)
    /// </summary>
    /// <param name="member_index"></param>
    /// <param name="effect_prefab"></param>
    public void setDamageValueMember(MasterDataDefineLabel.ElementType damage_element, BattleSceneUtil.MultiInt damage_value, BattleSceneUtil.MultiInt damage_target)
    {
        if (BattleParam.IsKobetsuHP == false)
        {
            return;
        }

        for (int idx = 0; idx < damage_value.getMemberCount(); idx++)
        {
            int dmg_target = damage_target.getValue((GlobalDefine.PartyCharaIndex)idx);
            if (dmg_target > 0)
            {
                int          dmg_value   = damage_value.getValue((GlobalDefine.PartyCharaIndex)idx);
                EDAMAGE_TYPE damage_type = EDAMAGE_TYPE.eDAMAGE_TYPE_NORMAL;
                if (damage_element != MasterDataDefineLabel.ElementType.NONE)
                {
                    CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)idx, CharaParty.CharaCondition.EXIST);
                    if (chara_once != null)
                    {
                        damage_type = InGameUtilBattle.GetSkillElementAffinity(damage_element, chara_once.m_CharaMasterDataParam.element);
                    }
                }

                DrawDamageManager.showDamage(m_MemberHPTrans[idx], dmg_value, damage_type, 3.0f, getInterfaceExtentionRate() * INTERFACE_EXTENTION_DAMAGE_VALUE_OFFSET_Y + 0.14f, 2.0f);
            }
        }
    }
Esempio n. 4
0
    public static void outputPlayerParty(CharaParty chara_party)
    {
        for (int idx = 0; idx < chara_party.getPartyMemberMaxCount(); idx++)
        {
            CharaOnce chara_once = chara_party.getPartyMember((GlobalDefine.PartyCharaIndex)idx, CharaParty.CharaCondition.EXIST);
            if (chara_once != null)
            {
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "プレイヤー情報(" + ((GlobalDefine.PartyCharaIndex)idx).ToString() + ")"
                                         + " FixID:" + chara_once.m_CharaMasterDataParam.fix_id.ToString()
                                         + " DrawID:" + chara_once.m_CharaMasterDataParam.draw_id.ToString()
                                         + " LV:" + chara_once.m_CharaLevel.ToString()
                                         + " 属性:" + chara_once.m_CharaMasterDataParam.element.ToString()
                                         + " 種族1:" + chara_once.m_CharaMasterDataParam.kind.ToString()
                                         + " 種族2:" + chara_once.m_CharaMasterDataParam.sub_kind.ToString()
                                         + " [" + chara_once.m_CharaMasterDataParam.name.ToString() + "]"
                                         );
                DebugBattleLog.writeText(DebugBattleLog.StrOpe + "  "
                                         + " HP:" + chara_party.m_HPCurrent.getValue((GlobalDefine.PartyCharaIndex)idx).ToString() + "/" + chara_party.m_HPMax.getValue((GlobalDefine.PartyCharaIndex)idx).ToString()
                                         + " SkillTurn:" + chara_once.GetTrunToLimitBreak().ToString() + "/" + chara_once.GetMaxTurn().ToString()
                                         + " Hate:" + chara_party.m_Hate.getValue((GlobalDefine.PartyCharaIndex)idx).ToString()
                                         );

                // 状態変化
                StatusAilmentChara ailment = chara_party.m_Ailments.getAilment((GlobalDefine.PartyCharaIndex)idx);
                outputAilment(ailment);
            }
        }
    }
Esempio n. 5
0
    public void AddLinkBonus(CharaOnce cCharaOnce, MasterDataParamChara cCharaMasterData)
    {
        UnitSkillContext _newSkill = new UnitSkillContext();

        _newSkill.setupLinkEffectInfo(cCharaOnce, cCharaMasterData, false);
        _newSkill.setLinkTitleImage("linkubo-nasu_gray", "skill_name_bg0");
        SkillList.Add(_newSkill);
    }
Esempio n. 6
0
 public void AddLinkEffectInfo(CharaOnce cCharaOnce, MasterDataParamChara cCharaMasterData, bool bLink)
 {
     if (m_LinkBonus == null)
     {
         m_LinkBonus = new UnitSkillContext();
     }
     m_LinkBonus.setupLinkEffectInfo(cCharaOnce, cCharaMasterData, bLink);
     LinkList.Add(m_LinkBonus);
 }
Esempio n. 7
0
 public void AddUnitDataLink(CharaOnce cCharaParam, MasterDataParamChara cCharaMasterData)
 {
     if (m_LinkBonus == null)
     {
         m_LinkBonus = new UnitSkillContext();
     }
     m_LinkBonus.setupUnitData(cCharaParam, cCharaMasterData);
     LinkList.Add(m_LinkBonus);
 }
Esempio n. 8
0
    /// <summary>
    /// ソートパラメータ設定(ユニット共通)
    /// </summary>
    /// <param name="_main"></param>
    /// <param name="_mainMaster"></param>
    /// <param name="_sub"></param>
    private void setSortParamUnit(PacketStructUnit _main, MasterDataParamChara _mainMaster, PacketStructUnit _sub)
    {
        CharaOnce baseChara = new CharaOnce();

        if (_main.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
            _sub != null)
        {
            baseChara.CharaSetupFromParam(
                _mainMaster,
                (int)_main.level,
                (int)_main.limitbreak_lv,
                (int)_main.limitover_lv,
                (int)_main.add_pow,
                (int)_main.add_hp,
                _sub.id,
                (int)_sub.level,
                (int)_sub.add_pow,
                (int)_sub.add_hp,
                (int)_main.link_point,
                (int)_sub.limitover_lv
                );
        }
        else
        {
            baseChara.CharaSetupFromParam(
                _mainMaster,
                (int)_main.level,
                (int)_main.limitbreak_lv,
                (int)_main.limitover_lv,
                (int)_main.add_pow,
                (int)_main.add_hp,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }

        draw_id = (int)_mainMaster.draw_id;
        level   = (int)_main.level;
        hp      = baseChara.m_CharaHP;
        pow     = baseChara.m_CharaPow;
        plus    = baseChara.m_CharaPlusHP + baseChara.m_CharaPlusPow;
        cost    = _mainMaster.party_cost;
        if (_main.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE && _sub != null)
        {
            cost += CharaLinkUtil.GetLinkUnitCost(_sub.id);
        }
        rare         = (int)_mainMaster.rare;
        element      = _mainMaster.element;
        kind         = _mainMaster.kind;
        sub_kind     = _mainMaster.sub_kind;
        limitover_lv = (int)_main.limitover_lv;
        charm        = baseChara.m_CharaCharm;
    }
Esempio n. 9
0
    public void setupChara(uint _unit_id, PacketStructUnit _mainUnit)
    {
        MasterDataParamChara _masterMain = MasterFinder <MasterDataParamChara> .Instance.Find((int)_unit_id);

        if (_masterMain == null)
        {
            return;
        }

        CharaOnce m_CharaParam = new CharaOnce();

        if (_mainUnit == null)
        {
            m_CharaParam.CharaSetupFromID(
                _unit_id,
                (int)1,
                (int)0,
                (int)0,
                (int)0,
                (int)0,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }
        else
        {
            m_CharaParam.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }

        if (_masterMain.link_enable == MasterDataDefineLabel.BoolType.ENABLE)
        {
            AddLinkBonus(m_CharaParam, _masterMain);
            AddRaceBonus(_masterMain);
            AddLinkSkill(_masterMain, 0);
            AddLinkPassive(_masterMain);
        }
    }
Esempio n. 10
0
    private static BattleSkillActivity getLeaderSkillActivity(GlobalDefine.PartyCharaIndex charaIdx, CharaParty PlayerParty)
    {
        BattleSkillActivity activity = new BattleSkillActivity();

        if (activity == null)
        {
            return(null);
        }

        if (charaIdx < 0 || charaIdx >= GlobalDefine.PartyCharaIndex.MAX)
        {
            return(null);
        }

        if (PlayerParty == null)
        {
            return(null);
        }
        // パーティリーダーキャラ情報を取得
        CharaOnce chara = PlayerParty.getPartyMember(charaIdx, CharaParty.CharaCondition.EXIST);

        if (chara == null)
        {
            return(null);
        }

        if (chara == null)
        {
            return(null);
        }

        if (!chara.m_bHasCharaMasterDataParam)
        {
            return(null);
        }

        MasterDataSkillLeader skill = BattleParam.m_MasterDataCache.useSkillLeader(chara.m_CharaMasterDataParam.skill_leader);

        if (skill == null)
        {
            return(null);
        }

        //--------------------------------------------------------------------
        // スキル発動情報設定
        //--------------------------------------------------------------------
        activity.m_SkillParamOwnerNum = charaIdx;
        activity.m_SkillParamFieldID  = 0;
        activity.m_SkillParamSkillID  = chara.m_CharaMasterDataParam.skill_leader;
        activity.m_SkillType          = ESKILLTYPE.eLEADER;

        return(activity);
    }
Esempio n. 11
0
 /// <summary>
 /// パーティのスキルターンを増加ボタンが押された
 /// </summary>
 public void OnPushSkillTurnPPButton()
 {
     // パーティのスキルターンを増加.
     for (int idx = 0; idx < BattleParam.m_PlayerParty.getPartyMemberMaxCount(); idx++)
     {
         CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)idx, CharaParty.CharaCondition.SKILL_TURN1);
         if (chara_once != null)
         {
             chara_once.AddCharaLimitBreak(1);
         }
     }
 }
Esempio n. 12
0
    /// <summary>
    /// デバッグ用スキルカットイン再生
    /// </summary>
    /// <param name="chara_fix_id"></param>
    /// <param name="img_2_tiling"></param>
    /// <param name="img_2_offsetX"></param>
    /// <param name="img_2_offsetY"></param>
    public void debugSkillCutin(int chara_fix_id, int img_2_tiling, int img_2_offsetX, int img_2_offsetY, int size_width, int size_height, MasterDataDefineLabel.PivotType pivot, int side_offset)
    {
        MasterDataParamChara base_chara_master = MasterFinder <MasterDataParamChara> .Instance.Find(chara_fix_id);

        if (base_chara_master != null)
        {
            // ダミーのキャラマスターを生成(面倒なのでスキルカットインで使うところだけ設定)
            MasterDataParamChara dummy_chara_master = new MasterDataParamChara();
            dummy_chara_master.fix_id        = base_chara_master.fix_id;
            dummy_chara_master.element       = base_chara_master.element;
            dummy_chara_master.skill_active0 = base_chara_master.skill_active0;
            dummy_chara_master.img_2_tiling  = img_2_tiling;
            dummy_chara_master.img_2_offsetX = img_2_offsetX;
            dummy_chara_master.img_2_offsetY = img_2_offsetY;
            dummy_chara_master.size_width    = size_width;
            dummy_chara_master.size_height   = size_height;
            dummy_chara_master.pivot         = pivot;
            dummy_chara_master.side_offset   = side_offset;

            // ダミーのキャラマスターをバトルのキャッシュに登録
            BattleParam.m_MasterDataCache.clearCachePlayerAll();
            BattleParam.m_MasterDataCache.addCharaParam(dummy_chara_master);

            // ダミーのキャラデータを生成(バトルのキャッシュを使用して生成される)
            CharaOnce chara_once = new CharaOnce();
            bool      is_success = chara_once.CharaSetupFromID((uint)chara_fix_id, 1);
            if (is_success)
            {
                string skill_name = "スキル名";
                MasterDataDefineLabel.ElementType element_type = base_chara_master.element;

                MasterDataSkillActive skill_master = MasterFinder <MasterDataSkillActive> .Instance.Find((int)chara_once.m_CharaMasterDataParam.skill_active0);

                if (skill_master != null)
                {
                    skill_name   = skill_master.name;
                    element_type = skill_master.skill_element;
                }

                // ダミーのパーティを生成
                CharaOnce[] party_members = new CharaOnce[5];
                party_members[0]          = chara_once;
                BattleParam.m_PlayerParty = new CharaParty();
                BattleParam.m_PlayerParty.PartySetup(party_members, true);

                // カットインを開始
                clearSkill();
                addSkill(GlobalDefine.PartyCharaIndex.LEADER, skill_name, ESKILLTYPE.eACTIVE, element_type, 0);
                startCutin(false, false, false);
            }
        }
    }
Esempio n. 13
0
    // Use this for initialization
    void Start()
    {
        for (int idx = 0; idx < m_CutinObjects.Length; idx++)
        {
            m_CutinObjects[idx] = new CutinObjectInfo(m_BgObjectPrefab, transform, this);
        }

        m_SkillAreaTransform = transform.Find("SkillArea");

        for (int obj_idx = 0; obj_idx < m_SkillObjects.Length; obj_idx++)
        {
            GameObject skill_object = Instantiate(m_SkillObjectPrefab);
            m_SkillObjects[obj_idx] = skill_object;

            skill_object.transform.SetParent(m_SkillLocateCurrent.transform, false);

            // キャラアイコンを設定
            for (int member_idx = 0; member_idx < BattleParam.m_PlayerParty.getPartyMemberMaxCount(); member_idx++)
            {
                CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember((GlobalDefine.PartyCharaIndex)member_idx, CharaParty.CharaCondition.EXIST);
                if (chara_once != null)
                {
                    Transform unit_obj = skill_object.transform.Find("Unit" + member_idx.ToString());
                    if (unit_obj != null &&
                        unit_obj.childCount > 0
                        )
                    {
                        Transform unit_obj_child = unit_obj.GetChild(0);
                        if (unit_obj_child != null)
                        {
                            Image unit_image = unit_obj_child.GetComponent <Image>();

                            if (unit_image != null)
                            {
                                UnitIconImageProvider.Instance.Get(
                                    chara_once.m_CharaMasterDataParam.fix_id,
                                    sprite =>
                                {
                                    unit_image.sprite = sprite;
                                });
                            }
                        }
                    }
                }
            }

            skill_object.SetActive(false);
        }

        m_ResurrectUnitPos0 = m_SkillObjects[0].transform.Find("Unit0").localPosition;
        m_ResurrectUnitPos1 = m_SkillObjects[0].transform.Find("Unit1").localPosition;
    }
Esempio n. 14
0
    static public void setupCharaParty(ref CharaParty _party, PacketStructUnit[] unitList, PacketStructUnit[] linkUnitList = null)
    {
        if (_party == null || unitList == null)
        {
            return;
        }

        CharaOnce[] acCharaList = new CharaOnce[(int)GlobalDefine.PartyCharaIndex.MAX];

        for (int j = 0; j < unitList.Length; j++)
        {
            if (unitList[j] == null)
            {
                continue;
            }
            PacketStructUnit cBaseUnit = unitList[j];

            // リンクの情報
            int  nLinkLimitOverLV = 0;
            uint nLinkId          = 0;
            int  nLinkLevel       = 0;
            int  nLinkPlusPow     = 0;
            int  nLinkPlusHp      = 0;

            PacketStructUnit cLinkUnit;
            if (linkUnitList != null && linkUnitList.IsRange(j))
            {
                cLinkUnit = linkUnitList[j];
            }
            else
            {
                cLinkUnit = CharaLinkUtil.GetLinkUnit(cBaseUnit.link_unique_id);
            }

            if (cLinkUnit != null)
            {
                nLinkId          = cLinkUnit.id;
                nLinkLevel       = (int)cLinkUnit.level;
                nLinkPlusPow     = (int)cLinkUnit.add_pow;
                nLinkPlusHp      = (int)cLinkUnit.add_hp;
                nLinkLimitOverLV = (int)cLinkUnit.limitover_lv;
            }


            acCharaList[j] = new CharaOnce();
            acCharaList[j].CharaSetupFromID(cBaseUnit.id, (int)cBaseUnit.level, (int)cBaseUnit.limitbreak_lv, (int)cBaseUnit.limitover_lv, (int)cBaseUnit.add_pow, (int)cBaseUnit.add_hp,
                                            nLinkId, nLinkLevel, nLinkPlusPow, nLinkPlusHp, (int)cBaseUnit.link_point, nLinkLimitOverLV);
        }

        _party.PartySetupMenu(acCharaList, false);
    }
Esempio n. 15
0
    private void setParam(CharaOnce baseChara, MasterDataParamChara _masterMain, MasterDataLimitOver _masterMainLO, PacketStructUnit _subUnit = null, int battleHP = 0, int battleHPMax = 0, int battleATK = -1)
    {
        /**
         * メインユニット情報
         */
        {
            string levelFormat = GameTextUtil.GetText("unit_status17");
            Level = string.Format(levelFormat, baseChara.m_CharaLevel, _masterMain.level_max);
        }
        if (battleHPMax != 0)
        {
            Hp = string.Format(GameTextUtil.GetText("unit_status_battle1"), battleHP, battleHPMax);
        }
        else
        {
            if (baseChara.m_CharaPlusHP != 0)
            {
                Hp = string.Format(GameTextUtil.GetText("unit_status19"), baseChara.m_CharaHP, baseChara.m_CharaPlusHP);
            }
            else
            {
                Hp = string.Format("{0}", baseChara.m_CharaHP);
            }
        }
        if (battleATK >= 0)
        {
            Atk = string.Format(GameTextUtil.GetText("unit_status_battle2"), battleATK);
        }
        else
        {
            if (baseChara.m_CharaPlusPow != 0)
            {
                Atk = string.Format(GameTextUtil.GetText("unit_status19"), baseChara.m_CharaPow, baseChara.m_CharaPlusPow);
            }
            else
            {
                Atk = string.Format("{0}", baseChara.m_CharaPow);
            }
        }
        int _cost = _masterMain.party_cost;

        if (_subUnit != null)
        {
            _cost += CharaLinkUtil.GetLinkUnitCost(_subUnit.id);
        }
        Cost  = _cost.ToString();
        Charm = string.Format(GameTextUtil.GetText("kyouka_text1"), baseChara.m_CharaCharm.ToString("F1"));
        Lo    = baseChara.m_CharaLimitOver.ToString();
        LoMax = _masterMainLO.limit_over_max.ToString();
    }
Esempio n. 16
0
    private void setEnableLimitBreak(int on_off, GlobalDefine.PartyCharaIndex caster_index)
    {
        if (caster_index >= GlobalDefine.PartyCharaIndex.LEADER && caster_index < GlobalDefine.PartyCharaIndex.MAX)
        {
            // リミブレスキルを使用可能に
            CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(caster_index, CharaParty.CharaCondition.SKILL_TURN1);
            if (chara_once != null)
            {
                m_IsForbidLimitBreak[(int)caster_index] = !(on_off != 0);
                chara_once.AddCharaLimitBreak(99999);
            }
        }

        m_IsNextCommand = true;
    }
Esempio n. 17
0
    /// <summary>
    /// 状態異常の遅延発動
    /// </summary>
    public void updateDelaydSkill()
    {
        //-----------------------------------------------------------------
        // 状態異常の遅延発動。プレイヤーのターン開始時に状態異常を発動させる。
        //-----------------------------------------------------------------
        if (m_bDelayAilment)
        {
            CharaOnce cChara = null;

            for (int i = 0; i < m_acDelayAilment.Length; ++i)
            {
                if (null == m_acDelayAilment[i])
                {
                    break;
                }


                //---------------------------------------------------------
                // 状態異常付きスキルを発動したキャラを取得。
                //---------------------------------------------------------
                if (m_acDelayAilment[i].m_SkillParamOwnerNum < 0 ||
                    m_acDelayAilment[i].m_SkillParamOwnerNum >= GlobalDefine.PartyCharaIndex.MAX)
                {
                    continue;
                }
                cChara = BattleParam.m_PlayerParty.getPartyMember(m_acDelayAilment[i].m_SkillParamOwnerNum, CharaParty.CharaCondition.EXIST);
                if (null == cChara)
                {
                    continue;
                }


                //---------------------------------------------------------
                // 状態異常付与。
                // @change Developer 201603/14 v330 キャラの最大HPではなく、パーティの最大HPに変更
                //---------------------------------------------------------
                //				SkillUpdate_StatusAilment( m_acDelayAilment[i], cChara.m_CharaPow, cChara.m_CharaHP );
                SkillUpdate_StatusAilment(m_acDelayAilment[i], cChara.m_CharaPow, BattleParam.m_PlayerParty.m_HPMax, BattleParam.m_EnemyParam);
            }


            //-------------------------------------------------------------
            // 状態異常遅延発動バッファをクリア。
            //-------------------------------------------------------------
            ClearDelayAilment();
        }
    }
Esempio n. 18
0
        private CostInfo _getActiveSkillCost(GlobalDefine.PartyCharaIndex member_index, int active_skill_no)
        {
            CostInfo ret_val = null;

            CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(member_index, CharaParty.CharaCondition.EXIST);

            if (chara_once != null)
            {
                uint active_skill_fix_id = (active_skill_no == 0) ? chara_once.m_CharaMasterDataParam.skill_active0 : chara_once.m_CharaMasterDataParam.skill_active1;
                MasterDataSkillActive master_data_skill_active = BattleParam.m_MasterDataCache.useSkillActive(active_skill_fix_id);
                if (master_data_skill_active != null)
                {
                    ret_val = new CostInfo(master_data_skill_active.cost1, master_data_skill_active.cost2, master_data_skill_active.cost3, master_data_skill_active.cost4, master_data_skill_active.cost5);
                }
            }

            return(ret_val);
        }
Esempio n. 19
0
    //----------------------------------------------------------------------------

    /*!
     *          @brief		リンクシステム:リンクユニットIDの取得
     *          @param[in]	int		(nPartyCharaIdx)	パーティキャラ番号
     *          @return		uint	[キャラID]
     *          @note		パーティキャラから、リンクユニットのキャラIDを取得
     */
    //----------------------------------------------------------------------------
    static public uint GetLinkUnitID(GlobalDefine.PartyCharaIndex nPartyCharaIdx)
    {
        uint unResult = 0;

        //--------------------------------
        // エラーチェック
        //--------------------------------
        CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(nPartyCharaIdx, CharaParty.CharaCondition.EXIST);

        if (chara_once == null)
        {
            return(unResult);
        }

        unResult = chara_once.m_LinkParam.m_CharaID;

        return(unResult);
    }
Esempio n. 20
0
    void SetUpCharaData(ref PartyMemberUnitContext item, PacketStructUnit _mainUnit, PacketStructUnit _subUnit, bool dispCharm)
    {
        CharaOnce baseChara = new CharaOnce();

        if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
            _subUnit != null)
        {
            baseChara.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                _subUnit.id,
                (int)_subUnit.level,
                (int)_subUnit.add_pow,
                (int)_subUnit.add_hp,
                (int)_mainUnit.link_point,
                (int)_subUnit.limitover_lv
                );
        }
        else
        {
            baseChara.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }

        item.HpText  = baseChara.m_CharaHP.ToString();
        item.AtkText = baseChara.m_CharaPow.ToString();
    }
Esempio n. 21
0
    public static void cacheBattleUnitTexture()
    {
        if (BattleParam.m_PlayerParty != null)
        {
            CharaOnce[] player_party_members = BattleParam.m_PlayerParty.getPartyMembers(CharaParty.CharaCondition.EXIST);
            for (int idx = 0; idx < player_party_members.Length; idx++)
            {
                CharaOnce player_party_member = player_party_members[idx];
                BattleUnitTextureCache.Instance.loadTexture((int)player_party_member.m_CharaMasterDataParam.fix_id, false);
                if (player_party_member.m_LinkParam != null &&
                    player_party_member.m_LinkParam.m_cCharaMasterDataParam != null
                    )
                {
                    BattleUnitTextureCache.Instance.loadTexture((int)player_party_member.m_LinkParam.m_cCharaMasterDataParam.fix_id, false);
                }
            }
        }

        if (BattleParam.m_EnemyParam != null)
        {
            for (int idx = 0; idx < BattleParam.m_EnemyParam.Length; idx++)
            {
                BattleEnemy battle_enemy = BattleParam.m_EnemyParam[idx];
                if (battle_enemy != null)
                {
                    MasterDataParamChara enemy_chara = battle_enemy.getMasterDataParamChara();
                    if (enemy_chara != null)
                    {
                        BattleUnitTextureCache.Instance.loadTexture((int)enemy_chara.fix_id, false);
                    }
                }
            }
        }

        // 主人公の画像をキャッシュ
        int current_hero_id = (int)MasterDataUtil.GetCurrentHeroID();

        BattleUnitTextureCache.Instance.loadTexture(-current_hero_id, false);
    }
Esempio n. 22
0
    private void SetLinkParent(CharaOnce cCharaParam)
    {
        IsViewLinkStatus = false;
        IsViewNone       = false;
        IsViewParent     = true;

        UnitIconImageProvider.Instance.Get(
            cCharaParam.m_CharaMasterDataParam.fix_id,
            sprite =>
        {
            IconRightImage = sprite;
        });
        IconSelectRight = MainMenuUtil.GetElementCircleSprite(cCharaParam.m_CharaMasterDataParam.element);

        UnitIconImageProvider.Instance.Get(
            cCharaParam.m_LinkParam.m_CharaID,
            sprite =>
        {
            IconLeftImage = sprite;
        });
        IconSelectLeft = MainMenuUtil.GetElementCircleSprite(cCharaParam.m_LinkParam.m_cCharaMasterDataParam.element);

        ParentText = GameTextUtil.GetText("unit_linkstatus6");
    }
Esempio n. 23
0
    /// <summary>
    /// ソートパラメータ設定(フレンド)
    /// </summary>
    /// <param name="_friend"></param>
    public void setSortParamFriend(
        PacketStructFriend _friend,
        CharaOnce _baseChara,
        MasterDataParamChara _master
        )
    {
        PacketStructUnit _sub = null;

        if (_friend.unit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE)
        {
            _sub = _friend.unit_link;
        }
        int _cost = _master.party_cost;

        if (_sub != null)
        {
            _cost += CharaLinkUtil.GetLinkUnitCost(_sub.id);
        }
        UnitParam              = new UnitGridParam();
        UnitParam.draw_id      = (int)_master.draw_id;
        UnitParam.level        = (int)_friend.unit.level;
        UnitParam.hp           = _baseChara.m_CharaHP;
        UnitParam.pow          = _baseChara.m_CharaPow;
        UnitParam.plus         = _baseChara.m_CharaPlusHP + _baseChara.m_CharaPlusPow;
        UnitParam.cost         = _cost;
        UnitParam.rare         = (int)_master.rare;
        UnitParam.element_int  = SortUtil.GetSortNumElement(_master.element);
        UnitParam.kind_int     = SortUtil.GetSortNumKind(_master.kind);
        UnitParam.sub_kind_int = SortUtil.GetSortNumKind(_master.sub_kind);
        UnitParam.limitover_lv = (int)_friend.unit.limitover_lv;
        UnitParam.charm        = _baseChara.m_CharaCharm;
        UnitParam.rank         = (int)_friend.user_rank;
        UnitParam.login_time   = SortUtil.GetSortNumLoginTime(_friend.last_play);
        UnitParam.favorite     = MainMenuUtil.ChkFavoridFriend(_friend.user_id);
        UnitParam.friend_state = (int)_friend.friend_state;
    }
Esempio n. 24
0
    /// <summary>
    /// ノーマルスキルの成立を判定
    /// </summary>
    /// <param name="index"></param>
    private void _checkNormalSkill()
    {
        //通常のアクティブスキル
        int start_index = (m_OrderedSkillList.Length * m_Phase) / PHASE_MAX;
        int end_index   = (m_OrderedSkillList.Length * (m_Phase + 1)) / PHASE_MAX;

        for (int skill_idx = start_index; skill_idx < end_index; skill_idx++)
        {
            MasterDataSkillActive current_skill_active = m_OrderedSkillList[skill_idx];
            uint  current_skill_id   = current_skill_active.fix_id;
            int[] current_skill_cost = current_skill_active.GetCostPerElement();

            if (current_skill_active.always != MasterDataDefineLabel.BoolType.ENABLE)
            {
                for (int member_idx = 0; member_idx < m_WorkActiveSkillMembers.Length; member_idx++)
                {
                    CharaOnce chara_once = m_WorkActiveSkillMembers[member_idx];
                    if (chara_once != null &&
                        m_WorkIsAliveActiveSkillMembers[member_idx]
                        )
                    {
                        if (chara_once.m_CharaMasterDataParam.skill_active0 == current_skill_id ||
                            chara_once.m_CharaMasterDataParam.skill_active1 == current_skill_id
                            )
                        {
                            if (SkillRequestParam.filterSkill(current_skill_active, m_FilterTypes[member_idx]))
                            {
                                int[,] wrk_member_field_cost_info = m_WorkMemberFieldCostInfo[member_idx];
                                _checkActiveSkillFormingConditionSub(wrk_member_field_cost_info, current_skill_cost, m_WorkHandcardCostPerElement, chara_once.m_PartyCharaIndex, current_skill_id);
                            }
                        }
                    }
                }
            }
        }
    }
Esempio n. 25
0
    /**
     * プレイヤー側で使用しているマスターデータをキャッシュ.
     */
    public void CachePlayerMasterData(CharaParty player_party)
    {
        clearCachePlayerAll();

        // 常駐スキル.
        MasterDataSkillActive[] master_data_skill_active_array = null;
#if BUILD_TYPE_DEBUG && USE_DEBUG_JSON_MASTER_DATA
        if (BattleParam.m_IsUseDebugJsonMasterData)
        {
            master_data_skill_active_array = BattleMasterDataFromJson.Instance.getMasterDataAll <MasterDataSkillActive>();
            for (int idx = 0; idx < master_data_skill_active_array.Length; idx++)
            {
                MasterDataSkillActive master_data_skill_active = master_data_skill_active_array[idx];
                if (master_data_skill_active.always == MasterDataDefineLabel.BoolType.ENABLE)
                {
                    useSkillActive(master_data_skill_active.fix_id);
                }
            }
        }
        else
#endif    //USE_DEBUG_JSON_MASTER_DATA
        {
            MasterDataSkillActive[] resMasterDataSkillActiveArray = MasterFinder <MasterDataSkillActive> .Instance.SelectWhere("where always = ? ", MasterDataDefineLabel.BoolType.ENABLE).ToArray();

            if (resMasterDataSkillActiveArray != null)
            {
                foreach (MasterDataSkillActive resMasterDataSkillActive in resMasterDataSkillActiveArray)
                {
                    useSkillActive(resMasterDataSkillActive.fix_id);
                }
            }
        }

        for (int i = 0; i < player_party.getPartyMemberMaxCount(); i++)
        {
            CharaOnce chara = player_party.getPartyMember((GlobalDefine.PartyCharaIndex)i, CharaParty.CharaCondition.EXIST);
            if (chara == null)
            {
                continue;
            }

            if (!chara.m_bHasCharaMasterDataParam)
            {
                continue;
            }

            // キャラ情報を保存
            MasterDataParamChara master_data_param_chara = chara.m_CharaMasterDataParam;
            addCharaParam(master_data_param_chara);

            // リンクキャラを保存
            MasterDataParamChara master_data_param_link_chara = null;
            if (chara.m_LinkParam != null)
            {
                master_data_param_link_chara = useCharaParam(chara.m_LinkParam.m_CharaID);
            }

            //--------------------------------
            // スキル情報を保存		<アクティブ1>
            //--------------------------------
            {
                MasterDataSkillActive master_data_skill_active = useSkillActive(master_data_param_chara.skill_active0);
                if (master_data_skill_active != null)
                {
                    useSkillBoost(master_data_skill_active.skill_boost_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<アクティブ2>
            //--------------------------------
            {
                MasterDataSkillActive master_data_skill_active = useSkillActive(master_data_param_chara.skill_active1);
                if (master_data_skill_active != null)
                {
                    useSkillBoost(master_data_skill_active.skill_boost_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<リーダー>
            //--------------------------------
            {
                int loop_counter = 0;
                MasterDataSkillLeader master_data_skill_leader = useSkillLeader(master_data_param_chara.skill_leader);
                while (master_data_skill_leader != null)
                {
                    // 無限ループ検出
                    if (_checkinfiniteLoop(ref loop_counter))
                    {
                        master_data_skill_leader.add_fix_id = 0;
                        break;
                    }

                    master_data_skill_leader = useSkillLeader(master_data_skill_leader.add_fix_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<パッシブ>
            //--------------------------------
            {
                int loop_counter = 0;
                MasterDataSkillPassive master_data_skill_passive = useSkillPassive(master_data_param_chara.skill_passive);
                while (master_data_skill_passive != null)
                {
                    // 無限ループ検出
                    if (_checkinfiniteLoop(ref loop_counter))
                    {
                        master_data_skill_passive.add_fix_id = 0;
                        break;
                    }

                    master_data_skill_passive = useSkillPassive((uint)master_data_skill_passive.add_fix_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<リンクパッシブ>
            //--------------------------------
            // バトル中の判定には使わないが、ダイアログの表示に使われるので保存.
            useSkillPassive(master_data_param_chara.link_skill_passive);

            //--------------------------------
            // スキル情報を保存		<リミブレ>
            //--------------------------------
            {
                int loop_counter = 0;
                MasterDataSkillLimitBreak master_data_skill_limit_break = useSkillLimitBreak(master_data_param_chara.skill_limitbreak);
                while (master_data_skill_limit_break != null)
                {
                    // 無限ループ検出
                    if (_checkinfiniteLoop(ref loop_counter))
                    {
                        master_data_skill_limit_break.add_fix_id = 0;
                        break;
                    }

                    master_data_skill_limit_break = useSkillLimitBreak((uint)master_data_skill_limit_break.add_fix_id);
                }
            }

            //--------------------------------
            // スキル情報を保存		<リンク>
            //--------------------------------
            if (master_data_param_link_chara != null)
            {
                //--------------------------------
                // スキル情報を保存		<リンクスキル>
                //--------------------------------
                useSkillActive(master_data_param_link_chara.skill_active0);

                //--------------------------------
                // スキル情報を保存		<リンクパッシブ>
                //--------------------------------
                {
                    int loop_counter = 0;
                    MasterDataSkillPassive master_data_skill_passive = useSkillPassive(master_data_param_link_chara.link_skill_passive);
                    while (master_data_skill_passive != null)
                    {
                        // 無限ループ検出
                        if (_checkinfiniteLoop(ref loop_counter))
                        {
                            master_data_skill_passive.add_fix_id = 0;
                            break;
                        }

                        master_data_skill_passive = useSkillPassive((uint)master_data_skill_passive.add_fix_id);
                    }
                }
            }
        }
    }
Esempio n. 26
0
    /// <summary>
    /// リンクボーナス設定
    /// </summary>
    /// <param name="skill_id"></param>
    public uint setupLinkEffectInfo(CharaOnce cCharaOnce, MasterDataParamChara cCharaMasterData, bool bLink)
    {
        BaseHeight  = BASE_LINK_BONUS_HEIGHT;
        TitleHeight = TITLE_DEFAULT_HEIGHT;
        TitleWidth  = LINK_BONUS_TITLE_WIDTH;
        MessageBgH  = LINK_MESSAGE_BG_HEIGHT;
        setLinkTitleImage("skill_name_bg1", "linkubo-nasu");
        LvLabel      = GameTextUtil.GetText("unit_status4");
        HpLabel      = GameTextUtil.GetText("unit_status5");
        AtkLabel     = GameTextUtil.GetText("unit_status6");
        CostLabel    = GameTextUtil.GetText("unit_status8");
        LinkLabel    = GameTextUtil.GetText("unit_linkstatus3");
        CharmLabel   = GameTextUtil.GetText("unit_status9");
        IsSkillItem  = false;
        IsViewStatus = true;
        IsViewIcon   = true;


        //
        LinkTitleText = "";

        //----------------------------------------
        // リンク効果設定
        //----------------------------------------
        //int nUnitId = (int)cCharaMasterData.fix_id;
        int    nLv      = cCharaOnce.m_CharaLevel;
        int    nPlusHp  = cCharaOnce.m_CharaPlusHP;
        int    nPlusPow = cCharaOnce.m_CharaPlusPow;
        int    nCost    = cCharaMasterData.party_cost;
        uint   unID     = cCharaMasterData.fix_id;
        double nCharm   = 0;

        //------------------------------------------------------------
        // LINK BONUS
        //------------------------------------------------------------
        //レベル
        Lv = nLv;

        //HP
        int nHp = (CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, 0, CharaUtil.VALUE.HP) +
                   CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP));

        // ATK
        int nPow = (CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, 0, CharaUtil.VALUE.POW) +
                    CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW));

        //COST
        Cost = nCost;

        //アイコン
        IsViewIcon = false;

        uint nLinkPoint = 0;

        //リンクポイント
        if (bLink)
        {
            //リンク子の場合はリンクポイントを反映
            nLinkPoint = (uint)cCharaOnce.m_LinkParam.m_CharaLinkPoint;
            float fLinkPoint = nLinkPoint * 0.01f;
            Link = string.Format(GameTextUtil.GetText("unit_linkstatus4"), fLinkPoint);
        }
        else
        {
            //ハイフン表示
            Link = EmptyStr;
        }

        uint nLimitOverLevel = (uint)cCharaOnce.m_CharaLimitOver;

        if (nLimitOverLevel > 0)
        {
            // 限界突破タイプ
            int nLimitOverType = cCharaMasterData.limit_over_type;

            // 限界突破後のコスト
            //Cost = (int)CharaLimitOver.GetParam(nLimitOverLevel, nLimitOverType, (int)CharaLimitOver.EGET.ePARAM_COST);

            // 限界突破後のHp
            nHp = CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, nLimitOverLevel, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP);

            // 限界突破後のPow
            nPow = CharaLinkUtil.GetLinkUnitBonusElement(unID, nLv, nLimitOverLevel, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW);

            // CHARM
            nCharm = CharaLimitOver.GetParamCharm(nLimitOverLevel, nLimitOverType);
        }

        if (nPlusHp > 0)
        {
            Hp = string.Format(GameTextUtil.GetText("unit_status19"), nHp, nPlusHp);
        }
        else
        {
            Hp = nHp.ToString();
        }

        if (nPlusPow > 0)
        {
            Atk = string.Format(GameTextUtil.GetText("unit_status19"), nPow, nPlusPow);
        }
        else
        {
            Atk = nPow.ToString();
        }

        Charm = nCharm.ToString("F1");

        return(nLinkPoint);
    }
Esempio n. 27
0
    /// <summary>
    /// リンクボーナス設定
    /// </summary>
    /// <param name="skill_id"></param>
    public void setupUnitData(CharaOnce cCharaParam, MasterDataParamChara cCharaMasterData)
    {
        BaseHeight  = BASE_LINK_BONUS_HEIGHT;
        TitleHeight = TITLE_DEFAULT_HEIGHT;
        TitleWidth  = LINK_BONUS_TITLE_WIDTH;
        MessageBgH  = LINK_MESSAGE_BG_HEIGHT;
        setLinkTitleImage("skill_name_bg1", "linkubo-nasu");
        LvLabel      = GameTextUtil.GetText("unit_status4");
        HpLabel      = GameTextUtil.GetText("unit_status5");
        AtkLabel     = GameTextUtil.GetText("unit_status6");
        CostLabel    = GameTextUtil.GetText("unit_status8");
        LinkLabel    = GameTextUtil.GetText("unit_linkstatus3");
        CharmLabel   = GameTextUtil.GetText("unit_status9");
        IsSkillItem  = false;
        IsViewStatus = true;
        IsViewIcon   = true;


        //--------------------------------
        // 選択されているユニット情報を選定
        //--------------------------------
        uint unCharaLevel = (uint)cCharaParam.m_CharaLevel;  // キャラレベル
                                                             // +情報

        //----------------------------------------
        // リンク情報の設定 v300対応
        //----------------------------------------

        //リンクキャラの定義取得
        uint unCharaId = cCharaParam.m_LinkParam.m_CharaID;
        // リンク対象ユニット
        MasterDataParamChara cCharaParamLink = MasterDataUtil.GetCharaParamFromID(unCharaId);
        // コスト
        int nCharaCost = cCharaMasterData.party_cost;

        if (unCharaId > 0 &&
            cCharaParamLink != null)
        {
            //------------------------------------------------------------
            // LINK BONUS
            //------------------------------------------------------------
            //ユニット名
            LinkTitleText = cCharaParamLink.name;

            //レベル
            Lv = cCharaParam.m_LinkParam.m_CharaLv;

            //HP
            int nHp = (CharaLinkUtil.GetLinkUnitBonusElement(cCharaParamLink, cCharaParam.m_LinkParam.m_CharaLv, 0, CharaUtil.VALUE.HP) +
                       CharaLinkUtil.GetLinkUnitBonusPlus(cCharaParam.m_LinkParam.m_CharaPlusHP, CharaUtil.VALUE.HP));
            int nPlusHp = cCharaParam.m_LinkParam.m_CharaPlusHP;
            // ATK
            int nPow = (CharaLinkUtil.GetLinkUnitBonusElement(cCharaParamLink, cCharaParam.m_LinkParam.m_CharaLv, 0, CharaUtil.VALUE.POW) +
                        CharaLinkUtil.GetLinkUnitBonusPlus(cCharaParam.m_LinkParam.m_CharaPlusPow, CharaUtil.VALUE.POW));
            int nPlusPow = cCharaParam.m_LinkParam.m_CharaPlusPow;

            double nCharm = 0;

            //COST
            Cost = cCharaParamLink.party_cost;

            // リンクポイント
            float fLinkPoint = (cCharaParam.m_LinkParam.m_CharaLinkPoint) * 0.01f;
            Link = string.Format(GameTextUtil.GetText("unit_linkstatus4"), fLinkPoint);

            uint nLimitOverLevel = (uint)cCharaParam.m_LinkParam.m_CharaLOLevel;

            if (nLimitOverLevel > 0)
            {
                // 限界突破タイプ
                int nLimitOverType = cCharaParamLink.limit_over_type;

                // 限界突破後のコスト
                //Cost = (int)CharaLimitOver.GetParam(nLimitOverLevel, nLimitOverType, (int)CharaLimitOver.EGET.ePARAM_COST);

                // 限界突破後のHp
                nHp = CharaLinkUtil.GetLinkUnitBonusElement(unCharaId, Lv, nLimitOverLevel, CharaUtil.VALUE.HP) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusHp, CharaUtil.VALUE.HP);

                // 限界突破後のPow
                nPow = CharaLinkUtil.GetLinkUnitBonusElement(unCharaId, Lv, nLimitOverLevel, CharaUtil.VALUE.POW) + CharaLinkUtil.GetLinkUnitBonusPlus(nPlusPow, CharaUtil.VALUE.POW);

                // CHARM
                nCharm = CharaLimitOver.GetParamCharm(nLimitOverLevel, nLimitOverType);
            }

            //キャラアイコン
            IsViewIcon = true;
            IconSelect = MainMenuUtil.GetElementCircleSprite(cCharaParamLink.element);
            UnitIconImageProvider.Instance.Get(
                cCharaParamLink.fix_id,
                sprite =>
            {
                IconImage = sprite;
            });

            if (nPlusHp > 0)
            {
                Hp = string.Format(GameTextUtil.GetText("unit_status19"), nHp, nPlusHp);
            }
            else
            {
                Hp = nHp.ToString();
            }

            if (nPlusPow > 0)
            {
                Atk = string.Format(GameTextUtil.GetText("unit_status19"), nPow, nPlusPow);
            }
            else
            {
                Atk = nPow.ToString();
            }

            Charm = nCharm.ToString("F1");
        }
    }
Esempio n. 28
0
    void initPlayerParty2()
    {
        // マスターーデータ
        BattleParam.m_MasterDataCache = m_MasterDataCache;

        // ステージ情報
        BattleParam.m_QuestAreaID    = 0;
        BattleParam.m_QuestMissionID = 0;
        BattleParam.m_QuestFloor     = 0;
        BattleParam.m_AcquireKey     = false;

        //
        BattleParam.ClrLBS();
        BattleParam.m_SkillRequestLimitBreak = new SkillRequestParam(BattleParam.SKILL_LIMIT_BREAK_ADD_MAX);

#if UNITY_EDITOR
        BattleParam.m_IsDamageOutput = false;
#endif

        // プレイヤーパーティメンバー
        if (m_BattleData.m_PlayerParty.m_PlayerCharas != null)
        {
            CharaOnce[] player_party_chara = new CharaOnce[m_BattleData.m_PlayerParty.m_PlayerCharas.Length];
            for (int idx = 0; idx < m_BattleData.m_PlayerParty.m_PlayerCharas.Length; idx++)
            {
                PlayerCharaData player_chara_data = m_BattleData.m_PlayerParty.m_PlayerCharas[idx];
                if (player_chara_data != null)
                {
                    MasterDataParamChara master_data = m_MasterDataCache.useCharaParam((uint)player_chara_data.m_CharaID);
                    if (master_data != null)
                    {
                        CharaOnce chara_once = new CharaOnce();
                        if (player_chara_data.m_CharaLevel < 1)
                        {
                            player_chara_data.m_CharaLevel = 1;
                        }
                        if (player_chara_data.m_CharaLevel > master_data.level_max)
                        {
                            player_chara_data.m_CharaLevel = master_data.level_max;
                        }

                        chara_once.CharaSetupFromID((uint)player_chara_data.m_CharaID,
                                                    player_chara_data.m_CharaLevel,
                                                    player_chara_data.m_SkillLevel,
                                                    player_chara_data.m_LimitOverLevel,
                                                    player_chara_data.m_PlusPower,
                                                    player_chara_data.m_PlusHP,

                                                    (uint)player_chara_data.m_LinkCharaID,
                                                    player_chara_data.m_LinkCharaLevel,
                                                    player_chara_data.m_LinkPlusPower,
                                                    player_chara_data.m_LinkPlusHP,
                                                    player_chara_data.m_LinkFriendry,
                                                    player_chara_data.m_LinkLimitOverLevel
                                                    );

                        player_party_chara[idx] = chara_once;
                    }
                }
            }

            // プレイヤーパーティ
            BattleParam.m_PlayerParty = new CharaParty();
            BattleParam.m_PlayerParty.setHero(m_HeroParam.m_Level, (uint)m_HeroParam.m_HeroSkillID);
            BattleParam.m_PlayerParty.PartySetup(player_party_chara, m_IsKobetsuHP);
            BattleParam.m_PlayerParty.m_PartyTotalSP = m_BattleData.m_PlayerParty.m_SP;

            // ステージ情報
            BattleParam.m_QuestAreaID    = (uint)m_BattleData.m_AreaData.m_AreaID;
            BattleParam.m_QuestMissionID = 0;
            BattleParam.m_QuestFloor     = 0;
            BattleParam.m_AcquireKey     = false;
        }

        if (InGameUtil.IsLocalData())
        {
            SceneGoesParamToQuest2Restore restore = SceneGoesParam.Instance.m_SceneGoesParamToQuest2Restore;
            RestorePlayerParty            restore_player_party = restore.m_PlayerPartyRestore;
            if (restore_player_party != null)
            {
                CharaOnce[] player_party_chara = new CharaOnce[(int)GlobalDefine.PartyCharaIndex.MAX];
                for (int idx = 0; idx < player_party_chara.Length; idx++)
                {
                    CharaOnce chara_once = new CharaOnce();
                    chara_once.CharaSetupFromID(restore_player_party.m_PartyCharaID[idx],
                                                restore_player_party.m_PartyCharaLevel[idx],
                                                restore_player_party.m_PartyCharaLBSLv[idx],
                                                restore_player_party.m_PartyCharaLimitOver[idx],
                                                restore_player_party.m_PartyCharaPlusPow[idx],
                                                restore_player_party.m_PartyCharaPlusHP[idx],

                                                restore_player_party.m_PartyCharaLinkID[idx],
                                                restore_player_party.m_PartyCharaLinkLv[idx],
                                                restore_player_party.m_PartyCharaLinkPlusPow[idx],
                                                restore_player_party.m_PartyCharaLinkPlusHP[idx],
                                                restore_player_party.m_PartyCharaLinkPoint[idx],
                                                restore_player_party.m_PartyCharaLinkLimitOver[idx]
                                                );

                    //------------------------------
                    // リミットブレイクコスト復帰
                    //------------------------------
                    chara_once.m_CharaLimitBreak = restore.m_PlayerPartyRestore.m_PartyCharaLimitBreak[idx];

                    player_party_chara[idx] = chara_once;
                }

                // プレイヤーパーティ
                BattleParam.m_PlayerParty = new CharaParty();
                BattleParam.m_PlayerParty.setHero(0 /*m_HeroParam.m_Level*/, 0 /*(uint)m_HeroParam.m_HeroSkillID*/);
                BattleParam.m_PlayerParty.PartySetup(player_party_chara, restore_player_party.m_IsKobetsuHP);

                //------------------------------
                // パーティ状態異常復帰(CharaParty.PartySetup() より後に復帰)
                //------------------------------
                BattleParam.m_PlayerParty.m_Ailments = restore_player_party.m_PartyAilments;
                BattleParam.m_PlayerParty.m_Ailments.restoreFromSaveData();

                BattleParam.m_PlayerParty.m_HPCurrent.setValue(GlobalDefine.PartyCharaIndex.MAX, restore_player_party.m_QuestHP);
                BattleParam.m_PlayerParty.m_PartyTotalSP = restore_player_party.m_QuestSP;
                BattleParam.m_PlayerParty.m_HPMax.setValue(GlobalDefine.PartyCharaIndex.MAX, restore_player_party.m_QuestHPMax);
                BattleParam.m_PlayerParty.m_PartyTotalSPMax   = restore_player_party.m_QuestSPMax;
                BattleParam.m_PlayerParty.m_Hate              = restore_player_party.m_Hate;
                BattleParam.m_PlayerParty.m_Hate_ProvokeTurn  = restore_player_party.m_Hate_ProvokeTurn;
                BattleParam.m_PlayerParty.m_Hate_ProvokeOrder = restore_player_party.m_Hate_ProvokeOrder;

                BattleParam.m_PlayerParty.m_BattleHero.restoreSkillTurn(restore_player_party.m_HeroSkillTurn);
                BattleParam.m_PlayerParty.m_BattleAchive = restore_player_party.m_BattleAchive;
            }
        }
    }
Esempio n. 29
0
    public void setup(MasterDataParamChara _chara, MasterDataParamCharaEvol _evolve = null, Texture2D _charaTexture = null, bool nameView = true)
    {
        charaMaster     = _chara;
        evolMaster      = _evolve;
        charaTexture    = _charaTexture;
        limitOverMaster = MasterFinder <MasterDataLimitOver> .Instance.Find((int)charaMaster.limit_over_type);

        IsViewNamePanel     = nameView;
        IsViewMaterialPanel = false;
        IsViewFloatWindow   = false;
        if (evolMaster != null)
        {
            IsViewMaterialPanel = true;

            MaterialValue = "";
            MaterialList.Clear();
            MaterialLabelX = -190;
            if (evolMaster.unit_id_parts1 != 0)
            {
                addMaterial(evolMaster.unit_id_parts1);
                MaterialLabelX += 64;
            }
            if (evolMaster.unit_id_parts2 != 0)
            {
                addMaterial(evolMaster.unit_id_parts2);
                MaterialLabelX += 64;
            }
            if (evolMaster.unit_id_parts3 != 0)
            {
                addMaterial(evolMaster.unit_id_parts3);
                MaterialLabelX += 64;
            }
            if (evolMaster.unit_id_parts4 != 0)
            {
                addMaterial(evolMaster.unit_id_parts4);
                MaterialLabelX += 64;
            }
        }

        charaOnce = new CharaOnce();
        charaOnce.CharaSetupFromID(
            charaMaster.fix_id,
            (int)charaMaster.level_max,
            (int)0,
            (int)limitOverMaster.limit_over_max,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0
            );

        Level          = string.Format(GameTextUtil.GetText("unit_status16"), charaOnce.m_CharaLevel, charaMaster.level_max);
        Hp             = charaOnce.m_CharaHP.ToString();
        HpPlus         = "";
        Atk            = charaOnce.m_CharaPow.ToString();
        AtkPlus        = "";
        Cost           = charaMaster.party_cost.ToString();
        LimitOver      = string.Format(GameTextUtil.GetText("unit_status16"), limitOverMaster.limit_over_max, limitOverMaster.limit_over_max);
        Charm          = charaOnce.m_CharaCharm.ToString("F1");
        ProfileMessage = charaMaster.detail.ReplaceSpaceTag(29).NoLineBreakTag();
    }
Esempio n. 30
0
    void SetUpCharaData(ref PartyMemberStatusListItemContext item, PacketStructUnit _mainUnit, PacketStructUnit _subUnit, bool dispCharm, PacketStructUnit[] partyUnits)
    {
        CharaOnce baseChara = new CharaOnce();

        if (_mainUnit.link_info == (uint)ServerDataDefine.CHARALINK_TYPE.CHARALINK_TYPE_BASE &&
            _subUnit != null)
        {
            baseChara.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                _subUnit.id,
                (int)_subUnit.level,
                (int)_subUnit.add_pow,
                (int)_subUnit.add_hp,
                (int)_mainUnit.link_point,
                (int)_subUnit.limitover_lv
                );
        }
        else
        {
            baseChara.CharaSetupFromID(
                _mainUnit.id,
                (int)_mainUnit.level,
                (int)_mainUnit.limitbreak_lv,
                (int)_mainUnit.limitover_lv,
                (int)_mainUnit.add_pow,
                (int)_mainUnit.add_hp,
                0,
                0,
                0,
                0,
                0,
                0
                );
        }

        var changeHp   = (int)(baseChara.m_CharaHP * MainMenuUtil.GetLeaderSkillHpRate(baseChara, partyUnits));
        var statusText = string.Format(GameTextUtil.GetText("questlast_text4"), changeHp);

        if (changeHp > baseChara.m_CharaHP)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text8"), changeHp);
        }
        else if (changeHp < baseChara.m_CharaHP)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text9"), changeHp);
        }
        item.HpText = statusText;

        var changePow = (int)(baseChara.m_CharaPow * MainMenuUtil.GetLeaderSkillDamageRate(baseChara, MainMenuUtil.GetPartyCharaOnceArray(partyUnits)));

        statusText = string.Format(GameTextUtil.GetText("questlast_text4"), changePow);
        if (changePow > baseChara.m_CharaPow)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text8"), changePow);
        }
        else if (changePow < baseChara.m_CharaPow)
        {
            statusText = string.Format(GameTextUtil.GetText("questlast_text9"), changePow);
        }
        item.AtkText = statusText;

        item.Cost  = ServerDataUtil.GetPacketUnitCost(_mainUnit) + CharaLinkUtil.GetLinkUnitCost(_mainUnit);
        item.Charm = baseChara.m_CharaCharm;
    }