private bool CheckAilmentDif(int[] anAilmentIDLH, MasterDataDefineLabel.TargetType nAilmentTargetLH, int[] anAilmentIDRH, MasterDataDefineLabel.TargetType nAilmentTargetRH) { if (null == anAilmentIDLH || null == anAilmentIDRH) { return(false); } MasterDataStatusAilmentParam cAilmentParamLH = null; MasterDataStatusAilmentParam cAilmentParamRH = null; for (int i = 0; i < anAilmentIDLH.Length; ++i) { if (0 == anAilmentIDLH[i]) // ← 2016/11/04 Developer 修正。元のプログラムでは状態異常のIDと種類を比較していた //if( MasterDataDefineLabel.AilmentType.NONE == anAilmentIDLH[i] ) { continue; } cAilmentParamLH = BattleParam.m_MasterDataCache.useAilmentParam((uint)anAilmentIDLH[i]); if (null == cAilmentParamLH) { continue; } for (int j = 0; j < anAilmentIDRH.Length; ++j) { if (0 == anAilmentIDRH[j]) // ← 2016/11/04 Developer 修正。元のプログラムでは状態異常のIDと種類を比較していた //if( MasterDataDefineLabel.AilmentType.NONE == anAilmentIDRH[j] ) { continue; } cAilmentParamRH = BattleParam.m_MasterDataCache.useAilmentParam((uint)anAilmentIDRH[j]); if (null == cAilmentParamRH) { continue; } if ((cAilmentParamLH.category != cAilmentParamRH.category) || (nAilmentTargetLH != nAilmentTargetRH)) { // 状態異常の効果が違う or 状態異常の対象が違う 場合、新規と見なす。 // ※同じ状態異常効果でも「敵にかかる」「味方にかかる」と異なる場合があるため、対象の相違をOR判定に加えている。 return(true); } } } return(false); }
public void setupCharaAilmentInfo(StatusAilmentChara ailmentChara) { AddAilmentInfo(GameTextUtil.GetText("battle_infotext1"), -1); int count = 1; for (int num = 0; num < (int)MasterDataDefineLabel.AilmentType.MAX; ++num) { if (ailmentChara.IsHavingAilment((MasterDataDefineLabel.AilmentType)num) == false) { continue; } int turn = 0; string detail = ""; // 残りターン数を取得 for (int n = 0; n < ailmentChara.GetAilmentCount(); ++n) { StatusAilment status_ailment = ailmentChara.GetAilment(n); if (status_ailment == null) { continue; } MasterDataDefineLabel.AilmentType type = status_ailment.nType; if (type != (MasterDataDefineLabel.AilmentType)num) { continue; } turn = status_ailment.nLife; MasterDataStatusAilmentParam master = MasterDataUtil.GetMasterDataStatusAilmentParam(status_ailment.nMasterDataStatusAilmentID); detail = master.detail; if (detail == "") { detail = master.name; } break; } AddAilmentInfo(detail, turn); ++count; } if (count == 1) { AddAilmentInfo("-", -1); } }
public static void outputAilment(StatusAilmentChara chara_ailment) { for (int idx = 0; idx < chara_ailment.cAilment.Length; idx++) { StatusAilment ailment = chara_ailment.cAilment[idx]; if (ailment != null && ailment.bUsed ) { MasterDataStatusAilmentParam ailment_master = BattleParam.m_MasterDataCache.useAilmentParam((uint)ailment.nMasterDataStatusAilmentID); DebugBattleLog.writeText(DebugBattleLog.StrOpe + " 状態変化" + " FixID:" + ailment.nMasterDataStatusAilmentID.ToString() + " 効果種類:" + ailment.nType.ToString() + " 残ターン数:" + ailment.nLife + " 発動者ATK:" + ailment.nBaseAtk + " 受動者HP:" + ailment.nBaseHPMax + ((ailment_master != null) ? " 効果値(割合):" + ailment_master.Get_VALUE_RATE() : "") + ((ailment_master != null) ? " 効果値(固定):" + ailment_master.Get_VALUE_FIX() : "") + " [" + ((ailment_master != null) ? ailment_master.name : "") + "]" ); } } }
private void setSkillInfo() { int panel_put_count_base = PANEL_PUT_COUNT_BASE; #if BUILD_TYPE_DEBUG // パネル配置数をデバッグメニューの値で上書き { int debug_panel_put_count = BattleDebugMenu.getAutoPlayPanelPutCount(); if (debug_panel_put_count > 0) { panel_put_count_base = debug_panel_put_count; } } #endif //BUILD_TYPE_DEBUG m_SkillWorksInfo.init(panel_put_count_base); // オートプレイスキルの効果を集約 bool is_applied_ailment = false; for (int member_idx = 0; member_idx < MEMBER_ORDER.Length; member_idx++) { GlobalDefine.PartyCharaIndex member_type = MEMBER_ORDER[member_idx]; CharaOnce chara_once = BattleParam.m_PlayerParty.getPartyMember(member_type, CharaParty.CharaCondition.SKILL_PASSIVE); if (chara_once != null) { #if BUILD_TYPE_DEBUG // デバッグメニューで設定されたスキルを適用 { MasterDataDefineLabel.AutoPlaySkillType[] debug_skills = BattleDebugMenu.getAutoPlaySkill(member_type); if (debug_skills.IsNullOrEmpty() == false) { for (int debug_skill_idx = 0; debug_skill_idx < debug_skills.Length; debug_skill_idx++) { MasterDataDefineLabel.AutoPlaySkillType debug_skill_type = debug_skills[debug_skill_idx]; m_SkillWorksInfo.applySkill(debug_skill_type, member_type, false); } } } #endif //BUILD_TYPE_DEBUG // メインユニットのパッシブスキル { MasterDataSkillPassive passive_skill_master = BattleParam.m_MasterDataCache.useSkillPassive(chara_once.m_CharaMasterDataParam.skill_passive); if (passive_skill_master != null) { m_SkillWorksInfo.applySkill(passive_skill_master, member_type, false); } } // リンクユニットのパッシブスキル if (chara_once.m_LinkParam != null && chara_once.m_LinkParam.m_CharaID != 0 ) { MasterDataParamChara link_chara_master = BattleParam.m_MasterDataCache.useCharaParam(chara_once.m_LinkParam.m_CharaID); if (link_chara_master != null) { MasterDataSkillPassive link_passive_skill_master = BattleParam.m_MasterDataCache.useSkillPassive(link_chara_master.link_skill_passive); if (link_passive_skill_master != null) { m_SkillWorksInfo.applySkill(link_passive_skill_master, member_type, true); } } } // 状態異常にあるオートプレイ用スキルを反映 if (is_applied_ailment == false) { is_applied_ailment = true; StatusAilmentChara status_ailment_chara = BattleParam.m_PlayerParty.m_Ailments.getAilment(member_type); if (status_ailment_chara != null) { for (int ailment_idx = 0; ailment_idx < status_ailment_chara.GetAilmentCount(); ailment_idx++) { StatusAilment status_ailment = status_ailment_chara.GetAilment(ailment_idx); if (status_ailment != null) { if (status_ailment.nType == MasterDataDefineLabel.AilmentType.AUTO_PLAY_SKILL) { MasterDataStatusAilmentParam ailment_param = BattleParam.m_MasterDataCache.useAilmentParam((uint)status_ailment.nMasterDataStatusAilmentID); if (ailment_param != null) { MasterDataDefineLabel.AutoPlaySkillType auto_play_skill_type = ailment_param.Get_AUTO_PLAY_SKILL_TYPE(); m_SkillWorksInfo.applySkill(auto_play_skill_type, member_type, false); } } } } } } } } m_SkillWorksInfo.fix(); }
//---------------------------------------------------------------------------- // @brief 状態異常処理 //---------------------------------------------------------------------------- public void SkillUpdate_StatusAilment(BattleSkillActivity activity, int nAtk, BattleSceneUtil.MultiInt nHPMax, BattleEnemy[] enemy_param) { if (activity == null || activity.m_SkillParamTarget == null || activity.m_statusAilment == null) { return; } bool clearOnAttack = true; int statusAilment_data_id = 0; MasterDataStatusAilmentParam statusAilmentParam = null; BattleSkillTarget cBattleTarget = null; BattleSceneManager battleMgr = BattleSceneManager.Instance; if (battleMgr == null) { return; } // 発行された状態異常を全て処理する for (int j = 0; j < activity.m_statusAilment.Length; j++) { statusAilment_data_id = activity.m_statusAilment[j]; if (statusAilment_data_id == 0) { continue; } statusAilmentParam = BattleParam.m_MasterDataCache.useAilmentParam((uint)statusAilment_data_id); if (statusAilmentParam == null) { Debug.LogError("statusAilment Param not found."); continue; } // 遅延のスキルは全員の効果がきれるまで再度この効果をかけることが出来ない if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR) { for (int k = 0; k < enemy_param.Length; k++) { if (enemy_param[k] == null) { continue; } if (enemy_param[k].isDead() == true) { continue; } if (enemy_param[k].getAttackFlag() == true) { continue; } clearOnAttack = false; } } // 誰かがまだ攻撃をしていない if (clearOnAttack == false) { continue; } // 状態異常に設定されたターゲットをみて処理 switch (activity.m_statusAilment_target) { case MasterDataDefineLabel.TargetType.NONE: default: break; case MasterDataDefineLabel.TargetType.FRIEND: case MasterDataDefineLabel.TargetType.SELF: //---------------------------------------- // プレイヤー側状態異常処理 //---------------------------------------- { GlobalDefine.PartyCharaIndex target_player = GlobalDefine.PartyCharaIndex.MAX; BattleParam.m_PlayerParty.m_Ailments.AddStatusAilmentToPlayerParty(target_player, statusAilment_data_id, nAtk, nHPMax); } break; case MasterDataDefineLabel.TargetType.OTHER: //---------------------------------------- // 敵単体(スキル側で指定されたターゲット) //---------------------------------------- { bool ailmentAddResult = false; for (int i = 0; i < activity.m_SkillParamTarget.Length; i++) { cBattleTarget = activity.m_SkillParamTarget[i]; if (cBattleTarget == null) { continue; } BattleEnemy enemyParam = enemy_param[cBattleTarget.m_TargetNum]; if (enemyParam == null) { continue; } if (enemyParam.isDead() == true) { continue; } // 状態異常処理 // @change Developer 2016/02/23 v330 毒[最大HP割合]対応 ailmentAddResult = enemyParam.m_StatusAilmentChara.AddStatusAilment(statusAilment_data_id, nAtk, enemyParam.m_EnemyHPMax, enemyParam.getMasterDataParamChara()); // NEXTのターンを加算(特殊処理) // 上限数以上の場合、遅延効果が発動しないように修正 @20150512 Developer if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR && ailmentAddResult == true) { int nTurn = (int)RandManager.GetRand((uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MIN(), (uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MAX()); enemyParam.AddTurn(nTurn); } } } break; case MasterDataDefineLabel.TargetType.ENEMY: case MasterDataDefineLabel.TargetType.ENE_N_1: case MasterDataDefineLabel.TargetType.ENE_1N_1: case MasterDataDefineLabel.TargetType.ENE_R_N: case MasterDataDefineLabel.TargetType.ENE_1_N: //---------------------------------------- // 敵全体 //---------------------------------------- { BattleEnemy enemyParam = null; bool ailmentAddResult = false; for (int k = 0; k < enemy_param.Length; k++) { enemyParam = enemy_param[k]; if (enemyParam == null) { continue; } if (enemyParam.isDead() == true) { continue; } // 状態異常処理 // @change Developer 2016/02/23 v330 毒[最大HP割合]対応 ailmentAddResult = enemyParam.m_StatusAilmentChara.AddStatusAilment(statusAilment_data_id, nAtk, enemyParam.m_EnemyHPMax, enemyParam.getMasterDataParamChara()); // NEXTのターンを加算(特殊処理) // 上限数以上の場合、遅延効果が発動しないように修正 @20150512 Developer if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR && ailmentAddResult == true) { int nTurn = (int)RandManager.GetRand((uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MIN(), (uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MAX()); enemyParam.AddTurn(nTurn); } } } break; case MasterDataDefineLabel.TargetType.ALL: //---------------------------------------- // 全員 //---------------------------------------- { // プレイヤー側状態異常処理 GlobalDefine.PartyCharaIndex target_player = GlobalDefine.PartyCharaIndex.MAX; BattleParam.m_PlayerParty.m_Ailments.AddStatusAilmentToPlayerParty(target_player, statusAilment_data_id, nAtk, nHPMax); BattleEnemy enemyParam = null; bool ailmentAddResult = false; // 敵全体 for (int k = 0; k < enemy_param.Length; k++) { enemyParam = enemy_param[k]; if (enemyParam == null) { continue; } if (enemyParam.isDead() == true) { continue; } // 状態異常処理 // @change Developer 2016/02/23 v330 毒[最大HP割合]対応 ailmentAddResult = enemyParam.m_StatusAilmentChara.AddStatusAilment(statusAilment_data_id, nAtk, enemyParam.m_EnemyHPMax, enemyParam.getMasterDataParamChara()); // NEXTのターンを加算(特殊処理) // 上限数以上の場合、遅延効果が発動しないように修正 @20150512 Developer if (statusAilmentParam.category == MasterDataDefineLabel.AilmentType.FEAR && ailmentAddResult == true) { int nTurn = (int)RandManager.GetRand((uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MIN(), (uint)statusAilmentParam.Get_ABSTATE_LATE_TURN_MAX()); enemyParam.AddTurn(nTurn); } } } break; } } }