本文整理汇总了C#中MUDEngine.CharData.GetTrust方法的典型用法代码示例。如果您正苦于以下问题:C# CharData.GetTrust方法的具体用法?C# CharData.GetTrust怎么用?C# CharData.GetTrust使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUDEngine.CharData
的用法示例。
在下文中一共展示了CharData.GetTrust方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Slay
/// <summary>
/// Immortal command to kill a character in cold blood.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Slay(CharData ch, string[] str)
{
if( ch == null ) return;
CharData realChar = ch.GetChar();
if (!realChar.Authorized("slay"))
{
return;
}
if (str.Length < 1 || String.IsNullOrEmpty(str[0]))
{
ch.SendText("Slay whom?\r\n");
return;
}
CharData victim = ch.GetCharRoom(str[0]);
if (!victim)
{
ch.SendText("They aren't even here.\r\n");
return;
}
if (ch == victim)
{
ch.SendText("You aren't powerful enough to kill yourself.\r\n");
return;
}
if (!victim.IsNPC() && victim.Level >= ch.Level)
{
ch.SendText("You failed.\r\n");
return;
}
if (str.Length > 1 && "immolate".StartsWith(str[1], StringComparison.CurrentCultureIgnoreCase))
{
SocketConnection.Act("Your &n&+rfi&+Rr&n&+re&+Rba&n&+rll&n turns $N into a blazing &n&+rinf&+Rer&+Yn&+Wo&n.",
ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act("$n releases a searing &n&+rfi&+Rr&n&+re&+Rba&n&+rll&n in your direction.",
ch, null, victim, SocketConnection.MessageTarget.victim);
SocketConnection.Act("$n points at $N, who bursts into a flaming &n&+rinf&+Rer&+Yn&+Wo&n.",
ch, null, victim, SocketConnection.MessageTarget.room_vict);
}
else if (str.Length > 1 && "pounce".StartsWith(str[1], StringComparison.CurrentCultureIgnoreCase) && ch.GetTrust() >= Limits.LEVEL_OVERLORD)
{
SocketConnection.Act("Leaping upon $N with bared &+Wfangs&n, you tear open $S throat and toss the &+Lcorpse&n to the &n&+yground&n...",
ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act("In a heartbeat, $n rips $s &+Wfangs&n through your throat! Your &+Rbl&n&+ro&+Ro&n&+rd&n sprays and pours to the &n&+yground&n as your life ends...",
ch, null, victim, SocketConnection.MessageTarget.victim);
SocketConnection.Act("Leaping suddenly, $n sinks $s &+Wfangs&n into $N's throat. As &+Rbl&n&+ro&+Ro&n&+rd&n sprays and gushes to the &n&+yground&n, $n tosses $N's dying body away.",
ch, null, victim, SocketConnection.MessageTarget.room_vict);
}
else if (str.Length > 1 && "shatter".StartsWith(str[1], StringComparison.CurrentCultureIgnoreCase))
{
SocketConnection.Act("You freeze $N with a glance and shatter the frozen &+Lcorpse&n into tiny &+Wsh&+Ca&+Wr&+Cds&n.",
ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act("$n freezes you with a glance and shatters your frozen body into tiny &+Wsh&+Ca&+Wr&+Cds&n.",
ch, null, victim, SocketConnection.MessageTarget.victim);
SocketConnection.Act("$n freezes $N with a simple look and shatters the frozen body into tiny &+Wsh&+Ca&+Wr&+Cds&n.",
ch, null, victim, SocketConnection.MessageTarget.room_vict);
}
else if (str.Length > 1 && "slit".StartsWith(str[1], StringComparison.CurrentCultureIgnoreCase) && ch.GetTrust() >= Limits.LEVEL_OVERLORD)
{
SocketConnection.Act("You calmly &+Lslit&n $N's throat.",
ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act("$n reaches out with a clawwed finger and calmly &+Lslits&n your throat.",
ch, null, victim, SocketConnection.MessageTarget.victim);
SocketConnection.Act("$n calmly &+Lslits&n $N's throat.",
ch, null, victim, SocketConnection.MessageTarget.room_vict);
}
else if (str.Length > 1 && "squeeze".StartsWith(str[1], StringComparison.CurrentCultureIgnoreCase))
{
SocketConnection.Act("You grasp $S head and squeeze it until it explodes in a bubble of &+Rbl&n&+ro&+Ro&n&+r&n!",
ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act("$n grasps your head and squeezes until your &+Wskull&n colapses!",
ch, null, victim, SocketConnection.MessageTarget.victim);
SocketConnection.Act("$n grasps $N's head and squeezes until it implodes!",
ch, null, victim, SocketConnection.MessageTarget.room_vict);
}
else
{
SocketConnection.Act("You &+Lslay&n $M in cold &+Rbl&n&+ro&+Ro&n&+rd&n!", ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act("$n &+Lslays&n you in cold &+Rbl&n&+ro&+Ro&n&+rd&n!", ch, null, victim, SocketConnection.MessageTarget.victim);
SocketConnection.Act("$n &+Lslays&n $N in cold &+Rbl&n&+ro&+Ro&n&+rd&n!", ch, null, victim, SocketConnection.MessageTarget.room_vict);
}
Combat.KillingBlow(ch, victim);
return;
}
示例2: HowSee
/// <summary>
/// Returns a visibility value based on how well the looker can see the target.
/// </summary>
/// <param name="ch"></param>
/// <param name="victim"></param>
/// <returns></returns>
public static Visibility HowSee(CharData ch, CharData victim)
{
if (ch == null)
{
Log.Error("how_see called with null ch.", 0);
return Visibility.invisible;
}
if (victim == null)
{
Log.Error("how_see called with null victim.", 0);
return Visibility.invisible;
}
// Char almost dead, or asleep.
if (ch.CurrentPosition <= Position.sleeping)
{
return Visibility.invisible;
}
// All mobiles cannot see wizinvised immortals.
if (ch.IsNPC() && !victim.IsNPC() && victim.HasActionBit(PC.PLAYER_WIZINVIS))
{
return Visibility.invisible;
}
// Handles Immortal Invis.
if (!victim.IsNPC() && victim.HasActionBit(PC.PLAYER_WIZINVIS)
&& ch.GetTrust() < victim.Level)
{
return Visibility.invisible;
}
// Handles Immmortal sight.
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_GODMODE))
{
return Visibility.visible;
}
// Handles blindness.
if (ch.IsAffected(Affect.AFFECT_BLIND))
{
return Visibility.invisible;
}
// Handles regular invisibility.
if ((victim.IsAffected(Affect.AFFECT_INVISIBLE) || victim.IsAffected(Affect.AFFECT_MINOR_INVIS)))
{
if (ch.HasInnate(Race.RACE_DETECT_INVIS) || ch.IsAffected(Affect.AFFECT_DETECT_INVIS)
|| (ch.IsAffected(Affect.AFFECT_ELEM_SIGHT) && (victim.GetRace() == Race.RACE_AIR_ELE
|| victim.GetRace() == Race.RACE_WATER_ELE || victim.GetRace() == Race.RACE_FIRE_ELE
|| victim.GetRace() == Race.RACE_EARTH_ELE)))
{
if (victim.IsAffected(Affect.AFFECT_HIDE))
{
if (ch.IsAffected(Affect.AFFECT_DETECT_HIDDEN))
{
return Visibility.visible;
}
if (ch.HasInnate(Race.RACE_DETECT_HIDDEN)
|| ch.IsAffected(Affect.AFFECT_SENSE_LIFE))
{
return Visibility.sense_hidden;
}
return Visibility.invisible;
}
return Visibility.visible;
}
}
// Handles dark rooms. Added ultracheck.
if (victim.InRoom.IsDark())
{
if (ch.HasInnate(Race.RACE_ULTRAVISION) || ch.IsAffected(Affect.AFFECT_ULTRAVISION))
{
return Visibility.visible;
}
if ((ch.HasInnate(Race.RACE_INFRAVISION) || ch.IsAffected(Affect.AFFECT_INFRAVISION))
&& !victim.InRoom.HasFlag(RoomTemplate.ROOM_UNDERWATER))
{
return Visibility.sense_infravision;
}
if (!(ch.HasInnate(Race.RACE_ULTRAVISION) || ch.IsAffected(Affect.AFFECT_ULTRAVISION)))
{
return Visibility.too_dark;
}
}
// Handles hidden people.
if (victim.IsAffected(Affect.AFFECT_HIDE))
{
if (ch.IsAffected(Affect.AFFECT_DETECT_HIDDEN))
{
return Visibility.visible;
//.........这里部分代码省略.........
示例3: Silence
/// <summary>
/// Immortal command to make a player shut up permanently.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Silence(CharData ch, string[] str)
{
if( ch == null ) return;
CharData victim;
CharData realChar = ch.GetChar();
if (!realChar.Authorized("silence"))
{
return;
}
if (str.Length == 0)
{
ch.SendText("Silence whom?\r\n");
return;
}
if (!(victim = ch.GetCharWorld(str[0])))
{
ch.SendText("They aren't here.\r\n");
return;
}
if (victim.IsNPC())
{
ch.SendText("Not on NPC's.\r\n");
return;
}
if (victim.GetTrust() >= ch.GetTrust())
{
ch.SendText("You failed.\r\n");
return;
}
if (victim.HasActionBit(PC.PLAYER_SILENCE))
{
victim.RemoveActionBit(PC.PLAYER_SILENCE);
victim.SendText("You can use channels again.\r\n");
ch.SendText("SILENCE removed.\r\n");
}
else
{
victim.SetActionBit(PC.PLAYER_SILENCE);
victim.SendText("You can't use channels!\r\n");
ch.SendText("SILENCE set.\r\n");
}
return;
}
示例4: Deny
/// <summary>
/// Deny a player access to the game.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Deny(CharData ch, string[] str)
{
if( ch == null ) return;
CharData realChar = ch.GetChar();
if (!realChar.Authorized("deny"))
{
return;
}
if (str.Length == 0)
{
ch.SendText("Deny whom?\r\n");
return;
}
CharData victim = ch.GetCharWorld(str[0]);
if (victim == null)
{
ch.SendText("They aren't here.\r\n");
return;
}
if (victim.IsNPC())
{
ch.SendText("Not on NPC's.\r\n");
return;
}
if (victim.GetTrust() >= ch.GetTrust())
{
ch.SendText("You failed.\r\n");
return;
}
victim.SetActionBit(PC.PLAYER_DENY);
victim.SendText("You are denied access!\r\n");
ch.SendText("Done.\r\n");
if (victim.Level <= 1)
{
CommandType.Interpret(victim, "quit");
}
return;
}
示例5: Freeze
/// <summary>
/// Immortal command to paralyze a player.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Freeze(CharData ch, string[] str)
{
if( ch == null ) return;
CharData victim;
CharData realChar = ch.GetChar();
if (!realChar.Authorized("freeze"))
{
return;
}
if (str.Length == 0)
{
ch.SendText("Freeze whom?\r\n");
return;
}
if (!(victim = ch.GetCharWorld(str[0])))
{
ch.SendText("They aren't here.\r\n");
return;
}
if (ch == victim && ch.HasActionBit(PC.PLAYER_FREEZE))
{
ch.RemoveActionBit(PC.PLAYER_FREEZE);
}
if (victim.IsNPC())
{
ch.SendText("Not on NPC's.\r\n");
return;
}
if (victim.GetTrust() >= ch.GetTrust())
{
ch.SendText("You failed.\r\n");
return;
}
if (victim.HasActionBit(PC.PLAYER_FREEZE))
{
victim.RemoveActionBit(PC.PLAYER_FREEZE);
ch.SendText("FREEZE bit removed.\r\n");
victim.SendText("You can play again.\r\n");
}
else
{
victim.SetActionBit(PC.PLAYER_FREEZE);
ch.SendText("FREEZE bit set.\r\n");
victim.SendText("You can't do anything!\r\n");
}
CharData.SavePlayer(victim);
return;
}
示例6: Advance
/// <summary>
/// Immortal command to change a player's level.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Advance(CharData ch, string[] str)
{
if( ch == null ) return;
CharData victim;
string text;
int level = 0;
int iLevel = 0;
CharData realChar = ch.GetChar();
if (!realChar.Authorized("advance"))
{
return;
}
if (str.Length < 2 || String.IsNullOrEmpty(str[0]) || String.IsNullOrEmpty(str[1]) || !MUDString.IsNumber(str[1]))
{
ch.SendText("Syntax: advance <char> <level>.\r\n");
return;
}
if (!(victim = ch.GetCharRoom(str[0])))
{
ch.SendText("That player is not here.\r\n");
return;
}
if (victim.IsNPC())
{
ch.SendText("Not on NPC's.\r\n");
return;
}
Int32.TryParse(str[1], out level);
if (level < 1 || level > Limits.MAX_LEVEL)
{
ch.SendText(String.Format("Advance within range 1 to {0}.\r\n", Limits.MAX_LEVEL));
return;
}
if (level > ch.GetTrust())
{
ch.SendText("Limited to your trust level.\r\n");
return;
}
/*
* Lower level:
* Reset to level 1.
* Then raise again.
* Currently, an imp can lower another imp.
*/
if (level <= victim.Level)
{
ch.SendText("Lowering a player's level!\r\n");
victim.SendText("**** OOOOHHHHHHHHHH NNNNOOOO ****\r\n");
victim.Level = 1;
// Max_hit should only be accessed for PERMENANT changes.
victim.MaxHitpoints = 20;
if (ch.CharacterClass.GainsMana)
{
victim.MaxMana = 50;
// Mana bonuses for newbies.
victim.MaxMana += (victim.GetCurrInt() / 10);
victim.MaxMana += (victim.GetCurrWis() / 14);
victim.MaxMana += (victim.GetCurrPow() / 7);
}
else
{
victim.MaxMana = 0;
}
victim.MaxMoves = 150;
// removed resetting of skills.
victim.Hitpoints = victim.GetMaxHit();
victim.CurrentMana = victim.MaxMana;
victim.CurrentMoves = victim.MaxMoves;
text = String.Format("{0} has been demoted to level {1} by {2}", victim.Name,
level, ch.Name);
ImmortalChat.SendImmortalChat(victim, ImmortalChat.IMMTALK_LEVELS, realChar.GetTrust(), text);
}
else
{
ch.SendText("Raising a player's level!\r\n");
victim.SendText("**** OOOOHHHHHHHHHH YYYYEEEESSS ****\r\n");
text = String.Format("{0} has been advanced to level {1} by {2}", victim.Name,
level, ch.Name);
ImmortalChat.SendImmortalChat(victim, ImmortalChat.IMMTALK_LEVELS, realChar.GetTrust(), text);
}
// Do not advance skills -- rerolling someone will auto-master
// their skills with no effort from the player... so we advance
// them with skills set to false -- Xangis
for (iLevel = victim.Level; iLevel < level; iLevel++)
//.........这里部分代码省略.........
示例7: Clone
/// <summary>
/// Make a clone of something.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Clone(CharData ch, string[] str)
{
if( ch == null ) return;
string text;
Object obj;
CharData mob;
if (str.Length == 0)
{
ch.SendText("Clone what?\r\n");
return;
}
if (str.Length > 1 && !MUDString.IsPrefixOf(str[0], "object"))
{
mob = null;
obj = ch.GetObjHere(str[1]);
if (obj == null)
{
ch.SendText("You don't see that here.\r\n");
return;
}
}
else if (str.Length > 1 && !MUDString.IsPrefixOf(str[0], "mobile") || (!MUDString.IsPrefixOf(str[0], "character")))
{
obj = null;
mob = ch.GetCharRoom(str[1]);
if (mob == null)
{
ch.SendText("You don't see that here.\r\n");
return;
}
}
else
{
mob = ch.GetCharRoom(str[0]);
obj = ch.GetObjHere(str[0]);
if (mob == null && obj == null)
{
ch.SendText("You don't see that here.\r\n");
return;
}
}
/* clone object */
if (obj != null)
{
Object clone = Database.CreateObject(obj.ObjIndexData, 0);
Database.CloneObject(obj, ref clone);
if (obj.CarriedBy != null)
{
clone.ObjToChar(ch);
}
else
{
clone.AddToRoom(ch.InRoom);
}
Object.RecursiveClone(ch, obj, clone);
SocketConnection.Act("$n has created $p.", ch, clone, null, SocketConnection.MessageTarget.room);
SocketConnection.Act("You clone $p.", ch, clone, null, SocketConnection.MessageTarget.character);
text = String.Format("{0} clones {1}.", ch.Name, clone.ShortDescription);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOAD, ch.GetTrust(), text);
return;
}
if (mob != null)
{
if (!mob.IsNPC())
{
ch.SendText("You can only clone mobiles.\r\n");
return;
}
CharData clone = Database.CreateMobile(mob.MobileTemplate);
Database.CloneMobile(mob, clone);
foreach (Object obj2 in mob.Carrying)
{
Object newObj = Database.CreateObject(obj2.ObjIndexData, 0);
Database.CloneObject(obj2, ref newObj);
Object.RecursiveClone(ch, obj2, newObj);
newObj.ObjToChar(clone);
newObj.WearLocation = obj2.WearLocation;
}
clone.AddToRoom(ch.InRoom);
SocketConnection.Act("$n has created $N.", ch, null, clone, SocketConnection.MessageTarget.room);
SocketConnection.Act("You clone $N.", ch, null, clone, SocketConnection.MessageTarget.character);
text = String.Format("{0} clones {1}.", ch.Name, clone.ShortDescription);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOAD, ch.GetTrust(), text);
return;
}
}
示例8: KillProcess
/// <summary>
/// Command to kill the MUD process. If that's not dangerous, I don't know what is.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void KillProcess(CharData ch, string[] str)
{
if( ch == null ) return;
ch = ch.GetChar();
if( ch.GetTrust() < Limits.LEVEL_OVERLORD )
return;
Log.Info("MUD Process terminated with KillProcess command by " + ch.Name);
Environment.Exit(0);
}
示例9: LoadObject
public static void LoadObject(CharData ch, string[] str)
{
if( ch == null ) return;
ObjTemplate objTemplate;
int level;
CharData realChar = ch.GetChar();
if (str.Length < 1 || String.IsNullOrEmpty(str[0]) || !MUDString.IsNumber(str[0]))
{
ch.SendText("Syntax: load object <index number> <level>.\r\n");
return;
}
if (str.Length < 2 || String.IsNullOrEmpty(str[1]))
{
level = ch.GetTrust();
}
else
{
if (!MUDString.IsNumber(str[1]))
{
ch.SendText("Syntax: load object <index number> <level>.\r\n");
return;
}
Int32.TryParse(str[1], out level);
if (level < 0 || level > ch.GetTrust())
{
ch.SendText("Limited to your trust level, which is " + ch.GetTrust() + ".\r\n");
return;
}
}
int indexNumber;
Int32.TryParse(str[0], out indexNumber);
if (!(objTemplate = Database.GetObjTemplate(indexNumber)))
{
ch.SendText("No object has that index number.\r\n");
return;
}
Object obj = Database.CreateObject(objTemplate, level);
if (obj.HasWearFlag(ObjTemplate.WEARABLE_CARRY))
{
obj.ObjToChar(ch);
}
else
{
obj.AddToRoom(ch.InRoom);
SocketConnection.Act("$n&n has created $p&n!", ch, obj, null, SocketConnection.MessageTarget.room);
}
ch.SendText("Done.\r\n");
string text = String.Format("{0} has loaded {1} at {2} [{3}]", ch.Name, obj.ShortDescription,
ch.InRoom.Title, ch.InRoom.IndexNumber);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOAD, realChar.GetTrust(), text);
return;
}
示例10: Quit
/// <summary>
/// Called when a player quits or when camping preparations are complete.
/// </summary>
public static void Quit(CharData ch)
{
if (ch == null)
{
Log.Error("Quit: Called with null character.");
return;
}
try
{
if (ch.HasActionBit(PC.PLAYER_CAMPING))
{
ch.RemoveActionBit(PC.PLAYER_CAMPING);
Act("You climb into your bedroll and leave the realm.", ch, null, null, MessageTarget.character);
if (ch.Gender == MobTemplate.Sex.male)
Act("$n&n climbs into his bedroll and leaves the realm.", ch, null, null, MessageTarget.room);
else if (ch.Gender == MobTemplate.Sex.female)
Act("$n&n climbs into her bedroll and leaves the realm.", ch, null, null, MessageTarget.room);
else
Act("$n&n climbs into its bedroll and leaves the realm.", ch, null, null, MessageTarget.room);
string text = String.Format("{0} has camped out.", ch.Name);
Log.Trace(text);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOGINS, ch.GetTrust(), text);
}
else
{
ch.SendText("You leave the realm.\r\n\r\n");
Act("$n&n has left the realm.", ch, null, null, MessageTarget.room);
Log.Trace(String.Format("{0} has camped out.", ch.Name));
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOGINS, ch.GetTrust(), String.Format("{0} has camped out.", ch.Name));
}
// I know we checked for position fighting, but I'm paranoid...
if (ch.Fighting)
{
Combat.StopFighting(ch, true);
}
ch.DieFollower(ch.Name);
Room room = null;
if (ch.InRoom)
{
room = ch.InRoom;
}
ch.RemoveFromRoom();
if (room != null)
{
ch.InRoom = room;
((PC)ch).LastRentLocation = ch.InRoom.IndexNumber;
}
// Put them in the correct body
if (ch && ch.Socket && ch.Socket.Original)
{
CommandType.Interpret(ch, "return");
}
CharData.SavePlayer(ch);
Database.CharList.Remove(ch);
if (ch && ch.Socket)
{
ch.Socket.ShowScreen(Screen.MainMenuScreen);
ch.Socket.ConnectionStatus = ConnectionState.menu;
}
}
catch (Exception ex)
{
Log.Error("Error in SocketConnection.Quit: " + ex.ToString());
}
return;
}
示例11: Hometown
public static void Hometown(CharData ch, string[] str)
{
if( ch == null ) return;
if (ch == null)
{
Log.Error("Command.Hometown: No ch!", 0);
return;
}
if (!ch.IsGuild() && !ch.IsImmortal())
{
ch.SendText("You don't have the power to do this.\r\n");
return;
}
if (ch.IsNPC())
return;
if (!ch.InRoom.HasFlag(RoomTemplate.ROOM_GUILDROOM))
{
ch.SendText("You can't set your hometown here!\r\n");
return;
}
if (ch.CurrentPosition == Position.fighting || ch.Fighting)
{
ch.SendText("No way! You are fighting.\r\n");
return;
}
if (ch.CurrentPosition < Position.stunned)
{
ch.SendText("You're not &+RD&n&+rE&+RA&n&+rD&n yet.\r\n");
return;
}
string logBuf = String.Format("{0} is resetting their hometown to {1}.", ch.Name, ch.InRoom.IndexNumber);
Log.Trace(logBuf);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOGINS, ch.GetTrust(), logBuf);
// I can't see any reason why ch would not have an .in_room, but that
// may just be shortsighted of me - Xangis
if (!ch.InRoom)
{
Log.Error("Commandhometown: ch not in a room!", 0);
return;
}
// Put them in the correct body
if (ch.Socket && ch.Socket.Original)
{
CommandType.Interpret(ch, "return");
}
ch.SendText("You Reset your hometown.\r\n");
((PC)ch).CurrentHome = ch.InRoom.IndexNumber;
CharData.SavePlayer(ch);
return;
}
示例12: CanSee
/// <summary>
/// True if char can see victim.
///
/// This is only a straightford all-or-none vision checker.
///
/// If you need more granularity, use Command.HowSee which returns an enum
/// based on the level of visibility but otherwise functions similarly.
/// </summary>
/// <param name="ch"></param>
/// <param name="victim"></param>
/// <returns></returns>
public static bool CanSee( CharData ch, CharData victim )
{
if( ch == null )
{
Log.Error( "CharData.CanSee: called with null ch.", 0 );
return false;
}
if( victim == null )
{
Log.Error( "CharData.CanSee: called with null victim.", 0 );
return false;
}
if( ch == victim )
{
return true;
}
/* All mobiles cannot see wizinvised immorts */
if (ch.IsNPC() && !ch.IsNPC() && ch.HasActionBit(PC.PLAYER_WIZINVIS))
{
return false;
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_WIZINVIS) && ch.GetTrust() < ch.Level)
{
return false;
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_GODMODE))
{
return true;
}
if( ch.IsAffected( Affect.AFFECT_BLIND ) )
{
return false;
}
if (ch.InRoom == null)
{
Log.Error("CanSee called by player " + ch.Name + " with null room.");
return false;
}
if( ch.InRoom.IsDark() && !ch.HasInnate( Race.RACE_ULTRAVISION )
&& !ch.IsAffected( Affect.AFFECT_ULTRAVISION ) && !ch.HasInnate( Race.RACE_INFRAVISION )
&& !ch.IsAffected(Affect.AFFECT_INFRAVISION ) )
{
return false;
}
if (ch.CurrentPosition == Position.dead)
{
return true;
}
if ((victim.IsAffected(Affect.AFFECT_INVISIBLE) || victim.IsAffected(Affect.AFFECT_MINOR_INVIS))
&& !ch.HasInnate( Race.RACE_DETECT_INVIS ) && !ch.IsAffected(Affect.AFFECT_DETECT_INVIS )
&& !(ch.IsAffected(Affect.AFFECT_ELEM_SIGHT) &&
( ch.GetRace() == Race.RACE_AIR_ELE || ch.GetRace() == Race.RACE_WATER_ELE
|| ch.GetRace() == Race.RACE_FIRE_ELE || ch.GetRace() == Race.RACE_EARTH_ELE ) ) )
{
return false;
}
if( victim.IsAffected( Affect.AFFECT_HIDE ) && !ch.HasInnate( Race.RACE_DETECT_HIDDEN )
&& !ch.IsAffected( Affect.AFFECT_DETECT_HIDDEN ) && !ch.Fighting )
{
return false;
}
return true;
}
示例13: ShowCharacterToCharacterAbbreviated
//.........这里部分代码省略.........
if (victim.CurrentPosition == Position.standing && victim.CanFly())
{
text += "flying";
}
else
{
text += Position.PositionString(victim.CurrentPosition);
}
text += " here";
if (victim.Fighting != null)
{
text += "&n fighting ";
if (victim.Fighting == ch)
{
text += "&nyou!";
}
else if (victim.InRoom == victim.Fighting.InRoom)
{
text += victim.Fighting.ShowNameTo(ch, false);
}
else
{
text += "&nsomeone who left??";
}
}
if (victim.Riding && victim.Riding.InRoom == victim.InRoom)
{
text += "&n, mounted on " + victim.Riding.ShowNameTo(ch, false);
}
text += "&n.";
}
if (victim.IsAffected(Affect.AFFECT_CASTING))
{
text += "&n&+y (casting)&n";
}
if (victim.IsAffected(Affect.AFFECT_MINOR_PARA))
{
text += "&n (&+Yparalyzed)&n";
}
if (!victim.IsNPC() && victim.HasActionBit(PC.PLAYER_WIZINVIS)
&& victim.GetTrust() <= ch.GetTrust())
{
text += " &n&+g*&n";
}
if (victim.IsAffected(Affect.AFFECT_HIDE) && (ch.IsAffected(Affect.AFFECT_DETECT_HIDDEN) ||
ch.HasInnate(Race.RACE_DETECT_HIDDEN)))
{
text += " &n(&+LHiding&n)";
}
if (victim.IsAffected(Affect.AFFECT_CHARM) && ch.HasActionBit(PC.PLAYER_GODMODE))
{
text += " &n(&n&+mCharmed&n)";
}
if ((victim.IsAffected(Affect.AFFECT_PASS_DOOR) || victim.HasInnate(Race.RACE_PASSDOOR))
&& ch.HasActionBit(PC.PLAYER_GODMODE))
{
text += " &n(&+WTranslucent&n)";
}
if ((victim.GetRace() == Race.RACE_UNDEAD || victim.GetRace() == Race.RACE_VAMPIRE)
&& (ch.IsAffected( Affect.AFFECT_DETECT_UNDEAD) || ch.HasActionBit(PC.PLAYER_GODMODE)))
{
text += " &n(&+WPale&n)";
}
if (victim.IsAffected(Affect.AFFECT_FAERIE_FIRE))
{
text += " &n(&n&+mFa&+Me&n&+mr&+Mie&+L Aura&n)";
}
if (victim.IsEvil() && (ch.IsAffected(Affect.AFFECT_DETECT_EVIL)
|| ch.HasInnate(Race.RACE_DETECT_ALIGN)
|| ch.IsClass(CharClass.Names.paladin)
|| ch.IsClass(CharClass.Names.antipaladin)))
{
text += " &n(&+rBlood&+L Aura&n)";
}
if (victim.IsGood() && (ch.IsAffected(Affect.AFFECT_DETECT_GOOD)
|| ch.HasInnate(Race.RACE_DETECT_ALIGN)
|| ch.IsClass(CharClass.Names.paladin)
|| ch.IsClass(CharClass.Names.antipaladin)))
{
text += " &n(&+CLight&+L Aura&n)";
}
if (victim.IsAffected(Affect.AFFECT_SANCTUARY))
{
text += " &n(&+WWhite&+L Aura&n)";
}
if (!victim.IsNPC() && victim.HasActionBit(PC.PLAYER_AFK))
{
text += " &n&+b(&+RAFK&n&+b)&n";
}
if (!victim.IsNPC() && victim.HasActionBit(PC.PLAYER_BOTTING))
{
text += " &n&+b(&+YBot&n&+b)&n";
}
text += "\r\n";
ch.SendText(text);
return;
}
示例14: ShowCharacterToCharacter
/// <summary>
/// Shows a list of characters to the looker. This is used for displaying the mobs that are in a room.
/// </summary>
/// <param name="list"></param>
/// <param name="ch"></param>
public static void ShowCharacterToCharacter(List<CharData> list, CharData ch)
{
if (list.Count == 0)
{
return;
}
foreach (CharData listChar in list)
{
if (listChar == ch)
continue;
if (listChar.FlightLevel != ch.FlightLevel)
continue;
if (!listChar.IsNPC() && listChar.HasActionBit(PC.PLAYER_WIZINVIS) && ch.GetTrust() < listChar.GetTrust())
continue;
Visibility sight = HowSee(ch, listChar);
if (sight == Visibility.visible)
{
ShowCharacterToCharacterAbbreviated(listChar, ch);
}
else if (sight == Visibility.sense_infravision)
{
ch.SendText(String.Format("&+rYou see the red shape of a {0} living being here.&n\r\n", Race.SizeString(listChar.CurrentSize)));
}
else if (sight == Visibility.sense_hidden)
{
ch.SendText("&+LYou sense a lifeform nearby.&n\r\n");
}
else if (sight == Visibility.invisible && (listChar.Riding)
&& HowSee(ch, listChar.Riding) != Visibility.invisible)
{
listChar.Riding.Rider = null;
ShowCharacterToCharacterAbbreviated(listChar.Riding, ch);
listChar.Riding.Rider = listChar.Riding;
}
}
}
示例15: Snoop
/// <summary>
/// Spy on the input and output of a character.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Snoop(CharData ch, string[] str)
{
if( ch == null ) return;
SocketConnection socket;
CharData realChar = ch.GetChar();
if (!realChar.Authorized("snoop"))
{
return;
}
if (str.Length == 0)
{
ch.SendText("Snoop whom?\r\n");
return;
}
CharData victim = ch.GetCharWorld(str[0]);
if (!victim)
{
ch.SendText("They aren't here.\r\n");
return;
}
if (!victim.Socket)
{
ch.SendText("No descriptor to snoop.\r\n");
return;
}
if (victim == ch)
{
ch.SendText("Cancelling all snoops.\r\n");
foreach (SocketConnection it in Database.SocketList)
{
socket = it;
if (socket.SnoopBy == ch.Socket)
{
socket.SnoopBy = null;
}
}
return;
}
if (victim.Socket.SnoopBy != null)
{
ch.SendText("Busy already.\r\n");
return;
}
if (victim.GetTrust() >= ch.GetTrust() && MUDString.StringsNotEqual(ch.Name, "Xangis"))
{
ch.SendText("You failed.\r\n");
return;
}
if (ch.Socket)
{
for (socket = ch.Socket.SnoopBy; socket; socket = socket.SnoopBy)
{
if (socket.Character == victim || socket.Original == victim)
{
ch.SendText("No snoop loops.\r\n");
return;
}
}
}
victim.Socket.SnoopBy = ch.Socket;
ch.SendText("Done.\r\n");
string text = String.Format("{0} is snooping {1}", ch.Name, victim.Name);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_SNOOPS, realChar.GetTrust(), text);
return;
}