Skip to content

Commit

Permalink
Merge pull request #138 from Alando1-doom/Quickturn-output-mode-2-sup…
Browse files Browse the repository at this point in the history
…port

Quickturn output mode 2 support
  • Loading branch information
Alando1-doom authored Sep 28, 2024
2 parents d2ad3b6 + 27550ed commit 7141101
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions zscript/quickturn.zs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
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);
}
}
}
}

0 comments on commit 7141101

Please sign in to comment.