-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from Alando1-doom/Quickturn-output-mode-2-sup…
…port Quickturn output mode 2 support
- Loading branch information
Showing
1 changed file
with
31 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |