투사체 관련 수정
This commit is contained in:
parent
c00fa2c4cd
commit
907a7f33e7
|
|
@ -78,7 +78,7 @@ CircleCollider2D:
|
|||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 0
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class AimArrowController : MonoBehaviour
|
|||
|
||||
ProjectileData basePd = new ProjectileData
|
||||
{
|
||||
IsPC = true,
|
||||
ActorType = eActor.PC,
|
||||
m_Data = table_projectile.Ins.Get_Data(unit.n_ProjectileID),
|
||||
tf_Start = arrow.transform,
|
||||
Dmg = unit.n_DefaultAttack + (int)IngameMgr.Ins.Get_SkillValue(eSkillType.AttackUp),
|
||||
|
|
@ -104,7 +104,7 @@ public class AimArrowController : MonoBehaviour
|
|||
Bounce = basePd.Bounce,
|
||||
Pierce = basePd.Pierce,
|
||||
|
||||
IsPC = basePd.IsPC,
|
||||
ActorType = basePd.ActorType,
|
||||
m_Data = basePd.m_Data,
|
||||
tf_Start = basePd.tf_Start,
|
||||
Dmg = basePd.Dmg
|
||||
|
|
|
|||
|
|
@ -152,11 +152,11 @@ public class MobActor : MonoBehaviour
|
|||
|
||||
ProjectileMgr.Ins.Shoot_Projectile(new ProjectileData
|
||||
{
|
||||
IsPC = false,
|
||||
ActorType = eActor.Mob,
|
||||
m_Data = table_projectile.Ins.Get_Data(m_Data.n_ProjectileID),
|
||||
tf_Start = transform,
|
||||
Dmg = m_Attack,
|
||||
Ignore_WallHP = true,
|
||||
Ignore_WallHP = false,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -172,22 +172,25 @@ public class MobActor : MonoBehaviour
|
|||
IngameMgr.Ins.Add_MobKill(m_Data.n_DropExp);
|
||||
gameObject.SetActive(false);
|
||||
|
||||
var explosionlv = IngameMgr.Ins.Get_SkillLv(eSkillType.Explosion);
|
||||
if (explosionlv > 0)
|
||||
if (data.ActorType == eActor.PC)
|
||||
{
|
||||
var tdata = table_skill.Ins.Get_Data(eSkillType.Explosion);
|
||||
var unit = IngameMgr.Ins.Get_CurUnitTData();
|
||||
var dmg = unit.n_DefaultAttack + (int)IngameMgr.Ins.Get_SkillValue(eSkillType.AttackUp);
|
||||
var totaldmg = dmg = (int)(dmg * tdata.f_ExplosionDmg);
|
||||
totaldmg += (int)(dmg * (tdata.f_ExplosionDmgPerLv * (explosionlv - 1)));
|
||||
|
||||
ProjectileMgr.Ins.Shoot_Projectile(new ProjectileData
|
||||
var explosionlv = IngameMgr.Ins.Get_SkillLv(eSkillType.Explosion);
|
||||
if (explosionlv > 0)
|
||||
{
|
||||
IsPC = true,
|
||||
Dmg = totaldmg,
|
||||
m_Data = table_projectile.Ins.Get_Data(3002),
|
||||
tf_Start = transform,
|
||||
});
|
||||
var tdata = table_skill.Ins.Get_Data(eSkillType.Explosion);
|
||||
var unit = IngameMgr.Ins.Get_CurUnitTData();
|
||||
var dmg = unit.n_DefaultAttack + (int)IngameMgr.Ins.Get_SkillValue(eSkillType.AttackUp);
|
||||
var totaldmg = dmg = (int)(dmg * tdata.f_ExplosionDmg);
|
||||
totaldmg += (int)(dmg * (tdata.f_ExplosionDmgPerLv * (explosionlv - 1)));
|
||||
|
||||
ProjectileMgr.Ins.Shoot_Projectile(new ProjectileData
|
||||
{
|
||||
ActorType = data.ActorType,
|
||||
Dmg = totaldmg,
|
||||
m_Data = table_projectile.Ins.Get_Data(3002),
|
||||
tf_Start = transform,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!bBoss)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class SupporterActor : MonoBehaviour
|
|||
private void OnEnable()
|
||||
{
|
||||
attackCoolTime = MaxAttackCoolTime;
|
||||
m_PD.IsPC = true;
|
||||
m_PD.ActorType = eActor.Supporter;
|
||||
m_PD.Dmg = Damage;
|
||||
m_PD.m_Data = table_projectile.Ins.Get_Data(3201);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ public class IngameMgr : MonoBehaviourSingletonTemplate<IngameMgr>
|
|||
{
|
||||
var pd = new ProjectileData
|
||||
{
|
||||
IsPC = true,
|
||||
ActorType = eActor.PC,
|
||||
Dmg = 100,
|
||||
m_Data = table_projectile.Ins.Get_Data(3301),
|
||||
tf_Start = mobs[i].transform
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class Projectile : MonoBehaviour
|
|||
{
|
||||
m_ProjectileData = pd;
|
||||
m_LifeTime = m_ProjectileData.m_Data.n_ProjectileLife;
|
||||
if (!m_ProjectileData.IsPC) m_ProjectileData.Ignore_WallHP = false;
|
||||
if (m_ProjectileData.ActorType == eActor.Mob) m_ProjectileData.Ignore_WallHP = false;
|
||||
|
||||
Vector3 pos = pd.tf_Start.position;
|
||||
Quaternion rot = pd.tf_Start.rotation;
|
||||
|
|
@ -79,13 +79,13 @@ public class Projectile : MonoBehaviour
|
|||
|
||||
transform.rotation = Quaternion.AngleAxis(angle, transform.forward) * transform.rotation;
|
||||
|
||||
if (!pd.IsPC)
|
||||
if (pd.ActorType == eActor.Mob)
|
||||
transform.eulerAngles += new Vector3(0f, 0f, 180f);
|
||||
|
||||
dir = transform.up.normalized;
|
||||
|
||||
m_ReflectCount = m_ProjectileData.m_Data.n_AttackBounceLimit;
|
||||
if (pd.IsPC)
|
||||
if (pd.ActorType == eActor.PC)
|
||||
m_ReflectCount += (int)IngameMgr.Ins.Get_SkillValue(eSkillType.Reflect);
|
||||
|
||||
if (m_ProjectileData.m_Data.n_ProjectileID == 3002)
|
||||
|
|
@ -124,7 +124,7 @@ public class Projectile : MonoBehaviour
|
|||
|
||||
private void OnTriggerEnter2D(Collider2D collision)
|
||||
{
|
||||
if (!m_ProjectileData.IsPC && collision.tag == "Mob") return;
|
||||
if (m_ProjectileData.ActorType == eActor.Mob && collision.tag == "Mob") return;
|
||||
if (m_ProjectileData.Ignore_WallHP && collision.tag == "Wall_HP")
|
||||
{
|
||||
m_ProjectileData.Ignore_WallHP = false;
|
||||
|
|
@ -207,7 +207,7 @@ public class Projectile : MonoBehaviour
|
|||
|
||||
void Check_Hit(Collider2D collision)
|
||||
{
|
||||
if (m_ProjectileData.IsPC)
|
||||
if (m_ProjectileData.ActorType != eActor.Mob)
|
||||
{
|
||||
switch(collision.tag)
|
||||
{
|
||||
|
|
@ -265,7 +265,7 @@ public class Projectile : MonoBehaviour
|
|||
var p = ProjectileMgr.Ins.Get(m_ProjectileData.m_Data.s_ProjectilePrefabs);
|
||||
p.Set(new ProjectileData
|
||||
{
|
||||
IsPC = m_ProjectileData.IsPC,
|
||||
ActorType = m_ProjectileData.ActorType,
|
||||
m_Data = m_ProjectileData.m_Data,
|
||||
tf_Start = transform,
|
||||
Dmg = m_ProjectileData.Dmg,
|
||||
|
|
@ -332,11 +332,12 @@ public class Projectile : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public enum eActor { PC, Mob, Supporter }
|
||||
public class ProjectileData
|
||||
{
|
||||
public ProjectileTableData m_Data;
|
||||
public Transform tf_Start;
|
||||
ObscuredBool _IsPC; public bool IsPC { get { return _IsPC; } set { _IsPC = value; _IsPC.RandomizeCryptoKey(); } }
|
||||
public eActor ActorType;
|
||||
ObscuredInt _Lv; public int Lv { get { return _Lv; } set { _Lv = value; _Lv.RandomizeCryptoKey(); } }
|
||||
ObscuredInt _Dmg; public int Dmg { get { return _Dmg; } set { _Dmg = value; _Dmg.RandomizeCryptoKey(); } }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue