本文整理匯總了C#中Server.AosSkillBonuses.AddTo方法的典型用法代碼示例。如果您正苦於以下問題:C# AosSkillBonuses.AddTo方法的具體用法?C# AosSkillBonuses.AddTo怎麽用?C# AosSkillBonuses.AddTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.AosSkillBonuses
的用法示例。
在下文中一共展示了AosSkillBonuses.AddTo方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 5:
{
// erl: New "crafted by" and quality properties
m_Crafter = reader.ReadMobile();
m_Quality = (JewelQuality)reader.ReadShort();
goto case 4;
}
case 4:
{
// remove AOS crap
// see case 1 below
goto case 3;
}
case 3:
{
m_MagicType = (JewelMagicEffect) reader.ReadInt();
m_MagicCharges = reader.ReadInt();
m_Identified = reader.ReadBool();
goto case 2;
}
case 2:
{
m_Resource = (CraftResource)reader.ReadEncodedInt();
m_GemType = (GemType)reader.ReadEncodedInt();
goto case 1;
}
case 1:
{
// pack these out of furture versions.
if (version < 4)
{
AosAttributes dmy_AosAttributes;
AosElementAttributes dmy_AosResistances;
AosSkillBonuses dmy_AosSkillBonuses;
dmy_AosAttributes = new AosAttributes( this, reader );
dmy_AosResistances = new AosElementAttributes( this, reader );
dmy_AosSkillBonuses = new AosSkillBonuses( this, reader );
if ( Core.AOS && Parent is Mobile )
dmy_AosSkillBonuses.AddTo( (Mobile)Parent );
int strBonus = dmy_AosAttributes.BonusStr;
int dexBonus = dmy_AosAttributes.BonusDex;
int intBonus = dmy_AosAttributes.BonusInt;
if ( Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
{
Mobile m = (Mobile)Parent;
string modName = Serial.ToString();
if ( strBonus != 0 )
m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );
if ( dexBonus != 0 )
m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );
if ( intBonus != 0 )
m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
}
}
if ( Parent is Mobile )
((Mobile)Parent).CheckStatTimers();
break;
}
case 0:
{
// pack these out of furture versions.
if (version < 4)
{
AosAttributes dmy_AosAttributes;
AosElementAttributes dmy_AosResistances;
AosSkillBonuses dmy_AosSkillBonuses;
dmy_AosAttributes = new AosAttributes( this );
dmy_AosResistances = new AosElementAttributes( this );
dmy_AosSkillBonuses = new AosSkillBonuses( this );
}
break;
}
}
if ( version < 2 )
{
m_Resource = CraftResource.Iron;
m_GemType = GemType.None;
}
//.........這裏部分代碼省略.........
示例2: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 3:
{
m_MaxHitPoints = reader.ReadEncodedInt();
m_HitPoints = reader.ReadEncodedInt();
goto case 2;
}
case 2:
{
m_Resource = (CraftResource)reader.ReadEncodedInt();
m_GemType = (GemType)reader.ReadEncodedInt();
goto case 1;
}
case 1:
{
m_AosAttributes = new AosAttributes(this, reader);
m_AosResistances = new AosElementAttributes(this, reader);
m_AosSkillBonuses = new AosSkillBonuses(this, reader);
if (Core.AOS && Parent is Mobile)
m_AosSkillBonuses.AddTo((Mobile)Parent);
int strBonus = m_AosAttributes.BonusStr;
int dexBonus = m_AosAttributes.BonusDex;
int intBonus = m_AosAttributes.BonusInt;
if (Parent is Mobile && (strBonus != 0 || dexBonus != 0 || intBonus != 0))
{
Mobile m = (Mobile)Parent;
string modName = Serial.ToString();
if (strBonus != 0)
m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
if (dexBonus != 0)
m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
if (intBonus != 0)
m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
}
if (Parent is Mobile)
((Mobile)Parent).CheckStatTimers();
break;
}
case 0:
{
m_AosAttributes = new AosAttributes(this);
m_AosResistances = new AosElementAttributes(this);
m_AosSkillBonuses = new AosSkillBonuses(this);
break;
}
}
if (version < 2)
{
m_Resource = CraftResource.Iron;
m_GemType = GemType.None;
}
}