本文整理汇总了C#中VirtueName类的典型用法代码示例。如果您正苦于以下问题:C# VirtueName类的具体用法?C# VirtueName怎么用?C# VirtueName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VirtueName类属于命名空间,在下文中一共展示了VirtueName类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Atrophy
public static bool Atrophy( Mobile from, VirtueName virtue )
{
int current = from.Virtues.GetValue( (int)virtue );
if ( current > 0 )
from.Virtues.SetValue( (int)virtue, current - 1 );
return ( current > 0 );
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:9,代码来源:VirtueHelper.cs
示例2: GetMaxAmount
public static int GetMaxAmount(VirtueName virtue)
{
if (virtue == VirtueName.Honor)
return 20000;
if (virtue == VirtueName.Sacrifice)
return 22000;
return 21000;
}
开发者ID:Crome696,项目名称:ServUO,代码行数:10,代码来源:VirtueHelper.cs
示例3: GetLevel
public static VirtueLevel GetLevel( Mobile from, VirtueName virtue )
{
int v = from.Virtues.GetValue( (int) virtue ) / 10;
if ( v < 0 )
v = 0;
else if ( v > 3 )
v = 3;
return (VirtueLevel)v;
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:11,代码来源:VirtueHelper.cs
示例4: Atrophy
public static bool Atrophy( Mobile from, VirtueName virtue, int amount )
{
int current = from.Virtues.GetValue( (int)virtue );
if( (current - amount) >= 0 )
from.Virtues.SetValue( (int)virtue, current - amount );
else
from.Virtues.SetValue( (int)virtue, 0 );
return ( current > 0 );
}
开发者ID:Godkong,项目名称:Origins,代码行数:11,代码来源:VirtueHelper.cs
示例5: GetMaxAmount
public static int GetMaxAmount( VirtueName virtue )
{
//Edit by Silver
return 30000;
//if( virtue == VirtueName.Honor )
// return 20000;
//if( virtue == VirtueName.Sacrifice )
// return 22000;
//return 21000;
}
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:13,代码来源:VirtueHelper.cs
示例6: GetLevel
public static VirtueLevel GetLevel( Mobile from, VirtueName virtue )
{
int v = from.Virtues.GetValue( (int)virtue );
int vl;
if ( v < 4000 )
vl = 0;
else if ( v >= 20000 )
vl = 3;
else
vl = ( v + 9999 ) / 10000;
return (VirtueLevel)vl;
}
开发者ID:Godkong,项目名称:Origins,代码行数:14,代码来源:VirtueHelper.cs
示例7: Award
public static bool Award( Mobile from, VirtueName virtue, int amount, ref bool gainedPath )
{
int current = from.Virtues.GetValue( (int)virtue );
if ( current >= 40 )
return false;
if ( (current + amount) >= 40 )
amount = 40 - current;
VirtueLevel oldLevel = GetLevel( from, virtue );
from.Virtues.SetValue( (int)virtue, current + amount );
gainedPath = ( GetLevel( from, virtue ) != oldLevel );
return true;
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:18,代码来源:VirtueHelper.cs
示例8: AwardVirtue
public static void AwardVirtue( PlayerMobile pm, VirtueName virtue, int amount )
{
if ( virtue == VirtueName.Compassion )
{
if ( pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay )
{
pm.NextCompassionDay = DateTime.MinValue;
pm.CompassionGains = 0;
}
if ( pm.CompassionGains >= 5 )
{
pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
return;
}
}
bool gainedPath = false;
string virtueName = Enum.GetName( typeof( VirtueName ), virtue );
if ( VirtueHelper.Award( pm, virtue, amount, ref gainedPath ) )
{
// TODO: Localize?
if ( gainedPath )
pm.SendMessage( "You have gained a path in {0}!", virtueName );
else
pm.SendMessage( "You have gained in {0}.", virtueName );
if ( virtue == VirtueName.Compassion )
{
pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays( 1.0 );
++pm.CompassionGains;
if ( pm.CompassionGains >= 5 )
pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
}
}
else
{
// TODO: Localize?
pm.SendMessage( "You have achieved the highest path of {0} and can no longer gain any further.", virtueName );
}
}
开发者ID:OurUO,项目名称:ouruo-server,代码行数:43,代码来源:VirtueHelper.cs
示例9: IsHighestPath
public static bool IsHighestPath( Mobile from, VirtueName virtue )
{
return ( from.Virtues.GetValue( (int)virtue ) >= 40 );
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:VirtueHelper.cs
示例10: HasAny
public static bool HasAny( Mobile from, VirtueName virtue )
{
return ( from.Virtues.GetValue( (int)virtue ) > 0 );
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:VirtueHelper.cs
示例11: Atrophy
public static bool Atrophy(Mobile from, VirtueName virtue)
{
return Atrophy(from, virtue, 1);
}
开发者ID:Crome696,项目名称:ServUO,代码行数:4,代码来源:VirtueHelper.cs
示例12: VirtueBonusEntry
public VirtueBonusEntry( VirtueName virtue, string mantra, Rectangle2D location, int cliloc )
{
Virtue = virtue;
Mantra = mantra;
Area = location;
Cliloc = cliloc;
}
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:7,代码来源:AnkhPendant.cs
示例13: VirtueInfoGump
public VirtueInfoGump(Mobile beholder, VirtueName virtue, int description, string webPage)
: base(0, 0)
{
this.m_Beholder = beholder;
this.m_Virtue = virtue;
this.m_Desc = description;
this.m_Page = webPage;
int value = beholder.Virtues.GetValue((int)virtue);
this.AddPage(0);
this.AddImage(30, 40, 2080);
this.AddImage(47, 77, 2081);
this.AddImage(47, 147, 2081);
this.AddImage(47, 217, 2081);
this.AddImage(47, 267, 2083);
this.AddImage(70, 213, 2091);
this.AddPage(1);
int maxValue = VirtueHelper.GetMaxAmount(this.m_Virtue);
int valueDesc;
int dots;
if (value < 4000)
dots = value / 400;
else if (value < 10000)
dots = (value - 4000) / 600;
else if (value < maxValue)
dots = (value - 10000) / ((maxValue - 10000) / 10);
else
dots = 10;
for (int i = 0; i < 10; ++i)
this.AddImage(95 + (i * 17), 50, i < dots ? 2362 : 2360);
if (value < 1)
valueDesc = 1052044; // You have not started on the path of this Virtue.
else if (value < 400)
valueDesc = 1052045; // You have barely begun your journey through the path of this Virtue.
else if (value < 2000)
valueDesc = 1052046; // You have progressed in this Virtue, but still have much to do.
else if (value < 3600)
valueDesc = 1052047; // Your journey through the path of this Virtue is going well.
else if (value < 4000)
valueDesc = 1052048; // You feel very close to achieving your next path in this Virtue.
else if (dots < 1)
valueDesc = 1052049; // You have achieved a path in this Virtue.
else if (dots < 9)
valueDesc = 1052047; // Your journey through the path of this Virtue is going well.
else if (dots < 10)
valueDesc = 1052048; // You feel very close to achieving your next path in this Virtue.
else
valueDesc = 1052050; // You have achieved the highest path in this Virtue.
this.AddHtmlLocalized(157, 73, 200, 40, 1051000 + (int)virtue, false, false);
this.AddHtmlLocalized(75, 95, 220, 140, description, false, false);
this.AddHtmlLocalized(70, 224, 229, 60, valueDesc, false, false);
this.AddButton(65, 277, 1209, 1209, 1, GumpButtonType.Reply, 0);
this.AddButton(280, 43, 4014, 4014, 2, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(83, 275, 400, 40, (webPage == null) ? 1052055 : 1052052, false, false); // This virtue is not yet defined. OR -click to learn more (opens webpage)
}
开发者ID:Crome696,项目名称:ServUO,代码行数:67,代码来源:VirtueInfoGump.cs
示例14: VirtueInfoGump
public VirtueInfoGump( Mobile beholder, VirtueName virtue, int description )
: base(0, 0)
{
m_Beholder = beholder;
m_Virtue = virtue;
m_Desc = description;
int value = beholder.Virtues.GetValue( (int) virtue );
AddPage( 0 );
AddImage( 30, 40, 2080 );
AddImage( 47, 77, 2081 );
AddImage( 47, 147, 2081 );
AddImage( 47, 217, 2081 );
AddImage( 47, 267, 2083 );
AddImage( 70, 213, 2091 );
AddPage( 1 );
int maxValue = VirtueHelper.GetMaxAmount( m_Virtue );
int valueDesc;
if ( value < 1 )
valueDesc = 1052044; // You have not started on the path of this Virtue.
else if ( value < maxValue / 6 )
valueDesc = 1052045; // You have barely begun your journey through the path of this Virtue.
else if ( value < maxValue / 3 )
valueDesc = 1052046; // You have progressed in this Virtue, but still have much to do.
else if ( value < maxValue / 2 )
valueDesc = 1052047; // Your journey through the path of this Virtue is going well.
else if ( value < 2 * maxValue / 3 )
valueDesc = 1052048; // You feel very close to achieving your next path in this Virtue.
else if ( value < 5 * maxValue / 6 )
valueDesc = 1052049; // You have achieved a path in this Virtue.
else
valueDesc = 1052050; // You have achieved the highest path in this Virtue.
AddHtmlLocalized( 157, 73, 200, 40, 1051000 + (int) virtue, false, false );
AddHtmlLocalized( 75, 95, 220, 140, description, false, false );
AddHtmlLocalized( 70, 224, 229, 60, valueDesc, false, false );
AddButton( 65, 277, 1209, 1209, 1, GumpButtonType.Reply, 0 );
AddButton( 280, 43, 4014, 4014, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 83, 275, 400, 40, 1052055, false, false ); // This virtue is not yet defined.
AddKRHtmlLocalized( 0, 0, 0, 0, 1078056, false, false ); // MORE
AddKRHtmlLocalized( 0, 0, 0, 0, 1011447, false, false ); // BACK
AddKRHtmlLocalized( 0, 0, 0, 0, 1078055, false, false ); // USE
AddKRHtmlLocalized( 0, 0, 0, 0, 0, false, false );
int dots;
if ( value < 4000 )
dots = value / 400;
else if ( value < 10000 )
dots = ( value - 4000 ) / 600;
else if ( value < maxValue )
dots = ( value - 10000 ) / ( ( maxValue - 10000 ) / 10 );
else
dots = 10;
for ( int i = 0; i < 10; ++i )
AddImage( 95 + ( i * 17 ), 50, i < dots ? 2362 : 2360 );
}
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:68,代码来源:VirtueInfoGump.cs
示例15: IsKnight
public static bool IsKnight( Mobile from, VirtueName virtue )
{
return ( GetLevel( from, virtue ) >= VirtueLevel.Knight );
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:VirtueHelper.cs
示例16: IsSeeker
public static bool IsSeeker( Mobile from, VirtueName virtue )
{
return ( GetLevel( from, virtue ) >= VirtueLevel.Seeker );
}
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:4,代码来源:VirtueHelper.cs
示例17: IsHighestPath
public static bool IsHighestPath( Mobile from, VirtueName virtue )
{
return false;//return ( from.Virtues.GetValue( (int)virtue ) >= GetMaxAmount( virtue ) );
}
开发者ID:greeduomacro,项目名称:divinity,代码行数:4,代码来源:VirtueHelper.cs
注:本文中的VirtueName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论