Exemplo n.º 1
0
        public void HandlePlayerTakeHit(ServerPlayer victim, ServerPlayer assilant, ShotManager.ShotInfo shot)
        {
            OnPlayerHitWhileHoldingFlag?.Invoke(victim, assilant, shot);

            FlagHitEventArgs args = new FlagHitEventArgs();

            args.FlagInvolved    = victim.Info.CariedFlag?.Flag;
            args.FlagHolder      = victim;
            args.OtherPlayer     = assilant;
            args.OtherPlayerFlag = shot.SourceFlag;


            PlayerHitWhileHoldingFlag?.Invoke(this, args);
        }
Exemplo n.º 2
0
        protected virtual void OnPlayerHitWhileHoldingFlag(ServerPlayer victim, ServerPlayer assilant, ShotManager.ShotInfo shot)
        {
            if (shot.SourceFlag == FlagTypeList.Shield)
            {
                if (victim.Info.ShotImmunities > 0)
                {
                    victim.Info.ShotImmunities--;
                }

                if (victim.Info.ShotImmunities == 0)
                {
                    // drop flag?
                    State.Flags.DropFlag(victim);
                }
            }
        }