private static string BuildDefinition(CoreDetails coreDetails, DetailManager[] managers) //rewrite { DefinitionLua definitionLua = new DefinitionLua(); string questCompleteLangId = coreDetails.progressLangID; definitionLua.AddDefinition($"locationId = {coreDetails.locationID}"); definitionLua.AddDefinition($@"areaName = ""{coreDetails.loadArea}"""); if (LoadAreas.isMtbs(coreDetails.locationID)) { definitionLua.AddDefinition($@"clusterName = ""{coreDetails.loadArea.Substring(4)}"""); } definitionLua.AddDefinition($"iconPos = Vector3({coreDetails.coords.xCoord},{coreDetails.coords.yCoord},{coreDetails.coords.zCoord})"); definitionLua.AddDefinition($"radius = {coreDetails.radius}"); definitionLua.AddDefinition($"category = TppQuest.QUEST_CATEGORIES_ENUM.{coreDetails.category}"); definitionLua.AddDefinition($@"questCompleteLangId = ""{questCompleteLangId}"""); definitionLua.AddDefinition("canOpenQuest=InfQuest.AllwaysOpenQuest"); definitionLua.AddDefinition($"questRank = TppDefine.QUEST_RANK.{coreDetails.reward}"); definitionLua.AddDefinition("disableLzs = {}"); foreach (DetailManager manager in managers) { manager.AddToDefinitionLua(definitionLua); } definitionLua.AddPackPath($"/Assets/tpp/pack/mission2/quest/ih/{coreDetails.FpkName}.fpk"); return(definitionLua.GetDefinitionLuaFormatted()); }
internal static void GetDefinition(HelicopterDetail questDetail, DefinitionLua definitionLua) { if (questDetail.helicopters.Any(helicopter => helicopter.isSpawn)) { definitionLua.AddDefinition($"hasEnemyHeli = {(questDetail.helicopters.Any(helicopter => helicopter.isSpawn) ? "true" : "false")}"); } }
internal static void GetDefinition(ItemDetail questDetail, DefinitionLua definitionLua) { List <string> requestList = new List <string>(); StringBuilder requestEquipBuilder = new StringBuilder("requestEquipIds = {"); foreach (Item item in questDetail.items) { if (requestList.Contains(item.item)) { continue; } else if (item.item.Contains("EQP_WP_")) { requestEquipBuilder.Append($@"""{item.item}"", "); requestList.Add(item.item); } } requestEquipBuilder.Append("}"); definitionLua.AddDefinition(requestEquipBuilder.ToString()); }