本文整理汇总了C#中Server.Engines.Harvest.HarvestBank类的典型用法代码示例。如果您正苦于以下问题:C# HarvestBank类的具体用法?C# HarvestBank怎么用?C# HarvestBank使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HarvestBank类属于Server.Engines.Harvest命名空间,在下文中一共展示了HarvestBank类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBank
public HarvestBank GetBank( Map map, int x, int y )
{
if ( map == null || map == Map.Internal )
return null;
x /= m_BankWidth;
y /= m_BankHeight;
Hashtable banks = (Hashtable)m_BanksByMap[map];
if ( banks == null )
m_BanksByMap[map] = banks = new Hashtable();
Point2D key = new Point2D( x, y );
HarvestBank bank = (HarvestBank)banks[key];
if ( bank == null )
banks[key] = bank = new HarvestBank( this, GetVeinAt( map, x, y ) );
return bank;
}
示例2: OnHarvestFinished
public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
{
/* include this part for rare extras
// modded by greywolf for random items coming in
double skillvaluelj = killerguy.Skills[SkillName.Magery].Base;
int i_itemid = (int)(killerguy.Skills[SkillName.ItemID].Base/10);
if ((Utility.RandomMinMax( 1, 1500 ) <= (1 + i_itemid)) && (skillvaluelj >= 70.1))
{
switch (Utility.RandomMinMax( 0, 10 ))
{
case 1 : default: from.AddToBackpack(new Kindling()); from.SendMessage ("you find something wedged in the tree, a weird peice of wood ");break;
case 2 : from.AddToBackpack(new BarkFragment()); from.SendMessage ("you find something wedged in the tree, a peice of bark ");break;
case 3 : from.AddToBackpack(new LuminescentFungi()); from.SendMessage ("you find something wedged in the tree, some fungi ");break;
case 4 : from.AddToBackpack(new ParasiticPlant()); from.SendMessage ("you find something wedged in the tree, a weird looking plant");break;
case 5 : from.AddToBackpack(new DiseasedBark()); from.SendMessage ("you find something wedged in the tree, some weird looking bark ");break;
}
}
*/
}
示例3: GetBank
public HarvestBank GetBank( Map map, int x, int y )
{
if ( map == null || map == Map.Internal )
return null;
x /= m_BankWidth;
y /= m_BankHeight;
Dictionary<Point2D, HarvestBank> banks = null;
m_BanksByMap.TryGetValue( map, out banks );
if ( banks == null )
m_BanksByMap[map] = banks = new Dictionary<Point2D, HarvestBank>();
Point2D key = new Point2D( x, y );
HarvestBank bank = null;
banks.TryGetValue( key, out bank );
if ( bank == null )
banks[key] = bank = new HarvestBank( this, GetVeinAt( map, x, y ) );
return bank;
}
示例4: OnHarvestFinished
public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
{
if ( tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble() )
{
HarvestResource res = vein.PrimaryResource;
if ( res == resource && res.Types.Length >= 3 )
{
try
{
Map map = from.Map;
if ( map == null )
return;
BaseCreature spawned = Activator.CreateInstance( res.Types[2], new object[]{ 25 } ) as BaseCreature;
if ( spawned != null )
{
int offset = Utility.Random( 8 ) * 2;
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, from.Z ) )
{
spawned.MoveToWorld( new Point3D( x, y, from.Z ), map );
spawned.Combatant = from;
return;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
spawned.MoveToWorld( new Point3D( x, y, z ), map );
spawned.Combatant = from;
return;
}
}
}
spawned.MoveToWorld( from.Location, from.Map );
spawned.Combatant = from;
}
}
catch
{
}
}
}
}
示例5: MutateVein
public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
{
if ( tool is GargoylesPickaxe && def == m_OreAndStone )
{
int veinIndex = Array.IndexOf( def.Veins, vein );
if ( veinIndex >= 0 && veinIndex < (def.Veins.Length - 1) )
return def.Veins[veinIndex + 1];
}
return base.MutateVein( from, tool, def, bank, toHarvest, vein );
}
示例6: OnHarvestFinished
public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
{
HarvestResource res = vein.PrimaryResource;
if (res == resource && res.Types.Length >= 3)
{
try
{
Map map = from.Map;
if (map == null)
return;
}
catch
{
}
}
}
示例7: OnHarvestFinished
public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
{
base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);
if (Core.ML)
from.RevealingAction();
}
示例8: MutateVein
public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
{
return base.MutateVein( from, tool, def, bank, toHarvest, vein );
}
示例9: OnHarvestFinished
public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
{
base.OnHarvestFinished( from, tool, def, vein, bank, resource, harvested );
if( tool is YewAxe && def == m_Definition && 0.10 >= Utility.RandomDouble() )
{
HarvestResource res = vein.PrimaryResource;
if( res == resource )
{
try
{
Map map = from.Map;
if( map == null || map == Map.Internal )
return;
BaseCreature spawned = Activator.CreateInstance( typeof( Reaper ) ) as BaseCreature;
if( spawned != null )
{
int offset = Utility.Random( 4 ) * 2;
for( int i = 0; i < m_Offsets.Length; i++ )
{
int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
int z = (map.CanSpawnMobile( x, y, from.Z ) ? from.Z : map.GetAverageZ( x, y ));
if( !map.CanSpawnMobile( x, y, z ) )
{
x = from.X;
y = from.Y;
z = from.Z;
}
if( map.CanSpawnMobile( x, y, z ) )
{
spawned.OnBeforeSpawn( new Point3D( x, y, z ), map );
spawned.MoveToWorld( new Point3D( x, y, z ), map );
spawned.Combatant = from;
from.SendMessage( "You have awoken a spirit tree!" );
break;
}
}
}
}
catch { }
}
}
}
示例10: HasBeenChecked
public static bool HasBeenChecked(HarvestBank bank)
{
if (m_BankTable.ContainsKey(bank) && m_BankTable[bank] < DateTime.UtcNow)
m_BankTable.Remove(bank);
return m_BankTable.ContainsKey(bank);
}
示例11: OnHarvestFinished
public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
{
if ( tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble() )
{
HarvestResource res = vein.PrimaryResource;
if ( res == resource && res.Types.Length >= 3 )
{
try
{
Map map = from.Map;
if ( map == null )
return;
BaseCreature spawned = Activator.CreateInstance( res.Types[2], new object[]{ 25 } ) as BaseCreature;
if ( spawned != null )
{
int offset = Utility.Random( 8 ) * 2;
for ( int i = 0; i < m_Offsets.Length; i += 2 )
{
int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, from.Z ) )
{
spawned.OnBeforeSpawn(new Point3D(x, y, from.Z), map);
spawned.MoveToWorld( new Point3D( x, y, from.Z ), map );
spawned.Combatant = from;
return;
}
else
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
{
spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
spawned.MoveToWorld( new Point3D( x, y, z ), map );
spawned.Combatant = from;
return;
}
}
}
spawned.OnBeforeSpawn(from.Location, from.Map);
spawned.MoveToWorld( from.Location, from.Map );
spawned.Combatant = from;
}
}
catch
{
}
}
}
if (bank != null && bank.Vein != null && bank.Vein.PrimaryResource != null)
{
int bankAmount = bank.Current;
double skillReq = bank.Vein.PrimaryResource.ReqSkill;
if (skillReq >= 99.0 && bankAmount <= 13)
bank.Consume(def, bankAmount, from);
else if (skillReq >= 98.0 && bankAmount <= 12)
bank.Consume(def, bankAmount, from);
else if (skillReq >= 97.0 && bankAmount <= 10)
bank.Consume(def, bankAmount, from);
else if (skillReq >= 90.0 && bankAmount <= 8)
bank.Consume(def, bankAmount, from);
else if (skillReq >= 75.0 && bankAmount <= 6)
bank.Consume(def, bankAmount, from);
else if (skillReq >= 65.0 && bankAmount <= 4)
bank.Consume(def, bankAmount, from);
}
}
示例12: OnHarvestFinished
public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
{
if (tool is DeepSeaFishingPole)
((DeepSeaFishingPole)tool).Charges--;
base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);
if (Core.ML)
from.RevealingAction();
}
示例13: CheckMutateVein
public void CheckMutateVein(Mobile from, HarvestDefinition def, HarvestBank bank, HarvestVein vein)
{
if (vein.PrimaryResource.ReqSkill > from.Skills[def.Skill].Base)
{
vein = def.Veins[0];
bank.Vein = vein;
}
//while (vein.PrimaryResource.ReqSkill > from.Skills[def.Skill].Base)
//{
// int maxVal = (int)(def.Veins[0].PrimaryResource.ReqSkill*100);
// int minVal = (int)(def.Veins[def.Veins.Length - 1].PrimaryResource.ReqSkill * 100);
// double spawnChance = Utility.RandomMinMax(minVal, maxVal);
// //Convert the random number into percent
// spawnChance /= 100;
// for (int i = def.Veins.Length - 1; i >= 0; i--)
// {
// if (def.Veins[i].VeinChance >= spawnChance)
// {
// vein = def.Veins[i];
// bank.Vein = vein;
// break;
// }
// }
//}
}
示例14: InternalTimer
public InternalTimer(Mobile from, HarvestBank bank, int maxCount)
: base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), maxCount)
{
m_From = from;
m_Bank = bank;
m_Count = 0;
m_MaxCount = maxCount;
}
示例15: OnHarvestFinished
public virtual void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
{
}