无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【PE】輪炸20炮 腳本

2022-12-21 18:12 作者:--Reisen--  | 我要投稿

可以自由使用,但請注明來源,遵守 License。
AvZ 版本:AvZ1 221001

/*
MIT License

Copyright (c) 2022 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.
*/

#define NOMINMAX
#include <algorithm>
#include <iterator>
#include <limits>
#include <random>
#include <set>
#include <vector>
#include "avz.h"
#include "fodder.h"
#include "showme/sm.h"

using namespace std;
using namespace AvZ;

MainObject* mo;
class : GlobalVar {
	void beforeScript() override {
		mo = GetMainObject();
	}
} _mo_initializer;

template <typename T>
bool RangeIn(T x, T l, T r) {
	return l <= x && x <= r;
}

template <class... Ts>
void Card(const vector<PlantType>& plant_types, Ts... args) {
	for(auto p: plant_types)
		Card(p, args...);
}

void TryCard(PlantType p, int r, int c) {
 ? ?InsertOperation([=](){
 ? ? ? ?int idx = GetCardIndex(p);
 ? ? ? ?if(idx != -1 && mo->seedArray()[idx].isUsable())
 ? ? ? ? ? ?CardNotInQueue(idx + 1, r, c);
 ? ?});
}

minstd_rand rng(0x14371437);

void set_random_pao_list() {
 ? ?InsertOperation([](){
 ? ? ? ?vector<Grid> pao_list;
 ? ? ? ?for(auto& p : alive_plant_filter)
 ? ? ? ? ? ?if(p.type() == COB_CANNON)
 ? ? ? ? ? ? ? ?pao_list.push_back({p.row() + 1, p.col() + 1});
 ? ? ? ?shuffle(pao_list.begin(), pao_list.end(), rng);
 ? ? ? ?SetNowTime();
 ? ? ? ?pao_operator.resetPaoList(pao_list);
 ? ?});
}

// Copyright (c) 2022 Crescendo
// License unknown = =
int check_hitcd(int row) {
 ? ?int hitCD = std::numeric_limits<int>::max();
 ? ?auto aa = GetPvzBase()->animationMain()->animationOffset()->animationArray();
 ? ?for(auto& zombie : alive_zombie_filter) {
 ? ? ? ?if(RangeIn(zombie.type(), {GARGANTUAR, GIGA_GARGANTUAR}) && zombie.row() == row - 1
 ? ? ? ? ? ?&& zombie.state() == 70 && int(zombie.abscissa()) <= 670) {
 ? ? ? ? ? ?float animation_progress = aa[zombie.mRef<uint16_t>(0x118)].circulationRate();
 ? ? ? ? ? ?if(animation_progress >= 0.648) continue;
 ? ? ? ? ? ?int remain_time = int((zombie.slowCountdown() > 0 ? 414 : 207) * (0.648 - animation_progress)) + 1;
 ? ? ? ? ? ?remain_time += zombie.freezeCountdown();
 ? ? ? ? ? ?hitCD = std::min(hitCD, remain_time);
 ? ? ? ?}
 ? ?}
 ? ?return hitCD;
}

TickRunner main_logic, cob_cannon_fixer;

#define dancings AliveFilter<Zombie>([](Zombie* z) { return z->type() == DANCING_ZOMBIE; })

void Script() {
	OpenMultipleEffective('Q', MAIN_UI_OR_FIGHT_UI);
	SelectCards({M_PUFF_SHROOM, SCAREDY_SHROOM, FLOWER_POT, SUNFLOWER, ICE_SHROOM, COFFEE_BEAN, PUMPKIN, CHERRY_BOMB, KERNEL_PULT, COB_CANNON});
	set_random_pao_list();
	plant_fixer.start(PUMPKIN, {}, 1333);
 ? ?ice_filler.start({{4, 9}});
	fodder.setCards({M_PUFF_SHROOM, SCAREDY_SHROOM, FLOWER_POT, SUNFLOWER});

	main_logic.pushFunc([](){
		SetNowTime();
		if(RangeIn(mo->gameClock() % 348, {149, 323})) {
			int r = mo->gameClock() % 348 == 323 ? 2 : 5;
			bool zombie_exist = false;
			for(auto& z : alive_zombie_filter)
				if(z.type() != IMP && RangeIn(z.row() + 1, r - 1, r + 1))
					zombie_exist = true;
			bool cond = mo->wave() == 20 ||
				(mo->wave() % 10 == 9 && NowTime(mo->wave() + 1) < -373);
			if(zombie_exist || !cond)
				pao_operator.pao(r, r == 2 ? 8.75 : 8.6625);
		}

 ? ? ? ?for(auto& z : alive_zombie_filter)
 ? ? ? ? ? ?if(z.type() == BACKUP_DANCER && z.row() == 5 && z.abscissa() < 600 && z.stateCountdown() == 100) {
 ? ? ? ? ? ? ? ?int t = 348 - (mo->gameClock() + 174) % 348;
 ? ? ? ? ? ? ? ?int y_dis = 15 + (100 - t) * 4 / 3;
 ? ? ? ? ? ? ? ?int x_dis = 686 - (int(z.abscissa()) + 78);
 ? ? ? ? ? ? ? ?if(x_dis * x_dis + y_dis * y_dis > 115 * 115)
 ? ? ? ? ? ? ? ? ? ?TryCard(CHERRY_BOMB, 6, 9);
 ? ? ? ? ? ?}

 ? ? ? ?for(int r : {1, 2, 5, 6})
 ? ? ? ? ? ?if(check_hitcd(r) <= 3)
 ? ? ? ? ? ? ? ?TryCard(CHERRY_BOMB, r, 9);
	});

	cob_cannon_fixer.pushFunc([](){
		int kp_idx = GetCardIndex(KERNEL_PULT), cob_idx = GetCardIndex(COB_CANNON);
		auto sa = mo->seedArray();
		if(!sa[kp_idx].isUsable() || !sa[cob_idx].isUsable()) return;
 ? ? ? ?if(mo->wave() == 20) return;
		for(auto& p : alive_plant_filter)
			if(p.hp() < 100 && p.state() == 35 && p.stateCountdown() + 125 > 751 + 625) {
				int r = p.row() + 1, c = p.col() + 1;
				SetNowTime(); Shovel(r, c); Card(KERNEL_PULT, r, c);
				set_random_pao_list();
				Delay(751); Card(KERNEL_PULT, r, c + 1); Card(COB_CANNON, r, c);
				set_random_pao_list();
				return;
			}
	});

	for(int wave = 1; wave <= 20; wave++) if(wave % 10 != 0)
 ? ? ? ?InsertTimeOperation(90, wave, [=](){
 ? ? ? ? ? ?int next_cob[2] = {348 + 90 - mo->gameClock() % 348, 348 + 90 - (mo->gameClock() + 174) % 348};
 ? ? ? ? ? ?set<int> a, b;
 ? ? ? ? ? ?if(next_cob[0] > 318) a.insert({1, 2});
 ? ? ? ? ? ?if(next_cob[1] > 318) a.insert({5, 6});
 ? ? ? ? ? ?for(auto& z : dancings) b.insert(z.row() + 1);
 ? ? ? ? ? ?vector<int> rows;
 ? ? ? ? ? ?set_intersection(a.begin(), a.end(), b.begin(), b.end(), back_inserter(rows));
 ? ? ? ? ? ?if(rows.empty()) return;
 ? ? ? ? ? ?int t = next_cob[a.count(5)];
 ? ? ? ? ? ?if(t > 341) {
 ? ? ? ? ? ? ? ?SetTime(t - 194, wave);
 ? ? ? ? ? ? ? ?fodder(rows, 60);
 ? ? ? ? ? ?} else {
 ? ? ? ? ? ? ? ?SetTime(90, wave);
 ? ? ? ? ? ? ? ?fodder(rows, t - 159 - 90);
 ? ? ? ? ? ?}
 ? ? ? ?});

 ? ?for(int wave : {10, 20})
 ? ? ? ?InsertTimeOperation(140, wave, [=](){
 ? ? ? ? ? ?int next_cob[2] = {348 + 140 - mo->gameClock() % 348, 348 + 140 - (mo->gameClock() + 174) % 348};
 ? ? ? ? ? ?set<int> a, b;
 ? ? ? ? ? ?if(next_cob[0] > 341)
 ? ? ? ? ? ? ? ?a.insert({1, 2});
 ? ? ? ? ? ?if(next_cob[1] > 341)
 ? ? ? ? ? ? ? ?a.insert({5, 6});
 ? ? ? ? ? ?for(auto& z : dancings)
 ? ? ? ? ? ? ? ?b.insert(z.row() + 1);
 ? ? ? ? ? ?vector<int> rows;
 ? ? ? ? ? ?set_intersection(a.begin(), a.end(), b.begin(), b.end(), back_inserter(rows));
 ? ? ? ? ? ?if(rows.empty())
 ? ? ? ? ? ? ? ?return;
 ? ? ? ? ? ?int time = max(next_cob[a.count(5)] - 194, 203);
 ? ? ? ? ? ?SetTime(time, wave);
 ? ? ? ? ? ?fodder(rows, 60);
 ? ? ? ?});

	auto ztl = mo->zombieTypeList();
	if(ztl[BUNGEE_ZOMBIE] || ztl[JACK_IN_THE_BOX_ZOMBIE])
		for(int w : {10, 20}) {
			SetTime(395 - 298, w);
 ? ? ? ? ? ?ice_filler.coffee();
 ? ? ? ?}
	SetTime(250 - 378, 20);
	pao_operator.pao(4, 7.5);
}

SMShowMe sm;

void Draw() {
 ? ?auto& bar_painter = sm.getPainter();
 ? ?for(auto& p : alive_plant_filter)
 ? ? ? ?if(p.type() == COB_CANNON && RangeIn(p.col(), {0, 6})) {
 ? ? ? ? ? ?double rate = 1.0 * p.hp() / p.hpMax();
 ? ? ? ? ? ?bar_painter.drawBar(p.xi() + 80, p.yi() - 10, rate, 120, 7, 1, 0xFF00FF00, SMPainter::RIGHT, {rate});
 ? ? ? ?}
}



【PE】輪炸20炮 腳本的評論 (共 條)

分享到微博請遵守國家法律
新余市| 东阳市| 通道| 平定县| 成武县| 鄂托克旗| 保定市| 凯里市| 金寨县| 江陵县| 沽源县| 北安市| 光泽县| 突泉县| 峨眉山市| 连平县| 凤冈县| 嘉峪关市| 抚顺县| 金平| 岢岚县| 涿州市| 隆林| 锡林浩特市| 荆州市| 张家港市| 竹山县| 铜川市| 社会| 南澳县| 台山市| 乌兰察布市| 盐池县| 青浦区| 合水县| 耒阳市| 太保市| 米林县| 霍州市| 肥东县| 长沙县|