本文整理汇总了C#中MUDEngine.CharData.GetCurrInt方法的典型用法代码示例。如果您正苦于以下问题:C# CharData.GetCurrInt方法的具体用法?C# CharData.GetCurrInt怎么用?C# CharData.GetCurrInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MUDEngine.CharData
的用法示例。
在下文中一共展示了CharData.GetCurrInt方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Attributes
//.........这里部分代码省略.........
buf = String.Format(
"&+WHeight:&n {0} inches &+WWeight:&n {1} pounds &+WSize:&n {2}\r\n",
MUDString.PadInt(((PC)ch).Height, 3),
MUDString.PadInt(((PC)ch).Weight, 5),
Race.SizeString(ch.CurrentSize));
}
else
{
buf = String.Format("&+WSize:&n {0}\r\n", ch.CurrentSize);
}
buf1 += buf;
TimeSpan time = TimeSpan.FromTicks(ch.TimePlayed.Ticks) + (DateTime.Now - ch.LogonTime);
int days = (int)time.TotalHours / 24;
time = (time - TimeSpan.FromDays(days));
int hours = (int)time.TotalHours;
time = (time - TimeSpan.FromHours(hours));
int minutes = (int)time.TotalMinutes;
// Age is a hack until we get it coded - Xangis
buf = String.Format(
"\r\n&+BAge:&n {0} years. &+BPlaying Time:&n {1} days {2} hours {3} minutes.\r\n",
MUDString.PadInt(ch.GetAge(), 3), days, hours, minutes);
buf1 += buf;
// Need to create a function to display character status strings
buf = String.Format("&+BStatus:&n {0}", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(Position.PositionString(ch.CurrentPosition)));
if (!ch.IsNPC() && ch.IsAffected(Affect.AFFECT_BERZERK))
{
buf += ", &+Rberzerk&n";
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_MEMORIZING))
{
buf += ", Memorizing";
}
if (ch.IsAffected(Affect.AFFECT_CASTING))
{
buf += ", Casting";
}
if (ch.IsAffected(Affect.AFFECT_SINGING))
{
buf += ", Singing";
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_MEDITATING))
{
buf += ", Meditating";
}
if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_CAMPING))
{ /* This is ugly and should be moved to its own function */
buf += ", Camping";
}
buf += ".\r\n\r\n";
buf1 += buf;
// We want players to see the same stats for levels 1-50.
// Should create string converters so that we have no decimals displayed
// below this point.
buf = String.Format(" &+cSTR:&n {0} &+cArmor Class:&n {1}.\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrStr()), 15), ch.GetAC());
buf1 += buf;
buf = String.Format(" &+cAGI:&n {0} &+cHitroll:&n {1}\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrAgi()), 15), StringConversion.BonusString(ch.GetHitroll(ObjTemplate.WearLocation.hand_one)));
buf1 += buf;
buf = String.Format(" &+cDEX:&n {0} &+cDamroll:&n {1}\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrDex()), 15), StringConversion.BonusString(ch.GetDamroll(ObjTemplate.WearLocation.hand_one)));
buf1 += buf;
buf = String.Format(" &+cCON:&n {0} &+cAlignment:&n {1}\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrCon()), 15), StringConversion.AlignmentString(ch));
buf1 += buf;
buf = String.Format(" &n&+cINT:&n {0}\r\n", MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrInt()), 15));
buf1 += buf;
buf = String.Format(" &+cWIS:&n {0} &+BSaving Throws&n\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrWis()), 15));
buf1 += buf;
buf = String.Format(" &+cPOW:&n {0} &+cParalysis:&n {1}\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrPow()), 15), StringConversion.BonusString(-ch.SavingThrows[0]));
buf1 += buf;
buf = String.Format(" &+cCHA:&n {0} &+cRod:&n {1}\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrCha()), 15), StringConversion.BonusString(-ch.SavingThrows[1]));
buf1 += buf;
buf = String.Format(" &+cLUK:&n {0} &+cPetrify:&n {1}\r\n",
MUDString.PadStr(StringConversion.AbilityScoreString(ch.GetCurrLuck()), 15), StringConversion.BonusString(-ch.SavingThrows[2]));
buf1 += buf;
buf = String.Format(" &+cBreath:&n {0}\r\n",
StringConversion.BonusString(-ch.SavingThrows[3]));
buf1 += buf;
buf = String.Format("&+BWimpy: &n{0} &+cSpell:&n {1}\r\n",
MUDString.PadInt(ch.Wimpy, 4), StringConversion.BonusString(-ch.SavingThrows[4]));
buf1 += buf;
buf = String.Format("&+BLoad Carried: &n{0} pounds ({1})\r\n",
MUDString.PadInt(ch.CarryWeight, 3), StringConversion.WeightString(ch));
buf1 += buf;
ch.SendText(buf1);
return;
}
示例2: Search
/// <summary>
/// Try to find hidden things.
/// </summary>
/// <param name="ch"></param>
/// <param name="str"></param>
public static void Search(CharData ch, string[] str)
{
if( ch == null ) return;
Room toRoom;
Exit reverseExit;
Exit exit = null;
Object obj;
bool isArg;
Exit.Direction door;
if (ch.InRoom == null)
{
ch.SendText("There's no searching to be done here.\r\n");
return;
}
/* Calculate the probability that ch finds something. */
int chance = ch.GetCurrInt() * 35 / 100;
chance += ch.GetCurrWis() * 35 / 100;
chance += ch.GetCurrLuck() * 10 / 100;
// Dwarves, being natural architects, can search better - Xangis
if (ch.GetRace() == Race.RACE_DWARF)
chance += 25;
if (chance > 95)
chance = 95;
if (chance < 10)
chance = 10;
/* Searching with arguments. */
if (str.Length != 0)
{
isArg = true;
obj = ch.GetObjHere(str[0]);
if (obj == null)
{
ch.SendText("You don't see that object here.\r\n");
return;
}
switch (obj.ItemType)
{
case ObjTemplate.ObjectType.quiver:
case ObjTemplate.ObjectType.container:
case ObjTemplate.ObjectType.npc_corpse:
case ObjTemplate.ObjectType.pc_corpse:
if (Macros.IsSet(obj.Values[1], ObjTemplate.CONTAINER_CLOSED.Vector))
{
SocketConnection.Act("$p&n is closed.", ch, obj, null, SocketConnection.MessageTarget.character);
return;
}
break;
default:
ch.SendText("That is not a container!\r\n");
return;
}
}
else
{
isArg = false;
obj = null;
}
/* Lag ch from searching. */
if (ch.Level < Limits.LEVEL_AVATAR)
{
ch.WaitState(MUDMath.FuzzyNumber(18));
}
List<Object> list;
if (obj != null)
{
list = obj.Contains;
}
else
{
list = ch.InRoom.Contents;
}
foreach (Object obj2 in list)
{
if (obj2.HasFlag(ObjTemplate.ITEM_SECRET) && chance > MUDMath.NumberPercent()
&& obj2.FlyLevel == ch.FlightLevel)
{
obj2.RemoveFlag(ObjTemplate.ITEM_SECRET);
SocketConnection.Act("You find $p&n.", ch, obj2, null, SocketConnection.MessageTarget.character);
SocketConnection.Act("$n&n points out $p&n!", ch, obj, null, SocketConnection.MessageTarget.room);
return;
}
}
/* Look for a hidden exit. */
door = Exit.Direction.invalid;
for (int doornum = 0; doornum <= Limits.MAX_DIRECTION; doornum++)
{
//.........这里部分代码省略.........
示例3: Brew
public static void Brew(CharData ch, string[] str)
{
if( ch == null ) return;
Object potion;
Spell spell;
if (str.Length == 0)
{
ch.SendText("Which spell do you want to brew into a &+Lpotion&n?\r\n");
return;
}
if (!(potion = Object.GetEquipmentOnCharacter(ch, ObjTemplate.WearLocation.hand_one)))
{
ch.SendText("You hold nothing in your hand.\r\n");
return;
}
if (potion.ItemType != ObjTemplate.ObjectType.potion)
{
ch.SendText("You are not holding a vial.\r\n");
return;
}
if ((spell = StringLookup.SpellLookup(str[0])) == null)
{
ch.SendText("You don't know any spells by that _name.\r\n");
return;
}
if (spell.ValidTargets != TargetType.singleCharacterDefensive
&& spell.ValidTargets != TargetType.self)
{
ch.SendText("You cannot brew that spell.\r\n");
return;
}
SocketConnection.Act("$n begins preparing a &+Lpotion&n.", ch, potion, null, SocketConnection.MessageTarget.room);
ch.WaitState(Skill.SkillList["brew"].Delay);
ch.PracticeSkill("brew");
if (!ch.IsNPC() && (MUDMath.NumberPercent() > ((PC)ch).SkillAptitude["brew"] ||
MUDMath.NumberPercent() > ((ch.GetCurrInt() - 13) * 5 + (ch.GetCurrWis() - 13) * 3)))
{
SocketConnection.Act("$p&n explodes violently!", ch, potion, null, SocketConnection.MessageTarget.character);
SocketConnection.Act("$p&n explodes violently!", ch, potion, null, SocketConnection.MessageTarget.room);
potion.RemoveFromWorld();
Combat.InflictDamage(ch, ch, ch.GetMaxHit() / 16, "brew", ObjTemplate.WearLocation.none, AttackType.DamageType.energy);
return;
}
potion.Level = ch.Level / 2;
potion.Values[0] = ch.Level / 4;
ch.ImprintSpell(spell, ch.Level, potion);
return;
}
示例4: LookCommand
//.........这里部分代码省略.........
{
Look.ShowCharacterToCharacterFull(victim, ch);
return;
}
}
// Look at an object.
if (args.Count > 0)
{
// Check inventory.
obj = ch.GetObjCarrying(args[0]);
// If not in inventory, check eq.
if (obj == null)
obj = ch.GetObjWear(args[0]);
// If not on character, check room.
if (obj == null)
obj = Object.GetObjFromList(ch.InRoom.Contents, ch, args[0]);
// If object found, show it to the char.
if (obj != null)
{
pdesc = (Database.GetExtraDescription(args[0], obj.ExtraDescription));
if (pdesc.Length != 0)
{
ch.SendText(pdesc);
}
else if ((pdesc = (Database.GetExtraDescription(args[0], obj.ObjIndexData.ExtraDescriptions))).Length > 0)
{
ch.SendText(pdesc);
}
else if (obj.FullDescription.Length > 0)
{
ch.SendText(obj.FullDescription);
ch.SendText("\r\n");
}
if (obj.HasAffect(Affect.AffectType.skill, "poison weapon"))
{
if (ch.IsClass(CharClass.Names.thief) || ch.IsClass(CharClass.Names.assassin)
|| MUDMath.NumberPercent() < ch.GetCurrInt() / 2)
ch.SendText("It has a &+Gsickly &+Lcolored&n hue.\r\n");
}
return;
}
}
// Look at an object in the room
if (args.Count > 0)
{
int count = 0;
foreach (Object iobj in ch.InRoom.Contents)
{
if (CharData.CanSeeObj(ch, iobj))
{
pdesc = (Database.GetExtraDescription(args[0], iobj.ExtraDescription));
if (pdesc.Length != 0)
{
if (++count == number)
{
ch.SendText(pdesc);
return;
}
continue;
}
pdesc = (Database.GetExtraDescription(args[0], iobj.ObjIndexData.ExtraDescriptions));
if (pdesc.Length != 0)
{
if (++count == number)
{
ch.SendText(pdesc);
return;
}
continue;
}
if (MUDString.NameContainedIn(args[0], iobj.Name))
{
if (++count == number)
{
ch.SendText(iobj.FullDescription);
ch.SendText("\r\n");
return;
}
continue;
}
}
}
}
// Check for room extra descriptions
if (args.Count > 0)
{
pdesc = (Database.GetExtraDescription(args[0], ch.InRoom.ExtraDescriptions));
if (!String.IsNullOrEmpty(pdesc))
{
ch.SendText(pdesc);
return;
}
}
ch.SendText("You do not see that here.\r\n");
return;
}
示例5: ScribeScroll
public static void ScribeScroll(CharData ch, string[] str)
{
if( ch == null ) return;
Object scroll;
Spell spell;
if (String.IsNullOrEmpty(str[0]))
{
ch.SendText("Scribe what spell?\r\n");
return;
}
if (!(scroll = Object.GetEquipmentOnCharacter(ch, ObjTemplate.WearLocation.hand_one)))
{
ch.SendText("You hold nothing in your hand.\r\n");
return;
}
if (scroll.ItemType != ObjTemplate.ObjectType.scroll)
{
ch.SendText("You are not holding a &+Wparchment&n.\r\n");
return;
}
if ((spell = StringLookup.SpellLookup(str[0])) == null)
{
ch.SendText("You don't know any spells by that _name.\r\n");
return;
}
SocketConnection.Act("$n begins writing a &+Wscroll&n.", ch, scroll, null, SocketConnection.MessageTarget.room);
ch.WaitState(Skill.SkillList["Scribe"].Delay);
ch.PracticeSkill("Scribe");
if (!ch.IsNPC()
&& (MUDMath.NumberPercent() > ((PC)ch).SkillAptitude["brew"] ||
MUDMath.NumberPercent() > ((ch.GetCurrInt() - 13) * 5 +
(ch.GetCurrWis() - 13) * 3)))
{
SocketConnection.Act("$p&n bursts in &n&+rflames&n!", ch, scroll, null, SocketConnection.MessageTarget.character);
SocketConnection.Act("$p&n bursts in &+Rflames&n!", ch, scroll, null, SocketConnection.MessageTarget.room);
scroll.RemoveFromWorld();
Combat.InflictDamage(ch, ch, ch.GetMaxHit(), "Scribe", ObjTemplate.WearLocation.none, AttackType.DamageType.fire);
return;
}
scroll.Level = ch.Level * 2 / 3;
scroll.Values[0] = ch.Level / 3;
ch.ImprintSpell(spell, ch.Level, scroll);
return;
}
示例6: SendAbilityScores
/// <summary>
/// Sends ability scores when rolling stats or applying bonuses. Used to avoid repetitive code.
/// </summary>
/// <param name="ch"></param>
private void SendAbilityScores(CharData ch)
{
string text = String.Format( "\r\n\r\nStr: {0} Int: {1}\r\nDex: {2} Wis: {3}\r\nAgi: {4} Cha: {5}\r\nCon: {6}\r\nPow: {7}\r\n\r\n",
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrStr() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrInt() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrDex() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrWis() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrAgi() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrCha() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrCon() ), 17 ),
MUDString.PadStr( StringConversion.AbilityScoreString( ch.GetCurrPow() ), 17 ) );
WriteToBuffer( text );
}
示例7: Disbelieve
/// <summary>
/// Save against illusionist spells, intelligence and level-based. Base save 50% with a
/// bonus/penalty of 2% per level of difference between spell power (typically caster level
/// but capped on most spells) and victim level. Also has a 1% bonus/penalty per 5 int
/// points of difference between caster and victim.
/// </summary>
/// <param name="level"></param>
/// <param name="victim"></param>
/// <param name="ch"></param>
/// <returns></returns>
public static bool Disbelieve( int level, CharData victim, CharData ch )
{
int ibase = 50;
if( !victim )
{
Log.Error( "Magic.Disbelieve called without CharData argument for victim.", 0 );
return false;
}
// Level has an effect on illusions.
int save = ibase + ( victim.Level - level ) * 2;
// Will cause a 100 int player to get a 5% bonus against a 50 int mob.
save += ( victim.GetCurrInt() / 5 );
save -= ( ch.GetCurrInt() / 5 );
// Figure in spell saving throw adjustment.
save -= victim.SavingThrows[4];
// Even though we already figured in intelligence, also take into account mental
// damage type resistance and susceptibility.
switch (victim.CheckRIS(AttackType.DamageType.mental))
{
case Race.ResistanceType.resistant:
save += 10;
break;
case Race.ResistanceType.immune:
return true;
case Race.ResistanceType.susceptible:
save -= 10;
break;
case Race.ResistanceType.vulnerable:
save -= 20;
break;
}
save = Macros.Range( 5, save, 95 );
return MUDMath.NumberPercent() < save;
}
示例8: ProcessSpellTargets
//.........这里部分代码省略.........
if( "ventriloquate".Equals(spell.Name, StringComparison.CurrentCultureIgnoreCase ))
{
if( spell.ValidTargets == TargetType.singleCharacterOffensive
|| spell.ValidTargets == TargetType.singleCharacterRanged )
SocketConnection.Act( "$n&n begins casting an offensive spell...", ch, null, null, SocketConnection.MessageTarget.room );
else
SocketConnection.Act( "$n&n begins casting...", ch, null, null, SocketConnection.MessageTarget.room );
}
beats = spell.CastingTime;
}
else if (ch.IsClass(CharClass.Names.bard))
{
ch.SendText( "You begin singing...\r\n" );
SocketConnection.Act( "$n&n starts singing...", ch, null, null, SocketConnection.MessageTarget.room );
beats = 0;
}
if (!ch.IsClass(CharClass.Names.psionicist) && !ch.IsClass(CharClass.Names.bard))
{
// Characters with int of 110 have normal memtimes.
// int of 100 worsens casting times by 10%
// with an int of 55 casting times are doubled.
// This may seem a bit harsh, but keep in mind any
// casters are very likely to have an int above 100, as it
// is their prime requisite. 120 is the max int for Grey Elves
// to start.
if (ch.IsClass(CharClass.Names.cleric) || ch.IsClass(CharClass.Names.druid)
|| ch.IsClass(CharClass.Names.paladin) || ch.IsClass(CharClass.Names.antipaladin))
{
beats = ( beats * 110 ) / ch.GetCurrWis();
}
else if (ch.IsClass( CharClass.Names.shaman))
{
beats = ( beats * 330 ) / ( ch.GetCurrInt() + ( ch.GetCurrWis() * 2 ) );
}
else
{
beats = ( beats * 110 ) / ch.GetCurrInt();
}
if( ch.CheckSkill("quick chant", PracticeType.only_on_success) )
{
beats = beats / 2;
}
/*
* A check for impossibly long cast times...came about from a player
* trying to cast when feebleminded. 100 casting time is arbitrary.
*/
if( beats > 100 )
{
ch.SendText( "Forget it! In your present state you haven't a dream of success.\r\n" );
return;
}
ch.WaitState( beats );
if( CheckHypnoticPattern( ch ) )
{
return;
}
CastData caster = new CastData();
caster.Who = ch;
caster.Eventdata = Event.CreateEvent( Event.EventType.spell_cast, beats, ch, target, spell );
Database.CastList.Add( caster );
ch.SetAffectBit( Affect.AFFECT_CASTING );
示例9: CheckHypnoticPattern
static bool CheckHypnoticPattern( CharData ch )
{
CharData owner;
if( !ch || ch.IsClass(CharClass.Names.psionicist) || ch.IsNPC() )
return false;
foreach( Object obj in ch.InRoom.Contents)
{
if( obj.ObjIndexData.IndexNumber == StaticObjects.OBJECT_NUMBER_HYPNOTIC_PATTERN )
{
//we have a pattern
owner = obj.CreatedBy;
//doublecheck that we have the right ch
if( owner != null && !owner.IsNPC() )
//we can't figure who owns it
return false;
if( owner != null && owner.IsSameGroup( ch ) )
continue;
if( MUDMath.NumberPercent() < ch.Level / 3 + ch.GetCurrInt() / 5 )
continue;
SocketConnection.Act( "Your concentration is disrupted by $p&n!", ch, obj, null, SocketConnection.MessageTarget.character );
return true;
}
}
return false;
}
示例10: CalculateMemorizationTime
static int CalculateMemorizationTime( CharData ch, Spell spell )
{
int attribute;
if( ch.IsClass(CharClass.Names.cleric) || ch.IsClass(CharClass.Names.druid)
|| ch.IsClass(CharClass.Names.paladin) || ch.IsClass(CharClass.Names.antipaladin ))
attribute = ch.GetCurrWis();
else if( ch.IsClass(CharClass.Names.shaman) )
attribute = ( ch.GetCurrInt() + ch.GetCurrWis() ) / 2;
else
attribute = ch.GetCurrInt();
int memtime = 220 - attribute - ( ch.Level * 3 )
+ (spell.SpellCircle[(int)ch.CharacterClass.ClassNumber] * 8);
if( memtime < 4 )
memtime = 4;
return memtime;
}