Ejemplo n.º 1
0
 public override void KnockDown(AgentHuman humanAttacker, E_MeleeType meleeType, Vector3 direction)
 {
     if (uLink.Network.isServer)
     {
         TakeDamage(humanAttacker, float.MaxValue, Vector3.zero, E_WeaponID.None, E_ItemID.None);
     }
 }
Ejemplo n.º 2
0
    protected void Melee(E_MeleeType meleeType, uLink.NetworkViewID viewID, uLink.NetworkMessageInfo info)
    {
        if (Owner.BlackBoard.DontUpdate)
        {
            return;
        }

        uLink.NetworkView view = uLink.NetworkView.Find(viewID);

        if (null == view)
        {
            // target was just destroyed
            return;
        }

        Agent targetAgent = view.GetComponent <Agent>();

        if (targetAgent == null)
        {
            return;             // wtf ?
        }
#if !DEADZONE_CLIENT
        if (Owner.IsServer)
        {
            if (!ServerAnticheat.ReportAndValidateMelee(Owner.NetworkView.owner, Owner, targetAgent, info))
            {
                // Ignore the action when it is not valid. This may happen even in a regular/fair game when
                // an attacking playerexperiences a lag.
                return;
            }
        }
#endif

        AgentActionMelee a = AgentActionFactory.Create(AgentActionFactory.E_Type.Melee) as AgentActionMelee;
        a.Target    = targetAgent;
        a.MeleeType = meleeType;
        Owner.BlackBoard.ActionAdd(a);

        if (a.IsFailed())
        {
            return;             // wtf ?
        }
        if (Owner.IsServer)
        {
            //send to proxies
            Owner.NetworkView.RPC("Melee", uLink.RPCMode.OthersExceptOwner, meleeType, viewID);

            //knockdown target immediatly, its player, we dont have time wait ....
            Vector3 direction = (a.Target.Position - Owner.Position).normalized;
            a.Target.KnockDown(Owner, meleeType, direction);
        }

        //Debug.Log(Time.timeSinceLevelLoad + " " + "Melee " + a.MeleeType + " " + a.Target.name);
    }
Ejemplo n.º 3
0
    protected void Knockdown(E_MeleeType meleeType, uLink.NetworkViewID viewId, Vector3 direction)
    {
#if !DEADZONE_CLIENT
        if (Owner.IsServer)
        {
            ServerAnticheat.ReportPotentialCheatAttempt("Knockdown", "should never be called on the server side", Owner.NetworkView.owner);
            return;
        }
#endif

        if (Owner.BlackBoard.DontUpdate)
        {
            return;
        }

        uLink.NetworkView View     = (viewId != uLink.NetworkViewID.unassigned) ? uLink.NetworkView.Find(viewId) : null;
        AgentHuman        attacker = View ? View.GetComponent <AgentHuman>() : null;

        Owner.KnockDown(attacker, meleeType, direction);
    }
Ejemplo n.º 4
0
 public abstract string GetMeleeAnim(E_MeleeType type);
Ejemplo n.º 5
0
 public override void KnockDown(AgentHuman humanAttacker, E_MeleeType meleeType, Vector3 direction)
 {
 }
Ejemplo n.º 6
0
 public abstract void KnockDown(AgentHuman humanAttacker, E_MeleeType meleeType, Vector3 direction);
Ejemplo n.º 7
0
 public override string GetMeleeAnim(E_MeleeType type)
 {
     return(MeleeAnims[(int)type]);
 }