Example #1
0
    void OnDamage(int casterId, float damage)
    {
        NetworkInterface caster = Get <NetworkInterface>(casterId);
        SkEntity         entity = null != caster ? null != caster.Runner ? caster.Runner.SkEntityBase : null : null;

        if (Runner != null)
        {
            PESkEntity skEntity = Runner.SkEntityBase as PESkEntity;
            if (skEntity != null)
            {
                skEntity.DispatchHPChangeEvent(entity, damage);
            }
        }
    }
Example #2
0
    protected void RPC_S2C_SkOnDamage(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int   casterId = stream.Read <int> ();
        float damage   = stream.Read <float> ();

        NetworkInterface caster = Get <NetworkInterface> (casterId);
        SkEntity         entity = null != caster ? null != caster.Runner ? caster.Runner.SkEntityBase : null : null;

        //if (null != Runner && null != Runner.SkEntityPE && IsController)
        //	Runner.SkEntityPE.Entity.SendMsg (EMsg.Battle_HPChange, entity, damage);

        if (Runner != null)
        {
            PESkEntity skEntity = Runner.SkEntityBase as PESkEntity;
            if (skEntity != null)
            {
                skEntity.DispatchHPChangeEvent(entity, damage);
            }
        }
    }