특성 초기화

This commit is contained in:
Ino 2025-07-01 10:14:52 +09:00
parent d2544869a6
commit 870931014d
8 changed files with 98 additions and 18 deletions

View File

@ -647,6 +647,49 @@ handlers.Save_PC_Ability = function(args)
else else
return Get_Return(2); // 재료 없음 return Get_Return(2); // 재료 없음
} }
handlers.Save_PC_AbilityInit = function(args)
{
var readonlydata = Get_UserReadOnlyData();
var error = Get_Error(readonlydata, args.Token);
if (error < 0) return Get_Return(error);
var urod = Get_JsonUserData(readonlydata);
var Gem = 100;
var itemtable = Get_ItemTable();
var table = Get_MissionTable();
var abilitytable = Get_AbilityConfigTable();
var global = Get_GlobalValueTable();
if (Use_Item(itemtable, urod, 1, Gem))
{
var matdata = global.find(f => f.s_ID == "n_AbilityMaterialID");
if (!matdata) return Get_Return(1); // 설정 누락
var materialId = matdata.n_Value;
// 특성 초기화 및 재료 환급
var lst = abilitytable.filter(f => f.e_BattleType == args.BattleType);
for (var i = 0; i < lst.length; ++i)
{
var key = lst[i].n_AbilityID;
if (urod.Ability[key])
{
Add_Item(table, itemtable, urod, materialId, urod.Ability[key]);
urod.Ability[key] = 0;
}
}
// 미션 카운트
Add_MissionCount(table, urod, "HERO_ABILITY_RESET_ACC", 0, 1, false);
Set_JsonUserData(urod);
return Get_Return(0, { gem: Gem });
}
else
{
return Get_Return(2); // 젬 부족
}
}
/////////////////////////////////// 서버 처리 /////////////////////////////////// 서버 처리
handlers.Write_UnityInApp = function(args) handlers.Write_UnityInApp = function(args)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -52430,7 +52430,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &8112082934472033055 --- !u!224 &8112082934472033055
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -109180,7 +109180,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1} m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -85.90039, y: -40} m_AnchoredPosition: {x: -590, y: -43}
m_SizeDelta: {x: 40, y: 40} m_SizeDelta: {x: 40, y: 40}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8316666745321261360 --- !u!222 &8316666745321261360

View File

@ -959,6 +959,45 @@ public class ServerInfo : MyCoroutine
Set_Coroutine(() => { Save_PC_Ability(abilityID, nbattletype, _act); }, 2f); Set_Coroutine(() => { Save_PC_Ability(abilityID, nbattletype, _act); }, 2f);
}); });
} }
public void Save_PC_AbilityInit(eBattleType battleType, Action _act)
{
NetWait.Ins.Set(true);
PlayFabClientAPI.ExecuteCloudScript(new ExecuteCloudScriptRequest
{
FunctionName = "Save_PC_AbilityInit",
GeneratePlayStreamEvent = true,
FunctionParameter = new
{
Token = m_LoginInfo.EntityToken.EntityToken,
BattleType = battleType,
}
},
result =>
{
if (result.Error == null)
{
NetWait.Ins.Set(false);
var str_result = result.FunctionResult.ToString();
var error = MyErrorCheck(str_result);
switch (error)
{
case 0:
var myresult = JsonUtility.FromJson<SC_PCStatInit>(str_result);
m_ServerData.Use_Item(1, myresult.gem);
_act?.Invoke();
break;
case 1: ToastUI.Ins.Set(999900005); break;
case 2: ToastUI.Ins.Set(388); break;
}
}
else
Set_Coroutine(() => { Save_PC_AbilityInit(battleType, _act); }, 2f);
},
fail =>
{
Set_Coroutine(() => { Save_PC_AbilityInit(battleType, _act); }, 2f);
});
}
#endregion #endregion
#region #region

View File

@ -1,8 +1,5 @@
using System; using System;
using System.Collections;
using System.Collections.Generic;
using TMPro; using TMPro;
using UnityEngine;
public class AbilityResetUI : BackKeyAdd public class AbilityResetUI : BackKeyAdd
{ {
@ -18,7 +15,7 @@ public class AbilityResetUI : BackKeyAdd
act_OK = ok; act_OK = ok;
texts[0].text = battleType.ToString(); texts[0].text = battleType.ToString();
m_MoneyForm.amount.text = "1"; m_MoneyForm.amount.text = "100";
} }
public void OnClick_OK() public void OnClick_OK()

View File

@ -1,8 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PCAbilityUI : PCUIMenu public class PCAbilityUI : PCUIMenu
{ {
public static PCAbilityUI Ins; public static PCAbilityUI Ins;
@ -21,7 +16,7 @@ public class PCAbilityUI : PCUIMenu
public override void Set() public override void Set()
{ {
base.Set(); base.Set();
NewGameUI.Ins.m_PCUI.Set_Money(table_GlobalValue.Ins.Get_Int("n_AbilityMaterialID"), 0); NewGameUI.Ins.m_PCUI.Set_Money(table_GlobalValue.Ins.Get_Int("n_AbilityMaterialID"), 1);
m_PCAbilityUI_Left.Set(CurType); m_PCAbilityUI_Left.Set(CurType);
m_PCAbilityUI_Scrollview.Set(CurType); m_PCAbilityUI_Scrollview.Set(CurType);
} }
@ -42,10 +37,16 @@ public class PCAbilityUI : PCUIMenu
m_AbilityResetUI.Set(CurType, () => m_AbilityResetUI.Set(CurType, () =>
{ {
var sdata = ServerInfo.Ins.m_ServerData; var sdata = ServerInfo.Ins.m_ServerData;
if (sdata.Check_ItemAmount(1, 100))
{
ServerInfo.Ins.Save_PC_AbilityInit(CurType, () =>
{
sdata.Init_Ability(CurType); sdata.Init_Ability(CurType);
MyValue.Get_ActorStatInfoorNull(eRole.PC); MyValue.Get_ActorStatInfoorNull(eRole.PC);
Set(); Set();
sdata.Add_MissionCount(ePurpose.HERO_ABILITY_RESET_ACC); sdata.Add_MissionCount(ePurpose.HERO_ABILITY_RESET_ACC);
}); });
} }
});
}
} }