public override void Enter(CardAbilityData abilityData) { iWaitFrame = 0; base.Enter(abilityData); // 現在のターンを取得 int turn = GameObject.Find("GameMain").GetComponent <SceneMain>().turn; int joukenTurn = abilityData.c_value0; PowerRange range = (PowerRange)abilityData.c_value1; Debug.Log("ターン条件チェックするクマ"); // 条件チェック bool isOK = CheckRange(range, turn, joukenTurn); if (isOK) { Debug.Log("条件満たしてる"); // 成功時の効果に移行 abilityData.skillNumber = abilityData.c_value2; // Ability列車 ターン条件効果発動(条件成功時) ActionEffectUVInfo info = new ActionEffectUVInfo(); info.iEffectType = (int)UV_EFFECT_TYPE.SKILL_WIN; info.fPosX = abilityData.GetFieldStrikerPosition().x; info.fPosY = abilityData.GetFieldStrikerPosition().y; info.fPosZ = abilityData.GetFieldStrikerPosition().z; MessageManager.DispatchOffline(CardAbilityData.playerManager.GetPlayerID(abilityData.isMyPlayer), MessageType.ActionEffectUV, info); // 効果発動SE oulAudio.PlaySE("action_ability"); } else { Debug.Log("条件満たしていない"); // 失敗時の効果に移行 abilityData.skillNumber = abilityData.c_value3; // Ability列車 ターン条件効果発動(条件満たしてない時) } }
protected bool CheckRange(PowerRange range, int value0, int value1) { switch (range) { case PowerRange.Pinpoint: Debug.Log(value0 + "==" + value1); return(value0 == value1); case PowerRange.Ijou: Debug.Log(value0 + ">=" + value1); return(value0 >= value1); case PowerRange.Ika: Debug.Log(value0 + "<=" + value1); return(value0 <= value1); default: Debug.LogWarning("パワーレンジの値おかしいクマ"); return(false); } }