private void InitializeGameMeu(string[] raw_data) { string[] tmpSX; int tmp = 1, tmp2; if (ImportantMethods.IsNumericGZ(raw_data[tmp])) { FlagsGZ = ulong.Parse(raw_data[tmp]); SetFlags(); } else { Flags = raw_data[tmp].Trim(); SetFlagsGZ(); } tmp++; Text = raw_data[tmp]; tmp++; MeshName = raw_data[tmp]; tmp++; tmp2 = int.Parse(raw_data[tmp]); if (tmp2 != 0) { OperationBlock = new string[tmp2 + 1]; tmpSX = new string[raw_data.Length - tmp - 1]; tmp++; for (int i = tmp - 1; i < raw_data.Length - 1; i++) { tmpSX[i - (tmp - 1)] = raw_data[i]; } OperationBlock[0] = ID + 1; tmpSX = CodeReader.DecompileScriptCode(OperationBlock, tmpSX); OperationBlock = CodeReader.GetStringArrayStartFromIndex(tmpSX, 1); } }
public TableauMaterial(string[] raw_data, bool source = false) : base(raw_data[0], ObjectType.TableauMaterial) { FlagsGZ = ulong.Parse(raw_data[1]); Flags = FlagsGZ.ToString(); //change if flags available SampleMaterialName = raw_data[2]; //change to name if good idea later Width = int.Parse(raw_data[3]); Height = int.Parse(raw_data[4]); MinX = int.Parse(raw_data[5]); MinY = int.Parse(raw_data[6]); MaxX = int.Parse(raw_data[7]); MaxY = int.Parse(raw_data[8]); if (!source) { OperationBlock = new string[int.Parse(raw_data[9]) + 1]; OperationBlock[0] = ID; OperationBlock = CodeReader.GetStringArrayStartFromIndex(CodeReader.DecompileScriptCode(OperationBlock, CodeReader.GetStringArrayStartFromIndex(raw_data, 9)), 1); } else { OperationBlock = new string[raw_data.Length - 9]; for (int i = 0; i < OperationBlock.Length; i++) { OperationBlock[i] = raw_data[i + 9]; } } }
private static string[] ProcessBlock(string[] raw_data, int tmp, int start_index) { int xx = 0; int x = -1; string[] tmpSX; string[] resArray = new string[tmp + 1]; for (int i = start_index; i < raw_data.Length; i++) { if (!raw_data[i].Equals(string.Empty)) { x++; } else { i = raw_data.Length; } } if (raw_data.Length > (start_index + x + 2)) { if (raw_data[start_index + x + 2].Equals("NO_TEXT")) { noErrorCode = !noErrorCode; } } resArray[0] = "TEXT"; if (!noErrorCode) { xx++; } tmpSX = new string[x + 1 + xx]; for (int i = start_index; i < (tmpSX.Length + start_index - 1); i++) { tmpSX[i - start_index + 1] = raw_data[i]; } tmpSX[0] = resArray[0]; return(CodeReader.GetStringArrayStartFromIndex(CodeReader.DecompileScriptCode(resArray, tmpSX), 1)); }
private void AddTriggers(string[] values, int ix, int x2) { int endI = ix + x2; List <string> triggerCodes = new List <string>(); for (int i = ix; i < endI; i++) { triggerCodes.Add(values[i]); } foreach (string triggerCode in triggerCodes) { string[] scriptLines = triggerCode.Split(); SimpleTrigger simpleTrigger = new SimpleTrigger(scriptLines[0]); string[] tmpS = new string[int.Parse(scriptLines[1]) + 1]; tmpS[0] = "SIMPLE_TRIGGER"; scriptLines = CodeReader.GetStringArrayStartFromIndex(scriptLines, 1); simpleTrigger.ConsequencesBlock = CodeReader.GetStringArrayStartFromIndex(CodeReader.DecompileScriptCode(tmpS, scriptLines), 1); SimpleTriggers.Add(simpleTrigger); } }
private void InitializeGameMenuOptions(string[] code) { int tts = 0; Name = code[0]; int x = int.Parse(code[1]); string[] xss = new string[x + 1], xss2; x = 0; for (int i = 2; i < code.Length; i++) { if (!ImportantMethods.IsNumericFKZ128(code[i])) { i = code.Length; } else { x++; } } if (x > 0) { xss2 = new string[x + 1]; for (int i = 1; i < xss2.Length; i++) { xss2[i] = code[i + 1]; } xss[0] = "GAME_MENU_OPTION=" + 0; xss2[0] = xss[0]; xss = CodeReader.DecompileScriptCode(xss, xss2); ConditionBlock = new string[xss.Length - 1]; for (int i = 0; i < ConditionBlock.Length; i++) { ConditionBlock[i] = xss[i + 1]; } tts = x + 2; } else { tts = 2; } Text = code[tts]; tts++; x = int.Parse(code[tts]); xss = new string[x + 1]; x = 0; tts++; for (int i = tts; i < code.Length; i++) { if (!ImportantMethods.IsNumericFKZ128(code[i])) { i = code.Length; } else { x++; } } if (x > 0) { xss2 = new string[x + 1]; for (int i = 1; i < xss2.Length; i++) { xss2[i] = code[i + tts - 1]; } xss[0] = "GAME_MENU_OPTION=" + 1; xss2[0] = xss[0]; xss = CodeReader.DecompileScriptCode(xss, xss2); ConsequenceBlock = new string[xss.Length - 1]; for (int i = 0; i < ConsequenceBlock.Length; i++) { ConsequenceBlock[i] = xss[i + 1]; } tts = x + tts; } else { tts++; } DoorText = code[code.Length - 1]; }