本文整理汇总了C#中BaseCreature.AddItem方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.AddItem方法的具体用法?C# BaseCreature.AddItem怎么用?C# BaseCreature.AddItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.AddItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EquipItems
private void EquipItems( BaseCreature bc )
{
bc.AddItem( new RingmailChest() );
bc.AddItem( new RingmailLegs() );
bc.AddItem( new RingmailArms() );
bc.AddItem( new RingmailGloves() );
bc.AddItem( new PlateGorget() );
bc.AddItem( new LeatherCap() );
switch( Utility.Random( 4 ) )
{
case 0: bc.AddItem( new Halberd() ); break;
case 1: bc.AddItem( new Longsword() ); break;
case 2: bc.AddItem( new VikingSword() ); break;
case 3: bc.AddItem( new Broadsword() ); break;
}
if( bc.FindItemOnLayer( Layer.TwoHanded ) == null )
{
switch( Utility.Random( 4 ) )
{
case 0: bc.AddItem( new BronzeShield() ); break;
case 1: bc.AddItem( new MetalKiteShield() ); break;
case 2: bc.AddItem( new HeaterShield() ); break;
case 3: bc.AddItem( new WoodenKiteShield() ); break;
}
}
switch( Utility.Random( 3 ) )
{
case 0:
case 1: bc.AddItem( new Boots() ); break;
case 2: bc.AddItem( new ThighBoots() ); break;
}
if( Utility.RandomBool() )
bc.AddItem( new Cloak( Utility.RandomDyedHue() ) );
}
示例2: Generate
public void Generate( BaseCreature npc )
{
if ( npc == null || npc.Summoned )
return;
for ( int i = 0; i < m_Entries.Length; ++i )
{
LootPackEntry entry = m_Entries[i];
if ( !( entry.Chance > Utility.Random( 10000 ) ) )
continue;
Item item = entry.Construct();
if ( item != null )
{
if ( npc.Backpack == null )
npc.AddItem( new Backpack() );
if ( !item.Stackable || !npc.Backpack.TryDropItem( npc, item, false ) )
npc.Backpack.DropItem( item );
}
}
}