스테이지 결과에 미션 8개 추가
This commit is contained in:
parent
3267a7e66f
commit
598e32c267
|
|
@ -253,10 +253,10 @@ function Use_Item(urod, itemid, amount)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function Add_MissionCount(urod, purpose, conditionvalue, count, setValue) {
|
function Add_MissionCount(table, urod, purpose, conditionvalue, count, setValue) {
|
||||||
if (count <= 0) return;
|
if (count <= 0) return;
|
||||||
|
|
||||||
var table = Get_MissionTable(); // 전체 미션 테이블
|
//var table = Get_MissionTable(); // 전체 미션 테이블을 외부에서 받는 걸로 변경 (1번만 호출하기 위함)
|
||||||
var matchingMissions = [];
|
var matchingMissions = [];
|
||||||
|
|
||||||
// 조건에 맞는 미션만 추림
|
// 조건에 맞는 미션만 추림
|
||||||
|
|
@ -286,6 +286,11 @@ function Add_MissionCount(urod, purpose, conditionvalue, count, setValue) {
|
||||||
else urod.Mission[key1][key2][1] += count;
|
else urod.Mission[key1][key2][1] += count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 가이드 퀘스트 체크
|
||||||
|
var guideData = table.find(f=>f.n_MissionGroupId == 0 && f.n_MissionIndex == urod.Common[10]);
|
||||||
|
if (guideData && guideData.e_MissionConditionType == purpose)
|
||||||
|
urod.Common[11] += count;
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get_Exp(lv) {
|
function Get_Exp(lv) {
|
||||||
|
|
@ -371,6 +376,7 @@ handlers.Save_StageResult = function(args) {
|
||||||
if (error < 0) return Get_Return(error);
|
if (error < 0) return Get_Return(error);
|
||||||
|
|
||||||
var urod = Get_JsonUserData();
|
var urod = Get_JsonUserData();
|
||||||
|
var table = Get_MissionTable();
|
||||||
|
|
||||||
// 경험치 처리
|
// 경험치 처리
|
||||||
urod.PC.Exp += args.Exp;
|
urod.PC.Exp += args.Exp;
|
||||||
|
|
@ -388,10 +394,45 @@ handlers.Save_StageResult = function(args) {
|
||||||
|
|
||||||
urod.Item[itemId][0] += itemCount;
|
urod.Item[itemId][0] += itemCount;
|
||||||
urod.Item[itemId][1] += itemCount;
|
urod.Item[itemId][1] += itemCount;
|
||||||
|
|
||||||
|
Add_MissionCount(table, urod, "TAKE_GOODS", itemId, itemCount, false);
|
||||||
|
Add_MissionCount(table, urod, "TAKE_GOODS_LIMIT", itemId, itemCount, false);
|
||||||
|
Add_MissionCount(table, urod, "TAKE_GOODS_ACC", itemId, itemCount, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set_JsonUserData(urod);
|
// 몬스터 킬 처리
|
||||||
|
var mobcount = 0;
|
||||||
|
for (var key in args.Mob) {
|
||||||
|
var Id = key;
|
||||||
|
var Count = args.Mob[key];
|
||||||
|
mobcount += Count;
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER", Id, Count, false);
|
||||||
|
}
|
||||||
|
var elitemobcount = 0;
|
||||||
|
for (var key in args.Elite) {
|
||||||
|
var Id = key;
|
||||||
|
var Count = args.Elite[key];
|
||||||
|
elitemobcount += Count;
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER", Id, Count, false);
|
||||||
|
}
|
||||||
|
var bossmobcount = 0;
|
||||||
|
for (var key in args.Boss) {
|
||||||
|
var Id = key;
|
||||||
|
var Count = args.Boss[key];
|
||||||
|
bossmobcount += Count;
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER", Id, Count, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_ALL", 0, mobcount + elitemobcount + bossmobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_ACC", 0, mobcount + elitemobcount + bossmobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_GRADE", 1, mobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_GRADE", 2, elitemobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_GRADE", 3, bossmobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_GRADE_ACC", 1, mobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_GRADE_ACC", 2, elitemobcount, false);
|
||||||
|
Add_MissionCount(table, urod, "KILL_MONSTER_GRADE_ACC", 3, bossmobcount, false);
|
||||||
|
|
||||||
|
Set_JsonUserData(urod);
|
||||||
return Get_Return(0);
|
return Get_Return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -420,7 +461,7 @@ handlers.Save_PC_Stat = function(args)
|
||||||
for (var i = 0; i < 4; i++) {
|
for (var i = 0; i < 4; i++) {
|
||||||
urod.PC.Stat[i] += args.UsePoint[i];
|
urod.PC.Stat[i] += args.UsePoint[i];
|
||||||
}
|
}
|
||||||
Add_MissionCount(urod, "HERO_STAT_UPGRADE_ACC", 0, curUsePoint, false);
|
Add_MissionCount(Get_MissionTable(), urod, "HERO_STAT_UPGRADE_ACC", 0, curUsePoint, false);
|
||||||
Set_JsonUserData(urod);
|
Set_JsonUserData(urod);
|
||||||
return Get_Return(0);
|
return Get_Return(0);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -484,12 +525,12 @@ handlers.Save_PC_Ability = function(args)
|
||||||
++urod.Ability[args.AbilityID];
|
++urod.Ability[args.AbilityID];
|
||||||
|
|
||||||
// 미션 카운트
|
// 미션 카운트
|
||||||
Add_MissionCount(urod, "HERO_ABILITY_UPGRADE_CLASS_LIMIT", args.nBattleType, 1, false);
|
var table = Get_MissionTable();
|
||||||
Add_MissionCount(urod, "HERO_ABILITY_UPGRADE_ALL", 0, 1, false);
|
Add_MissionCount(table, urod, "HERO_ABILITY_UPGRADE_CLASS_LIMIT", args.nBattleType, 1, false);
|
||||||
Add_MissionCount(urod, "HERO_ABILITY_UPGRADE_ACC", 0, 1, false);
|
Add_MissionCount(table, urod, "HERO_ABILITY_UPGRADE_ALL", 0, 1, false);
|
||||||
|
Add_MissionCount(table, urod, "HERO_ABILITY_UPGRADE_ACC", 0, 1, false);
|
||||||
|
|
||||||
Set_JsonUserData(urod);
|
Set_JsonUserData(urod);
|
||||||
|
|
||||||
return Get_Return(0);
|
return Get_Return(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -419,6 +419,9 @@ public class MobActor : Actor
|
||||||
StartCoroutine(Co_Dissolve());
|
StartCoroutine(Co_Dissolve());
|
||||||
MonsterSimpleInfo.Ins.DeadTarget(this);
|
MonsterSimpleInfo.Ins.DeadTarget(this);
|
||||||
|
|
||||||
|
// 킬 수
|
||||||
|
DropItemInfo.Ins.Add_MobKill(m_SubRole, m_ID);
|
||||||
|
|
||||||
// 골드 드랍
|
// 골드 드랍
|
||||||
DropItemInfo.Ins.Drop_DropItem(2, m_MonsterAppearData.n_DropGold, Get_position());
|
DropItemInfo.Ins.Drop_DropItem(2, m_MonsterAppearData.n_DropGold, Get_position());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ public class DropItemInfo : MonoBehaviourSingletonTemplate<DropItemInfo>
|
||||||
{ 2, "Assets/Res_Addr/Obj/DropItem_Coin.prefab" },
|
{ 2, "Assets/Res_Addr/Obj/DropItem_Coin.prefab" },
|
||||||
};
|
};
|
||||||
List<DropItem> list_dropitems = new List<DropItem>();
|
List<DropItem> list_dropitems = new List<DropItem>();
|
||||||
|
Dictionary<int, ObscuredInt> Mob = new Dictionary<int, ObscuredInt>();
|
||||||
|
Dictionary<int, ObscuredInt> Elite = new Dictionary<int, ObscuredInt>();
|
||||||
|
Dictionary<int, ObscuredInt> Boss = new Dictionary<int, ObscuredInt>();
|
||||||
|
|
||||||
public StageDropData m_StageDropData = new StageDropData();
|
public StageDropData m_StageDropData = new StageDropData();
|
||||||
|
|
||||||
|
|
@ -25,12 +28,33 @@ public class DropItemInfo : MonoBehaviourSingletonTemplate<DropItemInfo>
|
||||||
public void AllOff()
|
public void AllOff()
|
||||||
{
|
{
|
||||||
m_StageDropData.Init();
|
m_StageDropData.Init();
|
||||||
|
Mob.Clear();
|
||||||
|
Elite.Clear();
|
||||||
|
Boss.Clear();
|
||||||
|
|
||||||
foreach (var item in dic_dropitem)
|
foreach (var item in dic_dropitem)
|
||||||
for (int i = 0; i < item.Value.Count; i++)
|
for (int i = 0; i < item.Value.Count; i++)
|
||||||
item.Value[i].gameObject.SetActive(false);
|
item.Value[i].gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Add_MobKill(eSubRol subRol, int id)
|
||||||
|
{
|
||||||
|
var mob = Mob;
|
||||||
|
switch (subRol)
|
||||||
|
{
|
||||||
|
case eSubRol.Elite: mob = Elite; break;
|
||||||
|
case eSubRol.Boss: mob = Boss; break;
|
||||||
|
}
|
||||||
|
if (!mob.ContainsKey(id))
|
||||||
|
mob.Add(id, 0);
|
||||||
|
++mob[id];
|
||||||
|
mob[id].RandomizeCryptoKey();
|
||||||
|
}
|
||||||
|
public Dictionary<int, ObscuredInt> Get_Mob() { return Mob; }
|
||||||
|
public Dictionary<int, ObscuredInt> Get_Elite() { return Elite; }
|
||||||
|
public Dictionary<int, ObscuredInt> Get_Boss() { return Boss; }
|
||||||
|
|
||||||
|
|
||||||
void Make_DropItem(int key, int count)
|
void Make_DropItem(int key, int count)
|
||||||
{
|
{
|
||||||
AddrResourceMgr.Ins.LoadObject<GameObject>(dic_addrPath[key], handle =>
|
AddrResourceMgr.Ins.LoadObject<GameObject>(dic_addrPath[key], handle =>
|
||||||
|
|
|
||||||
|
|
@ -794,6 +794,21 @@ public class ServerInfo : MyCoroutine
|
||||||
foreach (var item in dropitem)
|
foreach (var item in dropitem)
|
||||||
items.Add(item.Key.ToString(), item.Value.GetDecrypted());
|
items.Add(item.Key.ToString(), item.Value.GetDecrypted());
|
||||||
|
|
||||||
|
Dictionary<string, int> MobKill = new Dictionary<string, int>();
|
||||||
|
var mob = DropItemInfo.Ins.Get_Mob();
|
||||||
|
foreach (var item in mob)
|
||||||
|
MobKill.Add(item.Key.ToString(), item.Value.GetDecrypted());
|
||||||
|
|
||||||
|
Dictionary<string, int> EliteKill = new Dictionary<string, int>();
|
||||||
|
var elite = DropItemInfo.Ins.Get_Elite();
|
||||||
|
foreach (var item in elite)
|
||||||
|
EliteKill.Add(item.Key.ToString(), item.Value.GetDecrypted());
|
||||||
|
|
||||||
|
Dictionary<string, int> BossKill = new Dictionary<string, int>();
|
||||||
|
var boss = DropItemInfo.Ins.Get_Boss();
|
||||||
|
foreach (var item in boss)
|
||||||
|
BossKill.Add(item.Key.ToString(), item.Value.GetDecrypted());
|
||||||
|
|
||||||
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
|
||||||
{
|
{
|
||||||
FunctionName = "Save_StageResult",
|
FunctionName = "Save_StageResult",
|
||||||
|
|
@ -802,7 +817,10 @@ public class ServerInfo : MyCoroutine
|
||||||
{
|
{
|
||||||
Token = m_LoginInfo.EntityToken.EntityToken,
|
Token = m_LoginInfo.EntityToken.EntityToken,
|
||||||
Exp = DropItemInfo.Ins.m_StageDropData.GetExp.GetDecrypted(),
|
Exp = DropItemInfo.Ins.m_StageDropData.GetExp.GetDecrypted(),
|
||||||
Item = items
|
Item = items,
|
||||||
|
Mob = MobKill,
|
||||||
|
Elite = EliteKill,
|
||||||
|
Boss = BossKill
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
result =>
|
result =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue