Example #1
0
    public override void DoAttackShared(HitInfo info)
    {
        BasePlayer       ownerPlayer      = GetOwnerPlayer();
        BaseCombatEntity baseCombatEntity = info.HitEntity as BaseCombatEntity;

        if (baseCombatEntity != null && ownerPlayer != null && base.isServer)
        {
            if (Interface.CallHook("OnHammerHit", ownerPlayer, info) != null)
            {
                return;
            }
            using (TimeWarning.New("DoRepair", 50))
            {
                baseCombatEntity.DoRepair(ownerPlayer);
            }
        }
        info.DoDecals = false;
        if (base.isServer)
        {
            Effect.server.ImpactEffect(info);
        }
        else
        {
            Effect.client.ImpactEffect(info);
        }
    }
Example #2
0
    public override void DoAttackShared(HitInfo info)
    {
        BasePlayer       ownerPlayer = base.GetOwnerPlayer();
        BaseCombatEntity hitEntity   = info.HitEntity as BaseCombatEntity;

        if (hitEntity != null)
        {
            if (Interface.CallHook("OnHammerHit", ownerPlayer, info) != null)
            {
                return;
            }
            if (ownerPlayer != null && base.isServer)
            {
                using (TimeWarning timeWarning = TimeWarning.New("DoRepair", (long)50))
                {
                    hitEntity.DoRepair(ownerPlayer);
                }
            }
        }
        if (base.isServer)
        {
            Effect.server.ImpactEffect(info);
            return;
        }
        Effect.client.ImpactEffect(info);
    }