Update /godmode to use JourneyMode Godmode power.
- Previous Bouncer checks for GodMode (namely, Hurt) were removed. - The command now uses the GodmodePower from core Terraria - The toggle powers (which this command will now make use of) are now reset on disconnect to prevent accidentally "gifting" godmode to an unsuspecting player.
This commit is contained in:
parent
173d6f71f5
commit
207b43e772
3 changed files with 24 additions and 10 deletions
|
|
@ -37,6 +37,8 @@ using OTAPI.Tile;
|
|||
using TShockAPI.Localization;
|
||||
using System.Text.RegularExpressions;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Creative;
|
||||
using static Terraria.GameContent.Creative.CreativePowers;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -6445,6 +6447,10 @@ namespace TShockAPI
|
|||
|
||||
playerToGod.GodMode = !playerToGod.GodMode;
|
||||
|
||||
var god_power = CreativePowerManager.Instance.GetPower<GodmodePower>();
|
||||
|
||||
god_power.SetEnabledState(playerToGod.Index, playerToGod.GodMode);
|
||||
|
||||
if (playerToGod == args.Player)
|
||||
{
|
||||
args.Player.SendSuccessMessage(string.Format("You are {0} in god mode.", args.Player.GodMode ? "now" : "no longer"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue