Updated the GodMode field.

* Changed the GodMode field to a property that is controlled by the journey mode.
- Removed the call to godmode in `Commands.ToggleGodMode`.
This commit is contained in:
AkjaHAsLk1IALk0MasH 2023-05-14 09:11:18 +07:00
parent c67d5cf152
commit 6d4682ed7e
2 changed files with 9 additions and 6 deletions

View file

@ -34,6 +34,7 @@ using TShockAPI.Hooks;
using TShockAPI.Net;
using Timer = System.Timers.Timer;
using System.Linq;
using Terraria.GameContent.Creative;
namespace TShockAPI
{
@ -935,9 +936,15 @@ namespace TShockAPI
public bool LoginHarassed = false;
/// <summary>
/// Player cant die, unless onehit
/// Controls the journey godmode
/// </summary>
public bool GodMode = false;
public bool GodMode
{
get =>
CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>().IsEnabledForPlayer(Index);
set =>
CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>().SetEnabledState(Index, value);
}
/// <summary>
/// Players controls are inverted if using SSC