diff --git a/zscript/quickturn.zs b/zscript/quickturn.zs index a852ede..89d5abb 100644 --- a/zscript/quickturn.zs +++ b/zscript/quickturn.zs @@ -1,20 +1,34 @@ -Class Toby_QuickTurnHandler : EventHandler +class Toby_QuickTurnHandler : EventHandler { - Override void PlayerEntered(PlayerEvent e) - { - let playe = players[e.PlayerNumber].mo; - If(!playe.FindInventory("Toby_QuickTurnItem")){playe.GiveInventory("Toby_QuickTurnItem",1);} - } + override void PlayerEntered(PlayerEvent e) + { + let playerActor = players[e.PlayerNumber].mo; + if (!playerActor.FindInventory("Toby_QuickTurnItem")) + { + playerActor.GiveInventory("Toby_QuickTurnItem", 1); + } + } } -Class Toby_QuickTurnItem : Inventory +class Toby_QuickTurnItem : Inventory { - Override void DoEffect() - { - Super.DoEffect(); - If(!owner || !owner.player){Destroy(); Return;} - If(owner.player.turnticks>0 && owner.player.cmd.buttons & BT_TURN180 && !(owner.player.oldbuttons & BT_TURN180)) - { - owner.A_StartSound("misc/quickturn", CHAN_AUTO, CHANF_DEFAULT, 1.0, ATTN_STATIC, 0, 0); - } - } -} \ No newline at end of file + override void DoEffect() + { + Super.DoEffect(); + if (!owner || !owner.player) + { + Destroy(); + return; + } + if (owner.player.turnticks > 0 && owner.player.cmd.buttons & BT_TURN180 && !(owner.player.oldbuttons & BT_TURN180)) + { + if (CVar.GetCVar("Toby_NarrationOutputType", owner.player).GetInt() == TNOT_CONSOLE) + { + Toby_Logger.ConsoleOutputModeMessage("Quickturn"); + } + else + { + owner.A_StartSound("misc/quickturn", CHAN_AUTO, CHANF_DEFAULT, 1.0, ATTN_STATIC, 0, 0); + } + } + } +}