public static void FF9Play_Update(PLAYER play) { FF9PLAY_INFO info = new FF9PLAY_INFO(); FF9PLAY_SKILL skill = new FF9PLAY_SKILL(); info.Base = play.basis; info.cur_hp = play.cur.hp; info.cur_mp = (ushort)play.cur.mp; for (int index = 0; index < 1; ++index) { info.sa[index] = play.sa[index]; } for (int index = 0; index < 5; ++index) { info.equip[index] = play.equip[index]; } FF9Play_GetSkill(ref info, ref skill); play.elem.dex = skill.Base[0]; play.elem.str = skill.Base[1]; play.elem.mgc = skill.Base[2]; play.elem.wpr = skill.Base[3]; play.defence.p_def = (byte)skill.weapon[1]; play.defence.p_ev = (byte)skill.weapon[2]; play.defence.m_def = (byte)skill.weapon[3]; play.defence.m_ev = (byte)skill.weapon[4]; play.cur.hp = skill.cur_hp; play.cur.mp = (short)skill.cur_mp; play.max.hp = skill.max_hp; play.max.mp = (short)skill.max_mp; }
public static void FF9Play_Update(PLAYER play) { FF9PLAY_INFO info = new FF9PLAY_INFO(); FF9PLAY_SKILL skill = new FF9PLAY_SKILL(); info.Base = play.basis; info.cur_hp = play.cur.hp; info.cur_mp = (UInt16)play.cur.mp; for (Int32 index = 0; index < 1; ++index) { info.sa[index] = play.sa[index]; } info.equip.Absorb(play.equip); FF9Play_GetSkill(ref info, ref skill); play.elem.dex = skill.Base[0]; play.elem.str = skill.Base[1]; play.elem.mgc = skill.Base[2]; play.elem.wpr = skill.Base[3]; play.defence.PhisicalDefence = (Byte)skill.weapon[1]; play.defence.PhisicalEvade = (Byte)skill.weapon[2]; play.defence.MagicalDefence = (Byte)skill.weapon[3]; play.defence.MagicalEvade = (Byte)skill.weapon[4]; play.cur.hp = skill.cur_hp; play.cur.mp = (Int16)skill.cur_mp; play.max.hp = skill.max_hp; play.max.mp = (Int16)skill.max_mp; }
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 = (ushort)info.Base.max_hp, max_mp = (ushort)info.Base.max_mp, Base = { [0] = info.Base.dex, [1] = info.Base.str, [2] = info.Base.mgc, [3] = info.Base.wpr } }; int index1; if ((index1 = info.equip[0]) != byte.MaxValue) { skill.weapon[0] = ff9weap._FF9Weapon_Data[index1].Ref.power; } for (int index2 = 0; index2 < 4; ++index2) { int num; if ((num = info.equip[1 + index2]) != byte.MaxValue && num >= 88 && num < 224) { DEF_PARAMS defParams = ff9armor._FF9Armor_Data[num - 88]; skill.weapon[1] += defParams.p_def; skill.weapon[2] += defParams.p_ev; skill.weapon[3] += defParams.m_def; skill.weapon[4] += defParams.m_ev; } } for (int index2 = 0; index2 < 5; ++index2) { int index3; if ((index3 = info.equip[index2]) != byte.MaxValue) { FF9ITEM_DATA ff9ItemData = ff9item._FF9Item_Data[index3]; EQUIP_PRIVILEGE equipPrivilege = ff9equip._FF9EquipBonus_Data[ff9ItemData.bonus]; skill.Base[0] += equipPrivilege.dex; skill.Base[1] += equipPrivilege.str; skill.Base[2] += equipPrivilege.mgc; skill.Base[3] += equipPrivilege.wpr; } } for (int index2 = 0; index2 < 4; ++index2) { if (ff9abil.FF9Abil_IsEnableSA(info.sa, numArray1[index2])) { switch (numArray1[index2]) { case 197: skill.max_hp = (ushort)(skill.max_hp + skill.max_hp / 10U); continue; case 198: skill.max_hp = (ushort)(skill.max_hp + skill.max_hp / 5U); continue; case 199: skill.max_mp = (ushort)(skill.max_mp + skill.max_mp / 10U); continue; case 200: skill.max_mp = (ushort)(skill.max_mp + skill.max_mp / 5U); continue; default: continue; } } } for (int index2 = 0; index2 < 4; ++index2) { if (skill.Base[index2] > numArray2[index2]) { skill.Base[index2] = numArray2[index2]; } } for (int 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); }
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); }