--紅美鈴用ai
--しなうす式/20220710check

require("function_pun_strage.lua")
head_req_list()

function main()
--シード生成、スレッド生成、base_states設定
	set_seedthreadstates()
--キャラ確認
	char_calling()
--ステージが 核融合炉心部 だと超反応モードに
	set_printsabot()

while true do
--スレッド外初期化
	while_top()

--●どちらかが体力無くなったら待機
	if interbattle_condi()==true then
		interbattle_exe()
--▼開幕行動▼
	elseif kaimaku_condi()==true then
		kaimaku_exe()
--▼移動起き上がり
	elseif my_act==97 or my_act==98 then --基本：画面端より遠ざかる。中央では相手から遠ざか…りたいが、設置技警戒のため、相手側に移動起き上がり。
		movedgetup_exe()

--▼簡易受け身▼：攻撃ないし回避いずれの目的であってもリカバリーポイントは限られるが、そういうことはさておき実装したもの
	elseif recovery_condi()==true then
		recovery_exe()

--▼台風になった時、フラグに従って「緋想の剣」を使用
	elseif y==0 and my_act<=10 and card_check(14) and flag_kishitu==1 then
		print("天候フラグＯＮ　⇒　「緋想の剣」使用");
		card_use(14);

--▼台風▼：近接状態からの強引な状況変更を行う行動。スペカなど使用。
	elseif react_rejecttaihu_condi()==true then
		react_rejecttaihu_exe()

--▼起き攻め▼
	elseif setplay_ongetup_condi()==true then
		setplay_ongetup_exe()
--▼ＨＪＣ▼
	--地上HJC
	elseif hjc_ground_condi()==true then
		hjc_ground_exe()
	--空中HJC
	elseif hjc_air_condi()==true then
		hjc_air_exe()

--▼反応行動
--反応：下段
	elseif 	react_lowattack_condi()==true then
		react_lowattack_exe()
--反応：地対空
	elseif react_g2a_condi()==true then
		react_g2a_exe()
--反応：低空飛翔
	elseif react_lowj6d_condi()==true then
		react_lowj6d_exe()
--上空追いかけ
	elseif ueoikake_condi()==true then
		ueoikake_exe()
--霊撃 or 霊撃札
	elseif reigeki_condi()==true then 
		print("拒否行動：霊撃　⇒　可能ならば使用");
		card_use(0)
		
--▼グレイズ：相手行動に対する反射or一定距離内のオブジェクト感知▼
--モーション反応グレイズ
	elseif
	graze_condition_xrange()==true and
	state_nottrueguard()==true and 
	my_airEX>=1 and 
	my_rei>=0 
	then--近距離時のグレイズ。のさばらせておくと、誤結界の原因となる。ガードの硬直間際ならok
		print("check 1 -> graze act X Range");
		graze_action_xrange()
			
--▼ ガード行動：簡易ガードルーチン▼
--▼ ガード反撃、龍魚の羽衣 13
	elseif hagoromo_1st_condi()==true or hagoromo_condi()==true then
		hagoromo_exe()

--回避結界
	elseif kekkai_condi()==true then
		kekkai_exe()

--▼ 宵越しの銭 12
	elseif yoikoshi_1st_condi()==true or yoikoshi_condi()==true then
		yoikoshi_exe()

--▼汎用中下段ガード
--基本は行動に対して後退入れ込み。下段のみ抽出して反応。通常射撃も同じく下段で受ける(けどメンドウだから今回は省き)。フラグを抜けてくるものは別個に対応
	elseif lowattack_aflags_condi()==true then
		guard_backexpectlowattack_exe()
	elseif overheadattack_aflags_condi()==true then
		guard_backoverheadattack_exe()
--下段判定をフィルタ
	elseif lowattack_flaged_condi()==true then
		guard_backexpectlowattack_exe()
--フラグを抜けてくるものをフィルタ
	elseif lowattack_unflaged_condi()==true then
		guard_backexpectlowattack_exe()
--屈状態では低空昇り攻撃には立てない
	elseif notstand_overhead_upjump_condi()==true then
		guard_backexpectlowattack_exe()
--以下、何もフィルタされなかった場合、立ちガード
	elseif guard_pun_condi()==true then
		guard_backoverheadattack_exe()

--[[▼オブジェが至近距離の場合、着地直前にｈｊを仕込む、タッチ＆ゴーグレイズ
	elseif touchandgo_00_condi() then
		touchandgo_00_exe()
--オブジェが至近距離の場合、ガードの前に、離陸
	elseif touchandgo_01_condi() then
		touchandgo_01_exe()
	elseif touchandgo_02_condi() then
		touchandgo_02_exe()
--]]
--オブジェが至近距離の場合、空中から地上へ飛翔　※咲夜：２D：120.0以上、３D：84.9以上必要
	elseif graze_pun_condi()==true then
		graze_pun_exe()
		
--遠距離時のグレイズ
	elseif graze_farground_condi() then
		graze_farground_exe()
	elseif graze_farair_condi() then
		graze_farair_exe()
		
--特定状況におけるガード
	elseif guard_objgimmick_condi()==true then
		guard_backexpectlowattack_exe()
--オブジェが至近距離の場合、ガード:射撃と打撃を重ねられると、しゃがみガードしてしまう。優先順位の変更が必要
	elseif guard_objclosedis_condi()==true then
		guard_backexpectlowattack_exe()
	
--▼起き上がり直後の行動
	elseif move_soonaftergetup_condi()==true then
		move_soonaftergetup_exe()

--▼コンボ▼
--近A>AA
	elseif my_act==300 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and is_dir_front==true then
		print("A>AA");
		key_event(ACT_A);
--AA>AAA
		elseif my_act==320 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and is_dir_front==true then
			print("AA>AAA");
			key_event(ACT_A);
--AAA>2B	
			elseif my_act==321 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((x<1040 and my_dir==1) or (x>240 and my_dir==-1)) then
				print("AAA＞2B");
				key_event2(ACT_B,ACT_DOWN);
--AAA>2B>6C9hjc>JA>J8A(1)>JC>JB降華蹴　降華蹴2lv以上(位置限：950<1000
	--2B>6C　1hitの場合のみ、上記流れが可能。また距離がやや遠くても当たる。近すぎるとあたらない。
				elseif my_act==402 and my_frame>=5 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((x<1000 and my_dir==1) or (x>280 and my_dir==-1)) and my_preact[1]==321 then
					key_resetEX();
					key_event(ACT_D);
					print("2B>6C");
					key_event2(ACT_C,front);
	--6C>9hjc>JA
					elseif my_act==411 and my_frame>=25 and enemy_act>=50 and enemy_act<=89 and (((x<1000 and my_dir==1)and(x>950 and my_dir==1)) or ((x>280 and my_dir==-1)and(x>330 and my_dir==-1))) and my_preact[1]==402 and my_preact[2]==321 then
						print("6C>9hjc");
						key_event(u_front);
		--9hjc>JA このJAが決まれば、位置的にそれ以降も入る。風雨等で9hjの速度が上がっていれば、可能な範囲が広がる。
						elseif my_act==209 and my_frame>=3 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==411 and my_preact[2]==402 and my_preact[3]==321 then
							print("9hjc>JA");
							key_event(ACT_A);
	--JA>J8A　6Cが複数hitしている場合、これで〆るのがベター
							elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and ey>0 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==411 and my_preact[4]==402 and my_preact[5]==321 then
								print("JA>J8A");
								key_event2(ACT_A,ACT_UP);
	--J8A(1)>JC
								elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=400 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==411 and my_preact[5]==402 then
									print("J8A(1hit)>JC");
									key_resetEX();
									key_event(ACT_C);
	--JC>JB降華蹴　降華蹴2lv以上（以下略）
									elseif my_act==414 and my_allframe>=0 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==309 and my_preact[2]==306 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==411 then
										if my_allframe<=11 then
											key_resetEX();
											if card_check(108)==true then
												card_1st(108);
											end
										end
										if my_allframe>=13 and card_check(108)==false then
											if get_skill_lv(0,8)>=0 then
												print("JC>B降華蹴");
												lvr214(ACT_B);
											end
										elseif my_allframe>=15 then
											key_resetEX();
											if card_check(108)==true then
												print("JC>スキカ降華蹴");
												card_use(108);
											end
										end
--基本）AAA>2B>6C>B降華蹴orC天龍脚　全キャラ対応版　よって霊力があればこちらを使おう
	--6C>B降華蹴　全キャラ対応版　よって霊力があればこちらを使おう
	--6C>C天龍脚　全キャラ対応版　6Cにはややディレイを
					elseif my_act==411 and my_frame>=0 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and (card_check(108)==true or get_skill_lv(0,8)>=0 or card_check(110)==true or get_skill_lv(0,10)>=0) and ((x<950 and my_dir==1) or (x>330 and my_dir==-1)) and my_preact[1]==402 and my_preact[2]==321 and my_preact[3]==320 and my_preact[4]==300 then
						if my_frame<=9 then
							key_resetEX();
							if card_check(108)==true then
								card_1st(108);
							elseif card_check(110)==true then
								card_1st(110);
							end
						end
						if my_frame>=10 and (card_check(108)==false and card_check(110)==false) and (get_skill_lv(0,8)>=0 or get_skill_lv(0,10)>=0) and ((x<950 and my_dir==1) or (x>330 and my_dir==-1)) then
							if get_skill_lv(0,8)>=0 then
								print("6C>B降華蹴");
								lvr214(ACT_B);
							elseif get_skill_lv(0,10)>=0 then
								print("6C>C天龍脚");
								lvr22(ACT_C);
							end
						elseif my_frame>=14 and ((x<950 and my_dir==1) or (x>330 and my_dir==-1)) then
							key_resetEX();
							if card_check(108)==true then
								print("6C>スキカ降華蹴");
								card_use(108);
							elseif card_check(110)==true then
								print("6C>スキカ天龍脚");
								card_use(110);
							end
						end
--AAA>2B>2C>9飛翔>JA>J8A(1)>JC>JB降華蹴　降華蹴2lv以上（以下略）
	--2B>2C
				elseif my_act==402 and my_frame>=5 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and my_preact[1]==321 and my_preact[2]==320 and my_preact[3]==300 then
					key_resetEX();
					key_event(ACT_D);
					print("2B>2C");
					key_event2(ACT_C,ACT_DOWN);
	--2C>9飛翔
					elseif my_act==412 and my_frame>=18 and enemy_act>=50 and enemy_act<=89 and dis>=190 and my_rei>=100 and my_preact[1]==412 and my_preact[2]==402 and my_preact[3]==321 and my_preact[4]==320 and my_preact[5]==300 then
						print("2C>9飛翔");
						key_on(ACT_D);
						key_on(u_front);
						wait(6);
						key_on(d_front);
						wait(8);
	--9飛翔>JA
						elseif my_act==214 and my_allframe>=14 and enemy_act>=50 and enemy_act<=89 and enemy_frame<=6 and is_dir_front==true and my_preact[1]==214 and my_preact[2]==214 and my_preact[3]==412 and my_preact[4]==412 and my_preact[5]==402 then
							print("9飛翔>JA");
							key_event(ACT_A);
	--JA>J8A　非慣性　やや難
							elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and ey>0 and my_preact[1]==214 and my_preact[2]==214 and my_preact[3]==214 and my_preact[4]==412 and my_preact[5]==412 then
								print("JA>J8A");
								key_event2(ACT_A,ACT_UP);
	--J8A(1)>JC
								elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=400 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==306 and my_preact[2]==214 and my_preact[3]==214 and my_preact[4]==214 and my_preact[5]==412 then
									print("J8A(1hit)>JC");
									key_resetEX();
									key_event(ACT_C);
	--JC>JB降華蹴　降華蹴2lv以上（以下略）
									elseif my_act==414 and my_allframe>=0 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==309 and my_preact[2]==306 and my_preact[3]==214 and my_preact[4]==214 and my_preact[5]==214 then
										if my_allframe<=11 then
											key_resetEX();
											if card_check(108)==true then
												card_1st(108);
											end
										end
										if my_allframe>=13 and card_check(108)==false then
											if get_skill_lv(0,8)>=0 then
												print("JC>B降華蹴");
												lvr214(ACT_B);
											end
										elseif my_allframe>=15 then
											key_resetEX();
											if card_check(108)==true then
												print("JC>スキカ降華蹴");
												card_use(108);
											end
										end
						
--AAA>2B>2C>66>J8A(1)>J6C　要慣性　やや難
	--2C>66
					elseif my_act==412 and my_frame>=16 and enemy_act>=50 and enemy_act<=89 and dis<190 and my_preact[1]==412 and my_preact[2]==402 and my_preact[3]==321 and my_preact[4]==320 and my_preact[5]==300 then
						print("2C>66");
						lvr66();
	--66>J8A(1)
						elseif my_act==202 and my_allframe>=8+3 and enemy_act>=50 and enemy_act<=89 and enemy_frame<=6 and is_dir_front==true and my_rei>=200 and my_preact[1]==202 and my_preact[2]==412 and my_preact[3]==412 and my_preact[4]==402 and my_preact[5]==321 then
							print("66>J8A");
							key_event2(ACT_A,ACT_UP);
	--J8A(1)>J6C　要慣性　やや難
							elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and my_preact[1]==202 and my_preact[2]==202 and my_preact[3]==412 and my_preact[4]==412 and my_preact[5]==402 then
								print("J8A(1hit)>J6C");
								key_event2(ACT_C,front);
										
--AAA>2B>2C>66>J8A(1)>JC (>JB降華蹴
	--J8A(1)>JC (>JB降華蹴
							elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and my_preact[1]==202 and my_preact[2]==202 and my_preact[3]==412 and my_preact[4]==412 and my_preact[5]==402 then
								print("J8A(1hit)>JC");
								key_event(ACT_C);
	--JC>JB降華蹴　降華蹴2lv以上（以下略）
									elseif my_act==414 and my_allframe>=0 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==309 and my_preact[2]==202 and my_preact[3]==202 and my_preact[4]==412 and my_preact[5]==412 then
										if my_allframe<=11 then
											key_resetEX();
											if card_check(108)==true then
												card_1st(108);
											end
										end
										if my_allframe>=13 and card_check(108)==false then
											if get_skill_lv(0,8)>=0 then
												print("JC>B降華蹴");
												lvr214(ACT_B);
											end
										elseif my_allframe>=15 then
											key_resetEX();
											if card_check(108)==true then
												print("JC>スキカ降華蹴");
												card_use(108);
											end
										end
										
--AAA>B>C>JA>J2A(1)>JC>44>JA>J8A　ここから端コン　キャラ限定
	--AAA>B
			elseif my_act==321 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((x>=1040 and my_dir==1) or (x<=240 and my_dir==-1)) then
				print("AAA＞B");
				key_event(ACT_B);
	--B>C
				elseif my_act==400 and my_frame>=10 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((x>=1040 and my_dir==1) or (x<=240 and my_dir==-1)) then
					print("B>C");
					key_event(ACT_C);
	--C>9hjc	>JA
					elseif my_act==410 and my_frame>=25 and enemy_act>=50 and enemy_act<=89 and ((x>=1040 and my_dir==1) or (x<=240 and my_dir==-1)) then
						print("C>9hjc");
						key_event(u_front);
		--9hjc	>JA
						elseif my_act==209 and my_frame>=3 and enemy_act>=50 and enemy_act<=89 and ((x>=1040 and my_dir==1) or (x<=240 and my_dir==-1)) then
							print("9hjc>JA");
							key_event(ACT_A);
	--JA>J2A 始動から1040+90でJAヒット
							elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_xspeed>=0 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==410 and my_preact[4]==400 and my_preact[5]==321 then
								print("JA>J2A");
								key_event2(ACT_A,ACT_DOWN);
	--J2A(1)>JC
								elseif my_act==308 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==410 and my_preact[5]==400 then
									print("J2A(1hit)>JC");
									key_event2(ACT_C,ACT_DOWN);
	--JC>44
									elseif my_act==414 and my_frame>=23 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==308 and my_preact[2]==306 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==410 then
										print("JC>44");
										lvr44();
	--44>JA
										elseif my_act==203 and my_allframe>=5 and enemy_act>=50 and enemy_act<=89 and enemy_frame<=6 and is_dir_front==true and my_rei>=200 and my_preact[1]==414 and my_preact[2]==308 and my_preact[3]==306 and my_preact[4]==209 and my_preact[5]==209 then
											print("44>JA");
											key_event(ACT_A);
	--JA>J8A
											elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==203 and my_preact[2]==414 and my_preact[3]==308 and my_preact[4]==306 and my_preact[5]==209 then
												print("JA>J8A");
												key_event2(ACT_A,ACT_UP);

--AAA>B>C>(JA)>J8A(1)>JC>66>JA>J8A　最初のJAは省いた方が無難。なおJAが入ると、ダメは44>JAルートと大差ないレベルとなる。
	--C>9hjc	>JA　ディレイかけ+10
					elseif my_act==410 and my_frame>=25 and enemy_act>=50 and enemy_act<=89 and ((x>=1040 and my_dir==1) or (x<=240 and my_dir==-1)) then
						print("C>9hjc");
						key_event(u_front);
		--9hjc	>JA
		--				elseif my_act==209 and my_frame>=3 and enemy_act>=50 and enemy_act<=89 and ((x>=1040 and my_dir==1) or (x<=240 and my_dir==-1)) then
		--					print("9hjc>JA");
		--					key_event(ACT_A);
	--JA>J8A 始動から1040+90でJAヒット・・・までは変わらないはず
							elseif my_act==209 and my_frame>=3+1 and enemy_act>=50 and enemy_act<=89 and my_xspeed>=0 and my_preact[1]==209 and my_preact[2]==410 and my_preact[3]==400 and my_preact[4]==321 and my_preact[5]==320 then
								print("9hjc>(JA)>J8A");
								key_event2(ACT_A,ACT_UP);
	--J8A(1)>JC
								elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==410 and my_preact[4]==400 and my_preact[5]==321 then
									print("J8A(1hit)>JC");
									key_event2(ACT_C,ACT_DOWN);
	--JC>66
									elseif my_act==414 and my_frame>=23 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==309 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==410 and my_preact[5]==400 then
										print("JC>66");
										lvr66();
	--66>JA
										elseif my_act==202 and my_allframe>=5+5 and enemy_act>=50 and enemy_act<=89 and enemy_frame<=6 and is_dir_front==true and my_rei>=200 and my_preact[1]==414 and my_preact[2]==309 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==410 then
											print("66>JA");
											key_event(ACT_A);
	--JA>J8A
											elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==202 and my_preact[2]==414 and my_preact[3]==309 and my_preact[4]==209 and my_preact[5]==209 then
												print("JA>J8A");
												key_event2(ACT_A,ACT_UP);
--AAAAコンボ
			elseif my_act==321 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and is_dir_front==true then
				print("ＡＡＡ＞ＡＡＡＡ");
				key_event(ACT_A);
--AAAA>黄震脚
			elseif my_act==322 and my_hitstop<=5 and my_hitstop>=1 and my_hitstop==enemy_hitstop and is_dir_front==true and (card_check(102) or (get_skill_lv(0,2)>=0 and card_check(102)==false and my_rei>=200)) then
				if card_check(102) and my_hitstop<=3 and my_hitstop>=1 then
					print("ＡＡＡＡ＞スキルカード：黄震脚");
					card_use(102);
				elseif get_skill_lv(0,2)>=0 and card_check(102)==false and my_rei>=200 then
					print("ＡＡＡＡ＞Ｂ黄震脚");
					lvr22(ACT_B);
				end
--AAAA>地龍波
			elseif my_act==322 and my_hitstop<=5 and my_hitstop>=1 and my_hitstop==enemy_hitstop and is_dir_front==true and (card_check(106) or (get_skill_lv(0,6)>=0 and card_check(106)==false and my_rei>=200)) then
				if card_check(106) and my_hitstop<=3 and my_hitstop>=1 then
					print("ＡＡＡＡ＞スキルカード：地龍波");
					card_use(106);
				elseif get_skill_lv(0,6)>=0 and card_check(106)==false and my_rei>=200 then
					print("ＡＡＡＡ＞Ｃ地龍波");
					lvr22(ACT_C);
				end
--基本？）梅雨・キャラ限定）　AAAA>B降華蹴>3A>C>B降華蹴
--基本）AAAA>スペカ
--AAAA>B黄震脚or地龍波　基本中の基本コンボ　ダウンが取れるのも良い
--基本）AAAA>C烈虹拳　BよりCの方がダメージが高い
--AAAA>B降華蹴　（キャラ限、やられ限）　一部キャラのしゃがみには当たらない
--AAAA>C天龍脚(>追撃）　やられ限　同じくしゃがみには当たらないキャラが
--AAAA>B紅寸剄（MAX）>3A>B天龍脚　結構ロマン





--基本）2A*6>星脈地転弾>DC



--基本）遠A>C>J2A(1hit)>JC>66>JA>J8A
--基本）遠A>6C>C螺光歩orC烈虹拳orB降華蹴or地龍波or天龍脚　中央で遠Aがヒットした時はコレで
--遠A>C>9hj>JA>J2A(1)>9hj>JA>J8A(>J2B)
	--遠A>C
			elseif my_act==301 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 then
				print("遠A>C");
				key_event(ACT_C);
	--C>9hj：キャラによりタイミングが異なる。最終的にはキャラごとに調整。
				elseif my_act==410 and my_frame>=25 and enemy_act>=50 and enemy_act<=89 then
					print("C>9hj");
					key_event(u_front);
	--9hj>JA
					elseif my_act==209 and my_allframe>=3+11 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==209 and my_preact[2]==410 then
						print("9hj>JA");
						key_event(ACT_A);
	--JA>J2A(1)
						elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==410 then
							print("JA>J2A(1)");
							wait(8);
							key_event2(ACT_A,ACT_DOWN);
	--J2A(1)>(着地)>9hjc　先行入力を利用して着地を完全にキャンセルして9hjc
								elseif my_act==308 and (y+my_yspeed*10+(10*(9*m_gs))/2)<=0 and my_hitstop>=1 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==410 then
									print("J2A(1)>(着地)>9hjc");
									key_event(ACT_DOWN);
									key_event(u_front);
	--9hj>JA
									elseif my_act==209 and my_frame>=3 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==308 and my_preact[2]==306 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==410 then
										print("9hjc>JA");
										key_event(ACT_A);
	--JA>J8A
										elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==308 and my_preact[4]==306 and my_preact[5]==209 then
											print("JA>J8A");
											key_event2(ACT_A,ACT_UP);
		--J8A(1hit)>J6C
										elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and ((x<=1030 and my_dir==1) or (x>=250 and my_dir==-1)) and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==308 and my_preact[5]==306 then
											print("J8A(1hit)>J6C");
											key_event2(ACT_C,front);
		--J8A(1hit)>JC
										elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==308 and my_preact[5]==306 then
											print("J8A(1hit)>JC");
											key_event(ACT_C);
			--JC>JB降華蹴　降華蹴2lv以上（以下略）
											elseif (my_act==414 or my_act==415) and my_allframe>=0 and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and ((card_check(108) and get_skill_lv(0,8)>=1) or get_skill_lv(0,8)>=2 or (weather==9 and get_skill_lv(0,8)>=0)) and my_preact[1]==309 and my_preact[2]==306 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==308 then
												if my_allframe<=11 then
													key_resetEX();
													if card_check(108)==true then
														card_1st(108);
													end
												end
												if my_allframe>=13 and card_check(108)==false then
													if get_skill_lv(0,8)>=0 then
														print("JC>B降華蹴");
														lvr214(ACT_B);
													end
												elseif my_allframe>=15 then
													key_resetEX();
													if card_check(108)==true then
														print("JC>スキカ降華蹴");
														card_use(108);
													end
												end
		--J8A(>J2B)
											elseif my_act==309 and my_frame>=25 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==308 and my_preact[5]==306 then
												print("J8A(>J2B)");
												key_event2(ACT_B,ACT_DOWN);
		--J2B>3飛翔：以下セットプレイ。状況優先行動
					elseif my_act==406 and my_frame>=23 and enemy_act>=50 and enemy_act<=89 and my_rei>=100 and my_preact[1]==309 and my_preact[2]==306 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==308 then
						print("J2B>3飛翔");
						key_on(ACT_D);
						key_on(d_front);
						wait(5);
						
		--3飛翔>J4A
						elseif my_act==214 and my_allframe>=15 and ((my_preact[1]==214 and my_preact[2]==214 and my_preact[3]==406 and my_preact[4]==309 and my_preact[5]==306)or(my_preact[1]==214 and my_preact[2]==214 and my_preact[3]==214 and my_preact[4]==406 and my_preact[5]==309)) then
							print("3飛翔>J4A");
							if x>=640 then
								key_event2(ACT_A,ACT_LEFT);
							else
								key_event2(ACT_A,ACT_RIGHT);
							end




--遠A>B>C>JA>J8A(1)>JC>44>JA>J8A　遠Aで空ガを狩ったとき用

--近A>B>JA>JB>66>JA>J8A(1)>JC>44>JA>J8A　近Aで空ガを狩ったとき用、やや難
--近A>B>JA>JB>66>JA>J6A>JC>44>JA>J8A　途中のJ8AをJ6Aにすると安定するキャラもいる


--C>JC>66>JA>J8A(1)>JC>44>JA>J8A　固めのC>JCがヒットしたらこれを

--基本）J2A(1hit)>4A>大鵬拳>追撃
--基本）J2A(1hit)>2A*2>B紅砲
--ロマン）J2A(1hit)>登りJA>J2A(1hit)>JC>B降華蹴(2lv)
--基本）J2A(1hit　めくりヒット)>スペカ
--J2A(1)>4A*2>B紅砲　ここからJ2A関係　2Aでも可
--J2A(1)>2A>B烈虹拳　2Aはできるだけ低い位置で
--J2A(1)>登りJA>J2A(1)>JC>66>JA>J8A　J2Aが低空で当たったときは余裕が増える
--J2A(1)>登りJA>J2A(1)>JC>B降華蹴　JCにややディレイ
--J2A(1)>遠A>B>JA>J8A>JC>44>JA>J8A　遠Aで拾うとダメージが上がる
--J2A(1)>AAA>2B>JA>J8A　ダッシュを入れ込んでいた場合はこちら
--J2A>登りJA>J2A(1)>JC>44>JA>J8A　JAで拾ってもいいと思うよ

--ネタ）JA>J8A>JB(空振り)>2飛翔>JA>遠A>6A>B紅砲
--ロマン）JA>AAA>6B>6C>大鵬墜撃拳>追撃
--JA>登りJA>J2A(1)>JC>66>JA>J8A(1)>JC>44>J8A　JAが低空でヒットしたとき用
--JA>J8A(1)>JC>66>JA>J8A(1)>JC>44>JA>J8A　画面端から逃がさないよッ！！

--C紅砲>JA>J8A(1)>JC>66>JA>J8A　ここからC紅砲追撃
	--C紅砲>9hj
				elseif my_act==521 and my_frame>=56 and enemy_act>=50 and enemy_act<=89 then
					print("C紅砲>9hj");
					key_event(ACT_DOWN);
					key_event(u_front);
					
	--9hj>JA
					elseif my_act==209 and my_allframe>=5 and enemy_act>=50 and enemy_act<=89 and ((my_preact[1]==521 and my_preact[2]<300)or(my_preact[2]==521 and my_preact[3]<300)) then
						print("9hj>JA");
						key_event(ACT_A);
	--JA>J8A
						elseif my_act==306 and dis<=120 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==521 and my_preact[4]<300 then
							print("JA>J8A");
							key_event2(ACT_A,ACT_UP);
	--JA>J6A
						elseif my_act==306 and dis>120 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==209 and my_preact[2]==209 and my_preact[3]==521 and my_preact[4]<300 then
							print("JA>J6A");
							key_event2(ACT_A,front);
							
	--J8A(1hit)>JC
							elseif my_act==309 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_rei>=200 and my_preact[1]==306 and my_preact[2]==209 and my_preact[3]==209 and my_preact[4]==521 and my_preact[5]<300 then
								print("J8A(1hit)>JC");
								key_event(ACT_C);
	--JC>66
								elseif my_act==414 and my_frame>=23 and enemy_act>=50 and enemy_act<=89 and my_preact[1]==309 and my_preact[2]==306 and my_preact[3]==209 and my_preact[4]==209 and my_preact[5]==521 then
									print("JC>66");
									lvr66();
	--66>JA
									elseif my_act==202 and my_allframe>=5+3 and enemy_act>=50 and enemy_act<=89 and enemy_frame<=6 and is_dir_front==true and my_rei>=200 and my_preact[1]==414 and my_preact[2]==309 and my_preact[3]==306 and my_preact[4]==209 and my_preact[5]==209 then
										print("66>JA");
										key_event(ACT_A);
	--JA>J8A
										elseif my_act==306 and my_hitstop<=3 and my_hitstop>=1 and my_hitstop==enemy_hitstop and enemy_act>=50 and enemy_act<=89 and my_preact[1]==202 and my_preact[2]==414 and my_preact[3]==309 and my_preact[4]==306 and my_preact[5]==209 then
											print("JA>J8A");
											key_event2(ACT_A,ACT_UP);--]]

--C紅砲CH>JC>9飛翔>JA>J8A(1)>JC>66>JA>J8A　CH時限定、JCはｈｊから最速で
--C紅砲黄砂CH>遠A>B>JA>J8A(1)>JC>66>JA>J8A　黄砂時限定　遠A>Bで拾うのはロマン

--ややロマン）B降華蹴CH>遠A>HB>C>JA>J8A
--ロマン）B降華蹴CH(2lv)>遠A>B>JA>J8A(1hit)>HJB>JC>B降華蹴
--B降華蹴CH>遠A>B降華蹴　降華蹴CHコン
--B降華蹴CH>遠A>B>JA>J8A(1)>44>JA>J8A　遠A>Cで拾ってもおｋ
--B降華蹴CH>遠A>B>JA>J8A(1)>HJB>JC>C降華蹴　コンボ後の霊力には注意

--基本）JA>AAA>B>C>J8A(1hit)>JC>44>JA>J8A
--基本）JA>AAA>B>C>J2A(1hit)44>JA>J8A
--JA>J8A>JB（空振り)>2飛翔>JA>遠A>6A>B紅砲　ややネタ　〆を遠A>B烈虹拳>彩光蓮華掌にすると・・・？
--JA>J2A(1)>登りJA>J8A(1)>JC>66>JA>J8A　着地からの拾いなおし
--JA>J6A>J6C>9飛翔>JA>J6A　端までの距離と高さしだいではこんなのも
--JA>J2A>8hj>JA>J8A(1)>JC>44>JA>J8A　J2Aが端で2hitしたらこれを
--JA>J8A>J6C>6飛翔>JA>J8A　最後はJ2Aでもおｋ

--C螺光歩>AAA>2B>JA>J8A　ネタコン　こんなことも('(ﾟ∀ﾟ∩ できるよ！
--B螺光歩>遠A>B>JA>J8A(1)>JC>44>JA>J8A　同じくネタコン　結構痛い

--ロマン）C天龍脚CH>B螺光歩>地龍天龍脚
--基本？）C天龍脚>J2A(1hit)>スペカ
--ロマン）C天龍脚CH(4lv)>B天龍脚>JA>大鵬拳
--C天龍脚CH>B天龍脚>JA>B紅砲　これもロマン

--ロマン）紅寸剄（2lv)>遠A>6A>B紅寸剄
--紅寸剄>遠A>6C>JA>J8A　端近くでの紅寸剄追撃コン
--紅寸剄>B>C>JA>J8A　端密着での追撃

--ネタ）遠Aヒット確認>スペカ
--ネタ）6A>遠A>6A>2B

--ロマン）大鵬拳>JA>J8A(1hit)>JC>66>JA>J8A
--ロマン）いわゆるひとつのDD殺法
--世紀末）バスケ
--基本）彩光乱舞による後光り

--●固め
--JA＞J6AorJ2AorJ8A＞JB(JC)＞66＞JA→ループ
	--JA>J6A
	--elseif my_act==306 and ey>0 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and is_dir_front then
	--	print("JA>J6A");
	--	key_event2(ACT_A,front);
	--JA>J2A
	--elseif my_act==306 and ey>0 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and is_dir_front and ey-y<0 then
	--	print("JA>J2A");
	--	key_event2(ACT_A,ACT_DOWN);
	--JA>J8A
	elseif my_act==306 and ey>0 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and is_dir_front then
		print("JA>J8A");
		key_event2(ACT_A,ACT_UP);
		--J6A
		--J2A
		--J8A>JB
		elseif my_act>=307 and ey>0 and my_act<=309 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and my_rei>=200 and is_dir_front then
			print("JxA>JB");
			key_event(ACT_B);
			--JxA>66
			elseif my_act==404 and my_allframe>=18 and ey>0 and enemy_act>=143 and enemy_act<=166 and (my_air<=1 or (my_air<=2 and weather==10)) and is_dir_front then
				print("JB>66");
				lvr66();
		
--JA＞JC＞8or9飛翔＞2飛翔＞JA＞着地9hjJA＞ループ
	--JA>JC

--遠A>6C
	elseif my_act==301 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and my_rei>=200 and ((x<=1000 and my_dir==1)or(x>=280 and my_dir==-1)) and is_dir_front then
		print("遠A>6C");
		key_event2(ACT_C,front);
--遠A>3A
	elseif my_act==301 and dis<=300 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and is_dir_front then
		print("遠A>3A");
		key_event2(ACT_A,d_front);
--遠A>B
	elseif my_act==301 and dis>300 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=1 and is_dir_front then
		print("遠A>3A");
		key_event(ACT_B);


--▼攻撃▼

--▼spell card▼

--▼cost2

--彩符「彩光風鈴」,200,600,g
	--Ground
		elseif card_check(200)==true and
			my_spell_more(1000) and
			dis<200 and
			y==0 and
			ey<100 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			--is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("彩符「彩光風鈴」");
				for i=1,10 do
					card_use(200);
					yield()
				end

--虹符「烈虹真拳」,206,606,g
	--Ground
		elseif card_check(206)==true and
			my_spell_more(1000) and
			dis<300 and
			y==0 and
			ey<50 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			--is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("虹符「烈虹真拳」");
				for i=1,10 do
					card_use(206);
					yield()
				end

--▼cost3

--気符「星脈弾」,202,602,g
	--Ground
		elseif card_check(202)==true and
			my_spell_more(1500) and
			--dis2<350 and
			y==0 and
			ey<100 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("気符「星脈弾」");
				for i=1,10 do
					card_use(202);
					yield()
				end

--撃符「大鵬拳」,204,604,g
	--Ground
		elseif card_check(204)==true and
			my_spell_more(1500) and
			dis<200 and
			y==0 and
			ey<200 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("撃符「大鵬拳」");
				for i=1,10 do
					card_use(204);
					yield()
				end

--気符「地龍天龍脚」,207,607,g
	--Ground
		elseif card_check(207)==true and
			my_spell_more(1500) and
			ey-y<dis+50 and
			dis<300 and
			y==0 and
			--ey<50 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("気符「地龍天龍脚」");
				for i=1,10 do
					card_use(207);
					yield()
				end

--▼cost4

--極彩「彩光乱舞」,201,601,g
	--Ground
		elseif card_check(201)==true and
			my_spell_more(2000) and
			dis<400 and
			y==0 and
			ey<200 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			--enemy_obj_range_in(150,60)==false and 
			--is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("極彩「彩光乱舞」");
				for i=1,10 do
					card_use(201);
					yield()
				end

--彩華「虹色太極拳」,208,608,g
	--Ground
		elseif card_check(208)==true and
			my_spell_more(2000) and
			--dis<500 and
			y==0 and
			--ey<100 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			--is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("彩華「虹色太極拳」");
				for i=1,10 do
					card_use(208);
					yield()
				end

--気符「猛虎内勁」,211,611,g
	--Ground
		elseif card_check(211)==true and
			my_spell_more(2000) and
			--dis<500 and
			y==0 and
			--ey<100 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			--is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("気符「猛虎内勁」");
				for i=1,10 do
					card_use(211);
					yield()
				end

--▼cost5

--星気「星脈地転弾」,203,603,g
	--Ground
		elseif card_check(203)==true and
			my_spell_more(2500) and
			dis<500 and
			y==0 and
			ey<200 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("星気「星脈地転弾」");
				for i=1,10 do
					card_use(203);
					yield()
				end

--熾撃「大鵬墜撃拳」,205,605,g
	--Ground
		elseif card_check(205)==true and
			my_spell_more(2500) and
			dis<200 and
			y==0 and
			ey<50 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("熾撃「大鵬墜撃拳」");
				for i=1,10 do
					card_use(205);
					yield()
				end

--華符「彩光蓮華掌」,209,609,g
	--Ground
		elseif card_check(209)==true and
			my_spell_more(2500) and
			dis<500 and
			y==0 and
			ey<100 and
			not(my_act>=50 and my_act<180) and my_act<600 and 
			get_fflags(0,32)==true and
			get_fflags(0,8)==false and get_fflags(1,8)==false and 
			enemy_obj_range_in(150,60)==false and 
			is_dir_front==true and 
			subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
				print("華符「彩光蓮華掌」");
				for i=1,10 do
					card_use(209);
					yield()
				end

--[[
--▼skill card▼

	--▼スキル236

		--博麗アミュレット,100,500,g,a
			--g,a
				elseif get_skill_lv(0,0)>=0 and my_rei>=400 and 
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("博麗アミュレット");
						lvr236(ACT_B);
				
				elseif get_skill_lv(0,0)>=0 and my_rei>=400 and 
					dis>450 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("博麗アミュレット");
						lvr236(ACT_C);
					
				elseif card_check(100)==true and my_rei>=400 and
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("博麗アミュレット");
						card_use(100);
		
		--妖怪バスター,104,505,g,a
			--g,a
				elseif get_skill_lv(0,4)>=0 and my_rei>=400 and 
					dis>200 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("妖怪バスター");
						lvr236(ACT_B);
					
				elseif get_skill_lv(0,4)>=0 and my_rei>=400 and 
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("妖怪バスター");
						lvr236(ACT_C);
					
				elseif card_check(104)==true and my_rei>=400 and
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("妖怪バスター");
						card_use(104);
		
		--拡散アミュレット,108,510,g

				elseif get_skill_lv(0,8)>=0 and my_rei>=400 and 
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("拡散アミュレット");
						lvr236(ACT_B);
					
				elseif get_skill_lv(0,8)>=0 and my_rei>=400 and 
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("拡散アミュレット");
						lvr236(ACT_C);
					
				elseif card_check(108)==true and my_rei>=400 and
					dis>300 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("拡散アミュレット");
						card_use(108);
		
	--▼スキル623

		--昇天脚,103,560,g

				elseif get_skill_lv(0,3)>=0 and my_rei>=400 and 
					dis<150 and
					y==0 and
					ey<200 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("昇天脚");
						lvr623(ACT_B);
					
				elseif get_skill_lv(0,3)>=0 and my_rei>=400 and 
					dis<150 and
					y==0 and
					ey<300 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					--enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("昇天脚");
						lvr623(ACT_C);
					
				elseif card_check(103)==true and my_rei>=400 and
					dis<150 and
					y==0 and
					ey<200 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("昇天脚");
						card_use(103);
		
		--抄地昇天脚,107,565,g
			--g
				elseif get_skill_lv(0,7)>=0 and my_rei>=400 and 
					dis<200 and
					y==0 and
					ey<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("抄地昇天脚");
						lvr623(ACT_B);
					
				elseif get_skill_lv(0,7)>=0 and my_rei>=400 and 
					dis<300 and
					y==0 and
					ey<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("抄地昇天脚");
						lvr623(ACT_C);
					
				elseif card_check(107)==true and my_rei>=400 and
					dis<200 and
					y==0 and
					ey<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("抄地昇天脚");
						card_use(107);
		
		--雨乞祈り,111,570,g,a
			--g,a
				elseif get_skill_lv(0,11)>=0 and my_rei>=400 and 
					dis<200 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("雨乞祈り");
						lvr623(ACT_B);
					
				elseif get_skill_lv(0,11)>=0 and my_rei>=400 and 
					dis<200 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("雨乞祈り");
						lvr623(ACT_C);
					
				elseif card_check(111)==true and my_rei>=400 and
					dis<200 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("雨乞祈り");
						card_use(111);

	--▼スキル421
		--亜空穴,102,540,g,a
			--g,a
				elseif get_skill_lv(0,2)>=0 and my_rei>=400 and 
					not(my_act>=50 and my_act<180) and my_act<600 and
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("亜空穴");
						lvr421(ACT_B);
					
				elseif get_skill_lv(0,2)>=0 and my_rei>=400 and 
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("亜空穴");
						lvr421(ACT_C);
					
				elseif card_check(102)==true and my_rei>=400 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("亜空穴");
						card_use(102);
		
		--封魔亜空穴,106,545,g,a
			--g,a
				elseif get_skill_lv(0,6)>=0 and my_rei>=400 and 
					dis<300 and
					ey<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("封魔亜空穴");
						lvr421(ACT_B);
					
				elseif get_skill_lv(0,6)>=0 and my_rei>=400 and 
					dis>300 and
					ey<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("封魔亜空穴");
						lvr421(ACT_C);
					
				elseif card_check(106)==true and my_rei>=400 and
					dis<300 and
					ey<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("封魔亜空穴");
						card_use(106);
		
		--刹那亜空穴,110,550,g
			--g
				elseif get_skill_lv(0,10)>=0 and my_rei>=400 and 
					dis2<300 and
					y==0 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					enemy_act>300 and
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("刹那亜空穴");
						lvr421(ACT_B);
					
				elseif get_skill_lv(0,10)>=0 and my_rei>=400 and 
					y==0 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==true and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("刹那亜空穴");
						lvr421(ACT_C);
					
				elseif card_check(110)==true and my_rei>=400 and
					dis2<300 and
					y==0 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					enemy_act>300 and
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("刹那亜空穴");
						card_use(110);

	--▼スキル214
		--警醒陣,101,520,g,a
			--g,a
				elseif get_skill_lv(0,1)>=0 and my_rei>=400 and 
					dis>200 and dis<500 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("警醒陣");
						lvr214(ACT_B);
					
				elseif get_skill_lv(0,1)>=0 and my_rei>=400 and 
					dis>300 and dis<600 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("警醒陣");
						lvr214(ACT_C);
					
				elseif card_check(101)==true and my_rei>=400 and
					dis>200 and dis<500 and
					dis_y<50 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("警醒陣");
						card_use(101);	
		
		--繋縛陣,105,525,g,a
			--g,a
				elseif get_skill_lv(0,5)>=0 and my_rei>=400 and 
					dis2>300 and
					math.abs(enemy_xspeedEX)>5 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("繋縛陣");
						lvr214(ACT_B);
					
				elseif get_skill_lv(0,5)>=0 and my_rei>=400 and 
					dis2>300 and
					math.abs(enemy_yspeed)>5 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("繋縛陣");
						lvr214(ACT_C);
					
				elseif card_check(105)==true and my_rei>=400 and
					dis2>300 and
					math.abs(enemy_xspeedEX)>5 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("繋縛陣");
						card_use(105);
		
		--常置陣,109,530,g
			--g
				elseif get_skill_lv(0,9)>=0 and my_rei>=400 and 
					dis2>300 and
					y==0 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("常置陣");
						lvr214(ACT_B);
					
				elseif get_skill_lv(0,9)>=0 and my_rei>=400 and 
					dis2>500 and
					y==0 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("常置陣");
						lvr214(ACT_C);
					
				elseif card_check(109)==true and my_rei>=400 and
					dis2>300 and
					y==0 and
					not(my_act>=50 and my_act<180) and my_act<600 and 
					get_fflags(0,32)==true and
					get_fflags(0,8)==false and get_fflags(1,8)==false and 
					enemy_obj_range_in(150,60)==false and 
					--is_dir_front==true and 
					subs_count>=530 and nega_count ~= 1 and math.random(64)==1 then
						print("常置陣");
						card_use(109);
--]]
			
--▼攻撃▼
--空中行動。
--ＪＡ 9F
	elseif	y>0 and 
	(my_act<=10 or (my_act>=180 and my_act<300)) and 
	not(enemy_act>=50 and enemy_act<=199) and
	enemy_obj_range_in(150,60)==false and
	is_dir_front and
	(y+my_yspeed*11+(11*(10*m_gs))/2)>0 	and
				(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*9		<=	350+30 	and
				(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*9		>=	0-30 	and
				(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	-	(y+my_yspeed*9+(9*(8*m_gs))/2)	<=	180 		and
				(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	-	(y+my_yspeed*9+(9*(8*m_gs))/2)	>=	0-120 	and subs_count>=530 and nega_count ~= 1 and math.random(2)==1 then
					print("JA");
					key_resetEX();
					key_event(ACT_A);
--Ｊ２Ａ
	elseif y>0 and my_act<300 and dis<=300 and dis_y<=200 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<=199) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("J2A");
		key_event2(ACT_A,ACT_DOWN);
		
--地上行動。

--紅砲。基本対空狙い。コマンド、スキカ両方使用。
	elseif 		y==0 and	(	(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*15		<=	100+30 	and
							(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*15		>=	20-30 	and
							(ey+enemy_yspeed*15+(15*(14*m_gs))/2)			<=	220 	and
							(ey+enemy_yspeed*15+(15*(14*m_gs))/2)>0 	 					) and card_check(101)==true and 
	not(enemy_act>=50 and enemy_act<=166) and enemy_obj_range_in(150,60)==false and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("スキルカード：紅砲");
		card_use(101);
	elseif y==0 and	(	(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*22		<=	100+90+30 	and
							(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*22		>=	20+90-30 	and
							(ey+enemy_yspeed*22+(22*(21*m_gs))/2)			<=	220 	and
							(ey+enemy_yspeed*22+(22*(21*m_gs))/2)			>	0 	 			) and card_check(101)==false and 
	not(enemy_act>=50 and enemy_act<=166) and enemy_obj_range_in(150,60)==false and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("コマンド：紅砲Ｃ");
		lvr623(ACT_C)
	elseif y==0 and	(	(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*15		<=	100+30 	and
							(ex-x)*my_dir-(my_xspeed+enemy_xspeed)*15		>=	20-30 	and
							(ey+enemy_yspeed*15+(15*(14*m_gs))/2)			<=	220 	and
							(ey+enemy_yspeed*15+(15*(14*m_gs))/2)>0 	 					) and card_check(101)==false and 
	not(enemy_act>=50 and enemy_act<=166) and enemy_obj_range_in(150,60)==false and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("コマンド：紅砲Ｂ");
		lvr623(ACT_B)
		
--２１４。螺光歩、降華蹴用。中距離からの奇襲。ｘ軸の判断は基本３つ。後退できる状況、後退できないモーション、後退が意味のない位置。
	--螺光歩 100
	elseif y==0 and not(my_act>=50 and my_act<=166) and not(ey==0 and enemy_act>=6 and enemy_act<=8) and not(ey==0 and enemy_act>=208 and enemy_act<=212) and
	((enemy_act<=5 and dis>=260 and dis<=280) or 
	(enemy_act~=10 and enemy_act<300 and dis+enemy_xspeedEX*21>=360 and dis+enemy_xspeedEX*21<=380) or 
	(((x<=480 and my_dir==-1) or (x>=800 and my_dir==1)) and enemy_act<300 and dis+enemy_xspeedEX*21>=360 and dis+enemy_xspeedEX*21<=380))and
	(ey+enemy_yspeed*21+(21*(20*m_gs))/2)<=80 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=166) and card_check(100)==true and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
			print("dis=",dis,"スキルカード：螺光歩");
			card_use(100);
	elseif y==0 and not(my_act>=50 and my_act<=166) and not(ey==0 and enemy_act>=6 and enemy_act<=8) and not(ey==0 and enemy_act>=208 and enemy_act<=212) and
	((enemy_act<=5 and dis>=260 and dis<=280) or 
	(enemy_act~=10 and enemy_act<300 and dis+enemy_xspeedEX*21>=360 and dis+enemy_xspeedEX*21<=380) or 
	(((x<=480 and my_dir==-1) or (x>=800 and my_dir==1)) and enemy_act<300 and dis+enemy_xspeedEX*21>=360 and dis+enemy_xspeedEX*21<=380))and
	(ey+enemy_yspeed*21+(21*(20*m_gs))/2)<=80 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=166) and get_skill_lv(0,0)>=0 and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
			print("dis=",dis,"コマンド：螺光歩B");
			lvr214(ACT_B);
	elseif y==0 and not(my_act>=50 and my_act<=166) and not(ey==0 and enemy_act>=6 and enemy_act<=8) and not(ey==0 and enemy_act>=208 and enemy_act<=212) and
	((enemy_act<=5 and dis>=440 and dis<=500) or 
	(--enemy_act~=10 and enemy_act<300 and 
	dis+enemy_xspeedEX*21>=580 and dis+enemy_xspeedEX*21<=600) or 
	(((x<=730 and my_dir==-1) or (x>=550 and my_dir==1)) and --enemy_act<300 and 
	dis+enemy_xspeedEX*21>=580 and dis+enemy_xspeedEX*21<=600))and
	(ey+enemy_yspeed*31+(31*(30*m_gs))/2)<=80 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=166) and get_skill_lv(0,0)>=0 and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
			print("dis=",dis,"コマンド：螺光歩C");
			lvr214(ACT_C);
--２１４。烈虹拳。コンボ用
--２２。天龍脚

--対空４Ａ
	elseif y==0 and ey>0 and enemy_obj_range_in(150,60)==false and my_act<=10 and not(enemy_act>=97 and enemy_act<=98) and not(enemy_act>=197 and enemy_act<=199) and is_dir_front==true and
	((not(enemy_act>=50 and enemy_act<=166)and math.random(1+5)==1) or (enemy_act>=50 and enemy_act<=166)) and
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*9		<=	110+30 	and
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*9		>=	20-30 	and
				(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	-	(y+my_yspeed*9+(9*(8*m_gs))/2)	<=	140 		and
				(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	-	(y+my_yspeed*9+(9*(8*m_gs))/2)	>=	60-120 	and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("対空4Ａ");
		key_event2(ACT_A,back);
--対空9HJ>JＡ:14F それなりに機能する。対地上りJAも兼ねる。
	elseif y==0 and 
	(ey>0 or
		(
			(enemy_char~=19 and (enemy_act==0 or (enemy_act>=5 and enemy_act<=10) or (enemy_act>=150 and enemy_act<=153) or (enemy_act>=159 and enemy_act<=162))
			) or
			(enemy_char==19 and ((enemy_act>=1 and enemy_act<=3) or (enemy_act>=154 and enemy_act<=157) or (enemy_act>=163 and enemy_act<=166))
			)
		)
	) and 
	enemy_obj_range_in(150,60)==false and
	my_act<=10 and 
	not(enemy_act>=97 and enemy_act<=98) and 
	not(enemy_act>=197 and enemy_act<=199) and 
	is_dir_front==true and
	(
		(not(enemy_act>=50 and enemy_act<=166)) or (enemy_act>=50 and enemy_act<=166)
	) and 
	subs_count>=530 and nega_count ~= 1 and math.random(4)==1 and 
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*15		<=	170+30 	and
				--(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*15		>=	80-30 	and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+my_yspeed*15+(15*(14*m_gs))/2)	<=	150 		and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+my_yspeed*15+(15*(14*m_gs))/2)	>=	110-120 	then
		print("対空9HJ>JＡ");
		key_event2(ACT_D,u_front)
		key_reset()
		wait(2)
		key_event(ACT_A);--]]
--対空8HJ>JＡ:14F
	elseif y==0 and 
	(ey>0 or
		(
			(enemy_char~=19 and (enemy_act==0 or (enemy_act>=5 and enemy_act<=10) or (enemy_act>=150 and enemy_act<=153) or (enemy_act>=159 and enemy_act<=162))
			) or
			(enemy_char==19 and ((enemy_act>=1 and enemy_act<=3) or (enemy_act>=154 and enemy_act<=157) or (enemy_act>=163 and enemy_act<=166))
			)
		)
	) and 
	enemy_obj_range_in(150,60)==false and
	my_act<=10 and 
	not(enemy_act>=97 and enemy_act<=98) and 
	not(enemy_act>=197 and enemy_act<=199) and 
	is_dir_front==true and
	(
		(not(enemy_act>=50 and enemy_act<=166)) or (enemy_act>=50 and enemy_act<=166)
	) and 
	subs_count>=530 and nega_count ~= 1 and math.random(4)==1 and 
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*15		<=	50+30 	and
				--(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*15		>=	-40-30 	and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+my_yspeed*15+(15*(14*m_gs))/2)	<=	181 		and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+my_yspeed*15+(15*(14*m_gs))/2)	>=	121-120 	then
		print("対空8HJ>JＡ");
		key_event2(ACT_D,ACT_UP)
		key_reset()
		wait(2)
		key_event(ACT_A);--]]
--ダッシュ＞4Ａ
	elseif dis<=180 and my_act==200 and my_allframe>=10 and ey==0 and enemy_obj_range_in(150,60)==false and not(enemy_act>=97 and enemy_act<=98) and not(enemy_act>=197 and enemy_act<=199) and is_dir_front==true and 
	((not(enemy_act>=50 and enemy_act<=166)and math.random(5)==1) or (enemy_act>=50 and enemy_act<=166)) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("ダッシュ４Ａ");
		key_event2(ACT_A,back);
--ダッシュ＞２Ａ
	elseif dis<=180 and my_act==200 and my_allframe>=10 and ey==0 and enemy_obj_range_in(150,60)==false and not(enemy_act>=97 and enemy_act<=98) and not(enemy_act>=197 and enemy_act<=199) and is_dir_front==true and 
	((not(enemy_act>=50 and enemy_act<=166)and math.random(5)==1) or (enemy_act>=50 and enemy_act<=166)) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("ダッシュ２Ａ");
		key_event2(ACT_A,ACT_DOWN);
--刻み4Ａ
	elseif (dis<=120 or (dis<=180 and my_xspeed>0)) and my_act==330 and ey==0 and my_hitstop<=3 and my_hitstop>=1 and enemy_obj_range_in(150,60)==false and 
	((enemy_act>=143 and enemy_act<=166) or (enemy_act>=50 and enemy_act<=89 and math.random(3)<=2)) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("刻み４Ａ");
		key_event2(ACT_A,back);
		wait(3);
--刻み２Ａ
	elseif (dis<=120 or (dis<=180 and my_xspeed>0)) and my_act==303 and ey==0 and my_hitstop<=3 and my_hitstop>=1 and enemy_obj_range_in(150,60)==false and 
	((enemy_act>=143 and enemy_act<=166) or (enemy_act>=50 and enemy_act<=89 and math.random(3)<=2)) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("刻み２Ａ");
		key_event2(ACT_A,ACT_DOWN);
		wait(3);
		
--近Ａ。大抵は遠Ａになる。相手がほぼ何もしていない時のみに振る。
	elseif y==0 and my_act<300 and dis<=120 and ey<=150 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=199) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("近A");
		key_resetEX();
		key_event(ACT_A);
--２Ａ。条件の設定上、ひたすら連打。確立で、６Ａ、３Ａに分岐。
	elseif y==0 and (my_act<=10 or my_act==303) and my_frame>=8 and dis<=120 and ey<=50 and enemy_obj_range_in(150,60)==false and not(enemy_act>=180 and enemy_act<=199) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("2A");
		key_resetEX();
		key_event2(ACT_A,ACT_DOWN);
--４Ａ。命令の優先順位上、実質低空にいる相手への打撃となる。
	elseif y==0 and (my_act<=10 or my_act==330) and my_frame>=8 and dis<=120 and ey<=100 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=199) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("4A");
		key_event2(ACT_A,back);
--遠Ａ。大抵は遠Ａになる。相手がほぼ何もしていない時のみに振る。
	elseif y==0 and my_act<300 and dis>=180 and dis<=200 and ey<=150 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=199) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("遠A");
		key_resetEX();
		key_event(ACT_A);
--６Ｃ。遠距離からおもむろに出す。確立で振る
	elseif y==0 and my_act<300 and dis>400 and enemy_obj_range_in(150,60)==false and not(enemy_act>=50 and enemy_act<107) and not(enemy_act>=180 and enemy_act<=199) and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		print("6C");
		key_resetEX();
		yield();
		key_event2(ACT_C,front);
--]]
--中距離以上からの８ｈｊ
	elseif move_8hjattakeovermidrange_condi()==true then
		print("中距離以上で８ＨＪ");
		key_event2(ACT_D,ACT_UP);
--中距離からのダッシュ
	elseif move_6dattakeovermidrange_condi()==true then
		print("ダッシュ接近");
		key_event2(ACT_D,front);
--低空飛翔で接近
	elseif move_approachbylowflaying_condi()==true then
		move_approachbylowflaying_exe()
--８８３飛翔
	elseif move_approachby883d_condi()==true then
		move_approachby883d_exe()
--▼ 終端運動
--▼ 相手上空へ飛び上がった際の処理
	elseif move_attakeoverhead_condi()==true then
		move_attakeoverhead_exe()
--▼ 終端機動
	--▼ 対台風時
	elseif move_terminationtaihu_condi()==true then
		move_terminationtaihu_exe()
	--▼ 終端機動1
	--台風じゃない時だが…
	elseif move_termination1_condi()==true then
		move_termination1_exe()
	--▼ 終端機動2
	--ただ動く事で自律性を錯覚させる事が目的の機動。静止やラインの設定に大きな根拠はない。
	--霊力が一定の評価を下回った場合、実行しない。
	elseif move_termination2_condi()==true then
		move_termination2_exe()
	end
	
	yield()
end
end