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); }
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); } } }