code:
;-------------------------------------------------
;顔を描画する関数群。製作者　金吉獣料理
;-------------------------------------------------
;MAIDFACE{X}はARG:0～ARG:{X-1}のX人の顔を横に並べて出力する関数。
;画像のピクセル数はとりあえず自動的に150*150に近い物が選択される。
;height属性
;表示サイズの縦幅をフォントサイズに対する％で指定します。省略すると100です。
;負の値を指定した場合、画像を縦に反転して表示します。
;width属性
;表示サイズの横幅をフォントサイズに対する％で指定します。省略すると0です。
;0の場合、元画像の縦横比を維持する値になります。
;負の値を指定した場合、画像を横に反転して表示します。
;ypos属性
;表示位置の縦軸位置をフォントサイズに対する％で指定します。省略すると0です。
;「行の高さ」ではなく「フォントサイズ」が基準であることに注意してください。
;横軸位置の調整には<shape type='space'>やbuttonのpos属性を利用してください。
;-------------------------------------------------
@PRINT_MAIDFACE, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM LCOUNT
#DIM MEMO_REDRAW
#DIM ACTOR, 6
#DIM NUM_ACTOR
#DIMS MEMO_MAIDFACE

SIF TFLAG:颜绘スキップ
	RETURN 0

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

NUM_ACTOR = 0
VARSET ACTOR
FOR LCOUNT, 0, 6
	SIF LCOUNT >= 1 && ARG:LCOUNT <= 0
		BREAK
	SIF ARG:LCOUNT >= CHARANUM
		CONTINUE
	SIF CFLAG:(ARG:LCOUNT):颜绘 == 0
		CONTINUE

	ACTOR:NUM_ACTOR = ARG:LCOUNT
	NUM_ACTOR += 1
NEXT

VARSET LATESTFACECHARA
VARSET LATESTFACEID
STR:参照用MAIDFACE文字列 =

FOR LCOUNT, 0, 6
	SIF ACTOR:LCOUNT <= 0
		BREAK
	SIF ARG:LCOUNT >= CHARANUM
		CONTINUE

	;この中で STR:参照用MAIDFACE文字列 を用いて計算する
	CALL PRINT_MAIDFACE_SUB, ACTOR:LCOUNT, LCOUNT
NEXT

TFLAG:MAX_height = 0
STR:颜绘再現文字列 =
IF STR:参照用MAIDFACE文字列 != ""
	STR:颜绘再現文字列 = %STR:参照用MAIDFACE文字列%

	HTML_PRINT CONVERTSTR(STR:颜绘再現文字列)
	CALL MULTILINE, TFLAG:MAX_height
	TFLAG:颜绘表示中 = LINECOUNT
ENDIF
REDRAW MEMO_REDRAW

;-------------------------------------------------
;STR:参照用MAIDFACE文字列 を用いて颜绘の文字列を受け渡すので、これを呼ぶ前に初期化する事
;-------------------------------------------------
@PRINT_MAIDFACE_SUB, ARG, ARG:1
#DIMS MEMO_MAIDFACE
#DIM NUM_MAIDFACE

NUM_MAIDFACE = ARG:1

CALL SET_CHANGE_FACE, ARG

IF TFLAG:颜绘动画中
	MEMO_MAIDFACE = %MAIDFACE_ANIME(ARG, NUM_MAIDFACE)%
ELSE
	MEMO_MAIDFACE = %MAIDFACE(ARG, NUM_MAIDFACE)%
ENDIF

CALL CREATE_SPRITE_MAIDFACE, ARG, NUM_MAIDFACE, MEMO_MAIDFACE

@CREATE_SPRITE_MAIDFACE, ARG, ARG:1, ARGS
#DIMS MEMO_MAIDFACE
#DIM NUM_MAIDFACE

NUM_MAIDFACE = ARG:1
MEMO_MAIDFACE = %ARGS%

SIF MEMO_MAIDFACE == ""
	RETURN 0

CALL OVERLAY_GCREATE, MAIDEFACEID, @"%EXTSTR(MEMO_MAIDFACE, "", ",")%"

SIF SPRITECREATED(@"颜绘{MAIDEFACEID}")
	SPRITEDISPOSE @"颜绘{MAIDEFACEID}"

;スプライト名をつける
SPRITECREATE @"颜绘{MAIDEFACEID}", MAIDEFACEID
STR:参照用MAIDFACE文字列 += @"颜绘{MAIDEFACEID},%EXTSTR(MEMO_MAIDFACE, ",")%"

;作成した角色とIDをメモ
LATESTFACECHARA:NUM_MAIDFACE = ARG
LATESTFACEID:NUM_MAIDFACE = MAIDEFACEID

;MAIDEFACEIDを次のものにする
MAIDEFACEID += 1
SIF MAIDEFACEID >= 3500		;MAIDEFACEIDの保存数を返回場合はここを変える
	MAIDEFACEID = 3000

;GETCONFIG("一行の高さ")=19換算でARG行分高さに相当する値を返す
@PICSIZE(ARG)
#FUNCTION
#DIM LCOUNT
#DIM VALUE_height
#DIM REAL_height

VALUE_height = ARG*GETCONFIG("一行の高さ")
;一行の高さ=19の際に、実際にどのぐらいの尺寸になるかの目安
REAL_height = ARG*19

;まずは基本計算
LOCAL = 100*19*ARG/GETCONFIG("フォントサイズ")
LOCAL -= LOCAL%(100*GETCONFIG("一行の高さ")/GETCONFIG("フォントサイズ") )

RETURNF LOCAL

;CONFIG("颜绘サイズ")に応じたPICSIZEを返す
@MAIDFACESIZE()
#FUNCTION
RETURNF PICSIZE(9)

;余白も加味した颜绘サイズの半角文字数
@NUMC_MAIDFACE()
#FUNCTION
#DIM FSIZE
#DIM VALUE
FSIZE = MAIDFACESIZE()
;余白はFPOSとの和が100の倍数になるようにする(100 - FSIZE%100がその操作)
VALUE = FSIZE + 100 - FSIZE%100
;値100=全角一文字なので、半角を意味する50で割る。これでVALUEは半角何文字なのかが分かる
VALUE /= 50
;颜绘は横に６つ並べる予定なので、VALUE*6が横幅より著しく短い場合にはその分余白におまけをつける
;SIF NUM("折り返し文字数") - VALUE*6 > 6
;	VALUE += 1
RETURNF VALUE

;-------------------------------------------------
;出してしまった颜绘を消す関数
;もしも前提が異なる場合は数字を変える事
;-------------------------------------------------
@CLEAR_MAIDFACE
CLEARLINE MAIDFACESIZE()/100

SIF LATESTFACEID:0
	MAIDEFACEID = LATESTFACEID:0

VARSET LATESTFACECHARA
VARSET LATESTFACEID

;-------------------------------------------------
;角色ARGの顔を描画する関数。ARG:1には何人目の位置かが入っている
;ピクセル数は選べるようにしようと思ったが150*150固定
;-------------------------------------------------
@MAIDFACE(ARG, ARG:1)
#FUNCTIONS
#DIM LCOUNT
#DIM NUM_MAIDFACE
#DIM FSIZE
#DIM FPOS
#DIM MEMO_value
#DIMS MEMO_title

#DIMS BG
;髪
#DIMS RIBBON
#DIMS HAIR_LENGTH
#DIMS HAIR_LENGTH_ACCE
#DIMS HAIR_BACK
#DIMS HAIR_FRONT
#DIMS HAIR_AHOGE
;髪の横に出てるもの
#DIMS HAIR_SIDE
#DIMS HAIR_SIDE_FRONT
#DIMS HAIR_SIDE_L_BACK
#DIMS HAIR_SIDE_L
;麻花辫
#DIMS HAIR_PLAIT
#DIMS HAIR_PLAIT_L

#DIMS HAIR_MESH
#DIMS HAIR_INNER

#DIMS HAIR_PLAIT_INNER
#DIMS HAIR_PLAIT_L_INNER
;肌～口
#DIMS MAIDFACE_SKIN
#DIMS FACE_ACCE
#DIMS FACE_EFFECT
#DIMS SUNTAN
#DIMS MAKEUP
#DIMS HOHO
#DIMS HOKURO
#DIMS CHEEK
#DIMS EAR
#DIMS EAR_BACK
#DIMS ANIMAL_EARS
#DIMS MOUTH
#DIMS FANG
;目
#DIMS LEYE
#DIMS REYE
#DIMS LEYE_UNDER
#DIMS REYE_UNDER
#DIMS LEYE_OVER
#DIMS REYE_OVER
#DIM IS_LEYE_HIGHLIGHT
#DIM IS_REYE_HIGHLIGHT
#DIMS LEYE_HIGHLIGHT
#DIMS REYE_HIGHLIGHT
#DIMS LEYE_SIROME
#DIMS REYE_SIROME
;まつ毛
#DIMS LEYE_EYELASH
#DIMS REYE_EYELASH

;服装
#DIMS CLOBASE
#DIMS KASANEGI

;角
#DIMS TUNO_SIDE
#DIMS TUNO
#DIMS TUNO_MID
#DIMS TUNO_BACK
;眼鏡
#DIMS MEGANE
;眉
#DIMS MAYU
;其他
#DIMS BUKKAKE
#DIMS OTHER
#DIMS SWEAT
;帽子や髪飾は"頭の上に乗せてるだけ"or"頭上を覆う"or"フードのように頭部全体を覆う"など複数の段階に分かれる
#DIMS HAIRACCE_SMALL
#DIMS HAIRACCE_ZUN
#DIMS HAIRACCE_LARGE
#DIMS HAIRACCE_HUGE
#DIMS HAIRACCE_HEAD
;最終的に上３つをまとめてこれに置き換える
#DIMS HAIRACCE_FRONT
#DIMS HAIRACCE_OVER
#DIMS EMOTE
;萌え袖判定
#DIM IS_MOESODE
#DIMS EYE_COND

;CSTR:颜绘変化 の記録用(この関数内でのみ変化が起きるが、最後に元に戻すため)
#DIMS MEMO_CSTR

SIF CFLAG:ARG:颜绘 == 0
	RETURNF ""

NUM_MAIDFACE = ARG:1
BG =
RIBBON =

HAIR_LENGTH =
HAIR_LENGTH_ACCE =
HAIR_BACK =
HAIR_SIDE =
HAIR_SIDE_L =
HAIR_SIDE_L_BACK =
HAIR_SIDE_FRONT =
HAIR_PLAIT =
HAIR_PLAIT_L =
HAIR_FRONT =
HAIR_AHOGE =
HAIR_MESH =
HAIR_INNER =
HAIR_PLAIT_INNER =
HAIR_PLAIT_L_INNER =
MAIDFACE_SKIN =
FACE_ACCE =
FACE_EFFECT =
SUNTAN =
MAKEUP =
CHEEK =
HOHO =
HOKURO =
EAR =
EAR_BACK =
ANIMAL_EARS =
MOUTH =
FANG =
LEYE =
REYE =
LEYE_UNDER =
REYE_UNDER =
LEYE_OVER =
REYE_OVER =
IS_LEYE_HIGHLIGHT = 0
IS_REYE_HIGHLIGHT = 0
LEYE_HIGHLIGHT =
REYE_HIGHLIGHT =
LEYE_SIROME =
REYE_SIROME =
LEYE_EYELASH =
REYE_EYELASH =
MAYU =
TUNO_SIDE =
TUNO =
TUNO_BACK =
TUNO_MID =
MEGANE =
CLOBASE =
KASANEGI =
EMOTE =
OTHER =
BUKKAKE =
SWEAT =
HAIRACCE_ZUN =
HAIRACCE_SMALL =
HAIRACCE_LARGE =
HAIRACCE_HUGE =
HAIRACCE_HEAD =
HAIRACCE_FRONT =
HAIRACCE_OVER =
IS_MOESODE = 0
EYE_COND =

;一行の高さ19で９行相当にしたい。800だとフォントサイズの８倍なので縦の長さが足りない
FSIZE = MAIDFACESIZE()
FPOS = NUM_MAIDFACE * NUMC_MAIDFACE()*50

IF COND("颜绘セーブロード中")
	MEMO_value = CFLAG:ARG:角色用
ELSEIF COND("角色メイク中")
	MEMO_value = NO:ARG
ELSE
	MEMO_value = CFLAG:ARG:優先順位
ENDIF
SIF COND("阴蒂ック指令表示中") == 0 && COND("角色メイク中") == 0
	MEMO_value = 0

MEMO_title =

;背景
IF COND("颜绘セーブロード中")
	BG = 0e+
	MEMO_title = [{CFLAG:ARG:角色用, 2}]号的数据
ELSEIF COND("角色メイク中") || COND("お友達紹介イベント中") || COND("颜绘セーブロード中") || COND("颜绘シミュ中")
	BG = 0e+
	MEMO_title = [%CSTR:ARG:称号%]%NAME:ARG% (%CSTR:ARG:学年%) 特技：%CSTR:ARG:建议%
ELSE
	MEMO_title = [%CSTR:ARG:称号%]%NAME:ARG% (%CSTR:ARG:学年%) 特技：%CSTR:ARG:建议%
	SIF CFLAG:ARG:躁动难忍
		MEMO_title += "（躁动难忍している）"

	IF DAYEV("圣诞节期間") && PLACE("野外") && COND("归途")
		BG = 0圣诞节+
	ELSEIF DAYEV("圣诞节期間") && COND("约会中") && COND("夕") + COND("夜")
		BG = 0圣诞节+
	ELSEIF COND("登校中")
		IF DAYEV("夏服期間")
			BG = 0c1+
		ELSE
			BG = 0c0+
		ENDIF
	ELSEIF PLACE("魔界")
		BG = 0魔界空+
	ELSEIF PLACE("映画館")
		BG = 0映画館+
	ELSEIF PLACE("図書館") || PLACE("書店")
		BG = 0図書館+
	ELSEIF PLACE("喫茶店")
		IF COND("夜")
			BG = 0喫茶店夜+
		ELSE
			BG = 0喫茶店昼+
		ENDIF
	ELSEIF PLACE("公園")
		BG = 0公園_%TEXTS("季節")%_%TEXTS("時間")%
	ELSEIF PLACE("裏路地")
		IF COND("夜")
			BG = 0裏路地夜+
		ELSE
			BG = 0裏路地傍晚+
		ENDIF
	ELSEIF PLACE("試着室")
		BG = 0e+
	ELSEIF PLACE("ロッカールーム") || PLACE("教室")
		BG = 0部室+
	ELSEIF PLACE("海")
		SELECTCASE NUM_MAIDFACE
		CASE 0
			BG = 0海+
		CASEELSE
			BG = 0海1+
		ENDSELECT
	ELSEIF PLACE("部室")
		SELECTCASE NUM_MAIDFACE
		CASE 0
			SELECTCASE TEXTS("季節")
			CASE "春"
				BG = 0部室1+
			CASE "夏"
				BG = 0部室3+
			CASE "秋"
				BG = 0部室1+
			CASE "冬"
				BG = 0部室2+
			ENDSELECT
		CASEELSE
			BG = 0部室+
		ENDSELECT
	ELSEIF PLACE("情人旅館")
		IF COND("夜")
			BG = 0情人旅館夜+
		ELSE
			BG = 0情人旅館傍晚+
		ENDIF
	ELSEIF PLACE("Ｈ目的") && PLACE("学園内")
		BG = 0部室+
	ELSEIF COND("夜")
		SELECTCASE NUM_MAIDFACE
		CASE 0
			BG = 0b+
		CASEELSE
			BG = 0b1+
		ENDSELECT
	ELSEIF COND("归途")
		;雨に降られた
		IF STRCOUNT(SAVESTR:現在位置, "阵雨")
			BG = 0f2+
		ELSE
			BG = 0f1+
		ENDIF
	ELSE
		SELECTCASE NUM_MAIDFACE
		CASE 0
			IF DAYEV("夏服期間")
				BG = 0c1+
			ELSE
				BG = 0c0+
			ENDIF
		CASEELSE
			IF DAYEV("夏服期間")
				BG = 0c3+
			ELSE
				BG = 0c2+
			ENDIF
		ENDSELECT
	ENDIF
	IF CFLAG:ARG:Cosplay中
		IF CHECK_BODYS("兔", ARG)
			BG = 0h%TOSTR(RAND:4)%+
		ELSEIF CHECK_SHIRT("旗袍", ARG)
			BG = 0g+
		ENDIF
	ENDIF
ENDIF

IF CSTR:ARG:颜绘変化 == "無人"
	RETURNF @"%BG%,{FPOS},{FSIZE},{FSIZE},{0},{MEMO_value},%MEMO_title%/"
ELSEIF CEVENT("颜绘没有", ARG)
	LOCALS = 0e+,{FPOS},{FSIZE},{FSIZE},{0},{MEMO_value},/
	RETURNF LOCALS
ELSEIF COND("颜绘パネル中", ARG)
	;現在存在している角色
	IF EXISTCSV_EX(NO:ARG)
		LOCALS = 颜绘パネル{NO:ARG}+,{FPOS},{FSIZE},{FSIZE},{0},{MEMO_value},%MEMO_title%/
		RETURNF LOCALS
	ENDIF
ENDIF

MEMO_CSTR = %CSTR:ARG:颜绘変化%
;CSTR:颜绘変化 を調整する
IF CSTR:ARG:颜绘変化改髪 != ""
	VARSET LOCALS
	SPLIT @"/%CSTR:ARG:颜绘変化%", "/", LOCALS

	;颜绘コンディションも見る
	SIF STRCOUNT(CSTR:ARG:颜绘変化改髪, @"＠%CONDS("颜绘コンディション", ARG)%：") && STRCOUNT(CSTR:ARG:颜绘変化, CONDS("颜绘コンディション", ARG) ) == 0
		LOCALS:0 = %CONDS("颜绘コンディション", ARG)%

	CSTR:ARG:颜绘変化 =
	FOR LCOUNT, 0, 10
		SELECTCASE LOCALS:LCOUNT
		CASE ""
			CONTINUE
		CASEELSE
			IF STRCOUNT(CSTR:ARG:颜绘変化改髪, @"＠%LOCALS:LCOUNT%：")
				CSTR:ARG:颜绘変化 += @"%EXTSTR(CSTR:ARG:颜绘変化改髪, @"%LOCALS:LCOUNT%：", "_")%/"
			ELSE
				CSTR:ARG:颜绘変化 += @"%LOCALS:LCOUNT%/"
			ENDIF
		ENDSELECT
	NEXT
	CSTR:ARG:颜绘変化改髪 =
ENDIF

HAIR_FRONT = 16%CONDS("前髪", ARG)%\[%CONDS("髪色の種類", ARG)%\]+
SELECTCASE CONDS("前髪", ARG)
CASE "撩刘海", "編髪", "外八刘海", "外八刘海２", "露额頭", "露额頭２", "分卷发２"
	SIF TALENT:ARG:動物耳
		HAIR_FRONT = 16%CONDS("前髪", ARG)%動物耳\[%CONDS("髪色の種類", ARG)%\]+
CASE "乱髪２", "乱髪３"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
		HAIR_FRONT = 16%CONDS("前髪", ARG)%長\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "長鬓角", "長鬓角２"
	HAIR_FRONT += @"16%CONDS("前髪", ARG)%髪飾\[%CONDS("髪色の種類", ARG)%\]+"
ENDSELECT

SELECTCASE CONDS("髪長", ARG)
CASE "短"
	SELECTCASE CONDS("後髪", ARG)
	CASE "自然"
		HAIR_LENGTH = 4自然短\[%CONDS("髪色の種類", ARG)%\]+
	CASE "外八"
		HAIR_LENGTH = 4外八短\[%CONDS("髪色の種類", ARG)%\]+
	CASE "卷髪"
		HAIR_LENGTH = 4卷髪短\[%CONDS("髪色の種類", ARG)%\]+
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "巻髪"
	SELECTCASE CONDS("後髪", ARG)
	CASE "自然"
		HAIR_LENGTH = 4自然巻髪\[%CONDS("髪色の種類", ARG)%\]+
	CASE "直髪"
		HAIR_LENGTH = 4直髪巻髪\[%CONDS("髪色の種類", ARG)%\]+
	CASE "外八"
		HAIR_LENGTH = 4外八巻髪\[%CONDS("髪色の種類", ARG)%\]+
	CASE "卷髪"
		HAIR_LENGTH = 4卷髪巻髪\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "中等長度"
	SELECTCASE CONDS("後髪", ARG)
	CASE "自然"
		HAIR_LENGTH = 4自然中等長度\[%CONDS("髪色の種類", ARG)%\]+
	CASE "直髪"
		HAIR_LENGTH = 4直髪中等長度\[%CONDS("髪色の種類", ARG)%\]+
	CASE "外八"
		HAIR_LENGTH = 4外八中等長度\[%CONDS("髪色の種類", ARG)%\]+
	CASE "卷髪"
		HAIR_LENGTH = 4卷髪中等長度\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "披肩"
	SELECTCASE CONDS("後髪", ARG)
	CASE "自然"
		HAIR_LENGTH = 4自然披肩\[%CONDS("髪色の種類", ARG)%\]+
	CASE "直髪"
		HAIR_LENGTH = 4直髪中等長度\[%CONDS("髪色の種類", ARG)%\]+
	CASE "外八"
		HAIR_LENGTH = 4外八中等長度\[%CONDS("髪色の種類", ARG)%\]+
	CASE "卷髪"
		HAIR_LENGTH = 4卷髪披肩\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "長", "超長"
	SELECTCASE CONDS("後髪", ARG)
	CASE "自然"
		HAIR_LENGTH = 4自然長\[%CONDS("髪色の種類", ARG)%\]+
	CASE "直髪"
		HAIR_LENGTH = 4直髪長\[%CONDS("髪色の種類", ARG)%\]+
	CASE "外八"
		HAIR_LENGTH = 4外八長\[%CONDS("髪色の種類", ARG)%\]+
	CASE "卷髪"
		HAIR_LENGTH = 4卷髪長\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
ENDSELECT
SIF COND("種族：史莱姆", ARG)
	HAIR_LENGTH = 4液状後髪\[%CONDS("髪色の種類", ARG)%\]+

SELECTCASE CONDS("改髪", ARG)
CASE "三股辫双马尾ール"
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE_L_BACK = 3左三股辫尾\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右三股辫尾\[%CONDS("髪色の種類", ARG)%\]+
CASE "おしゃれ三股辫"
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_PLAIT_L = 3左おしゃれ三股辫\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_PLAIT = 6右おしゃれ三股辫\[%CONDS("髪色の種類", ARG)%\]+

	HAIR_PLAIT_L_INNER = 17左おしゃれ三股辫\[%CONDS("渐变颜色", ARG)%\]+
	HAIR_PLAIT_INNER = 17右おしゃれ三股辫\[%CONDS("渐变颜色", ARG)%\]+
CASE "長双马尾ール"
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE_L_BACK = 3左長尾\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右長尾\[%CONDS("髪色の種類", ARG)%\]+
CASE "双马尾"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
	HAIR_SIDE_L_BACK = 3左尾\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右尾\[%CONDS("髪色の種類", ARG)%\]+
CASE "短双马尾ール"
	HAIR_SIDE_L_BACK = 3左短尾\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右短尾\[%CONDS("髪色の種類", ARG)%\]+
CASE "卷双马尾ール"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
	HAIR_SIDE_L_BACK = 3左卷髪\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右卷髪\[%CONDS("髪色の種類", ARG)%\]+
CASE "钻頭双马尾ール"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
	HAIR_SIDE_L_BACK = 3左钻頭\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右钻頭\[%CONDS("髪色の種類", ARG)%\]+
CASE "团子頭双马尾ール"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
	HAIR_SIDE_L_BACK = 3左団子頭尾\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右団子頭尾\[%CONDS("髪色の種類", ARG)%\]+
CASE "細双马尾"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
	HAIR_SIDE_L_BACK = 3左細尾\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右細尾\[%CONDS("髪色の種類", ARG)%\]+

;これだけ他の改髪とは別物レベルに特殊なので要注意
CASE "三股辫编发"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
	HAIR_SIDE = 6右三股辫编发\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE_FRONT = 6右三股辫编发前\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE_L_BACK = 3左三股辫编发\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE_L = 3左三股辫编发前\[%CONDS("髪色の種類", ARG)%\]+

CASE "侧边马尾"
	SELECTCASE CONDS("髪長", ARG)
	CASE "短", "巻髪"
		HAIR_SIDE_L_BACK = 3左短尾\[%CONDS("髪色の種類", ARG)%\]+
	CASEELSE
		HAIR_SIDE_L_BACK = 3左尾\[%CONDS("髪色の種類", ARG)%\]+
		SELECTCASE CONDS("後髪", ARG)
		CASE "自然"
			HAIR_LENGTH = 4自然巻髪\[%CONDS("髪色の種類", ARG)%\]+
		CASE "直髪"
			HAIR_LENGTH = 4直髪巻髪\[%CONDS("髪色の種類", ARG)%\]+
		CASE "外八"
			HAIR_LENGTH = 4外八巻髪\[%CONDS("髪色の種類", ARG)%\]+
		CASE "卷髪"
			HAIR_LENGTH = 4卷髪巻髪\[%CONDS("髪色の種類", ARG)%\]+
		ENDSELECT

	ENDSELECT
CASE "马尾辫"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
		HAIR_BACK = 3長马尾辫\[%CONDS("髪色の種類", ARG)%\]+
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
		HAIR_BACK = 3马尾辫\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "麻花辫"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
		HAIR_LENGTH = 4麻花辫長\[%CONDS("髪色の種類", ARG)%\]+
	CASEELSE
		HAIR_LENGTH = 4麻花辫披肩\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "麻花辫２"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
		HAIR_LENGTH = 4麻花辫２長
	CASE "披肩"
		HAIR_LENGTH = 4麻花辫２披肩
	CASEELSE
		HAIR_LENGTH = 4麻花辫２中等長度
	ENDSELECT

	SELECTCASE CONDS("後髪", ARG)
	CASE "直髪"
		HAIR_LENGTH += @"直髪\[%CONDS("髪色の種類", ARG)%\]+"
	CASEELSE
		HAIR_LENGTH += @"\[%CONDS("髪色の種類", ARG)%\]+"
	ENDSELECT
CASE "单辫"
	SELECTCASE CONDS("髪長", ARG)
	CASE "長", "超長"
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
		HAIR_BACK = 3長单辫\[%CONDS("髪色の種類", ARG)%\]+
	CASEELSE
		HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
		HAIR_BACK = 3单辫\[%CONDS("髪色の種類", ARG)%\]+
	ENDSELECT
CASE "单辫２"
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_BACK = 3单辫２\[%CONDS("髪色の種類", ARG)%\]+
CASE "双辫"
	HAIR_LENGTH = 4双辫\[%CONDS("髪色の種類", ARG)%\]+
CASE "三股辫"
	HAIR_LENGTH_ACCE = 6三股辫\[%CONDS("髪色の種類", ARG)%\]+
CASE "大三股辫"
	HAIR_LENGTH = 4大三股辫\[%CONDS("髪色の種類", ARG)%\]+
CASE "団子頭"
	HAIR_SIDE_L_BACK = 3左団子頭\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6右団子頭\[%CONDS("髪色の種類", ARG)%\]+
CASE "低団子頭"
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_BACK = 3低団子頭\[%CONDS("髪色の種類", ARG)%\]+
CASE "编起来"
	HAIR_BACK = 3编起来\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
CASE "盘頭"
	HAIR_BACK = 3盘頭\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
CASE "高侧盘頭"
	HAIR_LENGTH = 4直髪短\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_SIDE = 6高侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
CASE "侧盘頭"
	SELECTCASE CONDS("髪長", ARG)
	CASE "短", "巻髪"
		HAIR_LENGTH = 4巻髪侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
	CASE "中等長度", "披肩"
		SELECTCASE CONDS("後髪", ARG)
		CASE "卷髪"
			HAIR_LENGTH = 4卷髪中等長度侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
		CASEELSE
			HAIR_LENGTH = 4直髪中等長度侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
		ENDSELECT
	CASEELSE
		SELECTCASE CONDS("後髪", ARG)
		CASE "直髪"
			HAIR_LENGTH = 4直髪長侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
		CASE "卷髪"
			HAIR_LENGTH = 4卷髪長侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
		CASE "外八"
			HAIR_LENGTH = 4外八長侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
		CASEELSE
			HAIR_LENGTH = 4自然長侧盘頭\[%CONDS("髪色の種類", ARG)%\]+
		ENDSELECT
	ENDSELECT
CASE "简易扎发"
	HAIR_LENGTH = 4简易扎发\[%CONDS("髪色の種類", ARG)%\]+
	HAIR_LENGTH_ACCE = 4简易扎发バレッタカラー\[%CONDS("髪色の種類", ARG)%\]+
CASE "妹妹頭"
	HAIR_LENGTH = 4妹妹頭\[%CONDS("髪色の種類", ARG)%\]+
ENDSELECT

SELECTCASE NONUM(CONDS("呆毛", ARG) )
CASE "呆毛"
	HAIR_AHOGE = 19%CONDS("呆毛", ARG)%\[%CONDS("髪色の種類", ARG)%\]+
;色が無いもの
CASE "触角"
	HAIR_AHOGE = 19%CONDS("呆毛", ARG)%+
ENDSELECT

SELECTCASE NONUM(CONDS("挑染の種類", ARG) )
CASE "挑染"
	HAIR_MESH = 17%CONDS("挑染の種類", ARG)%\[%CONDS("挑染の色", ARG)%\]+
ENDSELECT

SELECTCASE CONDS("蝴蝶結", ARG)
CASE "无蝴蝶結"
CASE "頭上蝴蝶結"
	SELECTCASE CONDS("髪色の種類", ARG)
	CASE "青"
		HAIRACCE_SMALL = 15頭上蝴蝶結黄+
	CASE "黒", "銀", "緑"
		HAIRACCE_SMALL = 15頭上蝴蝶結赤+
	CASE "赤", "茶", "桃", "桃金"
		HAIRACCE_SMALL = 15頭上蝴蝶結白+
	CASE "金"
		HAIRACCE_SMALL = 15頭上蝴蝶結青+
	CASEELSE
		HAIRACCE_SMALL = 15頭上蝴蝶結黒+
	ENDSELECT
CASE "頭後蝴蝶結"
	SELECTCASE CONDS("髪色の種類", ARG)
	CASE "赤", "桃", "桃金", "紫"
		RIBBON = 1%CONDS("蝴蝶結", ARG)%白+
	CASE "青", "緑"
		RIBBON = 1%CONDS("蝴蝶結", ARG)%黄+
	CASEELSE
		RIBBON = 1%CONDS("蝴蝶結", ARG)%赤+
	ENDSELECT
CASEELSE
	SELECTCASE CONDS("改髪", ARG)
	CASE "団子頭", "团子頭双马尾ール"
		HAIR_SIDE += @"1%CONDS("蝴蝶結", ARG)%団子頭%CLOCOLOR_MAIDFACE(@"%CONDS("蝴蝶結", ARG)%団子頭", "", ARG)%+"
	CASE "侧边马尾"
		IF CONDS("蝴蝶結", ARG) == "单側蝴蝶結" && CONDS("髪長", ARG) == "長" && CONDS("後髪", ARG) == "自然"
			HAIR_SIDE += "1单側蝴蝶結侧边马尾+"
		ELSE
			RIBBON = 1%CONDS("蝴蝶結", ARG)%%CLOCOLOR_MAIDFACE(CONDS("蝴蝶結", ARG), "", ARG)%+
		ENDIF
	CASE "三股辫编发"

	CASEELSE
		RIBBON = 1%CONDS("蝴蝶結", ARG)%%CLOCOLOR_MAIDFACE(CONDS("蝴蝶結", ARG), "", ARG)%+
	ENDSELECT
ENDSELECT
SIF CHECK_OTHER("簪子", ARG)
	RIBBON = 1簪子+

;顔
MAIDFACE_SKIN = 7肌\[%CONDS("顔の色", ARG)%\]+
;晒痕
SIF COND("晒痕", ARG)
	SUNTAN = 7晒痕%CONDS("晒痕トップ", ARG)%\[%CONDS("顔の色晒痕有", ARG)%\]+
;坊主頭
SELECTCASE CONDS("髪長", ARG)
CASE "坊主"
	HAIR_LENGTH =
	HAIR_LENGTH_ACCE =
	HAIR_BACK =
	HAIR_SIDE =
	HAIR_SIDE_L =
	HAIR_SIDE_L_BACK =
	HAIR_SIDE_FRONT =
	HAIR_PLAIT =
	HAIR_PLAIT_L =
	HAIR_FRONT =
	HAIR_AHOGE =
	HAIR_MESH =
	HAIR_INNER =
	HAIR_PLAIT_INNER =
	HAIR_PLAIT_L_INNER =

	IF COND("晒痕", ARG)
		SUNTAN += @"7坊主\[晒痕\]+"
	ELSE
		MAIDFACE_SKIN += @"7坊主\[%CONDS("顔の色", ARG)%\]+"
	ENDIF
ENDSELECT

;頬化粧
SELECTCASE CONDS("頬化粧", ARG)
CASE "脸谱赤"
	MAKEUP = 8脸谱\[赤\]+
CASE "脸谱青"
	MAKEUP = 8脸谱\[青\]+
CASE "战妆"
	MAKEUP = 8战妆\[灰\]+
CASE "光滑"
	MAKEUP = 8%CONDS("頬化粧", ARG)%+
ENDSELECT
;頬傷や頬創口貼
SIF STRCOUNT(CSTR:ARG:頬, "頬傷左")
	HOHO += @"8頬傷左\[%CONDS("顔の色", ARG)%\]+"
SIF STRCOUNT(CSTR:ARG:頬, "頬傷右")
	HOHO += @"8頬傷右\[%CONDS("顔の色", ARG)%\]+"
SIF STRCOUNT(CSTR:ARG:頬, "頬傷鼻")
	HOHO += @"8頬傷鼻\[%CONDS("顔の色", ARG)%\]+"
SIF STRCOUNT(CSTR:ARG:頬, "頬創口貼左")
	HOHO += @"8頬創口貼左\[白\]+"
SIF STRCOUNT(CSTR:ARG:頬, "頬創口貼右")
	HOHO += @"8頬創口貼右\[白\]+"
SIF STRCOUNT(CSTR:ARG:頬, "頬創口貼鼻")
	HOHO += @"8頬創口貼鼻\[白\]+"

;口
IF COND("種族：獣人", ARG)
	FANG = 牙１
ELSEIF COND("種族：吸血鬼", ARG) + COND("種族：竜人", ARG)
	FANG = 牙２
ENDIF
SELECTCASE CONDS("嘴形の種類", ARG)
CASE "大口", "ワ", "半開", "ヮ"
	MOUTH = 9%CONDS("嘴形", ARG)%%FANG%+
CASEELSE
	MOUTH = 9%CONDS("嘴形", ARG)%+
ENDSELECT

;目
SELECTCASE NONUM(CONDS("左眼形", ARG) )
;色が関係ない目
CASE "笑颜", "ほんわか", "〇〇", "＞＜", "涙目〇〇", "涙目＞＜", "号泣", "婴儿哭"
	LEYE = 11%CONDS("左眼形", ARG)%左+
CASE "眯眯眼", "闭眼"
	LEYE = 11%NONUM(CONDS("左眼形", ARG) )%%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
CASE "陰"
	FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
CASEELSE
	LEYE = 11%CONDS("左眼形", ARG)%左\[%CONDS("左瞳色", ARG)%\]+
ENDSELECT
SELECTCASE NONUM(CONDS("右眼形", ARG) )
;色が関係ない目
CASE "笑颜", "ほんわか", "〇〇", "＞＜", "涙目〇〇", "涙目＞＜", "号泣", "婴儿哭"
	REYE = 11%CONDS("右眼形", ARG)%右+
CASE "眯眯眼", "闭眼"
	REYE = 11%NONUM(CONDS("右眼形", ARG) )%%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+
CASE "陰"
	SIF CONDS("左眼形", ARG) != "陰"
		FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
CASEELSE
	REYE = 11%CONDS("右眼形", ARG)%右\[%CONDS("右瞳色", ARG)%\]+
ENDSELECT
SELECTCASE CONDS("顔効果", ARG)
CASE "目陰"
	FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
CASE "青ざめ"
	FACE_EFFECT = 22青ざめ+
ENDSELECT

;高光の有無（実際にどの高光を使うかは後に本決定する）
SIF CONDS("左高光", ARG) != "无"
	IS_LEYE_HIGHLIGHT = 1
SIF CONDS("右高光", ARG) != "无"
	IS_REYE_HIGHLIGHT = 1

;眉
MAYU = 18%CONDS("眉形", ARG)%\[%CONDS("眉の色", ARG)%\]+

IF TALENT:ARG:動物耳
	ANIMAL_EARS = 12%CONDS("動物耳の形", ARG)%\[%CONDS("髪色の種類", ARG)%\]+

	;内耳があるか判定
	SELECTCASE NONUM(CONDS("動物耳の形", ARG) )
	CASE "人鱼耳"
	CASEELSE
		ANIMAL_EARS += @"12%CONDS("動物耳の形", ARG)%内耳\[%CONDS("髪色の種類", ARG)%\]+"
	ENDSELECT
ENDIF

IF TALENT:ARG:動物耳 == 0 || CEVENT("四つ耳", ARG)
	IF TALENT:ARG:精灵耳
		EAR = 12%CONDS("普通耳の形", ARG)%\[%CONDS("顔の色晒痕有", ARG)%\]+
		EAR_BACK = 12%CONDS("普通耳の形", ARG)%左\[%CONDS("顔の色晒痕有", ARG)%\]+
	ELSE
		;髪型次第では人类耳は隠れる
		SELECTCASE CONDS("髪長", ARG)
		CASE "披肩", "長", "超長"
			SELECTCASE NONUM(CONDS("前髪", ARG) )
			;短系なので耳を隠さない前髪
			CASE "撩刘海", "編髪", "外八刘海", "露额頭", "齐刘海", "不对称", "Ｍ字刘海", "後梳"
				EAR = 12%CONDS("普通耳の形", ARG)%\[%CONDS("顔の色晒痕有", ARG)%\]+
			CASEELSE
				SELECTCASE NONUM(CONDS("改髪", ARG) )
				CASE "编起来", "盘頭", "高侧盘頭", "双马尾", "短双马尾ール", "長双马尾ール", "卷双马尾ール", "钻頭双马尾ール", "团子頭双马尾ール", "細双马尾", "马尾辫", "单辫", "三股辫双马尾ール", "三股辫编发"
					EAR = 12%CONDS("普通耳の形", ARG)%\[%CONDS("顔の色晒痕有", ARG)%\]+
				ENDSELECT
			ENDSELECT
		CASEELSE
			EAR = 12%CONDS("普通耳の形", ARG)%\[%CONDS("顔の色晒痕有", ARG)%\]+
		ENDSELECT
	ENDIF
ENDIF

;会話中は吹き出しON
SIF TFLAG:交流中 || CFLAG:ARG:交流中
	EMOTE = 21对话框兴奋+

;精神状態で少し変化
SELECTCASE CONDS("颜绘コンディション", ARG)
CASE "睡眠"
	LEYE = 11闭眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
	REYE = 11闭眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+

	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "へ字", "大口", "ワ", "嘟嘴"
		MOUTH = 9半開%FANG%+
	CASE "ヮ"
		MOUTH = 9無口系+
	CASE "嘲笑", "いー"
		MOUTH = 9へ字+
	CASE "笑顔"
		MOUTH = 9微笑+
	ENDSELECT

	SIF EXP_GAIN("睡眠姦経験", ARG)
		CHEEK = 8赤面\[赤面]+

	SELECTCASE CONDS("眉形", ARG)
	CASE "憤怒眉", "憤怒眉短"
		MAYU = 18通常眉%CONDS("眉の長さ", ARG)%\[%CONDS("眉の色", ARG)%\]+
	ENDSELECT

	EMOTE = 21对话框睡眠+
CASE "刚睡醒"
	SELECTCASE CONDS("眼形", ARG)
	CASE "眯眯眼"
	CASEELSE
		LEYE = 11斜眼%CONDS("眼形の番号", ARG)%左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11斜眼%CONDS("眼形の番号", ARG)%右\[%CONDS("右瞳色", ARG)%\]+
	ENDSELECT

	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "へ字", "大口", "ワ", "笑顔", "嘟嘴"
		MOUTH = 9半開%FANG%+
	CASE "ヮ"
		MOUTH = 9無口系+
	CASE "微笑", "へ字", "嘲笑", "いー"
		MOUTH = 9△+
	ENDSELECT

	EMOTE = 21对话框困倦+
	;萌え袖
	SIF CHECK_SHIRT("萌え袖", ARG)
		IS_MOESODE = 1
CASE "心情差"
	SELECTCASE CONDS("眼形", ARG)
	CASE "三白眼", "重度三白眼"
		LEYE = 11重度三白眼左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11重度三白眼右\[%CONDS("右瞳色", ARG)%\]+
	CASEELSE
		LEYE = 11斜眼%CONDS("眼形の番号", ARG)%左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11斜眼%CONDS("眼形の番号", ARG)%右\[%CONDS("右瞳色", ARG)%\]+
	ENDSELECT

	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "微笑", "笑顔", "大口", "ワ", "無口系", "ヮ"
		MOUTH = 9△+
	CASE "△", "ω", "嘲笑", "いー"
		MOUTH = 9無口系+
	ENDSELECT
	CHEEK =
	;会話エモートは消す
	SIF CFLAG:ARG:交流中 == 0
		EMOTE =
	;EMOTE = 21对话框憤怒+
CASE "憤怒"
	SELECTCASE CONDS("眼形", ARG)
	CASE "重度三白眼"
		LEYE = 11三白眼左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11三白眼右\[%CONDS("右瞳色", ARG)%\]+
	ENDSELECT

	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "ω", "ワ"
		MOUTH = 9嘟嘴+
	CASEELSE
		MOUTH = 9△+
	ENDSELECT

	SELECTCASE CONDS("眉形", ARG)
	CASE "麻呂眉"
	CASEELSE
		MAYU = 18憤怒眉%CONDS("眉の長さ", ARG)%\[%CONDS("眉の色", ARG)%\]+
	ENDSELECT
	CHEEK =
	EMOTE = 21对话框憤怒+
CASE "甜言蜜语"
	IF TALENT:ARG:高贵 + TALENT:ARG:冷静 + TALENT:ARG:清楚
		IF CFLAG:ARG:夸奖 && CFLAG:ARG:躁动难忍 == 0
			LEYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
			REYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+
		ENDIF

		SELECTCASE CONDS("嘴形の種類", ARG)
		CASE "大口", "半開"
			MOUTH = 9ω+
		CASE "笑顔"
			MOUTH = 9ワ%FANG%+
		CASE "△", "へ字", "無口系", "嘲笑", "いー", "ヮ"
			MOUTH = 9微笑+
		ENDSELECT
	ELSE
		IF CFLAG:ARG:夸奖 && CFLAG:ARG:躁动难忍 == 0
			LEYE = 11笑颜%CONDS("笑颜目の対応番号", ARG)%左+
			REYE = 11笑颜%CONDS("笑颜目の対応番号", ARG)%右+
		ENDIF
		SELECTCASE CONDS("嘴形の種類", ARG)
		CASE "半開", "嘲笑"
			MOUTH = 9ω+
		CASE "△", "へ字", "無口系", "ヮ"
			MOUTH = 9微笑+
		ENDSELECT
	ENDIF
	CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
	IF TALENT:ARG:叛逆 == 0 && (TALENT:ARG:恋慕 || CFLAG:ARG:夸奖 || CFLAG:ARG:躁动难忍) && TFLAG:交流中 == 0 && CFLAG:ARG:交流中 == 0
		EMOTE = 21对话框爱心+
		;恋慕or淫乱＆躁动难忍なら爱心眼に
		SIF TALENT:ARG:恋慕 + TALENT:ARG:淫乱 && CFLAG:ARG:躁动难忍 && STRCOUNT(CSTR:ARG:颜绘変化, "爱心眼") == 0
			CSTR:ARG:颜绘変化 += "/爱心眼"
	ENDIF
CASE "夸奖"
	SELECTCASE CONDS("眉形", ARG)
	CASE "困扰眉", "困扰眉短"
		MAYU = 18斜眉%CONDS("眉の長さ", ARG)%\[%CONDS("眉の色", ARG)%\]+
	ENDSELECT

	IF TALENT:ARG:高贵 + TALENT:ARG:冷静 + TALENT:ARG:清楚
		LEYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
		REYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+

		SELECTCASE CONDS("嘴形の種類", ARG)
		CASE "大口", "半開"
			MOUTH = 9ω+
		CASE "笑顔"
			MOUTH = 9ワ%FANG%+
		CASE "△", "へ字", "無口系", "ヮ"
			MOUTH = 9微笑+
		ENDSELECT
	ELSE
		LEYE = 11笑颜%CONDS("笑颜目の対応番号", ARG)%左+
		REYE = 11笑颜%CONDS("笑颜目の対応番号", ARG)%右+

		SELECTCASE CONDS("嘴形の種類", ARG)
		CASE "半開"
			MOUTH = 9ω+
		CASE "△", "へ字", "無口系", "ヮ"
			MOUTH = 9微笑+
		ENDSELECT
	ENDIF
	SIF TALENT:ARG:冷静 + TALENT:ARG:感情缺乏 == 0
		CHEEK = 8红晕\[%CONDS("脸颊カラー", ARG)%\]+
	SIF TFLAG:交流中 == 0 && CFLAG:ARG:交流中 == 0
		EMOTE = 21对话框開心+
CASE "叛逆"
	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "微笑", "笑顔", "大口", "ω", "ワ"
		MOUTH = 9へ字+
	ENDSELECT
	MAYU = 18憤怒眉%CONDS("眉の長さ", ARG)%\[%CONDS("眉の色", ARG)%\]+
	CHEEK =
CASE "躁动难忍"
	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "笑顔"
		MOUTH = 9△+
	ENDSELECT
	CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
	IF TALENT:ARG:叛逆 == 0 && COND("発情中", ARG)
		SELECTCASE CONDS("眉形", ARG)
		CASE "麻呂眉"
		CASEELSE
			MAYU = 18困扰眉%CONDS("眉の長さ", ARG)%\[%CONDS("眉の色", ARG)%\]+
		ENDSELECT
		MOUTH = 9半開%FANG%+
		;EMOTE = 21对话框爱心+
	ENDIF
CASE "害羞"
	SELECTCASE CONDS("眉形", ARG)
	CASE "麻呂眉", "憤怒眉", "憤怒眉短"
	CASEELSE
		MAYU = 18困扰眉%CONDS("眉の長さ", ARG)%\[%CONDS("眉の色", ARG)%\]+
	ENDSELECT
	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "嘲笑"
		MOUTH = 9嘲笑２+
	CASE "へ字"
		MOUTH = 9小口+
	ENDSELECT
	CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
	;萌え袖
	SIF CHECK_SHIRT("萌え袖", ARG)
		IS_MOESODE = 1
CASE "惊嚇"
	LEYE = 11〇〇左+
	REYE = 11〇〇右+

	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "微笑", "へ字", "笑顔", "大口", "ω", "ワ", "嘲笑", "いー"
		MOUTH = 9△+
	ENDSELECT

	CHEEK =
	EMOTE = 21对话框惊讶+
CASE "小悪魔"
	SELECTCASE CONDS("眼形", ARG)
	CASE "三白眼"
		LEYE = 11重度三白眼左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11重度三白眼右\[%CONDS("右瞳色", ARG)%\]+
	ENDSELECT

	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "ω", "嘲笑", "いー"
	CASEELSE
		MOUTH = 9微笑+
	ENDSELECT

	CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
	;萌え袖
	SIF CHECK_SHIRT("萌え袖", ARG)
		IS_MOESODE = 1
CASE "闲"
	EYE_COND = 半目
	SELECTCASE CONDS("嘴形の種類", ARG)
	CASE "微笑", "ω", "猫口", "笑顔", "呀哒", "ワ", "ヮ", "大口", "嘲笑", "ڡ", "会話口", "いー", "ni↘", "流口水", "呀！", "抿嘴", "吐舌"
		MOUTH = 9無口系+
	ENDSELECT
	;EMOTE = 21对话框・・・+
CASE "红潮恍惚"
	SELECTCASE CONDS("眼形", ARG)
	CASE "三白眼", "重度三白眼"
		LEYE = 11重度三白眼左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11重度三白眼右\[%CONDS("右瞳色", ARG)%\]+
	CASEELSE
		LEYE = 11斜眼%CONDS("眼形の番号", ARG)%左\[%CONDS("左瞳色", ARG)%\]+
		REYE = 11斜眼%CONDS("眼形の番号", ARG)%右\[%CONDS("右瞳色", ARG)%\]+
	ENDSELECT

	MOUTH = 9△+
	CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
CASE "目陰"
	FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
	LEYE =
	REYE =
CASE "目陰効果"
	FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
CASE "青ざめ効果"
	FACE_EFFECT = 22青ざめ+
CASE "空洞"
	CHEEK =
	IS_LEYE_HIGHLIGHT = 0
	IS_REYE_HIGHLIGHT = 0
CASE "过电"
	BG = 0过电+
CASE "王様游戏"
	MOUTH = 9ワ+
	EMOTE = 21对话框兴奋+
ENDSELECT

;角は髪とかの色で色が変わる
IF CONDS("角の形", ARG) != ""
	SELECTCASE TALENT:ARG:角
	;横にデンとある領帯プの角
	CASE 1 TO 9
		TUNO_SIDE = 14角%CONDS("角の形", ARG)%\[%CONDS("角の色", ARG)%\]+
	;耳にかかる感じの角
	CASE 10 TO 19
		TUNO_BACK = 14角%CONDS("角の形", ARG)%左\[%CONDS("角の色", ARG)%\]+
		TUNO_MID = 14角%CONDS("角の形", ARG)%\[%CONDS("角の色", ARG)%\]+
	;額から前向きに延びる角
	CASE 20 TO 29
		TUNO = 19角%CONDS("角の形", ARG)%\[%CONDS("角の色", ARG)%\]+
	ENDSELECT
ENDIF
SIF CONDS("頭羽の形", ARG) != ""
	TUNO_SIDE += @"14%CONDS("頭羽の形", ARG)%\[%CONDS("頭羽の色", ARG)%\]+"

;服の下につける
IF CHECK_OTHER("铃铛项圈", ARG)
	FACE_ACCE += @"20铃铛项圈%CLOCOLOR_MAIDFACE("铃铛项圈", CHECK_CLOCOLOR(OTHER(ARG, "首") ), ARG)%+"
ELSEIF CHECK_OTHER("黒色颈环", ARG)
	FACE_ACCE += "20黒色颈环+"
ENDIF

;これは消すべきか迷う
;SIF CFLAG:ARG:電源BOX
;	CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+

SELECTCASE CLO("颜绘衣装", ARG)
CASE "", "裸体"
	SIF CFLAG:ARG:睡眠 + CFLAG:ARG:刚睡醒 + TALENT:ARG:不知羞恥 == 0 && ARG != MASTER && COND("颜绘シミュ中") == 0
		CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
CASEELSE
	IF CFLAG:ARG:睡眠 + CFLAG:ARG:刚睡醒 + TALENT:ARG:不知羞恥 == 0 && ARG != MASTER && COND("颜绘シミュ中") == 0
		SIF CHECK_CLO("恥ずかしい恰好", ARG)
			CHEEK = 8紅潮\[%CONDS("脸颊カラー", ARG)%\]+
	ENDIF

	;衣领颜色するもの
	SIF CHECK_CLO("インナー衣领颜色表示", ARG) && CLO("颜绘衣装：内衣と泳装", ARG) != ""
		CLOBASE += @"13%CLO("颜绘衣装：内衣と泳装", ARG)%+"

	CLOBASE += @"13%CLO("颜绘衣装", ARG)%+"
ENDSELECT

;怪图案Ｔ恤
SIF CHECK_SHIRT("怪图案Ｔ恤", ARG)
	CLOBASE += @"13%CONDS("変Ｔの文字", ARG)%+"

;休闲褲がメインな装扮
IF CHECK_OUTER("工装裤", ARG)
	KASANEGI += @"13工装裤%CLOCOLOR_MAIDFACE("工装裤", CHECK_CLOCOLOR(CSTR:ARG:外套), ARG)%+"
;飾品の外套による衣领颜色
ELSEIF CHECK_OTHER("休闲衫", ARG)
	KASANEGI += @"13休闲衫+"

;外套のみはカバー範囲が大きいので上書き
ELSEIF CHECK_OTHER("粗呢外套", ARG)
ELSEIF CHECK_OTHER("外套", ARG)
	IF EQUIP:ARG:服 == 0 || CLOBASE == ""
		CLOBASE = 13裸外套%CLOCOLOR_MAIDFACE("外套", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG )%+
	ELSE
		CLOBASE = 13外套%CLOCOLOR_MAIDFACE("外套", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG )%+
	ENDIF

ELSEIF CHECK_OTHER("前開的衬衫", ARG)
	KASANEGI += @"13前開的衬衫%CLOCOLOR_MAIDFACE("恤", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ELSEIF CHECK_OTHER("前開連帽風衣", ARG)
	KASANEGI += @"13前開連帽風衣%CLOCOLOR_MAIDFACE("連帽風衣", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ELSEIF CHECK_OTHER("前開无袖連帽風衣", ARG)
	KASANEGI += @"13前開无袖連帽風衣%CLOCOLOR_MAIDFACE("連帽風衣", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"

ELSEIF CHECK_OTHER("前開运动衫", ARG)
	KASANEGI += @"13前開运动衫%CLOCOLOR_MAIDFACE("运动衫", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ELSEIF CHECK_OTHER("露肩夹克", ARG)
	KASANEGI += @"13露肩夹克%CLOCOLOR_MAIDFACE("露肩夹克", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ELSEIF CHECK_OTHER("前開V领毛衣", ARG)
	KASANEGI += @"13前開V领毛衣%CLOCOLOR_MAIDFACE("前開V领毛衣", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"

ELSEIF CHECK_OTHER("褞袍", ARG)
	KASANEGI += @"13褞袍%CLOCOLOR_MAIDFACE("褞袍", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"

ELSEIF CHECK_OTHER("工作围裙", ARG)
	KASANEGI += @"13工作围裙%CLOCOLOR_MAIDFACE("工作围裙", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ELSEIF CHECK_OTHER("厨房围裙", ARG)
	KASANEGI += @"13厨房围裙+"
ELSEIF CHECK_OTHER("打工围裙", ARG)
	KASANEGI += @"13打工围裙+"
ELSEIF CHECK_OTHER("圍裙", ARG)
	KASANEGI += @"13圍裙+"
ELSEIF CHECK_OTHER("白金披风", ARG)
	KASANEGI += @"20白金披风+"
ELSEIF CHECK_OTHER("脏披风", ARG)
	KASANEGI += @"20脏披风+"
ENDIF
SIF CHECK_OTHER("项圈", ARG)
	KASANEGI += @"20项圈%CLOCOLOR_MAIDFACE("项圈", CHECK_CLOCOLOR(OTHER(ARG, "首") ), ARG)%+"

;裤吊带
IF CHECK_CLO("褶边裙吊带", ARG)
	KASANEGI += @"13褶边裙吊带%CLOCOLOR_MAIDFACE("褶边裙吊带", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ELSEIF CHECK_CLO("裤吊带", ARG)
	KASANEGI += @"13裤吊带%CLOCOLOR_MAIDFACE("裤吊带", CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
ENDIF

IF CHECK_OTHER("蝶形領帯", ARG)
	SELECTCASE CHECK_CLOCOLOR(OTHER(ARG, "首") )
	CASE "黒", "紫", "赤", "青", "白"
		KASANEGI += @"13蝶形領帯%CHECK_CLOCOLOR(OTHER(ARG, "首") )%+"
	;特に色指定が無い場合には衣装の色に合わせる
	CASEELSE
		SELECTCASE CHECK_CLOCOLOR(OTHER(ARG, "饰耳") )
		CASE "黒", "紫", "赤", "青", "白"
			KASANEGI += @"13蝶形領帯%CHECK_CLOCOLOR(OTHER(ARG, "饰耳") )%+"
		CASEELSE
			SELECTCASE CLO("颜绘衣装の色", ARG)
			CASE "黒", "紫", "赤", "青", "白"
				KASANEGI = 13蝶形領帯%CLO("颜绘衣装の色", ARG)%+
			CASEELSE
				KASANEGI = 13蝶形領帯赤+
			ENDSELECT
		ENDSELECT
	ENDSELECT
ENDIF

SIF CHECK_OTHER("围巾", ARG) && PLACE("野外") + COND("颜绘シミュ中")
	KASANEGI += @"20围巾%CLOCOLOR_MAIDFACE("围巾", CHECK_CLOCOLOR(OTHER(ARG, "首") ), ARG)%+"

SELECTCASE CONDS("眼鏡", ARG)
CASE "", "无眼鏡"
CASE "眼罩黒", "眼罩白", "太阳鏡", "瓶底眼鏡", "瓶底胡须眼鏡", "圈圈眼鏡", "圈圈胡须眼鏡"
	MEGANE = 20%CONDS("眼鏡", ARG)%+
CASEELSE
	MEGANE = 20%CONDS("眼鏡", ARG)%%CLOCOLOR_MAIDFACE("眼鏡", CHECK_CLOCOLOR(OTHER(ARG, "眼鏡") ), ARG)%+
ENDSELECT

;帽子系。上から順にHUGE,LARGE,SMALL
IF CHECK_OTHER("南瓜頭", ARG)
	HAIRACCE_HEAD = 15南瓜頭
ELSEIF CHECK_OTHER("修女帽", ARG)
    HAIRACCE_HUGE = 15修女帽+
ELSEIF CHECK_OTHER("頭纱", ARG)
	HAIRACCE_HUGE = 15頭纱+
ELSEIF CHECK_OTHER("青将校", ARG)
	HAIRACCE_HEAD = 将校青
ELSEIF CHECK_OTHER("緑将校", ARG)
	HAIRACCE_HEAD = 将校緑
ELSEIF CHECK_OTHER("黒将校", ARG)
	HAIRACCE_HEAD = 将校黒
ELSEIF CHECK_OTHER("茶兵士", ARG)
	HAIRACCE_HEAD = 兵士茶
ELSEIF CHECK_OTHER("緑兵士", ARG)
	HAIRACCE_HEAD = 兵士緑
ELSEIF CHECK_OTHER( "黒制服", ARG)
	HAIRACCE_HEAD = 制服黒
ELSEIF CHECK_OTHER("青制服", ARG)
	HAIRACCE_HEAD = 制服青
ELSEIF CHECK_OTHER("茶制服", ARG)
	HAIRACCE_HEAD = 制服茶

;ここからLARGE
ELSEIF CHECK_OTHER("白と金の薄紗", ARG)
	HAIRACCE_LARGE = 15白と金の薄紗+
ELSEIF CHECK_OTHER("魔女の帽子", ARG)
	HAIRACCE_LARGE = 5魔女の帽子+
ELSEIF CHECK_OTHER("鸭舌帽", ARG)
	HAIRACCE_LARGE = 5鸭舌帽%CLOCOLOR_MAIDFACE("鸭舌帽", CHECK_CLOCOLOR(OTHER(ARG, "帽子") ), ARG)%+
ELSEIF CHECK_OTHER("草帽", ARG)
	HAIRACCE_LARGE = 5草帽+
ELSEIF CHECK_OTHER("聖誕帽", ARG)
	HAIRACCE_LARGE = 5聖誕帽+
ELSEIF CHECK_OTHER("水兵帽", ARG)
	HAIRACCE_LARGE = 5水兵帽%CLOCOLOR_MAIDFACE("水兵帽", CHECK_CLOCOLOR(OTHER(ARG, "帽子") ), ARG)%+
ELSEIF CHECK_OTHER("贝雷帽", ARG)
	HAIRACCE_LARGE = 5贝雷帽%CLOCOLOR_MAIDFACE("贝雷帽", CHECK_CLOCOLOR(OTHER(ARG, "帽子") ), ARG)%+
ELSEIF CHECK_OTHER("女仆帽", ARG)
	HAIRACCE_ZUN = 15女仆帽+
ELSEIF CHECK_OTHER("护士帽", ARG)
    HAIRACCE_ZUN = 15护士帽+
ELSEIF CHECK_OTHER("胖次帽", ARG)
	HAIRACCE_ZUN = 5胖次帽白+
;ここからSMALL
ELSEIF CHECK_OTHER("兔耳", ARG)
	IF TALENT:ARG:動物耳 == 0
		SELECTCASE CHECK_CLOCOLOR(OTHER(ARG, "饰耳") )
		CASE "黒", "紫", "赤", "青", "白"
			HAIRACCE_SMALL = 15d%CHECK_CLOCOLOR(OTHER(ARG, "饰耳") )%+
		CASEELSE
			;特に色指定が無い場合には衣装の色に合わせる
			SELECTCASE CLO("颜绘衣装の色", ARG)
			CASE "黒", "紫", "赤", "青", "白"
				HAIRACCE_SMALL = 15d%CLO("颜绘衣装の色", ARG)%+
			CASEELSE
				HAIRACCE_SMALL = 15d赤+
			ENDSELECT
		ENDSELECT
	ENDIF
ELSEIF CHECK_OTHER("牛耳", ARG)
	IF TALENT:ARG:動物耳 == 0
		HAIRACCE_SMALL = 15牛耳+
	ENDIF
ELSEIF CHECK_OTHER("頭冠", ARG)
    HAIRACCE_SMALL = 15頭冠+
ELSEIF CHECK_OTHER("礼服頭花", ARG)
	HAIRACCE_SMALL = 15a白+
ELSEIF CHECK_OTHER("頭上太阳鏡", ARG)
	HAIRACCE_SMALL = 15頭上太阳鏡+
ELSEIF CHECK_OTHER("髮箍", ARG)
	HAIRACCE_SMALL = 15b赤+
ENDIF

;精液
SIF CHECK_STAIN(STAIN:ARG:顔, "精液")
	BUKKAKE += "22精液右頬+22精液左頬+"
SIF CHECK_STAIN(STAIN:ARG:髪, "精液")
	BUKKAKE += "22精液髪+"
SIF CHECK_STAIN(STAIN:ARG:Ｂ, "精液")
	BUKKAKE += "22精液Ｂ+"
;汗
SIF COND("浑身是汗", ARG)
	SWEAT = 8頬汗\[水色\]+

;颜绘変化有？
IF CSTR:ARG:颜绘変化 != ""
	VARSET LOCALS
	SPLIT CSTR:ARG:颜绘変化, "/", LOCALS
	FOR LCOUNT, 0, 10
		SELECTCASE NONUM(LOCALS:LCOUNT)
		;CASE ""
		;	BREAK
		CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
			LEYE = 11%LOCALS:LCOUNT%左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11%LOCALS:LCOUNT%右\[%CONDS("右瞳色", ARG)%\]+
		CASE "眯眯眼", "闭眼"
			LEYE = 11%NONUM(LOCALS:LCOUNT)%%ONLYNUM(LOCALS:LCOUNT)%左\[%CONDS("まつ毛の色", ARG)%\]+
			REYE = 11%NONUM(LOCALS:LCOUNT)%%ONLYNUM(LOCALS:LCOUNT)%右\[%CONDS("まつ毛の色", ARG)%\]+
		CASE "笑颜", "ほんわか", "〇〇", "＞＜", "涙目〇〇", "涙目＞＜", "号泣", "婴儿哭"
			LEYE = 11%LOCALS:LCOUNT%左+
			REYE = 11%LOCALS:LCOUNT%右+
		CASE "左普通眼", "左吊眼", "左垂眼", "左斜眼", "左水灵眼", "左縦長目", "左三白眼", "左重度三白眼"
			LOCALS:LCOUNT = %SUBSTRINGU(LOCALS:LCOUNT, 1, -1)%
			LEYE = 11%LOCALS:LCOUNT%左\[%CONDS("左瞳色", ARG)%\]+
		CASE "左眯眯眼", "左闭眼"
			LOCALS:LCOUNT = %SUBSTRINGU(LOCALS:LCOUNT, 1, -1)%
			LEYE = 11%NONUM(LOCALS:LCOUNT)%%ONLYNUM(LOCALS:LCOUNT)%左\[%CONDS("まつ毛の色", ARG)%\]+
		CASE "左笑颜", "左ほんわか", "左〇〇", "左＞＜", "左涙目〇〇", "左涙目＞＜", "左号泣", "左婴儿哭"
			LOCALS:LCOUNT = %SUBSTRINGU(LOCALS:LCOUNT, 1, -1)%
			LEYE = 11%LOCALS:LCOUNT%左+
		CASE "右普通眼", "右吊眼", "右垂眼", "右斜眼", "右水灵眼", "右縦長目", "右三白眼", "右重度三白眼"
			LOCALS:LCOUNT = %SUBSTRINGU(LOCALS:LCOUNT, 1, -1)%
			REYE = 11%LOCALS:LCOUNT%右\[%CONDS("右瞳色", ARG)%\]+
		CASE "右眯眯眼", "右闭眼"
			LOCALS:LCOUNT = %SUBSTRINGU(LOCALS:LCOUNT, 1, -1)%
			REYE = 11%NONUM(LOCALS:LCOUNT)%%ONLYNUM(LOCALS:LCOUNT)%右\[%CONDS("まつ毛の色", ARG)%\]+
		CASE "右笑颜", "右ほんわか", "右〇〇", "右＞＜", "右涙目〇〇", "右涙目＞＜", "右号泣", "右婴儿哭"
			LOCALS:LCOUNT = %SUBSTRINGU(LOCALS:LCOUNT, 1, -1)%
			REYE = 11%LOCALS:LCOUNT%右+
		CASE "普通眼飘忽", "吊眼飘忽", "垂眼飘忽", "斜眼飘忽", "水灵眼飘忽", "縦長目飘忽", "三白眼飘忽", "重度三白眼飘忽"
			LEYE = 11%LOCALS:LCOUNT%左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11%LOCALS:LCOUNT%右\[%CONDS("右瞳色", ARG)%\]+
			EYE_COND += "飘忽"
		CASE "普通眼半目", "吊眼半目", "垂眼半目", "斜眼半目", "水灵眼半目", "縦長目半目", "三白眼半目", "重度三白眼半目"
			LEYE = 11%LOCALS:LCOUNT%左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11%LOCALS:LCOUNT%右\[%CONDS("右瞳色", ARG)%\]+
			EYE_COND += "半目"
		CASE "半目", "飘忽", "睁開"
			EYE_COND += @"%LOCALS:LCOUNT%"

		CASE "目陰効果"
			FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
		CASE "青ざめ効果", "青ざめ"
			FACE_EFFECT = 22青ざめ+
		CASE "顔効果无"
			FACE_EFFECT =
		CASE "目陰"
			FACE_EFFECT = 22目陰\[%CONDS("顔の色晒痕有", ARG)%\]+
			LEYE =
			REYE =

		CASE "爱心眼"
			SELECTCASE CHECK_TYPE(REYE)
			CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
				REYE_OVER = 11%CONDS("右爱心眼の色", ARG)%爱心%CHECK_TYPE(REYE)%右+
			ENDSELECT

			SELECTCASE CHECK_TYPE(LEYE)
			CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
				LEYE_OVER = 11%CONDS("左爱心眼の色", ARG)%爱心%CHECK_TYPE(LEYE)%左+
			ENDSELECT

		;これは眼形を縦長に强行変える
		CASE "混乱"
			REYE_OVER = 11混乱右+
			LEYE_OVER = 11混乱左+
			LEYE = 11縦長目左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11縦長目右\[%CONDS("右瞳色", ARG)%\]+
		CASE "高光有"
			IS_LEYE_HIGHLIGHT = 1
			IS_REYE_HIGHLIGHT = 1
		CASE "高光无"
			IS_LEYE_HIGHLIGHT = 0
			IS_REYE_HIGHLIGHT = 0
		CASE "左高光有"
			IS_LEYE_HIGHLIGHT = 1
		CASE "左高光无"
			IS_LEYE_HIGHLIGHT = 0
		CASE "右高光有"
			IS_REYE_HIGHLIGHT = 1
		CASE "右高光无"
			IS_REYE_HIGHLIGHT = 0

		CASE "无眼白", "白眼", "黒目"
			LEYE_SIROME = %LOCALS:LCOUNT%
			REYE_SIROME = %LOCALS:LCOUNT%

		;眉の長さは基本固定
		CASE "通常眉", "憤怒眉", "斜眉", "困扰眉", "麻呂眉", "蹙眉", "困惑眉"
			MAYU = 18%NONUM(LOCALS:LCOUNT)%%CONDS("眉の長さ", ARG)%%ONLYNUM(LOCALS:LCOUNT)%\[%CONDS("眉の色", ARG)%\]+
		CASE "通常眉短", "憤怒眉短", "斜眉短", "困扰眉短", "蹙眉短", "困惑眉短"
			MAYU = 18%LOCALS:LCOUNT%\[%CONDS("眉の色", ARG)%\]+
		CASE "大口", "ワ", "半開"
			MOUTH = 9%LOCALS:LCOUNT%%FANG%+
		CASE "微笑", "へ字", "△", "ω", "嘟嘴", "猫口", "笑顔", "ワ", "ヮ", "半開", "大口", "無口系", "嘲笑", "小口", "一文字", "～", "いー", "呀哒", "哈欠大", "哈欠小", "会話口", "ni↘", "栗口", "ڡ", "流口水", "呀！", "抿嘴", "口哨", "吐舌", "小夫"
			MOUTH = 9%LOCALS:LCOUNT%+
		CASE "脸谱赤",
			MAKEUP = 8脸谱\[赤\]+
		CASE "脸谱青"
			MAKEUP = 8脸谱\[青\]+
		CASE "战妆"
			MAKEUP = 8战妆\[灰\]+
		CASE "光滑"
			MAKEUP = 8%LOCALS:LCOUNT%+
		CASE "赤面"
			CHEEK = 8%LOCALS:LCOUNT%\[%LOCALS:LCOUNT%\]+
		CASE "楕円", "红晕", "婴儿红晕", "紅潮"
			CHEEK = 8%LOCALS:LCOUNT%\[%CONDS("脸颊カラー", ARG)%\]+
		CASE "頬傷左", "頬傷鼻", "頬傷右"
			HOHO += @"8%LOCALS:LCOUNT%\[%CONDS("顔の色", ARG)%\]+"
		CASE "頬創口貼左", "頬創口貼鼻", "頬創口貼右"
			HOHO += @"8%LOCALS:LCOUNT%\[白\]+"
		CASE "血迹"
			CHEEK = 8血迹+
		CASE "精液右頬", "精液左頬", "精液髪", "精液Ｂ"
			BUKKAKE += @"22%LOCALS:LCOUNT%+"
		CASE "頬汗"
			SWEAT = 8頬汗\[水色\]+

		CASE "无眼鏡"
			MEGANE =
		CASE "眼罩黒", "眼罩白", "太阳鏡", "瓶底眼鏡", "瓶底胡须眼鏡", "圈圈眼鏡", "圈圈胡须眼鏡"
			MEGANE = 20%LOCALS:LCOUNT%+
		CASE "眼鏡", "专家眼鏡", "黑框眼鏡", "金丝眼鏡", "玳瑁眼鏡"
			MEGANE = 20%LOCALS:LCOUNT%黒+

		;鞄
		CASE "挎包"
			KASANEGI += @"22%LOCALS:LCOUNT%+"
		;小物
		CASE "茶", "橘子", "本", "带洞乳酪", "圆形奶酪", "扇子赤", "扇子富士山", "扇子桜", "扇子白", "菜刀", "带血菜刀", "啤酒"
			OTHER += @"22%LOCALS:LCOUNT%+"
		CASE "オーフェス", "オーフェス兴奋", "オーフェス汗", "オーフェス爱心", "オーフェス！", "22オーフェス？", "オーフェス！？", "オーフェス電球"
			OTHER = 22%LOCALS:LCOUNT%+
		CASE "頭上橘子"
			HAIRACCE_SMALL = 22頭上橘子+%HAIRACCE_SMALL%
		CASE "頭上太阳鏡"
			SIF CHECK_OTHER("頭上太阳鏡", ARG) == 0
				HAIRACCE_SMALL = 15頭上太阳鏡+
		;口に咥えるもの
		CASE "烟", "沒點燃的煙", "冰", "pocky", "面包", "法棍"
			MOUTH = 9無口系+
			OTHER += @"22%LOCALS:LCOUNT%+"
		CASE "避孕套"
			SELECTCASE CONDS("嘴形の種類", ARG)
			CASE "微笑", "無口系"
			CASEELSE
				MOUTH = 9無口系+
			ENDSELECT
			OTHER += @"22%LOCALS:LCOUNT%+"
		CASE "托下巴", "唇边手", "頬手", "对指", "不可以", "石頭", "剪刀", "布", "石頭右", "剪刀右", "布右"
			OTHER += @"22手首%LOCALS:LCOUNT%\[%CONDS("手の色", ARG)%\]+"
		CASE "Ｗ剪刀手"
			OTHER += @"22手首剪刀\[%CONDS("手の色", ARG)%\]+22手首剪刀右\[%CONDS("手の色", ARG)%\]+"
		CASE "頬杖", "頬杖左"
			OTHER += @"22手首%LOCALS:LCOUNT%\[%CONDS("前腕から先の色", ARG)%\]+"
			SIF CONDS("手首から先の色", ARG) != "" && CONDS("前腕から先の色", ARG) == CONDS("顔の色晒痕有", ARG)
				OTHER += @"22手首手套%LOCALS:LCOUNT%\[%CONDS("手首から先の色", ARG)%\]+"
		CASE "Ｗ頬杖"
			OTHER += @"22手首頬杖左\[%CONDS("前腕から先の色", ARG)%\]+22手首頬杖\[%CONDS("前腕から先の色", ARG)%\]+"
			SIF CONDS("手首から先の色", ARG) != "" && CONDS("前腕から先の色", ARG) == CONDS("顔の色晒痕有", ARG)
				OTHER += @"22手首手套頬杖左\[%CONDS("手首から先の色", ARG)%\]+22手首手套頬杖\[%CONDS("手首から先の色", ARG)%\]+"
		CASE "胖次花绳", "胖次花绳湿", "胖次花绳变化"
			OTHER += @"22手首展示内褲手\[%CONDS("手の色", ARG)%\]+"
			;あやとり可能な胖次を穿いている？
			IF CHECK_PANTIES("胖次花绳可能", ARG)
				IF CONFIG("裆部颜色：白")
					OTHER += @"22胖次花绳%CLOCOLOR(CSTR:ARG:胖次, "色のみ")%+"
					IF CHECK_PANTIES("湿的", ARG) || NONUM(LOCALS:LCOUNT) == "胖次花绳湿"
						OTHER += @"22胖次開洞白湿的+"
					ELSE
						OTHER += @"22胖次開洞白+"
					ENDIF
				ELSEIF CONFIG("裆部颜色：稍微带些变化")
					IF CHECK_PANTIES("湿的", ARG) || NONUM(LOCALS:LCOUNT) == "胖次花绳湿"
						OTHER += @"22胖次花绳変化湿的%CLOCOLOR(CSTR:ARG:胖次, "色のみ")%+"
					ELSE
						OTHER += @"22胖次花绳変化%CLOCOLOR(CSTR:ARG:胖次, "色のみ")%+"
					ENDIF
				;默认
				ELSE
					IF CHECK_PANTIES("湿的", ARG) || NONUM(LOCALS:LCOUNT) == "胖次花绳湿"
						OTHER += @"22胖次花绳湿%CLOCOLOR(CSTR:ARG:胖次, "色のみ")%+"
					ELSE
						OTHER += @"22胖次花绳%CLOCOLOR(CSTR:ARG:胖次, "色のみ")%+"
					ENDIF
				ENDIF
				SIF CHECK_PANTIES("開洞带污迹的", ARG)
					OTHER += @"22胖次開洞带污迹的+"
				SIF NONUM(LOCALS:LCOUNT) == "胖次花绳变化"
					OTHER += @"22胖次開洞精液+"
			ENDIF
		CASE "扇子"
			OTHER += "22扇子富士山+"
		CASE "萌え袖"
			IS_MOESODE = 1
		CASE "对话框憤怒", "对话框汗", "对话框爱心", "对话框兴奋", "对话框惊讶", "对话框睡眠", "对话框困倦", "对话框開心", "对话框・・・", "对话框？", "对话框！", "对话框尷尬", "对话框乱", "对话框電球", "对话框！？", "对话框圆圈", "对话框叉叉"
			EMOTE = 21%LOCALS:LCOUNT%+
		CASE "爱心大量", "对话框爱心大量"
			EMOTE = 21对话框爱心+21爱心大量+
		CASE "圓圈", "对话框圓圈"
			EMOTE = 21圓圈+
		CASE "抖抖"
			EMOTE = 21%LOCALS:LCOUNT%+%EMOTE%
		CASE "会話中", "叹气"
			EMOTE += @"21%LOCALS:LCOUNT%+"
		CASE "南瓜頭"
			HAIRACCE_HEAD = 15南瓜頭
		ENDSELECT

		IF STRCOUNT(LOCALS:LCOUNT, "BG=")
			LOCALS:LCOUNT = %EXTSTR(LOCALS:LCOUNT, "BG=", "")%
			IF LOCALS:LCOUNT == "无"
				BG =
			ELSE
				BG = %LOCALS:LCOUNT%+
			ENDIF
		ENDIF
	NEXT
ENDIF

;萌え袖
IF OTHER == ""
	IF IS_MOESODE && CLO("萌え袖可能", ARG) != ""
		OTHER = 22%CLO("萌え袖可能", ARG)%+
	ELSEIF CHECK_SHIRT("啦啦队制服", ARG)
		OTHER = 22ponpon+
	ENDIF
ENDIF

;圓圈中？
IF COND("圓圈中")
	EMOTE = 21圓圈+
	BG = 0e1+
ELSEIF PLACE("映画館")
	EMOTE += "21映画館効果+"
ENDIF

IF HAIRACCE_HUGE != ""
	HAIRACCE_OVER = %HAIRACCE_HUGE%

	;改髪、蝴蝶結、呆毛、動物耳、角、翼などはおかしなことになるので無くす
	TUNO =
	TUNO_SIDE =
	TUNO_BACK =
	ANIMAL_EARS =
	RIBBON =

	HAIR_BACK =
	HAIR_AHOGE =
	HAIR_SIDE =
	HAIR_SIDE_L =
	HAIR_SIDE_L_BACK =
	HAIR_SIDE_FRONT =
	HAIR_PLAIT =
	HAIR_PLAIT_L =

ELSEIF HAIRACCE_LARGE != ""
	HAIRACCE_OVER = %HAIRACCE_LARGE%

	TUNO =
	TUNO_SIDE =
	TUNO_BACK =
	ANIMAL_EARS =
	RIBBON =
	HAIR_AHOGE =
	HAIR_SIDE =
	HAIR_SIDE_L =
	HAIR_SIDE_L_BACK =
	HAIR_SIDE_FRONT =

ELSEIF HAIRACCE_ZUN != ""
	HAIRACCE_FRONT = %HAIRACCE_ZUN%

	;TUNO =
	;TUNO_SIDE =
	;TUNO_BACK =
	ANIMAL_EARS =
	RIBBON =

ELSEIF HAIRACCE_SMALL != ""
	HAIRACCE_OVER = %HAIRACCE_SMALL%

	HAIR_AHOGE =
ENDIF

;天使の輪など
IF COND("種族：死神", ARG)
	BG += "2c+"
ELSEIF COND("種族：堕天使", ARG) || COND("種族：アルサバーニ", ARG)
	BG += "2b+"
ELSEIF COND("種族：天使", ARG)
	BG += "2a+"
ENDIF

;三白眼などはメガネ形状に合わせる
IF MEGANE != ""
	IF STRCOUNT(MEGANE, "眼罩")
		LEYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
		REYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+
	ELSEIF STRCOUNTS(MEGANE, "ブロー", "フルリム", "太阳鏡")
		SELECTCASE CHECK_TYPE(REYE)
		CASE "三白眼"
			IF CHECK_TYPE(LEYE) == "三白眼"
				LEYE = 11重度三白眼左\[%CONDS("左瞳色", ARG)%\]+
				REYE = 11重度三白眼右\[%CONDS("右瞳色", ARG)%\]+
			ENDIF
		ENDSELECT
	ENDIF
ENDIF

;眼形に２とかをその都度付けるのがバグの元なので最後に一回だけ見る
;ここで白眼が必要かも判断する
SIF LEYE_SIROME == ""
	LEYE_SIROME = %CONDS("左白瞳色", ARG)%
SIF REYE_SIROME == ""
	REYE_SIROME = %CONDS("右白瞳色", ARG)%

IF STRCOUNT(EYE_COND, "睁開")
	EYE_COND =
ELSE
	IF STRCOUNT(EYE_COND, "飘忽") || (STRCOUNT(CONDS("右眼形", ARG), "飘忽") + STRCOUNT(CONDS("左眼形", ARG), "飘忽") && EYE_COND == "")
		EYE_COND += "飘忽"
		EYE_COND = %REPLACE(EYE_COND, "飘忽", "")%飘忽
	ENDIF
	IF STRCOUNT(EYE_COND, "半目") || (STRCOUNT(CONDS("右眼形", ARG), "半目") + STRCOUNT(CONDS("左眼形", ARG), "半目") && EYE_COND == "")
		EYE_COND += "半目"
		EYE_COND = %REPLACE(EYE_COND, "半目", "")%半目
	ENDIF
ENDIF

SELECTCASE CHECK_TYPE(REYE)
CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
	REYE = 11%CHECK_TYPE(REYE)%%CHECK_NUM(CONDS("右眼形", ARG), REYE)%%EYE_COND%右\[%CONDS("右瞳色", ARG)%\]+

	SIF REYE_SIROME != "无眼白" && REYE_SIROME != ""
		REYE_UNDER = 11%CHECK_TYPE(REYE)%%CHECK_NUM(CONDS("右眼形", ARG), REYE)%%EYE_COND%右白眼\[%REYE_SIROME%\]+
	REYE_EYELASH = 11%CHECK_TYPE(REYE)%%CHECK_NUM(CONDS("右眼形", ARG), REYE)%%EYE_COND%右まつ毛\[%CONDS("まつ毛の色", ARG)%\]+
	;まつ毛と白眼は飘忽が関係ない
	REYE_UNDER = %REPLACE(REYE_UNDER, "飘忽", "")%
	REYE_EYELASH = %REPLACE(REYE_EYELASH, "飘忽", "")%
ENDSELECT

SELECTCASE CHECK_TYPE(LEYE)
CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
	LEYE = 11%CHECK_TYPE(LEYE)%%CHECK_NUM(CONDS("左眼形", ARG), LEYE)%%EYE_COND%左\[%CONDS("左瞳色", ARG)%\]+

	SIF LEYE_SIROME != "无眼白" && LEYE_SIROME != ""
		LEYE_UNDER = 11%CHECK_TYPE(LEYE)%%CHECK_NUM(CONDS("左眼形", ARG), LEYE)%%EYE_COND%左白眼\[%LEYE_SIROME%]\+
	LEYE_EYELASH = 11%CHECK_TYPE(LEYE)%%CHECK_NUM(CONDS("左眼形", ARG), LEYE)%%EYE_COND%左まつ毛\[%CONDS("まつ毛の色", ARG)%\]+
	;まつ毛と白眼は飘忽が関係ない
	LEYE_UNDER = %REPLACE(LEYE_UNDER, "飘忽", "")%
	LEYE_EYELASH = %REPLACE(LEYE_EYELASH, "飘忽", "")%
ENDSELECT

;目に対応する高光が存在するかの確認
SIF IS_REYE_HIGHLIGHT
	REYE_HIGHLIGHT = %CHECK_HIGHLIGHT("右", REYE, ARG)%
SIF IS_LEYE_HIGHLIGHT
	LEYE_HIGHLIGHT = %CHECK_HIGHLIGHT("左", LEYE, ARG)%

;単眼か見る
IF COND("種族：一目", ARG)
	;単眼は全て右目として扱う
	LEYE =
	LEYE_UNDER =
	LEYE_OVER =
	LEYE_HIGHLIGHT =
	LEYE_SIROME =
	LEYE_EYELASH =

	REYE = %REPLACE(REYE, "11", "11単眼")%
	REYE_UNDER = %REPLACE(REYE_UNDER, "11", "11単眼")%
	REYE_OVER = %REPLACE(REYE_OVER, "11", "11単眼")%
	REYE_HIGHLIGHT = %REPLACE(REYE_HIGHLIGHT, "11", "11単眼")%
	REYE_SIROME = %REPLACE(REYE_SIROME, "11", "11単眼")%
	REYE_EYELASH = %REPLACE(REYE_EYELASH, "11", "11単眼")%
	MAYU = %REPLACE(MAYU, "18", "18単眼")%
ENDIF

SIF CHECK_OTHER("藤の髪飾", ARG)
    HAIR_FRONT += "20藤の髪飾+"
SIF CHECK_OTHER("橘子の发卡", ARG)
    HAIRACCE_OVER += "20橘子の发卡+"
SIF CHECK_OTHER("花飾り", ARG)
    HAIRACCE_OVER += "15花飾り+"
SIF CHECK_OTHER("狐面", ARG)
    HAIRACCE_OVER += "5狐面+"
SIF CHECK_OTHER("カボチャ面", ARG)
    HAIRACCE_OVER += "5カボチャ面+"

;南瓜頭は例外中の例外
IF HAIRACCE_HEAD != ""
	HAIRACCE_OVER = %HAIRACCE_HEAD%

	;改髪、蝴蝶結、呆毛、動物耳、角、翼などはおかしなことになるので無くす
	TUNO =
	TUNO_SIDE =
	TUNO_BACK =
	ANIMAL_EARS =
	EAR =
	EAR_BACK =
	RIBBON =

	HAIR_LENGTH =
	HAIR_LENGTH_ACCE =
	HAIR_BACK =
	HAIR_SIDE =
	HAIR_SIDE_L =
	HAIR_SIDE_L_BACK =
	HAIR_SIDE_FRONT =
	HAIR_PLAIT =
	HAIR_PLAIT_L =
	HAIR_FRONT =
	HAIR_AHOGE =
	HAIR_MESH =
	HAIR_INNER =
	HAIR_PLAIT_INNER =
	HAIR_PLAIT_L_INNER =
ENDIF

;痣は目によって要調整
SELECTCASE CONDS("痣", ARG)
CASE "", "痣无"
CASEELSE
	SELECTCASE CONDS("痣", ARG)
	CASE "泪痣左"
	;泪痣左は、左目が縦長目,番号が４or５,なら調整版
		IF STRCOUNTS(LEYE, "縦長目", "４", "５")
			HOKURO = 10%CONDS("痣", ARG)%調整+
		ELSE
			HOKURO = 10%CONDS("痣", ARG)%+
		ENDIF
	CASEELSE
		HOKURO = 10%CONDS("痣", ARG)%+
	ENDSELECT
ENDSELECT

;渐变颜色が設定されている場合は用意する
IF HAIR_LENGTH != "" && CONDS("渐变颜色", ARG) != ""
	SELECTCASE EXTSTR(HAIR_LENGTH, "4", "\[")
	;渐变颜色が無い髪型
	CASE "直髪短", "外八短", "液状後髪"
	CASEELSE
		HAIR_INNER = 17%EXTSTR(HAIR_LENGTH, "4", "\[")%\[%CONDS("渐变颜色", ARG)%\]+
	ENDSELECT
ENDIF

;CSTR:颜绘変化 を元に戻す
CSTR:ARG:颜绘変化 = %MEMO_CSTR%

;动画ーション用の変数に記録(_BACKは左耳と左双马尾など。画像的には右側のやつ)
SAVEFACE_BACK:NUM_MAIDFACE = %BG%%RIBBON%%HAIR_BACK%%HAIR_SIDE_L_BACK%%HAIR_LENGTH%%HAIR_INNER%%HAIR_LENGTH_ACCE%%TUNO_BACK%%EAR_BACK%%HAIR_SIDE_L%%HAIR_PLAIT_L%%HAIR_PLAIT_L_INNER%%MAIDFACE_SKIN%%SUNTAN%%FACE_ACCE%%FACE_EFFECT%%HAIR_SIDE%%HAIR_PLAIT%%HAIR_PLAIT_INNER%%TUNO_MID%%EAR%%MAKEUP%%HOHO%%HOKURO%%CHEEK%%ANIMAL_EARS%
SAVEFACE_MOUTH:NUM_MAIDFACE = %MOUTH%

SAVEFACE_EYES:NUM_MAIDFACE = %LEYE_UNDER%%REYE_UNDER%%LEYE%%REYE%
SAVEFACE_EYES_LIGHT:NUM_MAIDFACE = %LEYE_HIGHLIGHT%%REYE_HIGHLIGHT%
SAVEFACE_EYES_OVER:NUM_MAIDFACE = %LEYE_OVER%%REYE_OVER%
SAVEFACE_EYES_EYELASH:NUM_MAIDFACE = %LEYE_EYELASH%%REYE_EYELASH%

SAVEFACE_FRONT:NUM_MAIDFACE = %CLOBASE%%KASANEGI%%HAIRACCE_FRONT%%TUNO_SIDE%%MEGANE%%SWEAT%%HAIR_FRONT%%HAIR_SIDE_FRONT%%HAIR_MESH%
SAVEFACE_MAYU:NUM_MAIDFACE = %MAYU%
SAVEFACE_OVER:NUM_MAIDFACE = %HAIRACCE_OVER%%HAIR_AHOGE%%BUKKAKE%%OTHER%%TUNO%%EMOTE%,{FPOS},{FSIZE},{FSIZE},{0},{MEMO_value},%MEMO_title%/

RETURNF @"%SAVEFACE_BACK:NUM_MAIDFACE%%SAVEFACE_MOUTH:NUM_MAIDFACE%%SAVEFACE_EYES:NUM_MAIDFACE%%SAVEFACE_EYES_LIGHT:NUM_MAIDFACE%%SAVEFACE_EYES_OVER:NUM_MAIDFACE%%SAVEFACE_EYES_EYELASH:NUM_MAIDFACE%%SAVEFACE_FRONT:NUM_MAIDFACE%%SAVEFACE_MAYU:NUM_MAIDFACE%%SAVEFACE_OVER:NUM_MAIDFACE%"


code:
;-------------------------------------------------
;动画ーションを描画する関数群。金吉獣料理様のMAIDFACE.ERBを改変
;-------------------------------------------------
;-------------------------------------------------
;角色ARGの动画ーションを描画する関数。ARG:1には何人目の位置かが入っている
;SAVEFACE_BACK:ARGとSAVEFACE_FRONT:ARGは既に@MAIDFACEで設定された値を就这様使う
;表情はSAVEFACE_FACE_(MOUTH, EYES):ARGをベースに変化させる
;-------------------------------------------------
@MAIDFACE_ANIME(ARG, ARG:1)
#FUNCTIONS
#DIM NUM_MAIDFACE
#DIM FSIZE
#DIM FPOS
#DIMS MOUTH
#DIMS FANG
#DIMS LEYE_UNDER
#DIMS REYE_UNDER
#DIMS LEYE_OVER
#DIMS REYE_OVER
#DIMS LEYE_HIGHLIGHT
#DIMS REYE_HIGHLIGHT
#DIMS LEYE
#DIMS REYE
#DIMS LEYE_SIROME
#DIMS REYE_SIROME
;まつ毛
#DIMS LEYE_EYELASH
#DIMS REYE_EYELASH
#DIMS EYES
#DIMS EYE_COND

NUM_MAIDFACE = ARG:1
MOUTH =
LEYE =
REYE =
LEYE_UNDER =
REYE_UNDER =
LEYE_OVER =
REYE_OVER =
LEYE_HIGHLIGHT =
REYE_HIGHLIGHT =
LEYE_SIROME =
REYE_SIROME =
LEYE_EYELASH =
REYE_EYELASH =
EYES =
EYE_COND =

SIF CFLAG:ARG:颜绘 == 0
	RETURNF ""

FSIZE = MAIDFACESIZE()
FPOS = NUM_MAIDFACE * NUMC_MAIDFACE()*50

;口
IF COND("種族：獣人", ARG)
	FANG = 牙１
ELSEIF COND("種族：吸血鬼", ARG) + COND("種族：竜人", ARG)
	FANG = 牙２
ENDIF
IF CFLAG:ARG:睡眠
	SELECTCASE ANIME_FCOUNT:NUM_MAIDFACE
	CASE 40 TO 70
		MOUTH = 9半開%FANG%+
	CASEELSE
		MOUTH = 9無口系+
	ENDSELECT
ELSEIF CFLAG:ARG:刚睡醒 || STATE("困倦", ARG)
	SELECTCASE ANIME_FCOUNT:NUM_MAIDFACE
	CASE 81 TO 109
		MOUTH = 9哈欠大+
	CASE 78 TO 80, 110
		MOUTH = 9哈欠小+
	CASEELSE
		MOUTH = 9半開%FANG%+
	ENDSELECT
ENDIF

;目(一番上は瞬きしないもの)
IF STRCOUNTS(SAVEFACE_EYES:NUM_MAIDFACE, "眯眯眼", "笑颜", "闭眼", "ほんわか", "〇〇", "＞＜", "重度三白眼")

ELSEIF STRCOUNTS(SAVEFACE_EYES:NUM_MAIDFACE, "三白眼")
	IF CFLAG:ARG:睡眠
	ELSEIF CFLAG:ARG:刚睡醒 || STATE("困倦", ARG)
		SELECTCASE ANIME_FCOUNT:NUM_MAIDFACE
		CASE 76 TO 110
			LEYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
			REYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+
		CASEELSE
			LEYE = 11重度三白眼左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11重度三白眼右\[%CONDS("右瞳色", ARG)%\]+
		ENDSELECT
	;まばたき
	ELSE
		SELECTCASE ANIME_FCOUNT:NUM_MAIDFACE
		CASE 39, 41
			LEYE = 11重度三白眼左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11重度三白眼右\[%CONDS("右瞳色", ARG)%\]+
		CASE 40, 70
			LEYE = 11闭眼三白眼左\[%CONDS("まつ毛の色", ARG)%\]+
			REYE = 11闭眼三白眼右\[%CONDS("まつ毛の色", ARG)%\]+
		ENDSELECT
	ENDIF
ELSE
	IF CFLAG:ARG:睡眠
	ELSEIF CFLAG:ARG:刚睡醒 || STATE("困倦", ARG)
		SELECTCASE ANIME_FCOUNT:NUM_MAIDFACE
		CASE 76 TO 110
			LEYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
			REYE = 11眯眯眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+
		CASEELSE
			LEYE = 11斜眼左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11斜眼右\[%CONDS("右瞳色", ARG)%\]+
		ENDSELECT
	;まばたき
	ELSE
		SELECTCASE ANIME_FCOUNT:NUM_MAIDFACE
		CASE 39, 41
			LEYE = 11斜眼左\[%CONDS("左瞳色", ARG)%\]+
			REYE = 11斜眼右\[%CONDS("右瞳色", ARG)%\]+
		CASE 40, 70
			LEYE = 11闭眼%CONDS("閉じた目の対応番号", ARG)%左\[%CONDS("まつ毛の色", ARG)%\]+
			REYE = 11闭眼%CONDS("閉じた目の対応番号", ARG)%右\[%CONDS("まつ毛の色", ARG)%\]+
		;よそ見は保留
		;CASE 55 TO 68, 72 TO 79
		;	SELECTCASE CFLAG:ARG:心情差
		;	CASE IS > 0
		;		LEYE = 11斜眼左\[%CONDS("左瞳色", ARG)%\]よそ見+
		;		REYE = 11斜眼右\[%CONDS("右瞳色", ARG)%\]よそ見+
		;	CASEELSE
		;		LEYE = 11%CONDS("左眼形", ARG)%左\[%CONDS("左瞳色", ARG)%\]よそ見+
		;		REYE = 11%CONDS("右眼形", ARG)%右\[%CONDS("右瞳色", ARG)%\]よそ見+
		;	ENDSELECT
		;CASE 69, 71
		;	LEYE = 11斜眼左\[%CONDS("左瞳色", ARG)%\]よそ見+
		;	REYE = 11斜眼右\[%CONDS("右瞳色", ARG)%\]よそ見+
		ENDSELECT
	ENDIF
ENDIF

;眼形に２とかをその都度付けるのがバグの元なので最後に一回だけ見る
LEYE_SIROME = %CONDS("左白瞳色", ARG)%
REYE_SIROME = %CONDS("右白瞳色", ARG)%

SIF STRCOUNT(CONDS("右眼形", ARG), "飘忽") + STRCOUNT(CONDS("左眼形", ARG), "飘忽")
	EYE_COND += "飘忽"
SIF STRCOUNT(CONDS("右眼形", ARG), "半目") + STRCOUNT(CONDS("左眼形", ARG), "半目")
	EYE_COND += "半目"

SELECTCASE CHECK_TYPE(REYE)
CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
	REYE = 11%CHECK_TYPE(REYE)%%CHECK_NUM(CONDS("右眼形", ARG) )%%EYE_COND%右\[%CONDS("右瞳色", ARG)%\]+

	SIF REYE_SIROME != "无眼白" && REYE_SIROME != ""
		REYE_UNDER = 11%CHECK_TYPE(REYE)%%CHECK_NUM(CONDS("右眼形", ARG), REYE)%%EYE_COND%右白眼\[%REYE_SIROME%\]+
	REYE_EYELASH = 11%CHECK_TYPE(REYE)%%CHECK_NUM(CONDS("右眼形", ARG) )%%EYE_COND%右まつ毛\[%CONDS("まつ毛の色", ARG)%\]+
	;まつ毛と白眼は飘忽が関係ない
	REYE_UNDER = %REPLACE(REYE_UNDER, "飘忽", "")%
	REYE_EYELASH = %REPLACE(REYE_EYELASH, "飘忽", "")%
ENDSELECT

SELECTCASE CHECK_TYPE(LEYE)
CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
	LEYE = 11%CHECK_TYPE(LEYE)%%CHECK_NUM(CONDS("左眼形", ARG) )%%EYE_COND%左\[%CONDS("左瞳色", ARG)%\]+

	SIF LEYE_SIROME != "无眼白" && LEYE_SIROME != ""
		LEYE_UNDER = 11%CHECK_TYPE(LEYE)%%CHECK_NUM(CONDS("左眼形", ARG), LEYE)%%EYE_COND%左白眼\[%LEYE_SIROME%]\+
	LEYE_EYELASH = 11%CHECK_TYPE(LEYE)%%CHECK_NUM(CONDS("左眼形", ARG) )%%EYE_COND%左まつ毛\[%CONDS("まつ毛の色", ARG)%\]+
	;まつ毛と白眼は飘忽が関係ない
	LEYE_UNDER = %REPLACE(LEYE_UNDER, "飘忽", "")%
	LEYE_EYELASH = %REPLACE(LEYE_EYELASH, "飘忽", "")%
ENDSELECT

SIF MOUTH == ""
	MOUTH = %SAVEFACE_MOUTH:NUM_MAIDFACE%

EYES = %LEYE_UNDER%%REYE_UNDER%%LEYE%%REYE%

IF EYES == ""
	EYES = %SAVEFACE_EYES:NUM_MAIDFACE%%SAVEFACE_EYES_LIGHT:NUM_MAIDFACE%%SAVEFACE_EYES_OVER:NUM_MAIDFACE%%SAVEFACE_EYES_EYELASH:NUM_MAIDFACE%
ELSE
	;目の変化有些なら爱心眼や高光にも変化が起きるかも
	IF SAVEFACE_EYES_LIGHT:NUM_MAIDFACE != ""
		REYE_HIGHLIGHT = %CHECK_HIGHLIGHT("右", REYE, ARG)%
		LEYE_HIGHLIGHT = %CHECK_HIGHLIGHT("左", LEYE, ARG)%
	ENDIF

	IF STRCOUNT(SAVEFACE_EYES_OVER:NUM_MAIDFACE, "爱心")
		SELECTCASE CHECK_TYPE(REYE)
		CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
			REYE_OVER = 11%CONDS("右爱心眼の色", ARG)%爱心%CHECK_TYPE(REYE)%右+
		ENDSELECT

		SELECTCASE CHECK_TYPE(LEYE)
		CASE "普通眼", "吊眼", "垂眼", "斜眼", "水灵眼", "縦長目", "三白眼", "重度三白眼"
			LEYE_OVER = 11%CONDS("左爱心眼の色", ARG)%爱心%CHECK_TYPE(LEYE)%左+
		ENDSELECT
	ENDIF

	EYES += @"%LEYE_HIGHLIGHT%%REYE_HIGHLIGHT%%LEYE_OVER%%REYE_OVER%%LEYE_EYELASH%%REYE_EYELASH%"
ENDIF

;単眼の処理
IF COND("種族：一目", ARG)
	EYES = %REPLACE(EYES, "単眼", "")%
	EYES = %REPLACE(EYES, "11", "11単眼")%
ENDIF

LOCALS = %SAVEFACE_BACK:NUM_MAIDFACE%%MOUTH%%EYES%%SAVEFACE_FRONT:NUM_MAIDFACE%%SAVEFACE_MAYU:NUM_MAIDFACE%%SAVEFACE_OVER:NUM_MAIDFACE%

RETURNF LOCALS

license: unknown


code:
;-------------------------------------------------
;颜绘の設定がない角色に暫定的につける颜绘
;作者桑が設定した角色については当然ここは不要となります
;-------------------------------------------------
@PRESET_MAIDFACE, ARG
;設定がある角色についてはここは不要
SIF CFLAG:ARG:颜绘
	RETURN 0

SELECTCASE CSVNAME(NO:ARG)
CASE "阿丽努"
	IF RAND:3 == 0
		CSTR:ARG:髪色 = 桃髪
		CSTR:ARG:髪長 = 長
		CSTR:ARG:前髪 = 透明刘海
		CSTR:ARG:後髪 = 直髪
		CSTR:ARG:改髪 = 无特殊髪型
		CSTR:ARG:呆毛 = 无呆毛
		CSTR:ARG:蝴蝶結 = 无蝴蝶結
		CSTR:ARG:瞳色 = 紫
		CSTR:ARG:眼形 = 吊眼
		CSTR:ARG:白眼 = 无眼白
		CSTR:ARG:眉形 = 通常眉
		CSTR:ARG:嘴形 = 笑顔
	ELSEIF RAND:2
		CSTR:ARG:髪色 = 紫髪
		CSTR:ARG:髪長 = 長
		CSTR:ARG:前髪 = 斜刘海
		CSTR:ARG:後髪 = 自然
		CSTR:ARG:改髪 = 马尾辫
		CSTR:ARG:呆毛 = 无呆毛
		CSTR:ARG:蝴蝶結 = 无蝴蝶結
		CSTR:ARG:瞳色 = 青
		CSTR:ARG:眼形 = 斜眼
		CSTR:ARG:白眼 = 无眼白
		CSTR:ARG:眉形 = 通常眉
		CSTR:ARG:嘴形 = 微笑
	ELSE
		CSTR:ARG:髪色 = 茶髪
		CSTR:ARG:髪長 = 披肩
		CSTR:ARG:前髪 = 右斜
		CSTR:ARG:後髪 = 直髪
		CSTR:ARG:改髪 = 马尾辫
		CSTR:ARG:呆毛 = 无呆毛
		CSTR:ARG:蝴蝶結 = 无蝴蝶結
		CSTR:ARG:瞳色 = 赤
		CSTR:ARG:眼形 = 吊眼
		CSTR:ARG:白眼 = 无眼白
		CSTR:ARG:眉形 = 通常眉
		CSTR:ARG:嘴形 = 笑顔
	ENDIF
CASE "六華"
	CSTR:ARG:髪色 = 銀髪
	CSTR:ARG:髪長 = 巻髪
	CSTR:ARG:前髪 = 齐刘海
	CSTR:ARG:後髪 = 直髪
	CSTR:ARG:改髪 = 侧盘頭
	CSTR:ARG:呆毛 = 无呆毛
	CSTR:ARG:蝴蝶結 = 无蝴蝶結
	CSTR:ARG:瞳色 = 赤
	CSTR:ARG:眼形 = 三白眼
	CSTR:ARG:白眼 = 白眼
	CSTR:ARG:眉形 = 麻呂眉
	CSTR:ARG:嘴形 = 微笑
CASE "樱"
	CSTR:ARG:髪色 = 黒髪
	CSTR:ARG:髪長 = 長
	CSTR:ARG:前髪 = 斜刘海

	CSTR:ARG:瞳色 = 青
	CSTR:ARG:眼形 = 垂眼
	CSTR:ARG:眉形 = 困扰眉短
	CSTR:ARG:嘴形 = 微笑
CASE "鬼頭優里"
	CSTR:ARG:髪色 = 金髪
	CSTR:ARG:髪長 = 長
	CSTR:ARG:前髪 = 自然刘海
	CSTR:ARG:後髪 = 卷髪
	CSTR:ARG:瞳色 = 黒
	CSTR:ARG:眼形 = 垂眼
	CSTR:ARG:白眼 = 白眼
	CSTR:ARG:眉形 = 困扰眉短
	CSTR:ARG:嘴形 = ワ
CASE "麦莉爱娜"
	IF RAND:2
		CSTR:ARG:髪色 = 黒髪
		CSTR:ARG:髪長 = 中等長度
		CSTR:ARG:前髪 = 斜刘海
		CSTR:ARG:後髪 = 自然
		CSTR:ARG:改髪 = 编起来
		CSTR:ARG:瞳色 = 黒
		CSTR:ARG:眼形 = 斜眼
		CSTR:ARG:眉形 = 通常眉
		CSTR:ARG:嘴形 = 微笑
	ELSE
		CSTR:ARG:髪色 = 黒髪
		CSTR:ARG:髪長 = 巻髪
		CSTR:ARG:前髪 = 短刘海
		CSTR:ARG:後髪 = 卷髪
		CSTR:ARG:瞳色 = 赤
		CSTR:ARG:眼形 = 吊眼
		CSTR:ARG:白眼 = 白眼
		CSTR:ARG:眉形 = 通常眉
		CSTR:ARG:嘴形 = 微笑
	ENDIF
CASE "双葉成美"
	CSTR:ARG:種族 = 人类
	CSTR:ARG:髪色 = 黒髪
	CSTR:ARG:髪長 = 長
	CSTR:ARG:前髪 = 透明刘海３
	CSTR:ARG:後髪 = 直髪
	CSTR:ARG:改髪 = 无特殊髪型
	CSTR:ARG:呆毛 = 无呆毛
	CSTR:ARG:蝴蝶結 = 无蝴蝶結
	CSTR:ARG:瞳色 = 黒
	CSTR:ARG:眼形 = 普通眼
	CSTR:ARG:白眼 = 无眼白
	CSTR:ARG:眉形 = 通常眉
	CSTR:ARG:嘴形 = へ字
CASE "小菊"
	CSTR:ARG:髪色 = 黒髪
	CSTR:ARG:髪長 = 披肩
	CSTR:ARG:前髪 = 短刘海
	CSTR:ARG:後髪 = 直髪
	CSTR:ARG:瞳色 = 黒
	CSTR:ARG:眼形 = 縦長目
	CSTR:ARG:白眼 = 白眼
	CSTR:ARG:眉形 = 麻呂眉
	CSTR:ARG:嘴形 = 無口系
CASE "長谷川焰"
	CSTR:ARG:髪色 = 黒髪
	CSTR:ARG:髪長 = 中等長度
	CSTR:ARG:前髪 = 斜刘海
	CSTR:ARG:後髪 = 自然
	CSTR:ARG:改髪 = 马尾辫
	CSTR:ARG:瞳色 = 紫
	CSTR:ARG:眼形 = 吊眼
	CSTR:ARG:白眼 = 白眼
	CSTR:ARG:眉形 = 斜眉
	CSTR:ARG:嘴形 = 微笑
CASE "桂木恭子"
	IF RAND:2
		CSTR:ARG:髪色 = 紫髪
		CSTR:ARG:髪長 = 巻髪
		CSTR:ARG:前髪 = 自然刘海
		CSTR:ARG:後髪 = 自然
		CSTR:ARG:改髪 = 短双马尾ール
		CSTR:ARG:呆毛 = 无呆毛
		CSTR:ARG:蝴蝶結 = 无蝴蝶結
		CSTR:ARG:瞳色 = 紫
		CSTR:ARG:眼形 = 垂眼
		CSTR:ARG:白眼 = 白眼
		CSTR:ARG:眉形 = 斜眉短
		CSTR:ARG:嘴形 = ω
	ELSE
		CSTR:ARG:髪色 = 黒髪
		CSTR:ARG:髪長 = 巻髪
		CSTR:ARG:前髪 = 透明刘海２
		CSTR:ARG:後髪 = 自然
		CSTR:ARG:改髪 = 无特殊髪型
		CSTR:ARG:呆毛 = 无呆毛
		CSTR:ARG:蝴蝶結 = 无蝴蝶結
		CSTR:ARG:瞳色 = 金
		CSTR:ARG:眼形 = 斜眼
		CSTR:ARG:白眼 = 白眼
		CSTR:ARG:眉形 = 通常眉短
		CSTR:ARG:嘴形 = 笑顔
	ENDIF
CASE "春夏冬千穂"
	CSTR:ARG:髪色 = 黒髪
	CSTR:ARG:髪長 = 長
	CSTR:ARG:前髪 = 透明刘海３
	CSTR:ARG:後髪 = 自然
	CSTR:ARG:改髪 = 侧盘頭
	CSTR:ARG:呆毛 = 无呆毛
	CSTR:ARG:蝴蝶結 = 无蝴蝶結
	CSTR:ARG:瞳色 = 茶
	CSTR:ARG:眼形 = 垂眼
	CSTR:ARG:白眼 = 白眼
	CSTR:ARG:眉形 = 斜眉
	CSTR:ARG:嘴形 = 笑顔
ENDSELECT


code:
;-------------------------------------------------
;ARGを样本にして衣装換装をシミュレートする
;ARGSに文字列が入っている場合には特殊な操作を行う
;-------------------------------------------------
@SIMULATE_CLOTHES, ARG, ARGS
#DIMS MEMO_PLACE
#DIM MEMO_CFLAG
#DIM MEMO_CFLAG2
#DIM MEMO_CFLAG3
#DIM MEMO_FLAG
#DIMS MEMO_CSTR
#DIM CHOICE

SIF ARG == 0 && TARGET
	ARG = TARGET

MEMO_PLACE = %SAVESTR:現在位置%
SAVESTR:現在位置 = 試着室
MEMO_CFLAG = CFLAG:ARG:掀起裙子
CFLAG:ARG:掀起裙子 = 0
MEMO_CFLAG2 = CFLAG:ARG:電源BOX
CFLAG:ARG:電源BOX = 0
MEMO_CSTR = %CSTR:ARG:晒痕%
MEMO_CFLAG3 = CFLAG:ARG:晒痕強度
MEMO_FLAG = FLAG:状況判定

;颜绘シミュ中フラグON
SETBIT FLAG:状況判定, 48

PRINTL
SELECTCASE ARGS
CASE "整理内衣"
	PRINTFORML %CALLNAME:MASTER%のタンスの引き出しに入れる整理内衣をします。
	CALL PRINT_STRL, "なお、所持できる内衣は胸罩＆胖次の两件套で_黄色_18種類まで_です。_黄色_(无胸罩＆没穿内褲もＯＫ）_"
	CALL PRINT_STRW, "所持している内衣セットは、_黄色_制服、体操服、便装、外出装を着る際に随机選択で着用_するようになります"

	CALL SETFLAG, "衣装の記録", MASTER
	STR:最初の衣装 = %STR:衣装記録%
	CALL SETFLAG, "内衣以外全脱ぎ", MASTER
	;これでSIMULATE_CLOTHES_MAIN中のモードをコントロールする
	TFLAG:換装过滤器 = 3
CASEELSE
	CALL PRINT_STRL, "对制服和体操服进行设定的情况下、推荐先_黄色_选择套装搭配再具体进行服装的配置_"
	PRINTFORML 因此当对应画像中没有衣服时、可能会难以判断选择的服装是否适合。请悉知
	;これでSIMULATE_CLOTHES_MAIN中のモードをコントロールする
	TFLAG:換装过滤器 = 0
ENDSELECT

STR:LASTCHOICE =

CALL SIMULATE_CLOTHES_MAIN, ARG, ARGS

SELECTCASE ARGS
CASE "整理内衣"
	STR:衣装記録 = %STR:最初の衣装%
	CALL SETFLAG, "衣装記録からの復元", MASTER
ENDSELECT

STR:衣装記録 =
STR:LASTCHOICE =

SAVESTR:現在位置 = %MEMO_PLACE%
CFLAG:ARG:掀起裙子 = MEMO_CFLAG
CFLAG:ARG:電源BOX = MEMO_CFLAG2
;CSTR:ARG:晒痕 = %MEMO_CSTR%
;CFLAG:ARG:晒痕強度 = MEMO_CFLAG3
FLAG:状況判定 = MEMO_FLAG

;-------------------------------------------------
;TFLAG:換装过滤器で現在設定しているものの種類を管理する
;0ベース装扮選択, 1個別選択
;現在選択中の装扮はARGSに記録する
;-------------------------------------------------
@SIMULATE_CLOTHES_MAIN, ARG, ARGS
#DIM LCOUNT
#DIM MEMO_LINECOUNT
#DIMS CHOICES
#DIMS TYPE_LASTCHOICE
#DIMS NAME_LASTCHOICE
#DIMS CHANGE_SUBCOLOR
#DIMS MENU_SELECT
#DIMS TEXT_OFFSELECT, 2
#DIMS TEXT_ENDSELECT
#DIMS STR_FACE
#DIMS MEMO_MASTERCLO

MEMO_LINECOUNT = LINECOUNT

SELECTCASE TFLAG:过滤器
CASE 10
	MEMO_MASTERCLO = 制服
CASE 11
	MEMO_MASTERCLO = 体操服
CASE 12
	MEMO_MASTERCLO = 便装
CASE 13
	MEMO_MASTERCLO = 外出装
CASE 14
	MEMO_MASTERCLO = 泳装
CASEELSE
	MEMO_MASTERCLO =
ENDSELECT

MENU_SELECT =
SELECTCASE ARGS
CASE "整理内衣"
	MENU_SELECT += @"現在%CALLNAME:ARG%の引き出しに入っている内衣は_黄色_{COND("所持内衣数", ARG)}セット_です"
	TFLAG:換装过滤器 = 3
CASEELSE
	MENU_SELECT += @"\@ TFLAG:換装过滤器 == 0 ? 緑_ # \@[0]装扮 _"
	MENU_SELECT += @"\@ TFLAG:換装过滤器 == 1 ? 緑_ # \@[1]外衣＆裙 _"
	MENU_SELECT += @"\@ TFLAG:換装过滤器 == 2 ? 緑_ # \@[2]外套＆贴身制服 _"
	MENU_SELECT += @"\@ TFLAG:換装过滤器 == 3 ? 緑_ # \@[3]胖次＆胸罩 _"
	MENU_SELECT += @"\@ TFLAG:換装过滤器 == 4 ? 緑_ # \@[4]手套＆襪子＆靴 _"
	MENU_SELECT += @"\@ TFLAG:換装过滤器 == 5 ? 緑_ # \@[5]飾品 _"
ENDSELECT

PRINTL
CALL PRINT_STRL, "黄色_※想要脱掉衣服的时候_水色_可以连续选中现在穿着的衣服_or_水色_按下画像下的 脱衣: 右侧的按钮_黄色_※_"
CALL PRINT_STRL, MENU_SELECT
VARSET LOCALS
SPLIT STR:LASTCHOICE, "_", LOCALS
TYPE_LASTCHOICE = %LOCALS:0%
NAME_LASTCHOICE = %LOCALS:1%
CHANGE_SUBCOLOR =
STR_FACE = /%CSTR:ARG:颜绘変化%

IF CSTR:ARG:颜绘変化 != ""
	CALL EMOTION_PLUS, CSTR:ARG:颜绘変化, ARG

;表情変化は不要な気がしてきたのでいったんオミット
;ELSEIF ARG == MASTER && COND("池面", ARG)
;	CALL EMOTION_PLUS, @"重置%STR_FACE%", ARG
;ELSEIF CHECK_CLO("裸体", ARG)
;	IF TALENT:ARG:不知羞恥 || TALENT:ARG:小悪魔
;		CALL EMOTION_PLUS, @"小悪魔%STR_FACE%", ARG
;	ELSEIF TALENT:ARG:害羞
;		CALL EMOTION_PLUS, "害羞/对话框汗２/唇边手", ARG
;	ELSE
;		CALL EMOTION_PLUS, @"红潮恍惚/对话框・・・%STR_FACE%", ARG
;	ENDIF
;ELSEIF TALENT:ARG:恋慕 || TALENT:ARG:淫乱
;	CALL EMOTION_PLUS, @"夸奖%STR_FACE%", ARG
;ELSEIF TALENT:ARG:不知羞恥 || TALENT:ARG:小悪魔
;	CALL EMOTION_PLUS, @"小悪魔%STR_FACE%", ARG
;ELSEIF CHECK_CLO("恥ずかしい恰好", ARG)
;	IF TALENT:ARG:害羞
;		CALL EMOTION_PLUS, @"害羞%STR_FACE%", ARG
;	ELSE
;		CALL EMOTION_PLUS, @"重置/紅潮%STR_FACE%", ARG
;	ENDIF

ELSE
	CALL EMOTION_PLUS, @"重置%STR_FACE%", ARG
ENDIF
CALL START_PRINT_LINEUP

SELECTCASE TFLAG:換装过滤器
CASE 0
	CALL PRINT_STRL, @"%BL(21)%_緑_装扮_:\@ ARGS != "" ? _黄色_%ARGS%_ #  \@"
	CALL SELECTSL, "没有", "装扮_", BL(21)
	CALL SELECTSL, "西装外衣/水手服/女式衬衫/美式校服/背心/V领毛衣/女教師/校服", "装扮_", BL(21)
	CALL SELECTSL, "体操服布鲁马/体操服五分褲/体操服紧身短褲/体操服运动衫/工装裤", "装扮_", BL(21)
	CALL SELECTSL, "Micro比基尼/淚珠泳衣比基尼/比基尼/新死库水/死库水/競泳泳装/衝浪胖次", "装扮_", BL(21)
	CALL SELECTSL, "兔女郎制服/逆兔女郎/女仆装/執事服/修女服/旗袍/聖誕服/啦啦队制服", "装扮_", BL(21)
	CALL SELECTSL, "巫女/和服/浴衣/振袖/紋付袴/婚纱礼服/拘束衣", "装扮_", BL(21)
CASE 1
	CALL PRINT_STRL, @"%BL(21)%_緑_外衣_:\@ EQUIP:ARG:服 ? _黄色_%SHIRT(ARG)%_ #  \@"
	CALL SELECTSL, "西装外衣/水手服/背心/V领毛衣/女式衬衫/无袖女式衬衫/Ｔ恤/圆领衬衫", "外衣_", BL(21)
	CALL SELECTSL, "体操服/运动衫/吊帯背心/連帽風衣/前開的衬衫/校服/紧身高袍", "外衣_", BL(21)
	CALL SELECTSL, "针织毛衣/无袖高領毛衣/高領毛衣/露肩外衣/哥特式披风", "外衣_", BL(21)
	;CALL SELECTSL, "褶边連衣裙/露肩連衣裙/哥特連衣裙/洛丽塔連衣裙/白色連衣裙", "外衣_", BL(21)
	CALL SELECTSL, "格子連衣裙/連衣裙/吊帯衫/皮革夹克", "外衣_", BL(21)
	CALL SELECTSL, "晨衣/睡衣/情趣内衣/哥特蘿莉礼服/夏日礼服/哥特礼服", "外衣_", BL(21)

	PRINTL
	IF CHECK_SHIRT("連衣裙", ARG) == 0
		CALL PRINT_STRL, @"%BL(21)%_緑_裙_:\@ EQUIP:ARG:裙 ? _黄色_%SKIRT(ARG)%_ #  \@"
		CALL SELECTSL, "百褶裙/格子裙/紧身裙/荷葉邊", "裙_", BL(21)
	ENDIF
CASE 2
	CALL PRINT_STRL, @"%BL(21)%_緑_外套_:\@ EQUIP:ARG:外套 ? _黄色_%OUTER(ARG)%_ #  \@"
	CALL SELECTSL, "布鲁马/紧身短褲/热褲/休闲褲/五分褲/运动衫休闲褲/牛仔褲/工装裤", "外套_", BL(21)
	CALL SELECTSL, "開裆皮裤/连褲襪/褲襪/网纹褲襪", "外套_", BL(21)
	PRINTL
	CALL PRINT_STRL, @"%BL(21)%_緑_贴身制服_:\@ EQUIP:ARG:贴身制服 ? _黄色_%BODYS(ARG)%_ #  \@"
	CALL SELECTSL, "新死库水/紧身短褲型死库水/死库水/競泳泳装/兔女郎制服", "贴身制服_", BL(21)
CASE 3
	CALL PRINT_STRL, @"%BL(21)%_緑_胖次_:\@ EQUIP:ARG:胖次 ? _黄色_%PANTIES(ARG)%_ #  \@"
	CALL SELECTSL, "內褲/三角胖次/褶边の胖次/條紋胖次/蕾丝的胖次/低腰胖次", "胖次_", BL(21)
	CALL SELECTSL, "高開衩胖次/丁字褲/Micro內褲/四角内褲/開放型開洞胖次", "胖次_", BL(21)
	CALL SELECTSL, "超低腰胖次/高開衩布鲁马/兜襠布/前貼/Ｃ胖次/儿童胖次/襯褲/叶子胖次", "胖次_", BL(21)
	CALL SELECTSL, "衝浪胖次/比基尼/丁字褲比基尼/Micro比基尼/淚珠泳衣比基尼", "胖次_", BL(21)
	PRINTL
	CALL PRINT_STRL, @"%BL(21)%_緑_胸罩_:\@ EQUIP:ARG:胸罩 ? _黄色_%BRA(ARG)%_ #  \@"
	CALL SELECTSL, "满杯胸罩/３／４杯胸罩/半杯胸罩/Micro胸罩/開放型胸罩/拘束衣胸罩", "胸罩_", BL(21)
	CALL SELECTSL, "比基尼胸罩/猫型胸罩/蕾丝胸罩/吊帯背心/抹胸/褶边吊罩/乳贴", "胸罩_", BL(21)
CASE 4
	CALL PRINT_STRL, @"%BL(21)%_緑_手套_:\@ EQUIP:ARG:手套 ? _黄色_%GLOVE(ARG)%_ #  \@"
	CALL SELECTSL, "手套/指抜きグローブ/礼服手套/礼服袖套", "手套_", BL(21)
	PRINTL
	CALL PRINT_STRL, @"%BL(21)%_緑_短襪_:\@ EQUIP:ARG:襪子 ? _黄色_%SOCKS(ARG)%_ #  \@"
	CALL SELECTSL, "襪子/膝下襪/及膝襪/高筒襪/褶边短襪/短布襪", "襪子_", BL(21)
	CALL SELECTSL, "吊帯長筒襪/逆兔女郎褲襪", "襪子_", BL(21)
	PRINTL
	CALL PRINT_STRL, @"%BL(21)%_緑_靴_:\@ EQUIP:ARG:靴 ? _黄色_%SHOES(ARG)%_ #  \@"
	CALL SELECTSL, "小皮靴/運動鞋/平底鞋/高跟鞋/凉鞋/靴/草履/木屐/革靴", "靴_", BL(21)
CASE 5
	CALL PRINT_STRL, @"%BL(21)%_緑_飾品_:\@ EQUIP:ARG:飾品 ? _黄色_%REPLACE(REPLACE(CSTR:ARG:飾品, "\/", "＆"), "＆\$", "")%_ #  \@"
	CALL SELECTSL, "蝶形領帯/围巾/铃铛项圈/项圈", "饰_", BL(21)
	CALL SELECTSL, "眼鏡/太阳鏡/眼罩", "饰_", BL(21)
	CALL SELECTSL, "魔女の帽子/贝雷帽/礼服頭花/女仆帽/草帽/鸭舌帽/水兵帽", "饰_", BL(21)
	CALL SELECTSL, "修女帽/頭纱/护士帽/聖誕帽/胖次帽", "饰_", BL(21)
	CALL SELECTSL, "狐面/カボチャ面/兔耳/牛耳/髮箍/頭冠/簪子/花飾り", "饰_", BL(21)
	CALL SELECTSL, "外套/前開运动衫/前開V领毛衣/前開連帽風衣", "饰_", BL(21)
	CALL SELECTSL, "露肩夹克/裤吊带/圍裙/褞袍", "饰_", BL(21)
ENDSELECT

CALL PRINT_LINEUP

IF STRCOUNT(CSTR:ARG:颜绘変化, "胖次花绳")
	CALL PRINT_CUTIN, "胖次花绳", ARG
ELSE
	CALL PRINT_CUTIN, "縮小", ARG
ENDIF
CALL START_PRINT_LINEUP, "CIP"
PRINTL

IF CLO_PAT(NAME_LASTCHOICE, TYPE_LASTCHOICE) != ""
	CALL SELECTSL, CLO_PAT(NAME_LASTCHOICE, TYPE_LASTCHOICE), "類型選択_", @"%BL(21)%_緑_類型変更_:"
ELSE
;	PRINTL
ENDIF
IF CUSEABLE(NAME_LASTCHOICE, ARG) != ""
	CALL SELECTSL, CUSEABLE(NAME_LASTCHOICE, ARG), "", @"%BL(21)%_緑_花纹変更(%NAME_LASTCHOICE%)_:"
ELSE
	PRINTL
ENDIF

IF NAME_LASTCHOICE == "怪图案Ｔ恤"
	CALL SELECTSL, CUSEABLE("変な柄", ARG), "", @"%BL(21)%_緑_変Ｔ文字_:"
ELSEIF CUSEABLE(@"正面蝴蝶結%NAME_LASTCHOICE%", ARG) != ""
	CALL SELECTSL, CUSEABLE(@"正面蝴蝶結%NAME_LASTCHOICE%", ARG), "", @"%BL(21)%_緑_花纹変更(正面蝴蝶結)_:"
ELSEIF CUSEABLE(SHIRT(ARG, "種類"), ARG) != "" && (TYPE_LASTCHOICE == "裙" || TYPE_LASTCHOICE == "外套") && SHIRT(ARG, "種類") != NAME_LASTCHOICE
	CALL SELECTSL, CUSEABLE(SHIRT(ARG, "種類"), ARG), "外衣色変化_", @"%BL(21)%_緑_花纹変更(%SHIRT(ARG, "種類")%)_:"
ELSEIF CUSEABLE(SKIRT(ARG, "種類"), ARG) != "" && TYPE_LASTCHOICE != "裙" && SKIRT(ARG, "種類") != NAME_LASTCHOICE
	CALL SELECTSL, CUSEABLE(SKIRT(ARG, "種類"), ARG), "裙色変化_", @"%BL(21)%_緑_花纹変更(%SKIRT(ARG, "種類")%)_:"
ELSEIF CUSEABLE(OUTER(ARG, "種類"), ARG) != "" && TYPE_LASTCHOICE != "外套" && OUTER(ARG, "種類") != NAME_LASTCHOICE
	CALL SELECTSL, CUSEABLE(OUTER(ARG, "種類"), ARG), "外套色変化_", @"%BL(21)%_緑_花纹変更(%OUTER(ARG, "種類")%)_:"
ELSEIF CUSEABLE(SOCKS(ARG, "種類"), ARG) != "" && TYPE_LASTCHOICE != "襪子" && SOCKS(ARG, "種類") != NAME_LASTCHOICE
	CALL SELECTSL, CUSEABLE(SOCKS(ARG, "種類"), ARG), "襪子色変化_", @"%BL(21)%_緑_花纹変更(%SOCKS(ARG, "種類")%)_:"
ELSEIF EQUIP:ARG:外套 + EQUIP:ARG:裙 == 0 && TYPE_LASTCHOICE != "胖次" && PANTIES(ARG, "種類") != NAME_LASTCHOICE && CUSEABLE(PANTIES(ARG, "種類"), ARG) != "" && CHECK_CLO("泳装姿", ARG) == 0
	CALL SELECTSL, CUSEABLE(PANTIES(ARG, "種類"), ARG), "胖次色変化_", @"%BL(21)%_緑_花纹変更(%PANTIES(ARG, "種類")%)_:"
ELSE
	PRINTL
ENDIF
IF TYPE_OTHER(NAME_LASTCHOICE) == "外套"
	PRINTL
ELSEIF CHECK_OTHER("前開运动衫", ARG)
	CALL SELECTSL, CUSEABLE("前開运动衫", ARG), "外套色変化_", @"%BL(21)%_緑_花纹変更(前開运动衫)_:"
ELSEIF CHECK_OTHER("露肩夹克", ARG)
	CALL SELECTSL, CUSEABLE("露肩夹克", ARG), "外套色変化_", @"%BL(21)%_緑_花纹変更(露肩夹克)_:"
ELSEIF CHECK_OTHER("V领毛衣", ARG)
	CALL SELECTSL, CUSEABLE("前開V领毛衣", ARG), "外套色変化_", @"%BL(21)%_緑_花纹変更(前開V领毛衣)_:"
ELSEIF CHECK_OTHER("工作围裙", ARG)
	CALL SELECTSL, CUSEABLE("工作围裙", ARG), "外套色変化_", @"%BL(21)%_緑_花纹変更(工作围裙)_:"
ELSE
	SIF LINECOUNT - MEMO_LINECOUNT < 17
		PRINTL
ENDIF
CALL PRINT_LINEUP, "CIP"
CALL PRINT_CUTIN, "縮小背面", ARG
CALL MULTILINE, MAX(23 - (LINECOUNT - MEMO_LINECOUNT), 0)

VARSET TEXT_OFFSELECT, "水色_脱衣_:_BUTTON_[全部]"
IF EQUIP:ARG:服
	TEXT_OFFSELECT += "_BUTTON_[外衣]"
ELSE
	TEXT_OFFSELECT += "_灰色_[外衣]"
ENDIF
IF EQUIP:ARG:裙
	TEXT_OFFSELECT += "_BUTTON_[裙]"
ELSE
	TEXT_OFFSELECT += "_灰色_[裙]"
ENDIF
IF EQUIP:ARG:外套
	IF CHECK_OUTER("网纹褲襪", ARG)
		TEXT_OFFSELECT += "_BUTTON_[网纹褲襪]"
	ELSEIF CHECK_OUTER("褲襪", ARG)
		TEXT_OFFSELECT += "_BUTTON_[褲襪等]"
	ELSEIF CHECK_OUTER("连褲襪", ARG)
		TEXT_OFFSELECT += "_BUTTON_[连褲襪]"
	ELSE
		TEXT_OFFSELECT += "_BUTTON_[外套]"
	ENDIF
ELSE
	TEXT_OFFSELECT += "_灰色_[外套]"
ENDIF
IF EQUIP:ARG:贴身制服
	TEXT_OFFSELECT += "_BUTTON_[贴身制服]"
ELSE
	TEXT_OFFSELECT += "_灰色_[贴身制服]"
ENDIF
IF EQUIP:ARG:胖次
	TEXT_OFFSELECT += "_BUTTON_[胖次]"
	TEXT_OFFSELECT:1 += "_BUTTON_[胖次]"
ELSE
	TEXT_OFFSELECT += "_灰色_[胖次]"
	TEXT_OFFSELECT:1 += "_灰色_[胖次]"
ENDIF
IF EQUIP:ARG:胸罩
	TEXT_OFFSELECT += "_BUTTON_[胸罩]"
	TEXT_OFFSELECT:1 += "_BUTTON_[胸罩]"
ELSE
	TEXT_OFFSELECT += "_灰色_[胸罩]"
	TEXT_OFFSELECT:1 += "_灰色_[胸罩]"
ENDIF
IF EQUIP:ARG:手套
	TEXT_OFFSELECT += "_BUTTON_[手套]"
ELSE
	TEXT_OFFSELECT += "_灰色_[手套]"
ENDIF
IF EQUIP:ARG:襪子
	TEXT_OFFSELECT += "_BUTTON_[襪子]"
ELSE
	TEXT_OFFSELECT += "_灰色_[襪子]"
ENDIF
IF EQUIP:ARG:靴
	TEXT_OFFSELECT += "_BUTTON_[靴]"
ELSE
	TEXT_OFFSELECT += "_灰色_[靴]"
ENDIF
IF EQUIP:ARG:飾品
	TEXT_OFFSELECT += "_BUTTON_[饰]"
ELSE
	TEXT_OFFSELECT += "_灰色_[饰]"
ENDIF
SIF OTHER(ARG, "首") != ""
	TEXT_OFFSELECT += "_BUTTON_[首]"
SIF OTHER(ARG, "眼鏡") != ""
	TEXT_OFFSELECT += "_BUTTON_[眼鏡]"
SIF OTHER(ARG, "帽子") != ""
	TEXT_OFFSELECT += "_BUTTON_[帽子]"
SIF OTHER(ARG, "饰耳") != ""
	TEXT_OFFSELECT += "_BUTTON_[饰耳]"
SIF OTHER(ARG, "髪飾") != ""
	TEXT_OFFSELECT += "_BUTTON_[髪飾]"
SIF OTHER(ARG, "外套") != ""
	TEXT_OFFSELECT += "_BUTTON_[外套等]"
IF EQUIP:ARG:胖次
	IF CHECK_CLO("胖次下ろし可", ARG)
		TEXT_OFFSELECT += "_BUTTON_[拉下胖次]"
	ELSEIF CHECK_PANTIES("下拉半遮", ARG)
		TEXT_OFFSELECT += "_BUTTON_[整理胖次]"
	ENDIF
ENDIF
IF EQUIP:ARG:裙
	IF CFLAG:ARG:掀起裙子 == 0
		TEXT_OFFSELECT += "_BUTTON_[卷起裙子]"
	ELSE
		TEXT_OFFSELECT += "_BUTTON_[放好裙子]"
	ENDIF
ENDIF

SELECTCASE ARGS
CASE "整理内衣"
	CALL PRINT_STRL, TEXT_OFFSELECT:1
CASEELSE
	CALL PRINT_STRL, TEXT_OFFSELECT
ENDSELECT

PRINTL
;CALL PRINT_LINEUP, "CIP"

PRINTFORM 服装詳細:
CALL PRINT_DRESSL, ARG, "衣装表示"
PRINTL
CALL PRINT_STRL, @"只今の格好は　_黄色_%CLO_ABOUT(ARG)%_%SHOW_APP_CHANGE(ARG, " with")%です"
PRINTL

TEXT_ENDSELECT = 这様就好？
SELECTCASE ARGS
CASE "整理内衣"
	TEXT_ENDSELECT += "_BUTTON_[整理終了]"
	TEXT_ENDSELECT += "_BUTTON_[现在的内衣放入抽屉中]"
	IF COND("所持内衣数", ARG)
		TEXT_ENDSELECT += "_BUTTON_[检查抽屉里面(要処分掉的话也在这里)]"
	ELSE
		TEXT_ENDSELECT += "_灰色_[检查抽屉里面(现在里面什么都没有)]"
	ENDIF

CASEELSE
	IF MEMO_MASTERCLO != ""
		TEXT_ENDSELECT += @"_BUTTON_[%MEMO_MASTERCLO%に設定する]_BUTTON_[取消设定]"
	ELSE
		TEXT_ENDSELECT += "_BUTTON_[換装終了]"
	ENDIF
	TEXT_ENDSELECT += "_BUTTON_[関数表示]_BUTTON_[衣装保存]_BUTTON_[衣装加载]"
	SIF STR:最初の衣装 != ""
		TEXT_ENDSELECT += "_BUTTON_[返回最初的衣装]"
	TEXT_ENDSELECT += "_BUTTON_[晒痕]_BUTTON_[跳蛋]"
ENDSELECT

CALL PRINT_STRL, TEXT_ENDSELECT

;	[IF_DEBUG]
;		PRINTFORML STR:LASTCHOICE = %STR:LASTCHOICE%
;		VARSET LOCALS
;		SPLIT STR:CIP再現文字列, "/", LOCALS
;		FOR LCOUNT, 0, 5
;			SELECTCASE LOCALS:LCOUNT
;			CASE ""
;				SIF LCOUNT >= 1
;					BREAK
;				PRINTL
;			CASEELSE
;				PRINTFORML %LOCALS:LCOUNT%
;			ENDSELECT
;		NEXT
;	[ENDIF]

INPUTS
CHOICES = %EXTSTR(RESULTS, "[", "]")%
CLEARLINE 1

;特殊な選択
IF STRCOUNT(CHOICES, "色変化")
	VARSET LOCALS
	SPLIT CHOICES, "_", LOCALS
	CHOICES = %LOCALS:1%
	CHANGE_SUBCOLOR = %LOCALS%
ENDIF

SELECTCASE CHOICES
;純粋に数字を見る場合
CASE "0", "1", "2", "3", "4", "5"
	TFLAG:換装过滤器 = TOINT(CHOICES)
CASE "衣装保存"
	CALL SETFLAG, "衣装の記録", ARG
	CALL SAVE_CLO, STR:衣装記録, ARG
CASE "衣装加载"
	CALL SETFLAG, "衣装の記録", ARG
	CALL LOAD_CLO, STR:衣装記録, ARG
CASE "返回最初的衣装"
	STR:衣装記録 = %STR:最初の衣装%
	CALL SETFLAG, "衣装記録からの復元", ARG
CASE "取消设定"
	TFLAG:过滤器 = 0
;	CSTR:ARG:颜绘変化 =
	TFLAG:換装过滤器 = 0
	RETURN 1
CASE "換装終了", @"%MEMO_MASTERCLO%に設定する"
	IF ARG == MASTER && MEMO_MASTERCLO != ""
		CALL SETFLAG, "衣装の記録", MASTER
		IF SAVESTR:MEMO_MASTERCLO != STR:衣装記録
			SAVESTR:MEMO_MASTERCLO = %STR:衣装記録%
			CALL SETFLAG, "衣装記録からの復元", MASTER
			PRINTL
			CALL PRINT_DRESSL, ARG, "衣装表示"
			PRINTFORMW を%CALLNAME:MASTER%の%MEMO_MASTERCLO%に設定しました。
		ENDIF
		TFLAG:过滤器 = 0
	ENDIF

;	CSTR:ARG:颜绘変化 =
	TFLAG:換装过滤器 = 0
	RETURN 1

CASE "整理終了"
	TFLAG:过滤器 = 0
	TFLAG:換装过滤器 = 0
	RETURN 1
CASE "现在的内衣放入抽屉中"
	IF COND("所持内衣数", ARG) < 18
		CALL SETFLAG, "所持内衣に加える", ARG
		PRINTL
		CALL PRINT_UNDERWEARS, ARG
		PRINTFORMW 放到了抽屉里面。
	ELSE
		PRINTFORMW 抽屉里面塞满了。要处分掉哪个呢。
	ENDIF
CASE "检查抽屉里面(要処分掉的话也在这里)"
	CALL CHANGE_DRAWER_UNDERWEAR, ARG

CASE "整理胖次", "拉下胖次"
	CALL SETFLAG, CHOICES, ARG

CASE "卷起裙子", "放好裙子"
	INVERTBIT CFLAG:ARG:掀起裙子, 0
CASE "跳蛋"
	INVERTBIT CFLAG:ARG:電源BOX, 0
CASE "晒痕"
	IF COND("晒痕", ARG)
		CALL SETFLAG, "晒痕重置", ARG
		TALENT:ARG:常時晒痕 = 0
	ELSE
		CALL SETFLAG, "衣装の記録", ARG
		CALL SETFLAG, "晒痕", ARG
		TALENT:ARG:常時晒痕 = 1
	ENDIF
CASE "ポーズ重置"
	CSTR:ARG:颜绘変化 =
CASE "剪刀手"
	IF CSTR:ARG:颜绘変化 == "剪刀/"
		CSTR:ARG:颜绘変化 =
	ELSE
		CSTR:ARG:颜绘変化 = 剪刀/
	ENDIF
CASE "萌え袖"
	IF CSTR:ARG:颜绘変化 == "萌え袖/"
		CSTR:ARG:颜绘変化 =
	ELSE
		CSTR:ARG:颜绘変化 = 萌え袖/
	ENDIF
CASE "関数表示"
	IF CHECK_CLO("全裸", ARG) && EQUIP:ARG:飾品 == 0
		PRINTFORMW 现在身上什么都没有穿
	ELSE
		PRINTL
		PRINTFORML 现在的服装函数为
		PRINTL
		SIF EQUIP:ARG:服
			PRINTFORML CALL SET_SHIRT, "%SHIRT(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:服)%"
		SIF EQUIP:ARG:裙 && CHECK_SHIRT("連衣裙", ARG) == 0
			PRINTFORML CALL SET_SKIRT, "%SKIRT(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:裙)%"
		SIF EQUIP:ARG:贴身制服
			PRINTFORML CALL SET_BODYS, "%BODYS(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:贴身制服)%"
		SIF EQUIP:ARG:外套
			PRINTFORML CALL SET_OUTER, "%OUTER(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:外套)%"
		SIF EQUIP:ARG:胖次
			PRINTFORML CALL SET_PANTIES, "%PANTIES(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:胖次)%"
		SIF EQUIP:ARG:胸罩
			PRINTFORML CALL SET_BRA, "%BRA(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:胸罩)%"
		SIF EQUIP:ARG:手套
			PRINTFORML CALL SET_GLOVE, "%GLOVE(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:手套)%"
		SIF EQUIP:ARG:襪子
			PRINTFORML CALL SET_SOCKS, "%SOCKS(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:襪子)%"
		SIF EQUIP:ARG:靴
			PRINTFORML CALL SET_SHOES, "%SHOES(ARG, "種類")%%CHECK_ADDCLO(CSTR:ARG:靴)%"
		SIF EQUIP:ARG:飾品
			PRINTFORML CALL SET_OTHER, "%SUBSTRING(CSTR:ARG:飾品, 0, STRLENS(CSTR:ARG:飾品) - 1)%"
		PRINTL
		PRINTFORMW 。往EVENT_KX1_CLOTHES.ERB中进行复制的话就可以立即使用
	ENDIF
CASE "全部"
	SELECTCASE ARGS
	CASE "整理内衣"
		CALL SET_PANTIES, "", ARG
		CALL SET_BRA, "", ARG
	CASEELSE
		CALL SETFLAG, "衣装全脱ぎ", ARG
	ENDSELECT
CASE "外衣"
	CALL SET_SHIRT, "", ARG
CASE "裙"
	CALL SET_SKIRT, "", ARG
CASE "连褲襪", "外套", "网纹褲襪", "褲襪等"
	CALL SET_OUTER, "", ARG
CASE "贴身制服"
	CALL SET_BODYS, "", ARG
CASE "胖次"
	CALL SET_PANTIES, "", ARG
CASE "胸罩"
	CALL SET_BRA, "", ARG
CASE "手套"
	CALL SET_GLOVE, "", ARG
CASE "襪子"
	CALL SET_SOCKS, "", ARG
CASE "靴"
	CALL SET_SHOES, "", ARG
CASE "首", "眼鏡", "帽子", "饰耳",  "髪飾", "外套"
	CALL RESET_OTHER, CHOICES, ARG
CASE "外套等"
	CALL RESET_OTHER, "外套", ARG
CASE "饰"
	CALL SET_OTHER, "", ARG

;柄＆色
CASE "漢字１", "英字１", "英字２", "ＡＡ１"
	CALL SET_SHIRT, @"怪图案Ｔ恤/%CLOCOLOR_MAIDFACE("Ｔ恤", CHECK_CLOCOLOR(CSTR:ARG:服), ARG)%/%CHOICES%", ARG
CASE "三角黄", "三角黒", "三角青", "三角赤", "三角白", "紐黄", "紐黒", "紐青", "紐赤", "紐白"
	CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, @"正面蝴蝶結%CHOICES%")%
CASE "草莓紋", "小熊紋", "鱼紋", "猫紋", "小鸡紋", "蝴蝶结紋", "水玉模様"
	CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
CASE "紅白", "緑白", "青白", "黄白", "黒白", "水玉粉紅", "水玉黒", "水玉黄色", "水玉水色", "水玉白黒", "水玉白"
	SIF EQUIP:ARG:胖次 && CHECK_CUSEABLE(PANTIES(ARG, "種類"), CHOICES, ARG)
		CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
	SIF EQUIP:ARG:胸罩 && CHECK_CUSEABLE(BRA(ARG, "種類"), CHOICES, ARG)
		CSTR:ARG:胸罩 = %MERGE_STR(CSTR:ARG:胸罩, CHOICES)%
CASE "茶色", "黄色", "橙色", "黒", "紫", "青", "紺色", "薄青色", "真紅", "赤", "薄桃色", "桃色", "白", "純白", "緑色", "薄緑", "灰色", "水色", "豹纹", "奶牛", "虎紋", "柄", "米色", "濃紫", "藤の花", "焦茶色"
	SELECTCASE CHANGE_SUBCOLOR
	CASE "外衣色変化"
		CSTR:ARG:服 = %MERGE_STR(CSTR:ARG:服, CHOICES)%
		IF CHECK_SHIRT("連衣裙", ARG)
			CSTR:ARG:裙 = %MERGE_STR(CSTR:ARG:裙, CHOICES)%
		ELSEIF CHECK_SHIRT("和裤子颜色搭配", ARG) && CHECK_CUSEABLE(OUTER(ARG, "種類"), CHOICES, ARG)
			CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
		ENDIF
	CASE "裙色変化"
		CSTR:ARG:裙 = %MERGE_STR(CSTR:ARG:裙, CHOICES)%
	CASE "外套色変化"
		CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
	CASE "襪子色変化"
		CSTR:ARG:襪子 = %MERGE_STR(CSTR:ARG:襪子, CHOICES)%
	CASE "胖次色変化"
		CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
		SIF EQUIP:ARG:胸罩 && CHECK_CUSEABLE(BRA(ARG, "種類"), CHOICES, ARG)
			CSTR:ARG:胸罩 = %MERGE_STR(CSTR:ARG:胸罩, CHOICES)%
	CASE "外套色変化"
		SELECTCASE CHOICES
		CASE "赤", "青", "黒", "白"
			CHOICES += "い"
		CASEELSE
			CHOICES += "の"
		ENDSELECT

		IF CHECK_OTHER("前開运动衫", ARG)
			CALL SET_OTHER, @"%CHOICES%前開运动衫", ARG
		ELSEIF CHECK_OTHER("露肩夹克", ARG)
			CALL SET_OTHER, @"%CHOICES%露肩夹克", ARG
		ELSEIF CHECK_OTHER("V领毛衣", ARG)
			CALL SET_OTHER, @"%CHOICES%前開V领毛衣", ARG
		ELSEIF CHECK_OTHER("工作围裙", ARG)
			CALL SET_OTHER, @"%CHOICES%工作围裙", ARG
		ENDIF
	CASEELSE
		SELECTCASE TYPE_LASTCHOICE
		CASE "装扮"
			CALL SET_COSTUME, @"%ARGS%/%CHOICES%", ARG
			IF NAME_LASTCHOICE == SHIRT(ARG, "種類")
				IF CHECK_SHIRT("連衣裙", ARG)
					CSTR:ARG:裙 = %MERGE_STR(CSTR:ARG:裙, CHOICES)%
				ELSEIF CHECK_SHIRT("和裤子颜色搭配", ARG) && CHECK_CUSEABLE(OUTER(ARG, "種類"), CHOICES, ARG)
					CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
				ENDIF
			ENDIF
		CASE "外衣"
			CSTR:ARG:服 = %MERGE_STR(CSTR:ARG:服, CHOICES)%
			IF CHECK_SHIRT("連衣裙", ARG)
				CSTR:ARG:裙 = %MERGE_STR(CSTR:ARG:裙, CHOICES)%
			ELSEIF CHECK_SHIRT("和裤子颜色搭配", ARG) && CHECK_CUSEABLE(OUTER(ARG, "種類"), CHOICES, ARG)
				CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
			ENDIF
		CASE "裙"
			CSTR:ARG:裙 = %MERGE_STR(CSTR:ARG:裙, CHOICES)%
		CASE "外套"
			CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
		CASE "连褲襪"
			CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
		CASE "情趣吊带内衣"
			CSTR:ARG:襪子 = %MERGE_STR(CSTR:ARG:襪子, CHOICES)%
		CASE "贴身制服"
			CSTR:ARG:贴身制服 = %MERGE_STR(CSTR:ARG:贴身制服, CHOICES)%
		CASE "胖次"
			CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
			SIF EQUIP:ARG:胸罩 && CHECK_CUSEABLE(BRA(ARG, "種類"), CHOICES, ARG)
				CSTR:ARG:胸罩 = %MERGE_STR(CSTR:ARG:胸罩, CHOICES)%
		CASE "胸罩"
			CSTR:ARG:胸罩 = %MERGE_STR(CSTR:ARG:胸罩, CHOICES)%
			SIF EQUIP:ARG:胖次 && CHECK_CUSEABLE(PANTIES(ARG, "種類"), CHOICES, ARG)
				CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
		CASE "手套"
			CSTR:ARG:手套 = %MERGE_STR(CSTR:ARG:手套, CHOICES)%
		CASE "襪子"
			CSTR:ARG:襪子 = %MERGE_STR(CSTR:ARG:襪子, CHOICES)%
		CASE "靴"
			CSTR:ARG:靴 = %MERGE_STR(CSTR:ARG:靴, CHOICES)%
		CASE "饰"
			SELECTCASE CHOICES
			CASE "赤", "青", "黒", "白"
				CHOICES += "い"
			CASEELSE
				CHOICES += "の"
			ENDSELECT
			CALL SET_OTHER, @"%CHOICES%%NAME_LASTCHOICE%", ARG
		ENDSELECT
	ENDSELECT
;それ以外は種類選択。区分_名称 となっている
CASEELSE
	STR:LASTCHOICE = %CHOICES%
	VARSET LOCALS
	SPLIT CHOICES, "_", LOCALS
	CHOICES = %LOCALS:1%

	SELECTCASE LOCALS
	CASE "類型選択"
		STR:LASTCHOICE = %TYPE_LASTCHOICE%_%CHOICES%
		SELECTCASE TYPE_LASTCHOICE
		CASE "装扮"
			ARGS = %CHOICES%
			CALL SETFLAG, "内衣以外全脱ぎ", ARG
			CALL SET_OTHER, "", ARG
			CALL SET_COSTUME, CHOICES, ARG
		CASE "外衣"
			CALL SET_SHIRT, CHOICES, ARG
		CASE "裙"
			CALL SET_SKIRT, CHOICES, ARG
		CASE "外套"
			CALL SET_OUTER, CHOICES, ARG
		CASE "贴身制服"
			CALL SET_BODYS, CHOICES, ARG
		CASE "胖次"
			CALL SET_PANTIES, CHOICES, ARG
		CASE "胸罩"
			CALL SET_BRA, CHOICES, ARG
		CASE "手套"
			CALL SET_GLOVE, CHOICES, ARG
		CASE "襪子"
			CALL SET_SOCKS, CHOICES, ARG
		CASE "靴"
			CALL SET_SHOES, CHOICES, ARG
		CASE "饰"
			CALL SET_OTHER, CHOICES, ARG
		ENDSELECT
	CASE "装扮"
		CALL SETFLAG, "内衣以外全脱ぎ", ARG
		CALL SET_OTHER, "", ARG
		IF CHOICES == "没有"
			ARGS =
		ELSE
			ARGS = %CHOICES%
			CALL SET_COSTUME, CHOICES, ARG
		ENDIF
	CASE "外衣"
		IF ALLSAMES(SHIRT(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_SHIRT, "", ARG
		ELSE
			CALL SET_SHIRT, CHOICES, ARG
		ENDIF
	CASE "裙"
		IF ALLSAMES(SKIRT(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_SKIRT, "", ARG
		ELSE
			CALL SET_SKIRT, CHOICES, ARG
		ENDIF
	CASE "外套"
		IF ALLSAMES(OUTER(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_OUTER, "", ARG
		ELSE
			CALL SET_OUTER, CHOICES, ARG
		ENDIF
	CASE "贴身制服"
		IF ALLSAMES(BODYS(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_BODYS, "", ARG
		ELSE
			CALL SET_BODYS, CHOICES, ARG
		ENDIF
	CASE "胖次"
		IF ALLSAMES(PANTIES(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_PANTIES, "", ARG
		ELSE
			CALL SET_PANTIES, CHOICES, ARG
		ENDIF
	CASE "胸罩"
		IF ALLSAMES(BRA(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_BRA, "", ARG
		ELSE
			CALL SET_BRA, CHOICES, ARG
		ENDIF
	CASE "手套"
		IF ALLSAMES(GLOVE(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_GLOVE, "", ARG
		ELSE
			CALL SET_GLOVE, CHOICES, ARG
		ENDIF
	CASE "襪子"
		IF ALLSAMES(SOCKS(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_SOCKS, "", ARG
		ELSE
			CALL SET_SOCKS, CHOICES, ARG
		ENDIF
	CASE "靴"
		IF ALLSAMES(SHOES(ARG, "種類"), CHOICES, NAME_LASTCHOICE)
			CALL SET_SHOES, "", ARG
		ELSE
			CALL SET_SHOES, CHOICES, ARG
		ENDIF
	CASE "饰"
		CALL INVERTSET_OTHER, CHOICES, ARG
	ENDSELECT

	SIF CHOICES == "没有"
		STR:LASTCHOICE =
ENDSELECT

CLEARLINE LINECOUNT - MEMO_LINECOUNT
RESTART

;-------------------------------------------------
;SAVE, LOAD共にARGSに記録する衣装の文字列が入っている
;GLOBALS:0～23を使う
;-------------------------------------------------
@SAVE_CLO, ARGS, ARG
#DIM CHOICE
#DIM MEMO_LINECOUNT

SIF ARG == 0 && TARGET
	ARG = TARGET

MEMO_LINECOUNT = LINECOUNT
LOADGLOBAL

PRINTL
PRINTFORML 要记录到几号位置呢？点击[DEL]可以进行删除（请注意存档是全游戏存档公用的）
CALL SHOW_CLOSAVE, ARG
PRINTFORML [100] 返回　[200] 整理编号　[300] \@ GLOBAL:衣装シミュ颜绘表示 ? 文字列 # 颜绘 \@表示に変更　[400] \@ TFLAG:页数 ? 前 # 次 \@一页

CALL INPUT_SELECT, 48, 100, 200, 300, 400
CHOICE = RESULT

SELECTCASE CHOICE
CASE 400
	INVERTBIT TFLAG:页数, 0
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 300
	INVERTBIT GLOBAL:衣装シミュ颜绘表示, 0
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 200
	CALL SORT_CLOSAVE
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 100
CASE 24 TO 48
	GLOBALS:(CHOICE-24) =
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASEELSE
	IF GLOBALS:CHOICE != ""
		PRINTFORML 覆盖[{CHOICE, 2}]号存档可以吗？
		CALL PRINT_SELECT, "是/否"
		IF RESULT
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
	ENDIF
	STR:衣装記録 = %ARGS%
	CALL SETFLAG, "衣装記録からの復元", ARG
	;あってはならない装備を取下
	SIF CHECK_OTHER("黒色颈环", ARG)
		CALL RESET_OTHER, "黒色颈环", ARG
	CALL SETFLAG, "衣装の記録", ARG
	GLOBALS:CHOICE = %STR:衣装記録%
ENDSELECT

STR:衣装記録 = %ARGS%
CALL SETFLAG, "衣装記録からの復元", ARG
SAVEGLOBAL
RETURN 1

@LOAD_CLO, ARGS, ARG
#DIM CHOICE
#DIM MEMO_LINECOUNT

SIF ARG == 0 && TARGET
	ARG = TARGET

MEMO_LINECOUNT = LINECOUNT
LOADGLOBAL

PRINTL
PRINTFORML 使用几号存档呢？点击[DEL]可以进行删除
CALL SHOW_CLOSAVE, ARG
PRINTFORML [100] 返回　[200] 整理编号　[300] \@ GLOBAL:衣装シミュ颜绘表示 ? 文字列 # 颜绘 \@表示に変更　[400] \@ TFLAG:页数 ? 前 # 次 \@一页

CALL INPUT_SELECT, 48, 100, 200, 300, 400
CHOICE = RESULT

SELECTCASE CHOICE
CASE 400
	INVERTBIT TFLAG:页数, 0
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 300
	INVERTBIT GLOBAL:衣装シミュ颜绘表示, 0
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 200
	CALL SORT_CLOSAVE
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 100
	STR:衣装記録 = %ARGS%
CASE 24 TO 48
	GLOBALS:(CHOICE-24) =
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASEELSE
	IF GLOBALS:CHOICE == ""
		PRINTFORMW [{CHOICE, 2}]号存档里面什么都没有
		CLEARLINE LINECOUNT - MEMO_LINECOUNT
		RESTART
	ELSE
		STR:衣装記録 = %GLOBALS:CHOICE%
	ENDIF
ENDSELECT

CALL SETFLAG, "衣装記録からの復元", ARG
SAVEGLOBAL
RETURN 1

@SHOW_CLOSAVE, ARG
#DIM LCOUNT
#DIM LCOUNT2

;阴蒂ック指令表示中ON
SETBIT FLAG:メイン画面, 20
;颜绘セーブロード中ON
SETBIT FLAG:状況判定, 51

FOR LCOUNT, TFLAG:页数*12, TFLAG:页数*12 + 12
	ADDCOPYCHARA ARG
	CFLAG:(CHARANUM - 1):角色用 = LCOUNT
	SELECTCASE GLOBALS:LCOUNT
	CASE ""
		CALL SET_CEVENT, "颜绘没有", CHARANUM - 1
		CALL SETFLAG, "衣装全脱ぎ", CHARANUM - 1
	CASEELSE
		CALL DEL_CEVENT, "颜绘没有", CHARANUM - 1
		STR:衣装記録 = %GLOBALS:LCOUNT%
		CALL SETFLAG, "衣装記録からの復元", CHARANUM - 1
	ENDSELECT
	IF GLOBAL:衣装シミュ颜绘表示
		SELECTCASE LCOUNT
		CASE 5, 11, 17, 23
			CALL PRINT_MAIDFACE, CHARANUM - 6, CHARANUM - 5, CHARANUM - 4, CHARANUM - 3, CHARANUM - 2, CHARANUM - 1
			CALL PRINT_CUTIN, "縮小", CHARANUM - 6, CHARANUM - 5, CHARANUM - 4, CHARANUM - 3, CHARANUM - 2, CHARANUM - 1

			FOR LCOUNT2, 0, 6
				IF CEVENT("颜绘没有", CHARANUM - 6 + LCOUNT2)
					PRINTFORM %TEXT_LJ(@" [{LCOUNT-5+LCOUNT2, 2}]", NUMC_MAIDFACE() )%
				ELSE
					PRINTFORM %TEXT_LJ(@" [{LCOUNT-5+LCOUNT2, 2}]", NUMC_MAIDFACE()-7)%
					PRINTBUTTON "[DEL]", 24+LCOUNT-5+LCOUNT2
					PRINTPLAIN
				ENDIF
			NEXT
			PRINTL
			DELCHARA CHARANUM - 6, CHARANUM - 5, CHARANUM - 4, CHARANUM - 3, CHARANUM - 2, CHARANUM - 1
		ENDSELECT
	ELSE
		SELECTCASE GLOBALS:LCOUNT
		CASE ""
			PRINTFORML  [{LCOUNT, 2}] ----
		CASEELSE
			PRINTFORM  [{LCOUNT, 2}]
			CALL PRINT_DRESS, CHARANUM - 1, "衣装表示"
			PRINTBUTTON "　[DEL]", 24+LCOUNT
			PRINTL
		ENDSELECT
		DELCHARA CHARANUM - 1
		SIF LCOUNT == TFLAG:页数*12 + 12 - 1 || GLOBALS:LCOUNT + GLOBALS:(LCOUNT + 1) != ""
			CALL BLANKLINE
	ENDIF
NEXT

CLEARBIT FLAG:メイン画面, 20
CLEARBIT FLAG:状況判定, 51

@SHOW_CLOSAVE_OLD, ARG
#DIM LCOUNT
FOR LCOUNT, 0, 20
	SELECTCASE GLOBALS:LCOUNT
	CASE ""
		PRINTFORML  [{LCOUNT, 2}] ----
	CASEELSE
		PRINTFORM  [{LCOUNT, 2}]
		STR:衣装記録 = %GLOBALS:LCOUNT%
		CALL SETFLAG, "衣装記録からの復元", ARG
		CALL PRINT_DRESS, ARG, "衣装表示"
		PRINTBUTTON "　[DEL]", 20+LCOUNT
		PRINTL
	ENDSELECT
	SIF LCOUNT == 19 || GLOBALS:LCOUNT + GLOBALS:(LCOUNT + 1) != ""
		CALL BLANKLINE
NEXT

@SORT_CLOSAVE
#DIM LCOUNT
#DIM LCOUNT2

;24番目は見る必要ないので最初から19番までとする
FOR LCOUNT, 0, 23
	SELECTCASE GLOBALS:LCOUNT
	CASE ""
		FOR LCOUNT2, LCOUNT+1, 24
			SELECTCASE GLOBALS:LCOUNT2
			CASE ""
			CASEELSE
				SWAP GLOBALS:LCOUNT, GLOBALS:LCOUNT2
				BREAK
			ENDSELECT
		NEXT
	ENDSELECT
NEXT
SAVEGLOBAL

;-------------------------------------------------
;引き出しの内衣管理
;-------------------------------------------------
@CHANGE_DRAWER_UNDERWEAR, ARG
#DIM CHOICE
#DIM MEMO_LINECOUNT
#DIM LCOUNT

SIF ARG == 0 && TARGET
	ARG = TARGET

MEMO_LINECOUNT = LINECOUNT
;[300]のために呼んでおく
LOADGLOBAL

;タンスの中身を出す
VARSET LOCALS
SPLIT CSTR:ARG:所持内衣, "＠", LOCALS

PRINTL
PRINTFORML 現在%CALLNAME:MASTER%的秘密抽屉里面放入的内衣有
PRINTFORML 选择内衣可以穿上。点击[DEL]的话会删除＆点击空的编号会将现在的内衣放入(编号自动整理)
CALL SHOW_DRAWER_UNDERWEAR, ARG
PRINTFORML [100] 返回　[300] \@ GLOBAL:衣装シミュ颜绘表示 ? 文字列 # 颜绘 \@表示

CALL INPUT_SELECT, 36, 100, 300
CHOICE = RESULT

SELECTCASE CHOICE
CASE 300
	INVERTBIT GLOBAL:衣装シミュ颜绘表示, 0
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
;[DEL]した場合
CASE 18 TO 35
	LOCALS:(CHOICE-18) =
	CSTR:ARG:所持内衣 =
	FOR LCOUNT, 0, 18
		SELECTCASE LOCALS:LCOUNT
		CASE ""

		CASEELSE
			CSTR:ARG:所持内衣 +=  @"%LOCALS:LCOUNT%＠"
		ENDSELECT
	NEXT
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 100

CASEELSE
	;更衣場合
	IF LOCALS:CHOICE != ""
		STR:換装衣装 = %LOCALS:CHOICE%
		CALL SETFLAG, "内衣の換装", ARG
	;しまう場合
	ELSE
		CALL SETFLAG, "所持内衣に加える", ARG
		CLEARLINE LINECOUNT - MEMO_LINECOUNT
		RESTART
	ENDIF
ENDSELECT
RETURN 1

@SHOW_DRAWER_UNDERWEAR, ARG
#DIM LCOUNT
#DIM LCOUNT2

;阴蒂ック指令表示中ON
SETBIT FLAG:メイン画面, 20
;颜绘セーブロード中ON
SETBIT FLAG:状況判定, 51

;タンスの中身を出す
VARSET LOCALS
SPLIT CSTR:ARG:所持内衣, "＠", LOCALS

FOR LCOUNT, TFLAG:页数*18, TFLAG:页数*18 + 18
	ADDCOPYCHARA ARG
	CFLAG:(CHARANUM - 1):角色用 = LCOUNT
	SELECTCASE LOCALS:LCOUNT
	CASE ""
		CALL SET_CEVENT, "颜绘没有", CHARANUM - 1
		CALL SETFLAG, "衣装全脱ぎ", CHARANUM - 1
	CASEELSE
		CALL DEL_CEVENT, "颜绘没有", CHARANUM - 1
		STR:衣装記録 = %LOCALS:LCOUNT%
		CALL SETFLAG, "衣装記録からの復元", CHARANUM - 1
	ENDSELECT
	IF GLOBAL:衣装シミュ颜绘表示
		SELECTCASE LCOUNT
		CASE 5, 11, 17, 23
			CALL PRINT_MAIDFACE, CHARANUM - 6, CHARANUM - 5, CHARANUM - 4, CHARANUM - 3, CHARANUM - 2, CHARANUM - 1
			CALL PRINT_CUTIN, "縮小", CHARANUM - 6, CHARANUM - 5, CHARANUM - 4, CHARANUM - 3, CHARANUM - 2, CHARANUM - 1

			FOR LCOUNT2, 0, 6
				IF CEVENT("颜绘没有", CHARANUM - 6 + LCOUNT2)
					PRINTFORM %TEXT_LJ(@" [{LCOUNT-5+LCOUNT2, 2}]", NUMC_MAIDFACE() )%
				ELSE
					PRINTFORM %TEXT_LJ(@" [{LCOUNT-5+LCOUNT2, 2}]", NUMC_MAIDFACE()-7)%
					PRINTBUTTON "[DEL]", 18+LCOUNT-5+LCOUNT2
					PRINTPLAIN
				ENDIF
			NEXT
			PRINTL
			DELCHARA CHARANUM - 6, CHARANUM - 5, CHARANUM - 4, CHARANUM - 3, CHARANUM - 2, CHARANUM - 1
		ENDSELECT
	ELSE
		SELECTCASE LOCALS:LCOUNT
		CASE ""
			PRINTFORML  [{LCOUNT, 2}] ----
			PRINTL
		CASEELSE
			PRINTFORM  [{LCOUNT, 2}]
			CALL PRINT_DRESS, CHARANUM - 1, "衣装表示"
			PRINTBUTTON "　[DEL]", 18+LCOUNT
			PRINTL
		ENDSELECT
		DELCHARA CHARANUM - 1
		SIF LCOUNT == TFLAG:页数*18 + 18 - 1 || LOCALS:LCOUNT + LOCALS:(LCOUNT + 1) != ""
			CALL BLANKLINE
	ENDIF
NEXT

CLEARBIT FLAG:メイン画面, 20
CLEARBIT FLAG:状況判定, 51


code:
;-------------------------------------------------
;角色ARGの胖次を変更する。ARG == 0 の場合はドッペル你を使ってのシミュレーションモード
;-------------------------------------------------
@SIMULATE_CUTIN, ARG
STR:LASTCHOICE =
SELECTCASE ARG
CASE 0
	ADDCHARA 99
	ARG = CHARANUM - 1
	TALENT:ARG:肤色 = 0
	CALL SET_PANTIES, "內褲", ARG
	CALL SIMULATE_CUTIN_MAIN, ARG
	CALL DELETE_CHARA, CHARANUM - 1

ENDSELECT

;-------------------------------------------------
;ARGSで現在設定しているものの種類を管理する
;-------------------------------------------------
@SIMULATE_CUTIN_MAIN, ARG, ARGS
#DIM LCOUNT
#DIM MEMO_LINECOUNT
#DIMS CHOICES
#DIMS TYPE_LASTCHOICE
#DIMS NAME_LASTCHOICE
MEMO_LINECOUNT = LINECOUNT

IF OUTER(ARG, "CIP背面") != ""
	CALL PRINT_CUTIN, "見たまま前後", ARG
ELSEIF PANTIES(ARG, "CIP背面") != ""
	CALL PRINT_CUTIN, "見たまま前後", ARG
ELSEIF PANTIES(ARG, "CIP正面") == "開放型開洞胖次"
	CALL PRINT_CUTIN, "見たまま遠近", ARG
ELSE
	CALL PRINT_CUTIN, "見たまま正面", ARG
ENDIF

VARSET LOCALS
SPLIT STR:LASTCHOICE, "_", LOCALS
TYPE_LASTCHOICE = %LOCALS:0%
NAME_LASTCHOICE = %LOCALS:1%

[IF_DEBUG]
	PRINTFORML STR:LASTCHOICE = %STR:LASTCHOICE%

	VARSET LOCALS
	SPLIT STR:CIP再現文字列, "/", LOCALS
	FOR LCOUNT, 0, 5
		SELECTCASE LOCALS:LCOUNT
		CASE ""
			SIF LCOUNT >= 2
				BREAK
			PRINTL
		CASEELSE
			PRINTFORML %LOCALS:LCOUNT%
		ENDSELECT
	NEXT
[ENDIF]

SELECTCASE ARGS
CASEELSE
	IF NO:ARG  == 99
		CALL PRINT_STRL, @"　肤色:%TEXT_LJ(CONDS("肤色", ARG), 24)%_BUTTON_[普通]_BUTTON_[褐色肌]_BUTTON_[色白]_BUTTON_[青肌]_BUTTON_[色黒]"
		CALL PRINT_STRL, @"　　淫紋:%TEXT_LJ(@"{MARK:ARG:淫紋}LV", 24)%_BUTTON_[0LV]_BUTTON_[1LV]_BUTTON_[2LV]_BUTTON_[3LV]_BUTTON_[4LV]"
	ENDIF
	PRINTL

	CALL SELECTSL, "没有/內褲/三角胖次/褶边の胖次/條紋胖次/蕾丝的胖次", "胖次_", @"　胖次:%TEXT_LJ(\@ EQUIP:ARG:胖次 ? %PANTIES(ARG, "CIP正面")% # 没有 \@, 23)% "
	CALL SELECTSL, "高開衩胖次/低腰胖次/超低腰胖次/Ｔ字褲/Micro內褲", "胖次_", BL(33)
	CALL SELECTSL, "儿童胖次/兜襠布/前貼/Ｃ胖次/四角内褲/襯褲/叶子胖次", "胖次_", BL(33)
	CALL SELECTSL, "比基尼/丁字褲/Micro比基尼/淚珠泳衣比基尼/開放型開洞胖次", "胖次_", BL(33)
	CALL SELECTSL, "高開衩布鲁马", "胖次_", BL(33)
	PRINTL

	CALL SELECTSL, "没有/布鲁马/紧身短褲/热褲/迷你热褲/牛仔热褲/前開热褲/長褲/前開長褲", "外套_", @"外套:%TEXT_LJ(\@ (EQUIP:ARG:外套 && CHECK_OUTER("褲襪", ARG) + CHECK_OUTER("连褲襪", ARG) == 0) ? %OUTER(ARG, "CIP正面")% # 没有 \@, 23)% "
	PRINTL

	CALL SELECTSL, "没有/新死库水/死库水/競泳泳装/兔女郎制服", "贴身制服_", @"贴身制服:%TEXT_LJ(\@ EQUIP:ARG:贴身制服 ? %BODYS(ARG, "CIP正面")% # 没有 \@, 23)% "
	PRINTL

	CALL SELECTSL, "没有/运动衫/西装外衣/水手服/女式衬衫/体操服/体操服(短)/長連帽風衣", "外衣_", @"　　外衣:%TEXT_LJ(\@ EQUIP:ARG:服 ? %SHIRT(ARG, "CIP正面")% # 没有 \@, 23)% "
	CALL SELECTSL, "女仆装", "外衣_", BL(33)

	IF CHECK_SKIRT("連衣裙", ARG)
		CALL SELECTSL, "百褶裙", "裙_", @"裙:%TEXT_LJ(\@ EQUIP:ARG:服 ? %SHIRT(ARG, "CIP正面")% # 没有 \@, 23)% "
	ELSE
		CALL SELECTSL, "没有/百褶裙/迷你百褶裙/格子裙/迷你格子裙/荷葉邊/花柄荷葉邊", "裙_", @"裙:%TEXT_LJ(\@ EQUIP:ARG:裙 ? %SKIRT(ARG, "CIP正面")% # 没有 \@, 23)% "
	ENDIF
	CALL SELECTSL, "没有/连褲襪/网纹褲襪/褲襪", "连褲襪_", @"连褲襪:%TEXT_LJ(\@ CHECK_OUTER("褲襪", ARG) + CHECK_OUTER("连褲襪", ARG) ? %OUTER(ARG, "CIP正面")% # 没有 \@, 23)% "
	CALL SELECTSL, "没有/吊帯襪/吊帯長筒襪", "情趣吊带内衣_", @"ガーター:%TEXT_LJ(\@ CHECK_SOCKS("ガーター", ARG) ? %SOCKS(ARG, "CIP正面")% # 没有 \@, 23)% "
	PRINTL
	IF CUSEABLE(NAME_LASTCHOICE, ARG) != ""
		SELECTCASE NAME_LASTCHOICE
		;これだけ柄が多すぎた
		CASE "Ｔ字褲"
			CALL SELECTSL, CUSEABLE("紐Ｔ字褲not水玉", ARG), "", @"花纹変更:%TEXT_LJ(NAME_LASTCHOICE, 24)%"
			CALL SELECTSL, CUSEABLE("紐Ｔ字褲水玉", ARG), "", @"　　　　 %TEXT_LJ("", 24)%"
		CASEELSE
			CALL SELECTSL, CUSEABLE(NAME_LASTCHOICE, ARG), "", @"花纹変更:%TEXT_LJ(NAME_LASTCHOICE, 24)%"
			;胖次の蝴蝶結
			SELECTCASE PANTIES(ARG, "CIP正面")
			CASE "三角胖次"
				CALL SELECTSL, "三角黄/三角黒/三角青/三角赤/三角白/紐黄/紐黒/紐青/紐赤/紐白", "", @"　蝴蝶結:%TEXT_LJ(PANTIES(ARG, "蝴蝶結"), 24)%"
			CASE "褶边"
				CALL SELECTSL, "紐黄/紐黒/紐青/紐赤/紐白", "", @"　蝴蝶結:%TEXT_LJ(PANTIES(ARG, "蝴蝶結"), 24)%"
			CASEELSE
				PRINTL
			ENDSELECT
		ENDSELECT
	ELSE
		PRINTL
		PRINTL
	ENDIF
	IF NO:ARG  == 99
		CALL PRINT_STRL, "　这様就好？　　　　　　　　　 _BUTTON_[ＯＫ！]_BUTTON_[输出对应CSTR]"
	ELSE
		CALL PRINT_STRL, "　这様就好？　　　　　　　　　 _BUTTON_[ＯＫ！]"
	ENDIF
ENDSELECT

INPUTS
CHOICES = %EXTSTR(RESULTS, "[", "]")%
CLEARLINE 1

SELECTCASE CHOICES
CASE "ＯＫ！"
	PRINTL
	IF NO:ARG  == 99
		IF EQUIP:ARG:贴身制服
			PRINTFORML 这套贴身制服对应的CSTR是
			PRINTFORML %EXTSTR(CSTR:ARG:贴身制服, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:贴身制服, "共通属性追加済/")%
		ELSEIF EQUIP:ARG:外套
			PRINTFORML 这套外套对应的CSTR是
			PRINTFORML %EXTSTR(CSTR:ARG:外套, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:外套, "共通属性追加済/")%
		ELSE
			PRINTFORML 这套胖次对应的CSTR是
			PRINTFORML %EXTSTR(CSTR:ARG:胖次, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:胖次, "共通属性追加済/")%
		ENDIF
		PRINTFORMW 。
	ENDIF
	RETURN 1
CASE "输出对应CSTR"
	PRINTFORML 現在的画像に対応したCSTRは
	PRINTFORML CSTR:胖次 = %EXTSTR(CSTR:ARG:胖次, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:胖次, "共通属性追加済/")%
	SIF EQUIP:ARG:服
		PRINTFORML CSTR:服 = %EXTSTR(CSTR:ARG:服, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:服, "共通属性追加済/")%
	SIF EQUIP:ARG:裙
		PRINTFORML CSTR:裙 = %EXTSTR(CSTR:ARG:裙, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:裙, "共通属性追加済/")%
	SIF EQUIP:ARG:贴身制服
		PRINTFORML CSTR:贴身制服 = %EXTSTR(CSTR:ARG:贴身制服, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:贴身制服, "共通属性追加済/")%
	SIF EQUIP:ARG:外套
		PRINTFORML CSTR:外套 = %EXTSTR(CSTR:ARG:外套, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:外套, "共通属性追加済/")%
	SIF EQUIP:ARG:襪子
		PRINTFORML CSTR:襪子 = %EXTSTR(CSTR:ARG:襪子, "", "共通属性追加済/")%%EXTSTR(CSTR:ARG:襪子, "共通属性追加済/")%

	PRINTFORMW 。
CASE "普通"
	TALENT:ARG:肤色 = 0
CASE "褐色肌"
	TALENT:ARG:肤色 = 1
CASE "色白"
	TALENT:ARG:肤色 = 2
CASE "青肌"
	TALENT:ARG:肤色 = 3
CASE "色黒"
	TALENT:ARG:肤色 = 4
;淫紋のレベル
CASE "0LV"
	MARK:ARG:淫紋 = 0
CASE "1LV"
	MARK:ARG:淫紋 = 1
CASE "2LV"
	MARK:ARG:淫紋 = 2
CASE "3LV"
	MARK:ARG:淫紋 = 3
CASE "4LV"
	MARK:ARG:淫紋 = 4

;柄＆色
CASE "草莓紋", "小熊紋", "鱼紋", "猫紋", "小鸡紋", "蝴蝶结紋", "水玉模様"
	CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
CASE "紅白", "緑白", "青白", "黄白", "黒白", "水玉粉紅", "水玉黒", "水玉黄色", "水玉水色", "水玉白黒", "水玉白"
	CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%

CASE "茶色", "黄色", "橙色", "黒", "紫", "濃紫", "青", "紺色", "薄青色", "真紅", "赤", "薄桃色", "桃色", "白", "純白", "緑色", "薄緑", "灰色", "水色", "豹纹", "奶牛", "虎紋", "柄", "米色"
	SELECTCASE TYPE_LASTCHOICE
	CASE "胖次"
		CSTR:ARG:胖次 = %MERGE_STR(CSTR:ARG:胖次, CHOICES)%
	CASE "外套"
		CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
	CASE "连褲襪"
		CSTR:ARG:外套 = %MERGE_STR(CSTR:ARG:外套, CHOICES)%
	CASE "情趣吊带内衣"
		CSTR:ARG:襪子 = %MERGE_STR(CSTR:ARG:襪子, CHOICES)%
	CASE "贴身制服"
		CSTR:ARG:贴身制服 = %MERGE_STR(CSTR:ARG:贴身制服, CHOICES)%
	CASE "外衣"
		CSTR:ARG:服 = %MERGE_STR(CSTR:ARG:服, CHOICES)%
	CASE "裙"
		CSTR:ARG:裙 = %MERGE_STR(CSTR:ARG:裙, CHOICES)%
	ENDSELECT
;オプション
CASE "三角黄", "三角黒", "三角青", "三角赤", "三角白", "紐黄", "紐黒", "紐青", "紐赤", "紐白"
	VARSET LOCALS
	SPLIT CSTR:ARG:胖次, "/", LOCALS
	CSTR:ARG:胖次 =
	FOR LCOUNT, 0, 100
		SIF LOCALS:LCOUNT == ""
			BREAK

		IF STRCOUNT(LOCALS:LCOUNT, "正面蝴蝶結")
			CSTR:ARG:胖次 += @"正面蝴蝶結%CHOICES%\/"
		ELSE
			CSTR:ARG:胖次 += @"%LOCALS:LCOUNT%\/"
		ENDIF
	NEXT

;それ以外は種類選択。区分_名称 となっている
CASEELSE
	STR:LASTCHOICE = %CHOICES%
	VARSET LOCALS
	SPLIT CHOICES, "_", LOCALS
	CHOICES = %LOCALS:1%

	SELECTCASE LOCALS
	CASE "胖次"
		;CALL SET_OUTER, "", ARG
		CALL SET_PANTIES, CHOICES, ARG
	CASE "外套"
		CALL SET_OUTER, CHOICES, ARG
		CALL SET_BODYS, "", ARG
		SIF CHECK_SKIRT("荷葉邊", ARG)
			CALL SET_SKIRT, "", ARG
	CASE "连褲襪"
		CALL SET_OUTER, CHOICES, ARG
		CALL SET_SOCKS, "", ARG
	CASE "情趣吊带内衣"
		CALL SET_SOCKS, CHOICES, ARG
		;CALL SET_OUTER, "", ARG
	CASE "贴身制服"
		CALL SET_BODYS, CHOICES, ARG
		CALL SET_OUTER, "", ARG
	CASE "外衣"
		CALL SET_SHIRT, CHOICES, ARG
		SIF CHECK_SKIRT("荷葉邊", ARG)
			CALL SET_SKIRT, "", ARG
	CASE "裙"
		CALL SET_SKIRT, CHOICES, ARG
		IF CHECK_SKIRT("荷葉邊", ARG)
			CALL SET_SHIRT, "", ARG
			CALL SET_OUTER, "", ARG
		ENDIF
	ENDSELECT
	SIF CHOICES == "没有"
		STR:LASTCHOICE =
ENDSELECT

CLEARLINE LINECOUNT - MEMO_LINECOUNT
RESTART


code:
;-------------------------------------------------
;角色ARGの淫紋を選ぶ。ARG == 0 の場合はドッペル你を使ってのシミュレーションモード
;-------------------------------------------------
@SIMULATE_INMON, ARG
#DIM MEMO_INMON
#DIM MEMO_REDRAW

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

;淫紋設定中フラグＯＮ
SETBIT FLAG:状況判定, 44

SELECTCASE ARG
CASE 0
	ADDCHARA 99
	ARG = CHARANUM - 1
	CALL SET_3SIZE, ARG
	BASE:ARG:腰圍 = BASE:ARG:身高 * 38 /100
	TALENT:ARG:肤色 = 0
	MARK:ARG:淫紋 = 2
	CALL SIMULATE_INMON_MAIN, ARG
	CALL DELETE_CHARA, CHARANUM - 1
CASEELSE
	MEMO_INMON = MARK:ARG:淫紋
	SIF MARK:ARG:淫紋 == 0
		MARK:ARG:淫紋 = 1
	CALL SIMULATE_INMON_MAIN, ARG
	;仮想角色で無いなら淫紋を元に戻す
	SIF COND("仮想角色", ARG) == 0
		MARK:ARG:淫紋 = MEMO_INMON
ENDSELECT

CLEARBIT FLAG:状況判定, 44
REDRAW MEMO_REDRAW

@SIMULATE_INMON_MAIN, ARG
#DIM LCOUNT
#DIM MEMO_LINECOUNT
#DIMS CHOICES
MEMO_LINECOUNT = LINECOUNT

PRINTL
CALL PRINT_CUTIN, "腹部", ARG

IF COND("仮想角色", ARG)
	CALL SELECTSL, "普通/褐色肌/色白/青肌/色黒", "肤色：", @"　　　　肤色:%TEXT_LJ(CONDS("肤色", ARG), 13)%"
	CALL SELECTSL, "普通/苗条/筋肉/豐腴", "肚子周围：", @"　　　肚子周围:%TEXT_LJ(CONDS("お腹の見た目", ARG), 13)%"
	CALL SELECTSL, "没有/H型/棒型/十字架型/♂型/♀型/心型", "肚脐环：", @"　　肚脐环:%TEXT_LJ(CEVENTS("肚脐环", ARG), 13)%"
	CALL SELECTSL, "没有/銀色/金色/赤/緑/紫/青", "恥丘穿環：", @"　　恥丘穿環:%TEXT_LJ(CEVENTS("恥丘穿環", ARG), 13)%"
ENDIF
PRINTL

CALL SELECTSL, "基本/羽化/改造/開花/寄生", "", @"　　　　　形状:%TEXT_LJ(CONDS("淫紋の種類", ARG), 13)%"
CALL SELECTSL, "浸食/堕落/隷属/封入/聖翼", "", @"　　　　　　　　　　　　　　"
PRINTL
CALL SELECTSL, "0LV/1LV/2LV/3LV/4LV", "", @"　　　　　段階:{MARK:ARG:淫紋}LV　　　　　"
IF COND("仮想角色", ARG)
	CALL SELECTSL, "平常/欲求不満/満足", "様子：", @"　　淫紋の様子:%TEXT_LJ(CONDS("淫紋の様子", ARG), 13)%"
	CALL SELECTSL, "平常/妊娠中", "妊娠：", @"　　母体の状態:\@ BASE:ARG:受精 ? 妊娠中 # 平常　 \@ 　　　"
ENDIF
PRINTL
CALL PRINT_STRL, "　　　这様就好？　　　　　_BUTTON_[ＯＫ！]"

INPUTS
CHOICES = %EXTSTR(RESULTS, "[", "]")%
CLEARLINE 1

SELECTCASE CHOICES
CASE "ＯＫ！"
	SIF CEVENTS("淫紋", ARG) == ""
		CALL SET_CEVENT, "淫紋：基本", ARG

	PRINTL
	RETURN 1
CASE "肤色：普通"
	TALENT:ARG:肤色 = 0
CASE "肤色：褐色肌"
	TALENT:ARG:肤色 = 1
CASE "肤色：色白"
	TALENT:ARG:肤色 = 2
CASE "肤色：青肌"
	TALENT:ARG:肤色 = 3
CASE "肤色：色黒"
	TALENT:ARG:肤色 = 4

CASE "肚子周围：普通"
	TALENT:ARG:筋肉 = 0
	BASE:ARG:腰圍 = BASE:ARG:身高 * (CALCF("苗条倍数", ARG) + CALCF("豐腴倍数", ARG) ) /200
CASE "肚子周围：苗条"
	TALENT:ARG:筋肉 = 0
	BASE:ARG:腰圍 = BASE:ARG:身高 * (CALCF("苗条倍数", ARG) - 1) /100
CASE "肚子周围：筋肉"
	TALENT:ARG:筋肉 = 1
	BASE:ARG:腰圍 = BASE:ARG:身高 * 38 /100
CASE "肚子周围：豐腴"
	TALENT:ARG:筋肉 = 0
	BASE:ARG:腰圍 = BASE:ARG:身高 * (CALCF("豐腴倍数", ARG) + 1) /100

;形状
CASE "基本", "羽化", "改造", "開花", "寄生", "浸食", "堕落", "隷属", "封入", "聖翼"
	CALL DEL_CEVENT_GROUP, "淫紋", ARG
	CALL SET_CEVENT, @"淫紋：%CHOICES%", ARG
;段階
CASE "0LV"
	MARK:ARG:淫紋 = 0
CASE "1LV"
	MARK:ARG:淫紋 = 1
CASE "2LV"
	MARK:ARG:淫紋 = 2
CASE "3LV"
	MARK:ARG:淫紋 = 3
CASE "4LV"
	MARK:ARG:淫紋 = 4

;淫紋の様子
CASE "様子：平常"
	CFLAG:ARG:躁动难忍 = 0
	CFLAG:ARG:Ａ已中出 = 0
	CFLAG:ARG:Ｖ已中出 = 0
CASE "様子：欲求不満"
	CFLAG:ARG:躁动难忍 = 1
	CFLAG:ARG:Ａ已中出 = 0
	CFLAG:ARG:Ｖ已中出 = 0
CASE "様子：満足"
	CFLAG:ARG:躁动难忍 = 0
	IF TALENT:ARG:男性 || TALENT:ARG:尻穴狂い
		CFLAG:ARG:Ａ已中出 = 1
	ELSE
		CFLAG:ARG:Ｖ已中出 = 1
	ENDIF

;妊娠状態
CASE "妊娠：妊娠中"
	BASE:ARG:受精 = 1
CASE "妊娠：平常"
	BASE:ARG:受精 = 0

;肚脐环
CASE "肚脐环：没有"
	CALL DEL_CEVENT_GROUP, "肚脐环", ARG
	TALENT:ARG:肚脐环 = 0
CASE "肚脐环：H型", "肚脐环：棒型", "肚脐环：十字架型", "肚脐环：♂型", "肚脐环：♀型", "肚脐环：心型"
	CALL DEL_CEVENT_GROUP, "肚脐环", ARG
	CALL SET_CEVENT, CHOICES, ARG
	TALENT:ARG:肚脐环 = 1
;恥丘穿環
CASE "恥丘穿環：没有"
	CALL DEL_CEVENT_GROUP, "恥丘穿環", ARG
	TALENT:ARG:恥丘穿環 = 0
CASE "恥丘穿環：銀色", "恥丘穿環：金色", "恥丘穿環：赤", "恥丘穿環：緑", "恥丘穿環：紫", "恥丘穿環：青"
	CALL DEL_CEVENT_GROUP, "恥丘穿環", ARG
	CALL SET_CEVENT, CHOICES, ARG
	TALENT:ARG:恥丘穿環 = 1
ENDSELECT

CLEARLINE LINECOUNT - MEMO_LINECOUNT
RESTART