本文整理汇总了C#中Server.Multis.BaseHouse.IsCombatRestricted方法的典型用法代码示例。如果您正苦于以下问题:C# BaseHouse.IsCombatRestricted方法的具体用法?C# BaseHouse.IsCombatRestricted怎么用?C# BaseHouse.IsCombatRestricted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Multis.BaseHouse
的用法示例。
在下文中一共展示了BaseHouse.IsCombatRestricted方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HouseGumpAOS
public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base( 50, 40 )
{
m_House = house;
m_Page = page;
from.CloseGump( typeof( HouseGumpAOS ) );
//from.CloseGump( typeof( HouseListGump ) );
//from.CloseGump( typeof( HouseRemoveGump ) );
bool isCombatRestricted = house.IsCombatRestricted( from );
bool isOwner = house.IsOwner( from );
bool isCoOwner = isOwner || house.IsCoOwner( from );
bool isFriend = isCoOwner || house.IsFriend( from );
if ( isCombatRestricted )
isFriend = isCoOwner = isOwner = false;
AddPage( 0 );
if ( isFriend || page == HouseGumpPageAOS.Vendors )
{
AddBackground( 0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 5054 );
AddImageTiled( 10, 10, 400, 100, 2624 );
AddAlphaRegion( 10, 10, 400, 100 );
AddImageTiled( 10, 120, 400, 260, 2624 );
AddAlphaRegion( 10, 120, 400, 260 );
AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 );
AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 );
AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, 1060675 ); // CLOSE
}
AddImage( 10, 10, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.GetName() );
if ( lines != null )
{
for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( page == HouseGumpPageAOS.Vendors )
{
AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER>
AddList( house.AvailableVendorsFor( from ), 1, false, false, from );
return;
}
if ( !isFriend )
return;
if ( house != null )
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish
AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban
}
/*Zycron
else
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access
AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access
}
Zycron*/
AddPageButton( 150, 10, GetButtonID( 1, 0 ), 1060668, HouseGumpPageAOS.Information );
AddPageButton( 150, 30, GetButtonID( 1, 1 ), 1060669, HouseGumpPageAOS.Security );
AddPageButton( 150, 50, GetButtonID( 1, 2 ), 1060670, HouseGumpPageAOS.Storage );
AddPageButton( 150, 70, GetButtonID( 1, 3 ), 1060671, HouseGumpPageAOS.Customize );
AddPageButton( 150, 90, GetButtonID( 1, 4 ), 1060672, HouseGumpPageAOS.Ownership );
switch ( page )
{
case HouseGumpPageAOS.Information:
{
AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By:
AddLabel( 210, 130, LabelHue, GetOwnerName() );
AddHtmlLocalized( 20, 170, 380, 20, 1018032, SelectedColor, false, false ); // This house is properly placed.
AddHtmlLocalized( 20, 190, 380, 20, 1018035, SelectedColor, false, false ); // This house is of modern design.
AddHtmlLocalized( 20, 210, 380, 20, (house is HouseFoundation) ? 1060681 : 1060680, SelectedColor, false, false ); // This is a (pre | custom)-built house.
AddHtmlLocalized( 20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false, false ); // This house is (private | open to the public).
switch ( house.DecayType )
{
case DecayType.Ageless:
case DecayType.AutoRefresh:
{
AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
//.........这里部分代码省略.........
示例2: HouseGump
public HouseGump(Mobile from, BaseHouse house)
: base(100, 50)
{
if (house.Deleted)
return;
bool isTent = house is Tent;
m_House = house;
from.CloseGump(typeof(HouseGump));
from.CloseGump(typeof(HouseListGump));
from.CloseGump(typeof(HouseRemoveGump));
bool isCombatRestricted = house.IsCombatRestricted(from);
bool isOwner = m_House.IsOwner(from);
bool isCoOwner = isOwner || m_House.IsCoOwner(from);
bool isFriend = isCoOwner || m_House.IsFriend(from);
if (isCombatRestricted)
isFriend = isCoOwner = isOwner = false;
AddPage(0);
if (isFriend)
{
AddBackground(100, 100, 400, 300, 0xA28);
AddBackground(116, 165, 369, 25, 0x13EC);
}
AddImage(230, 65, 100);
if (m_House.Sign != null)
{
ArrayList lines = Wrap(m_House.Sign.Name);
if (lines != null) //HOUSE SIGN NAME TO FIX
{
for (int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14)
{
string s = (string)lines[i];
string housename = String.Format("<big>{0}</big>", s);
AddHtml(230 + ((143 - (s.Length * 8)) / 2), y + 65, 100, 20, housename, false, false);
}
}
}
if (!isFriend)
return;
AddHtml(125, 168, 75, 20, "<big>INFO</big>", false, false); //INFO
AddButton(170, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 1);
AddHtml(230, 168, 75, 20, "<big>FRIENDS</big>", false, false); //FRIENDS
AddButton(310, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 2);
AddHtml(375, 168, 75, 20, "<big>OPTIONS</big>", false, false); //OPTIONS
AddButton(455, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 3);
// Info page
AddPage(1);
AddButton(150, 366, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0); //EXIT;
AddHtml(245, 365, 300, 20, "<big>Change this house's name!</big>", false, false); //Change this house's name!
AddButton(425, 365, 0xA9A, 0xA9B, 1, GumpButtonType.Reply, 0);
string ownedbyname = String.Format("<big><center><basefont color=white>Owned by <basefont color=black>{0}</big></center>", GetOwnerName());
AddHtml(100, 205, 400, 20, ownedbyname, false, false);
string lockdowns = String.Format("<big><basefont color=white>Number of locked down items:<basefont color=black> {0} out of {1}</basefont>", m_House.LockDownCount, m_House.MaxLockDowns);
AddHtml(140, 240, 350, 20, lockdowns, false, false);
string secures = String.Format("<big><basefont color=white>Number of secure containers:<basefont color=black> {0} out of {1}</basefont>", m_House.SecureCount, m_House.MaxSecures);
AddHtml(140, 260, 350, 20, secures, false, false);
AddHtml(140, 315, 400, 20, "<big><basefont color=white>This house is properly placed.</big></basefont>", false, false);
AddHtml(140, 333, 400, 20, "<big><basefont color=white>This house is of classic design.</big></basefont>", false, false);
if (m_House.Public)
{
string visits = String.Format("<big><basefont color=white>Number of visits this building has had: <basefont color=black>{0}</big></basefont>", m_House.Visits);
AddHtml(140, 295, 400, 20, visits, false, false);
}
// Friends page
AddPage(2);
AddButton(150, 366, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0); //EXIT;
AddHtml(153, 194, 150, 20, "<big><basefont color=white>List of co-owners</basefont>", false, false); // <big><basefont color=white>List of co-owners</basefont>
AddButton(125, 194, 2714, 2715, 2, GumpButtonType.Reply, 0);
AddHtml(153, 216, 150, 20, "<big><basefont color=white>Add a co-owner</basefont>", false, false); // <big><basefont color=white>Add a co-owner</basefont>
AddButton(125, 216, 2714, 2715, 3, GumpButtonType.Reply, 0);
AddHtml(153, 238, 150, 20, "<big><basefont color=white>Remove a co-owner</basefont>", false, false); // <big><basefont color=white>Remove a co-owner</basefont>
AddButton(125, 238, 2714, 2715, 4, GumpButtonType.Reply, 0);
//.........这里部分代码省略.........
示例3: HouseGump
public HouseGump( Mobile from, BaseHouse house )
: base(20, 30)
{
if ( house.Deleted )
return;
m_House = house;
from.CloseGump( typeof( HouseGump ) );
from.CloseGump( typeof( HouseListGump ) );
from.CloseGump( typeof( HouseRemoveGump ) );
bool isCombatRestricted = house.IsCombatRestricted( from );
bool isOwner = m_House.IsOwner( from );
bool isCoOwner = isOwner || m_House.IsCoOwner( from );
bool isFriend = isCoOwner || m_House.IsFriend( from );
if ( isCombatRestricted )
isFriend = isCoOwner = isOwner = false;
AddPage( 0 );
if ( isFriend )
{
AddBackground( 0, 0, 420, 430, 5054 );
AddBackground( 10, 10, 400,410, 3000 );
}
AddImage( 130, 0, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.Name );
if ( lines != null )
{
for ( int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 130 + ((143 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( !isFriend )
return;
AddHtmlLocalized( 55, 103, 75, 20, 1011233, false, false ); // INFO
AddButton( 20, 103, 4005, 4007, 0, GumpButtonType.Page, 1 );
AddHtmlLocalized( 170, 103, 75, 20, 1011234, false, false ); // FRIENDS
AddButton( 135, 103, 4005, 4007, 0, GumpButtonType.Page, 2 );
AddHtmlLocalized( 295, 103, 75, 20, 1011235, false, false ); // OPTIONS
AddButton( 260, 103, 4005, 4007, 0, GumpButtonType.Page, 3 );
AddHtmlLocalized( 295, 390, 75, 20, 1011441, false, false ); // EXIT
AddButton( 260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 55, 390, 200, 20, 1011236, false, false ); // Change this house's name!
AddButton( 20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0 );
// Info page
AddPage( 1 );
AddHtmlLocalized( 20, 135, 100, 20, 1011242, false, false ); // Owned by:
AddHtml( 120, 135, 100, 20, GetOwnerName(), false, false );
AddHtmlLocalized( 20, 170, 275, 20, 1011237, false, false ); // Number of locked down items:
AddHtml( 320, 170, 50, 20, m_House.LockDownCount.ToString(), false, false );
AddHtmlLocalized( 20, 190, 275, 20, 1011238, false, false ); // Maximum locked down items:
AddHtml( 320, 190, 50, 20, m_House.MaxLockDowns.ToString(), false, false );
AddHtmlLocalized( 20, 210, 275, 20, 1011239, false, false ); // Number of secure containers:
AddHtml( 320, 210, 50, 20, m_House.SecureCount.ToString(), false, false );
AddHtmlLocalized( 20, 230, 275, 20, 1011240, false, false ); // Maximum number of secure containers:
AddHtml( 320, 230, 50, 20, m_House.MaxSecures.ToString(), false, false );
AddHtmlLocalized( 20, 260, 400, 20, 1018032, false, false ); // This house is properly placed.
AddHtmlLocalized( 20, 280, 400, 20, 1018035, false, false ); // This house is of modern design.
if ( m_House.Public )
{
// TODO: Validate exact placement
AddHtmlLocalized( 20, 305, 275, 20, 1011241, false, false ); // Number of visits this building has had
AddHtml( 320, 305, 50, 20, m_House.Visits.ToString(), false, false );
}
// Friends page
AddPage( 2 );
AddHtmlLocalized( 45, 130, 150, 20, 1011266, false, false ); // List of co-owners
AddButton( 20, 130, 2714, 2715, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 150, 150, 20, 1011267, false, false ); // Add a co-owner
AddButton( 20, 150, 2714, 2715, 3, GumpButtonType.Reply, 0 );
//.........这里部分代码省略.........
示例4: HouseGumpAOS
public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house )
: base(50, 40)
{
m_House = house;
m_Page = page;
from.CloseGump( typeof( HouseGumpAOS ) );
//from.CloseGump( typeof( HouseListGump ) );
//from.CloseGump( typeof( HouseRemoveGump ) );
bool isCombatRestricted = house.IsCombatRestricted( from );
bool isOwner = house.IsOwner( from );
bool isCoOwner = isOwner || house.IsCoOwner( from );
bool isFriend = isCoOwner || house.IsFriend( from );
if ( isCombatRestricted )
isFriend = isCoOwner = isOwner = false;
AddPage( 0 );
if ( isFriend || page == HouseGumpPageAOS.Vendors )
{
AddBackground(0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 9270);
AddImageTiled( 10, 10, 400, 100, 2624 );
//AddAlphaRegion( 10, 10, 400, 100 );
AddImageTiled( 10, 120, 400, 260, 2624 );
//AddAlphaRegion( 10, 120, 400, 260 );
AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 );
//AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 );
AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, "Fechar", true ); // CLOSE
}
AddImage( 10, 10, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.GetName() );
if ( lines != null )
{
for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( page == HouseGumpPageAOS.Vendors )
{
AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER>
AddList( house.AvailableVendorsFor( from ), 1, false, false, from );
return;
}
if ( !isFriend )
return;
if ( house.Public )
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), "Banir", true); // Banish
AddButtonLabeled(10, 410, GetButtonID(0, 1), "Remover Ban", true); // Lift a Ban
}
else
{
AddButtonLabeled(10, 390, GetButtonID(0, 2), "Permitir Acesso", true); // Grant Access
AddButtonLabeled(10, 410, GetButtonID(0, 3), "Remover Acesso", true); // Revoke Access
}
AddPageButton( 150, 10, GetButtonID( 1, 0 ), "INFORMAÇÕES", HouseGumpPageAOS.Information );
AddPageButton( 150, 30, GetButtonID( 1, 1 ), "SEGURANÇA", HouseGumpPageAOS.Security );
AddPageButton( 150, 50, GetButtonID( 1, 2 ), "SECURES", HouseGumpPageAOS.Storage );
AddPageButton( 150, 70, GetButtonID( 1, 3 ), "CUSTOMIZAR", HouseGumpPageAOS.Customize );
AddPageButton( 150, 90, GetButtonID( 1, 4 ), "TRANSFERIR", HouseGumpPageAOS.Ownership );
switch ( page )
{
case HouseGumpPageAOS.Information:
{
//AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By:
AddHtml(20, 130, 200, 20, "Dono: " + GetOwnerName(), false, false); // Owned By:
//AddLabel( 210, 130, LabelHue, GetOwnerName() );
AddHtml(20, 170, 380, 20, "Esta casa está colocada corretamente", false, false); // This house is properly placed.
AddHtml(20, 190, 380, 20, "Esta casa é de estilo moderno", false, false); // This house is of modern design.
AddHtml(20, 210, 380, 20, (house is HouseFoundation) ? "Esta é uma casa customizada" : "Esta é uma casa pré-moldada", false, false); // This is a (pre | custom)-built house.
//AddHtmlLocalized(20, 230, 380, 20, house.Public ? "" : 1060679, SelectedColor, false, false); // This house is (private | open to the public).
AddHtml(20, 230, 380, 20, house.Public ? "Esta casa é pública" : "Esta casa é restrita", false, false); // This house is (private | open to the public).
switch ( house.DecayType )
{
case DecayType.Ageless:
case DecayType.AutoRefresh:
//.........这里部分代码省略.........