public void TriggerPull(GameObject shotBy, Vector2 target, BodyPartType damageZone, bool isSuicideShot) { JobType job = PlayerList.Instance.Get(shotBy).Job; if (setRestriction == JobType.NULL) { if (job == JobType.CLOWN && !allowClumsy) { int chance = rnd.Next(0, 2); if (chance == 0) { gun.ServerShoot(shotBy, target, damageZone, true); Chat.AddActionMsgToChat( shotBy, "You fumble up and shoot yourself!", $"{shotBy.ExpensiveName()} fumbles up and shoots themself!"); return; } } else if (job != JobType.CLOWN && !allowNonClumsy) { gun.ServerShoot(shotBy, target, damageZone, true); Chat.AddActionMsgToChat( shotBy, "You somehow shoot yourself in the face! How the hell?!", $"{shotBy.ExpensiveName()} somehow manages to shoot themself in the face!"); return; } } gun.ServerShoot(shotBy, target, damageZone, isSuicideShot); }
public void TriggerPull(GameObject shotBy, Vector2 target, BodyPartType damageZone, bool isSuicideShot) { 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.ServerShoot(shotBy, target, damageZone, isSuicideShot); } else if (setRestriction == JobType.NULL && (job == JobType.CLOWN && !allowClumsy)) { int chance = rnd.Next(0, 2); if (chance == 0) { gun.ServerShoot(shotBy, target, damageZone, true); Chat.AddActionMsgToChat( shotBy, "You fumble up and shoot yourself!", $"{shotBy.ExpensiveName()} fumbles up and shoots themself!"); } else { gun.ServerShoot(shotBy, target, damageZone, isSuicideShot); } } else if (setRestriction == JobType.NULL && (job != JobType.CLOWN && !allowNonClumsy)) { gun.ServerShoot(shotBy, target, damageZone, true); Chat.AddActionMsgToChat( shotBy, "You somehow shoot yourself in the face! How the hell?!", $"{shotBy.ExpensiveName()} somehow manages to shoot themself in the face!"); } else { Chat.AddExamineMsgToClient($"The {gameObject.ExpensiveName()} displays \'User authentication failed\'"); } }
public void ServerPerformInteraction(InventoryApply interaction) { //TODO: switch this trait to the circular saw when that is implemented if (Validations.HasItemTrait(interaction.UsedObject, CommonTraits.Instance.Welder) && gunComp.FireCountDown == 0) { if (isSawn) { Chat.AddExamineMsg(interaction.Performer, $"The {gameObject.ExpensiveName()} is already shortened!"); } if (ammoBackfire && gunComp.CurrentMagazine.ServerAmmoRemains != 0) { gunComp.ServerShoot(interaction.Performer, Vector2.zero, BodyPartType.Head, true); Chat.AddActionMsgToChat(interaction.Performer, $"The {gameObject.ExpensiveName()} goes off in your face!", $"The {gameObject.ExpensiveName()} goes off in {interaction.Performer.ExpensiveName()}'s face!"); } else { Chat.AddActionMsgToChat(interaction.Performer, $"You shorten the {gameObject.ExpensiveName()}.", $"{interaction.Performer.ExpensiveName()} shortens the {gameObject.ExpensiveName()}"); itemAttComp.ServerSetSize(sawnSize); spriteHandler.ChangeSprite(1); // Don't overwrite recoil conf if it isn't setup if (SawnCameraRecoilConfig.Distance != 0f) { gunComp.SyncCameraRecoilConfig(gunComp.CameraRecoilConfig, SawnCameraRecoilConfig); } gunComp.MaxRecoilVariance = sawnMaxRecoilVariance; isSawn = true; } } // Propagates the InventoryApply Interaction to the Gun component for all basic gun InventoryApply interactions. gunComp.ServerPerformInteraction(interaction); }
protected void CallShotServer(AimApply interaction, bool isSuicide) { gunComp.ServerShoot(interaction.Performer, interaction.TargetVector.normalized, interaction.TargetBodyPart, isSuicide); }
protected void CallShotServer(AimApply interaction, bool isSuicide) { gunComp.ServerShoot(interaction.Performer, interaction.TargetVector.normalized, UIManager.DamageZone, isSuicide); }