public void OnSkillEffectOp(KProtoBuf buf, bool fristTime) { S2C_SKILL_EFFECT respond = buf as S2C_SKILL_EFFECT; KAttackEvent kaEvt = (KAttackEvent)respond.byAttackEvent; SceneEntity killerHero = GetSceneObject(respond.wCasterID) as SceneEntity; SceneEntity targetHero = GetSceneObject(respond.wTargetHeroID) as SceneEntity; if (null == targetHero) { return; } if (!fristTime && null == targetHero) { return; } targetHero.property.lastHitSkillId = respond.wSkillID; targetHero.property.lastAttackEvent = respond.byAttackEvent; if (null != targetHero.AnimCmp) { targetHero.AnimCmp.ResetFightingState(); } KSkillDisplay skillDisplay = KConfigFileManager.GetInstance().GetSkillDisplay(targetHero.property.lastHitSkillId, 1); if (fristTime && null != killerHero) { KActiveSkill activeSkill = KConfigFileManager.GetInstance().GetActiveSkill(targetHero.property.lastHitSkillId, 1); if (null != activeSkill) { if (activeSkill.ClientCache) { if (null != killerHero.ActiveAction) { killerHero.ActiveAction.AddSkillEffectMessage(respond, Time.realtimeSinceStartup); return; } } else if (null != killerHero && skillDisplay.HitDelayTimeScale > 0.00001f) { float distance = Vector3.Distance(killerHero.Position, targetHero.Position); float _time = distance * skillDisplay.HitDelayTimeScale; DelayCallManager.instance.CallFunction(OnSkillEffectParam, _time, buf, false, targetHero, targetHero.property.hp - (int)respond.wDamage, Time.realtimeSinceStartup); return; } } } if (fristTime) { targetHero.property.fightHp = (int)(targetHero.property.hp - respond.wDamage); targetHero.property.updateFightHpTime = Time.realtimeSinceStartup; } if (targetHero.property.heroObjType == KHeroObjectType.hotPlayer) { if (null != targetHero.AnimCmp) { targetHero.AnimCmp.ResetFightingState(); } } targetHero.Action.PlayFightEffect(respond.wSkillID, (int)respond.wDamage, respond.byAttackEvent, killerHero); }
private void OnSkillEffect(KProtoBuf buffer) { S2C_SKILL_EFFECT respond = (S2C_SKILL_EFFECT)buffer; m_EntityManager.SendEventToEntity(m_GameplayProxy.GetMainPlayerUID(), ComponentEventName.Event_s2c_skill_effect, new S2C_SKILL_EFFECT_Event() { msg = respond }); }
public virtual void AddSkillEffectMessage(S2C_SKILL_EFFECT respond, float _time) { msg_case.AddSkillEffectMessage(respond, _time); }
public void AddSkillEffectMessage(S2C_SKILL_EFFECT respond, float _time) { SceneEntity targetHero = SceneLogic.GetInstance().GetSceneObject(respond.wTargetHeroID) as SceneEntity; effect_msgs.Add(new SkillEffectItem(respond, (int)(targetHero.property.hp - respond.wDamage), _time)); }
public SkillEffectItem(S2C_SKILL_EFFECT effect, int hp, float _time) { this.effect = effect; this.hp = hp; this.hitTime = _time; }