서브 미션
This commit is contained in:
parent
2436f4bd76
commit
7a62129e89
|
|
@ -28,10 +28,7 @@
|
|||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
서브 미션
|
||||
광제 광고 제거
|
||||
앨범 수집 목록
|
||||
데이터 저장, 불러오기 (구글 플레이센터로 변경)
|
||||
|
||||
|
||||
광고 시청 횟수는3회 (딜레이 없음)
|
||||
광고 시청 3회 모두 소진할 경우, 1시간마다 1개씩 광고 기회 충전
|
||||
세이브 데이터 암호화
|
||||
데이터 저장, 불러오기 (구글 플레이센터로 변경)
|
||||
|
|
@ -4,8 +4,10 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public class CardTypeComparer : IComparer<ECardType>
|
||||
{
|
||||
|
|
@ -584,7 +586,7 @@ public partial class GamePanel : MonoBehaviour
|
|||
MissionOpenPopup_Main.MissionCards.All(card => _lstPlayerScoreCards.Contains(card)))
|
||||
{
|
||||
AddMultiplyType(EScoreMutiplyType.MainMission);
|
||||
ShowMainMissionPopup = MissionSuccessPopup.isMain = true;
|
||||
ShowMainMissionPopup = true;
|
||||
if (m_MissionSuccessPopup == null)
|
||||
{
|
||||
string path = ResourceManager.PREFAB_PATH + "Popups/";
|
||||
|
|
@ -594,8 +596,125 @@ public partial class GamePanel : MonoBehaviour
|
|||
}
|
||||
}
|
||||
// 서브 미션 체크
|
||||
if (CurSubMission != eSubMission.Max)
|
||||
if (CurSubMission != eSubMission.Max && !ShowSubMissionPopup)
|
||||
{
|
||||
List<ECardType> randomCards = null;
|
||||
bool success = false;
|
||||
|
||||
switch (CurSubMission)
|
||||
{
|
||||
case eSubMission.Dobule3:
|
||||
if (_lstPlayerScoreCards.Count(card => MissionOpenPopup_Sub.eSubMissionDobule3.Contains(card)) >= 3)
|
||||
{
|
||||
success = true;
|
||||
|
||||
// 교집합 구하기
|
||||
var validCards = _lstPlayerScoreCards
|
||||
.Where(card => MissionOpenPopup_Sub.eSubMissionDobule3.Contains(card))
|
||||
.ToList();
|
||||
|
||||
// 랜덤으로 3개 뽑기
|
||||
randomCards = validCards
|
||||
.OrderBy(c => Random.value)
|
||||
.Take(3)
|
||||
.ToList();
|
||||
}
|
||||
break;
|
||||
|
||||
case eSubMission.YulGgeut3:
|
||||
if (_lstPlayerScoreCards.Count(card => MissionOpenPopup_Sub.eSubMissionYulGgeut3.Contains(card)) >= 3)
|
||||
{
|
||||
success = true;
|
||||
|
||||
var validCards = _lstPlayerScoreCards
|
||||
.Where(card => MissionOpenPopup_Sub.eSubMissionYulGgeut3.Contains(card))
|
||||
.ToList();
|
||||
|
||||
randomCards = validCards
|
||||
.OrderBy(c => Random.value)
|
||||
.Take(3)
|
||||
.ToList();
|
||||
}
|
||||
break;
|
||||
|
||||
case eSubMission.Ddee3:
|
||||
if (_lstPlayerScoreCards.Count(card => MissionOpenPopup_Sub.eSubMissionDdee3.Contains(card)) >= 3)
|
||||
{
|
||||
success = true;
|
||||
|
||||
var validCards = _lstPlayerScoreCards
|
||||
.Where(card => MissionOpenPopup_Sub.eSubMissionDdee3.Contains(card))
|
||||
.ToList();
|
||||
|
||||
randomCards = validCards
|
||||
.OrderBy(c => Random.value)
|
||||
.Take(3)
|
||||
.ToList();
|
||||
}
|
||||
break;
|
||||
|
||||
case eSubMission.Gwang3:
|
||||
if (_lstPlayerScoreCards.Count(card => MissionOpenPopup_Sub.eSubMissionGwang3.Contains(card)) >= 3)
|
||||
{
|
||||
success = true;
|
||||
|
||||
var validCards = _lstPlayerScoreCards
|
||||
.Where(card => MissionOpenPopup_Sub.eSubMissionGwang3.Contains(card))
|
||||
.ToList();
|
||||
|
||||
randomCards = validCards
|
||||
.OrderBy(c => Random.value)
|
||||
.Take(3)
|
||||
.ToList();
|
||||
}
|
||||
break;
|
||||
|
||||
case eSubMission.Be3Gwang:
|
||||
bool hasDec = _lstPlayerScoreCards.Contains(ECardType.Dec_Ghwang);
|
||||
if (hasDec)
|
||||
{
|
||||
int otherCount = _lstPlayerScoreCards
|
||||
.Count(c => MissionOpenPopup_Sub.eSubMissionBe3Gwang.Contains(c) && c != ECardType.Dec_Ghwang);
|
||||
|
||||
if (otherCount >= 2)
|
||||
{
|
||||
success = true;
|
||||
|
||||
var validCards = _lstPlayerScoreCards
|
||||
.Where(c => MissionOpenPopup_Sub.eSubMissionBe3Gwang.Contains(c))
|
||||
.ToList();
|
||||
|
||||
// 반드시 Dec_Ghwang 포함 + 나머지 2개 랜덤
|
||||
var decCard = new List<ECardType> { ECardType.Dec_Ghwang };
|
||||
var others = validCards
|
||||
.Where(c => c != ECardType.Dec_Ghwang)
|
||||
.OrderBy(c => Random.value)
|
||||
.Take(2)
|
||||
.ToList();
|
||||
|
||||
randomCards = decCard.Concat(others).ToList();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// 성공 처리 공통부
|
||||
if (success)
|
||||
{
|
||||
ShowSubMissionPopup = true;
|
||||
|
||||
if (m_MissionSuccessPopup == null)
|
||||
{
|
||||
string path = ResourceManager.PREFAB_PATH + "Popups/";
|
||||
m_MissionSuccessPopup = Instantiate(
|
||||
Resources.Load<MissionSuccessPopup>(path + "MissionSuccessPopup"),
|
||||
GameManager.UI.PopupCanvasTransform
|
||||
);
|
||||
}
|
||||
|
||||
m_MissionSuccessPopup.Set(randomCards);
|
||||
AddMultiplyType(EScoreMutiplyType.SubMission);
|
||||
}
|
||||
}
|
||||
|
||||
switch (scoreType)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using CodeJay.Enum;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
|
|
@ -30,4 +31,58 @@ public class MissionOpenPopup_Sub : MonoBehaviour
|
|||
|
||||
return "";
|
||||
}
|
||||
|
||||
public static List<ECardType> eSubMissionDobule3 = new List<ECardType>
|
||||
{
|
||||
ECardType.Dec_Double,
|
||||
ECardType.Nov_Double,
|
||||
ECardType.Bonus_1,
|
||||
ECardType.Bonus_2,
|
||||
ECardType.Bonus_3
|
||||
};
|
||||
|
||||
public static List<ECardType> eSubMissionYulGgeut3 = new List<ECardType>
|
||||
{
|
||||
ECardType.Feb_Bird,
|
||||
ECardType.Apr_Bird,
|
||||
ECardType.May_Yulkkeut,
|
||||
ECardType.Jun_Yulkkeut,
|
||||
ECardType.Jul_Yulkkeut,
|
||||
ECardType.Aug_Bird,
|
||||
ECardType.Sep_Yulkkeut,
|
||||
ECardType.Oct_Yulkkeut,
|
||||
ECardType.Nov_Yulgget
|
||||
};
|
||||
|
||||
public static List<ECardType> eSubMissionDdee3 = new List<ECardType>
|
||||
{
|
||||
ECardType.Jan_Hongdan,
|
||||
ECardType.Feb_Hongdan,
|
||||
ECardType.Mar_Hongdan,
|
||||
ECardType.Apr_Chodan,
|
||||
ECardType.May_Chodan,
|
||||
ECardType.Jun_Chungdan,
|
||||
ECardType.Jul_Chodan,
|
||||
ECardType.Sep_Chungdan,
|
||||
ECardType.Oct_Chungdan,
|
||||
ECardType.Nov_Tee,
|
||||
};
|
||||
|
||||
public static List<ECardType> eSubMissionGwang3 = new List<ECardType>
|
||||
{
|
||||
ECardType.Jan_Ghwang,
|
||||
ECardType.Mar_Ghwang,
|
||||
ECardType.Aug_Ghwang,
|
||||
ECardType.Nov_Ghwang,
|
||||
ECardType.Dec_Ghwang
|
||||
};
|
||||
|
||||
public static List<ECardType> eSubMissionBe3Gwang = new List<ECardType>
|
||||
{
|
||||
ECardType.Jan_Ghwang,
|
||||
ECardType.Mar_Ghwang,
|
||||
ECardType.Aug_Ghwang,
|
||||
ECardType.Nov_Ghwang,
|
||||
ECardType.Dec_Ghwang
|
||||
};
|
||||
}
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
using CodeJay.Enum;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class MissionSuccessPopup_Set : uScrollViewMgr
|
||||
{
|
||||
private void OnEnable()
|
||||
public void Set(List<ECardType> lst)
|
||||
{
|
||||
if (MissionSuccessPopup.isMain)
|
||||
{
|
||||
Set_ScrollView(MissionOpenPopup_Main.MissionCards);
|
||||
}
|
||||
if (lst != null)
|
||||
Set_ScrollView(lst);
|
||||
else
|
||||
{
|
||||
CardBase_AllOff();
|
||||
}
|
||||
Set_ScrollView(MissionOpenPopup_Main.MissionCards);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +1,23 @@
|
|||
using CodeJay.Enum;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class MissionSuccessPopup : MonoBehaviour
|
||||
{
|
||||
public static bool isMain;
|
||||
|
||||
public TextMeshProUGUI t_mission;
|
||||
|
||||
public void Set()
|
||||
public void Set(List<ECardType> cards = null)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
||||
StartCoroutine(Co_Off());
|
||||
|
||||
t_mission.text = isMain ? $"메인미션 x{GamePanel.Instance.dic_missionRate[GamePanel.Instance.CurMission]}" :
|
||||
$"서브미션 x{GamePanel.Instance.dic_submisstionRate[GamePanel.Instance.CurSubMission]}";
|
||||
t_mission.text = cards == null ? $"메인미션 x{GamePanel.Instance.dic_missionRate[GamePanel.Instance.CurMission]}" :
|
||||
$"서브미션 x{GamePanel.Instance.dic_submisstionRate[GamePanel.Instance.CurSubMission]}";
|
||||
|
||||
GetComponent<MissionSuccessPopup_Set>().Set(cards);
|
||||
}
|
||||
|
||||
IEnumerator Co_Off()
|
||||
|
|
|
|||
Loading…
Reference in New Issue