本文整理汇总了C#中Server.Engines.Craft.CraftSystem.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# CraftSystem.GetType方法的具体用法?C# CraftSystem.GetType怎么用?C# CraftSystem.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Engines.Craft.CraftSystem
的用法示例。
在下文中一共展示了CraftSystem.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompleteCraft
//.........这里部分代码省略.........
Item item;
if ( customCraft != null )
{
item = customCraft.CompleteCraft( out num );
}
else if ( typeof( MapItem ).IsAssignableFrom( ItemType ) && from.Map != Map.Trammel && from.Map != Map.Felucca )
{
item = new IndecipherableMap();
from.SendLocalizedMessage( 1070800 ); // The map you create becomes mysteriously indecipherable.
}
else
{
item = Activator.CreateInstance( ItemType ) as Item;
}
if ( item != null )
{
if( item is ICraftable )
endquality = ((ICraftable)item).OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, this, resHue );
else if ( item.Hue == 0 )
item.Hue = resHue;
if ( maxAmount > 0 )
{
if ( !item.Stackable && item is IUsesRemaining )
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack( item );
if( from.AccessLevel > AccessLevel.Player )
CommandLogging.WriteLine( from, "Crafting {0} with craft system {1}", CommandLogging.Format( item ), craftSystem.GetType().Name );
//from.PlaySound( 0x57 );
}
if ( num == 0 )
num = craftSystem.PlayEndingEffect( from, false, true, toolBroken, endquality, makersMark, this );
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if ( item is IFactionItem )
{
def = FactionItemDefinition.Identify( item );
if ( def != null )
{
faction = Faction.Find( from );
if ( faction != null )
{
Town town = Town.FromRegion( from.Region );
if ( town != null && town.Owner == faction )
{
Container pack = from.Backpack;
if ( pack != null )
{
availableSilver = pack.GetAmount( typeof( Silver ) );
示例2: CompleteCraft
//.........这里部分代码省略.........
}
if (item is NaturalDye && (craftSystem is DefAlchemy || craftSystem is DefCooking))
{
((NaturalDye)item).PigmentHue = PlantPigmentHueInfo.GetInfo(m_PlantPigmentHue).PlantPigmentHue;
}
if (item is SoftenedReeds && (craftSystem is DefAlchemy || craftSystem is DefCooking))
{
((SoftenedReeds)item).PlantHue = PlantHueInfo.GetInfo(m_PlantHue).PlantHue;
}
if (item is BaseContainer && (craftSystem is DefBasketweaving))
{
(item).Hue = PlantHueInfo.GetInfo(m_PlantHue).Hue;
}
CraftContext context = craftSystem.GetContext(from);
if (context.QuestOption == CraftQuestOption.QuestItem)
{
PlayerMobile px = from as PlayerMobile;
if (!QuestHelper.CheckItem(px, item))
from.SendLocalizedMessage(1072355, null, 0x23); // That item does not match any of your quest criteria
}
#endregion
from.AddToBackpack(item);
if (from.IsStaff())
{
CommandLogging.WriteLine(
from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
}
AutoCraftTimer.OnSuccessfulCraft(from);
//from.PlaySound( 0x57 );
}
if (num == 0)
{
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
}
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
示例3: CompleteCraft
//.........这里部分代码省略.........
{
AncientSmithyHammer hammer = from.FindItemOnLayer(Layer.OneHanded) as AncientSmithyHammer;
if (hammer != null && hammer != tool)
{
hammer.UsesRemaining--;
if (hammer.UsesRemaining < 1)
hammer.Delete();
}
}
if (tool.UsesRemaining < 1)
toolBroken = true;
if (toolBroken)
tool.Delete();
int num = 0;
Item item;
if (customCraft != null)
item = customCraft.CompleteCraft(out num);
else if (typeof(MapItem).IsAssignableFrom(ItemType) && from.Map != Map.Trammel && from.Map != Map.Felucca)
{
item = new IndecipherableMap();
from.SendLocalizedMessage(1070800); // The map you create becomes mysteriously indecipherable.
}
else
item = Activator.CreateInstance(ItemType) as Item;
if (item != null && !item.Deleted)
{
if (craftSystem is DefCarpentry)
{
if (RetainsColorFrom(m_System, item.GetType()))
{
if (typeRes == typeof (OakLog))
item.Name = string.Format("Oak {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof (AshLog))
item.Name = string.Format("Ash {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof (YewLog))
item.Name = string.Format("Yew {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof (HeartwoodLog))
item.Name = string.Format("Heartwood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof (BloodwoodLog))
item.Name = string.Format("Bloodwood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof (FrostwoodLog))
item.Name = string.Format("Frostwood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof(MahoganyLog))
item.Name = string.Format("Mahoganywood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof(CedarLog))
item.Name = string.Format("Cedarwood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof(WillowLog))
item.Name = string.Format("Willowwood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
else if (typeRes == typeof(MystWoodLog))
item.Name = string.Format("Mystwood {0}", !string.IsNullOrEmpty(item.Name) ? item.Name.ToLower() : CliLoc.LocToString(item.LabelNumber).ToLower());
}
}
if (item is ICraftable)
{
if (item.Hue == 0)
item.Hue = resHue;
endquality = ((ICraftable)item).OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, this, resHue);
}
else if (item.Hue == 0)
示例4: CompleteCraft
//.........这里部分代码省略.........
case CraftResource.YewWood: item = new YewBoard(); break;
case CraftResource.Heartwood: item = new HeartwoodBoard(); break;
case CraftResource.Bloodwood: item = new BloodwoodBoard(); break;
case CraftResource.Frostwood: item = new FrostwoodBoard(); break;
default: item = new Board(); break;
}
}
#endregion
if (item is ICraftable)
endquality = ((ICraftable)item).OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, this, resHue);
else if (item.Hue == 0)
item.Hue = resHue;
if (maxAmount > 0)
{
if (!item.Stackable && item is IUsesRemaining)
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack(item);
//I Added FOR CRAFTBAG
Container craftbag = GetCraftBag(from);
if (!craftbag.TryDropItem(from, item, false))
{
from.AddToBackpack(item);
}
//I Added For craftbacg above. The original below
//originaly was there above from.AddToBackpack(item);
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
//from.PlaySound( 0x57 );
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
if (pack != null)
{
availableSilver = pack.GetAmount(typeof(Silver));
示例5: CompleteCraft
//.........这里部分代码省略.........
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();
int num = 0;
Item item;
if (customCraft != null)
{
item = customCraft.CompleteCraft(out num);
}
else if (typeof(MapItem).IsAssignableFrom(ItemType) && from.Map != Map.Felucca)
{
item = new IndecipherableMap();
from.SendLocalizedMessage(1070800); // The map you create becomes mysteriously indecipherable.
}
else
{
item = Activator.CreateInstance(ItemType) as Item;
}
if (item != null)
{
if (item is ICraftable)
endquality = ((ICraftable)item).OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, this, resHue);
else if (item.Hue == 0)
item.Hue = resHue;
if (maxAmount > 0)
{
if (!item.Stackable && item is IUsesRemaining)
((IUsesRemaining)item).UsesRemaining *= maxAmount;
else
item.Amount = maxAmount;
}
from.AddToBackpack(item);
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
//from.PlaySound( 0x57 );
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, num));
else if (num > 0)
from.SendLocalizedMessage(num);
}
else if (!allRequiredSkills)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, 1044153));
else
from.SendLocalizedMessage(1044153); // You don't have the required skills to attempt this item.
}
else
{
ConsumeType consumeType = (UseAllRes ? ConsumeType.Half : ConsumeType.All);
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, true))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
tool.UsesRemaining--;
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();
// SkillCheck failed.
int num = craftSystem.PlayEndingEffect(from, true, true, toolBroken, endquality, false, this);
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, num));
else if (num > 0)
from.SendLocalizedMessage(num);
}
}
示例6: CompleteCraft
//.........这里部分代码省略.........
case CraftResource.BlueScales: m_TokensAmount *= 7; break;
//case CraftResource.CopperScales: i_TokensAmount *= 8; break;
//case CraftResource.SilverScales: i_TokensAmount *= 9; break;
//case CraftResource.GoldScales: i_TokensAmount *= 10; break;
case CraftResource.Pine: m_TokensAmount *= 2; break;
case CraftResource.Oak: m_TokensAmount *= 3; break;
case CraftResource.Ash: m_TokensAmount *= 4; break;
case CraftResource.Yew: m_TokensAmount *= 5; break;
//case CraftResource.Oak: m_TokensAmount *= 6; break;
case CraftResource.Cherry: m_TokensAmount *= 7; break;
case CraftResource.Cedar: m_TokensAmount *= 8; break;
case CraftResource.Mahogany: m_TokensAmount *= 9; break;
// case CraftResource.PurpleHeart: i_TokensAmount *= 10; break;
// case CraftResource.Redwood: i_TokensAmount *= 11; break;
// case CraftResource.Petrified: i_TokensAmount *= 12; break;
case CraftResource.Heartwood: m_TokensAmount *= 10; break;
case CraftResource.Bloodwood: m_TokensAmount *= 11; break;
case CraftResource.Frostwood: m_TokensAmount *= 12; break;
}
}
m_TokensAmount *= Ressources.GetAt(0).Amount;
double tok = m_TokensAmount;
if (quality == 2)
tok *= 1.35;
tok /= 8;
if (tok >= 1)
m_TokensAmount = (int)tok;
else
m_TokensAmount = 1;
TokenValidate.RewardTokens(from, m_TokensAmount);
}
if (from.AccessLevel > AccessLevel.Player)
CommandLogging.WriteLine(from, "Crafting {0} with craft system {1}", CommandLogging.Format(item), craftSystem.GetType().Name);
//from.PlaySound( 0x57 );
}
if (num == 0)
num = craftSystem.PlayEndingEffect(from, false, true, toolBroken, endquality, makersMark, this);
bool queryFactionImbue = false;
int availableSilver = 0;
FactionItemDefinition def = null;
Faction faction = null;
if (item is IFactionItem)
{
def = FactionItemDefinition.Identify(item);
if (def != null)
{
faction = Faction.Find(from);
if (faction != null)
{
Town town = Town.FromRegion(from.Region);
if (town != null && town.Owner == faction)
{
Container pack = from.Backpack;
if (pack != null)
{
availableSilver = pack.GetAmount(typeof(Silver));