Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- MIT License
- Copyright (c) 2025 Reisen
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
- */
- #include <avz.h>
- #include <dsl/shorthand.h>
- #include <mod/mod.h>
- using namespace std;
- pair<vector<AZombie*>, vector<AZombie*>> GetGigas(int row) {
- vector<AZombie*> preGigas, curGigas;
- for (auto& zombie : AObjSelector(&AZombie::Type, AGIGA_GARGANTUAR, &AZombie::Row, row - 1)) {
- if (zombie.ExistTime() >= 601)
- preGigas.push_back(&zombie);
- else
- curGigas.push_back(&zombie);
- }
- return {preGigas, curGigas};
- }
- AFodder C2{APUFF_SHROOM, AM_PUFF_SHROOM, ASUN_SHROOM, ASCAREDY_SHROOM, AFLOWER_POT};
- ACoroutine PreCob(int row) {
- auto preGigas = GetGigas(row).first;
- int cobTime = ANowTime().time / 601 * 601 + 359;
- co_await [&]() {
- if (ANowTime().time % 4 == 3)
- return false; // 不垫舞王
- if (ANowTime().time > cobTime - 209)
- return true; // 最晚150垫
- for (auto giga : preGigas)
- if (giga->State() == 0 && giga->Abscissa() < 694.0) {
- At(now) C(1, row);
- return true;
- }
- return false;
- };
- }
- ACoroutine PostCob(int row) {
- auto [preGigas, curGigas] = GetGigas(row);
- float minX = 1000.0;
- for (auto giga : preGigas)
- minX = min(minX, giga->Abscissa());
- if (!curGigas.empty()) {
- if (minX >= 728.0) {
- // 有本波,无上波:360/713
- if (C2.AvailableCount() != 0)
- At(now) C2(380, row);
- else
- At(now + 353) C(27, row);
- } else {
- // 有本波,有上波:360/510
- if (C.AvailableCount() != 0)
- At(now) C(380, row);
- else
- At(now + 150) C(230, row);
- }
- } else if (minX < 735.0) {
- // 无本波,有上波:510
- At(now + 150) C(100, row);
- }
- co_return;
- }
- ACoroutine Run(ATime start) {
- ATimeline pre = Do {
- for (int row : {1, 2, 5, 6})
- ACoLaunch(bind(PreCob, row));
- };
- ATimeline post = Do {
- for (int row : {1, 2, 5, 6})
- ACoLaunch(bind(PostCob, row));
- };
- ATimeline op = {
- At(120) pre,
- At(359) PP() & DD<107>(7.8125),
- At(360) post,
- };
- At(start) op;
- co_await start;
- while (true) {
- if (ANowWave() % 10 == 9 && ANowTime().time != 0 && AObjSelector(&AZombie::Hp, greater(), 1800).Empty())
- co_return;
- int nxt = ANowTime().time == 601 ? 559 : 601;
- At(now + nxt) op;
- co_await nxt;
- }
- }
- void Main() {
- ACoLaunch(bind(Run, ATime(1, 0)));
- ACoLaunch(bind(Run, ATime(10, 0)));
- }
- void AScript() {
- ASetReloadMode(AReloadMode::MAIN_UI_OR_FIGHT_UI);
- ASetGameSpeed(10);
- EnableModsScoped(SaveDataReadOnly, CobFixedDelay, DisableItemDrop, AccelerateGame);
- auto cardList = {APUFF_SHROOM, AM_PUFF_SHROOM, ASUN_SHROOM, ASCAREDY_SHROOM, AFLOWER_POT, APOTATO_MINE, APLANTERN, ASUNFLOWER, AGARLIC, AFUME_SHROOM};
- ASelectCards(vector<int>{cardList.begin(), cardList.end()}, 0);
- C.SetCards(cardList);
- ASkipTick(AAlwaysTrue());
- Main();
- OnWave(20) {
- At(250) P(4, 7.5),
- At(341) PP() & DD<110>(8.75) & DD<220>(8.75),
- At(1000) PP()
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment