local t = {};

local chrFunc = {};

chrFunc.DragonInstall <- false;

const CDef_Rie_PP_DragonInstall = 0;
const CDef_Rie_PP_InstallLimit = 0;
const CDef_Rie_PP_PlayerSide = 0;
const CDef_Rie_PP_InstallTimer = 800;

const Installed = 0;
const InstallTimer = 1000;

local Install = {};

Install.Timer <- function()
{
	local timeLeft = BMvTbl.GetPP(InstallTimer);
	BMvEff.AttackInfoString_Set({ word = timeLeft });
}

t.DamageImpact <- function(info) : (chrFunc)
{
	if ( BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1 )
	{
		//Battle_Std.MoveCodeEx.AddFlag( 2, def_MC2_CounterHit )
		BMvEff.SetCharaFlash( { color = 0xFF50FF, type = 0, time = 10 } );
		BMvEff.SetCharaColor( { color = 0x0000FF, type = 0, intime = 60, time = 90 } );
		BMvTbl.SetPP(CDef_Rie_PP_InstallTimer, -1);
	}
	else
	{
		
	}
}


t.AttackImpact <- function(info) : (chrFunc) //t.GeneralInterrupt
{

	Battle_Std.AttackImpact_StdFunc(info);
	local Guard = ((info.flags&_ImpactFlag_IsGuard)!=0);
	local Nage = (info.atk_throw!=0); //投げ判定かどうか
	local Yarare = (((info.flags&_ImpactFlag_IsBound)!=0)&&!Guard);
	local Capture = (((info.flags&_ImpactFlag_IsCapture)!=0 ) && !Guard );
	local Nage_Shodan = (!Capture &&Nage); // 投げのみ ※投げ初段で処理をすると、通常投げの投げ抜け待機とかも反応するよ
	local Syodan = (!Yarare); // 打撃
	local Zenbu_Shodan = (Syodan || Nage_Shodan); // 打撃でも投げで
	//BMvEff.AttackInfoString_Set({ word = Guard });

	if ( BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1 )
	{
		BMvEff.CreateObject( { mvname="Mv_Obj_BeastModeOnHit" } );
		local enemy = BMvCore.GetNearEnemyCharaData();
		if ( enemy.push() )
		{
			if(Guard)
			{
				Battle_Std.SetKezurareDamage( 50 );
			}
			BMvEff.SetCharaFlash( { color = 0xFF0000, type = 2, time = 10 } );
			BMvEff.SetCharaColor( { color = 0xFF0000, type = 0, intime = 5, time = 40 } );
			enemy.pop()
		}
		//BMvTbl.SetFinalize();
		BMvTbl.SetAsStatusFlag( { normal=_CancelFlag_Always, special=_CancelFlag_Always, time=254, flag	=_ClearFlag_ChangeFrame|_ClearFlag_ChangePattern|_ClearFlag_ChangeMv } )
		//Battle_Std.MoveCode.AddFlag(def_MC_EnableCansel_SkilltoSkill); // Way too busted
		//Battle_Std.MoveCode.AddFlag(def_MC_EnableCansel_SkilltoAtk); // I'd allow this if EX moves weren't included
		Battle_Std.MoveCode.AddFlag(def_MC_EnableCansel_SkilltoJump); // That's all I can do
		Battle_Std.GRD_AddValue( { val=-150 } );
		//BMvTbl.SetFinalizeCode(0); 
	}
	else
	{
		
	}

	local mvs = BMvTbl.GetMvStatus();
	local ret_frameid = mvs.FrameID;
	
	
	//BMvEff.AttackInfoString_Set({ word = BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) });
	//BMvEff.AttackInfoString_Set({ word = BMvTbl.GetMvStatus().MvCountFrame });
	
}

t.Mv_Obj_BeastModeOnHit <-
{
	function Init_After()
	{
		//Battle_Std.ComboPoint_Multi(150);
		local enemy = BMvCore.GetEnemyCharaData();
		if( enemy.push() )
		{
			BMvEff.SetBoundSt( { addtime = 8 } );
			//BMvTbl.SetLP(6,1000);
			enemy.pop();
		}
		local player = BMvCore.GetPlayerCharaData();
		if (player.push() )
		{
			Battle_Std.MoveCode.AddFlag(def_MC_EnableCansel_SkilltoJump);
			player.pop();
		}
	}
}

t.Mv_Neutral <-
{
	function FrameUpdate_After()
	{
		local s = BMvTbl.GetMvStatus();
		if ( (s.FrameID == 10) && (s.MvCount >= 200) && (BMvEff.Random_Limit(90) == 1) )
		{
			BMvTbl.JumpFrameID( 20 );
		}
	}
}

t.Mv_Walk_F <-
{
	function FrameUpdate_After()
	{	
		BMvTbl.SetVector( { x=1000, y=0, addx=0, addy=0, flags=_Vector_Normal } );
	}
}

t.Mv_Walk_B <-
{
	function FrameUpdate_After()
	{	
		BMvTbl.SetVector( { x=-880, y=0, addx=0, addy=0, flags=_Vector_Normal } );
	}
}

t.Mv_Dash_F <-
{
	function FrameUpdate_After()
	{
		local di = (BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1)? 1 : 0;
		if(di) { BMvTbl.SetVector( { x=5000, flags=_Vector_Normal } ); }
	}	
}

t.Mv_Dash_B <-
{
	function FrameUpdate_After()
	{
		local di = (BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1)? 1 : 0;
		if(di)
		{
			switch( Battle_Std.GetUpdateFrameID() )
			{
			case 10:
				BMvTbl.SetVector( { x=-4000, flags=_Vector_Normal});
				break;
			}
		}
	}	
}

		//BMvTbl.SetLP(0,0); // どの派生にいったかどうか
		//BMvTbl.SetLP(1,0); // C派生の攻撃回数
		//BMvTbl.SetLP(2,0); // 攻撃回数　追加タイミングの検知やヒットエフェクトの見た目など色々使用
		//BMvTbl.SetLP(3,-1); // どの派生を出すか　子からボタン番号が入る -1:乱打ヒットしてない 0:ヒットしてる 1〜ボタン




// Allows for l/r movement when neutral jumping! stolen from elt
local set_JumpCtrlVector = function()
{
	local vec = BMvTbl.GetVector();
	
	if( (vec.y + vec.addy ) >= 0 )
	{
		//print("\n .");//23F
		return; // 下降中は失敗
	}
	
	local x = 0; //vector amount
	local plus_x = 96; //move by this every frame
	//commandだと相手方向基準か？
	if( ( BMvTbl.CheckStickHold( (1<<4) | (1<<7) | (1<<1) ) ) && vec.x > -1000 ) x -= plus_x;
	if( ( BMvTbl.CheckStickHold( (1<<6) | (1<<9) | (1<<3) ) ) && vec.x <  1000 ) x += plus_x;
	
	if( x )
	{
		vec.x += x;
		BMvTbl.SetVector( { x=vec.x, flags=_Vector_Normal } );
	}
}
t.Mv_Jump_N <- { function FrameUpdate_After() : (set_JumpCtrlVector) { set_JumpCtrlVector(); } }

t.Mv_ConvertCharge <-
{
	function FrameUpdate_After()
	{
		if ( BMvEff.GRD_GetJudgeResult() > 0 )
		{
			local player = BMvCore.GetPlayerCharaData();
			if( player.IsDone )
			{
				BMvCore.PushCharaData( player ); 
				local HP = BCMDTbl.GetHPRatio();
				local GRD = BMvEff.GRD_CheckStock( { val=-1 } );
				local distance = ( Battle_Std.GetEnemyDistance() / 10000 );
				//BMvEff.AttackInfoString_Set({ word = HP });
				local SPadd = 25 - (HP * 0.25) + (GRD * 4) + (8 - (distance * 0.45) );
				BMvEff.SetSpGauge( { value=SPadd,limitval=0.0, } );
				//BMvEff.AttackInfoString_Set({ word = SPadd});
				BMvCore.PopCharaData();
			}			
		}
	}
}



t.Mv_Startup <-
{
	function Init_After()
	{
		BMvEff.AttackInfoString_Set({ word = "brap" });
		local round = BMvTbl.GetMvRoundStatus();
		if (round.Round == 1)
		{
			local rand = BMvEff.Random_Limit(2);
			switch(rand)
			{
			case 0:
				BMvTbl.SetPattern("start1");
				break;
			case 1:
				BMvTbl.SetPattern("start2");
				break;
			}
		}
		if (round.Round >= 2)
		{
			BMvTbl.SetPattern(50);
		}
	}
	function FrameUpdate_After()
	{
		BMvEff.AttackInfoString_Set({ word = "FUCK" });
	}
}

t.Mv_Atk_Std6B <-
{
    function FrameUpdate_After()
	{
		Battle_Std.JumpFrameID_NotHoldButton({ mask=(1<<1), checkid=[200], jumpid=[202], endid=250 });
    }
	//function HitInterrupt_After() : (beastMode)
	//{
	//	beastMode( 10, 1000);
	//}
}



t.Mv_Atk_Std6C <-
{
	function FrameUpdate_After()
	{
		Battle_Std.JumpFrameID_NotHoldButton({ mask=(1<<2), checkid=100, jumpid=105, });
		local s = BMvTbl.GetMvStatus();
		if( (s.FrameID==50 ||  s.FrameID==500) && (BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1) )
		{
			BMvTbl.SetVector( { addx=10, y=-600, addy=55, flags=_Vector_Normal|_VecFlag_Add } );
		}

	}	
}



// t.Mv_Atk_StdBandC <-
// {
	// function FrameUpdate_After()
	// {
		// //Battle_Std.JumpFrameID_NotHoldButton({ mask=(1<<2), checkid=[100,200], jumpid=[101,201], endid=250 }); //ボタンホールドしてなかったらIDジャンプ
	// }	
	// function HitInterrupt()
	// {
		// BMvEff.SetSpGauge( { value=10, limitval=11.0, correct=0, mode=_SpGauge_UseBuffer } );
		// Battle_Std.EnemyGRD_Drain( 500, 0 ); // 500 equal
	// }
// }


t.Mv_Atk_StdBandC <-
{
	function Init_After()
	{
		BMvTbl.SetLP(9,0); // Common initialization as it is used in offsetting Init.
		Battle_Std.Sousai.Init( 0 ); // Is this the invul startup??????
		// BMvTbl.SetLP(4,0); // Reinforced shield
		BMvTbl.SetLP(2,0); // This LP is a switch for projectile counter
		Battle_Std.MoveCode.AddFlag( def_MC_Sousai|def_MC_Sousai_NoSubHitCount ); // Projectile Cancellation Occurs
	}
	function FrameUpdate_After()
	{
		Battle_Std.SetPattern_NotHoldButton( { ButtonMask=(1<<1)|(1<<2), CheckFrameID=100, EndFrameID=110, SetPattern="B+C_End", flags=Def_JFIDNHB_CheckAllButton } ); //flags=Def_JFIDNHB_HoldForever JumpFrameIDxxx???
		Battle_Std.SetPattern_NotHoldButton( { ButtonMask=(1<<1)|(1<<2), CheckFrameID=200, EndFrameID=210, SetPattern="B+C_Ender", flags=Def_JFIDNHB_CheckAllButton } );

		Battle_Std.Sousai.FrameUpdate( 10 ); // Invincibility time?
				
		Battle_Std.CheckSousai(); // Cancellable if sousai
		if( BMvTbl.GetLP(2)==0 && Battle_Std.MoveCode.CheckFlag( def_MC_Sousai_EnemySubSuccess ) ) // Check for projectile?
		{
			BMvTbl.SetLP(2,1); // The projectile was countered.
			
			Battle_Std.GRD_AddValue( { val=10000, boundplus=1 } );
            BMvEff.AttackInfoString_Set({ word = "Cancelable with a successful offset." });
			BMvTbl.SetAsStatusFlag( { special=_CancelFlag_Always, time=254, flag=_ClearFlag_ChangeMv } ); // Enables cancelling?
			
			// 181120 If you cancel a projectile, you will be invincible for a while.
			// Even if you cancel the first part of Seth's 236EX, you may not be able to avoid the rest.
			BMvTbl.SetHitCheckFlag( { type=0, val=_HitCheckFlag_FireBall, time=254, flag=_ClearFlag_ChangeMv } );
		}
		
		// Without this, you may fail to cancel out the shots.
		// Once you've canceled out the shots once, don't use it again. Without this, multiple shots will slip through strangely.
		if( BMvTbl.GetLP(2)==0 )
		{
			
			
				// If Param1(_paramno) is 8(_num), set head invincibility(_flag)
				// Set with FrameUpdate
				// Change to Flag format
				// 8: Head　_HitCheckFlag_Head　※It can also be a bullet lol
				// 16: Bullet　_HitCheckFlag_FireBall
				// 32: Leg　_HitCheckFlag_Legs
				// 64: Air Dive　Def_HitCheckFlag_AirDive
				// [_HitCheckFlag_Head] = "Air attack";
				// [_HitCheckFlag_Legs] = "Down attack";
				// [_HitCheckFlag_FireBall] = "Projectile";
				// [_HitCheckFlag_Legs|_HitCheckFlag_FireBall] = "Projectile & Down Attack";
				// [_HitCheckFlag_Legs|_HitCheckFlag_Head] = "Air Attack & Down Attack";
				// [_HitCheckFlag_Head|_HitCheckFlag_FireBall] = "Air Attack & Projectile";
				
			// TF this sets Param1 to Head Invincibility
			Battle_Std.SetHitMuteki( 1, 8, _HitCheckFlag_Head|_HitCheckFlag_Legs|_HitCheckFlag_FireBall ); // Param1 & 8: Bullet invincibility (changed to 16 as test(
		}
	}
	function HitInterrupt_After() // Successful hit?
	{
		local mvs = BMvTbl.GetMvStatus();
		local mvhs = Battle_Std.Sousai.HitInterrupt( { pride = def_MC1_AtkLow, noeffect=1 } );
		if( mvhs )
		{
			BMvEff.AttackInfoString_Set({ word = "TRIGGER!!!" });
			if( mvhs.isFirstUpdate )
			{
				// If the counterattack hits, the opponent will be stunned.
				// Projectiles will also stun the opponent.
				
				// BMvTbl.SetLP(0,1);
				local eff = BMvEff.CreateObject( { start_pat="eff_WagSousai", y=-200<<7 } );
				if( eff.push() )
				{
					BMvEff.SetObjectFlags( { flags=_ObjFlags_MoveTimeStopAll } );
					eff.pop();
				}
			}
		}
	}
};

t.Mv_Atk_AirBandC <-
{
	function Init_After()
	{
		BMvEff.SetCharaFlash( { color = 0x444444, time = 16 } );

	}
	function FrameUpdate_After()
	{
		 BMvTbl.SetMuki(_Direction_Auto );
	}
}

t.Mv_Throw_A <-
{
	function HitInterrupt()
	{
		local enemy = BMvCore.GetNearEnemyCharaData();
		
		local isBMCapture = false;
		if( enemy.push() )
		{
			local hs = BtlMvStd.GetBoundStatus();
			isBMCapture = ((hs.isCapture&(1<<1))!=0);
			
			enemy.pop();
		}
		BMvTbl.SetLP(0,0); //コンボ投げかどうか
		if( isBMCapture ) BMvTbl.SetLP(0,1); //コンボでの投げ
		
		Battle_Std.SetThrowHitFinalize(256); // ヒット分岐ファイナライズ
	}	
}

t.Mv_Throw_A_Hit <- 
{
	function FrameUpdate_After() // 
	{			
		local s = BMvTbl.GetMvStatus(); // ステータス取得
		
		if( s.FrameID==30 )
		{
			local jumpid = ( BMvTbl.GetLP(0)==1 )? 60 : 50; //Combo vs Raw
			BMvTbl.JumpFrameID(jumpid); //判定へ
			if ( Battle_Std.MoveCodeEx.CheckFlag( 2, def_MC2_CounterHit ) || Battle_Std.MoveCodeEx.CheckFlag( 2, def_MC2_GRDBreakAttack ) )
				{
					BMvEff.AttackInfoString_Set({ word="THROW COUNTER"});
					Battle_Std.PlayerSE_Play( 23 ); 
					Battle_Std.CreateObjectEX( { x=18000, y=-30000, datatype=1, pat=977} );
					Battle_Std.CreateObjectEX( { x=18000, y=-30000, datatype=1, pat=136} );
					// Battle_Std.CreateObjectEX( { x=18000, y=-30000, datatype=1, pat=133} );
				}
		}
		
		local di = (BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1)? 1 : 0;
		if( s.isFrameUpdate && ( s.FrameID == 50 || s.FrameID == 60 ) )
		{
			if ( (Battle_Std.MoveCodeEx.CheckFlag( 2, def_MC2_CounterHit ) || Battle_Std.MoveCodeEx.CheckFlag( 2, def_MC2_GRDBreakAttack ) ) || di )
			{
				local enemy = BMvCore.GetNearEnemyCharaData();
				{
					if( enemy.push() )
					{
						BMvEff.SetCharaFlash( { color = 0xFFF257, type = 0, time = 30 } );
						BMvEff.SetCharaColor( { color = 0xFFF257, type = 0, intime = 60, time = 60 } );
					}
				} //se 241 is good pilebukn
				enemy.pop();
				BMvEff.ThrowParam( { pattern = 324, x=120, y=-80 } );
				BMvEff.ThrowRelease( { type="斜め下MBバウンド", airrecover=0, flags=_ThrowRelease_NoGroundRecover } ); // TODO USE NEW UZUKI VECTOR
				local counter = 1;
			}
			else
			{
				BMvEff.ThrowParam( { pattern = 324, x=120, y=-80 } );
				BMvEff.ThrowRelease( { type="鋭角斜め下バウンド", flags=_ThrowRelease_NoGroundRecover|_ThrowRelease_NoAttackHit } );
				
				local enemy = BMvCore.GetNearEnemyCharaData();
				{
					if( enemy.push() )
					{
						BMvTbl.SetHitStop( 0 ); // 相手のヒットストップだけ伸ばす
						enemy.pop();
					}
				}
			}
		}
		//TODO uhhh how do we make it invuln on normal throw lol
		if ( s.FrameID==70 && Battle_Std.MoveCodeEx.CheckFlag( 2, def_MC2_CounterHit ) ) 
		{
			BMvTbl.SetVector( { addx=5, addy=20, flags=_Vector_Normal|_VecFlag_Add } );
		}
		if ( s.FrameID==70 && di )
		{
			BMvTbl.SetVector( { x=0, flags=_Vector_Normal } );
			BMvTbl.SetVector( { addy=30, flags=_Vector_Normal|_VecFlag_Add } );
		}
		
	}	
}

t.Mv_Throw_F_Hit <-
{
	function Init_After()
	{
		Battle_Std.SetThrowEnemyMuteki( 254 ); // Set invulnerability for opponents during throws
	}
	function FrameUpdate_After()
	{
		local enemy = BMvCore.GetEnemyCharaData();
		local di = (BMvTbl.GetPP(CDef_Rie_PP_DragonInstall) == 1)? 1 : 0;
		
		switch( Battle_Std.GetUpdateFrameID() )
		{
		case 100:  // Frame ID
			// // pat is ?. XY is relatve to attacker. This can be done in HA6 check TODO
            // // to rotate idk use the other thing
		    // BMvEff.ThrowParam( { pat=326, x=-320, y=-30 } );
			// //BMvTbl.SetAngle( { angle=7500 } ); //hrsets angle of attacker
			
			if( enemy.push() )
			{
				BMvTbl.SetMuki( _Direction_Auto );
				enemy.pop();
			}
			break;
		// case 200:
			// BMvEff.ThrowParam( { pat=326, x=-320, y=-30 } );
			// break;
		// case 300:
			// BMvEff.ThrowParam( { pat=326, x=-350, y=-60 } );
			// break;
		// case 400:
			// BMvEff.ThrowParam( { pat=326, x=-175, y=-300 } );
			// break;
		// case 500:
			// BMvEff.ThrowParam( { pat=326, x=-140, y=-320 } );
			// break;
		// case 600:
			// BMvEff.ThrowParam( { pat=326, x=-130, y=-330 } );
			// break;
		// case 700:
			// BMvEff.ThrowParam( { pat=326, x=0, y=-300 } );
			// break;
			
			//TODO why is there a blcok anim here?
			
		// case 800:
			// BMvEff.ThrowParam( { pat=326, x=30, y=0 } );
			// break;
		// case 900:
			// BMvEff.ThrowParam( { pat=326, x=114, y=0 } );
			// break;
		case 800:
			if ( di )
			{
				BMvEff.ThrowParam( { pattern = 324, x=120, y=-800 } );
				BMvEff.ThrowRelease( { type="真下MBバウンド", airrecover=0, flags=_ThrowRelease_NoGroundRecover } );
				//eff = Battle_Std.CreateObjectEX( { datatype=1, x=20000, y=-60000, pat=975,} ); //!!
				local enemy = BMvCore.GetNearEnemyCharaData();
				if( enemy.push() )
				{
					BMvEff.SetCharaFlash( { color = 0xFFF257, type = 0, time = 30 } );
					BMvEff.SetCharaColor( { color = 0xFFF257, type = 0, intime = 60, time = 60 } );
				}
			}
			else
			{
				//BMvEff.ThrowRelease( {type="あお向け起き上がり", airrecover=0, flags=_ThrowRelease_NoGroundRecover } );
				BMvEff.ThrowRelease( {type="空ガード強", airrecover=0, flags=_ThrowRelease_NoGroundRecover } );

			}
			//BMvEff.ThrowParam( { pat=326, x=120, y=30 } );
			////BMvEff.ThrowRelease( { type="腹やられ強", airrecover=0, flags=0 } );
			////BMvEff.ThrowRelease( { type="前転倒", airrecover=0, flags=0 } );
			break;
		case 1100:
		    if ( !di )
			{
				Battle_Std.SetThrowEnemyMuteki( 0 ); // Set invulnerability
			}
			else
			{
				Battle_Std.SetThrowEnemyMuteki( 1 );
			}

			break;

		}
	}
	function Finalize_After()
	{
		if ( di )
		{

			if( eff.push() )
			{
				BMvTbl.SetFinalize(0);
				eff.pop();
			}
		}
	}
}



// t.Mv_RoundWinPattern <-
// {
	// function Init_After()
	// {
        // BMvEff.AttackInfoString_Set({ word = "ROUNDWIN" });
		// //BMvEff.SetCamera_Focus( { x=0, time=[10,999,30], type_in=1 } );
		// //BMvEff.SetCamera_Clipping( 1 ); //画面端のクリッピング補正を戻す
		
	// }
	// function FrameUpdate_After()
	// {
		// BMvEff.AttackInfoString_Set({ word = Battle_Std.GetNearStageDistance() });
		// if (Battle_Std.GetNearStageDistance() == 0)
		// {
			// // Battle_Std.SetBothCharaInStagePosition();
			// // colour == 0xFFFFFFFF - 0x01010101
			// // BMvEff.SetCharaColor( { color = colour, olotype = 1, intime = 60, time = 60 } );
		// }
	// }
// }

// t.Mv_WinPattern <- {}

t.Mv_Atk_DashStdC <-
{
	function HitInterrupt()
	{
		BMvTbl.SetVector( { x=-500, flags=_Vector_Normal|_VectFlag_Add } );
	}
}

t.Mv_Atk_DashStdBandC <-
{
	function Init_After()
	{
		//Battle_Std.MoveCode.AddFlag(def_MC_EnableCansel_SkilltoAtk);
	}
}

t.Mv_Skill_623EX <- //This is really butchered and scuffed especially in the ha6 (set pattern 0)
{
	function Init_After()
	{
	}
	function FrameUpdate_After()
	{
		Battle_Std.SetHitMuteki( 1, 32, _HitCheckFlag_Legs ); // Param1 & 32 の時、足無敵
		switch( Battle_Std.GetUpdateFrameID() )
		{
		case 200:  // Frame ID
			if ( Battle_Std.CheckEnemyisDamage() )
			{
				BMvTbl.SetPattern("623EX_JHit");
			}
			break;
		}
		
		// local player = BMvCore.GetPlayerCharaData();
		// if( player.push() )
		// {
			// local p_mvs = BMvTbl.GetMvStatus();
			// local p_mvname = BMvTbl.GetMvName();
			// player.pop();
			
			// if( p_mvname == "Mv_Skill_623EX" && p_mvs.FrameID == 200 && p_mvs.isFrameUpdate && BMvTbl.GetLP(0)==1 && BMvTbl.GetLP(1)==0 )
			// {
				// if( Battle_Std.CheckEnemyisDamage() )
				// {
					// local eff = Battle_Std.CreateFireBall({ x=0, y=-250, mv="Mv_FireBall_Bakuha", pat="Bakuha623EX" });
					// if( eff.push() )
					// {
						// local epos = Battle_Std.GetEnemyPosition();
						// BMvTbl.SetPosition( { x=epos.x, y=epos.y-(250*128) } );
						// eff.pop();
					// }
					// BMvTbl.SetLP(1,1); // ?A?C?s”≫’e???μ???I?d?L‰￣
				// }
			// }
		// }
	}
	function HitInterrupt_After()
	{
		if( Battle_Std.CheckDamageTiming() ) //Still dunno what this does
		{
			Battle_Std.SetPosition_DamageHanteiRect({ power=50 });
		}
	}
	function Finalize()
	{
		Battle_Std.SwitchNextMoveTable("Mv_Neutral",[256,"Mv_Skill_623EX_JHit"]); //デフォ,[code,mv]...
	}
}

t.Mv_Skill_623EX_JHit <-
{
	flags = def_TmplFlags_NoAddComboRate // nani desu
	function Init_After()
	{
		Battle_Std.MoveCodeEx.AddFlag( 7, def_MC7_SetMutekiDamage ); // nani desu
	}
	function FrameUpdate_After()
	{

	}

	function LastUpdate_After()
	{
		Battle_Std.NoCansel_NoAttackHit(); // nani desu
		Battle_Std.CSAntenGaesi_DamageHosei(); // CSからの暗転返しで出したら補正をかける
	}

}

t.Mv_Skill_214A <-
{
    function FrameUpdate_After()
    {
        Battle_Std.SetPattern_NotHoldButton( { ButtonMask=(1<<0), CheckFrameID=100, EndFrameID=101, SetPattern="214A_End" } );
    }
	function Init_After()
	{
		Battle_Std.MoveCode.AddFlag(def_MC_EnableCansel_SkilltoJump);
	}
	function HitInterrupt_After()
	{
		if( Battle_Std.CheckDamageTiming() )
		{
			Battle_Std.SetPosition_DamageHanteiRect( { power=100 } );
		}
	}
}

t.Mv_Skill_214B <-
{
    function FrameUpdate_After()
    {
        Battle_Std.SetPattern_NotHoldButton( { ButtonMask=(1<<1), CheckFrameID=100, EndFrameID=101, SetPattern="214B_End" } );
    }
	function HitInterrupt_After()
	{
		if( Battle_Std.CheckDamageTiming() )
		{
			Battle_Std.SetPosition_DamageHanteiRect( { power=100 } );
		}
	}
}



// t.Mv_Skill_214C <-
// {
	// function Init_After()
	// {
	// }
// }

// t.Mv_Skill_214C <-
// {
	// function FrameUpdate_After()
	// {
		// local eIsCap = 0;
		// local enemy = BMvCore.GetEnemyCharaData();
		// if( enemy.push() )
		// {
			// local bound_st = BtlMvStd.GetBoundStatus();
			// if( bound_st.isCapture ) eIsCap = 1;
			// enemy.pop();
		// }
	
		// //local usepow = ( BMvTbl.GetLP(0)==0 )? mvparam.hitlock_FirstPow : mvparam.hitlock;
		// //Battle_Std.SetPosition_DamageHanteiRect( { power=50, flags=(1<<2)|(1<<4) } );

	// }
// }

t.Mv_Skill_63214EX <-
{
	function HitInterrupt_After()
	{
		if( Battle_Std.CheckDamageTiming() )
		{
			Battle_Std.SetPosition_DamageHanteiRect( { power=100 } );
			
		}
	}
}

t.Mv_Atk_AirC <-
{
	function FrameUpdate_After()
	{
		Battle_Std.JumpFrameID_NotHoldButton({ mask=(1<<2), checkid=[100,200], jumpid=[101,201], endid=250 });
    }	
}


local do_PileDrive = function( param={} )
{
	local ret_tmpl = {};

	local mvparam = {
		extend = { isdone=0, btn=0, checkid=50, jumpid=51, endid=60 },
		enable_add = 0,
	}

	switch( param.type )
	{
	case "A":
		break;
	case "B":
		mvparam.extend.isdone = 1;
		mvparam.extend.btn = (1<<1);
		break;
	case "C":
		break;
	case "EX":
		break;
	}

	ret_tmpl.Init_After <- function()
	{
		Battle_Std.MoveCode.AddFlag( def_MC_Sousai|def_MC_Sousai_NoSubHitCount ); // Offset Occurs
	}
	
	ret_tmpl.FrameUpdate_After <- function() : (mvparam)
	{
		if( mvparam.extend.isdone )
		{
			Battle_Std.JumpFrameID_NotHoldButton({ mask=mvparam.extend.btn, checkid=mvparam.extend.checkid, jumpid=mvparam.extend.jumpid, endid=mvparam.extend.endid }); //ID Jump if button not held
		}
		
		Battle_Std.CheckSousai(); // def_MC_Sousai
	}	

	return ret_tmpl;

}

t.Mv_Skill_236A <-
{
	function Init_After()
	{
		Battle_Std.CallAddSkillCache( "236A_Hit", 8 ); // Following Patstr, rest
		
		Battle_Std.MoveCode.AddFlag( def_MC_Sousai|def_MC_Sousai_NoSubHitCount ); // Offset Occurs
	}
	function FrameUpdate_After()
	{
		Battle_Std.CheckSousai(); // Offsets if def_MC_Sousai
	}
	function HitInterrupt()
	{
		local s = BMvTbl.GetMvStatus(); // Get Status
		if( s.FrameID==10 )
		{
			Battle_Std.SetThrowHitFinalize(256); // Hit Jump	
		}
	}
	function Finalize() // 
	{
		Battle_Std.SwitchNextMoveTable("Mv_Neutral",[256,"Mv_236A_Hit"]); //Default goto,[code,mv]
	}		
}	

t.Mv_236A_Hit <-
{
	flags = def_TmplFlags_NoAddComboRate, // Don't Add to Combo
	function Init()
	{
		BMvEff.ThrowChara_SetJoint( 0 ); //くっつけない
		BMvEff.ThrowChara_SetCamera( 1 ); // 投げているキャラをカメラ処理に含めるかどうか
		//BMvEff.SetCamera_Clipping( 0 ); //画面端のクリッピング補正を切る
		BMvTbl.SetPosition( { addx=-100 } );
		BMvTbl.SetPattern("236A_Hit");
		BMvEff.ThrowParam( { pattern=331, x=320, y=0, } );
		Battle_Std.MoveCode.AddFlag( def_MC_Atk ); // Sets (normal) action
		Battle_Std.CallSkillSoonCache( 512, 25 ); // Cache reservation for current Pat - FrameID, rest
		
		Battle_Std.PassHitMoveCodes(); // MvCode takeover at hit branch

		local pos = BMvTbl.GetPosition();
		local p_muki = BMvTbl.GetMuki();
		local corner_distance = def_POS_GamenHajiX - (-pos.x*p_muki);
		local enemy = BMvCore.GetEnemyCharaData();
		if( enemy.push() )
		{
			local e_muki = BMvTbl.GetMuki();
			enemy.pop();
			//BMvEff.AttackInfoString_Set({ word = corner_distance});

			if( corner_distance > 495000 && p_muki!=e_muki )
			{
				BMvTbl.SetPosition( { x=-20000*p_muki, flags=_Position_Add } );
				if (enemy.push() ) // Idk if there's a cleaner way
				{
					BMvTbl.SetPosition( { x=-20000*p_muki, flags=_Position_Add } );
					enemy.pop();
				}
			}
		}
	}
	// function FrameUpdate()
	// {
		// //Battle_Std.TypeSE_Play({ type="Mv_Atk_Std6C_Hit_FU" });
		// local s = BMvTbl.GetMvStatus(); // Gets status
		// if(s.isFrameUpdate )
		// {
			// local rc = BMvEff.GetHanteiRect ( { check=[ _Hantei_Etc, 0 ], flags=_HanteiFlag_NoMukiChange | _HanteiFlag_Tool  } );
			// if( rc.sx != _Hantei_Error ) // Checks exists
			// {
				// BMvEff.ThrowParam( { pattern=320, x=rc.sx, y=rc.sy, hantei_rect=[ _Hantei_Etc, 9 ] } );
			// }
			// if(s.FrameID==512)
			// {
				// BMvEff.ThrowRelease( { type="追撃ダウン", airrecover=0, flags=_ThrowRelease_NoGroundRecover|_ThrowRelease_NoWallRecover|_ThrowRelease_NoVecTimeHosei } )
			// }
		// }
	// }
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{   
		case 512:
			//BMvEff.ThrowParam( { pat=320, x=355, y=-20 } ); // nvm effect doesnt work, why? f1  14 320 355 -20 
            //BMvEff.ThrowParam( { pattern=320, x=250, y=-150, } );
            //BMvTbl.SetAngle({ angle=300 });
			BMvEff.ThrowRelease( { type="追撃ダウン", airrecover=0, flags=_ThrowRelease_NoGroundRecover|_ThrowRelease_NoWallRecover|_ThrowRelease_NoVecTimeHosei } )
			Battle_Std.MoveCodeEx.AddFlag( 2, def_MC2_EnableCVO_OnlyCS );
			break;
		}
	}
	function LastUpdate_After()
	{
		Battle_Std.NoCansel_NoAttackHit(); //If not canceled by something, make followup impossible.
        //BMvEff.SetCamera_Clipping( 1 );
        //BMvEff.SetCamera_Focus( { time=[0,0,30] } ); // ?J???‰?A’e?d?s?・
		//BMvEff.SetCamera_Quake( { time=0, type=2, clear=0, } ); //?h?c?μ
        //BMvEff.SetCamera_FocusKeep( 0 );
		//BMvEff.ResetCamera(); //?J???‰?‰?u‰≫
		//BMvEff.ResetViewCamera();
		//BMvEff.Cockpit_SetView( { mode=0 } ); // ?s?・
		//Grab and open in case of cancellation in the middle of a session
		Battle_Std.ThrowMv_CanselRelease( { pat=320, x=250, y=-150, type="きりもみ転倒", airrecover=0 } );
	}	
	function Finalize()
	{
		BMvTbl.SetNextMoveTable( "Mv_Neutral" );
	}	
}

t.Mv_Skill_236B <-
{
	function Init_After()
	{
		
		Battle_Std.CallAddSkillCache( "236B_Hit", 8 ); // Following Patstr, rest
		
		Battle_Std.MoveCode.AddFlag( def_MC_Sousai|def_MC_Sousai_NoSubHitCount ); // Offset Occurs
	}
	function FrameUpdate_After()
	{
		Battle_Std.CheckSousai(); // Offsets if def_MC_Sousai
//        Battle_Std.JumpFrameID_NotHoldButton({ mask=(1<<1), checkid=[100], jumpid=[200], endid=150 });
        Battle_Std.SetPattern_NotHoldButton( { ButtonMask=(1<<1), CheckFrameID=100, EndFrameID=150, SetPattern="236B_Norm" } );

	}
	function HitInterrupt()
	{
		local s = BMvTbl.GetMvStatus(); // Get Status
		if( s.FrameID==10 )
		{
			Battle_Std.SetThrowHitFinalize(256); // Hit Jump	
		}
	}
	function Finalize() // 
	{
		Battle_Std.SwitchNextMoveTable("Mv_Neutral",[256,"Mv_236B_Hit"]); //Default goto,[code,mv]
	}		
}	


t.Mv_236B_Hit <-
{
	flags = def_TmplFlags_NoAddComboRate, // Don't Add to Combo
	function Init()
	{
		
		BMvEff.ThrowChara_SetJoint( 0 ); //くっつけない
		BMvEff.ThrowChara_SetCamera( 1 ); // 投げているキャラをカメラ処理に含めるかどうか
		//BMvEff.SetCamera_Clipping( 0 ); //画面端のクリッピング補正を切る
		BMvTbl.SetPosition( { addx=-100 } );
		BMvTbl.SetPattern("236B_Hit");
		BMvEff.ThrowParam( { pattern=331, x=350, y=0, } );
		Battle_Std.MoveCode.AddFlag( def_MC_Atk ); // Sets (normal) action
		Battle_Std.CallSkillSoonCache( 512, 25 ); // Cache reservation for current Pat - FrameID, rest
		
		Battle_Std.PassHitMoveCodes(); // MvCode takeover at hit branch
		
		local pos = BMvTbl.GetPosition();
		local p_muki = BMvTbl.GetMuki();
		local corner_distance = def_POS_GamenHajiX - (-pos.x*p_muki);
		local enemy = BMvCore.GetEnemyCharaData();
		if( enemy.push() )
		{
			local e_muki = BMvTbl.GetMuki();
			enemy.pop();
			//BMvEff.AttackInfoString_Set({ word = corner_distance});

			if( corner_distance > 495000 && p_muki!=e_muki )
			{
				BMvTbl.SetPosition( { x=-20000*p_muki, flags=_Position_Add } );
				if (enemy.push() ) // Idk if there's a cleaner way
				{
					BMvTbl.SetPosition( { x=-20000*p_muki, flags=_Position_Add } );
					enemy.pop();
				}
			}
		}
		
	}
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{   
		case 512:
			BMvEff.ThrowRelease( { type="追撃ダウン", airrecover=0, flags=_ThrowRelease_NoGroundRecover|_ThrowRelease_NoWallRecover|_ThrowRelease_NoVecTimeHosei } )
			break;
		}
	}
	function LastUpdate_After()
	{
		Battle_Std.NoCansel_NoAttackHit();
		Battle_Std.ThrowMv_CanselRelease( { pat=320, x=250, y=-150, type="きりもみ転倒", airrecover=0 } );
	}	
	function Finalize()
	{
		BMvTbl.SetNextMoveTable( "Mv_Neutral" );
	}	
}	

t.Mv_Skill_0202D <-
{
    function Finalize_After()
    {
        BMvEff.Cockpit_SetView( { mode=0 } );
        BMvEff.AttackInfoString_Set({ word = "Zen" })
    }
}

t.Mv_Skill_236EX <-
{
	function Init_After()
	{
		Battle_Std.CallAddSkillCache( "236EX_Hit", 8 ); // Following Patstr, rest
		
		Battle_Std.MoveCode.AddFlag( def_MC_Sousai|def_MC_Sousai_NoSubHitCount ); // Offset Occurs
	}
	function FrameUpdate_After()
	{
		Battle_Std.CheckSousai(); // Offsets if def_MC_Sousai
	}
	function HitInterrupt()
	{
		local s = BMvTbl.GetMvStatus(); // Get Status
		if( s.FrameID==10 )
		{
			Battle_Std.SetThrowHitFinalize(256); // Hit Jump	
		}
	}
	function Finalize() // 
	{
		Battle_Std.SwitchNextMoveTable("Mv_Neutral",[256,"Mv_236EX_Hit"]); //Default goto,[code,mv]
	}		
}	

t.Mv_236EX_Hit <-
{
	//flags = def_TmplFlags_NoAddComboRate, // Don't Add to Combo
	function Init()
	{
		BMvEff.ThrowChara_SetJoint( 0 ); //くっつけない
		//BMvEff.SetCamera_Clipping( 0 ); //画面端のクリッピング補正を切る
		//BMvTbl.SetPosition( { addx=-100 } );
		
		
		BMvTbl.SetPattern("236EX_Hit");
		Battle_Std.CallSkillSoonCache( 512, 25 ); // Cache reservation for current Pat - FrameID, rest
		
		Battle_Std.PassHitMoveCodes(); // MvCode takeover at hit branch
		
		
	    local pos = BMvTbl.GetPosition();
		local p_muki = BMvTbl.GetMuki();
		local corner_distance = def_POS_GamenHajiX - (-pos.x*p_muki);
		local enemy = BMvCore.GetEnemyCharaData();
		if( enemy.push() )
		{
			local e_muki = BMvTbl.GetMuki();
			enemy.pop();
			//BMvEff.AttackInfoString_Set({ word = corner_distance});

			if( corner_distance > 495000 && p_muki!=e_muki )
			{
				BMvTbl.SetPosition( { x=-20000*p_muki, flags=_Position_Add } );
				if (enemy.push() ) // Idk if there's a cleaner way
				{
					BMvTbl.SetPosition( { x=-20000*p_muki, flags=_Position_Add } );
					enemy.pop();
				}
			}
		}
		
	}
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{
		case 10:
			//BMvEff.ThrowParam( { pat=326, x=250, y=-210 } );
			break;
		case 20:
			//BMvEff.ThrowParam( { pat=326, x=40,  y=-500 } );
			break;
		case 30:    
			//BMvEff.ThrowParam( { pat=326, x=30,  y=-510 } );
			break;
		case 40:
			//BMvEff.ThrowParam( { pat=326, x=20,  y=-515 } );
			break;
		case 250:
				local eff = BMvEff.CreateObject( { start_pat=151 } );
				if( eff.push() )
				{
					BMvTbl.SetAngle( { angle = 7500} );
					BMvTbl.SetPosition ( { y = -80000} ) ;
					BMvEff.SetObjectFlags( { flags=_ObjFlags_NoGround} );
					eff.pop();
				}
			break;
        case 512:
        	BMvEff.SetCamera_Quake( { time=23, type=2, clear=0, } ); //h, v, both
            BMvEff.Slowmotion_Set( { time=30, power=6666 } );
            //BMvEff.SetCamera_Focus( { charapos=1, zoom=1.0, time=[60,999,60], type_in=4 } );
            //BMvEff.SetCamera_FocusKeep( 0 );
            break;
		case 560:
			BMvEff.ThrowRelease( { type="追撃ダウン", airrecover=0, flags=_ThrowRelease_NoGroundRecover|_ThrowRelease_ReverseVec|_ThrowRelease_NoAttackHit|_ThrowRelease_NoWallRecover|_ThrowRelease_NoVecTimeHosei } )
            BMvTbl.SetMuki( _Direction_Reverse );
			break;
		}
	}
	function LastUpdate_After()
	{
		Battle_Std.NoCansel_NoAttackHit(); //If not canceled by something, make followup impossible.
        //BMvEff.SetCamera_Clipping( 1 );
        //BMvEff.SetCamera_Focus( { time=[0,0,30] } ); // ?J???‰?A’e?d?s?・
        //BMvEff.SetCamera_FocusKeep( 0 );
		//BMvEff.ResetCamera(); //?J???‰?‰?u‰≫
		//BMvEff.ResetViewCamera();
		//Grab and open in case of cancellation in the middle of a session
		Battle_Std.ThrowMv_CanselRelease( { pat=353, x=100, y=0, type="きりもみ転倒", airrecover=0 } );
	}	
	function Finalize()
	{
		BMvTbl.SetNextMoveTable( "Mv_Neutral" );
	}	
}	


t.Mv_Skill_41236SP <-
{
	// function FrameUpdate_After()
	// {
		// // How else am I gonna do this. Literally.
		// switch( Battle_Std.GetUpdateFrameID() )
		// {
		// case 200:  // Frame ID
			// if ( Battle_Std.CheckEnemyisDamage() )
			// {
				// BMvTbl.SetPattern("623EX_JHit");
			// }
			// break;
	// }
	function Init_After()
	{
		BMvEff.Chara_SetMessage( 640, 600, "Code... Ictus!", 120 );
	}
	function HitInterrupt_After()
	{
		//BMvEff.AttackInfoString_Set({ word = "dumber" });

		if( Battle_Std.CheckDamageTiming() ) //Still dunno what this does
		{
			Battle_Std.SetKezurareDamage( 50 );
			if( Battle_Std.CheckDamageTiming() )
			{
				Battle_Std.SetPosition_DamageHanteiRect( { power=100 } );
			}
			//Battle_Std.SetPosition_DamageHanteiRect({ power=100 });
			BMvTbl.SetNextMoveTable( "Mv_Skill_41236SP_Hit" );

		}
		
	}
	function Finalize_After()
	{
		Battle_Std.SwitchNextMoveTable("Mv_Neutral", [256,"Mv_Skill_41236SP_Hit"]);
	}
}


// t.Mv_Skill_41236SP <-
// {
	// function Init_After()
		// {BMvEff.AttackInfoString_Set({ word = "dumb" });}
	// function HitInterrupt()
	// {
		// Battle_Std.SetFinalize(256);
		// BMvEff.AttackInfoString_Set({ word = "dumber" });
	// }
	// function Finalize()
	// {
		//BMvEff.AttackInfoString_Set({ word = "dumbest" });
		// Battle_Std.SwitchNextMoveTable("Mv_Neutral", [256,"Mv_Skill_41236SP_Hit"]);
	// }
// }

t.Mv_Skill_41236SP_Hit <-
{
	function Init_After()
	{
		BMvEff.FadeProc_Set({type=0, time=[0,10,30] color=0xFFFFFF});

		BMvEff.SetCamera_Clipping( 0 ); // Disable stage bounds for teh immmersion
		BMvEff.ThrowParam( { pattern=320, x=200, y=0, } );
		BMvEff.ThrowRelease( { type="追撃ダウン", airrecover=0, flags=0 } ); //開放のみ
		

	}
	function HitInterrupt_After()
	{
		if( Battle_Std.CheckDamageTiming() ) //Still dunno what this does
		{
			Battle_Std.SetPosition_DamageHanteiRect({ power=100 });
		}
	}
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{
		case 100:
			if ( Battle_Std.CheckEnemyisDamage() )
			{
				BMvEff.Chara_SetMessage( 640, 600, "Break through!", 75 );
			}
			break;
		case 205:
			Battle_Std.MoveCodeEx.AddFlag( 1, def_MC1_ChainShiftOK );
			break;
		}

		local s = BMvTbl.GetMvStatus(); // wtf
		switch( s.FrameID )
		{
		case 205:
			
			if( s.isFrameUpdate ) Battle_Std.FinalizeWorthSkill(); //終了
			break;
		}
	}
	function Finalize_After()
	{
		BMvEff.SetCamera_Clipping( 1 ); // So the wall is back on the edge
	}
}

//-----------------------------------------------------------------------------
// 空中ダッシュ
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// 超必殺技
//-----------------------------------------------------------------------------


// 適当に演出を作れるように調整中
// HitMove : 自分のヒットストップ中以外に、相手を毎フレーム何ドット動かすか
// Throw : 投げつかみ座標再指定（自分から見た座標）
// Camera : カメラを動かす Move.xとMove.y : 何ドット動かすか Move.frame : 何フレームで到達するか






t.Mv_Skill_IWEXIST <- 
{
	//BMvEff.Chara_SetMessage( 640, 600, "Ictus...", 120, 600 );
	flags = def_TmplFlags_NoAddComboRate // Don't add to combo
	function HitInterrupt_After()
	{
		Battle_Std.SetThrowHitFinalize(256);
	}
	function Finalize()
	{
		//local btl = BMvTbl.CBtlInfo();
		local round = BMvTbl.GetMvRoundStatus();
		local training = BMvTbl.GetMvStageStatus().IsTrainingBattle() // Check if we're in training mode (1)
		local enemy = BMvCore.GetNearEnemyCharaData(); // For grabs?
		
            if( enemy.isdone ) // When obtained
            {
                BMvCore.PushCharaData( enemy );	// Fetch enemy data
				local hp_ratio = BCMDTbl.GetHPRatio();
                BMvCore.PopCharaData(); // Discard enemy data
				//BMvEff.AttackInfoString_Set({ word = hp_ratio });
				//BMvEff.AttackInfoString_Set({ word = btl.GetFixStageBGM() }); // this is for what character bgm is supposed to be for auto
				
				// TODO check currently playing bgm
				if ( ( round.Round >= 2 || training == 1 ) && hp_ratio <= 25 ) // Check round/training and enemy HP for KO threshold
				{
					BMvEff.BGM_Set( { num = 65 } ); // Set anime music
				}
            
			}
			
		Battle_Std.SwitchNextMoveTable("Mv_Neutral",[256,"Mv_Skill_IWEXIST_Hit"]);
		
	}	
}


t.Mv_Obj_Eff_Shld <-
{
	function FrameUpdate_After()
	{
		//	BMvTbl.SetScale( { x=y=9000+BMvEff.Random_Limit(2000), y=9000+BMvEff.Random_Limit(2000) } );
	}
}



t.Mv_Skill_IWEXIST_Hit <-
{
	flags = def_TmplFlags_NoAddComboRate
	
	function Init_After()
	{
		Battle_Std.InitIWExistSkill();
		BMvEff.ThrowChara_SetJoint( 0 ); // Don't attach grabs?
		BMvEff.ThrowParam( { pattern=304, x=600, y=0, } );
		
		//BMvTbl.SetLP(0,0); // wtf?
		
		// BMvEff.Chara_SetMessage( 640, 600, "Code... Ictus!!", 240, 600 );
		BMvEff.Chara_SetMessage( 640, 600, "Pray!", 240, 612 );
		

		local epos = Battle_Std.GetEnemyPosition();
		// BMvEff.SetCamera_Focus( { num=1, x=epos.x - (340<<7)*BMvTbl.GetMuki(), y=0, zoom=0.9, time=[0,00,30], type_in=0 } );
		BMvEff.SetCamera_Focus( { num=0, x=epos.x - (340<<7)*BMvTbl.GetMuki(), y=0, zoom=0.9, time=[0,50,30], type_out=1 } );

	}
	
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{
		case 100: // Hit
			//BMvEff.ThrowParam( { x=125, y=0, pattern=320 } );
			BMvEff.SetCamera_Quake( { time=60, type=0, clear=0, } ); //揺らし
			// BMvEff.SetCamera_Clipping( 1 ); //画面端のクリッピング補正を戻す

			//MvEff.SetCamera_Focus( {time=[ 0, 2000, 0] } );
			
			// local enemy = BMvCore.GetNearEnemyCharaData();
			// if( enemy.push() )
			// {
				//BMvEff.EraseObjectFlags( { flags=_ObjFlags_NoRender } ); //非表示を戻す
				
				//真っ黒にする？
				//BMvEff.SetCharaColor( { color=0x707070, intime=40, time=999, type=4 } ); // 少しずつ暗くする
				
				//BMvTbl.SetVector( { y=-256, flags=_Vector_Normal } );
				//BMvTbl.SetVector( { y=-2500, addy=80, flags=_Vector_Div } );
				
				// enemy.pop();
			// }
			// BMvEff.Cockpit_SetPrioU(1); // move to front
			
			BMvEff.Slowmotion_Set( { time=60, power=5000 } );
			BMvEff.FadeProc_Set({type=0, time=[0,10,30] color=0xFFFFFF});

			break;
			
		case 120:
					BMvEff.FadeProc_Set({type=0, time=[1,100,30] color=0xFFFFFF});
			BMvEff.Cockpit_SetView( { mode=2 } ); // 一部のみ消去
			BSound.BGM_SetFade( { val=50, time=90 } );//BGMのフェードアウト
			//白フェードでイン
			//BMvEff.FadeProc_SetRenderFlag(0); //Hide the IWEX bg
			BMvEff.FadeProc_SetRenderFlag(0); // 0:カットインBG描画なし
			//Battle_Std.ScreenEffect_LimitPat( { y=64*128, pat="LABG" } );
			local enemy = BMvCore.GetNearEnemyCharaData();
			if( enemy.push() )
			{

				BMvTbl.SetVector( { x = -28, y = -64,  flags=_Vector_Bound } );
				// BMvTbl.SetPosition( { x=200, y=-10000 } );
				BMvEff.SetCharaFlash( { color = 0x000000, type = 0, time = 10 } );
				BMvEff.SetCharaColor( { color = 0x000000, type = 0, intime = 60, time = 60 } );
				enemy.pop();
			}
			
			BMvEff.Chara_SetMessage( 640, 590, "Should thy soul bear any miracle, thou shalt be saved in the wake of judgment!!", 1000, 613 ); // x y string delay se_optinoal
			BMvTbl.SetPosition( { x=-500 } );
			break;
		case 200:
		
			local enemy = BMvCore.GetNearEnemyCharaData();
			if( enemy.push() )
			{
				BMvTbl.SetPosition( { x=200, y=-10000 } );
				enemy.pop();
			}
			break;
		case 250:
			local enemy = BMvCore.GetNearEnemyCharaData();
			if( enemy.push() )
			{
				BMvTbl.SetPosition( { x=200, y=-10000 } );
				BMvTbl.SetSpPrio( { prio=1 } );

				enemy.pop();
			}
			//BMvTbl.SetVector( { x=-1000, addx=10, y=0, flags=_Vector_Normal } );
			//BMvEff.SetExist( { level=_Exist_NoCamera, mode=_ExistMode_Set } ); //?J???‰?c?c?O?e?£?・
			BMvTbl.SetVector( { x=-100, y=0 } );
			//BMvEff.SetCamera_Focus( { num=0, x=epos.x - (340<<7)*BMvTbl.GetMuki(), y=0, zoom=0.9, time=[0,50,30], type_out=1 } );
			BMvEff.ThrowParam( { x=350, pattern = 320, frame = 0 } );
			local epos = Battle_Std.GetEnemyPosition();
			BMvEff.SetCamera_Focus( { num=0, y=-100*128, x=epos.x-200*128, zoom=4.0, time=[0,999,30] } );
			BMvEff.SetCamera_Focus( { num=1, y=-64, x=epos.x-180*128, zoom=1.3, time=[160,999,30], type_in=1 } );
			// BMvEff.SetCamera_Focus( { num=1, zoom=1.2, time=[90,255,120], type_out=2 } );	
			//?z???C?g?C?“
			BMvEff.FadeProc_Set( { type=0, time=[ 0, 1, 10 ], color = 0xFFFFFF } );
			
			break;
			
		case 310:
		
			// shield = Battle_Std.CreateObjectEX( { x=-25, y=-300, datatype=0, pat=983, flags=_Position_ToolShift } );
			BMvEff.CreateObject({ mvname="Mv_Obj_Eff_Shld" });
			break;
			
		case 311:
		
			// local shieldglow = Battle_Std.CreateObjectEX( { x=-25, y=-300, datatype=0, pat=966, flags=_Position_ToolShift } );
		
			// if( shield.push() )
			// {
				// //BMvEff.SetObjectFlags( { flags=_ObjFlags_NoGround } );
			// //	local scale = 7500 + BMvEff.Random_Limit(4000);
		   // // BMvEff.SetCharaDrawType( { type=1 } ); // 通常
				// BMvTbl.SetScale( { x=y=9000+BMvEff.Random_Limit(20000), y=9000+BMvEff.Random_Limit(20000) } );
				
				// shield.pop();
			// }
			break;

		case 350:
			local expl3 = Battle_Std.CreateObjectEX( { datatype=0, pat=987, flags=_Position_ToolShift } );

			if( expl3.push() )
			{
				Battle_Std.SetPos_MarkingEnemy();
				BMvTbl.SetSpPrio( { prio=2 } );
				BMvTbl.SetPosition( { x=50, flags=_Position_CaptureShift|_Position_Add } )

				expl3.pop();
			}
				
			break;

		case 500:
			BMvEff.SetCamera_Focus( { num=0, time=[0,999,30] } );
			BMvEff.SetCamera_Focus( { num=1, y=0, zoom=1.0, time=[25,999,30], type_in=3 } ); //0 Linear 1 Fast in 2 Slow in 3 Fast middle 4 slow to fast

			break;
			
		case 600:
		

			local enemy = BMvCore.GetNearEnemyCharaData();

			if( enemy.push() )
			{
				Battle_Std.CreateObjectEX( { y = 26000, angle=2500, datatype=1, pat=30, flags=256 } );
				BMvTbl.SetVector( { x=-1400, y=-1400, addx = 40, addy = 30,  flags=_Vector_Bound } );
				// BMvTbl.SetPosition( { x=200, y=-10000 } );
				enemy.pop();
			}
			break;
			
		case 610:
		
			local eff = Battle_Std.CreateObjectEX( { x=-450, y = -100, angle=2000, datatype=0, pat=973, flags=_Position_ToolShift } );

			if( eff.push() )
			{
				//BMvEff.SetObjectFlags( { flags=_ObjFlags_NoGround } );
			//	local scale = 7500 + BMvEff.Random_Limit(4000);
		   // BMvEff.SetCharaDrawType( { type=1 } ); // 通常
			//	BMvTbl.SetScale( { y=scale } );
				
				eff.pop();
			}	
			

		

			break;
		case 620:
			local enemy = BMvCore.GetNearEnemyCharaData();
			BMvEff.Slowmotion_Set( { time=60, power=5000 } );
			if( enemy.push() )
			{
				Battle_Std.InitVector();
				// BMvTbl.SetPosition( { x=200, y=-10000 } );
				enemy.pop();
			}
			
			
			local LABG = Battle_Std.ScreenEffect( { pat="LABG" } );
			if( LABG.push() )
			{
				//BMvTbl.SetMuki( _Direction_Right );
				
				LABG.pop();
			}			
			
			
			if( expl.push() )
			{
				Battle_Std.SetPos_MarkingEnemy();
				BMvTbl.SetSpPrio( { prio=2 } );
				BMvTbl.SetPosition( { x=200, y=-100, flags=_Position_CaptureShift|_Position_Add } )
				expl.pop();
			}	
									
			local expl = Battle_Std.CreateObjectEX( { datatype=0, pat=985, flags=_Position_ToolShift } );

			if( expl.push() )
			{
				Battle_Std.SetPos_MarkingEnemy();
				BMvTbl.SetSpPrio( { prio=2 } );
				BMvTbl.SetPosition( { x=200, y=-100, flags=_Position_CaptureShift|_Position_Add } )
				expl.pop();
			}	
						
			local expl2 = Battle_Std.CreateObjectEX( { datatype=0, pat=986, flags=_Position_ToolShift } );

			if( expl2.push() )
			{
				Battle_Std.SetPos_MarkingEnemy();
				BMvTbl.SetSpPrio( { prio=2 } );
				BMvTbl.SetPosition( { x=-100, y=-600, flags=_Position_CaptureShift|_Position_Add } )
				expl2.pop();
			}	
			
			
									
			local expl3 = Battle_Std.CreateObjectEX( { datatype=0, pat=987, flags=_Position_ToolShift } );

			if( expl3.push() )
			{
				Battle_Std.SetPos_MarkingEnemy();
				BMvTbl.SetSpPrio( { prio=2 } );
				BMvTbl.SetPosition( { x=50, flags=_Position_CaptureShift|_Position_Add } )

				expl3.pop();
			}
				
			break;
			
		case 777:
		
			BMvEff.ThrowRelease( { type="頭やられ弱", airrecover=0, flags=_ThrowRelease_NoAttackHit|_ThrowRelease_NoGroundRecover } );

			BMvEff.Chara_SetMessage( 640, 600, "Calvariat... SEAL!!", 120, 611 );
			BMvEff.FadeProc_Set({type=0, time=[0,1,30] color=0xFFFFFF})
			break;

			
		// case 350:
			// BMvEff.SetCamera_Focus( { num=0, y=-64, x=epos.x-180*128, zoom=1.3, time=[0,999,30] } );
			// BMvEff.SetCamera_Focus( { num=1, y=0, x=epos.x-180*128, zoom=1.0, time=[160,999,30], type_in=1 } );
			// break;
			
		// case 95: //?O?e?a?°?I???I?G
			// local p = BMvCore.GetCaptureCharaData();
			// if( p.IsDone )
			// {
				// BMvCore.PushCharaData( p ); //	
				// BMvTbl.SetVector( { y=-20000 } );				
				// BMvCore.PopCharaData(); //	
			// }
			// BMvEff.SetCamera_Focus( { num=0, time=[0,999,30] } ); //?X?^?[?g?E’u?d?!?I?J???‰?E?・?e
			// BMvEff.SetCamera_Focus( { num=1, y=-600*128, zoom=1.0, time=[10,999,30], type_in=1 } );				
			
			// break;
		// case 99: //?±?±?c?c?E?p?^?[?“
			// BSound.BGM_SetFade( { val=25, time=240 } );//BGM?I?t?F?[?h?A?E?g
			// BMvEff.ResetCamera(); //?J???‰?‰?u‰≫
			// BMvEff.ResetViewCamera();				
			// Battle_Std.CreateObjectEX( { datatype=1, setx=0, sety=-256, mvname="Mv_IE_scl_up", pat="scl_up", flags=_Position_ToolShift,
			// objectflags=_ObjFlags_EraseParentPatChange|_ObjFlags_NoCamera, } );
			// break;
			
		// case 1000: // とどめ爆発
			// Battle_Std.IWExistSkill_FinishEffect(); //KOと同じような揺れやスローを呼ぶ
			// break;
		}
	}
	// function Finalize()
	// {
		// BMvTbl.SetNextMoveTable( "Mv_Skill_IWEXIST_End" );
	// }
	// function LastUpdate_After()
	// {
		// BMvEff.Cockpit_SetPrioU(0); // 体力ゲージを通常に戻す
		// local enemy = BMvCore.GetNearEnemyCharaData();
		// if( enemy.push() )
		// {
			// BMvEff.EraseObjectFlags( { flags=_ObjFlags_NoRender } ); //非表示を戻す
			
			// BMvEff.SetCharaDrawType( { type=0 } ); // 通常
			// BMvEff.SetCharaColor( { color=0xFFFFFF, intime=0, time=0, type=0 } ); // 戻す
			
			// Battle_Std.InitVector();
			
			// enemy.pop();
		// }
	
		// BMvEff.FadeProc_Set({type=0, time=[0,2,10] color=0xFFFFFF}); // 2F稼ぐ
		
		// BMvEff.FadeProc_SetRenderFlag(1); // 0:カットインBG描画なし

		// //カメラ初期化
		// BMvEff.SetCamera_Focus( { time=[0,0,0] } );
		// BMvEff.ResetViewCamera();
		
		// //つかみ開放
		// BMvTbl.SetPosition( { x=0 } ); // 中央へ
		// BMvEff.ThrowParam( { x=400, y=-1024, } );
		// BMvEff.ThrowRelease( { type="真下叩きつけ", airrecover=0, flags=_ThrowRelease_NoAttackHit|_ThrowRelease_NoGroundRecover } );
		
		// // BMvEff.ThrowParam( { pattern=331, x=-300, y=-300, } );
		// // BMvEff.ThrowRelease( { type="腹吹き飛び", airrecover=0, flags=_ThrowRelease_NoAttackHit|_ThrowRelease_NoGroundRecover|_ThrowRelease_NoWallRecover } );
		// //BMvEff.SetCamera_Quake( { time=30, type=2, clear=0, } ); //揺らし
		// BMvEff.Slowmotion_Set( { time=30, power=5000 } );
		// Battle_Std.FinalizeIWExistSkill();	
	// }
	function LastUpdate_After()
	{
		BMvEff.FadeProc_SetRenderFlag(0); // 0:カットインBG描画なし
		
		BMvEff.SetCamera_Quake( { time=0, type=2, clear=0, } ); //揺らし
		
		Battle_Std.FinalizeIWExistSkill();

		BMvEff.SetCamera_Clipping( 1 ); //‰a?E’[?I?N???b?s?“?O?a?3?d?s?・
		
		BMvEff.SetCamera_Focus( { time=[0,0,30] } ); // ?J???‰?A’e?d?s?・
		
		BMvEff.SetCamera_Quake( { time=0, type=2, clear=0, } ); //?h?c?μ
				
		
		BMvEff.SetCamera_FocusKeep( 0 );
		BMvEff.ResetCamera(); //?J???‰?‰?u‰≫
		BMvEff.ResetViewCamera();	
		
		// BMvTbl.SetNextMoveTable( "Mv_Skill_IWEXIST_Hit2" );
		//つかみ開放
		//BMvEff.SetCamera_Focus( { zoom=1.0, time=[0,0,30] } ); //カメラ固定
	}	
}

t.Mv_Skill_IWEXIST_Hit2 <-
{
	function Init_After()
	{
		BMvEff.SetCamera_Focus( { charapos=0, zoom=10.25, time=[30,def_FL_SPCutinStopTime-40,10], type_in=3, type_out=1 } );
		BMvTbl.SetPosition( { x=0, } );
		BMvEff.AttackInfoString_Set({ word=def_AISW_Invincibility,} );
	}

	function LastUpdate_After() // 
	{		
		BMvEff.FadeProc_SetRenderFlag(1); // 0:カットインBG描画なし
		
		BMvEff.SetExist( { level=_Exist_NoCamera, mode=_ExistMode_Erase  } ); //カメラから切り離す
		
		BMvEff.SetCamera_Focus( { time=[0,0,30] } );
		BMvEff.ResetCamera(); //カメラ初期化
		BMvEff.ResetViewCamera();
		
		
		local p = BMvCore.GetCaptureCharaData();
		if( p.IsDone )
		{
			BMvCore.PushCharaData( p ); //	
				BMvEff.EraseObjectFlags( { flags=_ObjFlags_NoRender } ); //非表示にする
				BMvEff.SetExist( { level=_Exist_NoCamera, mode=_ExistMode_Erase  } ); //カメラから切り離す
				BMvEff.SetCharaDrawType( { type=0 } );
				BMvEff.SetCharaColor( { time=0 } );
			BMvCore.PopCharaData(); //	
		}
		
		BMvEff.SetExist( { level = 0 } );
		BMvEff.FadeProc_Erase( { type=1 } );
		BMvEff.FadeProc_Erase( { type=0 } );

		BMvEff.SetCharaDrawType( { type=0 } );
		BMvEff.SetCharaColor( { time=0 } );
		
		BMvTbl.SetLP( 1, 255 ); //花びらに終了を伝える

		//Battle_Std.FinalizeIWExistSkill();
	}
	function Finalize() // 
	{
		BMvTbl.SetNextMoveTable( "Mv_Skill_IWEXIST_End" );
	}
}

t.Mv_Skill_IWEXIST_End <- {
	function Init_After()
	{
		BMvEff.ThrowChara_SetJoint( 0 ); // Don't attach grabs?
		BMvEff.ThrowParam( { pattern=304, x=600, y=0, } );
	}
	
};

t.Mv_Skill_020202EX <-
{
	function Init_After()
	{
		BMvEff.SetCamera_Quake( { time=100, type=2, clear=0, } ); //揺らし
		BMvEff.Liberate_SetMinusValue( 9999 );
	}
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{	
		
		case 10:
			BSound.BGM_SetFade( { val=0, time=30 } );//BGMのフェードアウト
			
			break;
			
		case 15:
			BMvEff.FadeProc_Set({type=0, time=[0,5,10] color=0xFFFFFF}); //白くしてから開始
			BMvEff.PcAuraEffect_Set( { type=0, time=2000, power=3.2, color=0x555555FF, colorB=0x88FF4444, color_chara=0x001F0505, blendmode=1, delay=120 } );
 
			BMvEff.Slowmotion_Set( { time=75, power=9999 } );
			BMvEff.SetCamera_Focus( { charapos=1, zoom=1.25, time=[30,def_FL_SPCutinStopTime-40,10], type_in=3, type_out=1 } );
			//BMvEff.SetStopTime({ time=10, });
						
			Battle_Std.CreateTechObject_TechMissStart();
			Battle_Std.SetCharaFlash_Counter();
			local breaktime = def_GRDBF_NormalAtkDmg;
			BMvEff.GRD_SetBreak( 0, breaktime, breaktime );	
			
			
			BMvTbl.SetPP(Installed, InstallTimer);	
			BMvTbl.SetPP(CDef_Rie_PP_DragonInstall, 1);
			BMvTbl.SetPP(CDef_Rie_PP_InstallLimit, 1);
			BMvTbl.SetPP(CDef_Rie_PP_InstallTimer, 999);

			break;
			
			
		case 20:
			BMvEff.BGM_Set( { num = 191 } ); // BLOOD HEAT
			break;
			
		case 40:
			BMvEff.AttackInfoString_Set({ word=def_AISW_Invincibility,} );
			break;
		
		case 150:
			BMvEff.Slowmotion_Set( { time=60, power=7000 } );
			Battle_Std.ComboPoint_Multi( 300 );
			BMvTbl.ComboPoint_Calc( { num=1000 } );

			local enemy = BMvCore.GetEnemyCharaData();
			if( enemy.push() )
			{
				BMvEff.SetBoundSt( { addtime = 300 } ); // のけぞり増加
				enemy.pop();
			}
			
			BMvEff.CreateObject( { mvname="Mv_Obj_BeastMode" } );
			
			break;
		
		
		}
		
	}
	function LastUpdate_After()
	{
		BSound.BGM_SetFade( { val=100, time=4 } );

	}
}

t.Mv_Startup <-
{
	function Init_After()
	{

		if( Battle_Std.CheckTrainingCharaGaugeMode() ) // She installin me till i drag
		{
			BMvEff.GRD_SetBreak( 0, def_GRDBF_NormalAtkDmg, def_GRDBF_NormalAtkDmg );				
			BMvTbl.SetPP(CDef_Rie_PP_DragonInstall, 1);
			BMvTbl.SetPP(CDef_Rie_PP_InstallTimer, 99999);
			BMvEff.CreateObject( { mvname="Mv_Obj_BeastMode" } );
		}
	}
}

t.Mv_Skill_SSRelayAtk <-
{
	function FrameUpdate_After()
	{
		switch( Battle_Std.GetUpdateFrameID() )
		{
		case 100:
			local isDirectSS = BMvTbl.GetLPEx(1,1);
			if( isDirectSS )
			{
				local now_vec = BMvTbl.GetVector();
				local vec_x = Battle_Std.GetEnemyDistance()/8 - now_vec.x;

				if( vec_x < -3500 ) vec_x = -3500;
				if( vec_x > 1000 ) vec_x = 1000;
				BMvTbl.SetVector({ x=vec_x, flags=_VecFlag_Add });
				local xmax = now_vec.x + vec_x - 4000;
				BMvTbl.SetVector_MaxX( xmax );
			}
			break;
		}
	}
}


t.Mv_Obj_BeastMode <-
{
	function Init_After()
	{
	//	Battle_Std.CreateObjectEX( { y = 24000, datatype=1, pat=973} );
	}
	function FrameUpdate_After()
	{
		Battle_Std.SetPos_MarkingPlayer();
		local s = BMvTbl.GetMvStatus();
		
		if( s.FrameID==10 )
		{
			Battle_Std.CreateObjectEX( { y = 26000, angle=2500, datatype=1, pat=31, flags=_Position_ToolShift } );
			Battle_Std.CreateObjectEX( { y = 24000, angle=-2500, datatype=1, pat=31, flags=_Position_ToolShift } );
		}
	
		Battle_Std.CreateObjectEX( { y = 26000, angle=2500, datatype=1, pat=30 } );
		Battle_Std.CreateObjectEX( { y = 24000, angle=-2500, datatype=1, pat=30} );
		
		
		BMvTbl.AddPP(CDef_Rie_PP_InstallTimer, -1);
		BMvTbl.SetScale({ x=(100*BMvTbl.GetPP(CDef_Rie_PP_InstallTimer)) });
		BMvEff.AttackInfoString_Set({ word = BMvTbl.GetPP(CDef_Rie_PP_InstallTimer) });
		
		if ( BMvTbl.GetPP(CDef_Rie_PP_InstallTimer) <= 0 )
		{
			
			local player = BMvCore.GetPlayerCharaData();
			if( player.push() )
			{
			
				local movable = BCMDTbl.CheckCancel( _SkillType_None );
				if( movable )
				{
				
					//local player = BMvCore.GetPlayerCharaData();
					player.pop()
					
					BMvTbl.JumpFrameID( 100 );
					BMvTbl.SetPP(CDef_Rie_PP_DragonInstall, 0);
					BMvTbl.SetFinalize();
				}
				
				
			}
			
		}
	}
	function Finalize()
	{
		local player = BMvCore.GetPlayerCharaData();
		local og = BMvTbl.CBtlInfo.GetSelectBgm();
		BMvEff.BGM_Set( { num = og } );
		BMvEff.AttackInfoString_Set({ word = og });
		if (player.push() )
		{
			Battle_Std.MoveCodeEx.DelFlag(6, def_MC6_EnableCansel_JumpMoveable);
			Battle_Std.MoveCode.DelFlag( def_MC_EnableCansel_SkilltoSkill);
			Battle_Std.MoveCode.DelFlag( def_MC_EnableCansel_SkilltoAtk);
			Battle_Std.MoveCode.DelFlag( def_MC_EnableCansel_SkilltoJump);
			BMvTbl.SetPattern(992);
			//BMvTbl.SetNextMoveTable(Mv_BeastMode_End);
			BMvEff.SetCharaFlash( { color = 0xFF50FF, type = 0, time = 10 } );
			BMvEff.SetCharaColor( { color = 0x0000FF, type = 0, intime = 60, time = 90 } );
			player.pop();
		}
	}
}


t.Mv_BeastMode_End <-
{
	function Init_After()
	{
		BMvTbl.SetMoveableFlag( { move=0, time=254 } ); 
	}
	function FrameUpdate_After()
	{
		Battle_Std.MoveCodeEx.DelFlag(6, def_MC6_EnableCansel_JumpMoveable);
		
		local player = BMvCore.GetPlayerCharaData();
		if( player.push() )
		{
			local isGround = BMvTbl.CheckPosState( _PosState_Ground );
			local pos = BMvTbl.GetPosition(0);
			if( isGround )
			{
				Battle_Std.MoveCodeEx.DelFlag(6, def_MC6_EnableCansel_JumpMoveable);

			}
			player.pop();
		}
	}
	
}




RIES_MoveTable <- Battle_Std.MakeMoveTable( t, RIES_CommandTable, Def_ChrNo_Rie );

__dofile__("./data/Ries/Ries_se_category.txt"); //ＳＥ定義