public static void BuildFPKDAssets(DefinitionDetails definitionDetails, QuestEntities questDetails) { string destPath = string.Format("Sideop_Build//Assets//tpp//pack//mission2//quest//ih//{0}_fpkd", definitionDetails.FpkName); Directory.CreateDirectory(destPath); string VehFPKDAssetsPath = Path.Combine(VehAssetsPath, "FPKD_Files"); foreach (Vehicle vehicle in questDetails.vehicles) { string vehicleName = vehicleNames[vehicle.vehicleIndex]; string sourceDirPath = Path.Combine(VehFPKDAssetsPath, string.Format("{0}_fpkd", vehicleName)); CopyDirectory(sourceDirPath, destPath); } string AniFPKDAssetsPath = Path.Combine(AniAssetsPath, "FPKD_Files"); foreach (Animal animal in questDetails.animals) { string animalName = animal.animal; string sourceDirPath = Path.Combine(AniFPKDAssetsPath, string.Format("{0}_fpkd", animalName)); CopyDirectory(sourceDirPath, destPath); } string enemyFPKDAssetsPath = Path.Combine(enemyAssetsPath, "FPKD_Files"); if (QuestComponents.EnemyInfo.zombieCount > 0) { string sourceDirPath = Path.Combine(enemyFPKDAssetsPath, "zombie_fpkd"); CopyDirectory(sourceDirPath, destPath); } }
public static List <string> BuildHostageAttributes(QuestEntities questDetails) { List <string> hosAttributeList = new List <string>(); foreach (Hostage hostage in questDetails.hostages) { if (hostage.isUntied) { hosAttributeList.Add(string.Format("GameObject.SendCommand(GameObject.GetGameObjectId(\"TppHostageUnique2\", \"{0}\"),commandUnlocked)", hostage.name)); } if (hostage.isInjured) { hosAttributeList.Add(string.Format("GameObject.SendCommand(GameObject.GetGameObjectId(\"TppHostageUnique2\", \"{0}\"),commandInjured)", hostage.name)); } if (hostage.scared.Equals("NEVER")) //"NORMAL", "NEVER", "ALWAYS" { hosAttributeList.Add(string.Format("GameObject.SendCommand(GameObject.GetGameObjectId(\"TppHostageUnique2\", \"{0}\"),commandBrave)", hostage.name)); } else if (hostage.scared.Equals("ALWAYS")) { hosAttributeList.Add(string.Format("GameObject.SendCommand(GameObject.GetGameObjectId(\"TppHostageUnique2\", \"{0}\"),commandScared)", hostage.name)); } } return(hosAttributeList); }
public static void WriteMainQuestLua(DefinitionDetails definitionDetails, QuestEntities questDetails) { CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); List <string> questLua = new List <string>(questLuaInput); questLua[GetLineOf("local hostageCount =", questLua)] = string.Format("local hostageCount = {0}", questDetails.hostages.Count); questLua[GetLineOf("local CPNAME =", questLua)] = string.Format("local CPNAME = \"{0}\"", definitionDetails.CPName); //add cp combobox to setup questLua[GetLineOf("local useInter =", questLua)] = string.Format("local useInter = {0}", questDetails.canInter.ToString().ToLower()); //add interogation checkbox to setup questLua[GetLineOf("local qType =", questLua)] = string.Format("local qType = TppDefine.QUEST_TYPE.{0}", definitionDetails.objectiveType); //add questtype combobox to setup questLua[GetLineOf("local SUBTYPE =", questLua)] = string.Format("local SUBTYPE = \"{0}\"", questDetails.soldierSubType); string luaBool; if (EnemyInfo.armorCount > 0) { luaBool = "true"; } else { luaBool = "false"; } questLua[GetLineOf(" isQuestArmor =", questLua)] = string.Format(" isQuestArmor = {0},", luaBool); if (EnemyInfo.zombieCount > 0) { luaBool = "true"; } else { luaBool = "false"; } questLua[GetLineOf(" isQuestZombie =", questLua)] = string.Format(" isQuestZombie = {0},", luaBool); if (EnemyInfo.balaCount > 0) { luaBool = "true"; } else { luaBool = "false"; } questLua[GetLineOf(" isQuestBalaclava =", questLua)] = string.Format(" isQuestBalaclava = {0},", luaBool); questLua.InsertRange(GetLineOf(" enemyList = {", questLua) + 1, BuildEnemyList(questDetails)); questLua.InsertRange(GetLineOf(" vehicleList = {", questLua) + 1, BuildVehicleList(questDetails)); questLua.InsertRange(GetLineOf(" hostageList = {", questLua) + 1, BuildHostageList(questDetails)); questLua.InsertRange(GetLineOf(" animalList = {", questLua) + 1, BuildAnimalList(questDetails)); questLua.InsertRange(GetLineOf(" targetList = {", questLua) + 1, BuildTargetList(questDetails)); questLua.InsertRange(GetLineOf(" targetAnimalList = {", questLua) + 1, BuildAnimalTargetList(questDetails)); questLua.InsertRange(GetLineOf("Hostage Attributes List", questLua) + 1, BuildHostageAttributes(questDetails)); string LuaScriptPath = string.Format("Sideop_Build//Assets//tpp//pack//mission2//quest//ih//{0}_fpkd//Assets//tpp//level//mission2//quest//ih", definitionDetails.FpkName); string LuaScriptFile = Path.Combine(LuaScriptPath, definitionDetails.FpkName + ".lua"); Directory.CreateDirectory(LuaScriptPath); File.WriteAllLines(LuaScriptFile, questLua); }
public static List <string> BuildVehicleList(QuestEntities questDetails) { List <string> vehicleList = new List <string>(); if (questDetails.vehicles.Count == 0) { vehicleList.Add("nil"); } else { foreach (Vehicle vehicle in questDetails.vehicles) { string vehicleName = vehicleNames[vehicle.vehicleIndex]; vehicleList.Add(" {"); vehicleList.Add(" id = \"Spawn\","); vehicleList.Add(string.Format(" locator = \"{0}\",", vehicle.name)); if (vehicleName.Equals("EASTERN_WHEELED_ARMORED_VEHICLE_ROCKET_ARTILLERY")) { vehicleList.Add(string.Format(" type = Vehicle.type.{0},", "EASTERN_WHEELED_ARMORED_VEHICLE")); vehicleList.Add(string.Format(" subType = Vehicle.subType.{0},", vehicleName)); } else if (vehicleName.Equals("WESTERN_WHEELED_ARMORED_VEHICLE_TURRET_MACHINE_GUN") || vehicleName.Equals("WESTERN_WHEELED_ARMORED_VEHICLE_TURRET_CANNON")) { vehicleList.Add(string.Format(" type = Vehicle.type.{0},", "WESTERN_WHEELED_ARMORED_VEHICLE")); vehicleList.Add(string.Format(" subType = Vehicle.subType.{0},", vehicleName)); } else { vehicleList.Add(string.Format(" type = Vehicle.type.{0},", vehicleName)); } if (!vehicle.vehicleClass.Equals("DEFAULT")) { vehicleList.Add(string.Format(" class = Vehicle.class.{0},", vehicle.vehicleClass)); } double rotationdegrees = 0; Double.TryParse(vehicle.coordinates.roty, out rotationdegrees); double toRadians = rotationdegrees * Math.PI / 180; double yOffset = 0.0; double.TryParse(vehicle.coordinates.yCoord, out yOffset); yOffset += 0.783; vehicleList.Add(string.Format(" position={{pos={{{0},{1},{2}}},rotY={3},}},", vehicle.coordinates.xCoord, yOffset, vehicle.coordinates.zCoord, toRadians)); vehicleList.Add(" },"); } } return(vehicleList); }
public HttpResponseMessage Get() { List <Student> studentList = new List <Student>(); using (QuestEntities qe = new QuestEntities()) { studentList = qe.Students.OrderBy(a => a.FIRST_NAME).ToList(); HttpResponseMessage response; response = Request.CreateResponse(HttpStatusCode.OK, studentList); return(response); } }
internal void refreshCoordinateBoxes(QuestEntities qe) { string updatedTest = ""; foreach (Hostage entity in qe.hostages) { Coordinates detailCoords = entity.coordinates; updatedTest += string.Format("{{pos={{{0},{1},{2}}},rotY={3},}}, \r\n", detailCoords.xCoord, detailCoords.yCoord, detailCoords.zCoord, detailCoords.roty); } textBoxHosCoords.Text = updatedTest; updatedTest = ""; foreach (Vehicle entity in qe.vehicles) { Coordinates detailCoords = entity.coordinates; updatedTest += string.Format("{{pos={{{0},{1},{2}}},rotY={3},}}, \r\n", detailCoords.xCoord, detailCoords.yCoord, detailCoords.zCoord, detailCoords.roty); } textBoxVehCoords.Text = updatedTest; updatedTest = ""; foreach (Animal entity in qe.animals) { Coordinates detailCoords = entity.coordinates; updatedTest += string.Format("{{pos={{{0},{1},{2}}},rotY={3},}}, \r\n", detailCoords.xCoord, detailCoords.yCoord, detailCoords.zCoord, detailCoords.roty); } textBoxAnimalCoords.Text = updatedTest; updatedTest = ""; foreach (Item entity in qe.items) { Coordinates detailCoords = entity.coordinates; updatedTest += string.Format("{{pos={{{0},{1},{2}}},rotY={3},}}, \r\n", detailCoords.xCoord, detailCoords.yCoord, detailCoords.zCoord, detailCoords.roty); } textBoxItemCoords.Text = updatedTest; updatedTest = ""; foreach (ActiveItem entity in qe.activeItems) { Coordinates detailCoords = entity.coordinates; updatedTest += string.Format("{{pos={{{0},{1},{2}}},rotY={3},}}, \r\n", detailCoords.xCoord, detailCoords.yCoord, detailCoords.zCoord, detailCoords.roty); } textBoxActiveItemCoords.Text = updatedTest; updatedTest = ""; foreach (Model entity in qe.models) { Coordinates detailCoords = entity.coordinates; updatedTest += string.Format("{{pos={{{0},{1},{2}}},rotY={3},}}, \r\n", detailCoords.xCoord, detailCoords.yCoord, detailCoords.zCoord, detailCoords.roty); } textBoxStMdCoords.Text = updatedTest; }
public static List <string> BuildAnimalTargetList(QuestEntities questDetails) { List <string> animalTargetList = new List <string>(); bool hasTarget = false; foreach (Animal animal in questDetails.animals) { if (animal.isTarget) { hasTarget = true; } } animalTargetList.Add(" markerList = {"); if (!hasTarget) { animalTargetList.Add("nil"); } else { foreach (Animal animal in questDetails.animals) { if (animal.isTarget) { animalTargetList.Add(string.Format(" \"{0}\",", animal.name)); } } } animalTargetList.Add(" },"); animalTargetList.Add(" nameList={"); if (!hasTarget) { animalTargetList.Add("nil"); } else { foreach (Animal animal in questDetails.animals) { if (animal.isTarget) { animalTargetList.Add(string.Format(" \"{0}\",", animal.name)); } } } animalTargetList.Add(" },"); return(animalTargetList); }
public static List <string> BuildTargetList(QuestEntities questDetails) { int totalCount = 0; List <string> targetList = new List <string>(); foreach (Enemy enemy in questDetails.questEnemies) { if (enemy.isSpawn && enemy.isTarget) { targetList.Add(string.Format(" \"{0}\",", enemy.name)); totalCount++; } } foreach (Enemy enemy in questDetails.cpEnemies) { if (enemy.isSpawn && enemy.isTarget) { targetList.Add(string.Format(" \"{0}\",", enemy.name)); totalCount++; } } foreach (Hostage hostage in questDetails.hostages) { if (hostage.isTarget) { targetList.Add(string.Format(" \"{0}\",", hostage.name)); totalCount++; } } foreach (Vehicle vehicle in questDetails.vehicles) { if (vehicle.isTarget) { targetList.Add(string.Format(" \"{0}\",", vehicle.name)); totalCount++; } } if (totalCount == 0) { targetList.Add("nil"); } return(targetList); }
public QuestEntities GetEntityLists() { List<Enemy> qenemies = new List<Enemy>(); List<Enemy> cpenemies = new List<Enemy>(); List<Hostage> hostages = new List<Hostage>(); List<Vehicle> vehicles = new List<Vehicle>(); List<Animal> animals = new List<Animal>(); List<Item> items = new List<Item>(); List<ActiveItem> activeItems = new List<ActiveItem>(); List<Model> models = new List<Model>(); foreach (EnemyBox d in questEnemyBoxes) { string[] powerlist = new string[d.e_listBox_power.Items.Count]; d.e_listBox_power.Items.CopyTo(powerlist, 0); qenemies.Add(new Enemy(d.e_checkBox_spawn.Checked, d.e_checkBox_target.Checked, d.e_checkBox_balaclava.Checked, d.e_checkBox_zombie.Checked, d.e_checkBox_armor.Checked, questEnemyBoxes.IndexOf(d), d.e_groupBox_main.Text, d.e_comboBox_body.Text, d.e_comboBox_cautionroute.Text, d.e_comboBox_sneakroute.Text, d.e_comboBox_skill.Text, d.e_comboBox_staff.Text, powerlist)); } foreach (EnemyBox d in CPEnemyBoxes) { string[] powerlist = new string[d.e_listBox_power.Items.Count]; d.e_listBox_power.Items.CopyTo(powerlist, 0); cpenemies.Add(new Enemy(d.e_checkBox_spawn.Checked, d.e_checkBox_target.Checked, d.e_checkBox_balaclava.Checked, d.e_checkBox_zombie.Checked, d.e_checkBox_armor.Checked, CPEnemyBoxes.IndexOf(d), d.e_groupBox_main.Text, d.e_comboBox_body.Text, d.e_comboBox_cautionroute.Text, d.e_comboBox_sneakroute.Text, d.e_comboBox_skill.Text, d.e_comboBox_staff.Text, powerlist)); } foreach (HostageBox d in hostageBoxes) hostages.Add(new Hostage(d.h_checkBox_target.Checked, d.h_checkBox_untied.Checked, d.h_checkBox_injured.Checked, hostageBoxes.IndexOf(d), d.h_groupBox_main.Text, d.h_comboBox_skill.Text, d.h_comboBox_staff.Text, d.h_comboBox_scared.Text, d.h_comboBox_lang.Text, new Coordinates(d.h_textBox_xcoord.Text, d.h_textBox_ycoord.Text, d.h_textBox_zcoord.Text, d.h_textBox_rot.Text))); foreach (VehicleBox d in vehicleBoxes) vehicles.Add(new Vehicle(d.v_checkBox_target.Checked, vehicleBoxes.IndexOf(d), d.v_groupBox_main.Text, d.v_comboBox_vehicle.SelectedIndex, d.v_comboBox_class.Text, new Coordinates(d.v_textBox_xcoord.Text, d.v_textBox_ycoord.Text, d.v_textBox_zcoord.Text, d.v_textBox_rot.Text))); foreach (AnimalBox d in animalBoxes) animals.Add(new Animal(d.a_checkBox_isTarget.Checked, animalBoxes.IndexOf(d), d.a_groupBox_main.Text, d.a_comboBox_count.Text, d.a_comboBox_animal.Text, d.a_comboBox_TypeID.Text, new Coordinates(d.a_textBox_xcoord.Text, d.a_textBox_ycoord.Text, d.a_textBox_zcoord.Text, d.a_textBox_rot.Text))); foreach (ItemBox d in itemBoxes) items.Add(new Item(d.i_checkBox_boxed.Checked, itemBoxes.IndexOf(d), d.i_groupBox_main.Text, d.i_comboBox_count.Text, d.i_comboBox_item.Text, new Coordinates(d.i_textBox_xcoord.Text, d.i_textBox_ycoord.Text, d.i_textBox_zcoord.Text), new RotationQuat(d.i_textBox_xrot.Text, d.i_textBox_yrot.Text, d.i_textBox_zrot.Text, d.i_textBox_wrot.Text))); foreach (ActiveItemBox d in activeItemBoxes) activeItems.Add(new ActiveItem(activeItemBoxes.IndexOf(d), d.ai_groupBox_main.Text, d.ai_comboBox_activeitem.Text, new Coordinates(d.ai_textBox_xcoord.Text, d.ai_textBox_ycoord.Text, d.ai_textBox_zcoord.Text), new RotationQuat(d.ai_textBox_xrot.Text, d.ai_textBox_yrot.Text, d.ai_textBox_zrot.Text, d.ai_textBox_wrot.Text))); foreach (ModelBox d in modelBoxes) models.Add(new Model(d.m_label_GeomNotFound.Visible, modelBoxes.IndexOf(d), d.m_groupBox_main.Text, d.m_comboBox_preset.Text, new Coordinates(d.m_textBox_xcoord.Text, d.m_textBox_ycoord.Text, d.m_textBox_zcoord.Text), new RotationQuat(d.m_textBox_xrot.Text, d.m_textBox_yrot.Text, d.m_textBox_zrot.Text, d.m_textBox_wrot.Text))); questDetails = new QuestEntities(qenemies, cpenemies, hostages, vehicles, animals, items, activeItems, models, comboBox_Body.SelectedIndex, h_checkBox_intrgt.Checked, comboBox_subtype.Text); return questDetails; }
private void BuildQuest() { definitionDetails = setupPage.getDefinitionDetails(); questDetails = detailPage.GetEntityLists(); AssetsBuilder.ClearQuestFolders(definitionDetails); LangBuilder.WriteQuestLangs(definitionDetails); LuaBuilder.WriteDefinitionLua(definitionDetails, questDetails); LuaBuilder.WriteMainQuestLua(definitionDetails, questDetails); Fox2Builder.WriteItemFox2(definitionDetails, questDetails); Fox2Builder.WriteQuestFox2(definitionDetails, questDetails); AssetsBuilder.BuildFPKAssets(definitionDetails, questDetails); AssetsBuilder.BuildFPKDAssets(definitionDetails, questDetails); }
public static void BuildFPKAssets(DefinitionDetails definitionDetails, QuestEntities questDetails) { string destPath = string.Format("Sideop_Build//Assets//tpp//pack//mission2//quest//ih//{0}_fpk", definitionDetails.FpkName); Directory.CreateDirectory(destPath); string VehFPKAssetsPath = Path.Combine(VehAssetsPath, "FPK_Files"); foreach (Vehicle vehicle in questDetails.vehicles) { string vehicleName = vehicleNames[vehicle.vehicleIndex]; string sourceDirPath = Path.Combine(VehFPKAssetsPath, string.Format("{0}_fpk", vehicleName)); CopyDirectory(sourceDirPath, destPath); } string AniFPKAssetsPath = Path.Combine(AniAssetsPath, "FPK_Files"); foreach (Animal animal in questDetails.animals) { string animalName = animal.animal; string sourceDirPath = Path.Combine(AniFPKAssetsPath, string.Format("{0}_fpk", animalName)); CopyDirectory(sourceDirPath, destPath); } destPath += "//Assets"; if (!Directory.Exists(destPath)) { Directory.CreateDirectory(destPath); } foreach (Model model in questDetails.models) { string SourcemodelFileName = Path.Combine(modelAssetsPath, model.model); string DestModelFileName = Path.Combine(destPath, model.model); File.Copy(SourcemodelFileName + ".fmdl", DestModelFileName + ".fmdl", true); if (!model.missingGeom) { File.Copy(SourcemodelFileName + ".geom", DestModelFileName + ".geom", true); } } }
public static List <string> BuildAnimalList(QuestEntities questDetails) { List <string> animalList = new List <string>(); if (questDetails.animals.Count == 0) { animalList.Add("nil"); } else { foreach (Animal animal in questDetails.animals) { string animalType = animal.typeID; animalList.Add(" {"); animalList.Add(string.Format(" animalName = \"{0}\",", animal.name)); animalList.Add(string.Format(" animalType = \"{0}\",", animalType)); animalList.Add(" },"); } } return(animalList); }
public void LoadEntityLists(CP enemyCP, QuestEntities questDetails) { ShiftVisibilities(true); string currentRegion = enemyCP.CPname.Substring(0,4); string[] subtypes = new string[0]; comboBox_subtype.Items.Clear(); comboBox_subtype2.Items.Clear(); if (currentRegion.Equals("afgh")) subtypes = BodyInfo.afghSubTypes; else subtypes = BodyInfo.mafrSubTypes; comboBox_subtype.Items.AddRange(subtypes); comboBox_subtype2.Items.AddRange(subtypes); if (comboBox_subtype.Items.Contains(questDetails.soldierSubType)) comboBox_subtype.Text = questDetails.soldierSubType; else comboBox_subtype.SelectedIndex = 0; h_checkBox_intrgt.Checked = questDetails.canInter; comboBox_Body.Items.Clear(); if (currentRegion.Equals("mtbs")) foreach (BodyInfoEntry infoEntry in BodyInfo.BodyInfoArray) { if (infoEntry.hasface) this.comboBox_Body.Items.Add(infoEntry.bodyName); } else foreach (BodyInfoEntry infoEntry in BodyInfo.BodyInfoArray) { this.comboBox_Body.Items.Add(infoEntry.bodyName); } if (comboBox_Body.Items.Count <= questDetails.hostageBodyIndex) comboBox_Body.SelectedIndex = 0; else comboBox_Body.SelectedIndex = questDetails.hostageBodyIndex; // // Quest-Specific Soldiers // Panel currentPanel = panelQuestEnemyDet; currentPanel.AutoScroll = false; foreach (Enemy questEnemy in questDetails.questEnemies) { EnemyBox questEnemyBox = new EnemyBox(questEnemy, enemyCP); questEnemyBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(questEnemyBox.getGroupBoxMain()); questEnemyBoxes.Add(questEnemyBox); } currentPanel.AutoScroll = true; // // CP-Specific soldiers // currentPanel = panelCPEnemyDet; currentPanel.AutoScroll = false; foreach (Enemy cpEnemy in questDetails.cpEnemies) { EnemyBox cpEnemyBox = new EnemyBox(cpEnemy, enemyCP); cpEnemyBox.BuildObject(currentPanel.Width); cpEnemyBox.e_label_spawn.Text = "Customize:"; cpEnemyBox.e_label_spawn.Left = 26; currentPanel.Controls.Add(cpEnemyBox.getGroupBoxMain()); CPEnemyBoxes.Add(cpEnemyBox); } currentPanel.AutoScroll = true; // // Hostages // currentPanel = panelHosDet; currentPanel.AutoScroll = false; foreach (Hostage hostage in questDetails.hostages) { HostageBox hostageBox = new HostageBox(hostage, questDetails.hostageBodyIndex); hostageBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(hostageBox.getGroupBoxMain()); hostageBoxes.Add(hostageBox); } currentPanel.AutoScroll = true; // // Heavy Vehicles // currentPanel = panelVehDet; currentPanel.AutoScroll = false; foreach (Vehicle vehicle in questDetails.vehicles) { VehicleBox vehiclebox = new VehicleBox(vehicle); vehiclebox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(vehiclebox.getGroupBoxMain()); vehicleBoxes.Add(vehiclebox); } currentPanel.AutoScroll = true; // // Animal Clusters // currentPanel = panelAnimalDet; currentPanel.AutoScroll = false; foreach (Animal animal in questDetails.animals) { AnimalBox anibox = new AnimalBox(animal); anibox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(anibox.getGroupBoxMain()); animalBoxes.Add(anibox); } currentPanel.AutoScroll = true; // // Dormant Items // currentPanel = panelItemDet; currentPanel.AutoScroll = false; foreach (Item item in questDetails.items) { ItemBox itemBox = new ItemBox(item); itemBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(itemBox.getGroupBoxMain()); itemBoxes.Add(itemBox); } currentPanel.AutoScroll = true; // // Active Items // currentPanel = panelAcItDet; currentPanel.AutoScroll = false; foreach (ActiveItem acitem in questDetails.activeItems) { ActiveItemBox activeItemBox = new ActiveItemBox(acitem); activeItemBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(activeItemBox.getGroupBoxMain()); activeItemBoxes.Add(activeItemBox); } currentPanel.AutoScroll = true; // // Models // currentPanel = panelStMdDet; currentPanel.AutoScroll = false; foreach (Model model in questDetails.models) { ModelBox modelBox = new ModelBox(model); modelBox.BuildObject(currentPanel.Width); currentPanel.Controls.Add(modelBox.getGroupBoxMain()); modelBoxes.Add(modelBox); } currentPanel.AutoScroll = true; panelDetails.AutoScroll = false; ShiftVisibilities(false); ShiftGroups(Height, Width); panelDetails.AutoScroll = true; }
public static void setQuestEntities(QuestEntities q) { questEnemies = q.questEnemies; cpEnemies = q.cpEnemies; hostages = q.hostages; vehicles = q.vehicles; animals = q.animals; items = q.items; activeItems = q.activeItems; models = q.models; hostageBodyIndex = q.hostageBodyIndex; interrogateForHostages = q.canInter; enemySubType = q.soldierSubType; }
public static void WriteDefinitionLua(DefinitionDetails definitionDetails, QuestEntities questDetails) { CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); BodyInfoEntry bodyInfo = new BodyInfoEntry(); if (questDetails.hostageBodyIndex >= 0) { bodyInfo = BodyInfo.BodyInfoArray[questDetails.hostageBodyIndex]; } string packFiles = ""; string locName = ""; string gender = "MALE"; if (bodyInfo.isFemale) { gender = "FEMALE"; } if (definitionDetails.locationID == 10) { locName = "AFGH"; } else if (definitionDetails.locationID == 20) { locName = "MAFR"; } if (questDetails.hostages.Count > 0) { packFiles += "\n\t\t\"/Assets/tpp/pack/mission2/ih/ih_hostage_base.fpk\", "; packFiles += string.Format("\n\t\t\"{0}\", ", bodyInfo.missionPackPath); } packFiles += string.Format("\n\t\t\"/Assets/tpp/pack/mission2/quest/ih/{0}.fpk\", ", definitionDetails.FpkName); if (questDetails.hostages.Count > 0) { if (!bodyInfo.hasface) { packFiles += string.Format("\n\t\trandomFaceListIH = {{gender = \"{0}\", count = {1}}}, ", gender, questDetails.hostages.Count); } } string bodies = ""; string faces = ""; if (locName.Equals("AFGH") || locName.Equals("MAFR")) { if (EnemyInfo.balaCount > 0) { faces += string.Format("TppDefine.QUEST_FACE_ID_LIST.{0}_BALACLAVA, ", locName); } if (EnemyInfo.armorCount > 0) { bodies += string.Format("TppDefine.QUEST_BODY_ID_LIST.{0}_ARMOR, ", locName); } } foreach (string body in getEnemyBodies(questDetails.cpEnemies)) { bodies += string.Format("TppEnemyBodyId.{0}, ", body); } foreach (string body in getEnemyBodies(questDetails.questEnemies)) { bodies += string.Format("TppEnemyBodyId.{0}, ", body); } packFiles += string.Format("\n\t\tfaceIdList={{{0}}}, ", faces); packFiles += string.Format("\n\t\tbodyIdList={{{0}}}, ", bodies); string questPackList = string.Format("\tquestPackList = {{ {0} \n\t}},", packFiles); string locationInfo = string.Format("\tlocationId={0}, areaName=\"{1}\", iconPos=Vector3({2},{3},{4}), radius={5},", definitionDetails.locationID, definitionDetails.loadArea, definitionDetails.coords.xCoord, definitionDetails.coords.yCoord, definitionDetails.coords.zCoord, definitionDetails.radius); string progressLangId = string.Format("\tquestCompleteLangId=\"{0}\",", UpdateNotifsManager.getLangIds()[definitionDetails.progNotif]); string canOpenQuestFunction = "\tcanOpenQuest=InfQuest.AllwaysOpenQuest, --function that decides whether the quest is open or not"; //todo in future update? string disableLzs = "\tdisableLzs={ }, --disables lzs while the quest is active. Turn on the debugMessages option and look in ih_log.txt for StartedMoveToLandingZone after calling in a support heli to find the lz name."; // todo in future update string equipIds = ""; List <string> requestHistory = new List <string>(); foreach (Item item in questDetails.items) { if (item.item.Contains("EQP_WP_") && !requestHistory.Contains(item.item)) { equipIds += string.Format("\"{0}\", ", item.item); requestHistory.Add(item.item); } } string requestEquipIds = string.Format("\trequestEquipIds={{ {0} }},", equipIds); string hasEnemyHeli = "\thasEnemyHeli = false, --reserves an enemy helicopter for the sideop. set to true if the sideop has a heli."; string DefinitionLuaPath = "Sideop_Build//GameDir//mod//quests//"; string DefinitionLuaFile = Path.Combine(DefinitionLuaPath, string.Format("ih_quest_q{0}.lua", definitionDetails.QuestNum)); Directory.CreateDirectory(DefinitionLuaPath); using (StreamWriter defFile = new StreamWriter(DefinitionLuaFile)) { defFile.WriteLine("local this={"); defFile.WriteLine(questPackList); defFile.WriteLine(locationInfo); if (definitionDetails.locationID == 50) { defFile.WriteLine(string.Format("\tclusterName=\"{0}\",", definitionDetails.loadArea.Substring(4))); } defFile.WriteLine(string.Format("\tcategory=TppQuest.QUEST_CATEGORIES_ENUM.{0},", definitionDetails.category)); defFile.WriteLine(progressLangId); defFile.WriteLine(canOpenQuestFunction); defFile.WriteLine(string.Format("\tquestRank=TppDefine.QUEST_RANK.{0},", definitionDetails.reward)); defFile.WriteLine(disableLzs); defFile.WriteLine(requestEquipIds); defFile.WriteLine(hasEnemyHeli); defFile.WriteLine("} return this"); } }
public static List <string> BuildHostageList(QuestEntities questDetails) { List <string> hostageList = new List <string>(); BodyInfoEntry bodyInfo = new BodyInfoEntry(); if (questDetails.hostageBodyIndex >= 0) { bodyInfo = BodyInfo.BodyInfoArray[questDetails.hostageBodyIndex]; } if (questDetails.hostages.Count == 0) { hostageList.Add("nil"); } else { foreach (Hostage hostage in questDetails.hostages) { hostageList.Add(" {"); hostageList.Add(string.Format(" hostageName = \"{0}\",", hostage.name)); hostageList.Add(" isFaceRandom = true,"); if (hostage.isTarget) { hostageList.Add(" isTarget = true,"); } if (hostage.language.Equals("english")) { hostageList.Add(" voiceType = { \"hostage_a\", \"hostage_b\", \"hostage_c\", \"hostage_d\",},"); } else { hostageList.Add(" voiceType = { \"hostage_a\", \"hostage_b\", },"); } hostageList.Add(string.Format(" langType = \"{0}\",", hostage.language)); if (!hostage.staffType.Equals("NONE")) { hostageList.Add(string.Format(" staffTypeId = TppDefine.STAFF_TYPE_ID.{0},", hostage.staffType)); } if (!hostage.skill.Equals("NONE")) { hostageList.Add(string.Format(" skill = \"{0}\",", hostage.skill)); } double rotation = 0; Double.TryParse(hostage.coordinates.roty, out rotation); hostageList.Add(string.Format(" bodyId = {0},", bodyInfo.bodyId)); double yOffset = 0.0; double.TryParse(hostage.coordinates.yCoord, out yOffset); yOffset += 0.783; hostageList.Add(string.Format(" position={{pos={{{0},{1},{2}}},rotY={3},}},", hostage.coordinates.xCoord, yOffset, hostage.coordinates.zCoord, rotation)); hostageList.Add(" },"); } } return(hostageList); }
public static List <string> BuildEnemyList(QuestEntities questDetails) { List <string> enemyList = new List <string>(); List <Enemy> detailList = new List <Enemy>(); detailList.AddRange(questDetails.questEnemies); detailList.AddRange(questDetails.cpEnemies); int enemyCount = 0; foreach (Enemy enemy in detailList) { string powerlist = ""; if (!enemy.isSpawn) { continue; } enemyCount++; enemyList.Add(" {"); enemyList.Add(string.Format(" enemyName = \"{0}\",", enemy.name)); if (!enemy.dRoute.Equals("NONE")) { enemyList.Add(string.Format(" route_d = \"{0}\",", enemy.dRoute)); enemyList.Add(string.Format(" route_c = \"{0}\",", enemy.cRoute)); } enemyList.Add(" cpName = CPNAME,"); if (enemy.powers.Length > 0) { foreach (string power in enemy.powers) { powerlist += string.Format("\"{0}\", ", power); } enemyList.Add(string.Format(" powerSetting = {{ {0} }},", powerlist)); } enemyList.Add(" soldierSubType = SUBTYPE,"); if (!enemy.staffType.Equals("NONE")) { enemyList.Add(string.Format(" staffTypeId = TppDefine.STAFF_TYPE_ID.{0},", enemy.staffType)); } if (!enemy.skill.Equals("NONE")) { enemyList.Add(string.Format(" skill = \"{0}\",", enemy.skill)); } if (!enemy.body.Equals("DEFAULT") && !enemy.isArmored) { enemyList.Add(string.Format(" bodyId = TppEnemyBodyId.{0},", enemy.body)); } if (EnemyInfo.balaCount > 0) { if (enemy.isBalaclava) { enemyList.Add(" isBalaclava = true,"); } else { enemyList.Add(" isBalaclava = false,"); } } if (EnemyInfo.zombieCount > 0) { if (enemy.isZombie) { enemyList.Add(" isZombie = true,"); enemyList.Add(" isZombieUseRoute = true,"); } } enemyList.Add(" },"); } if (enemyCount == 0) { enemyList.Add("nil"); } return(enemyList); }