Merge branch 'general-devel' of https://github.com/Pryaxis/TShock into general-devel
This commit is contained in:
commit
0b890f9507
4 changed files with 50 additions and 18 deletions
|
|
@ -37,6 +37,7 @@ using OTAPI.Tile;
|
|||
using TShockAPI.Localization;
|
||||
using System.Text.RegularExpressions;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.Creative;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -544,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."
|
||||
|
|
@ -5360,12 +5366,16 @@ namespace TShockAPI
|
|||
{
|
||||
args.Player.SendErrorMessage("You are muted.");
|
||||
}
|
||||
else if (args.Player.LastWhisper != null)
|
||||
else if (args.Player.LastWhisper != null && args.Player.LastWhisper.Active)
|
||||
{
|
||||
var msg = string.Join(" ", args.Parameters);
|
||||
args.Player.LastWhisper.SendMessage(String.Format("<From {0}> {1}", args.Player.Name, msg), Color.MediumPurple);
|
||||
args.Player.SendMessage(String.Format("<To {0}> {1}", args.Player.LastWhisper.Name, msg), Color.MediumPurple);
|
||||
}
|
||||
else if (args.Player.LastWhisper != null)
|
||||
{
|
||||
args.Player.SendErrorMessage("The player you're attempting to reply to is no longer online.");
|
||||
}
|
||||
else
|
||||
{
|
||||
args.Player.SendErrorMessage("You haven't previously received any whispers. Please use {0}whisper to whisper to other people.", Specifier);
|
||||
|
|
@ -6445,15 +6455,26 @@ namespace TShockAPI
|
|||
|
||||
playerToGod.GodMode = !playerToGod.GodMode;
|
||||
|
||||
if (playerToGod == args.Player)
|
||||
{
|
||||
args.Player.SendSuccessMessage(string.Format("You are {0} in god mode.", args.Player.GodMode ? "now" : "no longer"));
|
||||
}
|
||||
else
|
||||
var godPower = CreativePowerManager.Instance.GetPower<CreativePowers.GodmodePower>();
|
||||
|
||||
godPower.SetEnabledState(playerToGod.Index, playerToGod.GodMode);
|
||||
|
||||
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);
|
||||
|
||||
args.Player.SendSuccessMessage("Journey Godmode has been disabled on your character.");
|
||||
}
|
||||
|
||||
#endregion Cheat Comamnds
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue