public virtual void GetAttackingData( ref bool isLeftHand, out AnimActionType animActionType, out int dataId, out int animationIndex, out CharacterItem weapon, out float triggerDuration, out float totalDuration, out DamageInfo damageInfo, out Dictionary <DamageElement, MinMaxFloat> allDamageAmounts) { // Initialize data animActionType = AnimActionType.None; dataId = 0; animationIndex = 0; weapon = this.GetAvailableWeapon(ref isLeftHand); triggerDuration = 0f; totalDuration = 0f; damageInfo = null; allDamageAmounts = new Dictionary <DamageElement, MinMaxFloat>(); // Prepare weapon data Item weaponItem = weapon.GetWeaponItem(); WeaponType weaponType = weaponItem.WeaponType; // Assign data id dataId = weaponType.DataId; // Assign animation action type animActionType = !isLeftHand ? AnimActionType.AttackRightHand : AnimActionType.AttackLeftHand; // Random animation if (!isLeftHand) { CharacterModel.GetRandomRightHandAttackAnimation(dataId, out animationIndex, out triggerDuration, out totalDuration); } else { CharacterModel.GetRandomLeftHandAttackAnimation(dataId, out animationIndex, out triggerDuration, out totalDuration); } // Assign damage data damageInfo = weaponType.damageInfo; // Calculate all damages allDamageAmounts = GameDataHelpers.CombineDamages( allDamageAmounts, weaponItem.GetDamageAmount(weapon.level, weapon.GetEquipmentBonusRate(), this)); allDamageAmounts = GameDataHelpers.CombineDamages( allDamageAmounts, CacheIncreaseDamages); }
public virtual void GetUsingSkillData( Skill skill, short level, ref bool isLeftHand, out AnimActionType animActionType, out int skillOrWeaponTypeDataId, out int animationIndex, out CharacterItem weapon, out float triggerDuration, out float totalDuration, out DamageInfo damageInfo, out Dictionary <DamageElement, MinMaxFloat> allDamageAmounts) { // Initialize data animActionType = AnimActionType.None; skillOrWeaponTypeDataId = 0; animationIndex = 0; weapon = this.GetAvailableWeapon(ref isLeftHand); triggerDuration = 0f; totalDuration = 0f; damageInfo = null; allDamageAmounts = new Dictionary <DamageElement, MinMaxFloat>(); // Prepare skill data if (skill == null) { return; } // Prepare weapon data Item weaponItem = weapon.GetWeaponItem(); WeaponType weaponType = weaponItem.WeaponType; SkillActivateAnimationType useSkillActivateAnimationType = CharacterModel.UseSkillActivateAnimationType(skill); // Prepare animation if (useSkillActivateAnimationType == SkillActivateAnimationType.UseAttackAnimation && skill.skillAttackType != SkillAttackType.None) { // If there is no cast animations // Assign data id skillOrWeaponTypeDataId = weaponType.DataId; // Assign animation action type animActionType = !isLeftHand ? AnimActionType.AttackRightHand : AnimActionType.AttackLeftHand; // Random animation if (!isLeftHand) { CharacterModel.GetRandomRightHandAttackAnimation(skillOrWeaponTypeDataId, out animationIndex, out triggerDuration, out totalDuration); } else { CharacterModel.GetRandomLeftHandAttackAnimation(skillOrWeaponTypeDataId, out animationIndex, out triggerDuration, out totalDuration); } } else if (useSkillActivateAnimationType == SkillActivateAnimationType.UseActivateAnimation) { // Assign data id skillOrWeaponTypeDataId = skill.DataId; // Assign animation action type animActionType = AnimActionType.Skill; // Random animation CharacterModel.GetSkillActivateAnimation(skillOrWeaponTypeDataId, out triggerDuration, out totalDuration); } // If it is attack skill if (skill.skillAttackType != SkillAttackType.None) { switch (skill.skillAttackType) { case SkillAttackType.Normal: // Assign damage data damageInfo = skill.damageInfo; // Calculate all damages allDamageAmounts = weaponItem.GetDamageAmountWithInflictions(weapon.level, weapon.GetEquipmentBonusRate(), this, skill.GetWeaponDamageInflictions(level)); // Sum damage with additional damage amounts allDamageAmounts = GameDataHelpers.CombineDamages( allDamageAmounts, skill.GetDamageAmount(level, this)); // Sum damage with skill damage allDamageAmounts = GameDataHelpers.CombineDamages( allDamageAmounts, skill.GetAdditionalDamageAmounts(level)); break; case SkillAttackType.BasedOnWeapon: // Assign damage data damageInfo = weaponType.damageInfo; // Calculate all damages allDamageAmounts = weaponItem.GetDamageAmountWithInflictions(weapon.level, weapon.GetEquipmentBonusRate(), this, skill.GetWeaponDamageInflictions(level)); // Sum damage with additional damage amounts allDamageAmounts = GameDataHelpers.CombineDamages( allDamageAmounts, skill.GetAdditionalDamageAmounts(level)); break; } allDamageAmounts = GameDataHelpers.CombineDamages( allDamageAmounts, CacheIncreaseDamages); } }