public static Int32 FF9Shop_GetDefence(Int32 part, CharacterEquipment equip) { Int32 result = 0; ItemDefence def = new ItemDefence(); for (Int32 i = 1; i < 5; i++) { if (equip[i] != 255 && 224 > equip[i]) { Int32 num = equip[i] - 88; def.PhisicalDefence = (Byte)(def.PhisicalDefence + ff9armor.ArmorData[num].PhisicalDefence); def.PhisicalEvade = (Byte)(def.PhisicalEvade + ff9armor.ArmorData[num].PhisicalEvade); def.MagicalDefence = (Byte)(def.MagicalDefence + ff9armor.ArmorData[num].MagicalDefence); def.MagicalEvade = (Byte)(def.MagicalEvade + ff9armor.ArmorData[num].MagicalEvade); } } switch (part) { case 1: result = def.MagicalDefence; break; case 2: result = def.PhisicalEvade; break; case 3: result = def.PhisicalDefence; break; case 4: result = 0; break; } return(result); }
public static FF9PLAY_SKILL FF9Play_GetSkill(ref FF9PLAY_INFO info, ref FF9PLAY_SKILL skill) { Byte[] numArray1 = { 197, 198, 199, 200 }; Byte[] numArray2 = { 50, 99, 99, 50 }; skill = new FF9PLAY_SKILL { cur_hp = info.cur_hp, cur_mp = info.cur_mp, max_hp = (UInt16)info.Base.max_hp, max_mp = (UInt16)info.Base.max_mp, Base = { [0] = info.Base.dex, [1] = info.Base.str, [2] = info.Base.mgc, [3] = info.Base.wpr } }; Int32 index1; if ((index1 = info.equip[0]) != Byte.MaxValue) { skill.weapon[0] = ff9weap.WeaponData[index1].Ref.Power; } for (Int32 index2 = 0; index2 < 4; ++index2) { Int32 num; if ((num = info.equip[1 + index2]) != Byte.MaxValue && num >= 88 && num < 224) { ItemDefence defParams = ff9armor.ArmorData[num - 88]; skill.weapon[1] += defParams.PhisicalDefence; skill.weapon[2] += defParams.PhisicalEvade; skill.weapon[3] += defParams.MagicalDefence; skill.weapon[4] += defParams.MagicalEvade; } } for (Int32 index2 = 0; index2 < 5; ++index2) { Int32 index3; if ((index3 = info.equip[index2]) != Byte.MaxValue) { FF9ITEM_DATA ff9ItemData = ff9item._FF9Item_Data[index3]; ItemStats equipPrivilege = ff9equip.ItemStatsData[ff9ItemData.bonus]; skill.Base[0] += equipPrivilege.dex; skill.Base[1] += equipPrivilege.str; skill.Base[2] += equipPrivilege.mgc; skill.Base[3] += equipPrivilege.wpr; } } for (Int32 index2 = 0; index2 < 4; ++index2) { if (ff9abil.FF9Abil_IsEnableSA(info.sa, numArray1[index2])) { switch (numArray1[index2]) { case 197: skill.max_hp = (UInt16)(skill.max_hp + skill.max_hp / 10U); continue; case 198: skill.max_hp = (UInt16)(skill.max_hp + skill.max_hp / 5U); continue; case 199: skill.max_mp = (UInt16)(skill.max_mp + skill.max_mp / 10U); continue; case 200: skill.max_mp = (UInt16)(skill.max_mp + skill.max_mp / 5U); continue; default: continue; } } } for (Int32 index2 = 0; index2 < 4; ++index2) { if (skill.Base[index2] > numArray2[index2]) { skill.Base[index2] = numArray2[index2]; } } for (Int32 index2 = 0; index2 < 5; ++index2) { if (skill.weapon[index2] > 999) { skill.weapon[index2] = 999; } } if (skill.max_hp > 9999) { skill.max_hp = 9999; } if (skill.max_mp > 999) { skill.max_mp = 999; } if (skill.cur_hp > skill.max_hp) { skill.cur_hp = skill.max_hp; } if (skill.cur_mp > skill.max_mp) { skill.cur_mp = skill.max_mp; } return(skill); }