public void TriggerPullClient(GameObject shotBy, Vector2 target, BodyPartType damageZone, bool isSuicideShot, string proj, int quant) { JobType job = PlayerList.Instance.Get(shotBy).Job; if (PlayerList.Instance.Get(shotBy).Job == setRestriction || (setRestriction == JobType.NULL && (job != JobType.CLOWN && allowNonClumsy || job == JobType.CLOWN && allowClumsy))) { gun.DisplayShot(shotBy, target, damageZone, isSuicideShot, proj, quant); } else if (setRestriction == JobType.NULL && (job == JobType.CLOWN && !allowClumsy)) { int chance = rnd.Next(0, 2); if (chance == 0) { gun.DisplayShot(shotBy, target, damageZone, true, proj, quant); } else { gun.DisplayShot(shotBy, target, damageZone, isSuicideShot, proj, quant); } } else if (setRestriction == JobType.NULL && (job != JobType.CLOWN && !allowNonClumsy)) { gun.DisplayShot(shotBy, target, damageZone, true, proj, quant); } else { Chat.AddExamineMsgToClient($"The {gameObject.ExpensiveName()} displays \'User authentication failed\'"); } }
///To be run on client public override void Process() { if (!MatrixManager.IsInitialized) { return; } if (Shooter.Equals(NetId.Invalid)) { //Failfast Logger.LogWarning($"Shoot request invalid, processing stopped: {ToString()}", Category.Firearms); return; } //Not even spawned don't show bullets if (PlayerManager.LocalPlayer == null) { return; } LoadMultipleObjects(new uint[] { Shooter, Weapon }); Gun wep = NetworkObjects[1].GetComponent <Gun>(); if (wep == null) { return; } //only needs to run on the clients other than the shooter if (!wep.isServer && PlayerManager.LocalPlayer.gameObject != NetworkObjects[0]) { wep.DisplayShot(NetworkObjects[0], Direction, DamageZone, IsSuicideShot, ProjectileName, Quantity); } }
protected void CallShotClient(AimApply interaction, bool isSuicide) { var dir = gunComp.ApplyRecoil(interaction.TargetVector.normalized); gunComp.DisplayShot(PlayerManager.LocalPlayer, dir, interaction.TargetBodyPart, isSuicide, gunComp.CurrentMagazine.containedBullets[0].name, gunComp.CurrentMagazine.containedProjectilesFired[0]); }