本文整理汇总了C#中Creature.SetSubWeapon方法的典型用法代码示例。如果您正苦于以下问题:C# Creature.SetSubWeapon方法的具体用法?C# Creature.SetSubWeapon怎么用?C# Creature.SetSubWeapon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Creature
的用法示例。
在下文中一共展示了Creature.SetSubWeapon方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyOptions
public void ApplyOptions(Creature obj, bool levelup)
{
if (m_refItem.levelup == null || m_refItem.levelup.optionPerLevel == null)
return;
foreach(RefPriceCondition.RefOptionPerLevel op in m_refItem.levelup.optionPerLevel)
{
float optionValue = 0f;
if (op.levelPer == false)
{
if (levelup == false)
{
if (Level >= op.level)
optionValue = op.option.values[0];
}
else
{
if (Level == op.level)
optionValue = op.option.values[0];
}
}
else
{
if (levelup == false)
optionValue = op.option.values[0]*(Level/op.level);
else
{
if (Level%op.level == 0)
optionValue = op.option.values[0];
}
}
switch(op.option.type)
{
case Option.DmgMultiplier:
obj.m_creatureProperty.DamageMultiPlier += optionValue;
break;
case Option.MoveSpeed:
obj.m_creatureProperty.AlphaMoveSpeed += optionValue;
break;
case Option.DmgReduction:
obj.m_creatureProperty.DamageReduction += optionValue;
break;
case Option.Weapon:
int weaponRefItemId = (int)optionValue;
if (weaponRefItemId == 0)
break;
if (weaponRefItemId == Const.EmbersRefItemId)
{
obj.SetSubWeapon(obj.WeaponHolder.MainWeapon, new ItemWeaponData(Const.EmbersRefItemId), new RefMob.WeaponDesc());
}
else
{
ItemWeaponData weaponData = new ItemWeaponData((int)optionValue);
weaponData.Level = (int)op.option.values[1];
obj.EquipPassiveSkillWeapon(weaponData, new RefMob.WeaponDesc());
}
break;
case Option.Strength:
obj.m_creatureProperty.AlphaPhysicalAttackDamage += (int)optionValue;
break;
case Option.MaxHp:
obj.m_creatureProperty.AlphaMaxHP += (int)optionValue;
break;
case Option.MaxSp:
obj.m_creatureProperty.AlphaMaxSP += (int)optionValue;
break;
case Option.RegenSp:
obj.m_creatureProperty.AlphaSPRegen += optionValue;
break;
case Option.TapDamage:
obj.m_creatureProperty.TapDamage += (int)optionValue;
break;
case Option.Critical:
obj.m_creatureProperty.AlphaCriticalChance += optionValue;
break;
case Option.CriticalDmg:
obj.m_creatureProperty.AlphaCriticalDamage += optionValue;
break;
case Option.LifeSteal:
obj.m_creatureProperty.AlphaLifeSteal += optionValue;
break;
case Option.Dodge:
obj.m_creatureProperty.Dodge += optionValue;
break;
case Option.GainExtraGold:
obj.m_creatureProperty.GainExtraGold += optionValue;
Creature owner = obj.GetOwner();
if (owner != null)
{
owner.m_creatureProperty.GainExtraGold += optionValue;
}
break;
}
}
}