internal static void GetMain(WalkerDetail detail, MainLua mainLua) { List <WalkerGear> walkers = detail.walkers; WalkerMetadata meta = detail.walkerMetadata; if (detail.walkers.Count > 0) { mainLua.AddToOpeningVariables("questWalkerGearList", "{}"); mainLua.AddToOpeningVariables("playerWGResetPosition"); mainLua.AddToOpeningVariables("walkerGearGameId"); mainLua.AddToOpeningVariables("inMostActiveQuestArea", "true"); mainLua.AddToOpeningVariables("exitOnce", "true"); mainLua.AddToQuestTable(BuildWalkerList(detail)); mainLua.AddToAuxiliary(OneTimeAnnounce); mainLua.AddToAuxiliary(ReboundWalkerGear); mainLua.AddToQStep_Main(ExitTrap, EnterTrap, FinishTimerActiveArea, FinishTimerCooldown); mainLua.AddToQStep_Main(QStep_MainCommonMessages.mechaCaptureTargetMessages); mainLua.AddToAuxiliary("local setupOnce = true"); mainLua.AddToOnUpdate("setupOnce = this.SetupGearsQuest(setupOnce)"); mainLua.AddToAuxiliary(SetupGearsQuest); mainLua.AddToQStep_Start_OnEnter(BuildWalkerGameObjectIdList); mainLua.AddToAuxiliary(BuildWalkerGameObjectIdList); if (walkers.Any(walker => walker.isTarget)) { CheckQuestGenericEnemy checkQuestMethod = new CheckQuestGenericEnemy(mainLua, checkWalkerGear, meta.objectiveType); foreach (WalkerGear walker in walkers) { if (walker.isTarget) { mainLua.AddToTargetList(walker.GetObjectName()); } } } } }
public static void GetMain(EnemyDetail detail, MainLua mainLua) { List <Enemy> enemies = detail.enemies; EnemyMetadata meta = detail.enemyMetadata; mainLua.AddToOpeningVariables("SUBTYPE", $@"""{meta.subtype}"""); mainLua.AddToQuestTable(BuildEnemyList(enemies)); bool hasSpawn = false; bool hasTarget = false; foreach (Enemy enemy in enemies) { if (enemy.spawn) { hasSpawn = true; if (enemy.isTarget) { hasTarget = true; mainLua.AddToTargetList(enemy.GetObjectName()); } } } if (hasSpawn) { string questarmor = $"isQuestArmor = {(HasArmors(enemies) ? "true" : "false")}"; string questZombie = $"isQuestZombie = {(HasZombie(enemies) ? "true" : "false")}"; string questBalaclava = $"isQuestBalaclava = {(HasBalaclavas(enemies) ? "true" : "false")}"; mainLua.AddToQuestTable(questarmor, questZombie, questBalaclava); if (hasTarget) { mainLua.AddToQStep_Main(QStep_MainCommonMessages.genericTargetMessages); CheckQuestGenericEnemy CheckEnemy = new CheckQuestGenericEnemy(mainLua, CheckIsSoldier, meta.objectiveType); } } }
private static string BuildMain(CoreDetails coreDetails, DetailManager[] managers) { MainLua mainLua = new MainLua(); mainLua.AddToOpeningVariables("this", "{}"); mainLua.AddToOpeningVariables("quest_step", "{}"); mainLua.AddToOpeningVariables("StrCode32", "Fox.StrCode32"); mainLua.AddToOpeningVariables("StrCode32Table", "Tpp.StrCode32Table"); mainLua.AddToOpeningVariables("GetGameObjectId", "GameObject.GetGameObjectId"); mainLua.AddToOpeningVariables("ELIMINATE", "TppDefine.QUEST_TYPE.ELIMINATE"); mainLua.AddToOpeningVariables("RECOVERED", "TppDefine.QUEST_TYPE.RECOVERED"); mainLua.AddToOpeningVariables("KILLREQUIRED", "9"); string cpNameString = coreDetails.CPName; if (coreDetails.CPName == "NONE") { /* * if (LoadAreas.isAfgh(coreDetails.locationID)) * { * cpNameString = @"""afgh_plantSouth_ob"""; // empty ob for afgh. doesn't trigger interrogations? * } * else if (LoadAreas.isMafr(coreDetails.locationID)) * { * cpNameString = @"""mafr_factory_cp"""; // empty cp for mafr * } * else * { */ cpNameString = $"InfMain.GetClosestCp{{{coreDetails.coords.xCoord},{coreDetails.coords.yCoord},{coreDetails.coords.zCoord}}}"; //} } else { cpNameString = $@"""{coreDetails.CPName}"""; } mainLua.AddToOpeningVariables("CPNAME", cpNameString); mainLua.AddToOpeningVariables("DISTANTCP", $@"""{QuestObjects.Enemy.EnemyInfo.ChooseDistantCP(coreDetails.CPName, coreDetails.locationID)}"""); mainLua.AddToOpeningVariables("questTrapName", $@"""trap_preDeactiveQuestArea_{coreDetails.loadArea}"""); mainLua.AddToQuestTable("questType = ELIMINATE"); mainLua.AddToQuestTable("soldierSubType = SUBTYPE"); mainLua.AddToQuestTable(BuildCpList(coreDetails)); foreach (DetailManager manager in managers) { manager.AddToMainLua(mainLua); } return(mainLua.GetMainLuaFormatted()); }