private void Save_Player_Info() { //lưu thông tin của player for (int i = 0; i < Cons.PLAYER_COUNT; i++) { if (list_player[i] == null) { list_player[i].Player_name = "NULL"; list_player[i].Player_score = 0; list_player[i].IsLock = 0; } if (list_player[i].Player_name != null) { //tạo bản sao của list_player_info[change_index] vì bản thân nó không phải là 1 giá trị PLAYER_INFO copy = list_player_info[i]; //save into copy variable copy.player_name = list_player[i].Player_name; copy.current_score = list_player[i].Player_score; copy.isLock = list_player[i].IsLock.ToString(); //save into change_index list_player_info[i] = copy; } } }
public static void FF9Play_Build(int slot_id, int lv, PLAYER_INFO init, bool lvup) { PLAYER play = FF9StateSystem.Common.FF9.player[slot_id]; if (!lvup && play.level != lv) { play.exp = (uint)ff9level._FF9Level_Exp[lv - 1]; } play.level = (byte)lv; long num1 = play.max.capa - play.cur.capa; long num2 = play.cur.hp; long num3 = play.cur.mp; long num4 = play.cur.capa; long num5 = play.max.capa; play.cur = new POINTS(); play.max = new POINTS(); play.cur.at_coef = 10; play.basis.dex = (byte)ff9level.FF9Level_GetDex(slot_id, play.level, lvup); play.basis.str = (byte)ff9level.FF9Level_GetStr(slot_id, play.level, lvup); play.basis.mgc = (byte)ff9level.FF9Level_GetMgc(slot_id, play.level, lvup); play.basis.wpr = (byte)ff9level.FF9Level_GetWpr(slot_id, play.level, lvup); play.max.hp = (ushort)ff9level.FF9Level_GetHp(play.level, play.basis.str); play.basis.max_hp = (short)play.max.hp; play.max.mp = play.basis.max_mp = (short)ff9level.FF9Level_GetMp(play.level, play.basis.mgc); play.max.capa = (byte)ff9level.FF9Level_GetCap(slot_id, play.level, lvup); play.cur.hp = (ushort)ccommon.min((int)num2, play.max.hp); play.cur.mp = (short)ccommon.min((int)num3, play.max.mp); play.cur.capa = (byte)(play.max.capa - (ulong)num1); if (init != null) { play.cur.hp = play.max.hp; play.cur.mp = play.max.mp; play.cur.capa = play.max.capa; } FF9Play_Update(play); if (lvup) { play.cur.hp = (ushort)ccommon.min((int)num2, play.max.hp); play.cur.mp = (short)ccommon.min((int)num3, play.max.mp); } if (num5 == 99L) { play.cur.capa = (byte)num4; play.max.capa = (byte)num5; } if (num1 <= play.max.capa) { return; } FF9Play_UpdateSA(play); }
public static void FF9Play_Build(Int32 slot_id, Int32 lv, PLAYER_INFO init, Boolean lvup) { PLAYER play = FF9StateSystem.Common.FF9.player[slot_id]; if (!lvup && play.level != lv) { play.exp = ff9level.CharacterLevelUps[lv - 1].ExperienceToLevel; } play.level = (Byte)lv; Int64 num1 = play.max.capa - play.cur.capa; Int64 num2 = play.cur.hp; Int64 num3 = play.cur.mp; Int64 num4 = play.cur.capa; Int64 num5 = play.max.capa; play.cur = new POINTS(); play.max = new POINTS(); play.cur.at_coef = 10; play.basis.dex = (Byte)ff9level.FF9Level_GetDex(slot_id, play.level, lvup); play.basis.str = (Byte)ff9level.FF9Level_GetStr(slot_id, play.level, lvup); play.basis.mgc = (Byte)ff9level.FF9Level_GetMgc(slot_id, play.level, lvup); play.basis.wpr = (Byte)ff9level.FF9Level_GetWpr(slot_id, play.level, lvup); play.max.hp = (UInt16)ff9level.FF9Level_GetHp(play.level, play.basis.str); play.basis.max_hp = (Int16)play.max.hp; play.max.mp = play.basis.max_mp = (Int16)ff9level.FF9Level_GetMp(play.level, play.basis.mgc); play.max.capa = (Byte)ff9level.FF9Level_GetCap(slot_id, play.level, lvup); play.cur.hp = (UInt16)ccommon.min((Int32)num2, play.max.hp); play.cur.mp = (Int16)ccommon.min((Int32)num3, play.max.mp); play.cur.capa = (Byte)(play.max.capa - (UInt64)num1); if (init != null) { play.cur.hp = play.max.hp; play.cur.mp = play.max.mp; play.cur.capa = play.max.capa; } FF9Play_Update(play); if (lvup) { play.cur.hp = (UInt16)ccommon.min((Int32)num2, play.max.hp); play.cur.mp = (Int16)ccommon.min((Int32)num3, play.max.mp); } if (num5 == 99L) { play.cur.capa = (Byte)num4; play.max.capa = (Byte)num5; } if (num1 <= play.max.capa) { return; } FF9Play_UpdateSA(play); }
private void ToggleOrder() { if (this.currentCharacterIndex == this.currentOrder) { if (FF9StateSystem.Common.FF9.party.member[this.currentCharacterIndex] != null) { PLAYER_INFO info = FF9StateSystem.Common.FF9.party.member[this.currentCharacterIndex].info; info.row = (Byte)(info.row ^ 1); } } else { PLAYER player = FF9StateSystem.Common.FF9.party.member[this.currentCharacterIndex]; FF9StateSystem.Common.FF9.party.member[this.currentCharacterIndex] = FF9StateSystem.Common.FF9.party.member[this.currentOrder]; FF9StateSystem.Common.FF9.party.member[this.currentOrder] = player; } }