Address JourneyMode Godmode issues
- Add /ungodme to allow unstucking godmode for involuntarily godmodded characters - Warn player about disabling Godmode before disconnecting - Minor change to command format to reduce code copypaste.
This commit is contained in:
parent
4a28d6779f
commit
78b72df79d
1 changed files with 16 additions and 6 deletions
|
|
@ -545,6 +545,11 @@ namespace TShockAPI
|
|||
{
|
||||
HelpText = "Toggles godmode on a player."
|
||||
});
|
||||
add(new Command("", ForceUngod, "ungodme")
|
||||
{
|
||||
HelpText = "Removes godmode from your character.",
|
||||
AllowServer = false
|
||||
});
|
||||
add(new Command(Permissions.heal, Heal, "heal")
|
||||
{
|
||||
HelpText = "Heals a player in HP and MP."
|
||||
|
|
@ -6450,15 +6455,20 @@ namespace TShockAPI
|
|||
|
||||
godPower.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"));
|
||||
}
|
||||
else
|
||||
if (playerToGod != args.Player)
|
||||
{
|
||||
args.Player.SendSuccessMessage(string.Format("{0} is {1} in god mode.", playerToGod.Name, playerToGod.GodMode ? "now" : "no longer"));
|
||||
playerToGod.SendSuccessMessage(string.Format("You are {0} in god mode.", playerToGod.GodMode ? "now" : "no longer"));
|
||||
}
|
||||
|
||||
playerToGod.SendSuccessMessage(string.Format("You are {0} in god mode.", args.Player.GodMode ? "now" : "no longer"));
|
||||
playerToGod.SendInfoMessage("Please make sure to disable godmode using /ungodme before disconnecting, otherwise your character may remain in godmode indefinitely, including singleplayer.");
|
||||
}
|
||||
|
||||
private static void ForceUngod(CommandArgs args)
|
||||
{
|
||||
var godPower = CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>();
|
||||
|
||||
godPower.SetEnabledState(args.Player.Index, false);
|
||||
}
|
||||
|
||||
#endregion Cheat Comamnds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue