// hp, mp public void ShowNumberPanel(AsUserEntity userEntity, int nValue, eATTRCHANGECONTENTS eContents, eCustomFontType eType, eDAMAGETYPE eDamageType) { if( null == userEntity) return; if( eATTRCHANGECONTENTS.eATTRCHANGECONTENTS_USING_SKILL == eContents || eATTRCHANGECONTENTS.eATTRCHANGECONTENTS_KILLNPC == eContents) { if( nValue <= 0) return; int nRes = nValue; float fSpeed = 1.0f; float fScale = 1.2f; if( eCustomFontType.eCustomFontType_HP == eType) { float maxHP = userEntity.GetProperty<float>( eComponentProperty.HP_MAX); float curHP = userEntity.GetProperty<float>( eComponentProperty.HP_CUR); float subHP = maxHP - curHP; if( subHP < nValue) nRes = (int)subHP; fSpeed = m_fSpeed_Damage_HP; fScale = m_fScale_Damage_HP; } else if( eCustomFontType.eCustomFontType_MP == eType) { float maxMP = userEntity.GetProperty<float>( eComponentProperty.MP_MAX); float curMP = userEntity.GetProperty<float>( eComponentProperty.MP_CUR); float subMP = maxMP - curMP; if( subMP < nValue) nRes = (int)subMP; fSpeed = m_fSpeed_Damage_MP; fScale = m_fScale_Damage_MP; } if( nRes >= 0) { if( eDAMAGETYPE.eDAMAGETYPE_CRITICAL == eDamageType) _ShowNumberPanel( userEntity.transform.gameObject, "!", 2, true, true, m_fSpeed_Damage_Critical, m_fScale_Damage_Critical); // critical user string str = _GetCustomFont( nRes, eType); _ShowNumberPanel( userEntity.transform.gameObject, str, 0, false, false, fSpeed, fScale); // HP, MP user } } else if( eATTRCHANGECONTENTS.eATTRCHANGECONTENTS_DOT_DAMAGE == eContents) { // if( nValue <= 0) // return; // // float maxHP = userEntity.GetProperty<float>( eComponentProperty.HP_MAX); // float curHP = userEntity.GetProperty<float>( eComponentProperty.HP_CUR); // float subHP = maxHP - curHP; // int nRes = nValue; // if( subHP < nValue) // nRes = (int)subHP; // // if( nRes > 0) // { // string str = _GetCustomFont( nRes, eType); // _ShowNumberPanel( userEntity.transform.gameObject, str, 0, false, false, m_fSpeed_Damage_DotHeal, m_fScale_Damage_DotHeal); // Dot Healling user // } string str = ""; int nRes = nValue; if( nValue <= 0) { nRes *= -1; //str = nRes.ToString(); // dot damage str = _GetCustomFont( nRes, eCustomFontType.eCustomFontType_AllyDamage); } else str = _GetCustomFont( nRes, eType); // dot healling _ShowNumberPanel( userEntity.transform.gameObject, str, 0, false, false, m_fSpeed_Damage_DotHeal, m_fScale_Damage_DotHeal); // Dot Healling user } else if( eATTRCHANGECONTENTS.eATTRCHANGECONTENTS_HP_INSTEAD_MP == eContents) { int nRes = nValue; if( nValue <= 0) nRes *= -1; if( eDAMAGETYPE.eDAMAGETYPE_CRITICAL == eDamageType) _ShowNumberPanel( userEntity.transform.gameObject, "!", 2, true, true, m_fSpeed_Damage_Critical, m_fScale_Damage_Critical); // critical user _ShowNumberPanel( userEntity.transform.gameObject, nRes.ToString(), 0, true, false, m_fSpeed_Damage, m_fScale_Damage); // damage(red font) } }
public void ShowNumberPanel(GameObject go, int nDamage, eDAMAGETYPE eDamageType, bool isEnemy) { switch( eDamageType) { case eDAMAGETYPE.eDAMAGETYPE_MISS: _ShowNumberPanel( go, "#", 0, true, true, m_fSpeed_Damage_Miss, m_fScale_Damage_Miss); // miss break; case eDAMAGETYPE.eDAMAGETYPE_DODGE: _ShowNumberPanel( go, "%", 0, true, true, m_fSpeed_Damage_Dodge, m_fScale_Damage_Dodge); // dodge break; case eDAMAGETYPE.eDAMAGETYPE_REGIST: _ShowNumberPanel( go, "/", 0, true, true, m_fSpeed_Damage_Dodge, m_fScale_Damage_Dodge); // resist break; case eDAMAGETYPE.eDAMAGETYPE_NORMAL: if( nDamage > 0) { if( true == isEnemy) { _ShowNumberPanel( go, nDamage.ToString(), 0, true, false, m_fSpeed_Damage, m_fScale_Damage); // damage(red font) } else { string strCustom = _GetCustomFont( nDamage, eCustomFontType.eCustomFontType_AllyDamage); _ShowNumberPanel( go, strCustom, 0, true, false, m_fSpeed_Damage, m_fScale_Damage); } } break; case eDAMAGETYPE.eDAMAGETYPE_CRITICAL: _ShowNumberPanel( go, "!", 2, true, true, m_fSpeed_Damage_Critical, m_fScale_Damage_Critical); // critical if( nDamage > 0) { if( true == isEnemy) { _ShowNumberPanel( go, nDamage.ToString(), 0, true, false, m_fSpeed_Damage, m_fScale_Damage); // damage(red font) } else { string strCustom = _GetCustomFont( nDamage, eCustomFontType.eCustomFontType_AllyDamage); _ShowNumberPanel( go, strCustom, 0, true, false, m_fSpeed_Damage, m_fScale_Damage); } } break; } }
public void ShowNumberPanel(GameObject go, int nDamage, eDAMAGETYPE eDamageType, Tbl_Action_Record actionRecord, bool isEnemy) { if( eDAMAGETYPE.eDAMAGETYPE_DODGE == eDamageType || eDAMAGETYPE.eDAMAGETYPE_REGIST == eDamageType || eDAMAGETYPE.eDAMAGETYPE_MISS == eDamageType) { ShowNumberPanel( go, nDamage, eDamageType, isEnemy); return; } if( null == actionRecord) return; if( null == actionRecord.HitAnimation) return; if( null == actionRecord.HitAnimation.hitInfo) return; Tbl_Action_HitInfo hitInfo = actionRecord.HitAnimation.hitInfo; if( eValueLookType.Duration == hitInfo.HitValueLookType) { stDamageDuration stData = new stDamageDuration(); stData._go = go; stData._eDamageType = eDamageType; stData._bEnemy = isEnemy; int nDamageOnce = nDamage / (int)hitInfo.HitValueLookCount; int nDamageBuf = (int)( (float)nDamageOnce * 0.07f); int nTotalDamage = 0; float fTimeGab = hitInfo.HitValueLookDuration / ( hitInfo.HitValueLookCount * 1000); for( int i = 0; i < hitInfo.HitValueLookCount; i++) { if( i > 0 && eDAMAGETYPE.eDAMAGETYPE_CRITICAL == stData._eDamageType) stData._eDamageType = eDAMAGETYPE.eDAMAGETYPE_NORMAL; if( i == ( hitInfo.HitValueLookCount - 1)) stData._nDamage = nDamage - nTotalDamage; else { stData._nDamage = ( i * nDamageBuf) + nDamageOnce; nTotalDamage += stData._nDamage; } stData._fTime = Time.time + ( fTimeGab * i); m_listDamageDuration.Add( stData); } } else ShowNumberPanel( go, nDamage, eDamageType, isEnemy); }
bool PlayPotency(Msg_OtherCharAttackNpc3 _attack, Tbl_Action_HitInfo _hitInfo, int _idx, eDAMAGETYPE _type, Tbl_SkillLevel_Potency _lvPotency) { if(m_Owner == null) return false; if(_idx == int.MaxValue || m_Owner.ModelObject == null) return true; Tbl_SkillPotencyEffect_Record effect = AsTableManager.Instance.GetTbl_SkillPotencyEffect_Record(_idx); if(effect == null) return false; string effectPath = ""; string soundPath = ""; effectPath = effect.PotencyEffect_FileName; soundPath = effect.PotencySound_FileName; switch(_type) { case eDAMAGETYPE.eDAMAGETYPE_NORMAL: break; case eDAMAGETYPE.eDAMAGETYPE_CRITICAL: if(effect.PotencyCriticalEffect_FileName != "NONE") effectPath = effect.PotencyCriticalEffect_FileName; if(effect.PotencyCriticalSound_FileName != "NONE") soundPath = effect.PotencyCriticalSound_FileName; break; case eDAMAGETYPE.eDAMAGETYPE_MISS: // effectPath = "Miss"; // soundPath = "Miss"; break; case eDAMAGETYPE.eDAMAGETYPE_DODGE: // effectPath = "Dodge"; // soundPath = "Dodge"; break; case eDAMAGETYPE.eDAMAGETYPE_NOTHING: // effectPath = "Nothing"; // soundPath = "Nothing"; break; default: // effectPath = "etc"; // soundPath = "etc"; // if(m_Owner.FsmType == eFsmType.MONSTER) // Debug.Log("PotencyProcessor::PlayPotency: monster [class:" + m_Owner.GetProperty<string>(eComponentProperty.CLASS) + "] attack type is " + _type); break; } if(_hitInfo != null && _hitInfo.HitValueLookType == eValueLookType.Duration) { float interval = (_hitInfo.HitValueLookDuration / _hitInfo.HitValueLookCount) * 0.0005f; SequentPotency sequent = new SequentPotency(_attack, effectPath, soundPath, effect); for(int i=0; i<_hitInfo.HitValueLookCount; ++i) { AsTimerManager.Instance.SetTimer(interval * i + interval * 0.5f, Timer_SequentEffect, sequent); // Debug.Log("PotencyProcessor::PlayPotency: interval=" + interval * i); } } else { float lifeTime = 0; // if(effect.PotencyEffect_Timing == eEFFECT_TIMING.Duration && _lvPotency != null) lifeTime = _lvPotency.Potency_Duration; if( null != AsEffectManager.Instance && null != AsSoundManager.Instance) { float size = 1; if(effect.Effect_Size != float.MaxValue) size = effect.Effect_Size * 0.001f * m_Owner.characterController.height; if(size > m_MaxSize) size = m_MaxSize; AsEffectManager.Instance.PlayEffect(effectPath, m_Owner.ModelObject.transform, false, lifeTime, size); AsSoundManager.Instance.PlaySound(soundPath, m_Owner.ModelObject.transform.position, false); if(effect.HitShake != float.MaxValue) { if(m_Owner.FsmType == eFsmType.MONSTER || (m_Owner.FsmType == eFsmType.OTHER_USER && _attack != null)) ShakeProcess(effect.HitShake); } } else { Debug.Log("PotencyProcessor::PlayPotency: AsEffectManager or AsSoundManager instance is null."); return false; } } return true; }
bool PlayPotency(Tbl_Action_HitInfo _hitInfo, int _idx, eDAMAGETYPE _type, Tbl_SkillLevel_Potency _lvPotency) { return PlayPotency(null, _hitInfo, _idx, _type, _lvPotency); }
//ADDITINAL INFO // public AsNpcEntity attacker_; // public Tbl_MonsterSkillLevel_Record skillLv_; // public Tbl_Action_Record action_; public Msg_NpcAttackChar2( Msg_NpcAttackChar1 _parent, AS_SC_NPC_ATTACK_CHAR_2 _info) { m_MessageType = eMessageType.NPC_ATTACK_CHAR2; parent_ = _parent; sessionId_ = _info.nSessionIdx; charUniqKey_ = _info.nCharUniqKey; hpCur_ = _info.fHpCur; mpCur_ = _info.fMpCur; eDamageType_ = ( eDAMAGETYPE)_info.eDamageType; // ilmeda, 20120731 damage_ = _info.nDamage; hpHeal_ = _info.fHpHeal; mpHeal_ = _info.fMpHeal; reflection_ = _info.fReflection; drain_ = _info.fDrain; knockBack_ = _info.bKnockBack; }
public Msg_OtherCharAttackNpc3( Msg_OtherCharAttackNpc1 _parent, AS_SC_CHAR_ATTACK_NPC_3 _info) { m_MessageType = eMessageType.CHAR_ATTACK_NPC3; parent_ = _parent; sessionIdx_ = _info.nSessionIdx; charUniqKey_ = _info.nCharUniqKey; hpCur_ = _info.fHpCur; mpCur_ = _info.fMpCur; eDamageType = ( eDAMAGETYPE)_info.eDamageType; damage_ = _info.fDamage; hpHeal_ = _info.fHpHeal; mpHeal_ = _info.fMpHeal; reflection_ = _info.fReflection; drain_ = _info.fDrain; knockBack_ = _info.bKnockBack; }
// public Vector3 position_; // //ADDITONAL // public Tbl_SkillLevel_Record skillLv_; // public Tbl_Action_Record action_; // public Msg_OtherCharAttackNpc2( AS_SC_CHAR_ATTACK_NPC_2 _info) // { // m_MessageType = eMessageType.CHAR_ATTACK_NPC2; // // npcIdx_ = _info.nNpcIdx; // // hpCur_ = _info.nHpCur; // eDamageType = ( eDAMAGETYPE)_info.eDamageType; // damage_ = _info.nDamage; // // reflection_ = _info.fReflection; // drain_ = _info.fDrain; // // position_ = _info.vPosition; // } public Msg_OtherCharAttackNpc2( Msg_OtherCharAttackNpc1 _parent, AS_SC_CHAR_ATTACK_NPC_2 _info, UInt32 charUniqKey) { m_MessageType = eMessageType.CHAR_ATTACK_NPC2; parent_ = _parent; npcIdx_ = _info.nNpcIdx; hpCur_ = _info.nHpCur; eDamageType_ = ( eDAMAGETYPE)_info.eDamageType; damage_ = _info.nDamage; heal_ = _info.fHpHeal; reflection_ = _info.fReflection; drain_ = _info.fDrain; #region -Authority authorityOwnerIsMe = ( charUniqKey == AsUserInfo.Instance.GetCurrentUserEntity().UniqueId) ? true : false; if( true == authorityOwnerIsMe) authorityInMe = _info.bAggroMyself; #endregion // position_ = _info.vPosition; }