示例#1
0
        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());
                        }
                    }
                }
            }
        }