--魂魄妖夢用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始動
--A>AA
	elseif my_act==300 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 then
		print("A>AA",dis);
		key_event(ACT_A);
	--AA>AAA
			elseif my_act==320 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 then
				print("AA>AAA",dis);
				key_event(ACT_A);
				
			--AAA>スペカ
				elseif my_act==321 and enemy_act>=50 and enemy_act<=89 and card_check(203) and my_spell_more(2500) then
					while my_allframe<=10 and my_card~=203 do
						card_1st(203);
						yield();
					end
					if my_hitstop<=3 and my_hitstop>=1 and my_card==203 then
						print("コンボ：ＡＡＡ＞人鬼「未来永劫斬」");
						key_event(ACT_BC);
					end
				elseif my_act==321 and enemy_act>=50 and enemy_act<=89 and card_check(212) and my_spell_more(1500) then
					while my_allframe<=10 and my_card~=212 do
						card_1st(212);
						yield();
					end
					if my_hitstop<=3 and my_hitstop>=1 and my_card==212 then
						print("コンボ：ＡＡＡ＞転生剣「円心流転斬」");
						key_event(ACT_BC);
					end
				elseif my_act==321 and enemy_act>=50 and enemy_act<=89 and card_check(201) and my_spell_more(1500) then
					while my_allframe<=10 and my_card~=201 do
						card_1st(201);
						yield();
					end
					if my_hitstop<=3 and my_hitstop>=1 and my_card==201 then
						print("コンボ：ＡＡＡ＞断命剣「冥想斬」");
						key_event(ACT_BC);
					end
					
		--AAA>6A>6C>etc
				elseif my_act==321 and ((enemy_act>=50 and enemy_act<=89 and my_frontside>=240 and my_frontside<=640) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 then
					print("AAA>6A",dis);
					key_event2(ACT_A,front);
				--6A>断迷剣「迷津慈航斬」
					elseif my_act==302 and enemy_act>=50 and enemy_act<=89 and my_limit<100 and my_frontside<=450 and enemy_backside>=200 and card_check(204)==true and my_spell_more(2000) then
						card_1st(204);
						if enemy_hitstop<=3 and enemy_hitstop>=2 and my_card==204 then
							print("6A>スペルカード：断迷剣「迷津慈航斬」");
							key_event(ACT_BC);
						end
				--6A>6C
					elseif my_act==302 and enemy_act>=50 and enemy_act<=89 and my_hitstop<=2 and my_hitstop>=1 and my_limit<100 and my_frontside>=240 and my_frontside<=640 and my_rei>=200 then
						print("6A>6C",dis);
						key_event2(ACT_C,front);
						elseif my_act==411 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_allframe>=39 and my_limit<100 then
							key_resetEX();
							key_event(u_front);
					--6C>JA>J6A
						elseif my_act==209 and my_preact[1]==411 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_allframe>=3 and my_limit<100 then
							print("6C>JA",dis);
							key_event(ACT_A);
							elseif my_act==306 and enemy_act>=50 and enemy_act<=89 and my_hitstop<=2 and my_hitstop>=1 and my_limit<100 and my_combo>=5 then
								print("JA>J6A",dis);
								key_event2(ACT_A,front);
					--6C>憑坐の縛
						elseif my_act==411 and (enemy_act>=50 and enemy_act<=89) and my_allframe>=25-5 and my_limit<100 and card_check(103) then
							card_1st(103);
							if enemy_frame<=1 then
								print("6C>スキルカード：憑坐の縛",dis);
								card_use(103);
							end
						elseif my_act==411 and (enemy_act>=50 and enemy_act<=89) and my_allframe>=25-5 and my_limit<100 and get_skill_lv(0,3)>=0 and my_rei>=200 and enemy_frame<=1 then
							print("6C>コマンド：B憑坐の縛",dis);
							key_resetEX();
							yield();
							lvr22(ACT_B);
							wait(2);
		--AAA>AAAA
				elseif my_act==321 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=2 and my_hitstop>=1 and my_limit<100 then
					print("AAA>AAAA",dis);
					key_event(ACT_A);
					
			--AAAA>スペカ
					elseif my_act==322 and enemy_act>=50 and enemy_act<=89 and card_check(207) and my_spell_more(2000) then
						while my_allframe<=10 and my_card~=207 do
							card_1st(207);
							yield();
						end
						if my_hitstop<=3 and my_hitstop>=1 and my_card==207 then
							print("コンボ：ＡＡＡA＞断霊剣「成仏得脱斬」");
							key_event(ACT_BC);
						end
					elseif my_act==322 and enemy_act>=50 and enemy_act<=89 and card_check(204) and my_spell_more(2000) then
						while my_allframe<=10 and my_card~=204 do
							card_1st(204);
							yield();
						end
						if my_hitstop<=3 and my_hitstop>=1 and my_card==204 then
							print("コンボ：ＡＡＡA＞断迷剣「迷津慈航斬」");
							key_event(ACT_BC);
						end
						
			--AAAA>生死流転斬3hit
					elseif my_act==322 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166 and my_frontside<=300)) and my_limit<100 and card_check(102) and ((card_check(200) and my_spell_more(2000)==false) or card_check(200)==false) then
						card_1st(102);
						if enemy_hitstop<=3 and enemy_hitstop>=1 then
							if my_hitstop>=1 then
								wait(my_hitstop)
							end
							wait(5);
							print("AAAA＞スキルカード：生死流転斬");
							card_use(102);
						end
					elseif my_act==322 and get_skill_lv(0,2)>=0 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and enemy_hitstop<=8 and enemy_hitstop>=1 and my_rei>=200 and ((card_check(200) and my_spell_more(2000)==false) or card_check(200)==false) then
						print("AAAA＞コマンド：C生死流転斬");
						key_resetEX();
						yield();
						lvr214(ACT_C);
						if my_hitstop>=1 then
							wait(my_hitstop)
						end
					elseif my_act>=540 and my_act<=544 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and enemy_hitstop<=8 and enemy_hitstop>=7 then
						print("生死流転斬>生死流転斬：派生");
						key_resetEX();
						wait(15);
						lvr214(ACT_B);
						if my_hitstop>=1 then
							wait(my_hitstop)
						end--]]
			--AAAA>AAAAA
					elseif my_act==322 and enemy_act>=50 and enemy_act<=89 and my_hitstop<=2 and my_hitstop>=1 and my_limit<100 then
						print("AAAA>AAAAA",dis);
						key_event(ACT_A);
						
					--AAAAA>スペカ
						elseif my_act==323 and enemy_act>=50 and enemy_act<=89 and card_check(200) and my_spell_more(1000) then
							while my_allframe<=10 and my_card~=200 do
								card_1st(200);
								yield();
							end
							if my_allframe>=49 and my_card==200 then
								print("コンボ：ＡＡＡAA＞（ディレイ）人符「現世斬」");
								key_event(ACT_BC);
							end
							
			--AAAAA>etc
					elseif my_act==323 and enemy_act>=50 and enemy_act<=89 and my_allframe>=50-5 and my_limit<100 and my_frontside<=280 and my_rei>=200 then
						print("AAAAA>DA",dis);
						key_reset();
						key_on(front);
						key_on(ACT_D);
						wait(11);
						key_event(ACT_A);
						yield();key_resetEX();
						elseif my_act==305 and (enemy_act>=50 and enemy_act<=89) and my_limit<100 and card_check(101) and ey>0 then
							card_1st(101);
							if enemy_hitstop<=3 and enemy_hitstop>=2 then
								if my_hitstop>=1 then
									wait(my_hitstop+10)
								end
								print("DA＞スキルカード：弦月斬");
								card_use(101);
							end
						elseif my_act==305 and (enemy_act>=50 and enemy_act<=89) and my_limit<100 and enemy_hitstop<=6 and enemy_hitstop>=5 and get_skill_lv(0,1)>=0 and ((my_dir==1 and x>=1000)or(my_dir==-1 and x<=280)) and my_rei>=200 and ey>0 then
							print("DA＞コマンド：C弦月斬");
							key_resetEX();
							if my_hitstop>=1 then
								wait(my_hitstop+10)
							end
							lvr623(ACT_C);
		
--遠A>6A
	elseif my_act==301 and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166 and math.random(3)<=2)) then
		print("遠A＞6A");
		key_event2(ACT_A,front);
--遠A>3A
	elseif my_act==301 and (enemy_act>=143 and enemy_act<=166) and dis<=200 and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true then
		print("遠A＞3A");
		key_event2(ACT_A,d_front);
		
--6A>6B
	elseif my_act==302 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and my_rei>=200 and math.random(5)==1 then
		print("6Ａ＞6B");
		key_event2(ACT_B,front);
--6A>6B
	elseif my_act==304 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and my_rei>=200 and math.random(5)==1 then
		print("3Ａ＞6B");
		key_event2(ACT_B,front);
--A>6B
	elseif ey==0 and (my_act==300 or my_act==330) and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and my_rei>=200 and math.random(5)==1 then
		print("コンボ：Ａ＞6B");
		key_event2(ACT_B,front);
--AA>6B
		elseif ey==0 and my_act==320 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and my_rei>=200 and math.random(5)==1 then
		print("AA>6B",dis);
		key_event2(ACT_B,front);
			
--6A>2C
	elseif my_act==302 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and my_frontside<=340 and my_rei>=200 and math.random(5)==1 then
		print("6Ａ＞2C");
		key_event2(ACT_C,ACT_DOWN);
--3A>2C
	elseif my_act==304 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and my_frontside<=340 and my_rei>=200 and math.random(5)==1 then
		print("3Ａ＞2C");
		key_event2(ACT_C,ACT_DOWN);
--A>2C
	elseif ey==0 and (my_act==300 or my_act==330) and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and is_dir_front==true and my_frontside<=340 and my_rei>=200 and math.random(5)==1 then
		print("コンボ：Ａ＞2C");
		key_event2(ACT_C,ACT_DOWN);
--AA>2C
		elseif ey==0 and my_act==320 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and my_frontside<=340 and my_rei>=200 and math.random(5)==1 then
		print("AA>2C",dis);
		key_event2(ACT_C,ACT_DOWN);
		
--6A>縛
	elseif my_act==302 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=6 and my_hitstop>=5 and is_dir_front==true and my_rei>=400 and get_skill_lv(0,3)>=0 and math.random(5)==1 then
		print("6Ａ＞縛");
		lvr22(ACT_B);
		yield();
--3A>縛
	elseif my_act==304 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=6 and my_hitstop>=5 and is_dir_front==true and my_rei>=400 and get_skill_lv(0,3)>=0 and math.random(5)==1 then
		print("3Ａ＞縛");
		lvr22(ACT_B);
		yield();
--A>縛
	elseif ey==0 and (my_act==300 or my_act==330) and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=6 and my_hitstop>=5 and is_dir_front==true and my_rei>=400 and get_skill_lv(0,3)>=0 and math.random(5)==1 then
		print("コンボ：Ａ＞縛");
		lvr22(ACT_B);
		yield();
--AA>縛
		elseif ey==0 and my_act==320 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=6 and my_hitstop>=5 and my_rei>=400 and get_skill_lv(0,3)>=0 and math.random(5)==1 then
		print("AA>縛",dis);
		lvr22(ACT_B);
		yield();
			
--AA>6A
		elseif my_act==320 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and math.random(5)==1 then
			print("AA>6A",dis);
			key_event2(ACT_A,front);
--AA>3A
		elseif my_act==320 and dis<=200 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and math.random(5)==1 then
			print("AA>3A",dis);
			key_event2(ACT_A,d_front);
--2A>6A
		elseif my_act==303 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and math.random(5)==1 then
			print("2A>6A",dis);
			key_event2(ACT_A,front);
			if my_hitstop>=1 then
				wait(my_hitstop)
			end
--2A>3A
		elseif my_act==303 and dis<=200 and enemy_act>=143 and enemy_act<=166 and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and math.random(5)==1 then
			print("2A>3A",dis);
			key_event2(ACT_A,d_front);
			if my_hitstop>=1 then
				wait(my_hitstop)
			end
--遠2A>6A
		elseif my_act==311 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and math.random(5)==1 then
			print("2A>6A",dis);
			key_event2(ACT_A,front);
			if my_hitstop>=1 then
				wait(my_hitstop)
			end
--遠2A>3A
		elseif my_act==311 and dis<=200 and (enemy_act>=143 and enemy_act<=166) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and math.random(5)==1 then
			print("2A>3A",dis);
			key_event2(ACT_A,d_front);
			if my_hitstop>=1 then
				wait(my_hitstop)
			end

--JA>J6A
	elseif my_act==306 and ((ey==0 and my_yspeed>=5)or(ey>0)) and ey<=y+0 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 then
		print("JA>J6A",dis);
		key_event2(ACT_A,front);
--JA>J8A
	elseif my_act==306 and ((ey==0 and my_yspeed>=5)or(ey>0)) and ey>=y+0 and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 then
		print("JA>J8A",dis);
		key_event2(ACT_A,ACT_UP);
	--J6A or J8A>J6C
		elseif my_act==307 and ((ey==0 and my_yspeed>=5)or(ey>0)) and enemy_act>=50 and enemy_act<=89 and my_frontside<=640 and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and my_rei>=200 then
			print("JA/J8A>J6C",dis);
			key_event2(ACT_C,front);
		elseif my_act==309 and ((ey==0 and my_yspeed>=5)or(ey>0)) and ((enemy_act>=50 and enemy_act<=89) or (enemy_act>=143 and enemy_act<=166 and math.random(2)==1)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and my_rei>=200 then
			print("JA/J8A>J6C",dis);
			key_event2(ACT_C,front);
	--J6A or J8A>JB
		elseif (my_act==307 or my_act==309) and ((enemy_act>=50 and enemy_act<=89 and ((my_dir==1 and x<=640)or(my_dir==-1 and x>=640)))or(enemy_act>=143 and enemy_act<=166)) and my_hitstop<=3 and my_hitstop>=2 and my_limit<100 and my_rei>=200 then
			print("JA/J8A>JB",dis);
			key_event2(ACT_B,front);
			
--色んなところから燐気斬
	elseif (my_act==302 or my_act==304 or my_act==305) and (enemy_act>=143 and enemy_act<=166) and card_check(108) then
		card_1st(108);
		if enemy_hitstop<=3 and enemy_hitstop>=2 then
			print("攻撃＞スキルカード：燐気斬");
			card_use(108);
		end
	elseif (my_act==302 or my_act==304 or my_act==305) and (enemy_act>=143 and enemy_act<=166) and get_skill_lv(0,8)>=0 and enemy_hitstop<=8 and enemy_hitstop>=1 and my_rei>=400 then
		print("攻撃＞コマンド：B燐気斬");
		key_resetEX(); key_on(ACT_D); yield(); key_resetEX();
		lvr236(ACT_B);
		if my_hitstop>=6 then
			wait(my_hitstop-5)
		end
--2A>弦月斬
	elseif ey==0 and my_act==303 and my_combo>=3 and (enemy_act>=50 and enemy_act<=89) and get_skill_lv(0,1)>=0 and enemy_hitstop<=8 and enemy_hitstop>=1 and my_rei>=400 then
		print("２A>コマンド：C弦月斬");
		lvr623(ACT_C);
		if my_hitstop>=6 then
			wait(my_hitstop-5)
		end
--DA>弦月斬
	elseif (my_act==303 or my_act==305 or my_act==330) and (enemy_act>=50 and enemy_act<=89) and card_check(101) then
		card_1st(101);
		if enemy_hitstop<=3 and enemy_hitstop>=2 then
			print("DA>スキルカード：弦月斬");
			card_use(101);
		end
	elseif ey==0 and (dis<=120 or enemy_backside<=100) and my_act==305 and (enemy_act>=50 and enemy_act<=89) and get_skill_lv(0,1)>=0 and enemy_hitstop<=8 and enemy_hitstop>=1 and my_rei>=400 then
		print("DA>コマンド：C弦月斬");
		lvr623(ACT_C);
		if my_hitstop>=6 then
			wait(my_hitstop-5)
		end
	elseif ey>0 and my_act==305 and (enemy_act>=50 and enemy_act<=89) and get_skill_lv(0,1)>=0 and enemy_hitstop<=8 and enemy_hitstop>=1 and my_rei>=400 then
		print("DA>コマンド：B弦月斬");
		lvr623(ACT_B);
		if my_hitstop>=6 then
			wait(my_hitstop-5)
		end
--JB着地硬直>6C
	elseif ((my_act==10 and my_preact[1]==404) and my_act==404) and y+my_yspeed*2<=0 and my_rei>=400 and (is_dir_front==false or (is_dir_front==true and dis<=60)) then
		print("JB>6C",dis);
		--key_event2(ACT_C,ACT_DOWN);
		key_event2(ACT_C,front);

			
		--]]
	
--▼コンボ・固め兼用▼

--▼攻撃▼

--▼spell card▼

--▼cost2

--人符「現世斬」,200,600,g
	--Ground
	elseif card_check(200)==true and
	my_spell_more(1000) and
	dis<500 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(200);
			yield()
		end

--魂符「幽明の苦輪」,202,602,g
	--Ground
	elseif card_check(202)==true and
	my_spell_more(1000) and
	--dis<320 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(202);
			yield()
		end

--▼cost3

--断命剣「冥想斬」,201,601,g
	--Ground
	elseif card_check(201)==true and
	my_spell_more(1500) and
	dis<400 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(201);
			yield()
		end

--剣伎「桜花閃々」,206,606,g
	--Ground
	elseif card_check(206)==true and
	my_spell_more(1500) and
	dis<300 and
	y==0 and
	dis_y<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(206);
			yield()
		end

--転生剣「円心流転斬」,212,612,g
	--Ground
	elseif card_check(212)==true and
	my_spell_more(1500) and
	dis<300 and
	y==0 and
	dis_y<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(212);
			yield()
		end

--▼cost4

--断迷剣「迷津慈航斬」,204,604,g
	--Ground
	elseif card_check(204)==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(204);
			yield()
		end

--断霊剣「成仏得脱斬」,207,607,g
	--Ground
	elseif card_check(207)==true and
	my_spell_more(2000) and
	dis<400 and
	y==0 and
	--dis_y<50 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(207);
			yield()
		end

--▼cost5

--人鬼「未来永劫斬」,203,603,g
	--Ground
	elseif card_check(203)==true and
	my_spell_more(2500) and
	dis<600 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(203);
			yield()
		end

--魂魄「幽明求聞持聡明の法」,205,605,g
	--Ground
	elseif card_check(205)==true and
	my_spell_more(2500) and
	--dis<250 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(205);
			yield()
		end

--空観剣「六根清浄斬」,208,608,g
	--Ground
	elseif card_check(208)==true and
	my_spell_more(2500) and
	dis<250 and
	y==0 and
	ey<100 and
	enemy_yspeed<=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("空観剣「六根清浄斬」");
		for i=1,10 do
			card_use(208);
			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);
--]]
			
--▼攻撃▼
--空中行動
--ＪＡ
	elseif	y>0 and 
	not(my_act>=50 and my_act<180) and my_act~=200 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(2)==1 and
	(y+my_yspeed*9+(9*(8*m_gs))/2)>0 	and
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*9		<=	75+30+20 	and
				--(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*9		>=	15-30 	and
				(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	-	(y+my_yspeed*9+(9*(8*m_gs))/2)	<=	100+20 		and
				(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	-	(y+my_yspeed*9+(9*(8*m_gs))/2)	>=	40-180 	then
					print("JA",my_act,my_allframe,math.floor(y*10)/10);
					key_resetEX();
					key_event(ACT_A);
			
--Ｊ８Ａ
	elseif	y>0 and 
	not(my_act>=50 and my_act<180) and my_act~=200 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(2)==1 and
	(y+my_yspeed*8+(8*(7*m_gs))/2)>0 	and
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*8		<=	120+30 	and
				(ex-x)*my_dir-(my_xspeedEX+enemy_xspeedEX)*8		>=	10-30 	and
				(ey+enemy_yspeed*8+(8*(7*e_gs))/2)	-	(y+my_yspeed*8+(8*(7*m_gs))/2)	<=	270+100 		and
				(ey+enemy_yspeed*8+(8*(7*e_gs))/2)	-	(y+my_yspeed*8+(8*(7*m_gs))/2)	>=	110-40 	then
					print("Ｊ８Ａ");
					key_resetEX();
					key_event2(ACT_A,ACT_UP);
--J6A(着地用
	elseif dis<=300 and y<=20 and ey<=50 and my_act>=208 and my_act<=212 and my_allframe>=4 and my_allframe<=5 and math.random(4)==1 then
		print("最低空J6A");
		key_event2(ACT_A,front);
--J2A(着地用
	elseif dis<=300 and y<=20 and ey<=50 and my_act>=208 and my_act<=212 and my_allframe>=4 and my_allframe<=5 and math.random(4)==1 then
		print("最低空J2A");
		key_event2(ACT_A,ACT_DOWN);


--対空４Ａ
	elseif y==0 and 
	ey>0 and 
	not(my_act>=50 and my_act<180) and my_act~=200 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(2)==1 and
			(ex-x)*my_dir	-	(enemy_xspeedEX)*9		<=	100+30 	and
			(ex-x)*my_dir	-	(enemy_xspeedEX)*9		>=	20-30 	and
			(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	<=	140 		and
			(ey+enemy_yspeed*9+(9*(8*e_gs))/2)	>=	60-180 then
		print("対空4Ａ");
		key_event2(ACT_A,back);
--対空9HJ>JＡ
	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 
	not(my_act>=50 and my_act<180) and my_act~=200 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(4)==1 and
				(ex-x)*my_dir	-	(14*9+enemy_xspeedEX*15)		<=	75+30 	and
				(ex-x)*my_dir	-	(14*9+enemy_xspeedEX*15)		>=	15-30 	and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+17*9+(9*(8*0.75))/2)	<=	100 		and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+17*9+(9*(8*0.75))/2)	>=	40-180 	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 
	not(my_act>=50 and my_act<180) and my_act~=200 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(4)==1 and
				(ex-x)*my_dir	-	(enemy_xspeedEX*15)		<=	75+30 	and
				(ex-x)*my_dir	-	(enemy_xspeedEX*15)		>=	15-30 	and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+20*9+(9*(8*0.75))/2)	<=	100 		and
				(ey+enemy_yspeed*15+(15*(14*e_gs))/2)	-	(y+20*9+(9*(8*0.75))/2)	>=	40-180 	then
		print("対空8HJ>JＡ");
		key_event2(ACT_D,ACT_UP)
		key_reset()
		wait(2)
		key_event(ACT_A);--]]
--ダッシュ＞２Ａ
	elseif dis<=120 and (my_act==200 or (my_act<=10 and dis<=80)) 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 subs_count>=530 and nega_count ~= 1 and math.random(4)==1 and 
	((not(enemy_act>=50 and enemy_act<=166)) or (enemy_act>=50 and enemy_act<=166)) then
		--print("刻み２Ａ始動");
		key_event2(ACT_A,ACT_DOWN);
--刻み２Ａ
	elseif (dis<=120) 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 and math.random(3)<=2) or (enemy_act>=50 and enemy_act<=89)) and 
	subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		--print("刻み２Ａ");
		key_event2(ACT_A,ACT_DOWN);
		wait(3);
--Ａ
	elseif dis<=160 and 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 subs_count>=530 and nega_count ~= 1 and math.random(4)==1 and
	((not(enemy_act>=50 and enemy_act<=166 and math.random(1+5)==1 )) or (enemy_act>=50 and enemy_act<=166)) then
		--print("Ａ");
		key_event(ACT_A);
--ＤＡ
	elseif dis<=250 and dis>=150 and 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 subs_count>=530 and nega_count ~= 1 and math.random(4)==1 and
	((not(enemy_act>=50 and enemy_act<=166)) or (enemy_act>=50 and enemy_act<=166)) then
		--print("ＤＡ");
		key_on(front);
		key_event2(ACT_D,ACT_A);
--6Ｂ
	elseif dis>300 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 subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		--print("6Ｂ");
		key_event2(ACT_B,front);
--憑坐の縛、奇び半身
	elseif dis>400 and y==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 subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		--print("22コマンド");
		lvr22(ACT_C);
		yield();
--2C
	elseif dis<=400 and y==0 and 
	enemy_obj_range_in(150,60)==false and my_act<=200 and not(enemy_act>=97 and enemy_act<=98) and not(enemy_act>=197 and enemy_act<=199) and 
	is_dir_front==false and subs_count>=530 and nega_count ~= 1 and math.random(4)==1 then
		--print("2C");
		key_event2(ACT_C,ACT_DOWN);
--]]
--中距離以上からの８ｈｊ
	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