本文整理汇总了C#中MUDEngine.CharData.AffectStrip方法的典型用法代码示例。如果您正苦于以下问题:C# CharData.AffectStrip方法的具体用法?C# CharData.AffectStrip怎么用?C# CharData.AffectStrip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUDEngine.CharData
的用法示例。
在下文中一共展示了CharData.AffectStrip方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fortitude
public static void Fortitude(CharData ch, string[] str)
{
if( ch == null ) return;
string arg = String.Empty;
int amount;
if (ch.IsNPC() || ((PC)ch).SkillAptitude["fortitude"] == 0)
{
ch.SendText("Try all you will, but you're still your plain self.\r\n");
return;
}
if (!MUDString.StringsNotEqual(arg, "off"))
{
if (ch.HasAffect( Affect.AffectType.skill, "fortitude"))
{
//strip the affect
ch.AffectStrip( Affect.AffectType.skill, "fortitude");
}
else
{
ch.SendText("You are not using fortitude.\r\n");
}
return;
}
if (((PC)ch).SkillAptitude["fortitude"] >= 95)
amount = 15;
else if (((PC)ch).SkillAptitude["fortitude"] >= 60)
amount = 10;
else
amount = 5;
Affect af = new Affect(Affect.AffectType.skill, "fortitude", 5 * ch.Level, Affect.Apply.constitution, amount, Affect.AFFECT_NONE);
ch.AddAffect(af);
ch.SendText("You feel more fortified.\r\n");
}
示例2: Charm
public static void Charm(CharData ch, string[] str)
{
if( ch == null ) return;
string arg = String.Empty;
int amount;
if (!ch.HasSkill("charm of the otter"))
{
ch.SendText("Try all you will, but you're still your plain self.\r\n");
return;
}
if (!MUDString.StringsNotEqual(arg, "off"))
{
if (ch.HasAffect( Affect.AffectType.skill, "charm of the otter"))
{
//strip the affect
ch.AffectStrip( Affect.AffectType.skill, "charm of the otter");
}
else
{
ch.SendText("You are not using charm of the otter.\r\n");
}
return;
}
if (((PC)ch).SkillAptitude["charm of the otter"] >= 95)
amount = 15;
else if (((PC)ch).SkillAptitude["charm of the otter"] >= 60)
amount = 10;
else
amount = 5;
Affect af = new Affect(Affect.AffectType.skill, "charm of the otter", 5 * ch.Level, Affect.Apply.charisma, amount, Affect.AFFECT_NONE);
ch.AddAffect(af);
ch.SendText("You feel more charasmatic!\r\n");
}
示例3: Endurance
public static void Endurance(CharData ch, string[] str)
{
if( ch == null ) return;
string arg = String.Empty;
int amount;
if (ch.IsNPC() || ((PC)ch).SkillAptitude["endurance"] == 0)
{
ch.SendText("Try all you will, but you're still your plain self.\r\n");
return;
}
if (!MUDString.StringsNotEqual(arg, "off"))
{
if (ch.HasAffect( Affect.AffectType.skill, "endurance"))
{
//strip the affect
ch.AffectStrip( Affect.AffectType.skill, "endurance");
}
else
{
ch.SendText("You are not using endurance.\r\n");
}
return;
}
if (((PC)ch).SkillAptitude["endurance"] >= 95)
amount = 15;
else if (((PC)ch).SkillAptitude["endurance"] >= 60)
amount = 10;
else
amount = 5;
Affect af = new Affect(Affect.AffectType.skill, "endurance", 5 * ch.Level, Affect.Apply.move, amount, Affect.AFFECT_MOVEMENT_INCREASED);
ch.AddAffect(af);
ch.SendText("You feel the endurance of the mountains in your muscles!\r\n");
}
示例4: Savvy
public static void Savvy(CharData ch, string[] str)
{
if( ch == null ) return;
string arg = String.Empty;
int amount;
if (ch.IsNPC() || ((PC)ch).SkillAptitude["savvy"] == 0)
{
ch.SendText("Try all you will, but you're still your plain self.\r\n");
return;
}
if (!MUDString.StringsNotEqual(arg, "off"))
{
if (ch.HasAffect( Affect.AffectType.skill, "savvy"))
{
//strip the affect
ch.AffectStrip( Affect.AffectType.skill, "savvy");
}
else
{
ch.SendText("You are not using savvy.\r\n");
}
return;
}
if (((PC)ch).SkillAptitude["savvy"] >= 95)
amount = 15;
else if (((PC)ch).SkillAptitude["savvy"] >= 60)
amount = 10;
else
amount = 5;
Affect af = new Affect(Affect.AffectType.skill, "savvy", 5 * ch.Level, Affect.Apply.strength, amount, Affect.AFFECT_STRENGTH_INCREASED);
ch.AddAffect(af);
ch.SendText("You feel more savvy.\r\n");
}
示例5: Shadow
public static void Shadow(CharData ch, string[] str)
{
if( ch == null ) return;
Affect af = new Affect();
if (!ch.IsNPC()
&& !ch.HasSkill("shadow form"))
{
ch.SendText("You don't know how to take shadow form.\r\n");
return;
}
ch.SendText("You attempt to move in the shadows.\r\n");
ch.AffectStrip( Affect.AffectType.skill, "shadow form");
if (ch.CheckSkill("shadow form"))
{
af.Value = "shadow form";
af.Type = Affect.AffectType.skill;
af.Duration = ch.Level;
af.SetBitvector(Affect.AFFECT_SNEAK);
ch.AddAffect(af);
}
ch.WaitState(10);
return;
}
示例6: InflictSpellDamage
//.........这里部分代码省略.........
/*
* Stop up any residual loopholes.
*/
// 1275 is average damage from Akiaurn's Power Word
// I changed this to reflect that.
if( ( dam > 1275 ) && ch.Level < Limits.LEVEL_AVATAR && ch.GetRace() != Race.RACE_DRAGON )
{
string buf3;
if( ch.IsNPC() && ch.Socket )
buf3 = String.Format(
"Spell_Damage: {0} from {1} by {2}: > 1275 points with {3} spell!",
dam, ch.Name, ch.Socket.Original.Name, spell.Name );
else
buf3 = String.Format(
"Spell_Damage: {0} from {1}: > 1275 points with {2} spell!",
dam, ch.IsNPC() ? ch.ShortDescription : ch.Name, spell.Name );
Log.Error( buf3, 0 );
dam = 1275;
}
if (victim.IsAffected( Affect.AFFECT_MINOR_PARA)
&& !( victim.GetRace() == Race.RACE_FIRE_ELE && damType == AttackType.DamageType.fire )
&& !( victim.GetRace() == Race.RACE_WATER_ELE && damType == AttackType.DamageType.water )
&& !( victim.GetRace() == Race.RACE_EARTH_ELE && damType == AttackType.DamageType.earth )
&& !( victim.GetRace() == Race.RACE_AIR_ELE && damType == AttackType.DamageType.wind ) )
{
SocketConnection.Act( "$n&n disrupts the magic preventing $N&n from moving.", ch, null, victim, SocketConnection.MessageTarget.room_vict );
SocketConnection.Act( "You disrupt the magic preventing $N&n from moving.", ch, null, victim, SocketConnection.MessageTarget.character );
SocketConnection.Act( "&+YYou can move again.&n", ch, null, victim, SocketConnection.MessageTarget.victim );
victim.RemoveAffect( Affect.AFFECT_MINOR_PARA );
victim.AffectStrip( Affect.AffectType.spell, "earthen grasp" );
victim.AffectStrip( Affect.AffectType.spell, "greater earthen grasp");
}
bool immune = false;
if( victim != ch )
{
/*
* Certain attacks are forbidden.
* Most other attacks are returned.
*/
if( IsSafe( ch, victim ) )
return false;
// is_safe could wipe out victim, as it calls procs if a boss
// check and see that victim is still valid
if( !victim )
return true;
Crime.CheckAttemptedMurder( ch, victim );
if( victim.CurrentPosition > Position.stunned
&& !( victim.GetRace() == Race.RACE_FIRE_ELE && damType == AttackType.DamageType.fire )
&& !( victim.GetRace() == Race.RACE_WATER_ELE && damType == AttackType.DamageType.water )
&& !( victim.GetRace() == Race.RACE_EARTH_ELE && damType == AttackType.DamageType.earth )
&& !( victim.GetRace() == Race.RACE_AIR_ELE && damType == AttackType.DamageType.wind ) )
{
// Offensive spells engage victim if not fighting, and
// caster only if neither are fighting.
if( !victim.Fighting && victim.InRoom == ch.InRoom
&& victim.FlightLevel == ch.FlightLevel )
{
SetFighting( victim, ch );
if( !ch.Fighting )
SetFighting( ch, victim );
示例7: ApplyPoison
public static void ApplyPoison( CharData ch )
{
Affect af = new Affect();
bool isSpell = false;
foreach (Affect aff in ch.Affected)
{
if( aff.Type == Affect.AffectType.spell && aff.Value == "poison" )
{
isSpell = true;
}
else if ((aff.Type == Affect.AffectType.skill && aff.Value == "poison weapon" || aff.Value == "poison bite") )
{
foreach (AffectApplyType apply in aff.Modifiers)
{
if (apply.Location != Affect.Apply.none || ch.IsAffected(Affect.AFFECT_SLOW_POISON) && MUDMath.NumberBits(1) == 0)
continue;
Poison.Type poisonType = (Poison.Type)apply.Amount;
int dam;
switch (poisonType)
{
case Poison.Type.damage:
SocketConnection.Act("$n&n goes into a brief siezure as the poison courses through $s body.", ch, null, null, SocketConnection.MessageTarget.room);
ch.SendText("Your muscles twitch randomly as the poison courses through your body.\r\n");
dam = MUDMath.Dice(1, 10);
if (!Magic.SpellSavingThrow(aff.Level, ch, AttackType.DamageType.poison))
InflictDamage(ch, ch, dam, "poison weapon", ObjTemplate.WearLocation.none, AttackType.DamageType.poison);
else
InflictDamage(ch, ch, dam / 2, "poison weapon", ObjTemplate.WearLocation.none, AttackType.DamageType.poison);
return;
case Poison.Type.attributes:
if (!Magic.SpellSavingThrow(aff.Level, ch, AttackType.DamageType.poison))
{
int lev = aff.Level;
ch.AffectStrip(Affect.AffectType.skill, "poison weapon");
af.Type = Affect.AffectType.skill;
af.Value = "poison";
af.Duration = lev / 4;
af.Level = lev;
af.AddModifier(Affect.Apply.strength, 0 - MUDMath.Dice(1, 20));
af.AddModifier(Affect.Apply.dexterity, 0 - MUDMath.Dice(1, 20));
af.AddModifier(Affect.Apply.agility, 0 - MUDMath.Dice(1, 20));
af.AddModifier(Affect.Apply.constitution, 0 - MUDMath.Dice(1, 20));
af.SetBitvector(Affect.AFFECT_POISON);
ch.AddAffect(af);
ch.SendText("You suddenly feel quite weak as the poison is distributed through your body.&n\r\n");
SocketConnection.Act("$n&n pales visibly and looks much weaker.", ch, null, null, SocketConnection.MessageTarget.room);
return;
}
ch.SendText("You feel the poison working its way into your system.\r\n");
InflictDamage(ch, ch, 2, "poison weapon", ObjTemplate.WearLocation.none, AttackType.DamageType.poison);
break;
case Poison.Type.damage_major:
dam = MUDMath.Dice(10, 10);
SocketConnection.Act("$n&n screams in agony as the poison courses through $s body.", ch, null, null, SocketConnection.MessageTarget.room);
ch.SendText("&+RYour blood is on fire!&n\r\n");
if (!Magic.SpellSavingThrow(aff.Level, ch, AttackType.DamageType.poison))
InflictDamage(ch, ch, dam, "poison weapon", ObjTemplate.WearLocation.none, AttackType.DamageType.poison);
else
InflictDamage(ch, ch, dam / 2, "poison weapon", ObjTemplate.WearLocation.none, AttackType.DamageType.poison);
return;
case Poison.Type.minor_para:
if (!Magic.SpellSavingThrow(aff.Level, ch, AttackType.DamageType.poison))
{
ch.AffectStrip(Affect.AffectType.skill, "poison_weapon");
af.Value = "poison";
af.Type = Affect.AffectType.skill;
af.Duration = MUDMath.NumberRange(1, 10);
af.SetBitvector(Affect.AFFECT_MINOR_PARA);
ch.AddAffect(af);
ch.SendText("&+YYou are paralyzed!&n\r\n");
StopFighting(ch, false);
SocketConnection.Act("$n&n&+y is suddenly overcome with rigor and cannot move.&n",
ch, null, null, SocketConnection.MessageTarget.room);
}
break;
case Poison.Type.minor_para_extended:
if (!Magic.SpellSavingThrow(aff.Level, ch, AttackType.DamageType.poison))
{
ch.AffectStrip(Affect.AffectType.skill, "poison_weapon");
af.Value = "poison";
af.Type = Affect.AffectType.skill;
af.Duration = MUDMath.NumberRange(5, 30);
af.SetBitvector(Affect.AFFECT_MINOR_PARA);
ch.AddAffect(af);
ch.SendText("&+YYou are paralyzed!&n\r\n");
StopFighting(ch, false);
SocketConnection.Act("$n&n&+y is suddenly overcome with rigor and cannot move.&n",
ch, null, null, SocketConnection.MessageTarget.room);
}
break;
case Poison.Type.major_para:
if (!Magic.SpellSavingThrow(aff.Level, ch, AttackType.DamageType.poison))
{
ch.AffectStrip(Affect.AffectType.skill, "poison_weapon");
af.Value = "poison";
af.Type = Affect.AffectType.skill;
af.Duration = MUDMath.NumberRange(1, 10);
af.SetBitvector(Affect.AFFECT_HOLD);
//.........这里部分代码省略.........
示例8: StopFollower
public static void StopFollower( CharData ch )
{
if( !ch )
{
Log.Error("StopFollower called with no CH argument.\r\n", 0);
return;
}
if( !ch.Master )
{
Log.Error("StopFollower: null master.", 0);
return;
}
if( ch.IsAffected( Affect.AFFECT_CHARM ) )
{
ch.RemoveAffect(Affect.AFFECT_CHARM);
ch.AffectStrip( Affect.AffectType.spell, "domination");
}
if( ch.Master != ch && CanSee( ch.Master, ch ) && ch.Master.InRoom )
SocketConnection.Act( "$n&n stops following you.", ch, null, ch.Master, SocketConnection.MessageTarget.victim );
if( ch.InRoom )
SocketConnection.Act( "You stop following $N&n.", ch, null, ch.Master, SocketConnection.MessageTarget.character );
// Remove the follower from the list of followers
foreach( CharData follower in ch.Master.Followers )
{
if( follower == ch )
{
ch.Master.Followers.Remove( follower );
}
}
ch.Master = null;
return;
}
示例9: Interpret
//.........这里部分代码省略.........
// Break sneak, hide, and invis
// Anything that will break hide OR invis will break concealment
// This is DUMB! Breaks invis w/backstab on a target that's not
// there: i.e. "backstab trolll"/"backstab humann" . vis and no
// attack! - (Should be handled with make_vis function).
if (CommandTable[cmd].BreakInvisibility)
{
if (ch.IsAffected(Affect.AFFECT_INVISIBLE))
{
ch.RemoveAffect(Affect.AFFECT_INVISIBLE);
ch.RemoveAffect(Affect.AFFECT_HIDE);
ch.RemoveAffect(Affect.AFFECT_MINOR_INVIS);
SocketConnection.Act("$n&n snaps into visibility.", ch, null, null, SocketConnection.MessageTarget.room);
ch.SendText("You snap into visibility.\r\n");
}
else if (ch.IsAffected(Affect.AFFECT_MINOR_INVIS))
{
ch.RemoveAffect(Affect.AFFECT_INVISIBLE);
ch.RemoveAffect(Affect.AFFECT_HIDE);
ch.RemoveAffect(Affect.AFFECT_MINOR_INVIS);
ch.SendText("You appear.\r\n");
}
}
if (CommandTable[cmd].BreakHide)
{
if (ch.IsAffected(Affect.AFFECT_MINOR_INVIS))
{
ch.SendText("You appear.\r\n");
}
ch.AffectStrip( Affect.AffectType.skill, "shadow form");
ch.RemoveAffect( Affect.AFFECT_HIDE );
ch.RemoveAffect(Affect.AFFECT_MINOR_INVIS);
}
}
// Command was not found, respond accordingly.
else
{
// Look for command in socials table.
if (!Database.SocialList.CheckSocial(ch, command, argument))
{
if (!ch.IsNPC() && !MUDString.IsPrefixOf(command, "petition"))
{
string logBuf = String.Format("Log {0}: {1}", ch.Name, logline);
Log.Trace(logBuf);
ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_SECURE, ch.GetTrust(), logBuf);
Command.Petition(ch, argument.Split(' '));
return;
}
Log.Trace("Failed to match command.");
ch.SendText("Huh?\r\n");
}
return;
}
// Character not in position for command?
if (ch.CurrentPosition < CommandTable[cmd].MinPosition)
{
switch (ch.CurrentPosition)
{
case Position.dead:
ch.SendText("Lie still; you are &+rDEAD&n!\r\n");
break;
示例10: CheckSocial
/// <summary>
/// The main social action processing routine. Sends the social strings and any associated sounds.
/// </summary>
/// <param name="ch">Character acting out the social.</param>
/// <param name="command">Command entered by the character.</param>
/// <param name="argument">Additional modifiers to the command entered.</param>
/// <returns></returns>
public bool CheckSocial(CharData ch, string command, string argument)
{
string arg = String.Empty;
Social soc = FindSocial(command);
if (soc == null)
{
return false;
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_NO_EMOTE))
{
ch.SendText("You are anti-social!\r\n");
return true;
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_MEDITATING))
{
ch.RemoveActionBit(PC.PLAYER_MEDITATING);
ch.SendText("You stop meditating.\r\n");
}
// Performing a social action removes hide and conceal.
if (ch.IsAffected(Affect.AFFECT_MINOR_INVIS))
{
ch.SendText("You appear.\r\n");
}
ch.AffectStrip(Affect.AffectType.skill, "shadow form");
ch.AffectStrip(Affect.AffectType.spell, "concealment");
ch.RemoveAffect(Affect.AFFECT_MINOR_INVIS);
ch.RemoveAffect(Affect.AFFECT_HIDE);
switch (ch.CurrentPosition)
{
case Position.dead:
ch.SendText("Lie still; you are DEAD.\r\n");
return true;
case Position.incapacitated:
case Position.mortally_wounded:
ch.SendText("You are hurt far too badly for that.\r\n");
return true;
case Position.stunned:
ch.SendText("You are too stunned to do that.\r\n");
return true;
case Position.sleeping:
// Special exception - only social when you're using when asleep is "snore".
if (!"snore".StartsWith(soc.Name, StringComparison.CurrentCultureIgnoreCase))
{
break;
}
ch.SendText("In your dreams, or what?\r\n");
return true;
}
MUDString.OneArgument(argument, ref arg);
CharData victim = null;
if (arg.Length == 0)
{
SocketConnection.Act(soc.CharNoArgument, ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act(soc.OthersNoArgument, ch, null, victim, SocketConnection.MessageTarget.room);
if (!String.IsNullOrEmpty(soc.AudioFile) && ch.InRoom != null)
{
foreach (CharData cd in ch.InRoom.People)
{
cd.SendSound(soc.AudioFile);
}
}
return true;
}
victim = ch.GetCharWorld(arg);
if (!victim || (ch.IsRacewar(victim) && ch.InRoom != victim.InRoom))
{
ch.SendText("They aren't here.\r\n");
}
else if (victim == ch)
{
SocketConnection.Act(soc.CharSelf, ch, null, victim, SocketConnection.MessageTarget.character);
SocketConnection.Act(soc.OthersSelf, ch, null, victim, SocketConnection.MessageTarget.room);
if (!String.IsNullOrEmpty(soc.AudioFile) && ch.InRoom != null)
{
foreach (CharData cd in ch.InRoom.People)
{
cd.SendSound(soc.AudioFile);
}
}
}
else if (!ch.GetCharRoom(arg) && CharData.CanSee(ch, victim)
&& soc.CharFound.Length > 0 && soc.VictimFound.Length > 0)
{
//.........这里部分代码省略.........