AlumKal

【PE】垫材24炮 新解

Aug 26th, 2025
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.30 KB | None | 0 0
  1. /*
  2. MIT License
  3.  
  4. Copyright (c) 2025 Reisen
  5.  
  6. Permission is hereby granted, free of charge, to any person obtaining a copy
  7. of this software and associated documentation files (the "Software"), to deal
  8. in the Software without restriction, including without limitation the rights
  9. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom the Software is
  11. furnished to do so, subject to the following conditions:
  12.  
  13. The above copyright notice and this permission notice shall be included in all
  14. copies or substantial portions of the Software.
  15.  
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  22. SOFTWARE.
  23. */
  24.  
  25. #include <avz.h>
  26. #include <dsl/shorthand.h>
  27. #include <mod/mod.h>
  28.  
  29. using namespace std;
  30.  
  31. pair<vector<AZombie*>, vector<AZombie*>> GetGigas(int row) {
  32.     vector<AZombie*> preGigas, curGigas;
  33.     for (auto& zombie : AObjSelector(&AZombie::Type, AGIGA_GARGANTUAR, &AZombie::Row, row - 1)) {
  34.         if (zombie.ExistTime() >= 601)
  35.             preGigas.push_back(&zombie);
  36.         else
  37.             curGigas.push_back(&zombie);
  38.     }
  39.     return {preGigas, curGigas};
  40. }
  41.  
  42. AFodder C2{APUFF_SHROOM, AM_PUFF_SHROOM, ASUN_SHROOM, ASCAREDY_SHROOM, AFLOWER_POT};
  43.  
  44. ACoroutine PreCob(int row) {
  45.     auto preGigas = GetGigas(row).first;
  46.     int cobTime = ANowTime().time / 601 * 601 + 359;
  47.     co_await [&]() {
  48.         if (ANowTime().time % 4 == 3)
  49.             return false; // 不垫舞王
  50.         if (ANowTime().time > cobTime - 209)
  51.             return true; // 最晚150垫
  52.         for (auto giga : preGigas)
  53.             if (giga->State() == 0 && giga->Abscissa() < 694.0) {
  54.                 At(now) C(1, row);
  55.                 return true;
  56.             }
  57.         return false;
  58.     };
  59. }
  60.  
  61. ACoroutine PostCob(int row) {
  62.     auto [preGigas, curGigas] = GetGigas(row);
  63.     float minX = 1000.0;
  64.     for (auto giga : preGigas)
  65.         minX = min(minX, giga->Abscissa());
  66.     if (!curGigas.empty()) {
  67.         if (minX >= 728.0) {
  68.             // 有本波,无上波:360/713
  69.             if (C2.AvailableCount() != 0)
  70.                 At(now) C2(380, row);
  71.             else
  72.                 At(now + 353) C(27, row);
  73.         } else {
  74.             // 有本波,有上波:360/510
  75.             if (C.AvailableCount() != 0)
  76.                 At(now) C(380, row);
  77.             else
  78.                 At(now + 150) C(230, row);
  79.         }
  80.     } else if (minX < 735.0) {
  81.         // 无本波,有上波:510
  82.         At(now + 150) C(100, row);
  83.     }
  84.     co_return;
  85. }
  86.  
  87. ACoroutine Run(ATime start) {
  88.     ATimeline pre = Do {
  89.         for (int row : {1, 2, 5, 6})
  90.             ACoLaunch(bind(PreCob, row));
  91.     };
  92.     ATimeline post = Do {
  93.         for (int row : {1, 2, 5, 6})
  94.             ACoLaunch(bind(PostCob, row));
  95.     };
  96.     ATimeline op = {
  97.         At(120) pre,
  98.         At(359) PP() & DD<107>(7.8125),
  99.         At(360) post,
  100.     };
  101.     At(start) op;
  102.     co_await start;
  103.     while (true) {
  104.         if (ANowWave() % 10 == 9 && ANowTime().time != 0 && AObjSelector(&AZombie::Hp, greater(), 1800).Empty())
  105.             co_return;
  106.         int nxt = ANowTime().time == 601 ? 559 : 601;
  107.         At(now + nxt) op;
  108.         co_await nxt;
  109.     }
  110. }
  111.  
  112. void Main() {
  113.     ACoLaunch(bind(Run, ATime(1, 0)));
  114.     ACoLaunch(bind(Run, ATime(10, 0)));
  115. }
  116.  
  117. void AScript() {
  118.     ASetReloadMode(AReloadMode::MAIN_UI_OR_FIGHT_UI);
  119.     ASetGameSpeed(10);
  120.     EnableModsScoped(SaveDataReadOnly, CobFixedDelay, DisableItemDrop, AccelerateGame);
  121.     auto cardList = {APUFF_SHROOM, AM_PUFF_SHROOM, ASUN_SHROOM, ASCAREDY_SHROOM, AFLOWER_POT, APOTATO_MINE, APLANTERN, ASUNFLOWER, AGARLIC, AFUME_SHROOM};
  122.     ASelectCards(vector<int>{cardList.begin(), cardList.end()}, 0);
  123.     C.SetCards(cardList);
  124.     ASkipTick(AAlwaysTrue());
  125.     Main();
  126.     OnWave(20) {
  127.         At(250) P(4, 7.5),
  128.         At(341) PP() & DD<110>(8.75) & DD<220>(8.75),
  129.         At(1000) PP()
  130.     };
  131. }
  132.  
Advertisement
Add Comment
Please, Sign In to add comment