--------------------------------------------------------------------
-- s_common.lua
-- シーン内共通スクリプト
--
-- author IZUMI STUDIO
-- date
--------------------------------------------------------------------

PI = 3.1415

-- シーン
SCENE_APP   = 0
SCENE_COPYRIGHT = SCENE_APP
SCENE_TITLE = SCENE_APP + 1
SCENE_MENU  = SCENE_APP + 2
SCENE_GAME  = SCENE_APP + 3


-- トランジション
TRANSITION_EMPTY_OUT = 0
TRANSITION_EMPTY_IN  = 1
TRANSITION_BLACK_OUT = 2
TRANSITION_BLACK_IN  = 3
TRANSITION_WHITE_OUT = 4
TRANSITION_WHITE_IN  = 5
TRANSITION_APP       = 6


-- サウンドの操作方法
CONTROL_STOP = 0
CONTROL_PLAY = 1


-- ストリームサウンドの操作方法
SCONTROL_STOP       = 0
SCONTROL_PLAY       = 1
SCONTROL_PUSH_SOUND = 2
SCONTROL_CLEAR      = 3
SCONTROL_FADE_IN    = 4
SCONTROL_FADE_OUT   = 5


-- ストリームサウンドのループモード
SCONTROL_LOOP_NO    = 0
SCONTROL_LOOP_ONE   = 1
SCONTROL_LOOP_ALL   = 2
SCONTROL_LOOP_RANDOM= 3


-- プレーヤー名
PLAYER_YOU        = 0
PLAYER_COM        = 1
PLAYER_PLAYER1    = 2
PLAYER_PLAYER2    = 3


-- エフェクト（削除時に使う）
EFFECT_CIRCLE     = 100
EFFECT_RING       = 101
EFFECT_SPRITE     = 102
EFFECT_STRIPE     = 103
EFFECT_MODEL      = 104


-- カメラワークの補間方法
INTERPOLATION_LINEAR    = 0
INTERPOLATION_POW2      = 1
INTERPOLATION_POW3      = 2
INTERPOLATION_POW4      = 3
INTERPOLATION_POWX      = 4
INTERPOLATION_EASE_IN   = 5
INTERPOLATION_EASE_IN2  = 6
INTERPOLATION_EASE_IN3  = 7
INTERPOLATION_EASE_IN4  = 8
INTERPOLATION_EASE_IN5  = 9
INTERPOLATION_EASE_IN6  = 10
INTERPOLATION_EASE_IN7  = 11
INTERPOLATION_EASE_IN8  = 12
INTERPOLATION_EASE_OUT  = 13
INTERPOLATION_EASE_OUT2 = 14
INTERPOLATION_EASE_OUT3 = 15
INTERPOLATION_EASE_OUT4 = 16
INTERPOLATION_EASE_OUT5 = 17
INTERPOLATION_EASE_OUT6 = 18
INTERPOLATION_EASE_OUT7 = 19
INTERPOLATION_EASE_OUT8 = 20


-- カメラワーク関連
CAMERA_POS_X = 0.0
CAMERA_POS_Y = 0.0
CAMERA_POS_Z = -40.0

PROJ_FOV        = 3.1415 * 25.0 / 180.0
PROJ_RADIUS     = (-CAMERA_POS_Z) / math.cos( PROJ_FOV / 2.0 )
PROJ_HALF_WIDTH = PROJ_RADIUS * math.sin( PROJ_FOV / 2.0 )


-- 各サブ画面のカメラワーク
CAMERA_FIRST = {
	0.0, -20.0, -20.0,
	-PI*90.0/180.0, -PI*90.0/180.0, PI*0.0/180.0 }

CAMERA_SELECT_MODE = {
	0.0, 0.0, 0.0,
	PI*0.0/180.0, PI*0.0/180.0, PI*0.0/180.0 }

CAMERA_SELECT_MODE_OUT = {
	0.0, 0.0, 24.0,
	PI*0.0/180.0, PI*0.0/180.0, PI*0.0/180.0 }


CAMERA_RECORDS = { 
	0.0, -20.0, 20.0,
	PI*90.0/180.0, PI*0.0/180.0, PI*0.0/180.0 }

CAMERA_SELECT_DIFFICULTY = {
	30.0, 0.0, 30.0,
	PI*0.0/180.0, PI*90.0/180.0, PI*0.0/180.0 }

CAMERA_SELECT_FLOWER = {
	60.0, 0.0, 0.0,
	PI*0.0/180.0, PI*180.0/180.0, PI*0.0/180.0 }

CAMERA_SELECT_FLOWER_OUT = {
	60.0, 0.0, -24.0,
	PI*0.0/180.0, PI*180.0/180.0, PI*0.0/180.0 }


-- モデル名
MODEL_NAME_MENU_BUTTON            = "bar_mode"
MODEL_NAME_MENU_BUTTON_RETURN     = "bar_return" 
MODEL_NAME_MENU_BUTTON_DIFFICULTY = "bar_difficulty" 
MODEL_NAME_MENU_BUTTON_FLOWER     = "bar_flower" 
MODEL_NAME_MENU_PLATE             = "menu_plate"

-- バーのオプション
OPTION_CAPTION  = 1
OPTION_CAPTION2 = 2
OPTION_IMAGE    = 4


-- テキストの揃え
ALIGN_LEFT    = 1
ALIGN_RIGHT   = 2
ALIGN_CENTER  = 4
ALIGN_TOP     = 8
ALIGN_BOTTOM  = 16
ALIGN_VCENTER = 32


-- AI 関連
AI_CAPTION_1_A     = "Level 1"
AI_CAPTION_1_B     = "ﾎ"
AI_BUTTON_SCRIPT_1 = "scripts\\menu\\s_push_com1.lua"
AI_SCRIPT_1        = "ai\\ai_level1.lua"
AI_LEVEL_1         = 1
AI_NAME_1          = "LEVEL 1"

AI_CAPTION_2_A     = "Level 2"
AI_CAPTION_2_B     = "ﾎﾎ"
AI_BUTTON_SCRIPT_2 = "scripts\\menu\\s_push_com2.lua"
AI_SCRIPT_2        = "ai\\ai_level2.lua"
AI_LEVEL_2         = 2
AI_NAME_2          = "LEVEL 2"

AI_CAPTION_3_A     = "Level 3"
AI_CAPTION_3_B     = "ﾎﾎﾎ"
AI_BUTTON_SCRIPT_3 = "scripts\\menu\\s_push_com3.lua"
AI_SCRIPT_3        = "ai\\ai_level3.lua"
AI_LEVEL_3         = 3
AI_NAME_3          = "LEVEL 3"

AI_CAPTION_4_A     = "Level 4"
AI_CAPTION_4_B     = "ﾎﾎﾎﾎ"
AI_BUTTON_SCRIPT_4 = "scripts\\menu\\s_push_com4.lua"
AI_SCRIPT_4        = "ai\\ai_level4.lua"
AI_LEVEL_4         = 4
AI_NAME_4          = "LEVEL 4"

AI_CAPTION_5_A     = "Level 5"
AI_CAPTION_5_B     = "ﾎﾎﾎﾎﾎ"
AI_BUTTON_SCRIPT_5 = "scripts\\menu\\s_push_com5.lua"
AI_SCRIPT_5        = "ai\\ai_level5.lua"
AI_LEVEL_5         = 5
AI_NAME_5          = "LEVEL 5"


function PlaySE_Button_OK()
	Scene.ControlSound( 0, CONTROL_STOP, "cursor8", 0 )
	Scene.ControlSound( 0, CONTROL_PLAY, "cursor8", 0 )
end

function PlaySE_Button_Cancel()
	Scene.ControlSound( 0, CONTROL_STOP, "cursor8_edited", 0 )
	Scene.ControlSound( 0, CONTROL_PLAY, "cursor8_edited", 0 )
end

function PlaySE_Button_Next()
	Scene.ControlSound( 0, CONTROL_STOP, "decide11", 0 )
	Scene.ControlSound( 0, CONTROL_PLAY, "decide11", 0 )
end



