불필요 스크립트 제거, 화살표 에임 관련 처리
This commit is contained in:
parent
c70b24c110
commit
b50884cd95
|
|
@ -13963,6 +13963,52 @@ Transform:
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 2122188986557445962}
|
m_Father: {fileID: 2122188986557445962}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!1 &6786920584044778676
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 1619714308856739474}
|
||||||
|
- component: {fileID: 3488395933534389267}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: AimController
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!4 &1619714308856739474
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6786920584044778676}
|
||||||
|
serializedVersion: 2
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 5616041856476126941}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &3488395933534389267
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 6786920584044778676}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: bc2eb6f2e5a4e2e449cd1e1e4160ad82, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
line: {fileID: 0}
|
||||||
|
maxDistance: 5
|
||||||
--- !u!1 &6816871435984902536
|
--- !u!1 &6816871435984902536
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -19378,6 +19424,7 @@ Transform:
|
||||||
- {fileID: 7206676759849195734}
|
- {fileID: 7206676759849195734}
|
||||||
- {fileID: 9165126372825175814}
|
- {fileID: 9165126372825175814}
|
||||||
- {fileID: 3582874163902399026}
|
- {fileID: 3582874163902399026}
|
||||||
|
- {fileID: 1619714308856739474}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!114 &7710057252007965318
|
--- !u!114 &7710057252007965318
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,7 +1,6 @@
|
||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e12cf67f1b9006a459473678ea0f6b5d
|
guid: a095105d5711d2541ba0f518805662c5
|
||||||
folderAsset: yes
|
PrefabImporter:
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
File diff suppressed because it is too large
Load Diff
13242
Assets/SampleScene.unity
13242
Assets/SampleScene.unity
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: f6c89cd86791ae64a93f6dfcf6699d87
|
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public class AimArrowController : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Image arrow;
|
||||||
|
public float m_AngleSpeed = 1.5f;
|
||||||
|
|
||||||
|
Vector2 startPos;
|
||||||
|
bool isAiming;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
arrow.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnAimStart(Vector2 screenPos)
|
||||||
|
{
|
||||||
|
isAiming = true;
|
||||||
|
arrow.enabled = true;
|
||||||
|
UpdateArrow(screenPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnAimDrag(Vector2 screenPos)
|
||||||
|
{
|
||||||
|
if (!isAiming) return;
|
||||||
|
UpdateArrow(screenPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnAimEnd()
|
||||||
|
{
|
||||||
|
arrow.enabled = false;
|
||||||
|
isAiming = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateArrow(Vector2 currentPos)
|
||||||
|
{
|
||||||
|
Vector2 dir = currentPos - startPos;
|
||||||
|
if (dir.sqrMagnitude < 0.001f) return;
|
||||||
|
|
||||||
|
float angle = (Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg - 45f) * m_AngleSpeed;
|
||||||
|
angle = Mathf.Clamp(angle, -60f, 60f);
|
||||||
|
arrow.rectTransform.rotation = Quaternion.Euler(0, 0, angle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 608d00eef53109d4987dc53cf586d8e1
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class AimController : MonoBehaviour
|
||||||
|
{
|
||||||
|
public LineRenderer line;
|
||||||
|
public float maxDistance = 5f;
|
||||||
|
|
||||||
|
private Vector2 startPos;
|
||||||
|
private bool isAiming;
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
if (Input.GetMouseButtonDown(0))
|
||||||
|
{
|
||||||
|
startPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||||
|
isAiming = true;
|
||||||
|
line.enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Input.GetMouseButton(0) && isAiming)
|
||||||
|
{
|
||||||
|
Vector2 currentPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||||
|
Vector2 dir = Vector2.ClampMagnitude(currentPos - startPos, maxDistance);
|
||||||
|
|
||||||
|
line.SetPosition(0, transform.position);
|
||||||
|
line.SetPosition(1, (Vector2)transform.position + dir);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Input.GetMouseButtonUp(0) && isAiming)
|
||||||
|
{
|
||||||
|
Vector2 endPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
||||||
|
Vector2 shootDir = (endPos - startPos).normalized;
|
||||||
|
|
||||||
|
GetComponent<Shooter>().Shoot(shootDir);
|
||||||
|
line.enabled = false;
|
||||||
|
isAiming = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bc2eb6f2e5a4e2e449cd1e1e4160ad82
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
|
|
||||||
|
public class AimInputArea : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IDragHandler
|
||||||
|
{
|
||||||
|
public AimArrowController aim;
|
||||||
|
|
||||||
|
public void OnPointerDown(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
aim.OnAimStart(eventData.position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnDrag(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
aim.OnAimDrag(eventData.position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPointerUp(PointerEventData eventData)
|
||||||
|
{
|
||||||
|
aim.OnAimEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 7ff42250fb86fc647a664ca7af0b3c1a
|
||||||
|
|
@ -1,163 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class MobActor : Actor
|
|
||||||
{
|
|
||||||
[SerializeField] protected SpriteRenderer sr_actor;
|
|
||||||
public GameObject go_shadow, go_targeteffect;
|
|
||||||
|
|
||||||
eMobBattlePos m_MobLine;
|
|
||||||
int m_MobIndex;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
base.Awake();
|
|
||||||
go_shadow.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Set(int identity, ActorTableDataBase actordata, HUD_HPShield hUD_HPShield, ServerData sdata = null)
|
|
||||||
{
|
|
||||||
if (actordata != null)
|
|
||||||
{
|
|
||||||
base.Set(identity, actordata, hUD_HPShield);
|
|
||||||
m_anim.Play("Mob_Dissolve_Init");
|
|
||||||
|
|
||||||
Load_SpriteRenderer(sr_actor, m_TableData.Get_ImagePath(), () =>
|
|
||||||
{
|
|
||||||
isSetImage = true;
|
|
||||||
if (IsRole(eRole.Mob)) Set_HUD(true);
|
|
||||||
});
|
|
||||||
var scale = (m_TableData as MonsterListTableData).f_Scale;
|
|
||||||
sr_actor.transform.localScale = Vector3.one * scale;
|
|
||||||
go_shadow.transform.localScale = new Vector3(2.0f, 2f) * scale;
|
|
||||||
go_shadow.SetActive(true);
|
|
||||||
|
|
||||||
go_targeteffect.SetActive(false);
|
|
||||||
go_targeteffect.transform.localScale = new Vector3(3.5f, 2f) * scale;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Off();
|
|
||||||
}
|
|
||||||
public override void Set(int index)
|
|
||||||
{
|
|
||||||
m_MobIndex = index;
|
|
||||||
}
|
|
||||||
public override void Set_TargetObj(bool active)
|
|
||||||
{
|
|
||||||
go_targeteffect.SetActive(active);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public override Vector3 Get_World_Position(eEffectPivot pivot = eEffectPivot.Center)
|
|
||||||
{
|
|
||||||
Bounds b = sr_actor.bounds;
|
|
||||||
var rtn = b.center;
|
|
||||||
switch (pivot)
|
|
||||||
{
|
|
||||||
case eEffectPivot.Top:
|
|
||||||
rtn = new Vector3(b.center.x, b.max.y, b.center.z); // 상단
|
|
||||||
break;
|
|
||||||
case eEffectPivot.Bottom:
|
|
||||||
rtn = new Vector3(b.center.x, b.min.y, b.center.z); // 하단
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rtn;
|
|
||||||
}
|
|
||||||
public override void Set_Line(eMobBattlePos eline) { m_MobLine = eline; }
|
|
||||||
public override eMobBattlePos Get_Line() { return m_MobLine; }
|
|
||||||
public override bool IsFrontLine() { return m_MobLine == eMobBattlePos.Frontline; }
|
|
||||||
public override bool IsMiddleLine() { return m_MobLine == eMobBattlePos.Middleline; }
|
|
||||||
public override bool IsBackLine() { return m_MobLine == eMobBattlePos.Backline; }
|
|
||||||
public override bool IsMobLine(eMobBattlePos eline) { return m_MobLine == eline; }
|
|
||||||
public override int Get_MobIndex() { return m_MobIndex; }
|
|
||||||
public override void Set_MobIndex_byLineChange() { m_MobIndex -= 3; }
|
|
||||||
protected override float Get_ProjectileSpeed()
|
|
||||||
{
|
|
||||||
if (IsFrontLine())
|
|
||||||
return table_GlobalValue.Ins.Get_Float("FrontMonster_ProjectileSpeed");
|
|
||||||
else if(IsMiddleLine())
|
|
||||||
return table_GlobalValue.Ins.Get_Float("BackMonster_ProjectileSpeed");
|
|
||||||
return base.Get_ProjectileSpeed();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Set_Die(ProjectileData pdData)
|
|
||||||
{
|
|
||||||
base.Set_Die(pdData);
|
|
||||||
go_shadow.SetActive(false);
|
|
||||||
go_targeteffect.SetActive(false);
|
|
||||||
m_anim.Play("Mob_Dissolve");
|
|
||||||
EffectMgr.Ins.Show_Effect("FX_Skull_Dead", Get_World_Position());
|
|
||||||
var tData = m_TableData as MonsterListTableData;
|
|
||||||
bool isPdData = pdData != null;
|
|
||||||
|
|
||||||
// 정인호 : 몬스터 처치 보상
|
|
||||||
var exp = tData.n_RewardExp;
|
|
||||||
if (isPdData && pdData.isCri)
|
|
||||||
{
|
|
||||||
var G1_XpGainOnCritKill = pdData.Hitter.Get_CardSkillData_orNull(eCardType.G1_XpGainOnCritKill);
|
|
||||||
if (G1_XpGainOnCritKill != null) exp = (int)(exp * G1_XpGainOnCritKill.m_Data.Get_FloatValue2());
|
|
||||||
}
|
|
||||||
IngameUIManager.Ins.m_MoneyAnimation.Set(MyValue.ItemID_Exp, exp, Get_World_Position());
|
|
||||||
|
|
||||||
var golddroprate = tData.f_GoldDropRate;
|
|
||||||
if (isPdData)
|
|
||||||
{
|
|
||||||
var G1_GoldDropChanceUp = pdData.Hitter.Get_CardSkillData_orNull(eCardType.G1_GoldDropChanceUp);
|
|
||||||
if (G1_GoldDropChanceUp != null) golddroprate += G1_GoldDropChanceUp.m_Data.Get_FloatValue2();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DSUtil.RandomTrue(golddroprate))
|
|
||||||
{
|
|
||||||
var gold = tData.Get_Gold();
|
|
||||||
IngameUIManager.Ins.m_MoneyAnimation.Set(MyValue.ItemID_Gold, gold, Get_World_Position());
|
|
||||||
if (isPdData)
|
|
||||||
{
|
|
||||||
var G1_HealOnGoldDrop = pdData.Hitter.Get_CardSkillData_orNull(eCardType.G1_HealOnGoldDrop);
|
|
||||||
if (G1_HealOnGoldDrop != null)
|
|
||||||
{
|
|
||||||
pdData.Hitter.Heal(eHealType.Normal, G1_HealOnGoldDrop.m_Data.Get_IntValue1());
|
|
||||||
pdData.Hitter.Set_StatusEffect(eStatusConditionsType.Heal_Hp_Add, 1f);
|
|
||||||
}
|
|
||||||
var G1_ShockDamageOnGoldDrop = pdData.Hitter.Get_CardSkillData_orNull(eCardType.G1_ShockDamageOnGoldDrop);
|
|
||||||
if (G1_ShockDamageOnGoldDrop != null)
|
|
||||||
{
|
|
||||||
var rdnTarget = InGameInfo.Ins.Get_Enemy_orNull(pdData.Hitter.Get_Data().m_Role);
|
|
||||||
pdData.Hitter.Shoot_AddProjectiles(eCardType.G1_ShockDamageOnGoldDrop, rdnTarget);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Play_Attack()
|
|
||||||
{
|
|
||||||
if (!IsDead())
|
|
||||||
{
|
|
||||||
if (Get_AttackType() == eAttackType.Melee)
|
|
||||||
{
|
|
||||||
if (m_MobLine == eMobBattlePos.Frontline)
|
|
||||||
{
|
|
||||||
base.Play_Attack();
|
|
||||||
m_anim.Play("Mob_Attack");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_MobLine == eMobBattlePos.Frontline || m_MobLine == eMobBattlePos.Middleline)
|
|
||||||
{
|
|
||||||
base.Play_Attack();
|
|
||||||
m_anim.Play("Mob_Attack");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public override void Shoot_Projectile()
|
|
||||||
{
|
|
||||||
base.Shoot_Projectile();
|
|
||||||
InGameInfo.Ins.OnEvent_Mob_ShootProjectile(this);
|
|
||||||
}
|
|
||||||
protected override void Play_Hit()
|
|
||||||
{
|
|
||||||
//if(m_anim.IsPlaying())
|
|
||||||
if (!IsDead() && !m_anim.isPlaying) m_anim.Play("Mob_Hit");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6bc5e99a876610e40b8f265e2b21c28c
|
|
||||||
|
|
@ -1,127 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class PCActor : Actor
|
|
||||||
{
|
|
||||||
public Image i_actor;
|
|
||||||
public EffectBase eff_Shield;
|
|
||||||
public GameObject go_lowhp;
|
|
||||||
|
|
||||||
Dictionary<eActorStatus, string> dic_statusImageKey = new Dictionary<eActorStatus, string>
|
|
||||||
{
|
|
||||||
{ eActorStatus.Idle, "" }, { eActorStatus.Hit, "" },
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
base.Awake();
|
|
||||||
eff_Shield.Off();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Set(int identity, ActorTableDataBase actordata, HUD_HPShield hUD_HPShield, ServerData sdata = null)
|
|
||||||
{
|
|
||||||
base.Set(identity, actordata, hUD_HPShield, sdata);
|
|
||||||
IngameUIManager.Ins.m_SpecificityList.Set(list_Specificity);
|
|
||||||
go_lowhp.SetActive(false);
|
|
||||||
|
|
||||||
dic_statusImageKey[eActorStatus.Idle] = m_TableData.Get_ImagePath();
|
|
||||||
dic_statusImageKey[eActorStatus.Hit] = m_TableData.Get_ImagePath(eActorStatus.Hit);
|
|
||||||
|
|
||||||
Load_Image(i_actor, dic_statusImageKey[eActorStatus.Hit], () =>
|
|
||||||
{
|
|
||||||
Load_Image(i_actor, dic_statusImageKey[eActorStatus.Idle], () =>
|
|
||||||
{
|
|
||||||
i_actor.SetNativeSize();
|
|
||||||
isSetImage = true;
|
|
||||||
if (IsRole(eRole.Mob)) Set_HUD(true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Heal(eHealType healType, float ratio)
|
|
||||||
{
|
|
||||||
base.Heal(healType, ratio);
|
|
||||||
Check_LowHP();
|
|
||||||
}
|
|
||||||
public override void Heal(eHealType healType, int heal)
|
|
||||||
{
|
|
||||||
base.Heal(healType, heal);
|
|
||||||
Check_LowHP();
|
|
||||||
}
|
|
||||||
protected override void OnEvent_GetDmg(ProjectileData pdData)
|
|
||||||
{
|
|
||||||
base.OnEvent_GetDmg(pdData);
|
|
||||||
Check_LowHP();
|
|
||||||
|
|
||||||
//if (co_Hit != null) { StopCoroutine(co_Hit); co_Hit = null; }
|
|
||||||
//co_Hit = StartCoroutine(Co_Anim(eActorStatus.Hit));
|
|
||||||
}
|
|
||||||
public override void OnEvent_Kill(Actor deadactor)
|
|
||||||
{
|
|
||||||
base.OnEvent_Kill(deadactor);
|
|
||||||
if (dic_Card.ContainsKey(eCardType.G2_ActivateInvincibleShieldOnKill))
|
|
||||||
{
|
|
||||||
eff_Shield.Set_OffTime(dic_Card[eCardType.G2_ActivateInvincibleShieldOnKill].m_Data.Get_FloatValue3());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool IsShield() { return eff_Shield.isActiveAndEnabled; }
|
|
||||||
public override Vector3 Get_World_Position(eEffectPivot pivot = eEffectPivot.Center) { return base.Get_World_Position(pivot); }
|
|
||||||
protected override float Get_ProjectileSpeed() { return table_GlobalValue.Ins.Get_Float("PC_ProjectileSpeed"); }
|
|
||||||
|
|
||||||
void Check_LowHP()
|
|
||||||
{
|
|
||||||
var hp = m_StatInfo.Get_TotalStat(eStat.HP);
|
|
||||||
var maxhp = m_StatInfo.Get_TotalStat(eStat.MaxHP);
|
|
||||||
var cal = hp / maxhp;
|
|
||||||
if (cal < 0.3)
|
|
||||||
{
|
|
||||||
if (!go_lowhp.activeInHierarchy)
|
|
||||||
{
|
|
||||||
go_lowhp.SetActive(true);
|
|
||||||
i_actor.sprite = m_Handle[dic_statusImageKey[eActorStatus.Hit]].Result as Sprite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (go_lowhp.activeInHierarchy)
|
|
||||||
{
|
|
||||||
go_lowhp.SetActive(false);
|
|
||||||
i_actor.sprite = m_Handle[dic_statusImageKey[eActorStatus.Idle]].Result as Sprite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#region 애니메이션
|
|
||||||
protected override void Play_Attack()
|
|
||||||
{
|
|
||||||
if (!IsDead())
|
|
||||||
{
|
|
||||||
if (m_Target == null || m_Target.IsDead() || isCantSetTarget())
|
|
||||||
Find_Target();
|
|
||||||
base.Play_Attack();
|
|
||||||
m_anim.Play("PC_Attack");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
protected override void Play_Hit()
|
|
||||||
{
|
|
||||||
base.Play_Hit();
|
|
||||||
if (IsDead() || ActorStatus == eActorStatus.Attack) return;
|
|
||||||
ActorStatus = eActorStatus.Hit;
|
|
||||||
m_anim.Stop();
|
|
||||||
m_anim.Play("PC_Hit");
|
|
||||||
}
|
|
||||||
protected override void Play_Evasion()
|
|
||||||
{
|
|
||||||
base.Play_Evasion();
|
|
||||||
if (IsDead() || ActorStatus == eActorStatus.Attack) return;
|
|
||||||
ActorStatus = eActorStatus.Evasion;
|
|
||||||
m_anim.Stop();
|
|
||||||
m_anim.Play("PC_Evasion");
|
|
||||||
}
|
|
||||||
IEnumerator Co_Anim(eActorStatus status)
|
|
||||||
{
|
|
||||||
i_actor.sprite = m_Handle[dic_statusImageKey[status]].Result as Sprite;
|
|
||||||
yield return new WaitForSeconds(1.0f);
|
|
||||||
i_actor.sprite = m_Handle[dic_statusImageKey[eActorStatus.Idle]].Result as Sprite;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3648ed2bf83581d46b4caf5750bc8052
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class Shooter : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject projectilePrefab;
|
||||||
|
public float shootPower = 10f;
|
||||||
|
|
||||||
|
public void Shoot(Vector2 dir)
|
||||||
|
{
|
||||||
|
GameObject proj = Instantiate(
|
||||||
|
projectilePrefab,
|
||||||
|
transform.position,
|
||||||
|
Quaternion.identity
|
||||||
|
);
|
||||||
|
|
||||||
|
Rigidbody2D rb = proj.GetComponent<Rigidbody2D>();
|
||||||
|
rb.linearVelocity = dir * shootPower;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2c841fc89245f2344962b3dd0b85a4b8
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class EffectBase : MonoBehaviour
|
|
||||||
{
|
|
||||||
bool isActor;
|
|
||||||
Actor m_Actor;
|
|
||||||
eEffectPivot m_pivot;
|
|
||||||
Vector3 offset = new Vector3(0f, 0f);
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
var particles = GetComponentsInChildren<ParticleSystem>();
|
|
||||||
for (int i = 0; i < particles.Length; i++)
|
|
||||||
{
|
|
||||||
var main = particles[i].main;
|
|
||||||
main.scalingMode = ParticleSystemScalingMode.Hierarchy;
|
|
||||||
var rend = particles[i].GetComponent<ParticleSystemRenderer>();
|
|
||||||
if (rend != null)
|
|
||||||
rend.sortingOrder += 10; // 기존 값에서 +10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Update()
|
|
||||||
{
|
|
||||||
if (isActor)
|
|
||||||
transform.position = m_Actor.Get_World_Position(m_pivot) + offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set(string effect, Vector3 pos, float offtime)
|
|
||||||
{
|
|
||||||
var data = table_effect.Ins.Get_Data(effect);
|
|
||||||
offset = new Vector3(data.f_PositionX, data.f_PositionY);
|
|
||||||
pos += offset;
|
|
||||||
transform.position = pos;
|
|
||||||
transform.localScale = data.f_Scale * Vector3.one;
|
|
||||||
Set_OffTime(offtime);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set(string effect, eEffectPivot pivot, Actor actor, Vector3 pos, float offtime)
|
|
||||||
{
|
|
||||||
m_Actor = actor; isActor = m_Actor;
|
|
||||||
m_pivot = pivot;
|
|
||||||
var data = table_effect.Ins.Get_Data(effect);
|
|
||||||
offset = new Vector3(data.f_PositionX, data.f_PositionY);
|
|
||||||
pos += offset;
|
|
||||||
transform.position = pos;
|
|
||||||
transform.localScale = data.f_Scale * Vector3.one;
|
|
||||||
Set_OffTime(offtime);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set_OffTime(float offtime)
|
|
||||||
{
|
|
||||||
gameObject.SetActive(true);
|
|
||||||
|
|
||||||
if (IsInvoking("Off"))
|
|
||||||
CancelInvoke("Off");
|
|
||||||
|
|
||||||
if (offtime > 0f)
|
|
||||||
Invoke("Off", offtime);
|
|
||||||
|
|
||||||
// offtime 이 0 보다 작은 경우는 알아서 끄는 경우
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Off()
|
|
||||||
{
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: fdc685657ce71254b8f15410bb65ebd8
|
|
||||||
|
|
@ -1,129 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class EffectMgr : MonoBehaviourSingletonTemplate<EffectMgr>
|
|
||||||
{
|
|
||||||
Dictionary<string, List<EffectBase>> dic_effect = new Dictionary<string, List<EffectBase>>();
|
|
||||||
public bool LoadComplete;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
base.Awake();
|
|
||||||
DontDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerator Co_Load(Action<float> addslidevalue)
|
|
||||||
{
|
|
||||||
LoadComplete = false;
|
|
||||||
|
|
||||||
var lst = table_effect.Ins.Get_DataList();
|
|
||||||
int totalCount = lst.Count;
|
|
||||||
|
|
||||||
// 슬라이더 35% 사용
|
|
||||||
float add1value = 0.35f / totalCount;
|
|
||||||
|
|
||||||
const int batchSize = 10; // 🔹 한 번에 로드할 개수
|
|
||||||
|
|
||||||
for (int batchStart = 0; batchStart < totalCount; batchStart += batchSize)
|
|
||||||
{
|
|
||||||
int batchEnd = Mathf.Min(batchStart + batchSize, totalCount);
|
|
||||||
|
|
||||||
// 🔹 이번 배치의 로드 코루틴 리스트
|
|
||||||
List<Coroutine> coroutines = new List<Coroutine>();
|
|
||||||
|
|
||||||
for (int i = batchStart; i < batchEnd; i++)
|
|
||||||
{
|
|
||||||
var data = lst[i];
|
|
||||||
|
|
||||||
if (!dic_effect.ContainsKey(data.s_Effect))
|
|
||||||
dic_effect.Add(data.s_Effect, new List<EffectBase>());
|
|
||||||
|
|
||||||
// 🔹 병렬 실행용 코루틴 등록
|
|
||||||
coroutines.Add(StartCoroutine(LoadEffect(data, add1value, addslidevalue)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 🔹 배치에 포함된 모든 로드가 끝날 때까지 대기
|
|
||||||
foreach (var c in coroutines)
|
|
||||||
yield return c;
|
|
||||||
|
|
||||||
// 🔹 한 배치 끝나면 잠깐 쉬어주기 (UI 멈춤 방지)
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadComplete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator LoadEffect(EffectTableData data, float add1value, Action<float> addslidevalue)
|
|
||||||
{
|
|
||||||
bool done = false;
|
|
||||||
|
|
||||||
yield return AddrResourceMgr.Ins.LoadObjectSequential<GameObject>(
|
|
||||||
$"Ingame/Effect/{data.s_Effect}.prefab",
|
|
||||||
prefab =>
|
|
||||||
{
|
|
||||||
for (int k = 0; k < data.n_LoadAmount; k++)
|
|
||||||
{
|
|
||||||
var eff = DSUtil.Get_Clone<EffectBase>(prefab, transform);
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
if (eff == null)
|
|
||||||
MyEditorDialog.Show_Dialog($"{data.s_Effect} 이펙트에 EffectBase 스크립트가 없습니다.", null);
|
|
||||||
#endif
|
|
||||||
dic_effect[data.s_Effect].Add(eff);
|
|
||||||
eff.Off();
|
|
||||||
}
|
|
||||||
|
|
||||||
addslidevalue?.Invoke(add1value);
|
|
||||||
done = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
yield return new WaitUntil(() => done);
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectBase Get_Effect(string effect)
|
|
||||||
{
|
|
||||||
if (dic_effect.ContainsKey(effect))
|
|
||||||
{
|
|
||||||
for (int i = 0; i < dic_effect[effect].Count; i++)
|
|
||||||
{
|
|
||||||
if (!dic_effect[effect][i].isActiveAndEnabled)
|
|
||||||
return dic_effect[effect][i];
|
|
||||||
}
|
|
||||||
|
|
||||||
var neweffect = DSUtil.Get_Clone<EffectBase>(dic_effect[effect][0].gameObject, transform);
|
|
||||||
neweffect.gameObject.SetActive(false);
|
|
||||||
neweffect.transform.localScale = dic_effect[effect][0].transform.localScale;
|
|
||||||
dic_effect[effect].Add(neweffect);
|
|
||||||
return neweffect;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Popup.Ins.Set($"{effect} 이펙트가 없습니다. 테이블을 확인해 주세요.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EffectBase Get_EffectBase(string effect) { return Get_Effect(effect); }
|
|
||||||
public void Show_Effect(string effect, Vector3 pos, float offtime = 2f)
|
|
||||||
{
|
|
||||||
var effectobj = Get_Effect(effect);
|
|
||||||
if (effectobj != null) effectobj.Set(effect, pos, offtime);
|
|
||||||
}
|
|
||||||
public EffectBase Show_FollowEffect(string effect, eEffectPivot pivot, Actor actor, Vector3 pos, float offtime = 2f)
|
|
||||||
{
|
|
||||||
var effectobj = Get_Effect(effect);
|
|
||||||
if (effectobj != null) effectobj.Set(effect, pivot, actor, pos, offtime);
|
|
||||||
return effectobj;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AllOff()
|
|
||||||
{
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool || MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool_Mob)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
foreach (var item in dic_effect)
|
|
||||||
for (int i = 0; i < item.Value.Count; i++)
|
|
||||||
item.Value[i].Off();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 38af84b9157c7664c803a68fb3f6a62d
|
|
||||||
|
|
@ -1,142 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ProjectileBase : MonoBehaviour
|
|
||||||
{
|
|
||||||
ProjectileTableData m_TableData;
|
|
||||||
Vector3 offset = new Vector3(0f, 0f);
|
|
||||||
float m_Speed;
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
//GetComponent<SpriteRenderer>().sortingOrder = 10;
|
|
||||||
var particles = GetComponentsInChildren<ParticleSystem>();
|
|
||||||
for (int i = 0; i < particles.Length; i++)
|
|
||||||
{
|
|
||||||
var main = particles[i].main;
|
|
||||||
main.scalingMode = ParticleSystemScalingMode.Hierarchy;
|
|
||||||
var rend = particles[i].GetComponent<ParticleSystemRenderer>();
|
|
||||||
if (rend != null)
|
|
||||||
rend.sortingOrder += 10; // 기존 값에서 +10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set(ProjectileData pdata, Vector3 start, Vector3 end, Actor target, Action<Actor> act_end)
|
|
||||||
{
|
|
||||||
gameObject.SetActive(true);
|
|
||||||
m_Speed = pdata.m_Speed;
|
|
||||||
if (m_Speed <= 0f) m_Speed = 15f; // 이펙트 툴용
|
|
||||||
transform.eulerAngles = Vector3.zero;
|
|
||||||
offset = new Vector3(m_TableData.f_PositionX, m_TableData.f_PositionY);
|
|
||||||
end += offset;
|
|
||||||
if (m_TableData.b_FilpX && transform.localScale.x > 0f)
|
|
||||||
transform.localScale = new Vector3(-transform.localScale.x, transform.localScale.y, transform.localScale.z);
|
|
||||||
|
|
||||||
if (pdata.e_AttackType == eAttackType.Melee)
|
|
||||||
{ // 즉시 공격
|
|
||||||
StartCoroutine(Co_Melee(end, target, act_end));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // 투사체 이동
|
|
||||||
StartCoroutine(Co_Update(start, end, target, act_end));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_Melee(Vector3 end, Actor target, Action<Actor> act_end)
|
|
||||||
{
|
|
||||||
transform.position = end;
|
|
||||||
if (m_TableData != null && !string.IsNullOrEmpty(m_TableData.s_Effect))
|
|
||||||
{
|
|
||||||
var delay = table_effect.Ins.Get_Data(m_TableData.s_Effect).f_EffectDelay;
|
|
||||||
yield return new WaitForSeconds(delay);
|
|
||||||
EffectMgr.Ins.Show_Effect(m_TableData.s_Effect, transform.position);
|
|
||||||
}
|
|
||||||
act_end?.Invoke(target);
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
IEnumerator Co_Update(Vector3 start, Vector3 end, Actor target, Action<Actor> act_end)
|
|
||||||
{
|
|
||||||
bool isTarget = target;
|
|
||||||
transform.position = start;
|
|
||||||
|
|
||||||
var ps = GetComponent<ParticleSystem>();
|
|
||||||
if (ps)
|
|
||||||
{
|
|
||||||
// Trail 완전 비활성화
|
|
||||||
var trails = ps.trails;
|
|
||||||
bool wasTrailOn = trails.enabled;
|
|
||||||
trails.enabled = false;
|
|
||||||
|
|
||||||
// 파티클 완전 정지 및 초기화
|
|
||||||
ps.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
|
|
||||||
ps.Clear(true);
|
|
||||||
|
|
||||||
foreach (var tr in GetComponentsInChildren<TrailRenderer>())
|
|
||||||
tr.Clear();
|
|
||||||
|
|
||||||
// 1프레임 대기 (렌더 버퍼 플러시)
|
|
||||||
yield return null;
|
|
||||||
|
|
||||||
// 파티클 리셋 + Trail 다시 켜기
|
|
||||||
ps.Simulate(0f, true, true, true);
|
|
||||||
if (wasTrailOn) trails.enabled = true;
|
|
||||||
ps.Play(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (Vector3.Distance(transform.position, end) > 0.01f)
|
|
||||||
{
|
|
||||||
if (isTarget)
|
|
||||||
{
|
|
||||||
if (target.IsRole(eRole.Mob) && target.IsDead())
|
|
||||||
{
|
|
||||||
var mobindex = target.Get_MobIndex();
|
|
||||||
if (mobindex < 0) mobindex += 3; // 라인 교체로 내려갔을 수도 있으므로 기존 위치로 잡음
|
|
||||||
var nexttarget = InGameInfo.Ins.Get_Enemy_orNull(eRole.PC, mobindex + 3);
|
|
||||||
var nexttarget2 = InGameInfo.Ins.Get_Enemy_orNull(eRole.PC, mobindex + 6);
|
|
||||||
if (nexttarget && !nexttarget.IsDead())
|
|
||||||
target = nexttarget;
|
|
||||||
else if (nexttarget2 && !nexttarget2.IsDead())
|
|
||||||
target = nexttarget2;
|
|
||||||
}
|
|
||||||
|
|
||||||
end = target.Get_World_Position() + offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
transform.LookAt(end);
|
|
||||||
transform.position = Vector3.MoveTowards(
|
|
||||||
transform.position,
|
|
||||||
end,
|
|
||||||
m_Speed * Time.deltaTime
|
|
||||||
);
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_TableData != null && !string.IsNullOrEmpty(m_TableData.s_Effect))
|
|
||||||
{
|
|
||||||
var delay = table_effect.Ins.Get_Data(m_TableData.s_Effect).f_EffectDelay;
|
|
||||||
yield return new WaitForSeconds(delay);
|
|
||||||
EffectMgr.Ins.Show_Effect(m_TableData.s_Effect, transform.position);
|
|
||||||
}
|
|
||||||
act_end?.Invoke(target);
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Off_AfterOneShot(ProjectileTableData tdata)
|
|
||||||
{
|
|
||||||
m_TableData = tdata;
|
|
||||||
Set_Scale(tdata.f_Scale);
|
|
||||||
if (gameObject.activeInHierarchy)
|
|
||||||
StartCoroutine(Co_Off());
|
|
||||||
}
|
|
||||||
public ProjectileTableData Get_Data() { return m_TableData; }
|
|
||||||
|
|
||||||
public void Set_Scale(float scale) { transform.localScale = Vector3.one * scale; }
|
|
||||||
|
|
||||||
IEnumerator Co_Off()
|
|
||||||
{
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: c3500a17c5eaf0543a0ded5e343088c8
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ProjectileMgr : MonoBehaviourSingletonTemplate<ProjectileMgr>
|
|
||||||
{
|
|
||||||
Dictionary<string, List<ProjectileBase>> dic_projectile = new Dictionary<string, List<ProjectileBase>>();
|
|
||||||
public bool LoadComplete;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
base.Awake();
|
|
||||||
DontDestroyOnLoad(transform.parent.gameObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AllOff()
|
|
||||||
{
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool || MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool_Mob)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
foreach (var item in dic_projectile)
|
|
||||||
for (int i = 0; i < item.Value.Count; i++)
|
|
||||||
item.Value[i].gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerator Co_Load(Action<float> addslidevalue)
|
|
||||||
{
|
|
||||||
LoadComplete = false;
|
|
||||||
|
|
||||||
var lst = table_projectile.Ins.Get_DataList();
|
|
||||||
int totalCount = lst.Count;
|
|
||||||
|
|
||||||
// 슬라이더 35% 사용
|
|
||||||
float add1value = 0.35f / totalCount;
|
|
||||||
|
|
||||||
const int batchSize = 10; // 한 번에 10개씩 로드
|
|
||||||
|
|
||||||
for (int batchStart = 0; batchStart < totalCount; batchStart += batchSize)
|
|
||||||
{
|
|
||||||
// 🔹 현재 배치의 끝 인덱스
|
|
||||||
int batchEnd = Mathf.Min(batchStart + batchSize, totalCount);
|
|
||||||
|
|
||||||
// 🔹 이 배치에서 비동기로 로드할 코루틴 리스트
|
|
||||||
List<Coroutine> coroutines = new List<Coroutine>();
|
|
||||||
|
|
||||||
// 🔹 병렬로 10개 로드 시작
|
|
||||||
for (int i = batchStart; i < batchEnd; i++)
|
|
||||||
{
|
|
||||||
var data = lst[i];
|
|
||||||
|
|
||||||
if (!dic_projectile.ContainsKey(data.s_Projectile))
|
|
||||||
dic_projectile.Add(data.s_Projectile, new List<ProjectileBase>());
|
|
||||||
|
|
||||||
// 비동기 로드 코루틴 추가
|
|
||||||
coroutines.Add(StartCoroutine(LoadProjectile(data, add1value, addslidevalue)));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 🔹 모든 코루틴이 끝날 때까지 대기
|
|
||||||
foreach (var c in coroutines)
|
|
||||||
yield return c;
|
|
||||||
|
|
||||||
// 🔹 한 배치 끝날 때마다 살짝 쉬기 (선택 사항)
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadComplete = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator LoadProjectile(ProjectileTableData data, float add1value, Action<float> addslidevalue)
|
|
||||||
{
|
|
||||||
bool done = false;
|
|
||||||
|
|
||||||
yield return AddrResourceMgr.Ins.LoadObjectSequential<GameObject>(
|
|
||||||
$"Ingame/Projectile/{data.s_Projectile}.prefab",
|
|
||||||
prefab =>
|
|
||||||
{
|
|
||||||
for (int k = 0; k < data.n_LoadAmount; k++)
|
|
||||||
{
|
|
||||||
var proj = DSUtil.Get_Clone<ProjectileBase>(prefab, transform, Vector3.right * 10000f);
|
|
||||||
#if UNITY_EDITOR
|
|
||||||
if (proj == null)
|
|
||||||
MyEditorDialog.Show_Dialog($"{data.s_Projectile} 투사체에 ProjectileBase 스크립트가 없습니다.", null);
|
|
||||||
#endif
|
|
||||||
proj.Off_AfterOneShot(data);
|
|
||||||
dic_projectile[data.s_Projectile].Add(proj);
|
|
||||||
}
|
|
||||||
|
|
||||||
addslidevalue?.Invoke(add1value);
|
|
||||||
done = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 완료될 때까지 대기 (혹시 비동기일 경우 대비)
|
|
||||||
yield return new WaitUntil(() => done);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectileBase Get_Projectile(string projetile)
|
|
||||||
{
|
|
||||||
if (dic_projectile.ContainsKey(projetile))
|
|
||||||
{
|
|
||||||
for (int i = 0; i < dic_projectile[projetile].Count; i++)
|
|
||||||
{
|
|
||||||
if (!dic_projectile[projetile][i].isActiveAndEnabled)
|
|
||||||
return dic_projectile[projetile][i];
|
|
||||||
}
|
|
||||||
|
|
||||||
var newproj = DSUtil.Get_Clone<ProjectileBase>(dic_projectile[projetile][0].gameObject, transform);
|
|
||||||
newproj.gameObject.SetActive(false);
|
|
||||||
newproj.Off_AfterOneShot(dic_projectile[projetile][0].Get_Data());
|
|
||||||
dic_projectile[projetile].Add(newproj);
|
|
||||||
return newproj;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Popup.Ins.Set($"{projetile} 투사체가 없습니다. 테이블을 확인해 주세요.");
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Shoot_Projectile(ProjectileData pdata, Vector3 start, Vector3 end, Actor target, Action<Actor> act_end)
|
|
||||||
{
|
|
||||||
var crirate = pdata.Hitter != null ? pdata.Hitter.Get_ActorStatInfo().Get_TotalStat(eStat.Cri) : 0;
|
|
||||||
pdata.isCri = DSUtil.RandomTrue(crirate);
|
|
||||||
var proj = Get_Projectile(pdata.s_Projectile);
|
|
||||||
proj.Set(pdata, start, end, target, act_end);
|
|
||||||
}
|
|
||||||
public void Set_Scale(string proj, float scale)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < dic_projectile[proj].Count; i++)
|
|
||||||
dic_projectile[proj][i].Set_Scale(scale);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: ab49994372de82649878bfdb8faf3b90
|
|
||||||
|
|
@ -11,17 +11,17 @@ public class BackGroundSetting : MonoBehaviour
|
||||||
for (int i = 0; i < images.Length; i++)
|
for (int i = 0; i < images.Length; i++)
|
||||||
images[i].enabled = false;
|
images[i].enabled = false;
|
||||||
|
|
||||||
var worlddata = table_WorldMapConfig.Ins.Get_Data(MyValue.m_MyStageData.m_Chapter);
|
//var worlddata = table_WorldMapConfig.Ins.Get_Data(MyValue.m_MyStageData.m_Chapter);
|
||||||
AddrResourceMgr.Ins.Relese(m_Handle);
|
//AddrResourceMgr.Ins.Relese(m_Handle);
|
||||||
AddrResourceMgr.Ins.LoadObject<Sprite>($"Ingame/BackGround/{worlddata.s_StageBg}.png", handle =>
|
//AddrResourceMgr.Ins.LoadObject<Sprite>($"Ingame/BackGround/{worlddata.s_StageBg}.png", handle =>
|
||||||
{
|
//{
|
||||||
m_Handle = handle;
|
// m_Handle = handle;
|
||||||
for (int i = 0; i < images.Length; i++)
|
// for (int i = 0; i < images.Length; i++)
|
||||||
{
|
// {
|
||||||
images[i].enabled = true;
|
// images[i].enabled = true;
|
||||||
images[i].sprite = handle.Result;
|
// images[i].sprite = handle.Result;
|
||||||
images[i].GetComponent<BackgroundFitter>().Set();
|
// images[i].GetComponent<BackgroundFitter>().Set();
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class HUD_Dmg : MonoBehaviour
|
|
||||||
{
|
|
||||||
public TextMeshProUGUI[] texts; // 0 실드, 1 hp
|
|
||||||
|
|
||||||
void Set_Common(Vector3 worldpos)
|
|
||||||
{
|
|
||||||
gameObject.SetActive(true);
|
|
||||||
(transform as RectTransform).anchoredPosition = DSUtil.Get_UIPos(worldpos, transform as RectTransform, new Vector2(0f, 200f));
|
|
||||||
StartCoroutine(Co_Off());
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_Off()
|
|
||||||
{
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
Off();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set(bool isCri, bool shield, int dmg, Vector3 worldpos)
|
|
||||||
{
|
|
||||||
Set_Common(worldpos);
|
|
||||||
|
|
||||||
if (dmg == -1)
|
|
||||||
{ // 빗나감
|
|
||||||
texts[0].text = table_localtext.Ins.Get_Text(108);
|
|
||||||
texts[1].text = "";
|
|
||||||
}
|
|
||||||
else if (dmg == -2)
|
|
||||||
{ // 회피
|
|
||||||
texts[0].text = table_localtext.Ins.Get_Text(1003);
|
|
||||||
texts[1].text = "";
|
|
||||||
}
|
|
||||||
else if (dmg == -3 || dmg == -4 || dmg == -5)
|
|
||||||
{ // 근접 무효화, 원거리 무효화, 실드 무효화
|
|
||||||
texts[0].text = table_localtext.Ins.Get_Text(111);
|
|
||||||
texts[1].text = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (shield)
|
|
||||||
{
|
|
||||||
texts[0].text = dmg.ToString();
|
|
||||||
texts[1].text = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
texts[0].text = "";
|
|
||||||
texts[1].text = dmg.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isCri)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(texts[0].text)) texts[0].text = $"{table_localtext.Ins.Get_Text(112)} {texts[0].text}";
|
|
||||||
else if (!string.IsNullOrEmpty(texts[1].text)) texts[1].text = $"{table_localtext.Ins.Get_Text(112)} {texts[1].text}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Set_Heal(int heal, Vector3 worldpos)
|
|
||||||
{
|
|
||||||
Set_Common(worldpos);
|
|
||||||
texts[0].text = "";
|
|
||||||
texts[1].text = $"<color=green>+{heal}";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Off()
|
|
||||||
{
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 934a5cb91b24068478ae895be947fb72
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class HUD_HPShield : MonoBehaviour
|
|
||||||
{
|
|
||||||
public RectTransform rtf_this;
|
|
||||||
public List<TextMeshProUGUI> texts_shield, texts_hp; // 실드, 체력/최대체력
|
|
||||||
public List<SliderBase> sliders;
|
|
||||||
|
|
||||||
Animation m_Anim;
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
m_Anim = GetComponent<Animation>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set_Init(Actor actor)
|
|
||||||
{
|
|
||||||
gameObject.SetActive(true);
|
|
||||||
|
|
||||||
if (actor.IsFrontLine())
|
|
||||||
{
|
|
||||||
rtf_this.localScale = actor.transform.localScale;
|
|
||||||
rtf_this.anchoredPosition = DSUtil.Get_UIPos(actor.Get_World_Position(), rtf_this) + Vector2.up * 200f;
|
|
||||||
}
|
|
||||||
else if (actor.IsMiddleLine())
|
|
||||||
{
|
|
||||||
rtf_this.localScale = actor.transform.localScale * 1.2f;
|
|
||||||
rtf_this.anchoredPosition = DSUtil.Get_UIPos(actor.Get_World_Position(), rtf_this) + Vector2.up * 120f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
rtf_this.localScale = actor.transform.localScale * 1.5f;
|
|
||||||
rtf_this.anchoredPosition = DSUtil.Get_UIPos(actor.Get_World_Position(), rtf_this) + Vector2.up * 50f;
|
|
||||||
}
|
|
||||||
|
|
||||||
sliders.ForEach(f => f.Set(1f));
|
|
||||||
|
|
||||||
if (sliders.Count == 2)
|
|
||||||
{
|
|
||||||
if (actor.IsBoss())
|
|
||||||
{
|
|
||||||
sliders[0].gameObject.SetActive(false);
|
|
||||||
sliders[1].gameObject.SetActive(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sliders[0].gameObject.SetActive(true);
|
|
||||||
sliders[1].gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set(ActorStatInfo stat)
|
|
||||||
{
|
|
||||||
texts_shield.ForEach(f => f.text = stat.Get_TotalStat(eStat.Shield).ToString());
|
|
||||||
var hp = stat.Get_TotalStat(eStat.HP);
|
|
||||||
hp = hp > 0 ? hp : 0;
|
|
||||||
texts_hp.ForEach(f => f.text = $"{hp}/{stat.Get_TotalStat(eStat.MaxHP)}");
|
|
||||||
sliders.ForEach(f => f.Set_Next(DSUtil.Get_SliderValue((float)(hp / stat.Get_TotalStat(eStat.MaxHP)))));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Hit_Shield()
|
|
||||||
{
|
|
||||||
m_Anim.Stop();
|
|
||||||
m_Anim.Play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: c54ca55686b584a44912cfdae68b2d08
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using Random = UnityEngine.Random;
|
|
||||||
|
|
||||||
public class ToolData
|
|
||||||
{
|
|
||||||
public Dictionary<int, List<IngameStageData>> IngameStages = new Dictionary<int, List<IngameStageData>>();
|
|
||||||
public List<BattlePatternData> MonsterPattern = new List<BattlePatternData>();
|
|
||||||
|
|
||||||
public List<IngameStageData> Get_IngameStageDatas(int chapter)
|
|
||||||
{
|
|
||||||
return IngameStages.ContainsKey(chapter) ? IngameStages[chapter] : new List<IngameStageData>();
|
|
||||||
}
|
|
||||||
public IngameStageData Get_IngameStageData(int chapter, int stage)
|
|
||||||
{
|
|
||||||
return IngameStages[chapter].Find(f=>f.m_Stage == stage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable] public class IngameStageData
|
|
||||||
{
|
|
||||||
public int m_Stage;
|
|
||||||
public string mapConfigID;
|
|
||||||
public List<StageNodeData> list_Nodedata = new List<StageNodeData>();
|
|
||||||
public List<StageMonsterData> list_MobData = new List<StageMonsterData>();
|
|
||||||
public List<StageMonsterData> list_BossMobData = new List<StageMonsterData>();
|
|
||||||
public List<StagePatternData> list_PatternData = new List<StagePatternData>();
|
|
||||||
Dictionary<eStageNodeType, int> dic_RandomNodeLimit = new Dictionary<eStageNodeType, int>();
|
|
||||||
|
|
||||||
public List<StageMonsterData> Get_MonsterList(bool isBoss) { return isBoss ? list_BossMobData : list_MobData; }
|
|
||||||
public void Init()
|
|
||||||
{
|
|
||||||
Set_RandomNodeLimit();
|
|
||||||
}
|
|
||||||
public bool Use_RandomNodeLimit(eStageNodeType nodeType)
|
|
||||||
{
|
|
||||||
if (!dic_RandomNodeLimit.ContainsKey(nodeType) || dic_RandomNodeLimit[nodeType] <= 0)
|
|
||||||
return false;
|
|
||||||
--dic_RandomNodeLimit[nodeType];
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public void Set_RandomNodeLimit()
|
|
||||||
{
|
|
||||||
dic_RandomNodeLimit.Clear();
|
|
||||||
for (int i = 0; i < list_Nodedata.Count; i++)
|
|
||||||
{
|
|
||||||
if (list_Nodedata[i].m_Type == eStageNodeType.Random)
|
|
||||||
{
|
|
||||||
var nodedata = list_Nodedata[i].Get_Data<StageNodeData_Random>();
|
|
||||||
var tdata = table_RandomPatternConfig.Ins.Get_Data(nodedata.RandomID);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.Nothing, 999);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.Mob, tdata.n_MonsterLimitCount);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.BuffDebuff, tdata.n_BuffDebuffLimitCount);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.Merchant, tdata.n_MerchantLimitCount);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.Treasure, tdata.n_TreasureLimitCount);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.NPC, tdata.n_NPCLimitCount);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.Sanctuary, tdata.f_MineLimitCount);
|
|
||||||
dic_RandomNodeLimit.Add(eStageNodeType.TwoWay, tdata.f_TwoWayLimitCount);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Serializable] public class StageNodeData
|
|
||||||
{
|
|
||||||
public int m_Node;
|
|
||||||
public eStageNodeType m_Type;
|
|
||||||
public string JsonData;
|
|
||||||
|
|
||||||
// JSON 직렬화 옵션 (상속 구조 안전)
|
|
||||||
private static readonly JsonSerializerSettings JsonSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All };
|
|
||||||
|
|
||||||
|
|
||||||
public T Get_Data<T>() where T : class { return JsonConvert.DeserializeObject<T>(JsonData, JsonSettings); }
|
|
||||||
public void Set_Data<T>(eStageNodeType type, T nodedata)
|
|
||||||
{
|
|
||||||
m_Type = type;
|
|
||||||
Set_Data(nodedata);
|
|
||||||
}
|
|
||||||
public void Set_Data<T>(T nodedata)
|
|
||||||
{
|
|
||||||
JsonData = JsonConvert.SerializeObject(nodedata, JsonSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[Serializable] public class StageNodeData_Nothing { public float Time; }
|
|
||||||
[Serializable] public class StageNodeData_Treasure { public int BoxID; public float MimicRate; }
|
|
||||||
[Serializable] public class StageNodeData_Mob { public int MobCount; public int PatternID; public List<int> list_MobID = new List<int>(); public bool MakeRandom = false; }
|
|
||||||
[Serializable] public class StageNodeData_BuffDebuff { public int BuffID; }
|
|
||||||
[Serializable] public class StageNodeData_Campfire { public int Gold; public int Heal; public int Exp; }
|
|
||||||
[Serializable] public class StageNodeData_Merchant { public int MerchantID; }
|
|
||||||
[Serializable] public class StageNodeData_NPC { public int NPCID; }
|
|
||||||
[Serializable] public class StageNodeData_Mine { public int SanctuaryID; }
|
|
||||||
[Serializable] public class StageNodeData_TwoWay { public string MapConfig1; public string MapConfig2; public float ChangeRate; }
|
|
||||||
[Serializable] public class StageNodeData_Boss : StageNodeData_Mob { public int BossID; }
|
|
||||||
[Serializable] public class StageNodeData_Random { public int RandomID; }
|
|
||||||
|
|
||||||
[Serializable] public class StageMonsterData { public int m_Index, m_MobID, m_Weight; }
|
|
||||||
|
|
||||||
[Serializable] public class BattlePatternData // 최종 9개의 패턴
|
|
||||||
{
|
|
||||||
public int m_Pattern, m_PatternID; // 101 부터
|
|
||||||
public ePatternType m_PatternType;
|
|
||||||
public int m_MobCount; // 패턴 몬스터 수는 최초 참고용
|
|
||||||
public List<MonsterPatternData> list_MobPatternData; // 0~2 대기열, 3~5 후열, 6~8 전열
|
|
||||||
public List<MonsterPatternDetailData> list_Detail; // 0~2 대기열 확률, 3~5 후열 확률, 6~8 전열 확률
|
|
||||||
|
|
||||||
public MakeMobData Get_MakeMob(int setindex, eMobBattlePos battlePos)
|
|
||||||
{ // 인게임에서 실시간 호출
|
|
||||||
var mmd = new MakeMobData();
|
|
||||||
var data = list_Detail.Find(f=>f.m_Index == setindex && f.e_MobPos == battlePos);
|
|
||||||
var rdn = Random.Range(0, 10000);
|
|
||||||
var count = data.MobID > 0 ? data.list_Rate.Count : data.list_Rate.Count - 1;
|
|
||||||
for (int i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
if (data.list_Rate[i] > rdn)
|
|
||||||
{
|
|
||||||
mmd.bNoMob = false;
|
|
||||||
mmd.e_ToolMobType = (eToolMobType)i;
|
|
||||||
mmd.MobID = mmd.e_ToolMobType == eToolMobType.Unique ? data.MobID : 0;
|
|
||||||
mmd.f_Rate = data.list_Rate[i] / 10000;
|
|
||||||
mmd.m_ActorSettingData = data.m_ActorSettingData;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//list_MobPatternData[Get_ListIndex(setindex, battlePos)].m_MakeMobData = mmd;
|
|
||||||
|
|
||||||
return mmd;
|
|
||||||
}
|
|
||||||
int Get_ListIndex(int setindex, eMobBattlePos battlePos)
|
|
||||||
{
|
|
||||||
if (setindex == 1 && battlePos == eMobBattlePos.Backline)
|
|
||||||
return 0;
|
|
||||||
else if (setindex == 2 && battlePos == eMobBattlePos.Backline)
|
|
||||||
return 1;
|
|
||||||
else if (setindex == 3 && battlePos == eMobBattlePos.Backline)
|
|
||||||
return 2;
|
|
||||||
else if (setindex == 1 && battlePos == eMobBattlePos.Middleline)
|
|
||||||
return 3;
|
|
||||||
else if (setindex == 2 && battlePos == eMobBattlePos.Middleline)
|
|
||||||
return 4;
|
|
||||||
else if (setindex == 3 && battlePos == eMobBattlePos.Middleline)
|
|
||||||
return 5;
|
|
||||||
else if (setindex == 1 && battlePos == eMobBattlePos.Frontline)
|
|
||||||
return 6;
|
|
||||||
else if (setindex == 2 && battlePos == eMobBattlePos.Frontline)
|
|
||||||
return 7;
|
|
||||||
return 8;
|
|
||||||
}
|
|
||||||
public int Get_Rate(int index) { return list_Detail[index].list_Rate.Sum(); }
|
|
||||||
}
|
|
||||||
[Serializable] public class MonsterPatternData
|
|
||||||
{
|
|
||||||
public int m_Index; // 0~8 9칸
|
|
||||||
public eMobBattlePos e_MobPos; // 대기열, 후열, 전열
|
|
||||||
//public MakeMobData m_MakeMobData; // 게임 내에서 실시간 생성
|
|
||||||
}
|
|
||||||
[Serializable] public class MonsterPatternDetailData
|
|
||||||
{
|
|
||||||
public int m_Index; // 1~3 가로 인덱스
|
|
||||||
public eMobBattlePos e_MobPos;
|
|
||||||
public List<int> list_Rate; // 0 근접, 1 원거리, 2 고유
|
|
||||||
public int MobID; // 0 이면 없음
|
|
||||||
public ActorSettingData m_ActorSettingData = new ActorSettingData { PreemptiveStrike = false, StunTime = 0f };
|
|
||||||
}
|
|
||||||
[Serializable] public class MakeMobData
|
|
||||||
{
|
|
||||||
public bool bNoMob = true, isBoss = false;
|
|
||||||
public eToolMobType e_ToolMobType; // 몬스터 종류
|
|
||||||
public float f_Rate; // 확률
|
|
||||||
public int MobID; // 0이 아니면 지정된 몹이 나와야 함
|
|
||||||
public ActorSettingData m_ActorSettingData = new ActorSettingData { PreemptiveStrike = false, StunTime = 0f };
|
|
||||||
}
|
|
||||||
[Serializable] public class ActorSettingData
|
|
||||||
{
|
|
||||||
public bool PreemptiveStrike = false;
|
|
||||||
public float StunTime = 0f;
|
|
||||||
}
|
|
||||||
public enum eToolMobType { Melee, Range, Unique }
|
|
||||||
|
|
||||||
[Serializable] public class StagePatternData { public int m_PatternID, m_Weight, m_MobCount; }
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 573f8f77b05524243a2f0be0da46c07a
|
|
||||||
|
|
@ -65,13 +65,15 @@ public class MoneyAnimationObj : MonoBehaviour
|
||||||
else if (itemid == MyValue.ItemID_Exp)
|
else if (itemid == MyValue.ItemID_Exp)
|
||||||
val = Get_Val(eStat.EXP_Mul, val);
|
val = Get_Val(eStat.EXP_Mul, val);
|
||||||
|
|
||||||
InGameInfo.Ins.Add_Goods(itemid, val);
|
//InGameInfo.Ins.Add_Goods(itemid, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Get_Val(eStat stat, int val)
|
int Get_Val(eStat stat, int val)
|
||||||
{
|
{
|
||||||
var mul = InGameInfo.Ins.m_PCActor.Get_ActorStatInfo().Get_BuffStat(stat);
|
//var mul = InGameInfo.Ins.m_PCActor.Get_ActorStatInfo().Get_BuffStat(stat);
|
||||||
if (mul > 1) val = (int)(val * mul);
|
//if (mul > 1) val = (int)(val * mul);
|
||||||
return val;
|
//return val;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,349 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
|
||||||
using Random = UnityEngine.Random;
|
|
||||||
|
|
||||||
public class MonsterNodeControler : MonoBehaviourSingletonTemplate<MonsterNodeControler>
|
|
||||||
{
|
|
||||||
public Actor[] actors; // 0 ~ 2 전열, 3 ~ 5 후열, 6 ~ 8 대기열
|
|
||||||
|
|
||||||
Dictionary<eMobBattlePos, Dictionary<int, int>> dic_mob = new Dictionary<eMobBattlePos, Dictionary<int, int>>
|
|
||||||
{
|
|
||||||
{ eMobBattlePos.Frontline, new Dictionary<int, int>{ { 1, 1 }, { 2, 2 }, { 3, 3 } } },
|
|
||||||
{ eMobBattlePos.Middleline, new Dictionary<int, int>{ { 1, 1 }, { 2, 2 }, { 3, 3 } } },
|
|
||||||
{ eMobBattlePos.Backline, new Dictionary<int, int>{ { 1, 1 }, { 2, 2 }, { 3, 3 } } },
|
|
||||||
};
|
|
||||||
Dictionary<eMobBattlePos, Dictionary<int, MakeMobData>> dic_mobsetData = new Dictionary<eMobBattlePos, Dictionary<int, MakeMobData>>
|
|
||||||
{
|
|
||||||
{ eMobBattlePos.Frontline, new Dictionary<int, MakeMobData>{ { 1, null }, { 2, null }, { 3, null } } },
|
|
||||||
{ eMobBattlePos.Middleline, new Dictionary<int, MakeMobData>{ { 1, null }, { 2, null }, { 3, null } } },
|
|
||||||
{ eMobBattlePos.Backline, new Dictionary<int, MakeMobData>{ { 1, null }, { 2, null }, { 3, null } } },
|
|
||||||
};
|
|
||||||
List<float> list_scale = new List<float> { 1f, 1f, 1f, 0.6f, 0.6f, 0.6f, 0.28f, 0.28f, 0.28f };
|
|
||||||
List<Vector3> list_pos = new List<Vector3>
|
|
||||||
{
|
|
||||||
new Vector3(-7.0f, -1.1f), new Vector3(0f, -1.1f), new Vector3(7.0f, -1.1f),
|
|
||||||
new Vector3(-5f, 5.5f), new Vector3(0f, 5.5f), new Vector3(5f, 5.5f),
|
|
||||||
new Vector3(-3.5f, 10.05f), new Vector3(0f, 10.05f), new Vector3(3.5f, 10.05f),
|
|
||||||
//new Vector3(-6.5f, -4.05f), new Vector3(0f, -4.05f), new Vector3(6.5f, -4.05f),
|
|
||||||
//new Vector3(-5f, 2.55f), new Vector3(0f, 2.55f), new Vector3(5f, 2.55f),
|
|
||||||
//new Vector3(-3.5f, 7.1f), new Vector3(0f, 7.1f), new Vector3(3.5f, 7.1f),
|
|
||||||
};
|
|
||||||
eMobBattlePos CurLine = eMobBattlePos.Frontline;
|
|
||||||
|
|
||||||
Action act_EndNode;
|
|
||||||
|
|
||||||
public void Set(Action endnode)
|
|
||||||
{
|
|
||||||
var ingamestagedata = MyValue.m_MyStageData.m_StageData;
|
|
||||||
var stagedata = MyValue.m_MyStageData.Get_CurNodeData();
|
|
||||||
|
|
||||||
Set(endnode, ingamestagedata, stagedata);
|
|
||||||
}
|
|
||||||
public void Set(Action endnode, IngameStageData ingamestagedata, StageNodeData stagedata)
|
|
||||||
{
|
|
||||||
act_EndNode = endnode;
|
|
||||||
CurLine = eMobBattlePos.Frontline;
|
|
||||||
|
|
||||||
var mobdata = stagedata.Get_Data<StageNodeData_Mob>();
|
|
||||||
var battledata = InGameInfo.Ins.Get_BattlePatternData(mobdata.PatternID);
|
|
||||||
|
|
||||||
foreach (var outer in dic_mob)
|
|
||||||
{
|
|
||||||
var innerKeys = outer.Value.Keys.ToList(); // Key 목록 복사
|
|
||||||
foreach (var key in innerKeys)
|
|
||||||
outer.Value[key] = 0; // 값 초기화
|
|
||||||
}
|
|
||||||
foreach (var outer in dic_mobsetData)
|
|
||||||
{
|
|
||||||
var innerKeys = outer.Value.Keys.ToList(); // Key 목록 복사
|
|
||||||
foreach (var key in innerKeys)
|
|
||||||
outer.Value[key] = null; // 값 초기화
|
|
||||||
}
|
|
||||||
|
|
||||||
int makeMobCount = 0, bossid = 0;
|
|
||||||
bool MakeOver = false;
|
|
||||||
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
actors[i].Set(i);
|
|
||||||
|
|
||||||
// 보스 노드 구성
|
|
||||||
if (stagedata.m_Type == eStageNodeType.Boss)
|
|
||||||
{
|
|
||||||
++makeMobCount;
|
|
||||||
var bossdata = stagedata.Get_Data<StageNodeData_Boss>();
|
|
||||||
bossid = bossdata.BossID;
|
|
||||||
dic_mob[eMobBattlePos.Backline][2] = bossid;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 몬스터 구성
|
|
||||||
if (makeMobCount < mobdata.MobCount)
|
|
||||||
for (eMobBattlePos pos = eMobBattlePos.Frontline; pos >= eMobBattlePos.Backline; --pos)
|
|
||||||
{
|
|
||||||
if (MakeOver) break;
|
|
||||||
|
|
||||||
for (int i = 1; i <= 3; i++)
|
|
||||||
{
|
|
||||||
var mob = battledata.Get_MakeMob(i, pos);
|
|
||||||
dic_mobsetData[pos][i] = mob;
|
|
||||||
if (!mob.bNoMob && dic_mob[pos][i] == 0)
|
|
||||||
{
|
|
||||||
dic_mob[pos][i] = Get_MobID(mob, mobdata, makeMobCount, bossid);
|
|
||||||
|
|
||||||
++makeMobCount;
|
|
||||||
if (makeMobCount >= mobdata.MobCount)
|
|
||||||
{
|
|
||||||
MakeOver = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
actors[i].Set_Trasform(list_pos[i], list_scale[i]);
|
|
||||||
var mobins = table_monsterlist.Ins;
|
|
||||||
var ingameuiins = IngameUIManager.Ins;
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
{
|
|
||||||
actors[i].Set(i + 1, mobins.Get_Data_orNull(dic_mob[eMobBattlePos.Frontline][i + 1]), ingameuiins.Mob_HUD_HPShield[i]);
|
|
||||||
actors[i].Set_Line(eMobBattlePos.Frontline);
|
|
||||||
ActorSet(actors[i], eMobBattlePos.Frontline, i + 1);
|
|
||||||
|
|
||||||
actors[i + 3].Set(i + 4, mobins.Get_Data_orNull(dic_mob[eMobBattlePos.Middleline][i + 1]), ingameuiins.Mob_HUD_HPShield[i + 3]);
|
|
||||||
actors[i + 3].Set_Line(eMobBattlePos.Middleline);
|
|
||||||
ActorSet(actors[i + 3], eMobBattlePos.Middleline, i + 1);
|
|
||||||
|
|
||||||
actors[i + 6].Set(i + 7, mobins.Get_Data_orNull(dic_mob[eMobBattlePos.Backline][i + 1]), ingameuiins.Mob_HUD_HPShield[i + 6]);
|
|
||||||
actors[i + 6].Set_Line(eMobBattlePos.Backline);
|
|
||||||
ActorSet(actors[i + 6], eMobBattlePos.Backline, i + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
InGameInfo.Ins.BattleStart_AfterMakeMob();
|
|
||||||
}
|
|
||||||
|
|
||||||
int Get_MobID(MakeMobData mob, StageNodeData_Mob mobnode, int makecount, int bossid)
|
|
||||||
{
|
|
||||||
if (mob.MobID > 0)
|
|
||||||
return mob.MobID;
|
|
||||||
|
|
||||||
var lst = mobnode.list_MobID;
|
|
||||||
if (bossid > 0) lst = mobnode.list_MobID.FindAll(f => f != bossid);
|
|
||||||
|
|
||||||
if (mobnode.MakeRandom)
|
|
||||||
return lst[Random.Range(0, lst.Count)];
|
|
||||||
|
|
||||||
return lst[makecount % lst.Count];
|
|
||||||
//return MyValue.m_MyStageData.Get_MobID_onStage(mob.e_ToolMobType);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ActorSet(Actor actor, eMobBattlePos pos, int index)
|
|
||||||
{
|
|
||||||
if (dic_mobsetData[pos][index] != null)
|
|
||||||
actor.ActorSet(dic_mobsetData[pos][index].m_ActorSettingData);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Update()
|
|
||||||
{
|
|
||||||
if (Input.GetMouseButtonDown(0))
|
|
||||||
{
|
|
||||||
Vector2 worldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
|
|
||||||
RaycastHit2D hit = Physics2D.Raycast(worldPos, Vector2.zero);
|
|
||||||
|
|
||||||
if (hit.collider != null)
|
|
||||||
{
|
|
||||||
var actor = hit.collider.GetComponent<Actor>();
|
|
||||||
if (actor != null && !actor.IsDead() && actor.IsFrontLine())
|
|
||||||
InGameInfo.Ins.m_PCActor.Set_Target(actor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Init_IngameDatas() { for (int i = 0; i < actors.Length; i++) actors[i].Init_IngameDatas(); }
|
|
||||||
public void Init_EveryMeetMonster() { for (int i = 0; i < actors.Length; i++) actors[i].Init_EveryMeetMonster(); }
|
|
||||||
public void Set_Battle(bool battle)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
actors[i].Set_Battle(battle);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Actor[] Get_AllActor() { return actors; }
|
|
||||||
public Actor Get_RandomTarget()
|
|
||||||
{
|
|
||||||
var alive = actors.Where(a => !a.IsDead()).ToList();
|
|
||||||
if (alive.Count > 0)
|
|
||||||
return alive[Random.Range(0, alive.Count)];
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public Actor Get_Actor_orNull(int index) { return index >= 0 ? actors[index] : null; }
|
|
||||||
public void Set_TargetUI(Actor target)
|
|
||||||
{
|
|
||||||
Set_TargetUI_AllOff();
|
|
||||||
if (target) target.Set_TargetObj(true);
|
|
||||||
}
|
|
||||||
void Set_TargetUI_AllOff() { for (int i = 0; i < actors.Length; i++) actors[i].Set_TargetObj(false); }
|
|
||||||
|
|
||||||
public void Check_LineAllDead()
|
|
||||||
{
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool_Mob) return;
|
|
||||||
|
|
||||||
// 모든 몬스터 사망 확인
|
|
||||||
bool alldead = true;
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
{
|
|
||||||
if (!actors[i].IsDead())
|
|
||||||
{
|
|
||||||
alldead = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (alldead) CurLine = eMobBattlePos.Backline;
|
|
||||||
|
|
||||||
switch (CurLine)
|
|
||||||
{
|
|
||||||
case eMobBattlePos.Backline:
|
|
||||||
if (actors[6].IsDead() && actors[7].IsDead() && actors[8].IsDead())
|
|
||||||
{
|
|
||||||
InGameInfo.Ins.Set_Battle(false);
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(Co_AllKill());
|
|
||||||
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool_Mob)
|
|
||||||
DefeatUI.Ins.Set();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eMobBattlePos.Middleline:
|
|
||||||
if (actors[3].IsDead() && actors[4].IsDead() && actors[5].IsDead())
|
|
||||||
{
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(Co_LineChange());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eMobBattlePos.Frontline:
|
|
||||||
if (actors[0].IsDead() && actors[1].IsDead() && actors[2].IsDead())
|
|
||||||
{
|
|
||||||
StopAllCoroutines();
|
|
||||||
StartCoroutine(Co_LineChange());
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_LineChange()
|
|
||||||
{
|
|
||||||
InGameInfo.Ins.Set_Battle(false);
|
|
||||||
Set_TargetUI_AllOff();
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
actors[i].Set_HUD(false);
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(0.5f);
|
|
||||||
|
|
||||||
List<(Actor actor, Vector3 startPos, Vector3 targetPos, Vector3 startScale, Vector3 targetScale)> moveList =
|
|
||||||
new List<(Actor, Vector3, Vector3, Vector3, Vector3)>();
|
|
||||||
|
|
||||||
switch (CurLine)
|
|
||||||
{
|
|
||||||
case eMobBattlePos.Frontline:
|
|
||||||
// Middle(3~5) → Front(0~2)
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
{
|
|
||||||
var a = actors[i];
|
|
||||||
a.Set_MobIndex_byLineChange();
|
|
||||||
var from = actors[3 + i];
|
|
||||||
from.Set_Line(eMobBattlePos.Frontline);
|
|
||||||
from.Set_MobIndex_byLineChange();
|
|
||||||
moveList.Add((from, from.transform.localPosition, list_pos[i],
|
|
||||||
from.transform.localScale, Vector3.one * list_scale[i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Wait(6~8) → Middle(3~5)
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
{
|
|
||||||
var a = actors[3 + i];
|
|
||||||
var from = actors[6 + i];
|
|
||||||
from.Set_Line(eMobBattlePos.Middleline);
|
|
||||||
from.Set_MobIndex_byLineChange();
|
|
||||||
moveList.Add((from, from.transform.localPosition, list_pos[3 + i],
|
|
||||||
from.transform.localScale, Vector3.one * list_scale[3 + i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
CurLine = eMobBattlePos.Middleline;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case eMobBattlePos.Middleline:
|
|
||||||
// Middle(Wait, 3~5) → Front(0~2)
|
|
||||||
for (int i = 0; i < 3; i++)
|
|
||||||
{
|
|
||||||
var from = actors[6 + i];
|
|
||||||
from.Set_Line(eMobBattlePos.Frontline);
|
|
||||||
from.Set_MobIndex_byLineChange();
|
|
||||||
moveList.Add((from, from.transform.localPosition, list_pos[i],
|
|
||||||
from.transform.localScale, Vector3.one * list_scale[i]));
|
|
||||||
}
|
|
||||||
|
|
||||||
CurLine = eMobBattlePos.Backline;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 이동
|
|
||||||
float t = 0f;
|
|
||||||
const float duration = 0.5f; // 이동 시간
|
|
||||||
while (t < 1f)
|
|
||||||
{
|
|
||||||
Set_TargetUI_AllOff();
|
|
||||||
|
|
||||||
t += Time.deltaTime / duration;
|
|
||||||
foreach (var (actor, startPos, targetPos, startScale, targetScale) in moveList)
|
|
||||||
{
|
|
||||||
if (actor == null) continue;
|
|
||||||
actor.transform.localPosition = Vector3.Lerp(startPos, targetPos, t);
|
|
||||||
actor.transform.localScale = Vector3.Lerp(startScale, targetScale, t);
|
|
||||||
}
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 최종 위치 정렬
|
|
||||||
foreach (var (actor, _, targetPos, _, targetScale) in moveList)
|
|
||||||
{
|
|
||||||
actor.transform.localPosition = targetPos;
|
|
||||||
actor.transform.localScale = targetScale;
|
|
||||||
if (!actor.IsDead()) actor.Set_HUD(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(0.3f);
|
|
||||||
Check_LineAllDead();
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(0.2f);
|
|
||||||
InGameInfo.Ins.Set_Battle(IngameUIManager.Ins.Check_BattleStart());
|
|
||||||
InGameInfo.Ins.m_PCActor.OnEvent_RunSkillCard();
|
|
||||||
InGameInfo.Ins.OnEvent_AfterLineChange();
|
|
||||||
}
|
|
||||||
IEnumerator Co_AllKill()
|
|
||||||
{
|
|
||||||
while (!IngameUIManager.Ins.Check_BattleStart()) yield return null;
|
|
||||||
yield return new WaitForSeconds(1.5f); // 경험치 들어가는 시간 기다림
|
|
||||||
act_EndNode();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnEvent_CheckCard(CardListTableData carddata)
|
|
||||||
{
|
|
||||||
switch (carddata.e_CardType)
|
|
||||||
{
|
|
||||||
case eCardType.G3_DodgeFirstRangedAttack:
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
{
|
|
||||||
if (actors[i].Get_Data() != null && actors[i].Get_AttackType() == eAttackType.Range)
|
|
||||||
actors[i].Set_Buff(true, eStat.MyRangeAttackAvoid, 1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AllOff()
|
|
||||||
{
|
|
||||||
for (int i = 0; i < actors.Length; i++)
|
|
||||||
actors[i].Off();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 22df1a65f79b31b47b0a80aeea209777
|
|
||||||
|
|
@ -1,97 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeBase : MonoBehaviour
|
|
||||||
{
|
|
||||||
public eStageNodeType m_NodeType;
|
|
||||||
|
|
||||||
public void Set()
|
|
||||||
{
|
|
||||||
var data = MyValue.m_MyStageData.Get_CurNodeData();
|
|
||||||
if (data != null)
|
|
||||||
{
|
|
||||||
var curType = data.m_Type;
|
|
||||||
if (curType == eStageNodeType.Boss && m_NodeType == eStageNodeType.Mob)
|
|
||||||
Set_Node();
|
|
||||||
else if (curType == m_NodeType)
|
|
||||||
Set_Node();
|
|
||||||
else
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void Set_Node()
|
|
||||||
{
|
|
||||||
gameObject.SetActive(true);
|
|
||||||
InGameInfo.Ins.OnEvent_MeetNode(m_NodeType);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_EndNode()
|
|
||||||
{
|
|
||||||
End_Node(0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void End_Node()
|
|
||||||
{
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
IngameUIManager.Ins.Active_ExporeButton();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void End_Node(float delay = 0f)
|
|
||||||
{
|
|
||||||
StartCoroutine(Co_EndNode(delay));
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_EndNode(float delay)
|
|
||||||
{
|
|
||||||
yield return new WaitForSeconds(delay);
|
|
||||||
End_Node();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void Set_Mob(int mobid, bool PreemptiveStrike = false, float StunTime = 0f)
|
|
||||||
{
|
|
||||||
var mobID = mobid;
|
|
||||||
var snd = new StageNodeData();
|
|
||||||
StageNodeData_Mob mobnodedata = new StageNodeData_Mob
|
|
||||||
{
|
|
||||||
MobCount = 1,
|
|
||||||
list_MobID = new List<int> { mobID },
|
|
||||||
PatternID = -2
|
|
||||||
};
|
|
||||||
snd.Set_Data(eStageNodeType.Mob, mobnodedata);
|
|
||||||
var stagedata = new IngameStageData
|
|
||||||
{
|
|
||||||
list_MobData = new List<StageMonsterData> { new StageMonsterData { m_Index = 0, m_MobID = mobID, m_Weight = 10000 } },
|
|
||||||
mapConfigID = "Mimic",
|
|
||||||
list_PatternData = new List<StagePatternData> { new StagePatternData { m_PatternID = -1, m_Weight = 10000 } },
|
|
||||||
list_Nodedata = new List<StageNodeData> { snd }
|
|
||||||
};
|
|
||||||
|
|
||||||
List<MonsterPatternDetailData> lstDetail = new List<MonsterPatternDetailData>();
|
|
||||||
for (int i = 0; i < 9; i++)
|
|
||||||
{
|
|
||||||
var temp = new MonsterPatternDetailData { m_Index = i == 0 || i == 3 || i == 6 ? 1 : i == 1 || i == 4 || i == 7 ? 2 : 3 };
|
|
||||||
temp.e_MobPos = i < 3 ? eMobBattlePos.Frontline : i < 6 ? eMobBattlePos.Middleline : eMobBattlePos.Backline;
|
|
||||||
if (temp.e_MobPos == eMobBattlePos.Frontline && i == 1)
|
|
||||||
{
|
|
||||||
temp.MobID = mobID;
|
|
||||||
temp.m_ActorSettingData = new ActorSettingData { PreemptiveStrike = PreemptiveStrike, StunTime = StunTime };
|
|
||||||
temp.list_Rate = new List<int> { 0, 0, 10000 };
|
|
||||||
}
|
|
||||||
else
|
|
||||||
temp.list_Rate = new List<int> { 0, 0, 0 };
|
|
||||||
lstDetail.Add(temp);
|
|
||||||
}
|
|
||||||
var battlepatterndata = new BattlePatternData
|
|
||||||
{
|
|
||||||
list_Detail = lstDetail,
|
|
||||||
m_PatternID = mobnodedata.PatternID
|
|
||||||
};
|
|
||||||
|
|
||||||
InGameInfo.Ins.Add_BattlePatternData(mobnodedata.PatternID, battlepatterndata);
|
|
||||||
MonsterNodeControler.Ins.Set(End_Node, stagedata, snd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3a47c25babdfa8a45ab8eb669eab5594
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeBase_Camp : StageNodeBase
|
|
||||||
{ // 스킬 카드 중 성소가 캠프와 동일하게 작동하는 경우가 있어서 공통 처리
|
|
||||||
public TextMeshProUGUI[] texts; // 0 회복량, 1 골드, 2 경험치
|
|
||||||
|
|
||||||
protected ObscuredInt m_Heal, m_Gold, m_Exp;
|
|
||||||
|
|
||||||
protected void Set_Goods(int heal, int gold, int exp)
|
|
||||||
{
|
|
||||||
m_Heal = heal; m_Heal.RandomizeCryptoKey();
|
|
||||||
m_Gold = gold; m_Gold.RandomizeCryptoKey();
|
|
||||||
m_Exp = exp; m_Exp.RandomizeCryptoKey();
|
|
||||||
|
|
||||||
texts[0].text = m_Heal.ToString();
|
|
||||||
texts[1].text = m_Gold.ToString();
|
|
||||||
texts[2].text = m_Exp.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_Item(int index)
|
|
||||||
{
|
|
||||||
GetComponent<Animation>().Play("Campfire_Off");
|
|
||||||
|
|
||||||
switch (index)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
InGameInfo.Ins.Heal_PC(eHealType.Camp, m_Heal);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
InGameInfo.Ins.Add_Goods(MyValue.ItemID_Gold, m_Gold);
|
|
||||||
GetItemUI.Ins.Set(new ItemSimpleData { itemid = MyValue.ItemID_Gold, amount = m_Gold });
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
InGameInfo.Ins.Add_Goods(MyValue.ItemID_Exp, m_Exp);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
End_Node(1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: d3844c2e2a7b496438a65da9d454b8c5
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeUI_BuffDebuff : StageNodeBase
|
|
||||||
{
|
|
||||||
public GameObject go_btns;
|
|
||||||
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
go_btns.SetActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_Eat()
|
|
||||||
{
|
|
||||||
go_btns.SetActive(false);
|
|
||||||
Popup.Ins.Set("아직 효과 없음", () => { End_Node(0f); }, () => { End_Node(0f); });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: fb190f019839c0b48b939dbb0bc49f76
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeUI_Campfire : StageNodeBase_Camp
|
|
||||||
{
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
var campData = MyValue.m_MyStageData.Get_CurNodeData().Get_Data<StageNodeData_Campfire>();
|
|
||||||
Set_Goods(campData.Heal, campData.Gold, campData.Exp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3b71df2ae7eb43c46a0d612c6fd77250
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeUI_Merchant : StageNodeBase
|
|
||||||
{
|
|
||||||
public GameObject go_meet, go_buy;
|
|
||||||
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
Show_Meet();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Show_Meet()
|
|
||||||
{
|
|
||||||
go_meet.SetActive(true);
|
|
||||||
go_buy.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_ShowBuy()
|
|
||||||
{
|
|
||||||
go_meet.SetActive(false);
|
|
||||||
go_buy.SetActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_Buy()
|
|
||||||
{
|
|
||||||
Popup.Ins.Set("현재는 구매할 수 없습니다.");
|
|
||||||
}
|
|
||||||
public void OnClick_BuyCancle()
|
|
||||||
{
|
|
||||||
Show_Meet();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 620f2e4d83225434c92e10a0eac17e2b
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class StageNodeUI_Mine : StageNodeBase_Camp
|
|
||||||
{
|
|
||||||
public Image i_sanctuary;
|
|
||||||
public GameObject go_effect, go_btn;
|
|
||||||
public TextMeshProUGUI[] texts_sactuary; // 0 성소 이름, 1 성소 효과
|
|
||||||
|
|
||||||
StageNodeData_Mine m_Data;
|
|
||||||
SanctuaryConfigTableData m_TData;
|
|
||||||
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
m_Data = MyValue.m_MyStageData.Get_CurNodeData().Get_Data<StageNodeData_Mine>();
|
|
||||||
m_TData = table_SanctuaryConfig.Ins.Get_Data(m_Data.SanctuaryID);
|
|
||||||
i_sanctuary.sprite = UIAtlasMgr.Ins.Get_Sprite(m_TData.s_MineImg);
|
|
||||||
texts_sactuary[0].text = "";
|
|
||||||
|
|
||||||
go_effect.SetActive(false);
|
|
||||||
go_btn.SetActive(true);
|
|
||||||
|
|
||||||
Set_Goods(table_GlobalValue.Ins.Get_Int("CampFire_Default_HP"),
|
|
||||||
table_GlobalValue.Ins.Get_Int("CampFire_Default_Gold"),
|
|
||||||
table_GlobalValue.Ins.Get_Int("CampFire_Default_EXP"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_Search()
|
|
||||||
{
|
|
||||||
go_effect.SetActive(true);
|
|
||||||
go_btn.SetActive(false);
|
|
||||||
|
|
||||||
var optiondata = table_StatusOptionSet.Ins.Get_Data(m_TData.n_BuffOptionID);
|
|
||||||
var actor = InGameInfo.Ins.m_PCActor;
|
|
||||||
actor.RunStatusEffect_Instantly(optiondata, optiondata.Get_Target(actor, actor.Get_Target(), actor.Get_Data().m_Role), data =>
|
|
||||||
{
|
|
||||||
if (data > 0)
|
|
||||||
texts_sactuary[1].text = table_localtext.Ins.Get_Text(m_TData.n_BuffDesc, data);
|
|
||||||
else
|
|
||||||
texts_sactuary[1].text = table_localtext.Ins.Get_Text(m_TData.n_BuffDesc);
|
|
||||||
|
|
||||||
switch (optiondata.e_StatusConditionsType)
|
|
||||||
{
|
|
||||||
case eStatusConditionsType.Heal_Hp_Add:
|
|
||||||
case eStatusConditionsType.Heal_Hp_Random:
|
|
||||||
case eStatusConditionsType.Heal_Hp_Mul:
|
|
||||||
{
|
|
||||||
var card = actor.Get_CardSkillData_orNull(eCardType.G1_ShieldHealOnHealFountain);
|
|
||||||
if (card != null) actor.Heal_Shield((int)data);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (m_TData.e_SanctuaryType)
|
|
||||||
{
|
|
||||||
case eSanctuaryType.Sanctuary:
|
|
||||||
break;
|
|
||||||
case eSanctuaryType.Spring_Heal:
|
|
||||||
{
|
|
||||||
var card = actor.Get_CardSkillData_orNull(eCardType.G1_FountainGivesXp);
|
|
||||||
if (card != null)
|
|
||||||
IngameUIManager.Ins.m_MoneyAnimation.Set(MyValue.ItemID_Exp, card.m_Data.Get_IntValue1(), Vector3.zero);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eSanctuaryType.Spring_Exp:
|
|
||||||
{
|
|
||||||
var card = actor.Get_CardSkillData_orNull(eCardType.G1_RecoverExpFraction);
|
|
||||||
if (card != null)
|
|
||||||
{
|
|
||||||
actor.Heal(eHealType.Normal, card.m_Data.Get_IntValue1());
|
|
||||||
actor.Set_StatusEffect(eStatusConditionsType.Heal_Hp_Add, 1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eSanctuaryType.Spring_Shield:
|
|
||||||
{
|
|
||||||
var card = actor.Get_CardSkillData_orNull(eCardType.G1_SpringShieldToHP);
|
|
||||||
if (card != null)
|
|
||||||
{
|
|
||||||
var heal = (int)(data * card.m_Data.Get_IntValue1());
|
|
||||||
actor.Heal(eHealType.Normal, heal);
|
|
||||||
actor.Set_StatusEffect(eStatusConditionsType.Heal_Hp_Add, 1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
StartCoroutine(Co_CheckNext());
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_CheckNext()
|
|
||||||
{
|
|
||||||
var card = InGameInfo.Ins.m_PCActor.Get_CardSkillData_orNull(eCardType.G1_NextSpringActsAsCamp);
|
|
||||||
if (card != null)
|
|
||||||
{
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
go_effect.SetActive(false);
|
|
||||||
GetComponent<Animation>().Play("Campfire_On");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
End_Node(1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 53647d2b1473ff449baf6c27c6d5b5fd
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeUI_MobBoss : StageNodeBase
|
|
||||||
{
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
MonsterNodeControler.Ins.Set(End_Node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 85132135805d3e745ac4cf600a9f5173
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class StageNodeUI_NPC : StageNodeBase
|
|
||||||
{
|
|
||||||
public GameObject go_meet, go_gift;
|
|
||||||
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
Show_Meet();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Show_Meet()
|
|
||||||
{
|
|
||||||
go_meet.SetActive(true);
|
|
||||||
go_gift.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_ShowGift()
|
|
||||||
{
|
|
||||||
go_meet.SetActive(false);
|
|
||||||
go_gift.SetActive(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_Gift()
|
|
||||||
{
|
|
||||||
go_gift.SetActive(false);
|
|
||||||
Popup.Ins.Set("선물을 줬다.", () => { }, () => { });
|
|
||||||
End_Node(2f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: d5f8fdd03a31b5e488a21e200e1b0393
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
public class StageNodeUI_Nothing : StageNodeBase
|
|
||||||
{
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
//var data = MyValue.m_MyStageData.Get_CurNodeData().Get_Data<StageNodeData_Nothing>();
|
|
||||||
//End_Node(data.Time);
|
|
||||||
End_Node();
|
|
||||||
IngameUIManager.Ins.Go_Explore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 126e409b915dd2148ab2de03df9594f9
|
|
||||||
|
|
@ -1,146 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using System.Collections;
|
|
||||||
using TMPro;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.UI;
|
|
||||||
|
|
||||||
public class StageNodeUI_Treasure : StageNodeBase
|
|
||||||
{
|
|
||||||
public GameObject[] gos; // 0 일반 상자, 1 잠긴 상자
|
|
||||||
public GameObject[] gos_key; // 0 열쇠 사용 버튼, 1 광고 버튼
|
|
||||||
public Image i_ribbon, i_box, i_shadow;
|
|
||||||
public TextMeshProUGUI[] texts; // 0 강제 개방 확률, 1 열쇠, 2 현재 상황
|
|
||||||
|
|
||||||
StageNodeData_Treasure m_Data;
|
|
||||||
TreasureBoxConfigTableData m_Tdata;
|
|
||||||
ObscuredInt _BagID; int m_BagID { get { return _BagID; } set { _BagID = value; _BagID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _Status; int m_Status { get { return _Status; } set { _Status = value; _Status.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
protected override void Set_Node()
|
|
||||||
{
|
|
||||||
base.Set_Node();
|
|
||||||
m_Data = MyValue.m_MyStageData.Get_CurNodeData().Get_Data<StageNodeData_Treasure>();
|
|
||||||
m_Tdata = table_TreasureBoxConfig.Ins.Get_Data(m_Data.BoxID);
|
|
||||||
m_BagID = 0;
|
|
||||||
|
|
||||||
i_ribbon.sprite = UIAtlasMgr.Ins.Get_Sprite("ribbon_04");
|
|
||||||
|
|
||||||
texts[0].text = "확률 50%";
|
|
||||||
texts[1].text = $"1/{0}";
|
|
||||||
texts[2].text = table_localtext.Ins.Get_Text(1105);
|
|
||||||
|
|
||||||
i_shadow.enabled = i_box.enabled = true;
|
|
||||||
if (DSUtil.RandomTrue(m_Tdata.f_LockRate))
|
|
||||||
{ // 잠김
|
|
||||||
DSUtil.InActivateGameObjects(gos, 1);
|
|
||||||
i_box.sprite = UIAtlasMgr.Ins.Get_Sprite("treasure_lock");
|
|
||||||
DSUtil.InActivateGameObjects(gos_key, 1); // 정인호 : 열쇠가 없어서 무조건 광고 버튼
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // 안 잠김
|
|
||||||
DSUtil.InActivateGameObjects(gos, 0);
|
|
||||||
i_box.sprite = UIAtlasMgr.Ins.Get_Sprite("treasure_nolock");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClick_Button(GameObject go)
|
|
||||||
{
|
|
||||||
DSUtil.InActivateGameObjects(gos);
|
|
||||||
|
|
||||||
switch (go.name)
|
|
||||||
{
|
|
||||||
case "btn_ignore": End_Node(); break;
|
|
||||||
case "btn_open": Open(0); break;
|
|
||||||
case "btn_forceopen": Open(DSUtil.RandomTrue(0.5f) ? 1 : 2); break;
|
|
||||||
case "btn_usekey":break;
|
|
||||||
case "btn_ad":
|
|
||||||
ADInfo.Ins.Show_AD(() => { Open(3); });
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 0 일반 오픈, 1 강제 개방 성공, 2 강제 개방 실패, 3 열쇠나 광고 오픈
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="status"></param>
|
|
||||||
void Open(int status)
|
|
||||||
{
|
|
||||||
m_Status = status;
|
|
||||||
|
|
||||||
if (status != 3 && DSUtil.RandomTrue(m_Data.MimicRate))
|
|
||||||
{ // 미믹 등장
|
|
||||||
m_BagID = m_Tdata.n_TreasureRewardID;
|
|
||||||
StartCoroutine(Co_MeetMimic());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // 성공 확률로 보상 지급
|
|
||||||
m_BagID = status == 2 ? m_Tdata.n_DestroyRewardID : m_Tdata.n_TreasureRewardID;
|
|
||||||
End_Node();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_MeetMimic()
|
|
||||||
{
|
|
||||||
bool PreemptiveStrike = false;
|
|
||||||
float StunTime = 0f;
|
|
||||||
if (m_Status == 1)
|
|
||||||
{ // 미믹 선제공격하지 않고, 3초간 스턴
|
|
||||||
StunTime = 3f;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // 미믹 선제공격
|
|
||||||
PreemptiveStrike = true;
|
|
||||||
}
|
|
||||||
Set_Mob(m_Tdata.n_BattleMonsterID, PreemptiveStrike, StunTime);
|
|
||||||
texts[2].text = table_localtext.Ins.Get_Text(1106);
|
|
||||||
i_ribbon.sprite = UIAtlasMgr.Ins.Get_Sprite("ribbon_01");
|
|
||||||
i_shadow.enabled = i_box.enabled = false;
|
|
||||||
|
|
||||||
m_Status = -1;
|
|
||||||
yield return new WaitForSeconds(3f);
|
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetReward()
|
|
||||||
{
|
|
||||||
if (m_BagID > 0)
|
|
||||||
{
|
|
||||||
var bagReward = table_RewardRandomBag.Ins.Get_Reward(m_BagID);
|
|
||||||
GetItemUI.Ins.Set(bagReward);
|
|
||||||
InGameInfo.Ins.Add_Goods(bagReward.itemid, (int)bagReward.amount);
|
|
||||||
|
|
||||||
var pc = InGameInfo.Ins.m_PCActor;
|
|
||||||
var G1_LootChestGivesHealAndXp = pc.Get_CardSkillData_orNull(eCardType.G1_LootChestGivesHealAndXp);
|
|
||||||
if (G1_LootChestGivesHealAndXp != null)
|
|
||||||
{
|
|
||||||
pc.Heal(eHealType.Normal, G1_LootChestGivesHealAndXp.m_Data.Get_IntValue1());
|
|
||||||
IngameUIManager.Ins.m_MoneyAnimation.Set(MyValue.ItemID_Exp,
|
|
||||||
G1_LootChestGivesHealAndXp.m_Data.Get_IntValue2(), Vector3.zero);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void End_Node()
|
|
||||||
{
|
|
||||||
if (m_Status == -1)
|
|
||||||
{ // 미믹과 전투 후
|
|
||||||
base.End_Node();
|
|
||||||
GetReward();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_BagID > 0)
|
|
||||||
StartCoroutine(Co_BoxOpen());
|
|
||||||
else
|
|
||||||
base.End_Node();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Co_BoxOpen()
|
|
||||||
{
|
|
||||||
i_box.sprite = UIAtlasMgr.Ins.Get_Sprite("treasure_open");
|
|
||||||
yield return new WaitForSeconds(1f);
|
|
||||||
GetReward();
|
|
||||||
base.End_Node();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: a698a9e382cd64b4db908200920df5af
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
public class StageNodeUI_TwoWay : StageNodeBase
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: aea7ec19de2a6eb439c021338c4024ac
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ActorInfo : MonoBehaviour
|
|
||||||
{
|
|
||||||
//[RuntimeInitializeOnLoadMethod]
|
|
||||||
//static void OnRuntimeMethodLoad() { new GameObject("ActorInfo").AddComponent<ActorInfo>(); }
|
|
||||||
public static ActorInfo Ins;
|
|
||||||
private void Awake() { Ins = this; DontDestroyOnLoad(gameObject); }
|
|
||||||
|
|
||||||
private ObjectPool<List<Actor>> listPool = new ObjectPool<List<Actor>>();
|
|
||||||
/// <summary>
|
|
||||||
/// 타입, <노드, 액터들>
|
|
||||||
/// </summary>
|
|
||||||
Dictionary<eRole, Dictionary<int, List<Actor>>> dic_actor = new Dictionary<eRole, Dictionary<int, List<Actor>>>();
|
|
||||||
|
|
||||||
|
|
||||||
public void Destroy_Mob()
|
|
||||||
{
|
|
||||||
foreach (var role in dic_actor)
|
|
||||||
{
|
|
||||||
if (role.Key == eRole.Mob)
|
|
||||||
{
|
|
||||||
foreach (var actor in role.Value)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < actor.Value.Count; i++)
|
|
||||||
{
|
|
||||||
Destroy(actor.Value[i].gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
role.Value.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Add_Actor(Actor actor, eRole role, int node = 0)
|
|
||||||
{ // 생성한 액터 추가
|
|
||||||
if (!dic_actor[role].ContainsKey(node))
|
|
||||||
dic_actor[role].Add(node, new List<Actor>());
|
|
||||||
dic_actor[role][node].Add(actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Release_Actors(List<Actor> actors)
|
|
||||||
{
|
|
||||||
actors.Clear();
|
|
||||||
listPool.Release(actors);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3ca848bc41898d64b94d070ef02d9f62
|
|
||||||
|
|
@ -1,438 +0,0 @@
|
||||||
using CodeStage.AntiCheat.Detectors;
|
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
|
||||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
|
||||||
using Random = UnityEngine.Random;
|
|
||||||
|
|
||||||
public partial class InGameInfo : MyCoroutine
|
|
||||||
{
|
|
||||||
public static InGameInfo Ins;
|
|
||||||
public TextAsset ta_StageData;
|
|
||||||
public Material mat_Dissolve;
|
|
||||||
public BackGroundSetting m_BackGroundSetting;
|
|
||||||
public Transform[] tfs_ProjectileStart; // 0 왼쪽, 1 중앙, 2 오른쪽, 3 몹 중앙
|
|
||||||
public PCActor m_PCActor { get { return IngameUIManager.Ins.m_PCActor; } }
|
|
||||||
|
|
||||||
ToolData m_ToolData;
|
|
||||||
|
|
||||||
|
|
||||||
private void Awake() { Ins = this; }
|
|
||||||
|
|
||||||
void Set_Init()
|
|
||||||
{
|
|
||||||
AddrResourceMgr.Ins.LoadObject<GameObject>("MainUI/GameUI.prefab", handle =>
|
|
||||||
{
|
|
||||||
if (handle.IsDone && handle.Status == AsyncOperationStatus.Succeeded)
|
|
||||||
{
|
|
||||||
DSUtil.Get_Clone(handle.Result);
|
|
||||||
//InappInfo.Ins.Check_Retrieved();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
IEnumerator Start()
|
|
||||||
{
|
|
||||||
m_ToolData = JsonConvert.DeserializeObject<ToolData>(ta_StageData.text);
|
|
||||||
|
|
||||||
DataCheckMgr.Ins.Set();
|
|
||||||
Set_Init();
|
|
||||||
|
|
||||||
while (!TableChecker.Ins.CheckAllLoad()) yield return new WaitForSeconds(0.1f);
|
|
||||||
|
|
||||||
//var lst = table_effectlist.Ins.Get_DataList(1);
|
|
||||||
//for (int i = 0; i < lst.Count; i++)
|
|
||||||
//{
|
|
||||||
// dic_str_Effect.Add(lst[i].s_EffectPrefab, new List<GameObject>());
|
|
||||||
// for (int j = 0; j < lst[i].n_PreLoadCount; j++)
|
|
||||||
// Load_Effect(lst[i].s_EffectPrefab, effect => { effect.transform.position = Vector3.one * 100000f; });
|
|
||||||
//}
|
|
||||||
|
|
||||||
ObscuredCheatingDetector.StartDetection(OnCheaterDetected);
|
|
||||||
SpeedHackDetector.StartDetection(OnCheaterDetected);
|
|
||||||
|
|
||||||
//while (DSUtil.CheckNull(NewGameUI.Ins)) yield return null;
|
|
||||||
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType != eStageEnterType.Normal)
|
|
||||||
{
|
|
||||||
while (!LobbyUIManager.Ins) yield return null;
|
|
||||||
Start_Game_byTool();
|
|
||||||
}
|
|
||||||
|
|
||||||
while (!IngameUIManager.Ins) yield return null;
|
|
||||||
|
|
||||||
dic_EnemyActor.Add(eRole.Mob, new List<Actor> { m_PCActor });
|
|
||||||
dic_EnemyActor.Add(eRole.PC, MonsterNodeControler.Ins.Get_AllActor().ToList());
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnCheaterDetected()
|
|
||||||
{
|
|
||||||
Time.timeScale = 0f;
|
|
||||||
Popup.Ins.Set(ePopupType.One, -99, DSUtil.Quit, DSUtil.Quit);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set_TimeScale(float _scale, float _delay) { Set_Coroutine(() => { Time.timeScale = _scale; }, _delay); }
|
|
||||||
|
|
||||||
#region 탐험
|
|
||||||
public void Return_To_Lobby()
|
|
||||||
{
|
|
||||||
IngameUIManager.Ins.Return_To_Lobby();
|
|
||||||
switch (MyValue.m_MyStageData.m_EnterType)
|
|
||||||
{
|
|
||||||
case eStageEnterType.Normal:
|
|
||||||
LobbyUIManager.Ins.Set();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MonsterNodeControler.Ins) MonsterNodeControler.Ins.AllOff(); // 몬스터 끄기
|
|
||||||
EffectMgr.Ins.AllOff(); // 이펙트 끄기
|
|
||||||
ProjectileMgr.Ins.AllOff(); // 투사체 끄기
|
|
||||||
}
|
|
||||||
public void Start_Game()
|
|
||||||
{
|
|
||||||
Start_Game_Common();
|
|
||||||
}
|
|
||||||
public void Start_Game_byTool()
|
|
||||||
{
|
|
||||||
LobbyUIManager.Ins.gameObject.SetActive(false);
|
|
||||||
IngameUIManager.Ins.gameObject.SetActive(true);
|
|
||||||
Start_Game_Common();
|
|
||||||
}
|
|
||||||
void Start_Game_Common()
|
|
||||||
{
|
|
||||||
var pcid = MyValue.sdata.PCID;
|
|
||||||
switch (MyValue.m_MyStageData.m_EnterType)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
Set_StageData(MyValue.m_MyStageData.m_Chapter, MyValue.m_MyStageData.m_Stage);
|
|
||||||
break;
|
|
||||||
case eStageEnterType.Tool_Mob:
|
|
||||||
Set_StageData(1, 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
m_BackGroundSetting.Set();
|
|
||||||
IngameUIManager.Ins.Active_ExporeButton();
|
|
||||||
Init_CardData(); // Actor Set_Equipment() 전 호출해야 됨
|
|
||||||
m_PCActor.Set(0, table_pclist.Ins.Get_Data_orNull(pcid), IngameUIManager.Ins.PC_HUD_HPShield, MyValue.sdata);
|
|
||||||
|
|
||||||
Init_IngameDatas();
|
|
||||||
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool_Mob)
|
|
||||||
IngameUIManager.Ins.Skip_Expore();
|
|
||||||
}
|
|
||||||
public void Init_IngameDatas()
|
|
||||||
{ // 탐험 입장 시 1번 호출
|
|
||||||
PCLv = 1;
|
|
||||||
dic_goodsAmount.Clear();
|
|
||||||
|
|
||||||
Set_Texts();
|
|
||||||
Set_PCLvInfo();
|
|
||||||
IngameUIManager.Ins.m_PCMainStatUI.Set(m_PCActor.Get_ActorStatInfo());
|
|
||||||
IngameUIManager.Ins.m_GainCardList.Set(list_GainCard); // Actor Set_Equipment() 후 호출됨
|
|
||||||
DefeatUI.Ins.Init();
|
|
||||||
IngameUIManager.Ins.m_DungeonInfo.Set();
|
|
||||||
|
|
||||||
m_PCActor.Init_IngameDatas();
|
|
||||||
if (MonsterNodeControler.Ins) MonsterNodeControler.Ins.Init_IngameDatas();
|
|
||||||
}
|
|
||||||
void Init_CardData()
|
|
||||||
{
|
|
||||||
m_lvupcardcount = 0;
|
|
||||||
list_GainCard.Clear();
|
|
||||||
}
|
|
||||||
void Set_StageData(int chapter, int stage)
|
|
||||||
{
|
|
||||||
IngameStageData data = null;
|
|
||||||
switch (MyValue.m_MyStageData.m_EnterType)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
data = m_ToolData.Get_IngameStageData(chapter, stage);
|
|
||||||
data.Init();
|
|
||||||
if (data == null)
|
|
||||||
{
|
|
||||||
Popup.Ins.Set($"{stage} 스테이지 데이터가 없습니다.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
MyValue.m_MyStageData.m_StageData = data;
|
|
||||||
IngameUIManager.Ins.m_DungeonInfo.m_DungeonProcess.Set_ExtraMark();
|
|
||||||
}
|
|
||||||
public void Add_BattlePatternData(int patternid, BattlePatternData bpdata)
|
|
||||||
{
|
|
||||||
var data = m_ToolData.MonsterPattern.Find(f => f.m_PatternID == patternid);
|
|
||||||
if (data != null) m_ToolData.MonsterPattern.Remove(data);
|
|
||||||
m_ToolData.MonsterPattern.Add(bpdata);
|
|
||||||
}
|
|
||||||
public BattlePatternData Get_BattlePatternData(int patternid)
|
|
||||||
{
|
|
||||||
var rtndata = m_ToolData.MonsterPattern.Find(f => f.m_PatternID == patternid);
|
|
||||||
return rtndata;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region 몬스터 조우
|
|
||||||
ObscuredInt _pclv; public int PCLv { get { return _pclv; } set { _pclv = value; _pclv.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _lvupcardcount; public int m_lvupcardcount { get { return _lvupcardcount; } set { _lvupcardcount = value; _lvupcardcount.RandomizeCryptoKey(); } }
|
|
||||||
Dictionary<int, ObscuredInt> dic_goodsAmount = new Dictionary<int, ObscuredInt>();
|
|
||||||
List<CardListTableData> list_GainCard = new List<CardListTableData>();
|
|
||||||
public List<CardListTableData> Get_ListGainCard() { return list_GainCard; }
|
|
||||||
Dictionary<eRole, List<Actor>> dic_EnemyActor = new Dictionary<eRole, List<Actor>>();
|
|
||||||
public void Init_EveryMeetMonster()
|
|
||||||
{ // 몬스터 만났을 때마다 한 번 실행되는 함수
|
|
||||||
m_PCActor.Init_EveryMeetMonster();
|
|
||||||
if (MonsterNodeControler.Ins) MonsterNodeControler.Ins.Init_EveryMeetMonster();
|
|
||||||
|
|
||||||
m_PCActor.OnEvent_RunSkillCard();
|
|
||||||
}
|
|
||||||
public void BattleStart_AfterMakeMob()
|
|
||||||
{ // 몬스터, 보스 노드 만날 시 최초 한 번 실행
|
|
||||||
OnEvent_MakeMob();
|
|
||||||
Set_Battle(true);
|
|
||||||
Init_EveryMeetMonster();
|
|
||||||
MonsterNodeControler.Ins.Check_LineAllDead();
|
|
||||||
OnEvent_AfterLineChange();
|
|
||||||
}
|
|
||||||
public void Set_Texts()
|
|
||||||
{
|
|
||||||
IngameUIManager.Ins.Set_Texts(Get_GoodsAmount(MyValue.ItemID_Gold), Get_GoodsAmount(MyValue.ItemID_Soul),
|
|
||||||
(int)m_PCActor.Get_ActorStatInfo().Get_TotalStat(eStat.Potion));
|
|
||||||
}
|
|
||||||
public void Set_PCLvInfo(Action<bool> actgageend = null)
|
|
||||||
{
|
|
||||||
IngameUIManager.Ins.m_PCMainStatUI.Set_Lv(PCLv, Get_GoodsAmount(MyValue.ItemID_Exp), actgageend);
|
|
||||||
}
|
|
||||||
public void Set_Battle(bool battle)
|
|
||||||
{
|
|
||||||
m_PCActor.Set_Battle(battle);
|
|
||||||
if (MonsterNodeControler.Ins) MonsterNodeControler.Ins.Set_Battle(battle);
|
|
||||||
}
|
|
||||||
public int Get_GoodsAmount(int itemid) { return dic_goodsAmount.ContainsKey(itemid) ? dic_goodsAmount[itemid] : 0; }
|
|
||||||
public void Add_Goods(int itemid, int v)
|
|
||||||
{
|
|
||||||
if (!dic_goodsAmount.ContainsKey(itemid))
|
|
||||||
dic_goodsAmount.Add(itemid, 0);
|
|
||||||
dic_goodsAmount[itemid] += v;
|
|
||||||
dic_goodsAmount[itemid].RandomizeCryptoKey();
|
|
||||||
|
|
||||||
Set_Texts();
|
|
||||||
|
|
||||||
if (itemid == MyValue.ItemID_Exp)
|
|
||||||
Set_PCLvInfo(Check_PCLvUp);
|
|
||||||
}
|
|
||||||
void Check_PCLvUp(bool isLvUp)
|
|
||||||
{
|
|
||||||
if (isLvUp)
|
|
||||||
{
|
|
||||||
SelectCardUI.Ins.Set(true);
|
|
||||||
++PCLv;
|
|
||||||
m_PCActor.OnEvent_LvUp();
|
|
||||||
Set_PCLvInfo(Check_PCLvUp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Add_Potion(int amount, int maxpotion = 0)
|
|
||||||
{
|
|
||||||
if (maxpotion > 0) m_PCActor.Get_ActorStatInfo().Set_Stat(true, eStat.MaxPotion, maxpotion);
|
|
||||||
m_PCActor.Get_ActorStatInfo().Set_Stat(true, eStat.Potion, amount);
|
|
||||||
Set_Texts();
|
|
||||||
}
|
|
||||||
public void Use_Potion()
|
|
||||||
{
|
|
||||||
var potion = 10; // 테스트 : 물약 회복량
|
|
||||||
m_PCActor.Use_Potion(false, potion);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PCLvUp_Imm()
|
|
||||||
{
|
|
||||||
var expdata = table_BattleLevelUp.Ins.Get_Data_orNull(PCLv);
|
|
||||||
if (expdata != null)
|
|
||||||
{
|
|
||||||
var remainExp = expdata.n_TotalExp - Get_GoodsAmount(MyValue.ItemID_Exp);
|
|
||||||
Add_Goods(MyValue.ItemID_Exp, remainExp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Heal_PC(eHealType healType, int heal)
|
|
||||||
{
|
|
||||||
m_PCActor.Heal(healType, heal);
|
|
||||||
m_PCActor.Set_StatusEffect(eStatusConditionsType.Heal_Hp_Add, 1f);
|
|
||||||
}
|
|
||||||
public void Add_Card(CardListTableData card, bool islvupcard)
|
|
||||||
{
|
|
||||||
if (islvupcard) ++m_lvupcardcount;
|
|
||||||
list_GainCard.Add(card);
|
|
||||||
IngameUIManager.Ins.m_GainCardList.Set(list_GainCard);
|
|
||||||
if (ServerInfo.Ins.m_ServerData != null) ServerInfo.Ins.m_ServerData.Add_Card(card.n_ID);
|
|
||||||
m_PCActor.Add_CardSkill(card);
|
|
||||||
|
|
||||||
Set_Texts();
|
|
||||||
IngameUIManager.Ins.m_PCMainStatUI.Set(m_PCActor.Get_ActorStatInfo());
|
|
||||||
}
|
|
||||||
public void Add_Card_Random(eGrade grade) { m_PCActor.Add_Card_Random(grade); }
|
|
||||||
|
|
||||||
public void Revive_PC() { m_PCActor.Revive_byDefeatUI(); }
|
|
||||||
|
|
||||||
public void OnEvent_MakeMob()
|
|
||||||
{
|
|
||||||
for (int i = 0; i < list_GainCard.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = list_GainCard[i];
|
|
||||||
switch (temp.e_CardType)
|
|
||||||
{
|
|
||||||
case eCardType.G3_DodgeFirstRangedAttack:
|
|
||||||
MonsterNodeControler.Ins.OnEvent_CheckCard(temp);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void OnEvent_Mob_ShootProjectile(MobActor mob)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < list_GainCard.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = list_GainCard[i];
|
|
||||||
switch (temp.e_CardType)
|
|
||||||
{
|
|
||||||
case eCardType.G4_RangedAttackFrontEnemyDamageShare:
|
|
||||||
if (mob.IsMiddleLine() && mob.Get_AttackType() == eAttackType.Range)
|
|
||||||
{
|
|
||||||
var frontmob = Get_Enemy_orNull(eRole.PC, mob.Get_MobIndex() - 3);
|
|
||||||
if (frontmob != null && !frontmob.IsDead())
|
|
||||||
{
|
|
||||||
var dmg = (int)(mob.Get_ActorStatInfo().Get_Damage() * temp.Get_FloatValue2());
|
|
||||||
mob.Shoot_Projectile_FixedDmg(temp.e_CardType, temp.s_Projectile, dmg, frontmob);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case eCardType.G1_RangedFirstAttackHitFrontAlly:
|
|
||||||
if (mob.IsMiddleLine() && mob.Get_AttackType() == eAttackType.Range && mob.Get_AttackCount() == 1)
|
|
||||||
{
|
|
||||||
var carddata = m_PCActor.Get_CardSkillData_orNull(temp.e_CardType);
|
|
||||||
if (carddata != null)
|
|
||||||
{
|
|
||||||
var frontmob = Get_Enemy_orNull(eRole.PC, mob.Get_MobIndex() - 3);
|
|
||||||
if (frontmob != null && !frontmob.IsDead())
|
|
||||||
frontmob.Get_Dmg((int)(mob.Get_ActorStatInfo().Get_Damage() * temp.Get_FloatValue2()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void OnEvent_MeetNode(eStageNodeType nodeType)
|
|
||||||
{
|
|
||||||
m_PCActor.OnEvent_MeetNode(nodeType);
|
|
||||||
}
|
|
||||||
public void OnEvent_AfterLineChange()
|
|
||||||
{
|
|
||||||
if (MyValue.m_MyStageData.m_EnterType == eStageEnterType.Tool_Mob) return;
|
|
||||||
|
|
||||||
m_PCActor.OnEvent_AfterLineChange();
|
|
||||||
Get_AllEnemies(eRole.PC).ForEach(f => f.OnEvent_AfterLineChange());
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 타겟 찾기
|
|
||||||
public List<Actor> Get_AllEnemies(eRole role) { return dic_EnemyActor[role]; }
|
|
||||||
public List<Actor> Get_RandomAliveEnemies(eRole role, int count)
|
|
||||||
{
|
|
||||||
if (!dic_EnemyActor.TryGetValue(role, out var enemies))
|
|
||||||
return new List<Actor>();
|
|
||||||
|
|
||||||
// 살아있는 적만 필터
|
|
||||||
var aliveList = enemies.Where(e => e != null && !e.IsDead()).ToList();
|
|
||||||
|
|
||||||
if (aliveList.Count <= count)
|
|
||||||
return aliveList;
|
|
||||||
|
|
||||||
// Fisher–Yates Shuffle (부분 셔플)
|
|
||||||
for (int i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
int rand = Random.Range(i, aliveList.Count);
|
|
||||||
(aliveList[i], aliveList[rand]) = (aliveList[rand], aliveList[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return aliveList.GetRange(0, count);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Actor> Get_LineMobs(params eMobBattlePos[] pos)
|
|
||||||
{
|
|
||||||
var enemies = Get_AllEnemies(eRole.PC);
|
|
||||||
return enemies.FindAll(f => !f.IsDead() && pos.Contains(f.Get_Line()));
|
|
||||||
}
|
|
||||||
public List<Actor> Get_Ally(eRole role)
|
|
||||||
{
|
|
||||||
var actors = dic_EnemyActor[role == eRole.PC ? eRole.Mob : eRole.PC];
|
|
||||||
return actors.FindAll(f => !f.IsDead());
|
|
||||||
}
|
|
||||||
public Actor Get_Enemy_orNull(eRole role, bool cantsettarget = false)
|
|
||||||
{
|
|
||||||
if (role == eRole.PC)
|
|
||||||
{ // PC가 몬스터 선택 (정인호 : 옵션 연계 필요)
|
|
||||||
if (cantsettarget)
|
|
||||||
{
|
|
||||||
var mobs = Get_LineMobs(eMobBattlePos.Frontline, eMobBattlePos.Middleline);
|
|
||||||
var aliveMobs = mobs.FindAll(m => !m.IsDead());
|
|
||||||
return aliveMobs.Count == 0 ? null : aliveMobs[Random.Range(0, aliveMobs.Count)];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var mobs = Get_LineMobs(eMobBattlePos.Frontline);
|
|
||||||
var aliveMobs = mobs.FindAll(m => !m.IsDead());
|
|
||||||
return aliveMobs.Count == 0 ? null : aliveMobs[Random.Range(0, aliveMobs.Count)];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return m_PCActor;
|
|
||||||
}
|
|
||||||
public Actor Get_Enemy_orNull(eRole role, int index)
|
|
||||||
{
|
|
||||||
var all = Get_AllEnemies(role);
|
|
||||||
return all.Find(f => f.Get_MobIndex() == index);
|
|
||||||
}
|
|
||||||
public Actor[] Get_Mobs_4Nearby(int mobIndex)
|
|
||||||
{
|
|
||||||
// 기본 패턴: 상하좌우
|
|
||||||
int[] offsets = { -1, 1, -3, 3 };
|
|
||||||
|
|
||||||
// 특수 처리: 위치별로 제외 인덱스 조정
|
|
||||||
List<int> targetIndices = new List<int> { mobIndex };
|
|
||||||
foreach (int offset in offsets)
|
|
||||||
{
|
|
||||||
int idx = mobIndex + offset;
|
|
||||||
|
|
||||||
// 좌우 경계 처리 (열 구분)
|
|
||||||
int col = mobIndex % 3;
|
|
||||||
if ((col == 0 && offset == -1) || (col == 2 && offset == 1))
|
|
||||||
continue; // 왼쪽 끝에서 왼쪽으로 가거나, 오른쪽 끝에서 오른쪽으로 가는 경우 제외
|
|
||||||
|
|
||||||
// 범위 제한
|
|
||||||
if (idx < 0 || idx > 8)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
targetIndices.Add(idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 대상들 가져오기 (null은 제외)
|
|
||||||
var mobs = targetIndices.Select(i => Get_Enemy_orNull(eRole.PC, i)).Where(t => t != null && !t.IsDead()).ToArray();
|
|
||||||
return mobs;
|
|
||||||
}
|
|
||||||
public Actor Get_RandomEnemy_orNull(eRole role)
|
|
||||||
{
|
|
||||||
var enemies = Get_AllEnemies(role);
|
|
||||||
enemies = enemies.FindAll(f => !f.IsDead());
|
|
||||||
if (enemies.Count > 0)
|
|
||||||
return enemies[Random.Range(0, enemies.Count)];
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
public List<Actor> Get_Enemies_byAttackType(eRole role, eAttackType attackType)
|
|
||||||
{
|
|
||||||
var enemies = Get_AllEnemies(role);
|
|
||||||
return enemies.FindAll(f => !f.IsDead() && f.Get_AttackType() == attackType);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3730eb11af01f7f4488d36b41a4551e8
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class OptionInfo : MonoBehaviourSingletonTemplateBackKeyAdd<OptionInfo>
|
||||||
Set_UI();
|
Set_UI();
|
||||||
//label_id.text = ServerInfo.Ins.m_LoginInfo.PlayFabId;
|
//label_id.text = ServerInfo.Ins.m_LoginInfo.PlayFabId;
|
||||||
|
|
||||||
switch (ObscuredPrefs.GetInt(MyValue.OptionKey_UserType))
|
switch (ObscuredPrefs.GetInt("LoginType"))
|
||||||
{
|
{
|
||||||
case 1: // 애플
|
case 1: // 애플
|
||||||
sprite_loginicon.sprite = UIAtlasMgr.Ins.Get_Sprite("option_apple"); break;
|
sprite_loginicon.sprite = UIAtlasMgr.Ins.Get_Sprite("option_apple"); break;
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,5 @@ public class Title_Mgr : MonoBehaviourSingletonTemplate<Title_Mgr>
|
||||||
DontDestroyOnLoad(overui);
|
DontDestroyOnLoad(overui);
|
||||||
});
|
});
|
||||||
addslidevalue?.Invoke(0.1f);
|
addslidevalue?.Invoke(0.1f);
|
||||||
|
|
||||||
// 정인호 : 투사체, 이펙트 로딩이 느려 일단은 백그라운드에서 돌게
|
|
||||||
//yield return StartCoroutine(ProjectileMgr.Ins.Co_Load());
|
|
||||||
//yield return StartCoroutine(EffectMgr.Ins.Co_Load());
|
|
||||||
StartCoroutine(ProjectileMgr.Ins.Co_Load(addslidevalue));
|
|
||||||
StartCoroutine(EffectMgr.Ins.Co_Load(addslidevalue));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -161,542 +161,6 @@ public class StatTableDataBase : TableDataBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CardSkillData
|
|
||||||
{
|
|
||||||
public CardListTableData m_Data;
|
|
||||||
Actor m_Actor;
|
|
||||||
ObscuredBool _StartBattle; public bool StartBattle { get { return _StartBattle; } set { _StartBattle = value; _StartBattle.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UseCount; public int UseCount { get { return _UseCount; } set { _UseCount = value; _UseCount.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UseCount_Acc; public int UseCount_Acc { get { return _UseCount_Acc; } set { _UseCount_Acc = value; _UseCount_Acc.RandomizeCryptoKey(); } }
|
|
||||||
public float m_LifeTime = 0f;
|
|
||||||
public List<int> list_identity = new List<int>();
|
|
||||||
|
|
||||||
public void Add(Actor actor, CardListTableData data)
|
|
||||||
{
|
|
||||||
m_Actor = actor;
|
|
||||||
m_Data = data;
|
|
||||||
|
|
||||||
StartBattle = false;
|
|
||||||
UseCount_Acc = UseCount = 0;
|
|
||||||
m_LifeTime = 0f;
|
|
||||||
|
|
||||||
switch (data.e_CardType)
|
|
||||||
{
|
|
||||||
case eCardType.G1_AddPotion: InGameInfo.Ins.Add_Potion(m_Data.Get_IntValue2(), m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G1_MagicMissile: m_LifeTime = m_Data.Get_FloatValue3(); break;
|
|
||||||
case eCardType.G3_HealHalfHPAndRefillPotions:
|
|
||||||
actor.Heal(eHealType.Normal, m_Data.Get_FloatValue2());
|
|
||||||
actor.Refill_AllPotions();
|
|
||||||
InGameInfo.Ins.Set_Texts();
|
|
||||||
break;
|
|
||||||
|
|
||||||
// 버프
|
|
||||||
case eCardType.G1_AddMaxAttack: actor.Set_Buff(true, eStat.Attack_Max, m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G1_AddMinAttack: actor.Set_Buff(true, eStat.Attack_Min, m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G1_AddHitRate: actor.Set_Buff(true, eStat.HitRate, m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G1_AddCriDmg: actor.Set_Buff(true, eStat.CriDmg, m_Data.Get_FloatValue2()); break;
|
|
||||||
case eCardType.G1_DodgeNextNAttacks: actor.Set_Buff(true, eStat.AvoidAll_Count, m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G2_ReduceMeeleEnemyDamage: actor.Set_Buff(true, eStat.ReduceMeeleDmg, m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G2_ReduceRangeEnemyDamage: actor.Set_Buff(true, eStat.ReduceRangeDmg, m_Data.Get_IntValue1()); break;
|
|
||||||
case eCardType.G2_IncreaseDamageToBacklineEnemies: actor.Set_Buff(true, eStat.AddDmgMul_MiddleLine, m_Data.Get_FloatValue2()); break;
|
|
||||||
case eCardType.G3_IncreaseAttackSpeed:
|
|
||||||
{
|
|
||||||
var cooltime = actor.Get_ActorStatInfo().Get_Stat(eStat.AttackCoolTime); // 기본 공속
|
|
||||||
cooltime -= cooltime * m_Data.Get_FloatValue2();
|
|
||||||
actor.Get_ActorStatInfo().Set_Stat(eStat.AttackCoolTime, cooltime);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eCardType.G3_IncreaseMeleeDodge:
|
|
||||||
{
|
|
||||||
var avoid = actor.Get_ActorStatInfo().Get_Stat(eStat.Avoid_Melee); // 기본 회피(근)
|
|
||||||
avoid += avoid * m_Data.Get_FloatValue2();
|
|
||||||
actor.Get_ActorStatInfo().Set_Stat(eStat.Avoid_Melee, avoid);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eCardType.G4_MaxAttackIncreasesByShield: actor.OnEvent_MyShield_Hit(); break;
|
|
||||||
case eCardType.G4_MaxAttackUpAndHealOnKill: actor.Set_Buff(true, eStat.Attack_Max, m_Data.Get_IntValue1()); break;
|
|
||||||
|
|
||||||
// 디퍼프
|
|
||||||
case eCardType.G3_DodgeFirstRangedAttack:
|
|
||||||
InGameInfo.Ins.OnEvent_MakeMob();
|
|
||||||
break;
|
|
||||||
|
|
||||||
// 즉시 지급
|
|
||||||
case eCardType.G3_GetInstantGold:
|
|
||||||
InGameInfo.Ins.Add_Goods(MyValue.ItemID_Gold, Random.Range(m_Data.Get_IntValue1(), (int)m_Data.Get_FloatValue2()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Add_UseCountACC(int valueindex, Action act, int initvalue = 0)
|
|
||||||
{
|
|
||||||
++UseCount_Acc;
|
|
||||||
var compare = valueindex == 1 ? m_Data.Get_IntValue1() : valueindex == 2 ? m_Data.Get_IntValue2() : m_Data.Get_IntValue3();
|
|
||||||
if (UseCount_Acc >= compare)
|
|
||||||
{
|
|
||||||
UseCount_Acc = initvalue;
|
|
||||||
act?.Invoke();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Init_IngameDatas()
|
|
||||||
{
|
|
||||||
StartBattle = true;
|
|
||||||
}
|
|
||||||
public void Init_EveryMeetMonster()
|
|
||||||
{
|
|
||||||
UseCount = 0;
|
|
||||||
list_identity.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update()
|
|
||||||
{
|
|
||||||
if (m_LifeTime > 0f)
|
|
||||||
{
|
|
||||||
m_LifeTime -= Time.deltaTime;
|
|
||||||
if (m_LifeTime <= 0f)
|
|
||||||
{
|
|
||||||
m_LifeTime = m_Data.Get_FloatValue3();
|
|
||||||
if (m_Data.e_CardType == eCardType.G1_MagicMissile)
|
|
||||||
{
|
|
||||||
++UseCount;
|
|
||||||
m_Actor.Shoot_AddProjectiles(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ProjectileData
|
|
||||||
{
|
|
||||||
public string s_Projectile;
|
|
||||||
public eRole m_Role;
|
|
||||||
public eAttackType e_AttackType;
|
|
||||||
public eCardType e_CardType;
|
|
||||||
public Actor Hitter, Target;
|
|
||||||
public ActorStatInfo m_HitterStat;
|
|
||||||
public float m_Speed;
|
|
||||||
public bool isCri;
|
|
||||||
|
|
||||||
public void Set(string _Projectile, eRole _Role, eAttackType _AttackType, Actor hitter, ActorStatInfo _Stat,
|
|
||||||
eCardType cardtype = eCardType.Max)
|
|
||||||
{
|
|
||||||
s_Projectile = _Projectile;
|
|
||||||
m_Role = _Role;
|
|
||||||
e_AttackType = _AttackType;
|
|
||||||
Hitter = hitter;
|
|
||||||
m_HitterStat = _Stat;
|
|
||||||
e_CardType = cardtype;
|
|
||||||
}
|
|
||||||
public void Set(Actor target, float speed)
|
|
||||||
{
|
|
||||||
Target = target;
|
|
||||||
m_Speed = speed;
|
|
||||||
}
|
|
||||||
public void Copy(ProjectileData pd)
|
|
||||||
{
|
|
||||||
pd.s_Projectile = s_Projectile;
|
|
||||||
pd.m_Role = m_Role;
|
|
||||||
pd.Hitter = Hitter;
|
|
||||||
pd.Target = Target;
|
|
||||||
pd.m_Speed = m_Speed;
|
|
||||||
pd.m_HitterStat = m_HitterStat;
|
|
||||||
pd.e_AttackType = e_AttackType;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public partial class StatusEffectData
|
|
||||||
{
|
|
||||||
float LifeTime, DotTime, RepeatEffectDelayTime;
|
|
||||||
bool bDot;
|
|
||||||
double curValue;
|
|
||||||
StatusOptionSetActorData m_Data;
|
|
||||||
StatusConditionsListTableData m_sclData;
|
|
||||||
Actor m_Target;
|
|
||||||
|
|
||||||
EffectBase m_eff, m_eff_repeat;
|
|
||||||
|
|
||||||
public void Set(StatusOptionSetActorData data, Actor target = null)
|
|
||||||
{
|
|
||||||
bActiveSkill = bDot = false;
|
|
||||||
m_Data = data;
|
|
||||||
m_sclData = m_Data.m_sclData;
|
|
||||||
m_Target = target;
|
|
||||||
if (m_Target == null)
|
|
||||||
m_Target = m_Data.m_TData.Get_Target(data.m_Actor, m_Target, data.m_Actor.Get_Data().m_Role);
|
|
||||||
|
|
||||||
var sosdata = m_Data.m_TData;
|
|
||||||
switch (sosdata.e_ActiveConditions)
|
|
||||||
{ // 시간으로 제어하지 않는 조건들
|
|
||||||
case eActiveConditions.Appear:
|
|
||||||
LifeTime = 0f;
|
|
||||||
break;
|
|
||||||
case eActiveConditions.MaxHp_Up:
|
|
||||||
case eActiveConditions.MaxHp_Down:
|
|
||||||
case eActiveConditions.MaxHpRate:
|
|
||||||
case eActiveConditions.MaxShield_Up:
|
|
||||||
case eActiveConditions.MaxShield_Down:
|
|
||||||
case eActiveConditions.MaxShield_Rate:
|
|
||||||
LifeTime = 0f;
|
|
||||||
m_Target.Set_ActiveConditionData(m_Data.m_TData.e_ActiveConditions, this);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
bDot = sosdata.b_DotDmg;
|
|
||||||
var time = sosdata.Get_StatValue1();
|
|
||||||
var v = sosdata.Get_StatValue2();
|
|
||||||
|
|
||||||
if (LifeTime > 0)
|
|
||||||
{
|
|
||||||
if (v > curValue)
|
|
||||||
{
|
|
||||||
if (LifeTime < time) LifeTime = time;
|
|
||||||
curValue = v;
|
|
||||||
Set_BufforDebuff(v);
|
|
||||||
}
|
|
||||||
else if (Mathf.Approximately((float)curValue, (float)v))
|
|
||||||
{
|
|
||||||
if (LifeTime < time) LifeTime = time;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
curValue = v;
|
|
||||||
LifeTime = time;
|
|
||||||
DotTime = 0f;
|
|
||||||
Set_BufforDebuff(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (sosdata.e_StatusConditionsType)
|
|
||||||
{
|
|
||||||
case eStatusConditionsType.Invincibility_Count:
|
|
||||||
m_Target.Set_StatusEffectData(sosdata.e_StatusConditionsType, this);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Set_Common();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set_byCard(eStatusConditionsType scType, float time, Actor target)
|
|
||||||
{
|
|
||||||
m_sclData = table_StatusConditionsList.Ins.Get_Data_orNull(scType);
|
|
||||||
if (m_sclData == null) return;
|
|
||||||
m_Target = target;
|
|
||||||
if (LifeTime < time) LifeTime = time;
|
|
||||||
Set_Common();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set_Common()
|
|
||||||
{
|
|
||||||
if (!bDot)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(m_sclData.s_SkillEffect) && !m_sclData.s_SkillEffect.Equals("None"))
|
|
||||||
{
|
|
||||||
if (m_eff == null || LifeTime <= 0f)
|
|
||||||
m_eff = EffectMgr.Ins.Get_EffectBase(m_sclData.s_SkillEffect);
|
|
||||||
if (m_eff)
|
|
||||||
m_eff.Set(m_sclData.s_SkillEffect, m_sclData.e_EffectPivot, m_Target,
|
|
||||||
m_Target.Get_World_Position(m_sclData.e_EffectPivot), LifeTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(m_sclData.s_RepeatEffect) && !m_sclData.s_RepeatEffect.Equals("None"))
|
|
||||||
RepeatEffectDelayTime = Mathf.Max(Time.deltaTime, m_sclData.f_RepeatEffectStartDelay);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Set_BufforDebuff(double v)
|
|
||||||
{
|
|
||||||
if (m_Target == null)
|
|
||||||
{
|
|
||||||
Set_Off();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (m_Data.m_TData.e_BuffType)
|
|
||||||
{
|
|
||||||
case eBuffType.Buff:
|
|
||||||
m_Target.Set_Buff(m_Data.m_TData.e_Stat1, v);
|
|
||||||
break;
|
|
||||||
case eBuffType.Debuff:
|
|
||||||
m_Target.Set_DeBuff(m_Data.m_TData.e_Stat1, Math.Abs(v));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_Target.IsDead()) Set_Off();
|
|
||||||
}
|
|
||||||
void Set_BufforDebuff(bool off = false)
|
|
||||||
{
|
|
||||||
var sosdata = m_Data.m_TData;
|
|
||||||
|
|
||||||
switch (sosdata.e_BuffType)
|
|
||||||
{
|
|
||||||
case eBuffType.Buff:
|
|
||||||
m_Target.Set_Buff(m_Data.m_TData.e_Stat1, off ? 0 : sosdata.Get_StatValue1());
|
|
||||||
m_Target.Set_Buff(m_Data.m_TData.e_Stat2, off ? 0 : sosdata.Get_StatValue2());
|
|
||||||
break;
|
|
||||||
case eBuffType.Debuff:
|
|
||||||
m_Target.Set_DeBuff(m_Data.m_TData.e_Stat1, off ? 0 : sosdata.Get_StatValue1());
|
|
||||||
m_Target.Set_DeBuff(m_Data.m_TData.e_Stat2, off ? 0 : sosdata.Get_StatValue2());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Counting(int arg1, int arg2)
|
|
||||||
{
|
|
||||||
var sosdata = m_Data.m_TData;
|
|
||||||
switch (sosdata.e_StatusConditionsType)
|
|
||||||
{
|
|
||||||
case eStatusConditionsType.Invincibility_Count:
|
|
||||||
if (arg1 <= 0)
|
|
||||||
Set_Off();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (sosdata.e_ActiveConditions)
|
|
||||||
{
|
|
||||||
case eActiveConditions.MaxHp_Up:
|
|
||||||
if (arg1 >= sosdata.Get_Rate_orValue())
|
|
||||||
{
|
|
||||||
if (!m_eff.gameObject.activeInHierarchy)
|
|
||||||
m_eff.gameObject.SetActive(true);
|
|
||||||
Set_BufforDebuff();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_eff.Off();
|
|
||||||
Set_BufforDebuff(true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eActiveConditions.MaxHp_Down:
|
|
||||||
if (arg1 <= m_Data.m_TData.Get_Rate_orValue())
|
|
||||||
{
|
|
||||||
if (!m_eff.gameObject.activeInHierarchy)
|
|
||||||
m_eff.gameObject.SetActive(true);
|
|
||||||
Set_BufforDebuff();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_eff.Off();
|
|
||||||
Set_BufforDebuff(true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eActiveConditions.MaxHpRate:
|
|
||||||
if ((arg1 / (float)arg2) <= m_Data.m_TData.Get_Rate_orValue())
|
|
||||||
{
|
|
||||||
if (sosdata.e_StatusConditionsType == eStatusConditionsType.Destruct)
|
|
||||||
{
|
|
||||||
if (m_Target.Get_SelfDestructData().m_Status == eSelfDestructStatus.None)
|
|
||||||
{
|
|
||||||
m_Target.Set_SelfDestruct(m_Data);
|
|
||||||
m_Target.Get_SelfDestructData().eff_SelfDestruct = m_eff;
|
|
||||||
m_eff.gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!m_eff.gameObject.activeInHierarchy)
|
|
||||||
m_eff.gameObject.SetActive(true);
|
|
||||||
Set_BufforDebuff();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_eff.Off();
|
|
||||||
Set_BufforDebuff(true);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case eActiveConditions.MaxShield_Up:
|
|
||||||
break;
|
|
||||||
case eActiveConditions.MaxShield_Down:
|
|
||||||
break;
|
|
||||||
case eActiveConditions.MaxShield_Rate:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Off()
|
|
||||||
{
|
|
||||||
if (m_Data != null)
|
|
||||||
{
|
|
||||||
var sosdata = m_Data.m_TData;
|
|
||||||
switch (sosdata.e_ActiveConditions)
|
|
||||||
{ // 시간으로 제어하지 않는 조건들
|
|
||||||
case eActiveConditions.Appear:
|
|
||||||
case eActiveConditions.MaxHp_Up:
|
|
||||||
case eActiveConditions.MaxHp_Down:
|
|
||||||
case eActiveConditions.MaxHpRate:
|
|
||||||
case eActiveConditions.MaxShield_Up:
|
|
||||||
case eActiveConditions.MaxShield_Down:
|
|
||||||
case eActiveConditions.MaxShield_Rate:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Set_BufforDebuff(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Set_Off();
|
|
||||||
}
|
|
||||||
void Set_Off()
|
|
||||||
{
|
|
||||||
LifeTime = 0f;
|
|
||||||
bDot = false;
|
|
||||||
m_eff?.Off();
|
|
||||||
m_eff_repeat?.Off();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update()
|
|
||||||
{
|
|
||||||
Update_ActiveSkill();
|
|
||||||
|
|
||||||
if (RepeatEffectDelayTime > 0f)
|
|
||||||
{
|
|
||||||
RepeatEffectDelayTime -= Time.deltaTime;
|
|
||||||
if (RepeatEffectDelayTime <= 0f)
|
|
||||||
{
|
|
||||||
m_eff_repeat = EffectMgr.Ins.Show_FollowEffect(m_sclData.s_RepeatEffect, m_sclData.e_EffectPivot, m_Target,
|
|
||||||
m_Target.Get_World_Position(m_sclData.e_EffectPivot),
|
|
||||||
Mathf.Max(Time.deltaTime, LifeTime - m_sclData.f_RepeatEffectStartDelay));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bDot)
|
|
||||||
{
|
|
||||||
DotTime -= Time.deltaTime;
|
|
||||||
if (DotTime <= 0f)
|
|
||||||
{
|
|
||||||
DotTime = 1f;
|
|
||||||
m_Target.Get_Dmg((int)curValue);
|
|
||||||
EffectMgr.Ins.Show_Effect(m_sclData.s_SkillEffect, m_Target.Get_World_Position(m_sclData.e_EffectPivot), 1f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LifeTime > 0f)
|
|
||||||
{
|
|
||||||
LifeTime -= Time.deltaTime;
|
|
||||||
if (LifeTime < 0f)
|
|
||||||
{
|
|
||||||
Off();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsActive() { return LifeTime > 0f; }
|
|
||||||
public StatusOptionSetActorData Get_Data() { return m_Data; }
|
|
||||||
}
|
|
||||||
public partial class StatusEffectData
|
|
||||||
{
|
|
||||||
bool bActiveSkill;
|
|
||||||
float ActiveSkillRunTime;
|
|
||||||
|
|
||||||
public void Set_ActiveSkill(StatusOptionSetActorData data)
|
|
||||||
{
|
|
||||||
bActiveSkill = true;
|
|
||||||
m_Data = data;
|
|
||||||
m_sclData = m_Data.m_sclData;
|
|
||||||
m_Target = m_Data.m_Actor;
|
|
||||||
Set_Common();
|
|
||||||
|
|
||||||
ActiveSkillRunTime = m_Data.m_TData.Get_Rate_orValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update_ActiveSkill()
|
|
||||||
{
|
|
||||||
if (bActiveSkill)
|
|
||||||
{
|
|
||||||
if (ActiveSkillRunTime > 0f)
|
|
||||||
{
|
|
||||||
ActiveSkillRunTime -= Time.deltaTime;
|
|
||||||
if (ActiveSkillRunTime <= 0f)
|
|
||||||
{
|
|
||||||
ActiveSkillRunTime = m_Data.m_TData.Get_Rate_orValue();
|
|
||||||
var actor = m_Data.m_Actor;
|
|
||||||
var targets = m_Data.m_TData.Get_Targets(actor, actor.Get_Target(), actor.Get_Data().m_Role);
|
|
||||||
switch (m_Data.m_TData.e_StatusConditionsType)
|
|
||||||
{
|
|
||||||
case eStatusConditionsType.Heal_Hp_Add:
|
|
||||||
targets.ForEach(f => f.Heal(eHealType.Normal, (int)m_Data.m_TData.Get_StatValue1()));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum eSelfDestructStatus { None, Check_Rate /* 자폭 확률 켜짐 */, Soon /* 곧 자폭함 */ }
|
|
||||||
public class SelfDestructData
|
|
||||||
{
|
|
||||||
public eSelfDestructStatus m_Status;
|
|
||||||
public EffectBase eff_SelfDestruct;
|
|
||||||
public Coroutine co_SelfDestruct;
|
|
||||||
public StatusOptionSetActorData m_Data;
|
|
||||||
|
|
||||||
public void Set_Status(eSelfDestructStatus status) { m_Status = status; }
|
|
||||||
public void Set(StatusOptionSetActorData data) { m_Data = data; }
|
|
||||||
public void Stop(Actor actor)
|
|
||||||
{
|
|
||||||
if (co_SelfDestruct != null)
|
|
||||||
{
|
|
||||||
actor.StopCoroutine(co_SelfDestruct);
|
|
||||||
co_SelfDestruct = null;
|
|
||||||
eff_SelfDestruct.Off();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SetEquipmentData
|
|
||||||
{
|
|
||||||
public ObscuredInt m_MainValue, m_SetGroupID;
|
|
||||||
public Dictionary<eStat, ObscuredFloat> dic_Stat = new Dictionary<eStat, ObscuredFloat>();
|
|
||||||
public List<ObscuredInt> list_SkillId = new List<ObscuredInt>();
|
|
||||||
|
|
||||||
public void Add(EquipmentSetOptionTableData data, int set)
|
|
||||||
{
|
|
||||||
if (data == null) return;
|
|
||||||
dic_Stat.Clear();
|
|
||||||
list_SkillId.Clear();
|
|
||||||
|
|
||||||
m_SetGroupID = data.n_SetId;
|
|
||||||
m_SetGroupID.RandomizeCryptoKey();
|
|
||||||
|
|
||||||
if (set >= data.n_SetCondition1)
|
|
||||||
{
|
|
||||||
Add_Stat(data.e_SetStat1, data.f_SetStatValue1);
|
|
||||||
if (data.n_Set1CardSkill > 0) list_SkillId.Add(data.n_Set1CardSkill);
|
|
||||||
}
|
|
||||||
if (set >= data.n_SetCondition2)
|
|
||||||
{
|
|
||||||
Add_Stat(data.e_SetStat2, data.f_SetStatValue2);
|
|
||||||
if (data.n_Set2CardSkill > 0) list_SkillId.Add(data.n_Set2CardSkill);
|
|
||||||
}
|
|
||||||
if (set >= data.n_SetCondition3)
|
|
||||||
{
|
|
||||||
Add_Stat(data.e_SetStat3, data.f_SetStatValue3);
|
|
||||||
if (data.n_Set3CardSkill > 0) list_SkillId.Add(data.n_Set3CardSkill);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (set >= 6) m_MainValue = data.n_IncreaseMainStatSet6_Mul;
|
|
||||||
else if (set >= 5) m_MainValue = data.n_IncreaseMainStatSet5_Mul;
|
|
||||||
else if (set >= 4) m_MainValue = data.n_IncreaseMainStatSet4_Mul;
|
|
||||||
else if (set >= 3) m_MainValue = data.n_IncreaseMainStatSet3_Mul;
|
|
||||||
else if (set >= 2) m_MainValue = data.n_IncreaseMainStatSet2_Mul;
|
|
||||||
else m_MainValue = 0;
|
|
||||||
m_MainValue.RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Add_Stat(eStat stat, float value)
|
|
||||||
{
|
|
||||||
if (stat >= eStat.Max) return;
|
|
||||||
|
|
||||||
if (!dic_Stat.ContainsKey(stat))
|
|
||||||
dic_Stat.Add(stat, 0f);
|
|
||||||
dic_Stat[stat] += value;
|
|
||||||
dic_Stat[stat].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ItemSimpleData
|
public class ItemSimpleData
|
||||||
{
|
{
|
||||||
ObscuredInt _itemid;
|
ObscuredInt _itemid;
|
||||||
|
|
|
||||||
|
|
@ -102,15 +102,6 @@ public static class MyText
|
||||||
case ePatternType.Random: return "랜덤";
|
case ePatternType.Random: return "랜덤";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static string Get_MobTypeName(eToolMobType type)
|
|
||||||
{
|
|
||||||
switch (type)
|
|
||||||
{
|
|
||||||
case eToolMobType.Melee: return "근접";
|
|
||||||
case eToolMobType.Range: return "원거리";
|
|
||||||
default: return "고유";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static string Get_GradeName(eGrade grade) { return table_localtext.Ins.Get_Text(200 + (int)grade); }
|
public static string Get_GradeName(eGrade grade) { return table_localtext.Ins.Get_Text(200 + (int)grade); }
|
||||||
public static string Get_GradeName(int grade) { return table_localtext.Ins.Get_Text(200 + grade); }
|
public static string Get_GradeName(int grade) { return table_localtext.Ins.Get_Text(200 + grade); }
|
||||||
}
|
}
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
using CodeStage.AntiCheat.ObscuredTypes;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Random = UnityEngine.Random;
|
|
||||||
|
|
||||||
public static class MyValue
|
public static class MyValue
|
||||||
{
|
{
|
||||||
|
|
@ -13,14 +10,6 @@ public static class MyValue
|
||||||
public static int ItemID_Gem = 101, ItemID_Gold = 201, ItemID_Soul = 301, ItemID_Potion = 401, ItemID_Exp = 501,
|
public static int ItemID_Gem = 101, ItemID_Gold = 201, ItemID_Soul = 301, ItemID_Potion = 401, ItemID_Exp = 501,
|
||||||
ItemID_EvolutionMaxStone = 601;
|
ItemID_EvolutionMaxStone = 601;
|
||||||
|
|
||||||
public static Dictionary<eEquipmentParts, int> dic_NeedEvolution = new Dictionary<eEquipmentParts, int>
|
|
||||||
{ { eEquipmentParts.Ring, 1 }, { eEquipmentParts.Necklace, 2 }, { eEquipmentParts.SubWeapon, 3 } };
|
|
||||||
public static int PCEvolutionMaxLv = 6, SealMixCount = 3;
|
|
||||||
public static float MaxAvoid = 0.9f, MaxCri = 0.9f;
|
|
||||||
|
|
||||||
public static string OptionKey_UserType = "Option_UserType"; // 0 구글, 1 애플, 2 게스트
|
|
||||||
public static string OptionKey_UserID = "Option_UserID";
|
|
||||||
|
|
||||||
public static string SaveDataFileName = "SaveData";
|
public static string SaveDataFileName = "SaveData";
|
||||||
public static ServerData sdata => ServerInfo.Ins.m_ServerData;
|
public static ServerData sdata => ServerInfo.Ins.m_ServerData;
|
||||||
|
|
||||||
|
|
@ -31,143 +20,9 @@ public static class MyValue
|
||||||
m_MyStageData.m_Diff = 1;
|
m_MyStageData.m_Diff = 1;
|
||||||
m_MyStageData.m_Chapter = chapter;
|
m_MyStageData.m_Chapter = chapter;
|
||||||
m_MyStageData.m_Stage = stage;
|
m_MyStageData.m_Stage = stage;
|
||||||
m_MyStageData.m_NodeIndex = -1;
|
|
||||||
m_MyStageData.m_GameMode = eGameMode.Stage;
|
m_MyStageData.m_GameMode = eGameMode.Stage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ActorStatInfo Get_PCActorStatInfo(int pcid)
|
|
||||||
{
|
|
||||||
var pc = InGameInfo.Ins.m_PCActor;
|
|
||||||
var pctdata = table_pclist.Ins.Get_Data_orNull(pcid);
|
|
||||||
pc.Set(0, pctdata, IngameUIManager.Ins.PC_HUD_HPShield, sdata);
|
|
||||||
return Get_ActorStatInfo(pc, pctdata);
|
|
||||||
}
|
|
||||||
public static ActorStatInfo Get_ActorStatInfo(Actor actor, ActorTableDataBase actordata)
|
|
||||||
{
|
|
||||||
var stat = new ActorStatInfo(actor, true);
|
|
||||||
|
|
||||||
stat.Set_Stat(eStat.AttackCoolTime, actordata.f_AttackCoolTime);
|
|
||||||
stat.Set_Stat(eStat.Attack_Min, actordata.n_AttackMin);
|
|
||||||
stat.Set_Stat(eStat.Attack_Max, actordata.n_AttackMax);
|
|
||||||
stat.Set_Stat(eStat.Cri, actordata.f_Cri);
|
|
||||||
stat.Set_Stat(eStat.CriDmg, actordata.f_CriDmg);
|
|
||||||
stat.Set_Stat(eStat.HitRate, 100);
|
|
||||||
|
|
||||||
if (actor.IsRole(eRole.Mob))
|
|
||||||
{
|
|
||||||
stat.Set_Stat(eStat.HP, actordata.n_HP, true);
|
|
||||||
stat.Set_Stat(eStat.Shield, actordata.n_Shield, true);
|
|
||||||
stat.Set_Stat(eStat.Avoid_Melee, actordata.n_Avoid_Meele * 100);
|
|
||||||
stat.Set_Stat(eStat.Avoid_Range, actordata.n_Avoid_Range * 100);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var sdata = actor.Get_ServerData();
|
|
||||||
var pcid = actor.Get_Data().n_ID;
|
|
||||||
var addstats = new Dictionary<eStat, float>
|
|
||||||
{
|
|
||||||
{ eStat.Attack_Min, 0 }, { eStat.Attack_Max, 0 }, { eStat.MaxHP, 0 }, { eStat.MaxShield, 0 },
|
|
||||||
{ eStat.HitRate, 0 }, { eStat.Avoid_Melee, 0 }, { eStat.Avoid_Range, 0 }, { eStat.Cri, 0 }, { eStat.CriDmg, 0 },
|
|
||||||
};
|
|
||||||
|
|
||||||
// 2025. 12. 08 : 진화값 추가
|
|
||||||
var evolution = sdata.Get_PCEvolution(pcid);
|
|
||||||
for (int i = 1; i < evolution; i++)
|
|
||||||
{
|
|
||||||
var evolutionTdata = table_PCEvolution.Ins.Get_Data(pcid, i);
|
|
||||||
addstats[eStat.Attack_Min] += evolutionTdata.n_AttackValue;
|
|
||||||
addstats[eStat.Attack_Max] += evolutionTdata.n_AttackValue;
|
|
||||||
addstats[eStat.MaxHP] += evolutionTdata.n_MaxHPValue;
|
|
||||||
addstats[eStat.MaxShield] += evolutionTdata.n_MaxShieldValue;
|
|
||||||
addstats[eStat.HitRate] += evolutionTdata.n_HitRateValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2025. 12. 09 : 한계돌파값 추가
|
|
||||||
foreach (var key in addstats.Keys.ToList())
|
|
||||||
{
|
|
||||||
var lv = sdata.Get_PCEvolutionMax(pcid, key);
|
|
||||||
if (lv > 0)
|
|
||||||
{
|
|
||||||
var tData = table_PCEvolutionMax.Ins.Get_Data(key);
|
|
||||||
addstats[key] += lv *
|
|
||||||
(tData.e_Stat == eStat.Avoid_Melee || tData.e_Stat == eStat.Avoid_Range ? tData.f_Value * 100 :
|
|
||||||
tData.f_Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2025.12.27 : 장비값 추가
|
|
||||||
var equipitems = sdata.Get_EquipItems(pcid);
|
|
||||||
for (int i = 0; i < equipitems.Count; i++)
|
|
||||||
{
|
|
||||||
var equip = equipitems[i];
|
|
||||||
if (equip == null || equip.ID == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var tdata = table_EquipmentList.Ins.Get_Data(equip.TableID);
|
|
||||||
if (tdata == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
int lv = equip.Lv;
|
|
||||||
|
|
||||||
// ===== Main Option =====
|
|
||||||
if (tdata.n_MainOtion > 0)
|
|
||||||
{
|
|
||||||
var mainOpt = table_StatusOptionSet.Ins.Get_Data(tdata.n_MainOtion);
|
|
||||||
if (mainOpt != null)
|
|
||||||
{
|
|
||||||
ApplyStat(stat, addstats, mainOpt.e_Stat1, tdata.Get_Value(eEquipmentStat.Main1, actordata.n_ID, lv));
|
|
||||||
ApplyStat(stat, addstats, mainOpt.e_Stat2, tdata.Get_Value(eEquipmentStat.Main2, actordata.n_ID, lv));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===== Sub Options =====
|
|
||||||
ApplyStat(stat, addstats, tdata, tdata.n_SubOtion1, eEquipmentStat.Sub1, actordata.n_ID, lv);
|
|
||||||
ApplyStat(stat, addstats, tdata, tdata.n_SubOtion2, eEquipmentStat.Sub2, actordata.n_ID, lv);
|
|
||||||
ApplyStat(stat, addstats, tdata, tdata.n_SubOtion3, eEquipmentStat.Sub3, actordata.n_ID, lv);
|
|
||||||
ApplyStat(stat, addstats, tdata, tdata.n_SubOtion4, eEquipmentStat.Sub4, actordata.n_ID, lv);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2026. 01. 02 : 장비 세트 옵션값 추가
|
|
||||||
var setitemData = sdata.Get_EquipSetItemData(actordata.n_ID);
|
|
||||||
if (setitemData != null)
|
|
||||||
foreach (var item in setitemData.dic_Stat)
|
|
||||||
ApplyStat(stat, addstats, item.Key, item.Value);
|
|
||||||
|
|
||||||
stat.Set_Stat(true, eStat.Attack_Min, addstats[eStat.Attack_Min]);
|
|
||||||
stat.Set_Stat(true, eStat.Attack_Max, addstats[eStat.Attack_Max]);
|
|
||||||
stat.Set_Stat(true, eStat.HitRate, addstats[eStat.HitRate]);
|
|
||||||
stat.Set_Stat(true, eStat.Cri, addstats[eStat.Cri]);
|
|
||||||
stat.Set_Stat(true, eStat.CriDmg, addstats[eStat.CriDmg]);
|
|
||||||
|
|
||||||
stat.Set_Stat(eStat.HP, actordata.n_HP + addstats[eStat.MaxHP], true);
|
|
||||||
stat.Set_Stat(eStat.Shield, actordata.n_Shield + addstats[eStat.MaxShield], true);
|
|
||||||
stat.Set_Stat(eStat.Avoid_Melee, actordata.n_Avoid_Meele + addstats[eStat.Avoid_Melee]);
|
|
||||||
stat.Set_Stat(eStat.Avoid_Range, actordata.n_Avoid_Range + addstats[eStat.Avoid_Range]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 테스트 : 포션 임의 세팅
|
|
||||||
stat.Set_Stat(eStat.Potion, 5, true);
|
|
||||||
|
|
||||||
return stat;
|
|
||||||
}
|
|
||||||
static void ApplyStat(ActorStatInfo stat, Dictionary<eStat, float> addstats, eStat statType, float value)
|
|
||||||
{
|
|
||||||
if (addstats.ContainsKey(statType))
|
|
||||||
addstats[statType] += value;
|
|
||||||
else
|
|
||||||
stat.Set_Stat(true, statType, value);
|
|
||||||
}
|
|
||||||
static void ApplyStat(ActorStatInfo stat, Dictionary<eStat, float> addstats, EquipmentListTableData tdata,
|
|
||||||
int optionId, eEquipmentStat estat, int pcid, int lv)
|
|
||||||
{
|
|
||||||
if (optionId <= 0) return;
|
|
||||||
|
|
||||||
var optData = table_StatusOptionSet.Ins.Get_Data(optionId);
|
|
||||||
if (optData == null) return;
|
|
||||||
|
|
||||||
ApplyStat(stat, addstats, optData.e_Stat1, tdata.Get_Value(estat, pcid, lv));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Dictionary<eGrade, Color> dic_GradeColor = new Dictionary<eGrade, Color>
|
public static Dictionary<eGrade, Color> dic_GradeColor = new Dictionary<eGrade, Color>
|
||||||
{
|
{
|
||||||
{ eGrade.None, new Color32(161,152,148,255) },
|
{ eGrade.None, new Color32(161,152,148,255) },
|
||||||
|
|
@ -180,459 +35,11 @@ public static class MyValue
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum eStageEnterType { Normal, Tool, Tool_Mob }
|
|
||||||
public class MyStageData
|
public class MyStageData
|
||||||
{
|
{
|
||||||
public eStageEnterType m_EnterType = eStageEnterType.Normal;
|
|
||||||
public eGameMode m_GameMode;
|
public eGameMode m_GameMode;
|
||||||
|
|
||||||
ObscuredInt _diff = 1; public int m_Diff { get { return _diff; } set { _diff = value; _diff.RandomizeCryptoKey(); } }
|
ObscuredInt _diff = 1; public int m_Diff { get { return _diff; } set { _diff = value; _diff.RandomizeCryptoKey(); } }
|
||||||
ObscuredInt _chapter = 1; public int m_Chapter { get { return _chapter; } set { _chapter = value; _chapter.RandomizeCryptoKey(); } }
|
ObscuredInt _chapter = 1; public int m_Chapter { get { return _chapter; } set { _chapter = value; _chapter.RandomizeCryptoKey(); } }
|
||||||
ObscuredInt _stage; public int m_Stage { get { return _stage; } set { _stage = value; _stage.RandomizeCryptoKey(); } }
|
ObscuredInt _stage; public int m_Stage { get { return _stage; } set { _stage = value; _stage.RandomizeCryptoKey(); } }
|
||||||
ObscuredInt _node; public int m_NodeIndex { get { return _node; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_node = value;
|
|
||||||
_node.RandomizeCryptoKey();
|
|
||||||
|
|
||||||
// 스테이지 진행 상황 UI 갱신
|
|
||||||
if (_node > -1) IngameUIManager.Ins.m_DungeonInfo.m_DungeonProcess.Set();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public IngameStageData m_StageData;
|
|
||||||
StageNodeData m_CurNode;
|
|
||||||
|
|
||||||
public void Set_CurNodeData()
|
|
||||||
{
|
|
||||||
m_CurNode = m_StageData.list_Nodedata.Count > m_NodeIndex ? m_StageData.list_Nodedata[m_NodeIndex] : null;
|
|
||||||
|
|
||||||
if (m_CurNode != null && m_CurNode.m_Type == eStageNodeType.Random)
|
|
||||||
{
|
|
||||||
var rdnnodedata = m_CurNode.Get_Data<StageNodeData_Random>();
|
|
||||||
var tabledata = table_RandomPatternConfig.Ins.Get_Data(rdnnodedata.RandomID);
|
|
||||||
|
|
||||||
int pick = -1;
|
|
||||||
int safety = 20; // 무한루프 방지
|
|
||||||
|
|
||||||
while (safety-- > 0)
|
|
||||||
{
|
|
||||||
var tmp = DSUtil.WeightedPickIndex(tabledata.list_Weight, x => x);
|
|
||||||
var type = eStageNodeType.Nothing;
|
|
||||||
switch (tmp)
|
|
||||||
{
|
|
||||||
case 1: type = eStageNodeType.Mob; break;
|
|
||||||
case 2: type = eStageNodeType.BuffDebuff; break;
|
|
||||||
case 3: type = eStageNodeType.Merchant; break;
|
|
||||||
case 4: type = eStageNodeType.Treasure; break;
|
|
||||||
case 5: type = eStageNodeType.NPC; break;
|
|
||||||
case 6: type = eStageNodeType.Sanctuary; break;
|
|
||||||
case 7: type = eStageNodeType.TwoWay; break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 제한 걸린 타입이면 다시 뽑기
|
|
||||||
if (m_StageData.Use_RandomNodeLimit(type))
|
|
||||||
{
|
|
||||||
pick = tmp;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (pick)
|
|
||||||
{
|
|
||||||
default: // 없음
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.Nothing, new StageNodeData_Nothing());
|
|
||||||
break;
|
|
||||||
case 1: // 몬스터 등장
|
|
||||||
{
|
|
||||||
var mobnodedata = new StageNodeData_Mob();
|
|
||||||
var patternindex = DSUtil.WeightedPickIndex(m_StageData.list_PatternData, x => x.m_Weight);
|
|
||||||
var patterndata = m_StageData.list_PatternData[patternindex];
|
|
||||||
mobnodedata.PatternID = patterndata.m_PatternID;
|
|
||||||
mobnodedata.MobCount = Mathf.Max(1, patterndata.m_MobCount);
|
|
||||||
mobnodedata.list_MobID = new List<int>();
|
|
||||||
var moblst = m_StageData.Get_MonsterList(false);
|
|
||||||
for (int i = 0; i < mobnodedata.MobCount; i++)
|
|
||||||
{
|
|
||||||
var mobindex = DSUtil.WeightedPickIndex(moblst, x => x.m_Weight);
|
|
||||||
mobnodedata.list_MobID.Add(moblst[mobindex].m_MobID);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.Mob, mobnodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2: // 버프/디버프
|
|
||||||
{
|
|
||||||
var nodedata = new StageNodeData_BuffDebuff();
|
|
||||||
nodedata.BuffID = table_BuffPatternConfig.Ins.Get_RandomData().n_BuffOptionID;
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.BuffDebuff, nodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3: // 암상인
|
|
||||||
{
|
|
||||||
var nodedata = new StageNodeData_Merchant();
|
|
||||||
nodedata.MerchantID = table_MerchantConfig.Ins.Get_RandomData().n_MerchantID;
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.Merchant, nodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4: // 보물 상자
|
|
||||||
{
|
|
||||||
var nodedata = new StageNodeData_Treasure();
|
|
||||||
var tdata = table_TreasureBoxConfig.Ins.Get_RandomData();
|
|
||||||
nodedata.BoxID = tdata.n_TreasureID;
|
|
||||||
nodedata.MimicRate = tdata.f_TreasureMimicRate;
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.Treasure, nodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5: // NPC
|
|
||||||
{
|
|
||||||
var nodedata = new StageNodeData_NPC();
|
|
||||||
var tdata = table_NPCConfig.Ins.Get_RandomData();
|
|
||||||
nodedata.NPCID = tdata.n_NPCID;
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.NPC, nodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6: // 성소
|
|
||||||
{
|
|
||||||
var nodedata = new StageNodeData_Mine();
|
|
||||||
var tdata = table_SanctuaryConfig.Ins.Get_RandomData();
|
|
||||||
nodedata.SanctuaryID = tdata.n_BuffOptionID;
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.Sanctuary, nodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 7: // 갈림길
|
|
||||||
{ // TODO 정인호 : 갈림길 세부적인 건 추후에...
|
|
||||||
var nodedata = new StageNodeData_TwoWay();
|
|
||||||
nodedata.MapConfig1 = "";
|
|
||||||
nodedata.MapConfig2 = "";
|
|
||||||
nodedata.ChangeRate = 0.2f;
|
|
||||||
|
|
||||||
m_CurNode.Set_Data(eStageNodeType.TwoWay, nodedata);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public StageNodeData Get_CurNodeData() { return m_CurNode; }
|
|
||||||
public int Get_MobID_onStage(eToolMobType type)
|
|
||||||
{
|
|
||||||
List<StageMonsterData> candidates = new List<StageMonsterData>();
|
|
||||||
|
|
||||||
if (type == eToolMobType.Melee)
|
|
||||||
{
|
|
||||||
foreach (var temp in m_StageData.list_MobData)
|
|
||||||
{
|
|
||||||
var mobdata = table_monsterlist.Ins.Get_Data_orNull(temp.m_MobID);
|
|
||||||
if (mobdata != null && mobdata.Get_AttackType() == eAttackType.Melee)
|
|
||||||
candidates.Add(temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (type == eToolMobType.Range)
|
|
||||||
{
|
|
||||||
foreach (var temp in m_StageData.list_MobData)
|
|
||||||
{
|
|
||||||
var mobdata = table_monsterlist.Ins.Get_Data_orNull(temp.m_MobID);
|
|
||||||
if (mobdata != null && mobdata.Get_AttackType() == eAttackType.Range)
|
|
||||||
candidates.Add(temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (candidates.Count == 0)
|
|
||||||
return 0; // 없을 때는 0 반환
|
|
||||||
|
|
||||||
// 가중치 합계
|
|
||||||
int totalWeight = 0;
|
|
||||||
foreach (var c in candidates)
|
|
||||||
totalWeight += c.m_Weight;
|
|
||||||
|
|
||||||
// 랜덤 뽑기
|
|
||||||
int rand = UnityEngine.Random.Range(1, totalWeight + 1);
|
|
||||||
int cumulative = 0;
|
|
||||||
|
|
||||||
foreach (var c in candidates)
|
|
||||||
{
|
|
||||||
cumulative += c.m_Weight;
|
|
||||||
if (rand <= cumulative)
|
|
||||||
return c.m_MobID;
|
|
||||||
}
|
|
||||||
|
|
||||||
return candidates[0].m_MobID; // fallback
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ActorStatInfo
|
|
||||||
{
|
|
||||||
public Actor m_Actor;
|
|
||||||
|
|
||||||
Dictionary<eStat, ObscuredDouble> dic_StatValue = new Dictionary<eStat, ObscuredDouble>();
|
|
||||||
Dictionary<eStat, ObscuredDouble> dic_StatValue_Buff = new Dictionary<eStat, ObscuredDouble>();
|
|
||||||
Dictionary<eStat, ObscuredDouble> dic_StatValue_Debuff = new Dictionary<eStat, ObscuredDouble>();
|
|
||||||
bool bInit = false;
|
|
||||||
public bool IsMainAttack;
|
|
||||||
|
|
||||||
void Init()
|
|
||||||
{
|
|
||||||
if (!bInit)
|
|
||||||
{
|
|
||||||
bInit = true;
|
|
||||||
for (eStat i = 0; i < eStat.Max; i++)
|
|
||||||
dic_StatValue.Add(i, 0d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Clear_All()
|
|
||||||
{
|
|
||||||
var keys = new List<eStat>(dic_StatValue.Keys);
|
|
||||||
foreach (var key in keys) dic_StatValue[key] = 0d;
|
|
||||||
Clear_BuffDebuff();
|
|
||||||
}
|
|
||||||
public void Clear_BuffDebuff()
|
|
||||||
{
|
|
||||||
dic_StatValue_Buff.Clear();
|
|
||||||
dic_StatValue_Debuff.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActorStatInfo(Actor actor, bool mainattack)
|
|
||||||
{
|
|
||||||
Init();
|
|
||||||
m_Actor = actor;
|
|
||||||
IsMainAttack = mainattack;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double Get_Stat(eStat key)
|
|
||||||
{
|
|
||||||
if (dic_StatValue.ContainsKey(key))
|
|
||||||
return dic_StatValue[key].GetDecrypted();
|
|
||||||
return 0d;
|
|
||||||
}
|
|
||||||
public double Get_TotalStat(eStat stat)
|
|
||||||
{
|
|
||||||
var rtn = Get_Stat(stat) + Get_BuffStat(stat) - Get_DebuffStat(stat);
|
|
||||||
|
|
||||||
switch (stat)
|
|
||||||
{
|
|
||||||
// 정수
|
|
||||||
case eStat.HP:
|
|
||||||
case eStat.Shield:
|
|
||||||
case eStat.Potion:
|
|
||||||
case eStat.HitRate:
|
|
||||||
return (int)rtn;
|
|
||||||
case eStat.MaxHP:
|
|
||||||
{
|
|
||||||
rtn += Get_BuffStat(eStat.MaxHP_Add);
|
|
||||||
var mul = Get_BuffStat(eStat.MaxHP_Mul);
|
|
||||||
return (int)(rtn + (rtn * mul));
|
|
||||||
}
|
|
||||||
case eStat.MaxShield:
|
|
||||||
{
|
|
||||||
rtn += Get_BuffStat(eStat.MaxShield_Add);
|
|
||||||
var mul = Get_BuffStat(eStat.MaxShield_Mul);
|
|
||||||
return (int)(rtn + (rtn * mul));
|
|
||||||
}
|
|
||||||
case eStat.Attack_Min:
|
|
||||||
{
|
|
||||||
rtn += Get_Stat(eStat.Attack) + Get_BuffStat(eStat.Attack) - Get_DebuffStat(eStat.Attack);
|
|
||||||
|
|
||||||
var card = m_Actor.Get_CardSkillData_orNull(eCardType.G5_FlatDamageMinMaxEqual);
|
|
||||||
if (card != null)
|
|
||||||
{
|
|
||||||
var comparestat = eStat.Attack_Max;
|
|
||||||
var maxdmg = Get_Stat(comparestat) + Get_BuffStat(comparestat) - Get_DebuffStat(comparestat);
|
|
||||||
rtn = Mathf.Max((int)rtn, (int)maxdmg);
|
|
||||||
}
|
|
||||||
|
|
||||||
var mul = Get_BuffStat(eStat.DmgMul);
|
|
||||||
return (int)(rtn + (rtn * mul));
|
|
||||||
}
|
|
||||||
case eStat.Attack_Max:
|
|
||||||
{
|
|
||||||
rtn += Get_Stat(eStat.Attack) + Get_BuffStat(eStat.Attack) - Get_DebuffStat(eStat.Attack);
|
|
||||||
|
|
||||||
var card = m_Actor.Get_CardSkillData_orNull(eCardType.G5_FlatDamageMinMaxEqual);
|
|
||||||
if (card != null)
|
|
||||||
{
|
|
||||||
var comparestat = eStat.Attack_Min;
|
|
||||||
var maxdmg = Get_Stat(comparestat) + Get_BuffStat(comparestat) - Get_DebuffStat(comparestat);
|
|
||||||
rtn = Mathf.Max((int)rtn, (int)maxdmg);
|
|
||||||
}
|
|
||||||
|
|
||||||
var mul = Get_BuffStat(eStat.DmgMul);
|
|
||||||
return (int)(rtn + (rtn * mul) + Get_BuffStat(eStat.MaxAttack_byShield));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 정수 분기 (캐릭터 실수, 몬스터 정수)
|
|
||||||
case eStat.Avoid_Melee:
|
|
||||||
case eStat.Avoid_Range:
|
|
||||||
if (m_Actor.IsRole(eRole.PC))
|
|
||||||
{
|
|
||||||
var totalavoid = rtn * 0.01f + Get_BuffStat(eStat.AvoidAll_1Time);
|
|
||||||
totalavoid += Get_BuffStat(eStat.Avoid_G1_MaxDodgeWhenHpBelow);
|
|
||||||
totalavoid += Get_TotalStat(eStat.AllEvasion);
|
|
||||||
Set_Buff(eStat.AvoidAll_1Time, 0);
|
|
||||||
return Math.Min(MyValue.MaxAvoid, totalavoid);
|
|
||||||
}
|
|
||||||
return (int)rtn;
|
|
||||||
|
|
||||||
// 백분율
|
|
||||||
case eStat.Cri:
|
|
||||||
if (IsMainAttack)
|
|
||||||
{
|
|
||||||
rtn += Get_BuffStat(eStat.AddCri_1Time) + Get_BuffStat(eStat.AddCri_Once);
|
|
||||||
Set_Buff(eStat.AddCri_1Time, 0);
|
|
||||||
Set_Buff(eStat.AddCri_Once, 0);
|
|
||||||
}
|
|
||||||
rtn = Math.Min(MyValue.MaxCri, rtn);
|
|
||||||
break;
|
|
||||||
case eStat.CriDmg:
|
|
||||||
{
|
|
||||||
rtn += Get_BuffStat(eStat.AddCriDmg_1Time);
|
|
||||||
Set_Buff(eStat.AddCriDmg_1Time, 0);
|
|
||||||
}
|
|
||||||
return rtn;
|
|
||||||
|
|
||||||
case eStat.AttackCoolTime:
|
|
||||||
{
|
|
||||||
var slow = Get_DebuffStat(eStat.Slow);
|
|
||||||
rtn += rtn * slow;
|
|
||||||
var past = Get_BuffStat(eStat.AttackCoolTimeMul);
|
|
||||||
rtn -= rtn * past;
|
|
||||||
if (rtn <= 0) rtn = 0.1f;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rtn;
|
|
||||||
}
|
|
||||||
public void Set_Stat(bool _add, eStat key, double _val)
|
|
||||||
{
|
|
||||||
if (key >= eStat.Max) return;
|
|
||||||
|
|
||||||
if (_add) dic_StatValue[key] += _val;
|
|
||||||
else dic_StatValue[key] -= _val;
|
|
||||||
|
|
||||||
if (key == eStat.HP)
|
|
||||||
{
|
|
||||||
var maxhp = Get_TotalStat(eStat.MaxHP);
|
|
||||||
if (dic_StatValue[key] > maxhp)
|
|
||||||
dic_StatValue[key] = maxhp;
|
|
||||||
else if (dic_StatValue[key] < 0)
|
|
||||||
dic_StatValue[key] = 0;
|
|
||||||
|
|
||||||
//if (m_Actor) m_Actor.Set_HUD();
|
|
||||||
}
|
|
||||||
else if (key == eStat.Shield)
|
|
||||||
{
|
|
||||||
var maxshield = Get_TotalStat(eStat.MaxShield);
|
|
||||||
if (dic_StatValue[key] > maxshield)
|
|
||||||
dic_StatValue[key] = maxshield;
|
|
||||||
else if (dic_StatValue[key] < 0)
|
|
||||||
dic_StatValue[key] = 0;
|
|
||||||
|
|
||||||
//if (m_Actor) m_Actor.Set_HUD();
|
|
||||||
}
|
|
||||||
else if (key == eStat.Potion)
|
|
||||||
{
|
|
||||||
var maxpotion = Get_TotalStat(eStat.MaxPotion);
|
|
||||||
if (dic_StatValue[key] > maxpotion)
|
|
||||||
dic_StatValue[key] = maxpotion;
|
|
||||||
else if (dic_StatValue[key] < 0)
|
|
||||||
dic_StatValue[key] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
dic_StatValue[key].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
public void Set_Stat(eStat key, double _val, bool setmax = false)
|
|
||||||
{
|
|
||||||
dic_StatValue[key] = _val;
|
|
||||||
dic_StatValue[key].RandomizeCryptoKey();
|
|
||||||
|
|
||||||
if (setmax)
|
|
||||||
{
|
|
||||||
if (key == eStat.HP)
|
|
||||||
{
|
|
||||||
dic_StatValue[eStat.MaxHP] = _val;
|
|
||||||
dic_StatValue[eStat.MaxHP].RandomizeCryptoKey();
|
|
||||||
|
|
||||||
//if (m_Actor) m_Actor.Set_HUD();
|
|
||||||
}
|
|
||||||
else if (key == eStat.Shield)
|
|
||||||
{
|
|
||||||
dic_StatValue[eStat.MaxShield] = _val;
|
|
||||||
dic_StatValue[eStat.MaxShield].RandomizeCryptoKey();
|
|
||||||
|
|
||||||
//if (m_Actor) m_Actor.Set_HUD();
|
|
||||||
}
|
|
||||||
else if (key == eStat.Potion)
|
|
||||||
{
|
|
||||||
dic_StatValue[eStat.MaxPotion] = _val;
|
|
||||||
dic_StatValue[eStat.MaxPotion].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double Get_BuffStat(eStat stat) { return dic_StatValue_Buff.ContainsKey(stat) ? dic_StatValue_Buff[stat] : 0d; }
|
|
||||||
public void Set_Buff(eStat stat, double v)
|
|
||||||
{
|
|
||||||
if (stat >= eStat.Max) return;
|
|
||||||
|
|
||||||
if (!dic_StatValue_Buff.ContainsKey(stat))
|
|
||||||
dic_StatValue_Buff.Add(stat, v);
|
|
||||||
else
|
|
||||||
dic_StatValue_Buff[stat] = v;
|
|
||||||
dic_StatValue_Buff[stat].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
public void Set_Buff(bool add, eStat stat, double v)
|
|
||||||
{
|
|
||||||
if (stat >= eStat.Max) return;
|
|
||||||
|
|
||||||
if (!dic_StatValue_Buff.ContainsKey(stat))
|
|
||||||
{
|
|
||||||
if (add) dic_StatValue_Buff.Add(stat, v);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (add) dic_StatValue_Buff[stat] += v;
|
|
||||||
else dic_StatValue_Buff[stat] -= v;
|
|
||||||
}
|
|
||||||
dic_StatValue_Buff[stat].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
public double Get_DebuffStat(eStat stat) { return dic_StatValue_Debuff.ContainsKey(stat) ? dic_StatValue_Debuff[stat] : 0d; }
|
|
||||||
public void Set_Debuff(eStat stat, double v)
|
|
||||||
{
|
|
||||||
if (stat >= eStat.Max) return;
|
|
||||||
|
|
||||||
if (!dic_StatValue_Debuff.ContainsKey(stat))
|
|
||||||
dic_StatValue_Debuff.Add(stat, v);
|
|
||||||
else
|
|
||||||
dic_StatValue_Debuff[stat] = v;
|
|
||||||
dic_StatValue_Debuff[stat].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
public void Set_Debuff(bool add, eStat stat, double v)
|
|
||||||
{
|
|
||||||
if (!dic_StatValue_Debuff.ContainsKey(stat))
|
|
||||||
{
|
|
||||||
if (add) dic_StatValue_Debuff.Add(stat, v);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (add) dic_StatValue_Debuff[stat] += v;
|
|
||||||
else dic_StatValue_Debuff[stat] -= v;
|
|
||||||
}
|
|
||||||
dic_StatValue_Debuff[stat].RandomizeCryptoKey();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Set_BuffDebuff(ActorStatInfo statinfo)
|
|
||||||
{
|
|
||||||
foreach (var item in dic_StatValue_Buff) statinfo.Set_Buff(item.Key, item.Value);
|
|
||||||
foreach (var item in dic_StatValue_Debuff) statinfo.Set_Debuff(item.Key, item.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Get_Damage()
|
|
||||||
{
|
|
||||||
var dmg = Random.Range((int)Get_TotalStat(eStat.Attack_Min), (int)Get_TotalStat(eStat.Attack_Max) + 1);
|
|
||||||
return Mathf.Max(dmg, 1); // 최소 데미지 1 보장
|
|
||||||
}
|
|
||||||
public bool isFullHP() { return Get_TotalStat(eStat.HP) >= Get_TotalStat(eStat.MaxHP); }
|
|
||||||
}
|
}
|
||||||
|
|
@ -22,521 +22,11 @@ public class SC_Version
|
||||||
public class ServerData
|
public class ServerData
|
||||||
{ // 데이터 정의
|
{ // 데이터 정의
|
||||||
public DateTime LastTime;
|
public DateTime LastTime;
|
||||||
public ObscuredInt _pcid; public int PCID { get { return _pcid; } set { _pcid = value; _pcid.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
public Dictionary<int, SD_PC> dic_PC = new Dictionary<int, SD_PC>(); // pcid
|
|
||||||
// pcid, awaken id
|
|
||||||
public Dictionary<int, Dictionary<int, SD_PC_Awakening>> dic_PC_Awakening = new Dictionary<int, Dictionary<int, SD_PC_Awakening>>();
|
|
||||||
public SD_Seal Seal = new SD_Seal();
|
|
||||||
public SD_Equipment Equipment = new SD_Equipment();
|
|
||||||
public Dictionary<int, SD_Money> dic_Item = new Dictionary<int, SD_Money>(); // itemid
|
|
||||||
public Dictionary<int, SD_Card> dic_Card = new Dictionary<int, SD_Card>(); // cardid
|
|
||||||
|
|
||||||
#region 최초 생성
|
#region 최초 생성
|
||||||
public ServerData()
|
public ServerData()
|
||||||
{
|
{
|
||||||
LastTime = ServerInfo.ServerTime;
|
LastTime = ServerInfo.ServerTime;
|
||||||
PCID = table_pclist.Ins.Get_DataList()[0].n_ID;
|
|
||||||
Add_PC(PCID);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region PC
|
|
||||||
public bool IsObtainPC(int id) { return dic_PC.ContainsKey(id); }
|
|
||||||
public int Get_PCLv(int id) { return IsObtainPC(id) ? dic_PC[id].Lv : 0; }
|
|
||||||
public int Get_SelectPCLv() { return IsObtainPC(PCID) ? dic_PC[PCID].Lv : 0; }
|
|
||||||
public void Set_SelectPC(int id) { PCID = id; ServerInfo.Ins.Save(); }
|
|
||||||
void Add_PC(int id)
|
|
||||||
{
|
|
||||||
if (!IsObtainPC(id))
|
|
||||||
{
|
|
||||||
dic_PC.Add(id, new SD_PC());
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region PC 각성
|
|
||||||
public int Get_PCAwakenLv(int pcid, int awakeid)
|
|
||||||
{
|
|
||||||
return dic_PC_Awakening.ContainsKey(pcid) ?
|
|
||||||
dic_PC_Awakening[pcid].ContainsKey(awakeid) ? dic_PC_Awakening[pcid][awakeid].Lv
|
|
||||||
: 0
|
|
||||||
: 0;
|
|
||||||
}
|
|
||||||
public int Get_PCAwakenLv(int awakeid)
|
|
||||||
{
|
|
||||||
foreach (var item in dic_PC_Awakening)
|
|
||||||
{
|
|
||||||
foreach (var item2 in item.Value)
|
|
||||||
{
|
|
||||||
if (item2.Key == awakeid)
|
|
||||||
return item2.Value.Lv;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
public void Add_PCAwakenLv(int pcid, int awakeid)
|
|
||||||
{
|
|
||||||
if (!dic_PC_Awakening.ContainsKey(pcid)) dic_PC_Awakening.Add(pcid, new Dictionary<int, SD_PC_Awakening>());
|
|
||||||
if (!dic_PC_Awakening[pcid].ContainsKey(awakeid)) dic_PC_Awakening[pcid].Add(awakeid, new SD_PC_Awakening());
|
|
||||||
++dic_PC_Awakening[pcid][awakeid].Lv;
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region PC 진화
|
|
||||||
public int Get_PCEvolution(int id) { return dic_PC.ContainsKey(id) ? dic_PC[id].Evolution : 0; }
|
|
||||||
public void Add_PCEvolution(int id) { if (dic_PC.ContainsKey(id)) ++dic_PC[id].Evolution; ServerInfo.Ins.Save(); }
|
|
||||||
public int Get_PCEvolutionTestClear(int id) { return dic_PC.ContainsKey(id) ? dic_PC[id].EvolutionTestClear : 0; }
|
|
||||||
public void Add_PCEvolutionTestClear(int id) { if (dic_PC.ContainsKey(id)) ++dic_PC[id].EvolutionTestClear; ServerInfo.Ins.Save(); }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region PC 한계돌파
|
|
||||||
public int Get_PCEvolutionMax(int id, eStat stat) { return dic_PC.ContainsKey(id) ? dic_PC[id].Get_EvolutionMax(stat) : 0; }
|
|
||||||
public void Add_PCEvolutionMax(int id, eStat stat)
|
|
||||||
{
|
|
||||||
if (dic_PC.ContainsKey(id))
|
|
||||||
{
|
|
||||||
dic_PC[id].Add_EvolutionMax(stat);
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region PC 인장
|
|
||||||
public List<uint> Get_EquipSeals(int pcid) { return dic_PC.ContainsKey(pcid) ? dic_PC[pcid].list_equipseal : null; }
|
|
||||||
public void Set_EquipSeal(int pcid, int slot, uint sealid = 0)
|
|
||||||
{
|
|
||||||
if (dic_PC.ContainsKey(pcid))
|
|
||||||
{
|
|
||||||
dic_PC[pcid].list_equipseal[slot] = sealid;
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public void Set_UnEqiupSeal(int pcid, uint sealid)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < dic_PC[pcid].list_equipseal.Count; i++)
|
|
||||||
{
|
|
||||||
if (dic_PC[pcid].list_equipseal[i] == sealid)
|
|
||||||
{
|
|
||||||
dic_PC[pcid].list_equipseal[i] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
public void Add_Seal(int sealtableid)
|
|
||||||
{
|
|
||||||
Seal.list_Seal.Add(new SD_SealData { ID = Seal.Get_Init_ID(), TableID = sealtableid, Lv = 1 });
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
public int Get_SameSealCount(SD_SealData data)
|
|
||||||
{
|
|
||||||
var count = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < Seal.list_Seal.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = Seal.list_Seal[i];
|
|
||||||
if (temp.TableID == data.TableID && temp.Lv == data.Lv && !isEquipSeal(temp.ID))
|
|
||||||
++count;
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
public bool isEquipSeal(uint sealid)
|
|
||||||
{
|
|
||||||
foreach (var pc in dic_PC.Values)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < pc.list_equipseal.Count; i++)
|
|
||||||
{
|
|
||||||
if (pc.list_equipseal[i] == sealid)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public int CanEquipSeal(int pcid, uint sealid, eElement element)
|
|
||||||
{
|
|
||||||
var equippcid = MyValue.sdata.Get_EquipSealPCID(sealid);
|
|
||||||
if (equippcid > 0 && equippcid == pcid) return -1; // 선택한 PC가 착용중
|
|
||||||
|
|
||||||
// 착용하고자 하는 슬롯이 잠겨 있거나, 인장과 같은 속성의 슬롯이 다 찼으면 장착 불가
|
|
||||||
if (MyValue.sdata.Get_CanEquipSealSlotIndex(pcid, element) < 0)
|
|
||||||
return -3;
|
|
||||||
|
|
||||||
var pcTdata = table_pclist.Ins.Get_Data_orNull(pcid);
|
|
||||||
if (!pcTdata.list_element.Contains(element)) return -2; // 선택한 PC가 착용할 수 없는 속성
|
|
||||||
|
|
||||||
if (equippcid > 0 && equippcid != pcid) return 1; // 다른 캐릭터가 장착하고 있음
|
|
||||||
return 0; // 착용 가능
|
|
||||||
}
|
|
||||||
public int Get_EquipSealPCID(uint sealid)
|
|
||||||
{
|
|
||||||
foreach (var pc in dic_PC)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < pc.Value.list_equipseal.Count; i++)
|
|
||||||
{
|
|
||||||
if (pc.Value.list_equipseal[i] == sealid)
|
|
||||||
return pc.Key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
public int Get_CanEquipSealSlotIndex(int pcid, eElement element)
|
|
||||||
{
|
|
||||||
if (dic_PC.ContainsKey(pcid))
|
|
||||||
{
|
|
||||||
var slots = dic_PC[pcid].list_equipseal;
|
|
||||||
var pcTdata = table_pclist.Ins.Get_Data_orNull(pcid);
|
|
||||||
var alv = Get_PCAwakenLv(pcid);
|
|
||||||
for (int i = 0; i < pcTdata.list_slotelement.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = pcTdata.list_slotelement[i];
|
|
||||||
if (temp == element)
|
|
||||||
{
|
|
||||||
if (slots[i] == 0 && alv >= i) // 잠기지 않은 빈 슬롯
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
public SD_SealData Get_SealData(uint sealid) { return Seal.list_Seal.Find(f=>f.ID == sealid); }
|
|
||||||
public void Mix_Seal(SD_SealData data)
|
|
||||||
{
|
|
||||||
// 1) 장착된 인장은 합성 불가
|
|
||||||
if (isEquipSeal(data.ID))
|
|
||||||
{
|
|
||||||
ToastUI.Ins.Set("[Mix_Seal] 합성 실패: 장착 중인 인장은 합성할 수 없습니다.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2) 승급 대상 인장 찾기
|
|
||||||
SD_SealData target = Seal.list_Seal.Find(s => s.ID == data.ID);
|
|
||||||
if (target == null)
|
|
||||||
{
|
|
||||||
ToastUI.Ins.Set("[Mix_Seal] 합성 실패: 대상 인장이 존재하지 않습니다.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3) 동일 tableid + 동일 star 의 재료 인장 2개 찾기 (대상은 제외)
|
|
||||||
List<SD_SealData> materials = new List<SD_SealData>();
|
|
||||||
foreach (var s in Seal.list_Seal)
|
|
||||||
{
|
|
||||||
if (s.ID == data.ID) continue;
|
|
||||||
if (s.TableID == data.TableID && s.Lv == data.Lv)
|
|
||||||
materials.Add(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (materials.Count < 2)
|
|
||||||
{
|
|
||||||
ToastUI.Ins.Set("[Mix_Seal] 합성 실패: 동일 인장(star, tableid) 재료가 부족합니다. 필요: 2개");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4) 합성 처리
|
|
||||||
target.Lv = data.Lv + 1;
|
|
||||||
|
|
||||||
// 재료 2개 삭제
|
|
||||||
Seal.list_Seal.Remove(materials[0]);
|
|
||||||
Seal.list_Seal.Remove(materials[1]);
|
|
||||||
|
|
||||||
ToastUI.Ins.Set($"인장 합성 성공! ID:{data.ID}, Lv:{data.Lv - 1} → Lv:{data.Lv}");
|
|
||||||
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 장비
|
|
||||||
public List<SD_EquipmentData> Get_Equip_Inven(List<eEquipmentParts> types)
|
|
||||||
{
|
|
||||||
List<SD_EquipmentData> rtn = new List<SD_EquipmentData>();
|
|
||||||
bool isAll = types == null;
|
|
||||||
for (int i = 0; i < Equipment.list_item.Count; i++)
|
|
||||||
{
|
|
||||||
var tdata = table_EquipmentList.Ins.Get_Data(Equipment.list_item[i].TableID);
|
|
||||||
if (isAll || types.Contains(tdata.e_EquipmentType))
|
|
||||||
rtn.Add(Equipment.list_item[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return rtn;
|
|
||||||
}
|
|
||||||
void Add_Equipment(int tid)
|
|
||||||
{
|
|
||||||
Equipment.list_item.Add(new SD_EquipmentData { ID = Equipment.Get_Init_ID(), TableID = tid, Lv = 0 });
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
public void Add_EquipmentLv(uint id, int lv = 1)
|
|
||||||
{
|
|
||||||
var item = Get_Equipment(id);
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
var edata = table_EquipmentList.Ins.Get_Data(item.TableID);
|
|
||||||
var udata = table_EquipmentUpgrade.Ins.Get_Data(edata.n_Grade);
|
|
||||||
if (item.Lv < udata.n_MaxLv)
|
|
||||||
{
|
|
||||||
item.Lv += lv;
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SD_EquipmentData> list_noequipitems = new List<SD_EquipmentData>
|
|
||||||
{
|
|
||||||
new SD_EquipmentData(), new SD_EquipmentData(), new SD_EquipmentData(), new SD_EquipmentData(),
|
|
||||||
new SD_EquipmentData(), new SD_EquipmentData(), new SD_EquipmentData(), new SD_EquipmentData(),
|
|
||||||
};
|
|
||||||
public List<SD_EquipmentData> Get_EquipItems(int pcid)
|
|
||||||
{
|
|
||||||
var rtn = new List<SD_EquipmentData>();
|
|
||||||
|
|
||||||
if (!IsObtainPC(pcid))
|
|
||||||
return list_noequipitems;
|
|
||||||
|
|
||||||
foreach (var id in dic_PC[pcid].list_equipitems)
|
|
||||||
{
|
|
||||||
if (id == 0)
|
|
||||||
rtn.Add(new SD_EquipmentData());
|
|
||||||
else
|
|
||||||
rtn.Add(Get_Equipment(id) ?? new SD_EquipmentData());
|
|
||||||
}
|
|
||||||
|
|
||||||
return rtn;
|
|
||||||
}
|
|
||||||
public SD_EquipmentData Get_Equipment(uint id) { return Equipment.list_item.Find(f => f.ID == id); }
|
|
||||||
bool TryFindEquippedPC(uint itemId, out int equippedPcid)
|
|
||||||
{
|
|
||||||
foreach (var kv in dic_PC)
|
|
||||||
{
|
|
||||||
if (kv.Value.list_equipitems.Exists(id => id == itemId))
|
|
||||||
{
|
|
||||||
equippedPcid = kv.Key;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
equippedPcid = -1;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
EquipResult CanEquipItem(int pcid, uint itemId)
|
|
||||||
{
|
|
||||||
var serverdata = Equipment.list_item.Find(f=>f.ID == itemId);
|
|
||||||
if (serverdata == null) return EquipResult.NotEnoughEvolution;
|
|
||||||
|
|
||||||
var tData = table_EquipmentList.Ins.Get_Data(serverdata.TableID);
|
|
||||||
if (MyValue.dic_NeedEvolution.ContainsKey(tData.e_EquipmentType))
|
|
||||||
{
|
|
||||||
if (MyValue.sdata.Get_PCEvolution(pcid) < MyValue.dic_NeedEvolution[tData.e_EquipmentType])
|
|
||||||
return EquipResult.NotEnoughEvolution;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!TryFindEquippedPC(itemId, out var equippedPcid))
|
|
||||||
return EquipResult.CanEquip;
|
|
||||||
|
|
||||||
if (equippedPcid == pcid)
|
|
||||||
return EquipResult.EquippedByMe;
|
|
||||||
|
|
||||||
return EquipResult.EquippedByOther;
|
|
||||||
}
|
|
||||||
public bool Can_EquipItem(int pcid, uint itemId)
|
|
||||||
{
|
|
||||||
var result = CanEquipItem(pcid, itemId);
|
|
||||||
return result == EquipResult.CanEquip || result == EquipResult.EquippedByOther;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsObtainItem(int tableid) { return Equipment.list_item.Find(f => f.TableID == tableid) != null; }
|
|
||||||
public bool isEquipItem(uint id)
|
|
||||||
{
|
|
||||||
foreach (var pc in dic_PC.Values)
|
|
||||||
if (pc.list_equipitems.Contains(id))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public bool isEquipItem_byTableID(int id)
|
|
||||||
{
|
|
||||||
foreach (var pc in dic_PC.Values)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < pc.list_equipitems.Count; i++)
|
|
||||||
{
|
|
||||||
var sid = pc.list_equipitems[i];
|
|
||||||
var sitem = Equipment.list_item.Find(f => f.ID == sid);
|
|
||||||
if (sitem != null && sitem.TableID == id)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public bool isMyEquipItem(int pcid, uint id)
|
|
||||||
{
|
|
||||||
return IsObtainPC(pcid) && dic_PC[pcid].list_equipitems.Contains(id);
|
|
||||||
}
|
|
||||||
public void Set_EquipItem(int pcid, uint sid)
|
|
||||||
{
|
|
||||||
var result = CanEquipItem(pcid, sid);
|
|
||||||
if (result == EquipResult.EquippedByMe)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// 다른 캐릭터 장착 해제
|
|
||||||
if (result == EquipResult.EquippedByOther && TryFindEquippedPC(sid, out var otherPcid))
|
|
||||||
{
|
|
||||||
var otherList = dic_PC[otherPcid].list_equipitems;
|
|
||||||
for (int i = 0; i < otherList.Count; i++)
|
|
||||||
if (otherList[i] == sid)
|
|
||||||
otherList[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
var itemData = Get_Equipment(sid);
|
|
||||||
if (itemData == null) return;
|
|
||||||
|
|
||||||
var tdata = table_EquipmentList.Ins.Get_Data(itemData.TableID);
|
|
||||||
int slotIndex = (int)tdata.e_EquipmentType;
|
|
||||||
|
|
||||||
dic_PC[pcid].list_equipitems[slotIndex] = sid;
|
|
||||||
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
public void Set_UnEquipItem(int pcid, uint itemId)
|
|
||||||
{
|
|
||||||
if (!IsObtainPC(pcid)) return;
|
|
||||||
|
|
||||||
var equipList = dic_PC[pcid].list_equipitems;
|
|
||||||
|
|
||||||
for (int i = 0; i < equipList.Count; i++)
|
|
||||||
{
|
|
||||||
if (equipList[i] == itemId)
|
|
||||||
{
|
|
||||||
equipList[i] = 0;
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Dictionary<eEquipmentParts, bool> dic_SetCheck = new Dictionary<eEquipmentParts, bool>
|
|
||||||
{
|
|
||||||
{ eEquipmentParts.Weapon, false }, { eEquipmentParts.SubWeapon, false }, { eEquipmentParts.ArmorTop, false },
|
|
||||||
{ eEquipmentParts.ArmorBottom, false }, { eEquipmentParts.Gloves, false }, { eEquipmentParts.Shoes, false },
|
|
||||||
{ eEquipmentParts.Ring, false }, { eEquipmentParts.Necklace, false }
|
|
||||||
};
|
|
||||||
public int Get_ObtainSetItemCount(int setid)
|
|
||||||
{
|
|
||||||
var keys = dic_SetCheck.Keys.ToList();
|
|
||||||
for (int i = 0; i < keys.Count; i++)
|
|
||||||
dic_SetCheck[keys[i]] = false;
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
for (int i = 0; i < Equipment.list_item.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = Equipment.list_item[i];
|
|
||||||
var tdata = table_EquipmentList.Ins.Get_Data(temp.TableID);
|
|
||||||
if (tdata.n_SetGroupID == setid && !dic_SetCheck[tdata.e_EquipmentType])
|
|
||||||
{
|
|
||||||
dic_SetCheck[tdata.e_EquipmentType] = true;
|
|
||||||
++count;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
public SetEquipmentData Get_EquipSetItemData(int pcid)
|
|
||||||
{
|
|
||||||
if (!IsObtainPC(pcid)) return null;
|
|
||||||
|
|
||||||
SetEquipmentData data = new SetEquipmentData();
|
|
||||||
Dictionary<int, int> dic_SetCount = new Dictionary<int, int>();
|
|
||||||
|
|
||||||
// 1. Count equipped items per set
|
|
||||||
for (int i = 0; i < dic_PC[pcid].list_equipitems.Count; i++)
|
|
||||||
{
|
|
||||||
var equipid = dic_PC[pcid].list_equipitems[i];
|
|
||||||
if (equipid == 0) continue;
|
|
||||||
|
|
||||||
var itemdata = Equipment.list_item.Find(f => f.ID == equipid);
|
|
||||||
var equipdata = table_EquipmentList.Ins.Get_Data(itemdata.TableID);
|
|
||||||
|
|
||||||
if (equipdata.n_SetGroupID > 0)
|
|
||||||
{
|
|
||||||
if (dic_SetCount.ContainsKey(equipdata.n_SetGroupID))
|
|
||||||
++dic_SetCount[equipdata.n_SetGroupID];
|
|
||||||
else
|
|
||||||
dic_SetCount.Add(equipdata.n_SetGroupID, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. Aggregate Set Bonuses
|
|
||||||
foreach (var item in dic_SetCount)
|
|
||||||
{
|
|
||||||
var setdata = table_EquipmentSetOption.Ins.Get_Data(item.Key);
|
|
||||||
if (setdata != null) data.Add(setdata, item.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Item
|
|
||||||
public bool Check_EnoughItem(int id, int amount, bool showtoast_ifnotenough = true)
|
|
||||||
{
|
|
||||||
if (Get_ItemAmount(id) >= amount) return true;
|
|
||||||
if (showtoast_ifnotenough) ToastUI.Ins.Set(126);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public int Get_ItemAmount(int id) { return dic_Item.ContainsKey(id) ? dic_Item[id].Amount : 0; }
|
|
||||||
public void Add_Item(int id, int amount)
|
|
||||||
{
|
|
||||||
var itemdata = table_ItemList.Ins.Get_Data_orNull(id);
|
|
||||||
if (itemdata != null)
|
|
||||||
{
|
|
||||||
switch (itemdata.e_ItemType)
|
|
||||||
{
|
|
||||||
case eItem.Goods:
|
|
||||||
if (!dic_Item.ContainsKey(id)) dic_Item.Add(id, new SD_Money());
|
|
||||||
dic_Item[id].Amount += amount;
|
|
||||||
LobbyTopUI.Ins.Set();
|
|
||||||
break;
|
|
||||||
case eItem.PC: Add_PC(id); break;
|
|
||||||
case eItem.Seal: for (int i = 0; i < amount; i++) Add_Seal(id); break;
|
|
||||||
case eItem.Equipment: for (int i = 0; i < amount; i++) Add_Equipment(id); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
ServerInfo.Ins.Save();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ToastUI.Ins.Set($"ItemList 테이블에 없는 아이템이어서 추가할 수 없습니다.\n{id}");
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Card
|
|
||||||
public void Add_Card(int cardid)
|
|
||||||
{
|
|
||||||
if (!dic_Card.ContainsKey(cardid))
|
|
||||||
dic_Card.Add(cardid, new SD_Card());
|
|
||||||
++dic_Card[cardid].Amount;
|
|
||||||
}
|
|
||||||
public bool IsGetAllCard()
|
|
||||||
{
|
|
||||||
var lst = table_cardlist.Ins.Get_DataList();
|
|
||||||
for (int i = 0; i < lst.Count; i++)
|
|
||||||
{
|
|
||||||
if (!dic_Card.ContainsKey(lst[i].n_ID))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public bool IsReinforceAllCard(int star)
|
|
||||||
{
|
|
||||||
var lst = table_cardlist.Ins.Get_DataList();
|
|
||||||
for (int i = 0; i < lst.Count; i++)
|
|
||||||
{
|
|
||||||
if (!dic_Card.ContainsKey(lst[i].n_ID))
|
|
||||||
return false;
|
|
||||||
if (dic_Card[lst[i].n_ID].Lv < star)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,11 +68,11 @@ public class ServerInfo : MyCoroutine
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (InGameInfo.Ins != null)
|
//if (InGameInfo.Ins != null)
|
||||||
{
|
//{
|
||||||
//OffLineReward.m_Sec = (int)(ServerTime - AppPauseTime).TotalSeconds;
|
// //OffLineReward.m_Sec = (int)(ServerTime - AppPauseTime).TotalSeconds;
|
||||||
// TODO 정인호 : 오프라인 보상 서버 통신 필요?
|
// // TODO 정인호 : 오프라인 보상 서버 통신 필요?
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class ApprearMonsterPatternTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public int n_AppearMonserGroup;
|
|
||||||
public int n_MonsterID;
|
|
||||||
public int n_AppearRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_ApprearMonsterPattern : table_base
|
|
||||||
{
|
|
||||||
public static table_ApprearMonsterPattern Ins;
|
|
||||||
|
|
||||||
List<ApprearMonsterPatternTableData> tableDatas;
|
|
||||||
// 그룹, 몹아이디 리스트
|
|
||||||
Dictionary<int, List<int>> dic_mobids = new Dictionary<int, List<int>>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<ApprearMonsterPatternTableData>>(json_last);
|
|
||||||
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
if (!dic_mobids.ContainsKey(tableDatas[i].n_AppearMonserGroup))
|
|
||||||
dic_mobids.Add(tableDatas[i].n_AppearMonserGroup, new List<int>());
|
|
||||||
dic_mobids[tableDatas[i].n_AppearMonserGroup].Add(tableDatas[i].n_MonsterID);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ApprearMonsterPatternTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public List<ApprearMonsterPatternTableData> Get_DataList(int group) { return tableDatas.FindAll(x => x.n_AppearMonserGroup == group); }
|
|
||||||
public ApprearMonsterPatternTableData Get_Data(int group)
|
|
||||||
{
|
|
||||||
var list = tableDatas.FindAll(x => x.n_AppearMonserGroup == group);
|
|
||||||
return DSUtil.WeightedPick(list, x => x.n_AppearRate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: c01deb31620b85949abb9f3bd7b1a3fd
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class BattleLevelUpTableData
|
|
||||||
{
|
|
||||||
ObscuredInt _Lv;
|
|
||||||
public int n_Lv
|
|
||||||
{
|
|
||||||
get { return _Lv; }
|
|
||||||
set { _Lv = value; _Lv.RandomizeCryptoKey(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
ObscuredInt _NextRequireExp;
|
|
||||||
public int n_NextRequireExp
|
|
||||||
{
|
|
||||||
get { return _NextRequireExp; }
|
|
||||||
set { _NextRequireExp = value; _NextRequireExp.RandomizeCryptoKey(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
ObscuredInt _TotalExp;
|
|
||||||
public int n_TotalExp
|
|
||||||
{
|
|
||||||
get { return _TotalExp; }
|
|
||||||
set { _TotalExp = value; _TotalExp.RandomizeCryptoKey(); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_BattleLevelUp : table_base
|
|
||||||
{
|
|
||||||
public static table_BattleLevelUp Ins;
|
|
||||||
|
|
||||||
List<BattleLevelUpTableData> tableDatas;
|
|
||||||
Dictionary<int, BattleLevelUpTableData> dic_data = new Dictionary<int, BattleLevelUpTableData>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<BattleLevelUpTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
dic_data.Add(tableDatas[i].n_Lv, tableDatas[i]);
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<BattleLevelUpTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public BattleLevelUpTableData Get_Data_orNull(int id) { return dic_data.ContainsKey(id) ? dic_data[id] : null; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 24e0dbc66470c594888087aec184a908
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class BuffPatternConfigTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public string s_BuffType;
|
|
||||||
public bool b_MaintainBuff;
|
|
||||||
public int n_AppearRate;
|
|
||||||
public int n_BuffDesc;
|
|
||||||
public int n_BuffOptionID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_BuffPatternConfig : table_base
|
|
||||||
{
|
|
||||||
public static table_BuffPatternConfig Ins;
|
|
||||||
|
|
||||||
List<BuffPatternConfigTableData> tableDatas;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<BuffPatternConfigTableData>>(json_last);
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<BuffPatternConfigTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public BuffPatternConfigTableData Get_Data(int optionid) { return tableDatas.Find(f=>f.n_BuffOptionID == optionid); }
|
|
||||||
public BuffPatternConfigTableData Get_RandomData() { return DSUtil.WeightedPick(tableDatas, x => x.n_AppearRate); }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 635d99d1796d9dc48ad927057b60d144
|
|
||||||
|
|
@ -1,170 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using Random = UnityEngine.Random;
|
|
||||||
|
|
||||||
public class CreateMapConfigTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public string s_MapConfigID;
|
|
||||||
public int n_StageType;
|
|
||||||
public int n_AppearMonsterGroup;
|
|
||||||
public int n_AppearBossGroup;
|
|
||||||
|
|
||||||
public float f_Monster;
|
|
||||||
public int n_MobNodeMin;
|
|
||||||
public int n_MobNodeMax;
|
|
||||||
|
|
||||||
public float f_BuffDebuff;
|
|
||||||
public int n_BuffDebuffMin;
|
|
||||||
public int n_BuffDebuffMax;
|
|
||||||
|
|
||||||
public float f_CampFire;
|
|
||||||
public int n_CampMin;
|
|
||||||
public int n_CampMax;
|
|
||||||
|
|
||||||
public float f_Merchant;
|
|
||||||
public int n_MerchantMin;
|
|
||||||
public int n_MerchantMax;
|
|
||||||
|
|
||||||
public float f_Treasure;
|
|
||||||
public int n_TreasureMin;
|
|
||||||
public int n_TreasureMax;
|
|
||||||
|
|
||||||
public float f_NPC;
|
|
||||||
public int n_NPCMin;
|
|
||||||
public int n_NPCMax;
|
|
||||||
|
|
||||||
public float f_Mine;
|
|
||||||
public int n_MineMin;
|
|
||||||
public int n_MineMax;
|
|
||||||
|
|
||||||
public float f_TwoWay;
|
|
||||||
public int n_TwoWayMin;
|
|
||||||
public int n_TwoWayMax;
|
|
||||||
|
|
||||||
public float f_Nothing;
|
|
||||||
public int n_NothingMin;
|
|
||||||
public int n_NothingMax;
|
|
||||||
|
|
||||||
public float f_Random;
|
|
||||||
public int n_RandomMin;
|
|
||||||
public int n_RandomMax;
|
|
||||||
|
|
||||||
public Dictionary<eStageNodeType, float> dic_Rate = new Dictionary<eStageNodeType, float>();
|
|
||||||
public List<float> list_rate = new List<float>(); // 랜덤 인덱스 선택에 필요
|
|
||||||
public int TotalMin, TotalMax;
|
|
||||||
|
|
||||||
public int Get_Min(eStageNodeType nodeType)
|
|
||||||
{
|
|
||||||
switch (nodeType)
|
|
||||||
{
|
|
||||||
case eStageNodeType.Mob: return n_MobNodeMin;
|
|
||||||
case eStageNodeType.Treasure: return n_TreasureMin;
|
|
||||||
case eStageNodeType.Merchant: return n_MerchantMin;
|
|
||||||
case eStageNodeType.NPC: return n_NPCMin;
|
|
||||||
case eStageNodeType.Sanctuary: return n_MineMin;
|
|
||||||
case eStageNodeType.BuffDebuff: return n_BuffDebuffMin;
|
|
||||||
case eStageNodeType.TwoWay: return n_TwoWayMin;
|
|
||||||
case eStageNodeType.Campfire: return n_CampMin;
|
|
||||||
case eStageNodeType.Nothing: return n_NothingMin;
|
|
||||||
case eStageNodeType.Random: return n_RandomMin;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
public int Get_Max(eStageNodeType nodeType)
|
|
||||||
{
|
|
||||||
switch (nodeType)
|
|
||||||
{
|
|
||||||
case eStageNodeType.Mob: return n_MobNodeMax;
|
|
||||||
case eStageNodeType.Treasure: return n_TreasureMax;
|
|
||||||
case eStageNodeType.Merchant: return n_MerchantMax;
|
|
||||||
case eStageNodeType.NPC: return n_NPCMax;
|
|
||||||
case eStageNodeType.Sanctuary: return n_MineMax;
|
|
||||||
case eStageNodeType.BuffDebuff: return n_BuffDebuffMax;
|
|
||||||
case eStageNodeType.TwoWay: return n_TwoWayMax;
|
|
||||||
case eStageNodeType.Campfire: return n_CampMax;
|
|
||||||
case eStageNodeType.Nothing: return n_NothingMax;
|
|
||||||
case eStageNodeType.Random: return n_RandomMax;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
public int Get_NodeCount_byMinMax(eStageNodeType nodeType) { return Random.Range(Get_Min(nodeType), Get_Max(nodeType) + 1); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_CreateMapConfig : table_base
|
|
||||||
{
|
|
||||||
public static table_CreateMapConfig Ins;
|
|
||||||
|
|
||||||
List<CreateMapConfigTableData> tableDatas;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<CreateMapConfigTableData>>(json_last);
|
|
||||||
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Mob, temp.f_Monster * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Treasure, temp.f_Treasure * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Merchant, temp.f_Merchant * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.NPC, temp.f_NPC * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Sanctuary, temp.f_Mine * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.BuffDebuff, temp.f_BuffDebuff * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.TwoWay, temp.f_TwoWay * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Campfire, temp.f_CampFire * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Nothing, temp.f_Nothing * 0.01f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Boss, 0f);
|
|
||||||
temp.dic_Rate.Add(eStageNodeType.Random, temp.f_Random * 0.01f);
|
|
||||||
|
|
||||||
temp.list_rate.Add(temp.f_Monster * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_Treasure * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_Merchant * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_NPC * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_Mine * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_BuffDebuff * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_TwoWay * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_CampFire * 0.01f);
|
|
||||||
temp.list_rate.Add(temp.f_Nothing * 0.01f);
|
|
||||||
temp.list_rate.Add(0f);
|
|
||||||
temp.list_rate.Add(temp.f_Random * 0.01f);
|
|
||||||
|
|
||||||
temp.TotalMin = temp.n_MobNodeMin
|
|
||||||
+ temp.n_BuffDebuffMin
|
|
||||||
+ temp.n_CampMin
|
|
||||||
+ temp.n_MerchantMin
|
|
||||||
+ temp.n_TreasureMin
|
|
||||||
+ temp.n_NPCMin
|
|
||||||
+ temp.n_MineMin
|
|
||||||
+ temp.n_TwoWayMin
|
|
||||||
+ temp.n_NothingMin
|
|
||||||
+ temp.n_RandomMin;
|
|
||||||
|
|
||||||
temp.TotalMax = temp.n_MobNodeMax
|
|
||||||
+ temp.n_BuffDebuffMax
|
|
||||||
+ temp.n_CampMax
|
|
||||||
+ temp.n_MerchantMax
|
|
||||||
+ temp.n_TreasureMax
|
|
||||||
+ temp.n_NPCMax
|
|
||||||
+ temp.n_MineMax
|
|
||||||
+ temp.n_TwoWayMax
|
|
||||||
+ temp.n_NothingMax
|
|
||||||
+ temp.n_RandomMax;
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<CreateMapConfigTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public CreateMapConfigTableData Get_Data(string id) { return Get_DataList().Find(f => f.s_MapConfigID == id); }
|
|
||||||
public CreateMapConfigTableData Get_FisrtData(int world, int stage)
|
|
||||||
{
|
|
||||||
var lst = tableDatas.FindAll(f => f.n_StageType == world);
|
|
||||||
return lst[lst.Count >= stage ? stage - 1 : 0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 9c223f6b12e525844a537b05c2b88dcd
|
|
||||||
|
|
@ -1,208 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public enum eEquipmentParts { Weapon, SubWeapon, ArmorTop, ArmorBottom, Gloves, Shoes, Ring, Necklace }
|
|
||||||
public enum eEquipmentStat { Main1, Main2, Sub1, Sub2, Sub3, Sub4 }
|
|
||||||
public enum EquipResult
|
|
||||||
{
|
|
||||||
CanEquip = 0, // 아무도 안 쓰고 있음
|
|
||||||
EquippedByOther = 1, // 다른 캐릭터가 사용 중
|
|
||||||
EquippedByMe = -1, // 내가 이미 장착 중
|
|
||||||
NotEnoughEvolution = -2, // 캐릭터 진화 부족
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class EquipmentListTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public eEquipmentParts e_EquipmentType;
|
|
||||||
ObscuredInt _ID; public int n_ID { get { return _ID; } set { _ID = value; _ID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _Grade; public int n_Grade { get { return _Grade; } set { _Grade = value; _Grade.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SetGroupID; public int n_SetGroupID { get { return _SetGroupID; } set { _SetGroupID = value; _SetGroupID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SubOptionCount; public int n_SubOptionCount { get { return _SubOptionCount; } set { _SubOptionCount = value; _SubOptionCount.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _MainOtion; public int n_MainOtion { get { return _MainOtion; } set { _MainOtion = value; _MainOtion.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SubOtion1; public int n_SubOtion1 { get { return _SubOtion1; } set { _SubOtion1 = value; _SubOtion1.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SubOtion2; public int n_SubOtion2 { get { return _SubOtion2; } set { _SubOtion2 = value; _SubOtion2.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SubOtion3; public int n_SubOtion3 { get { return _SubOtion3; } set { _SubOtion3 = value; _SubOtion3.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SubOtion4; public int n_SubOtion4 { get { return _SubOtion4; } set { _SubOtion4 = value; _SubOtion4.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
public override string Get_Name() { return table_ItemList.Ins.Get_Data_orNull(n_ID).Get_Name(); }
|
|
||||||
public eStat Get_eStat(eEquipmentStat whatstat)
|
|
||||||
{
|
|
||||||
switch (whatstat)
|
|
||||||
{
|
|
||||||
case eEquipmentStat.Main1: return table_StatusOptionSet.Ins.Get_Data(n_MainOtion).e_Stat1;
|
|
||||||
case eEquipmentStat.Main2: return table_StatusOptionSet.Ins.Get_Data(n_MainOtion).e_Stat1;
|
|
||||||
case eEquipmentStat.Sub1: return n_SubOtion1 > 0 ? table_StatusOptionSet.Ins.Get_Data(n_SubOtion1).e_Stat1 : eStat.None;
|
|
||||||
case eEquipmentStat.Sub2: return n_SubOtion2 > 0 ? table_StatusOptionSet.Ins.Get_Data(n_SubOtion2).e_Stat1 : eStat.None;
|
|
||||||
case eEquipmentStat.Sub3: return n_SubOtion3 > 0 ? table_StatusOptionSet.Ins.Get_Data(n_SubOtion3).e_Stat1 : eStat.None;
|
|
||||||
case eEquipmentStat.Sub4: return n_SubOtion4 > 0 ? table_StatusOptionSet.Ins.Get_Data(n_SubOtion4).e_Stat1 : eStat.None;
|
|
||||||
}
|
|
||||||
return eStat.None;
|
|
||||||
}
|
|
||||||
public float Get_Value(eEquipmentStat whatstat, int pcid, int lv = 0)
|
|
||||||
{
|
|
||||||
var upgradeData = table_EquipmentUpgrade.Ins.Get_Data(n_Grade);
|
|
||||||
|
|
||||||
switch (whatstat)
|
|
||||||
{
|
|
||||||
case eEquipmentStat.Main1:
|
|
||||||
{
|
|
||||||
var setData = MyValue.sdata.Get_EquipSetItemData(pcid);
|
|
||||||
int setMul = setData.m_SetGroupID == n_SetGroupID ? setData.m_MainValue : 0;
|
|
||||||
return table_StatusOptionSet.Ins.Get_Data(n_MainOtion).Get_StatValue1(lv,
|
|
||||||
upgradeData.n_UpgradeMainStat_Mul + setMul);
|
|
||||||
}
|
|
||||||
case eEquipmentStat.Main2:
|
|
||||||
{
|
|
||||||
var setData = MyValue.sdata.Get_EquipSetItemData(pcid);
|
|
||||||
int setMul = setData.m_SetGroupID == n_SetGroupID ? setData.m_MainValue : 0;
|
|
||||||
return table_StatusOptionSet.Ins.Get_Data(n_MainOtion).Get_StatValue2(lv,
|
|
||||||
upgradeData.n_UpgradeMainStat_Mul + setMul);
|
|
||||||
}
|
|
||||||
case eEquipmentStat.Sub1: return n_SubOtion1 > 0 ?
|
|
||||||
table_StatusOptionSet.Ins.Get_Data(n_SubOtion1).Get_StatValue1(lv, upgradeData.n_UpgradeSubStat_Mul) : 0f;
|
|
||||||
case eEquipmentStat.Sub2: return n_SubOtion2 > 0 ?
|
|
||||||
table_StatusOptionSet.Ins.Get_Data(n_SubOtion2).Get_StatValue1(lv, upgradeData.n_UpgradeSubStat_Mul) : 0f;
|
|
||||||
case eEquipmentStat.Sub3: return n_SubOtion3 > 0 ?
|
|
||||||
table_StatusOptionSet.Ins.Get_Data(n_SubOtion3).Get_StatValue1(lv, upgradeData.n_UpgradeSubStat_Mul) : 0f;
|
|
||||||
case eEquipmentStat.Sub4: return n_SubOtion4 > 0 ?
|
|
||||||
table_StatusOptionSet.Ins.Get_Data(n_SubOtion4).Get_StatValue1(lv, upgradeData.n_UpgradeSubStat_Mul) : 0f;
|
|
||||||
}
|
|
||||||
return 0f;
|
|
||||||
}
|
|
||||||
public float Get_DifferentValue(eEquipmentStat whatstat, int lv)
|
|
||||||
{
|
|
||||||
if (lv <= 0)
|
|
||||||
return 0f;
|
|
||||||
|
|
||||||
var upgradeData = table_EquipmentUpgrade.Ins.Get_Data(n_Grade);
|
|
||||||
|
|
||||||
float GetDiff(int optionId, Func<StatusOptionSetTableData, int, float> getter)
|
|
||||||
{
|
|
||||||
if (optionId <= 0) return 0f;
|
|
||||||
|
|
||||||
var data = table_StatusOptionSet.Ins.Get_Data(optionId);
|
|
||||||
return getter(data, lv) - getter(data, lv - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (whatstat)
|
|
||||||
{
|
|
||||||
case eEquipmentStat.Main1:
|
|
||||||
return GetDiff(n_MainOtion, (d, l) => d.Get_StatValue1(l, upgradeData.n_UpgradeMainStat_Mul));
|
|
||||||
|
|
||||||
case eEquipmentStat.Main2:
|
|
||||||
return GetDiff(n_MainOtion, (d, l) => d.Get_StatValue2(l, upgradeData.n_UpgradeMainStat_Mul));
|
|
||||||
|
|
||||||
case eEquipmentStat.Sub1:
|
|
||||||
return GetDiff(n_SubOtion1, (d, l) => d.Get_StatValue1(l, upgradeData.n_UpgradeSubStat_Mul));
|
|
||||||
|
|
||||||
case eEquipmentStat.Sub2:
|
|
||||||
return GetDiff(n_SubOtion2, (d, l) => d.Get_StatValue1(l, upgradeData.n_UpgradeSubStat_Mul));
|
|
||||||
|
|
||||||
case eEquipmentStat.Sub3:
|
|
||||||
return GetDiff(n_SubOtion3, (d, l) => d.Get_StatValue1(l, upgradeData.n_UpgradeSubStat_Mul));
|
|
||||||
|
|
||||||
case eEquipmentStat.Sub4:
|
|
||||||
return GetDiff(n_SubOtion4, (d, l) => d.Get_StatValue1(l, upgradeData.n_UpgradeSubStat_Mul));
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0f;
|
|
||||||
}
|
|
||||||
public string Get_Desc_Main(int pcid, int lv)
|
|
||||||
{
|
|
||||||
var equiptype = table_localtext.Ins.Get_Text(1001001 + (int)e_EquipmentType);
|
|
||||||
var stattitle = "";
|
|
||||||
if (e_EquipmentType == eEquipmentParts.Weapon)
|
|
||||||
{
|
|
||||||
stattitle = MyText.Get_StatName(eStat.Attack);
|
|
||||||
var val1 = MyText.Get_StatValueText(Get_eStat(eEquipmentStat.Main1), Get_Value(eEquipmentStat.Main1, pcid, lv), true);
|
|
||||||
var val2 = MyText.Get_StatValueText(Get_eStat(eEquipmentStat.Main2), Get_Value(eEquipmentStat.Main2, pcid,lv), true);
|
|
||||||
return $"{equiptype}\n{stattitle}\n<size=50><color=#fffc00>{val1}~{val2}";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var sosdata = table_StatusOptionSet.Ins.Get_Data(n_MainOtion);
|
|
||||||
stattitle = MyText.Get_StatName(sosdata.e_Stat1);
|
|
||||||
var val1 = MyText.Get_StatValueText(sosdata.e_Stat1, Get_Value(eEquipmentStat.Main1, pcid,lv), true);
|
|
||||||
return $"{equiptype}\n{stattitle}\n<size=50><color=#fffc00>{val1}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string Get_Desc_SubOptions(int lv)
|
|
||||||
{
|
|
||||||
var lines = new List<string>();
|
|
||||||
|
|
||||||
AddOptionLines(lines, n_SubOtion1, lv);
|
|
||||||
AddOptionLines(lines, n_SubOtion2, lv);
|
|
||||||
AddOptionLines(lines, n_SubOtion3, lv);
|
|
||||||
AddOptionLines(lines, n_SubOtion4, lv);
|
|
||||||
|
|
||||||
return string.Join("\n", lines);
|
|
||||||
}
|
|
||||||
void AddOptionLines(List<string> lines, int optionId, int lv)
|
|
||||||
{
|
|
||||||
if (optionId <= 0) return;
|
|
||||||
|
|
||||||
var text = Get_OptionText(optionId, lv);
|
|
||||||
if (string.IsNullOrEmpty(text)) return;
|
|
||||||
|
|
||||||
// 옵션 내부 줄들을 그대로 펼쳐서 추가
|
|
||||||
lines.AddRange(text.Split('\n'));
|
|
||||||
}
|
|
||||||
string Get_OptionText(int optionid, int lv)
|
|
||||||
{
|
|
||||||
if (optionid <= 0) return string.Empty;
|
|
||||||
var upgradeData = table_EquipmentUpgrade.Ins.Get_Data(n_Grade);
|
|
||||||
|
|
||||||
var tdata = table_StatusOptionSet.Ins.Get_Data(optionid);
|
|
||||||
var optionLines = new List<string>();
|
|
||||||
|
|
||||||
if (tdata.e_Stat1 < eStat.Max)
|
|
||||||
optionLines.Add(MyText.Get_StatNameValueText(tdata.e_Stat1, tdata.Get_StatValue1(lv, upgradeData.n_UpgradeSubStat_Mul), true));
|
|
||||||
|
|
||||||
if (tdata.e_Stat2 < eStat.Max)
|
|
||||||
optionLines.Add(MyText.Get_StatNameValueText(tdata.e_Stat2, tdata.Get_StatValue2(lv, upgradeData.n_UpgradeSubStat_Mul), true));
|
|
||||||
|
|
||||||
return string.Join("\n", optionLines);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_EquipmentList : table_base
|
|
||||||
{
|
|
||||||
public static table_EquipmentList Ins;
|
|
||||||
|
|
||||||
List<EquipmentListTableData> tableDatas;
|
|
||||||
Dictionary<int, EquipmentListTableData> dic_Data = new Dictionary<int, EquipmentListTableData>();
|
|
||||||
Dictionary<int, List<EquipmentListTableData>> dic_SetDatas = new Dictionary<int, List<EquipmentListTableData>>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<EquipmentListTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
|
|
||||||
dic_Data.Add(temp.n_ID, temp);
|
|
||||||
|
|
||||||
if (temp.n_SetGroupID > 0)
|
|
||||||
{
|
|
||||||
if (!dic_SetDatas.ContainsKey(temp.n_SetGroupID))
|
|
||||||
dic_SetDatas.Add(temp.n_SetGroupID, new List<EquipmentListTableData>());
|
|
||||||
dic_SetDatas[temp.n_SetGroupID].Add(temp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EquipmentListTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public EquipmentListTableData Get_Data(int id) { return dic_Data[id]; }
|
|
||||||
public List<EquipmentListTableData> Get_SetDataList(int setid) { return dic_SetDatas[setid]; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: ae1843545b08a9b40a03c60983af35be
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class EquipmentSetOptionTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public eStat e_SetStat1, e_SetStat2, e_SetStat3;
|
|
||||||
public string s_SetStatValue1, s_SetStatValue2, s_SetStatValue3;
|
|
||||||
public int n_SetName;
|
|
||||||
ObscuredInt _SetId; public int n_SetId { get { return _SetId; } set { _SetId = value; _SetId.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SetCondition1; public int n_SetCondition1 { get { return _SetCondition1; } set { _SetCondition1 = value; _SetCondition1.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _Set1CardSkill; public int n_Set1CardSkill { get { return _Set1CardSkill; } set { _Set1CardSkill = value; _Set1CardSkill.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SetCondition2; public int n_SetCondition2 { get { return _SetCondition2; } set { _SetCondition2 = value; _SetCondition2.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _Set2CardSkill; public int n_Set2CardSkill { get { return _Set2CardSkill; } set { _Set2CardSkill = value; _Set2CardSkill.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _SetCondition3; public int n_SetCondition3 { get { return _SetCondition3; } set { _SetCondition3 = value; _SetCondition3.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _Set3CardSkill; public int n_Set3CardSkill { get { return _Set3CardSkill; } set { _Set3CardSkill = value; _Set3CardSkill.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _IncreaseMainStatSet2_Mul; public int n_IncreaseMainStatSet2_Mul { get { return _IncreaseMainStatSet2_Mul; } set { _IncreaseMainStatSet2_Mul = value; _IncreaseMainStatSet2_Mul.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _IncreaseMainStatSet3_Mul; public int n_IncreaseMainStatSet3_Mul { get { return _IncreaseMainStatSet3_Mul; } set { _IncreaseMainStatSet3_Mul = value; _IncreaseMainStatSet3_Mul.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _IncreaseMainStatSet4_Mul; public int n_IncreaseMainStatSet4_Mul { get { return _IncreaseMainStatSet4_Mul; } set { _IncreaseMainStatSet4_Mul = value; _IncreaseMainStatSet4_Mul.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _IncreaseMainStatSet5_Mul; public int n_IncreaseMainStatSet5_Mul { get { return _IncreaseMainStatSet5_Mul; } set { _IncreaseMainStatSet5_Mul = value; _IncreaseMainStatSet5_Mul.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _IncreaseMainStatSet6_Mul; public int n_IncreaseMainStatSet6_Mul { get { return _IncreaseMainStatSet6_Mul; } set { _IncreaseMainStatSet6_Mul = value; _IncreaseMainStatSet6_Mul.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
ObscuredFloat _SetStatValue1; public float f_SetStatValue1 { get { return _SetStatValue1; } set { _SetStatValue1 = value; _SetStatValue1.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredFloat _SubStatValue2; public float f_SetStatValue2 { get { return _SubStatValue2; } set { _SubStatValue2 = value; _SubStatValue2.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredFloat _SubStatValue3; public float f_SetStatValue3 { get { return _SubStatValue3; } set { _SubStatValue3 = value; _SubStatValue3.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
public string Get_SetName() { return table_localtext.Ins.Get_Text(n_SetName); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_EquipmentSetOption : table_base
|
|
||||||
{
|
|
||||||
public static table_EquipmentSetOption Ins;
|
|
||||||
|
|
||||||
List<EquipmentSetOptionTableData> tableDatas;
|
|
||||||
Dictionary<int, EquipmentSetOptionTableData> dic_Data = new Dictionary<int, EquipmentSetOptionTableData>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<EquipmentSetOptionTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
temp.f_SetStatValue1 = Get_Value(temp.s_SetStatValue1);
|
|
||||||
temp.f_SetStatValue2 = Get_Value(temp.s_SetStatValue2);
|
|
||||||
temp.f_SetStatValue3 = Get_Value(temp.s_SetStatValue3);
|
|
||||||
dic_Data.Add(temp.n_SetId, temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EquipmentSetOptionTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public EquipmentSetOptionTableData Get_Data(int id) { return dic_Data[id]; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 879d05ff12bd9484c9252b79c629772e
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class EquipmentUpgradeTableData : TableDataBase
|
|
||||||
{
|
|
||||||
ObscuredInt _EquipGrade; public int n_EquipGrade { get { return _EquipGrade; } set { _EquipGrade = value; _EquipGrade.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _MaxLv; public int n_MaxLv { get { return _MaxLv; } set { _MaxLv = value; _MaxLv.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UpgradeGoodsID; public int n_UpgradeGoodsID { get { return _UpgradeGoodsID; } set { _UpgradeGoodsID = value; _UpgradeGoodsID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UpgradeDefaultPrice; public int n_UpgradeDefaultPrice { get { return _UpgradeDefaultPrice; } set { _UpgradeDefaultPrice = value; _UpgradeDefaultPrice.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UpgradeIncreasePrice; public int n_UpgradeIncreasePrice { get { return _UpgradeIncreasePrice; } set { _UpgradeIncreasePrice = value; _UpgradeIncreasePrice.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UpgradeMainStat_Mul; public int n_UpgradeMainStat_Mul { get { return _UpgradeMainStat_Mul; } set { _UpgradeMainStat_Mul = value; _UpgradeMainStat_Mul.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _UpgradeSubStat_Mul; public int n_UpgradeSubStat_Mul { get { return _UpgradeSubStat_Mul; } set { _UpgradeSubStat_Mul = value; _UpgradeSubStat_Mul.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
public int Get_UpgradePrice(int lv) { return n_UpgradeDefaultPrice + (n_UpgradeIncreasePrice * lv); }
|
|
||||||
public int Get_UpgradeAffordablePrice(int lv, int maxlv, out ObscuredInt uplv)
|
|
||||||
{
|
|
||||||
int curMoney = MyValue.sdata.Get_ItemAmount(n_UpgradeGoodsID);
|
|
||||||
int total = 0;
|
|
||||||
uplv = 0;
|
|
||||||
|
|
||||||
for (int i = lv; i < maxlv; i++)
|
|
||||||
{
|
|
||||||
int price = Get_UpgradePrice(i);
|
|
||||||
if (total + price > curMoney)
|
|
||||||
break;
|
|
||||||
|
|
||||||
++uplv; uplv.RandomizeCryptoKey();
|
|
||||||
total += price;
|
|
||||||
}
|
|
||||||
|
|
||||||
return total;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_EquipmentUpgrade : table_base
|
|
||||||
{
|
|
||||||
public static table_EquipmentUpgrade Ins;
|
|
||||||
|
|
||||||
List<EquipmentUpgradeTableData> tableDatas;
|
|
||||||
Dictionary<int, EquipmentUpgradeTableData> dic_Data = new Dictionary<int, EquipmentUpgradeTableData>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<EquipmentUpgradeTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
|
|
||||||
dic_Data.Add(temp.n_EquipGrade, temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EquipmentUpgradeTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public EquipmentUpgradeTableData Get_Data(int grade) { return dic_Data[grade]; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 005d88a9db7b0ec44a79ab62326f145b
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
[Serializable]
|
|
||||||
public class GlobalValueData
|
|
||||||
{
|
|
||||||
public string s_ID;
|
|
||||||
public float n_Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_GlobalValue : table_base
|
|
||||||
{
|
|
||||||
public static table_GlobalValue Ins;
|
|
||||||
List<GlobalValueData> m_GlobalValueData;
|
|
||||||
Dictionary<string, float> dic_Data = new Dictionary<string, float>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
base.Awake();
|
|
||||||
Ins = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
m_GlobalValueData = JsonConvert.DeserializeObject<List<GlobalValueData>>(json_last);
|
|
||||||
for (int i = 0; i < m_GlobalValueData.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = m_GlobalValueData[i];
|
|
||||||
dic_Data.Add(temp.s_ID, temp.n_Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Get_Int(string id) { return (int)dic_Data[id]; }
|
|
||||||
public float Get_Float(string id) { return dic_Data[id];}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 198199bffee806b44a5be3a96ad3c719
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public enum eItem { Goods, PC, Seal, Equipment }
|
|
||||||
|
|
||||||
public class ItemListTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public eItem e_ItemType;
|
|
||||||
ObscuredInt _ItemID; public int n_ItemID { get { return _ItemID; } set { _ItemID = value; _ItemID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _BuyItemID; public int n_BuyItemID { get { return _BuyItemID; } set { _BuyItemID = value; _BuyItemID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _BuyPrice; public int n_BuyPrice { get { return _BuyPrice; } set { _BuyPrice = value; _BuyPrice.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
public int n_ItemGrade, n_ItemName, n_ItemDesc, n_ItemOrder;
|
|
||||||
public string s_ItemIcon;
|
|
||||||
|
|
||||||
public override string Get_Name() { return table_localtext.Ins.Get_Text(n_ItemName); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_ItemList : table_base
|
|
||||||
{
|
|
||||||
public static table_ItemList Ins;
|
|
||||||
|
|
||||||
List<ItemListTableData> tableDatas;
|
|
||||||
Dictionary<int, ItemListTableData> dic_Data = new Dictionary<int, ItemListTableData>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<ItemListTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
dic_Data.Add(temp.n_ItemID, temp);
|
|
||||||
}
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ItemListTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public ItemListTableData Get_Data_orNull(int id) { return dic_Data.ContainsKey(id) ? dic_Data[id] : null; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 14ef3db7a3eee7e42a93144a91bbb9a0
|
|
||||||
|
|
@ -1,80 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class MerchantConfigTableData : TableDataBase
|
|
||||||
{
|
|
||||||
ObscuredInt _MerchantID; public int n_MerchantID { get { return _MerchantID; } set { _MerchantID = value; _MerchantID.RandomizeCryptoKey(); } }
|
|
||||||
public int n_MerchantGrade;
|
|
||||||
public string s_MerchantImg;
|
|
||||||
public int n_AppearRate;
|
|
||||||
public int n_BattleMonsterID;
|
|
||||||
ObscuredInt _ProductRandomBagID; public int n_ProductRandomBagID { get { return _ProductRandomBagID; } set { _ProductRandomBagID = value; _ProductRandomBagID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredFloat _MerchantSaleMin; public float f_MerchantSaleMin { get { return _MerchantSaleMin; } set { _MerchantSaleMin = value; _MerchantSaleMin.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredFloat _MerchantSaleMax; public float f_MerchantSaleMax { get { return _MerchantSaleMax; } set { _MerchantSaleMax = value; _MerchantSaleMax.RandomizeCryptoKey(); } }
|
|
||||||
public int n_AppearTalkID;
|
|
||||||
public int n_BattleTalkID;
|
|
||||||
public int n_LeaveTalkID;
|
|
||||||
public int n_SalesTalkID;
|
|
||||||
public int n_SoldOutTalkID;
|
|
||||||
public int n_NoPurchaseTalkID;
|
|
||||||
public int n_StealFailTalkID;
|
|
||||||
public int n_DieTalkID;
|
|
||||||
|
|
||||||
public float Get_Sale()
|
|
||||||
{
|
|
||||||
// 할인 단위 (% 단위 → 0~1 단위로 변환)
|
|
||||||
int saleunit = table_GlobalValue.Ins.Get_Int("ProductDiscountUnitRate");
|
|
||||||
float step = saleunit * 0.01f; // ex) 5 → 0.05, 10 → 0.10
|
|
||||||
|
|
||||||
float min = f_MerchantSaleMin;
|
|
||||||
float max = f_MerchantSaleMax;
|
|
||||||
|
|
||||||
// 유효 범위 내에서 가능한 단계 수 계산
|
|
||||||
int startIndex = Mathf.CeilToInt(min / step);
|
|
||||||
int endIndex = Mathf.FloorToInt(max / step);
|
|
||||||
|
|
||||||
if (startIndex > endIndex)
|
|
||||||
return min; // 안전장치: 단위가 안 맞으면 최소값 반환
|
|
||||||
|
|
||||||
// 가능한 값 리스트 중 랜덤 선택
|
|
||||||
int randIndex = Random.Range(startIndex, endIndex + 1);
|
|
||||||
return randIndex * step;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_MerchantConfig : table_base
|
|
||||||
{
|
|
||||||
public static table_MerchantConfig Ins;
|
|
||||||
|
|
||||||
List<MerchantConfigTableData> tableDatas;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<MerchantConfigTableData>>(json_last);
|
|
||||||
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
tableDatas[i].f_MerchantSaleMin *= 0.01f;
|
|
||||||
tableDatas[i].f_MerchantSaleMax *= 0.01f;
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<MerchantConfigTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public MerchantConfigTableData Get_Data(int id) { return tableDatas.Find(f => f.n_MerchantID == id); }
|
|
||||||
public MerchantConfigTableData Get_RandomData(int grade)
|
|
||||||
{
|
|
||||||
var list = tableDatas.FindAll(x => x.n_MerchantGrade == grade);
|
|
||||||
return DSUtil.WeightedPick(list, x => x.n_AppearRate);
|
|
||||||
}
|
|
||||||
public MerchantConfigTableData Get_RandomData() { return DSUtil.WeightedPick(tableDatas, x => x.n_AppearRate); }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3248c55d2a68c4449af737a9ff428289
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class NPCConfigTableData : TableDataBase
|
|
||||||
{
|
|
||||||
ObscuredInt _NPCID; public int n_NPCID { get { return _NPCID; } set { _NPCID = value; _NPCID.RandomizeCryptoKey(); } }
|
|
||||||
public int n_NPCGrade;
|
|
||||||
public string s_NPCImg;
|
|
||||||
ObscuredInt _AppearRate; public int n_AppearRate { get { return _AppearRate; } set { _AppearRate = value; _AppearRate.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _BattleMonsterID; public int n_BattleMonsterID { get { return _BattleMonsterID; } set { _BattleMonsterID = value; _BattleMonsterID.RandomizeCryptoKey(); } }
|
|
||||||
public eNPCType e_NPCType;
|
|
||||||
ObscuredInt _NPCRequestItemID; public int n_NPCRequestItemID { get { return _NPCRequestItemID; } set { _NPCRequestItemID = value; _NPCRequestItemID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _NPCRewardID; public int n_NPCRewardID { get { return _NPCRewardID; } set { _NPCRewardID = value; _NPCRewardID.RandomizeCryptoKey(); } }
|
|
||||||
public int n_AppearTalkID;
|
|
||||||
public int n_BattleTalkID;
|
|
||||||
public int n_LeaveTalkID;
|
|
||||||
public int n_NPCRequestItemTalkID;
|
|
||||||
public int n_NPCGiftTalkID;
|
|
||||||
public int n_NoGiftTalkID;
|
|
||||||
public int n_StealFailTalkID;
|
|
||||||
public int n_DieTalkID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_NPCConfig : table_base
|
|
||||||
{
|
|
||||||
public static table_NPCConfig Ins;
|
|
||||||
|
|
||||||
List<NPCConfigTableData> tableDatas;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<NPCConfigTableData>>(json_last);
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<NPCConfigTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public NPCConfigTableData Get_Data(int id) { return tableDatas.Find(f => f.n_NPCID == id); }
|
|
||||||
public NPCConfigTableData Get_RandomData(int grade)
|
|
||||||
{
|
|
||||||
var list = tableDatas.FindAll(x => x.n_NPCGrade == grade);
|
|
||||||
return DSUtil.WeightedPick(list, x => x.n_AppearRate);
|
|
||||||
}
|
|
||||||
public NPCConfigTableData Get_RandomData() { return DSUtil.WeightedPick(tableDatas, x => x.n_AppearRate); }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 3b21546d64d94c446b8d15749df8751f
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public enum eAwakenUIPosition { Left, Center, Right };
|
|
||||||
|
|
||||||
public class PCAwakeningTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public int n_Step, n_NextID1, n_NextID2, n_NextID3, n_Name, n_Desc;
|
|
||||||
public eAwakenUIPosition e_Position;
|
|
||||||
public eStat e_Stat1, e_Stat2;
|
|
||||||
public string s_Icon, s_Value1, s_UpgradeStatValuePara1, s_Value2, s_UpgradeStatValuePara2;
|
|
||||||
ObscuredInt _PCID; public int n_PCID { get { return _PCID; } set { _PCID = value; _PCID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _ID; public int n_ID { get { return _ID; } set { _ID = value; _ID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _MaxLv; public int n_MaxLv { get { return _MaxLv; } set { _MaxLv = value; _MaxLv.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _NeedSoul; public int n_NeedSoul { get { return _NeedSoul; } set { _NeedSoul = value; _NeedSoul.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
ObscuredFloat _Value1; public float f_Value1 { get { return _Value1; } set { _Value1 = value; _Value1.RandomizeCryptoKey(); } }
|
|
||||||
public float Get_Value1() { return f_Value1 + (f_Value1PerLv * MyValue.sdata.Get_PCAwakenLv(n_ID)); }
|
|
||||||
ObscuredFloat _Value1PerLv; public float f_Value1PerLv { get { return _Value1PerLv; } set { _Value1PerLv = value; _Value1PerLv.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
ObscuredFloat _Value2; public float f_Value2 { get { return _Value2; } set { _Value2 = value; _Value2.RandomizeCryptoKey(); } }
|
|
||||||
public float Get_Value2() { return f_Value2 + (f_Value2PerLv * MyValue.sdata.Get_PCAwakenLv(n_ID)); }
|
|
||||||
ObscuredFloat _Value2PerLv; public float f_Value2PerLv { get { return _Value2PerLv; } set { _Value2PerLv = value; _Value2PerLv.RandomizeCryptoKey(); } }
|
|
||||||
|
|
||||||
public override string Get_Name() { return table_localtext.Ins.Get_Text(n_Name); }
|
|
||||||
public override string Get_Desc() { return table_localtext.Ins.Get_Text(n_Desc,
|
|
||||||
MyText.Get_StatValueText(e_Stat1, Get_Value1(), true), MyText.Get_StatValueText(e_Stat2, Get_Value2(), true)); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_PCAwakening : table_base
|
|
||||||
{
|
|
||||||
public static table_PCAwakening Ins;
|
|
||||||
|
|
||||||
List<PCAwakeningTableData> tableDatas;
|
|
||||||
Dictionary<int, PCAwakeningTableData> dic_Datas = new Dictionary<int, PCAwakeningTableData>();
|
|
||||||
Dictionary<int, List<PCAwakeningTableData>> dic_Datas_PC = new Dictionary<int, List<PCAwakeningTableData>>();
|
|
||||||
public List<List<List<PCAwakeningTableData>>> list_PCStep = new List<List<List<PCAwakeningTableData>>>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<PCAwakeningTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
temp.f_Value1 = Get_Value(temp.s_Value1);
|
|
||||||
temp.f_Value1PerLv = Get_Value(temp.s_UpgradeStatValuePara1);
|
|
||||||
temp.f_Value2 = Get_Value(temp.s_Value2);
|
|
||||||
temp.f_Value2PerLv = Get_Value(temp.s_UpgradeStatValuePara2);
|
|
||||||
|
|
||||||
dic_Datas.Add(temp.n_ID, temp);
|
|
||||||
if (!dic_Datas_PC.ContainsKey(temp.n_PCID))
|
|
||||||
dic_Datas_PC.Add(temp.n_PCID, new List<PCAwakeningTableData>());
|
|
||||||
dic_Datas_PC[temp.n_PCID].Add(temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
// PC 갯수 찾기
|
|
||||||
int pcid = 0, pccount = 0;
|
|
||||||
foreach (var d in tableDatas)
|
|
||||||
if (d.n_PCID != pcid)
|
|
||||||
{
|
|
||||||
pcid = d.n_PCID;
|
|
||||||
++pccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// PCID 길이에 맞게 초기화
|
|
||||||
list_PCStep = new List<List<List<PCAwakeningTableData>>>(pccount);
|
|
||||||
|
|
||||||
for (int i = 0; i < pccount; i++)
|
|
||||||
list_PCStep.Add(new List<List<PCAwakeningTableData>>());
|
|
||||||
|
|
||||||
// Step 최대값 동적으로 확장하면서 추가
|
|
||||||
foreach (var temp in tableDatas)
|
|
||||||
{
|
|
||||||
// Step 인덱스 부족하면 채우기
|
|
||||||
while (list_PCStep[temp.n_PCID - 6001].Count <= temp.n_Step)
|
|
||||||
list_PCStep[temp.n_PCID - 6001].Add(new List<PCAwakeningTableData>());
|
|
||||||
|
|
||||||
// 넣기
|
|
||||||
list_PCStep[temp.n_PCID - 6001][temp.n_Step].Add(temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PCAwakeningTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public PCAwakeningTableData Get_Data(int id) { return dic_Datas[id]; }
|
|
||||||
public List<PCAwakeningTableData> Get_Datas(int pcid) { return dic_Datas_PC[pcid]; }
|
|
||||||
public List<List<PCAwakeningTableData>> Get_UIDatas(int pcid) { return list_PCStep[pcid - 6001]; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 64b1ca6401085ac4582eb5d5ceb91072
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class PCEvolutionTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public eStat e_Stat1, e_Stat2, e_Stat3, e_Stat4;
|
|
||||||
ObscuredInt _PCID; public int n_PCID { get { return _PCID; } set { _PCID = value; _PCID.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _Star; public int n_Star { get { return _Star; } set { _Star = value; _Star.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _AttackValue; public int n_AttackValue { get { return _AttackValue; } set { _AttackValue = value; _AttackValue.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _MaxHPValue; public int n_MaxHPValue { get { return _MaxHPValue; } set { _MaxHPValue = value; _MaxHPValue.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _MaxShieldValue; public int n_MaxShieldValue { get { return _MaxShieldValue; } set { _MaxShieldValue = value; _MaxShieldValue.RandomizeCryptoKey(); } }
|
|
||||||
ObscuredInt _HitRateValue; public int n_HitRateValue { get { return _HitRateValue; } set { _HitRateValue = value; _HitRateValue.RandomizeCryptoKey(); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_PCEvolution : table_base
|
|
||||||
{
|
|
||||||
public static table_PCEvolution Ins;
|
|
||||||
|
|
||||||
List<PCEvolutionTableData> tableDatas;
|
|
||||||
Dictionary<int, List<PCEvolutionTableData>> dic_Datas = new Dictionary<int, List<PCEvolutionTableData>>();
|
|
||||||
Dictionary<(int, int), PCEvolutionTableData> dic_Data = new Dictionary<(int, int), PCEvolutionTableData>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<PCEvolutionTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
|
|
||||||
if (!dic_Datas.ContainsKey(temp.n_PCID)) dic_Datas.Add(temp.n_PCID, new List<PCEvolutionTableData>());
|
|
||||||
dic_Datas[temp.n_PCID].Add(temp);
|
|
||||||
|
|
||||||
dic_Data.Add((temp.n_PCID, temp.n_Star), temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PCEvolutionTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public PCEvolutionTableData Get_Data(int pcid, int star) { return dic_Data[(pcid, star)]; }
|
|
||||||
public List<PCEvolutionTableData> Get_Datas(int pcid) { return dic_Datas[pcid]; }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 6d1ee61d3a1e9b5408242bb984246653
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
using CodeStage.AntiCheat.ObscuredTypes;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class PCEvolutionMaxTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public eStat e_Stat;
|
|
||||||
public string s_Value, s_Rate;
|
|
||||||
ObscuredFloat _Value; public float f_Value { get { return _Value; } set { _Value = value; _Value.RandomizeCryptoKey(); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_PCEvolutionMax : table_base
|
|
||||||
{
|
|
||||||
public static table_PCEvolutionMax Ins;
|
|
||||||
|
|
||||||
List<PCEvolutionMaxTableData> tableDatas;
|
|
||||||
Dictionary<eStat, PCEvolutionMaxTableData> dic_Data = new Dictionary<eStat, PCEvolutionMaxTableData>();
|
|
||||||
|
|
||||||
List<float> list_rate = new List<float>();
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<PCEvolutionMaxTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var temp = tableDatas[i];
|
|
||||||
temp.f_Value = Get_Value(temp.s_Value);
|
|
||||||
list_rate.Add(Get_Value(temp.s_Rate));
|
|
||||||
dic_Data.Add(temp.e_Stat, temp);
|
|
||||||
}
|
|
||||||
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<PCEvolutionMaxTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public PCEvolutionMaxTableData Get_Data(eStat stat) { return dic_Data[stat]; }
|
|
||||||
public PCEvolutionMaxTableData Get_RandomData(int pcid)
|
|
||||||
{
|
|
||||||
// 확률 복사본 생성
|
|
||||||
List<float> rates = new List<float>(list_rate);
|
|
||||||
var statinfo = MyValue.Get_PCActorStatInfo(pcid);
|
|
||||||
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
var data = tableDatas[i];
|
|
||||||
|
|
||||||
// 1) Attack_Min >= Attack_Max ? Attack_Min 제외
|
|
||||||
if (data.e_Stat == eStat.Attack_Min &&
|
|
||||||
statinfo.Get_TotalStat(eStat.Attack_Min) >= statinfo.Get_TotalStat(eStat.Attack_Max))
|
|
||||||
{
|
|
||||||
rates[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2) 회피력 초과 → Avoid_Melee, Avoid_Range 제외
|
|
||||||
if (data.e_Stat == eStat.Avoid_Melee)
|
|
||||||
{
|
|
||||||
if (statinfo.Get_TotalStat(eStat.Avoid_Melee) >= MyValue.MaxAvoid)
|
|
||||||
rates[i] = 0;
|
|
||||||
}
|
|
||||||
if (data.e_Stat == eStat.Avoid_Range)
|
|
||||||
{
|
|
||||||
if (statinfo.Get_TotalStat(eStat.Avoid_Range) >= MyValue.MaxAvoid)
|
|
||||||
rates[i] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3) 치명타 확률 초과
|
|
||||||
if (data.e_Stat == eStat.Cri)
|
|
||||||
{
|
|
||||||
if (statinfo.Get_TotalStat(eStat.Cri) >= MyValue.MaxAvoid)
|
|
||||||
rates[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//// 모든 확률이 0이 될 경우 대비
|
|
||||||
//bool allZero = true;
|
|
||||||
//foreach (float r in rates)
|
|
||||||
//{
|
|
||||||
// if (r > 0)
|
|
||||||
// {
|
|
||||||
// allZero = false;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//// 모든 확률이 0이면 그냥 원래 리스트에서 랜덤 하나 뽑음
|
|
||||||
//if (allZero)
|
|
||||||
// return tableDatas[Random.Range(0, tableDatas.Count)];
|
|
||||||
|
|
||||||
// 확률 기반 랜덤 선택
|
|
||||||
int index = DSUtil.Get_RandomIndex(rates);
|
|
||||||
return tableDatas[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 36995b837d9782b47b1972e2568a3642
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
public class RandomPatternConfigTableData : TableDataBase
|
|
||||||
{
|
|
||||||
public int n_RandomPatternID;
|
|
||||||
public string s_RandomPatternID;
|
|
||||||
public int n_PatternRate;
|
|
||||||
public int n_NothingRate;
|
|
||||||
public int n_MonsterRate;
|
|
||||||
public int n_MonsterLimitCount;
|
|
||||||
public int n_BuffDebuffRate;
|
|
||||||
public int n_BuffDebuffLimitCount;
|
|
||||||
public int n_MerchantRate;
|
|
||||||
public int n_MerchantLimitCount;
|
|
||||||
public int n_TreasureRate;
|
|
||||||
public int n_TreasureLimitCount;
|
|
||||||
public int n_NPCRate;
|
|
||||||
public int n_NPCLimitCount;
|
|
||||||
public int n_MineRate;
|
|
||||||
public int f_MineLimitCount;
|
|
||||||
public int f_TwoWayRate;
|
|
||||||
public int f_TwoWayLimitCount;
|
|
||||||
|
|
||||||
public List<int> list_Weight = new List<int>();
|
|
||||||
public List<int> list_MaxCount = new List<int>();
|
|
||||||
|
|
||||||
public eStageNodeType Get_RandomNode(Dictionary<eStageNodeType, int> makecount)
|
|
||||||
{
|
|
||||||
// 후보 리스트
|
|
||||||
List<(eStageNodeType type, int rate)> candidates = new List<(eStageNodeType type, int rate)>();
|
|
||||||
|
|
||||||
// 유틸 함수: Limit 체크 후 후보 추가
|
|
||||||
void AddCandidate(int rate, int limit, eStageNodeType type)
|
|
||||||
{
|
|
||||||
if (rate <= 0) return; // 가중치 0이면 제외
|
|
||||||
if (makecount.TryGetValue(type, out int made) && made >= limit) return; // 한도 초과 → 제외
|
|
||||||
candidates.Add((type, rate));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 후보 추가
|
|
||||||
AddCandidate(n_NothingRate, int.MaxValue, eStageNodeType.Nothing);
|
|
||||||
AddCandidate(n_MonsterRate, n_MonsterLimitCount, eStageNodeType.Mob);
|
|
||||||
AddCandidate(n_BuffDebuffRate, n_BuffDebuffLimitCount, eStageNodeType.BuffDebuff);
|
|
||||||
AddCandidate(n_MerchantRate, n_MerchantLimitCount, eStageNodeType.Merchant);
|
|
||||||
AddCandidate(n_TreasureRate, n_TreasureLimitCount, eStageNodeType.Treasure);
|
|
||||||
AddCandidate(n_NPCRate, n_NPCLimitCount, eStageNodeType.NPC);
|
|
||||||
AddCandidate(n_MineRate, f_MineLimitCount, eStageNodeType.Sanctuary);
|
|
||||||
AddCandidate(f_TwoWayRate, f_TwoWayLimitCount, eStageNodeType.TwoWay);
|
|
||||||
|
|
||||||
// 후보 없으면 Nothing
|
|
||||||
if (candidates.Count == 0)
|
|
||||||
return eStageNodeType.Nothing;
|
|
||||||
|
|
||||||
// 가중치 총합
|
|
||||||
int total = 0;
|
|
||||||
foreach (var c in candidates)
|
|
||||||
total += c.rate;
|
|
||||||
|
|
||||||
if (total <= 0)
|
|
||||||
return eStageNodeType.Nothing;
|
|
||||||
|
|
||||||
// 랜덤 선택
|
|
||||||
int rand = UnityEngine.Random.Range(0, total);
|
|
||||||
int cumulative = 0;
|
|
||||||
|
|
||||||
foreach (var c in candidates)
|
|
||||||
{
|
|
||||||
cumulative += c.rate;
|
|
||||||
if (rand < cumulative)
|
|
||||||
return c.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
return eStageNodeType.Nothing;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class table_RandomPatternConfig : table_base
|
|
||||||
{
|
|
||||||
public static table_RandomPatternConfig Ins;
|
|
||||||
|
|
||||||
List<RandomPatternConfigTableData> tableDatas;
|
|
||||||
|
|
||||||
protected override void Awake()
|
|
||||||
{
|
|
||||||
Ins = this;
|
|
||||||
base.Awake();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Start()
|
|
||||||
{
|
|
||||||
tableDatas = JsonConvert.DeserializeObject<List<RandomPatternConfigTableData>>(json_last);
|
|
||||||
for (int i = 0; i < tableDatas.Count; i++)
|
|
||||||
{
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_NothingRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_MonsterRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_BuffDebuffRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_MerchantRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_TreasureRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_NPCRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].n_MineRate);
|
|
||||||
tableDatas[i].list_Weight.Add(tableDatas[i].f_TwoWayRate);
|
|
||||||
|
|
||||||
tableDatas[i].list_MaxCount.Add(999);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].n_MonsterLimitCount);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].n_BuffDebuffLimitCount);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].n_MerchantLimitCount);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].n_TreasureLimitCount);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].n_NPCLimitCount);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].f_MineLimitCount);
|
|
||||||
tableDatas[i].list_MaxCount.Add(tableDatas[i].f_TwoWayLimitCount);
|
|
||||||
}
|
|
||||||
base.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<RandomPatternConfigTableData> Get_DataList() { return tableDatas; }
|
|
||||||
public RandomPatternConfigTableData Get_Data(int id) { return tableDatas.Find(f=>f.n_RandomPatternID == id); }
|
|
||||||
public RandomPatternConfigTableData Get_RandomData() { return DSUtil.WeightedPick(tableDatas, x => x.n_PatternRate); }
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: f50e0acf4f5d96c4f8cb08bf50f0d57d
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue