code:
;-------------------------------------------------
;画像を特写する関数群。製作者　金吉獣料理
;-------------------------------------------------
;特写する画像の種類ARGSをARG:0～ARG:{X-1}のX人分並べて表示する関数。横長なので3人まで。
;画像のピクセル数はとりあえず自動的に縦100が選択される。
;ARGSには "淫紋", "兔チップ"の2種の他、[胖次or見たまま][正面or背面or前後]の組み合わせが入る。
;例）"胖次正面"、"見たまま背面" など
;前後 を使った場合は表示を２個使うので一人だけにすること。
;-------------------------------------------------
@PRINT_CUTIN, ARGS, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM LCOUNT
#DIM ACTOR, 6
#DIM NUM_ACTOR
#DIM MEMO_REDRAW
#DIM ypos
#DIMS MEMO_PANTIES, 6
#DIM MEMO_CFLAG

ypos = 0
MEMO_CFLAG = 0

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

NUM_ACTOR = 0
VARSET ACTOR
VARSET MEMO_PANTIES

FOR LCOUNT, 0, 6
	SIF LCOUNT >= 1 && ARG:LCOUNT <= 0
		BREAK

	ACTOR:NUM_ACTOR = ARG:LCOUNT
	NUM_ACTOR += 1
	CFLAG:(ARG:LCOUNT):CIP発生済 = 1
NEXT

VARSET LATESTCUTINCHARA
VARSET LATESTCUTINID
STR:参照用MAIDFACE文字列 =

;淫紋の动画ーションに使う
VARSET SAVEINMON_BOTTOM
VARSET SAVEINMON_TOP

SELECTCASE ARGS
;特殊な分岐
CASE "受精"
	CALL PRINT_CUTIN_SUB, "受精"
CASE "胖次前後"
	CALL PRINT_CUTIN_SUB, "胖次正面", ACTOR, 0
	CALL PRINT_CUTIN_SUB, "胖次背面", ACTOR, 1
CASE "掀起裙子"
	MEMO_CFLAG = CFLAG:ACTOR:ARGS
	CALL PRINT_CUTIN_SUB, "見たまま正面/掀起裙子", ACTOR, 0
	CFLAG:ACTOR:ARGS = MEMO_CFLAG
CASE "見たまま前後"
	CALL PRINT_CUTIN_SUB, "見たまま正面", ACTOR, 0
	SIF STRCOUNT(STR:参照用MAIDFACE文字列, "CIP背面") == 0
		CALL PRINT_CUTIN_SUB, "見たまま背面", ACTOR, 1
CASE "見たまま遠近"
	CALL PRINT_CUTIN_SUB, "見たまま正面", ACTOR, 0
	SIF STRCOUNT(STR:参照用MAIDFACE文字列, "CIPすじ") == 0
		CALL PRINT_CUTIN_SUB, "すじ", ACTOR, 1
CASE "属性与外表"
	;この中で STR:参照用MAIDFACE文字列 を用いて計算する
	CALL PRINT_MAIDFACE_SUB, ACTOR, 0
	CALL PRINT_CUTIN_SUB, "腹部", ACTOR, 1
CASE "腹部"
	FOR LCOUNT, 0, 6
		SIF ACTOR:LCOUNT <= 0
			BREAK

		CALL PRINT_CUTIN_SUB, "腹部", ACTOR:LCOUNT, LCOUNT
	NEXT
CASE "兔チップ"
	FOR LCOUNT, 0, 6
		SIF ACTOR:LCOUNT <= 0
			BREAK

		CALL PRINT_CUTIN_SUB, "胸部", ACTOR:LCOUNT, LCOUNT
	NEXT
CASE "縮小", "胖次花绳", "縮小背面"
	;CIP縮小中フラグON
	SETBIT FLAG:メイン画面, 10

	;胖次花绳フラグON
	SIF ARGS == "胖次花绳"
		SETBIT FLAG:状況判定, 52

	FOR LCOUNT, 0, 6
		SIF ACTOR:LCOUNT <= 0
			BREAK
		SIF CEVENT("颜绘没有", ACTOR:LCOUNT)
			CONTINUE

		;SIF COND("阴蒂ック指令表示中")
		;	CALL PRINT_CUTIN_SUB, "縮小ボタン", ACTOR:LCOUNT, LCOUNT

		SELECTCASE ARGS
		CASE "縮小背面"
			CALL PRINT_CUTIN_SUB, "見たまま背面", ACTOR:LCOUNT, LCOUNT
		CASEELSE
			IF COND("胖次花绳中") && CHECK_PANTIES("胖次花绳可能", ACTOR:LCOUNT)
				MEMO_PANTIES:LCOUNT = %CSTR:(ACTOR:LCOUNT):胖次%
				CALL SET_PANTIES, "", ACTOR:LCOUNT
			ENDIF
			IF EQUIP:(ACTOR:LCOUNT):裙
				;掀起裙子前かつ裙画像がない場合には出力しない
				SIF CFLAG:(ACTOR:LCOUNT):掀起裙子 == 0 && SKIRT(ACTOR:LCOUNT, "CIP正面") == ""
					CONTINUE
			ENDIF

			CALL PRINT_CUTIN_SUB, "見たまま正面", ACTOR:LCOUNT, LCOUNT
		ENDSELECT

		IF COND("胖次花绳中") && MEMO_PANTIES:LCOUNT != ""
			STR:換装衣装 = %MEMO_PANTIES:LCOUNT%
			CALL SETFLAG, "胖次の換装", ACTOR:LCOUNT
		ENDIF
	NEXT

	;CIP縮小中フラグOFF
	CLEARBIT FLAG:メイン画面, 10
	;胖次花绳フラグOFF
	CLEARBIT FLAG:状況判定, 52
CASEELSE
	FOR LCOUNT, 0, 6
		SIF ACTOR:LCOUNT <= 0
			BREAK

		CALL PRINT_CUTIN_SUB, ARGS, ACTOR:LCOUNT, LCOUNT
	NEXT
ENDSELECT

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

	SELECTCASE ARGS
	CASE "縮小"
		;阴蒂ック指令表示中では無い場合に縮小画像が無いなら表示させない
		IF COND("阴蒂ック指令表示中") == 0 && SUBSTRING(STR:CIP再現文字列, 0, STRLENS("CIP背景没有") ) == "CIP背景没有"

		ELSE
			HTML_PRINT CONVERTSTR(STR:CIP再現文字列)
			CALL MULTILINE, TFLAG:MAX_height
		ENDIF
	CASEELSE
		HTML_PRINT CONVERTSTR(STR:CIP再現文字列)
		CALL MULTILINE, TFLAG:MAX_height
	ENDSELECT
ENDIF
REDRAW MEMO_REDRAW

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

NUM_CUTIN = ARG:1
MEMO_CUTIN = %CUTIN(ARGS, ARG, NUM_CUTIN, ARG:2)%

CALL CREATE_SPRITE_CUTIN, ARG, NUM_CUTIN, MEMO_CUTIN

@CREATE_SPRITE_CUTIN, ARG, ARG:1, ARGS
#DIMS MEMO_CUTIN
#DIM NUM_CUTIN

NUM_CUTIN = ARG:1
MEMO_CUTIN = %ARGS%

SIF MEMO_CUTIN == ""
	RETURN 0

CALL OVERLAY_GCREATE, CUTINID, @"%EXTSTR(MEMO_CUTIN, "", ",")%"

SIF SPRITECREATED(@"CUTIN{CUTINID}")
	SPRITEDISPOSE @"CUTIN{CUTINID}"

;スプライト名をつける
IF STRCOUNT(MEMO_CUTIN, "CIP背景マスク")
	IF SPRITECREATE(@"CUTIN{CUTINID}", CUTINID, 60, 0, 180, 100)
		;PRINTFORML 縮小スプライト作成成功：CUTIN{CUTINID}
	ELSE
		;PRINTFORML 縮小スプライト作成失敗：CUTIN{CUTINID}
	ENDIF
ELSE
	IF SPRITECREATE(@"CUTIN{CUTINID}", CUTINID)
		;PRINTFORML 通常スプライト作成成功：CUTIN{CUTINID}
	ELSE
		;PRINTFORML 通常スプライト作成失敗：CUTIN{CUTINID}
	ENDIF
ENDIF
STR:参照用MAIDFACE文字列 += @"CUTIN{CUTINID},%EXTSTR(MEMO_CUTIN, ",")%"

;作成した特写とIDをメモ
LATESTCUTINCHARA:NUM_CUTIN = ARG
LATESTCUTINID:NUM_CUTIN = CUTINID

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

;-------------------------------------------------
;出してしまった特写を消す関数
;突然出現した100は、このバリアントだと特写のサイズが縦100ピクセルのため
;もしも前提が異なる場合は数字を変える事
;-------------------------------------------------
@CLEAR_CUTIN
CLEARLINE CUTINSIZE()/100

@CUTINSIZE()
#FUNCTION
RETURNF PICSIZE(5)

;-------------------------------------------------
;角色ARGの特写ARGSを描画する関数。ARG:1には何人目の位置かが入っている。ARG:2はyposの位置。
;ピクセル数は選べるようにしようと思ったが胖次特写は300*100固定。
;ARGSには[胖次or見たまま][正面or背面or前後]の組み合わせが入っている
;ARGSは / で区切って表示注文 外套OFF,连褲襪OFF,裙OFF,服OFF を付けられる。
;-------------------------------------------------
@CUTIN(ARGS, ARG, ARG:1, ARG:2)
#FUNCTIONS
#DIM LCOUNT
#DIM NUM_CUTIN
#DIM FSIZE
#DIM FSIZE2
#DIM FPOS
#DIM FPOS_FACE
#DIM MEMO_value
;BG ～ SKIRTはこの順番で上に重ねていく
#DIMS BG
#DIMS BG_MASK
;これは肌
#DIMS CUTIN_SKIN
#DIMS CUTIN_SUNTAN
#DIMS CUTIN_PIERCE
#DIMS CUTIN_INMON
#DIMS CUTIN_PANTIES
#DIMS CUTIN_PANTIES_OVER
;CUTIN_OUTER ～ CUTIN_SKIRTは正面のみ
#DIMS CUTIN_OUTER
#DIMS CUTIN_PANST
#DIMS CUTIN_BODYS
#DIMS CUTIN_SKIRT
#DIMS CUTIN_SKIRT_OVER
#DIMS CUTIN_SKIRT_BACK
#DIMS CUTIN_SHIRT
#DIMS CUTIN_SOCKS
#DIMS CUTIN_SOCKS2
#DIMS CIPTYPE
#DIMS SKINTYPE
#DIMS INMONTYPE
#DIMS CUTIN_PUBES
#DIMS CUTIN_PUBES_UNDER
#DIMS OUTER_BODYS
#DIMS CUTIN_MASK_PANST
#DIMS CUTIN_MASK_OUTER
#DIMS CUTIN_ROTOR
#DIMS CUTIN_ROTOR_PANST
#DIMS CUTIN_ROTOR_OVER

NUM_CUTIN = ARG:1
MEMO_value = 0
BG_MASK =
CUTIN_SKIN =
CUTIN_SUNTAN =
CUTIN_PIERCE =
CUTIN_INMON =
CUTIN_PANTIES =
CUTIN_PANTIES_OVER =
CUTIN_OUTER =
CUTIN_MASK_OUTER =
CUTIN_PANST =
CUTIN_BODYS =
CUTIN_SHIRT =
CUTIN_SKIRT =
CUTIN_SKIRT_OVER =
CUTIN_SKIRT_BACK =
CUTIN_SOCKS =
CUTIN_SOCKS2 =
CUTIN_ROTOR =
SIF STRCOUNT(ARGS, "掀起裙子")
	CFLAG:ARG:掀起裙子 = 1
;開放型连褲襪を履いている場合はこっちを使う
CUTIN_ROTOR_PANST =
;裙がある＆掀起裙子状態ならコード部分をこっちに移す
CUTIN_ROTOR_OVER =

CUTIN_PUBES =
CUTIN_PUBES_UNDER =
INMONTYPE =
OUTER_BODYS =

;表示位置
FSIZE = CUTINSIZE()
FSIZE2 = 3*FSIZE
FPOS = NUM_CUTIN * FSIZE2 + (NUM_CUTIN >= 1)*50

;これは縮小画像の際に使う
FPOS_FACE = NUM_CUTIN * NUMC_MAIDFACE()*50

;基本は下半身なので、それ以外の派生はここで処理する
SELECTCASE ARGS
CASE "腹部"
	FSIZE = MAIDFACESIZE()
	FPOS = NUM_CUTIN * (FSIZE + 30)

	BG = CIP背景粉紅+
	CUTIN_SKIN = CIP腹%CONDS("CIP肤色", ARG)%%CONDS("お腹の見た目", ARG)%+

	SIF COND("晒痕", ARG)
		CUTIN_SUNTAN = CIP腹晒痕%CONDS("晒痕ボトム", ARG)%%CONDS("お腹の見た目", ARG)%+
	IF TALENT:ARG:肚脐环
		SELECTCASE CEVENTS("肚脐环", ARG)
		CASE "棒型", "♂型", "♀型", "十字架型", "心型"
			CUTIN_PIERCE = CIP肚脐环%CEVENTS("肚脐环", ARG)%+
		CASEELSE
			CUTIN_PIERCE = CIP肚脐环H型+
		ENDSELECT
	ENDIF
	IF TALENT:ARG:恥丘穿環
		SELECTCASE CEVENTS("恥丘穿環", ARG)
		CASE "金色", "赤", "緑", "紫", "青"
			CUTIN_PIERCE += @"CIP恥丘穿環%CEVENTS("恥丘穿環", ARG)%+"
		CASEELSE
			CUTIN_PIERCE += @"CIP恥丘穿環+"
		ENDSELECT
	ENDIF
	IF MARK:ARG:淫紋
		CUTIN_INMON = CIP淫紋%CONDS("淫紋の種類", ARG)%%CONDS("淫紋の色", ARG)%%CONDS("淫紋の段階", ARG)%+
		SIF CONDS("淫紋の様子", ARG) == "欲求不満" || COND("受精確認フラグ", ARG)
			CUTIN_INMON += @"CIP淫紋%CONDS("淫紋の種類", ARG)%粉紅1+"
	ENDIF

	;腹部画像はアップなのでUNDER判定部分を很多にする
	SELECTCASE COND("陰毛年齢", ARG)
	CASE 1
		SELECTCASE CONDS("陰毛", ARG)
		CASE "剃过留痕", "还没長出来"
			CUTIN_PUBES_UNDER = CIP腹陰毛%CONDS("陰毛", ARG)%１\[%CONDS("陰毛の色", ARG)%\]+
		ENDSELECT
	CASE 2
		SELECTCASE CONDS("陰毛", ARG)
		CASE "剃过留痕", "还没長出来", "無髭"
			CUTIN_PUBES_UNDER = CIP腹陰毛%CONDS("陰毛", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
		CASE "自然", "随意生長"
			CUTIN_PUBES = CIP腹陰毛%CONDS("陰毛", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
		CASE "保养完毕"
			SELECTCASE CEVENTS("陰毛の名称", ARG)
			CASE "小三角形", "長方形", "心型"
				CUTIN_PUBES_UNDER = CIP腹陰毛%CEVENTS("陰毛の名称", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
			CASEELSE
				CUTIN_PUBES_UNDER = CIP腹陰毛%CONDS("陰毛", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
			ENDSELECT
			IF COND("还没長出来露出", ARG)
				CUTIN_PUBES_UNDER = CIP腹陰毛还没長出来２\[%CONDS("陰毛の色", ARG)%\]+%CUTIN_PUBES_UNDER%
			ELSEIF COND("剃过留痕露出", ARG)
				CUTIN_PUBES_UNDER = CIP腹陰毛剃过留痕２\[%CONDS("陰毛の色", ARG)%\]+%CUTIN_PUBES_UNDER%
			ENDIF
		ENDSELECT
	CASE IS >= 3
		SELECTCASE CONDS("陰毛", ARG)
		CASE "剃过留痕", "还没長出来", "無髭"
			CUTIN_PUBES_UNDER = CIP腹陰毛%CONDS("陰毛", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
		CASE "自然", "随意生長"
			CUTIN_PUBES = CIP腹陰毛%CONDS("陰毛", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
		CASE "保养完毕"
			SELECTCASE CEVENTS("陰毛の名称", ARG)
			CASE "小三角形", "逆三角形", "卵型", "長方形", "四角形", "心型"
				CUTIN_PUBES_UNDER = CIP腹陰毛%CEVENTS("陰毛の名称", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
			CASEELSE
				CUTIN_PUBES_UNDER = CIP腹陰毛%CONDS("陰毛", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
			ENDSELECT
			IF COND("还没長出来露出", ARG)
				CUTIN_PUBES_UNDER = CIP腹陰毛还没長出来\[%CONDS("陰毛の色", ARG)%\]+%CUTIN_PUBES_UNDER%
			ELSEIF COND("剃过留痕露出", ARG)
				CUTIN_PUBES_UNDER = CIP腹陰毛剃过留痕\[%CONDS("陰毛の色", ARG)%\]+%CUTIN_PUBES_UNDER%
			ENDIF
		ENDSELECT
	ENDSELECT

	;动画ーションのための記録
	SAVEINMON_BOTTOM:NUM_CUTIN = %BG%%CUTIN_SKIN%%CUTIN_SUNTAN%
	SAVEINMON_TOP:NUM_CUTIN = %CUTIN_INMON%%CUTIN_PUBES_UNDER%%CUTIN_PIERCE%%CUTIN_PUBES%

	LOCALS = %BG%%CUTIN_SKIN%%CUTIN_SUNTAN%%CUTIN_INMON%%CUTIN_PUBES_UNDER%%CUTIN_PIERCE%%CUTIN_PUBES%,{FPOS},{FSIZE},{FSIZE},{ARG:2}/
	RETURNF LOCALS
CASE "胸部"
	FPOS = NUM_CUTIN * (FSIZE*3 + 30)
	BG = CIP背景粉紅+
	CUTIN_SKIN = CIO兔%CONDS("胸部", ARG)%+
	LOCALS = %BG%%CUTIN_SKIN%,{FPOS},{FSIZE},{FSIZE*3},{ARG:2}/
	RETURNF LOCALS
CASE "受精"
	BG = CIP背景粉紅+
	LOCALS = %BG%CIP受精,{0},{FSIZE},{FSIZE*3},{0}/
	RETURNF LOCALS

CASE "縮小ボタン"
	;FPOS = FPOS_FACE
	;横幅を本来のFSIZE2からMAIDFACESIZE()にする
	;FSIZE2 = MAIDFACESIZE()

	;MEMO_value = CFLAG:ARG:優先順位 + 30

	;BG = CIP背景没有+
	;LOCALS = %BG%,{FPOS},{FSIZE},{FSIZE2},{ARG:2},{MEMO_value}/
	RETURNF LOCALS
ENDSELECT

;跳蛋の条件もっと緩くしたい
SIF CFLAG:ARG:電源BOX
	CUTIN_ROTOR = CIP跳蛋+

;CIPTYPEはこの３種しかない。あとで変更も起きない
IF STRCOUNT(ARGS, "正面")
	CIPTYPE = CIP正面
ELSEIF STRCOUNT(ARGS, "すじ")
	CIPTYPE = CIPすじ
ELSE
	CIPTYPE = CIP背面
ENDIF
;肌領帯プの默认を代入しておく。SKINTYPEは胖次形状によりCIPMicroやCIP蕾丝等に変化する
SKINTYPE = %CIPTYPE%

;背景
BG = CIP背景粉紅+

;胖次描画やそもそも特写が発生するかの格子に使う
SIF STRCOUNT(ARGS, "見たまま") && STRCOUNT(ARGS, "外套OFF") == 0
	OUTER_BODYS = %OUTER(ARG, CIPTYPE)%%BODYS(ARG, CIPTYPE)%

;胖次描写に限定していない場合(=見たまま)で、CIPが表示されない外套or贴身制服を着ている場合はここで終わり
IF EQUIP:ARG:外套 + EQUIP:ARG:贴身制服 && OUTER_BODYS == "" && STRCOUNT(ARGS, "見たまま")
	;外套OFF操作の場合は胖次メインとなるので例外
	IF STRCOUNT(ARGS, "外套OFF")
	ELSE
		RETURNF ""
	ENDIF
ENDIF

;ここでCASE ""以外はSTRCOUNT(ARGS, "見たまま") && STRCOUNT(ARGS, "外套OFF") == 0を満たしている
SELECTCASE OUTER_BODYS
;紧身短褲はボディ没有
CASE "紧身短褲"
	SKINTYPE = CIP紧身短褲
;休闲褲系は可能な限り衣领颜色する
CASE "迷你热褲", "热褲", "牛仔热褲", "前開热褲", "長褲", "前開長褲", "開裆皮裤", "运动衫休闲褲", "五分褲"
	SELECTCASE PANTIES(ARG, CIPTYPE)
	CASE ""
	;これは正面画像なので齟齬が起きる
	CASE "背面紐Ｔ字褲", "背面Ｔ字褲", "背面Micro"
	CASE "淚珠泳衣"
		;肌の変化が起きるか見る
		SELECTCASE OUTER_BODYS
		CASE "迷你热褲", "前開热褲"
			SKINTYPE = CIP淚珠泳衣
			CUTIN_OUTER = CIP淚珠泳衣%OUTER(ARG, CIPTYPE)%%OUTER(ARG, @"%CIPTYPE%カラー")%+
			CUTIN_PANTIES = CIP淚珠泳衣%PANTIES(ARG, @"%CIPTYPE%カラー")%+
		CASEELSE
			SKINTYPE = CIP正面
			CUTIN_PANTIES = CIP紐丁字褲%PANTIES(ARG, @"%CIPTYPE%カラー")%+
		ENDSELECT
	CASEELSE
		IF EQUIP:ARG:胖次
			;色がない場合は画像を出力しない
			SIF PANTIES(ARG, @"%CIPTYPE%カラー") == ""
				RETURNF ""

			CUTIN_PANTIES = CIP%PANTIES(ARG, CIPTYPE)%%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			SIF PANTIES(ARG, "蝴蝶結") != ""
				CUTIN_PANTIES += @"CIP三角胖次蝴蝶結%PANTIES(ARG, "蝴蝶結")%+"

			;胖次衣领颜色描写の具合を見る
			SELECTCASE PANTIES(ARG, CIPTYPE)
			;胖次を無視するもの
			CASE "贴身前貼", "贴身創口貼", "すじ心形貼紙", "贴身Ｃ胖次", "襯褲"
				CUTIN_PANTIES =
			;SKINTYPEとCUTIN_PANTIES変更
			CASE "贴身開放型開洞胖次", "開放型開洞胖次"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIP開放型開洞胖次%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			CASE "蕾丝"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIP內褲%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			CASE "縞胖次"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIP內褲白+
			CASE "儿童胖次"
				SKINTYPE = CIP正面
				SELECTCASE PANTIES(ARG, @"%CIPTYPE%カラー")
				CASE "草莓紋", "蝴蝶结紋"
					CUTIN_PANTIES = CIP內褲桃色+
				CASE "小熊紋", "小鸡紋"
					CUTIN_PANTIES = CIP內褲黄色+
				CASE "鱼紋", "水玉模様"
					CUTIN_PANTIES = CIP內褲水色+
				CASE "緑色"
					CUTIN_PANTIES = CIP內褲緑色+
				CASEELSE
					CUTIN_PANTIES = CIP內褲白+
				ENDSELECT
			CASE "Micro"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIPMicro內褲%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			ENDSELECT

			;特殊処理
			SELECTCASE PANTIES(ARG, CIPTYPE)
			CASE "紐丁字褲", "紐比基尼", "紐Ｔ字褲比基尼"
				SELECTCASE OUTER_BODYS
				CASE "迷你热褲"
					CUTIN_PANTIES_OVER = CIP繩系胖次の紐%PANTIES(ARG, @"%CIPTYPE%カラー")%+
				ENDSELECT
			ENDSELECT
		ENDIF
	ENDSELECT
;连褲襪,网纹褲襪,褲襪の場合には胖次優先（胖次特写がCIP正面でない場合は连褲襪描写を無くして胖次特写に変更）
CASE "", "连褲襪", "网纹褲襪", "褲襪", "開放型连褲襪", "開放型网纹褲襪", "開放型褲襪"
	;裙を履いていて、めくっていない場合は裙優先
	IF CIPTYPE == "CIP正面" && SKIRT(ARG, CIPTYPE) != "" && CFLAG:ARG:掀起裙子 == 0
		IF EQUIP:ARG:胖次
			;色がない場合は画像を出力しない
			SIF PANTIES(ARG, @"%CIPTYPE%カラー") == ""
				RETURNF ""

			CUTIN_PANTIES = CIP%PANTIES(ARG, CIPTYPE)%%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			SIF PANTIES(ARG, "蝴蝶結") != ""
				CUTIN_PANTIES += @"CIP三角胖次蝴蝶結%PANTIES(ARG, "蝴蝶結")%+"

			;胖次衣领颜色描写の具合を見る
			SELECTCASE PANTIES(ARG, CIPTYPE)
			;胖次を無視するもの
			CASE "贴身前貼", "贴身創口貼", "すじ心形貼紙", "贴身Ｃ胖次", "襯褲"
				CUTIN_PANTIES =
			;SKINTYPEとCUTIN_PANTIES変更
			CASE "贴身開放型開洞胖次", "開放型開洞胖次"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIP開放型開洞胖次%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			CASE "淚珠泳衣"
				SELECTCASE SKIRT(ARG, SKINTYPE)
				;掀起裙子前のみ
				CASE "荷葉邊", "花柄荷葉邊"
					SKINTYPE = CIP%PANTIES(ARG, CIPTYPE)%
				ENDSELECT
			CASE "蕾丝"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIP內褲%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			CASE "縞胖次"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIP內褲白+
			CASE "儿童胖次"
				SKINTYPE = CIP正面
				SELECTCASE PANTIES(ARG, @"%CIPTYPE%カラー")
				CASE "草莓紋", "蝴蝶结紋"
					CUTIN_PANTIES = CIP內褲桃色+
				CASE "小熊紋", "小鸡紋"
					CUTIN_PANTIES = CIP內褲黄色+
				CASE "鱼紋", "水玉模様"
					CUTIN_PANTIES = CIP內褲青+
				CASE "緑色"
					CUTIN_PANTIES = CIP內褲緑色+
				CASEELSE
					CUTIN_PANTIES = CIP內褲白+
				ENDSELECT
			CASE "Micro"
				SKINTYPE = CIP正面
				CUTIN_PANTIES = CIPMicro內褲%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			ENDSELECT
		ENDIF
	ELSEIF CIPTYPE == "CIP背面" && SKIRT(ARG, CIPTYPE) != "" && CFLAG:ARG:掀起裙子 == 0
		;胖次衣领颜色描写の具合を見る
		SELECTCASE PANTIES(ARG, CIPTYPE)
		CASE "背面Micro"
			CUTIN_PANTIES = CIP背面Micro%PANTIES(ARG, @"%CIPTYPE%カラー")%+
		ENDSELECT
	ELSE
		;没穿内褲＆ちんこ没有ならすじ描写
		IF EQUIP:ARG:胖次 == 0
			IF OUTER_BODYS != ""

			ELSEIF SKINTYPE == "CIP背面"

			ELSEIF PENIS(ARG) == 0
				SKINTYPE = CIPすじ
			ELSE
				RETURNF ""
			ENDIF
		ELSEIF PANTIES(ARG, CIPTYPE) != ""
			;色がない場合は画像を出力しない
			SIF PANTIES(ARG, @"%CIPTYPE%カラー") == ""
				RETURNF ""

			CUTIN_PANTIES = CIP%PANTIES(ARG, CIPTYPE)%%PANTIES(ARG, @"%CIPTYPE%カラー")%+
			SIF PANTIES(ARG, "蝴蝶結") != ""
				CUTIN_PANTIES += @"CIP三角胖次蝴蝶結%PANTIES(ARG, "蝴蝶結")%+"
			;肌の変化が起きるか見る
			SELECTCASE PANTIES(ARG, CIPTYPE)
			CASE "淚珠泳衣", "Micro", "蕾丝", "縞胖次", "儿童胖次", "背面Ｔ字褲", "背面紐Ｔ字褲", "背面Micro"
				SKINTYPE = CIP%PANTIES(ARG, CIPTYPE)%
			CASEELSE
				SIF STRCOUNT(PANTIES(ARG, CIPTYPE), "すじ")
					SKINTYPE = CIPすじ
			ENDSELECT
		ELSEIF CIPTYPE == "CIPすじ"

		ELSE
			RETURNF ""
		ENDIF
	ENDIF
ENDSELECT

;表示するボディ領帯プの決定＆淫紋表示
SELECTCASE SKINTYPE
CASE "", "CIP紧身短褲"
CASE "CIP背面", "CIP背面Micro"
	SKINTYPE = CIP背面
	CUTIN_SKIN = CIP背面%CONDS("CIP肤色", ARG)%+
CASE "CIP縞胖次", "CIP儿童胖次", "CIP背面紐Ｔ字褲", "CIP背面Ｔ字褲"
	CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
CASE "CIPすじ"
	CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
	INMONTYPE = すじ
	;没穿内褲かつCIP正面での裙や短襪画像がある場合にはSKINTYPEをCIP正面に変更する
	IF CIPTYPE == "CIP正面" && STRCOUNT(ARGS, "見たまま") && COND("阴蒂ック指令表示中") == 0 && PANTIES(ARG, "CIP正面") == ""
		IF (SKIRT(ARG, "CIP正面") != "" && STRCOUNT(ARGS, "裙OFF") == 0) || (SOCKS(ARG, "CIP正面") != "" && STRCOUNT(ARGS, "襪子OFF") == 0) || (OUTER(ARG, "CIP正面") != "" && STRCOUNT(ARGS, "外套OFF") == 0)
			SKINTYPE = CIP正面
			CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
			INMONTYPE = 正面
		ENDIF
	ENDIF
CASE "CIP正面"
	CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
	INMONTYPE = 正面
CASE "CIPMicro"
	IF CUTIN_SKIRT != ""
		SKINTYPE = CIP正面
		CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
		INMONTYPE = 正面
		CUTIN_PANTIES = CIPMicro內褲%PANTIES(ARG, @"%CIPTYPE%カラー")%+
	ELSE
		CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
		INMONTYPE = %PANTIES(ARG, CIPTYPE)%
	ENDIF
CASEELSE
	CUTIN_SKIN = %SKINTYPE%%CONDS("CIP肤色", ARG)%+
	INMONTYPE = %PANTIES(ARG, CIPTYPE)%
ENDSELECT

;晒痕
IF COND("晒痕", ARG)
	SELECTCASE SKINTYPE
	CASE "CIP正面", "CIPすじ", "CIPMicro", "CIP背面", "CIP背面紐Ｔ字褲", "CIP背面Ｔ字褲"
		CUTIN_SUNTAN = %SKINTYPE%晒痕%CONDS("晒痕ボトム", ARG)%+
	CASE "CIP淚珠泳衣", "CIP蕾丝", "CIP儿童胖次", "CIP縞胖次"
		CUTIN_SUNTAN = %SKINTYPE%晒痕+
	ENDSELECT
ENDIF

;SKINTYPEが本決定したので画像を合わせる
;ARGSが見たままでないならSKIRT～BODYSまでは没有
IF STRCOUNT(ARGS, "見たまま")
 	IF STRCOUNT(ARGS, "裙OFF") == 0
		SELECTCASE SKIRT(ARG, SKINTYPE)
		CASE ""
		;掀起裙子前のみ
		CASE "荷葉邊", "花柄荷葉邊"
			SIF CFLAG:ARG:掀起裙子 == 0
				CUTIN_SKIRT = CIP%SKIRT(ARG, SKINTYPE)%%SKIRT(ARG, @"%CIPTYPE%カラー")%+
		;長裙はまくり部分のみを服の上に重ねる
		CASE "百褶裙", "格子裙", "旗袍"
			IF CFLAG:ARG:掀起裙子
				CUTIN_SKIRT = CIP%SKIRT(ARG, SKINTYPE)%捲り%SKIRT(ARG, @"%CIPTYPE%カラー")%+
				CUTIN_SKIRT_OVER = CIP%SKIRT(ARG, SKINTYPE)%捲り部分のみ%SKIRT(ARG, @"%CIPTYPE%カラー")%+
				SIF CHECK_SKIRT("Micro", ARG) == 0
					CUTIN_SKIRT_BACK = CIP%SKIRT(ARG, SKINTYPE)%背面%SKIRT(ARG, @"%CIPTYPE%カラー")%+
			ELSE
				CUTIN_SKIRT = CIP%SKIRT(ARG, SKINTYPE)%%SKIRT(ARG, @"%CIPTYPE%カラー")%+
			ENDIF
		CASEELSE
			IF CFLAG:ARG:掀起裙子
				CUTIN_SKIRT = CIP%SKIRT(ARG, SKINTYPE)%捲り%SKIRT(ARG, @"%CIPTYPE%カラー")%+
				SIF CHECK_SKIRT("Micro", ARG) == 0
					CUTIN_SKIRT_BACK = CIP%SKIRT(ARG, SKINTYPE)%背面%SKIRT(ARG, @"%CIPTYPE%カラー")%+
			ELSE
				CUTIN_SKIRT = CIP%SKIRT(ARG, SKINTYPE)%%SKIRT(ARG, @"%CIPTYPE%カラー")%+
			ENDIF
		ENDSELECT
	ENDIF
	IF STRCOUNT(ARGS, "服OFF") == 0
		SIF SHIRT(ARG, SKINTYPE) != ""
			CUTIN_SHIRT = CIP%SHIRT(ARG, SKINTYPE)%%SHIRT(ARG, @"%CIPTYPE%カラー")%+
		SIF SHIRT(ARG, @"%SKINTYPE%衣领颜色") != ""
			CUTIN_SHIRT += @"CIP%SHIRT(ARG, @"%SKINTYPE%衣领颜色")%%CLOCOLOR_MAIDFACE(SHIRT(ARG, @"%SKINTYPE%衣领颜色"), CHECK_CLOCOLOR(OTHER(ARG, "外套") ), ARG)%+"
	ENDIF
	IF OUTER(ARG, SKINTYPE) != "" && STRCOUNT(ARGS, "外套OFF") == 0
		IF CHECK_OUTER("连褲襪", ARG) || CHECK_OUTER("褲襪", ARG)
			CUTIN_PANST = CIP%OUTER(ARG, SKINTYPE)%%OUTER(ARG, @"%CIPTYPE%カラー")%+
		ELSE
			CUTIN_OUTER = CIP%OUTER(ARG, SKINTYPE)%%OUTER(ARG, @"%CIPTYPE%カラー")%+
		ENDIF
	ENDIF
	SIF SOCKS(ARG, SKINTYPE) != "" && STRCOUNT(ARGS, "襪子OFF") == 0
		CUTIN_SOCKS = CIP%SOCKS(ARG, SKINTYPE)%%SOCKS(ARG, @"%CIPTYPE%カラー")%+
	SIF BODYS(ARG, SKINTYPE) != "" && STRCOUNT(ARGS, "贴身制服OFF") == 0
		CUTIN_BODYS = CIP%BODYS(ARG, SKINTYPE)%%BODYS(ARG, @"%CIPTYPE%カラー")%+
ENDIF

;跳蛋や創口貼など
SELECTCASE SKINTYPE
;これは現在紧身短褲のみ
CASE "CIP紧身短褲"
	CUTIN_PANST =
	;CUTIN_OUTER =
	CUTIN_BODYS =
	CUTIN_SHIRT =
	CUTIN_SKIRT =
	CUTIN_SOCKS =
	CUTIN_ROTOR =
CASE "CIP正面"
	IF CUTIN_ROTOR != ""
		IF OUTER(ARG, SKINTYPE) == "迷你热褲" || PANTIES(ARG, CIPTYPE) == "四角内褲"
			CUTIN_ROTOR = CIP短褲跳蛋BOX+CIP短褲跳蛋コード+
		ELSEIF CUTIN_BODYS != ""
			IF CHECK_BODYS("休闲褲型", ARG)
				CUTIN_ROTOR = CIP短褲跳蛋BOX+CIP短褲跳蛋コード+
			ELSE
				CUTIN_ROTOR = CIP贴身制服跳蛋BOX+CIP贴身制服跳蛋コード+
			ENDIF
		ELSE
			CUTIN_ROTOR = CIP跳蛋BOX+

			SELECTCASE PANTIES(ARG, CIPTYPE)
			CASE "胖次下拉半遮"
				CUTIN_ROTOR += "CIP跳蛋コード+"
			CASEELSE
				;裙がある？
				IF CUTIN_SKIRT != ""
					SIF CFLAG:ARG:掀起裙子 || CHECK_SKIRT("Micro", ARG)
						CUTIN_ROTOR_OVER = CIP跳蛋コード+
				ELSE
					CUTIN_ROTOR_OVER = CIP跳蛋コード+
				ENDIF
			ENDSELECT
		ENDIF
	ENDIF
	IF CUTIN_OUTER != ""
		CUTIN_MASK_OUTER = CIP正面マスク+
	ELSEIF CUTIN_PANST != ""
		IF STRCOUNT(CUTIN_PANST, "開放型")
			CUTIN_MASK_PANST = CIP正面マスク外側+
		ELSE
			CUTIN_MASK_PANST = CIP正面マスク+
		ENDIF
	ELSEIF CUTIN_SKIRT != ""
		CUTIN_MASK_OUTER = CIP正面マスク外側+
	ENDIF
CASEELSE
	SELECTCASE SKINTYPE
	CASE "CIP正面"
		SIF CFLAG:ARG:創口貼装着
			CUTIN_PANTIES = CIP創口貼+%CUTIN_PANTIES%
	CASE "CIP背面"

	CASE "CIP淚珠泳衣"
		SELECTCASE SKIRT(ARG, SKINTYPE)
		CASE "荷葉邊", "花柄荷葉邊"
			SIF CFLAG:ARG:掀起裙子 == 0
				CUTIN_SKIRT = CIP淚珠泳衣%SKIRT(ARG, SKINTYPE)%%SKIRT(ARG, @"%CIPTYPE%カラー")%+
		CASEELSE
			CUTIN_SKIRT =
		ENDSELECT
	CASE "CIPすじ"
		SIF CFLAG:ARG:創口貼装着
			CUTIN_PANTIES = CIP贴身創口貼+%CUTIN_PANTIES%
		SIF CUTIN_ROTOR != ""
			CUTIN_ROTOR = CIPすじ跳蛋+
	ENDSELECT
	;CIP正面以外は指定画像の名称に SKINTYPE が含まれていないものすべてを消す
	SIF STRCOUNT(CUTIN_PANST, SKINTYPE) == 0
		CUTIN_PANST =
	SIF STRCOUNT(CUTIN_OUTER, SKINTYPE) == 0
		CUTIN_OUTER =
	SIF STRCOUNT(CUTIN_BODYS, SKINTYPE) == 0
		CUTIN_BODYS =
	SIF STRCOUNT(CUTIN_SHIRT, SKINTYPE) == 0
		CUTIN_SHIRT =
	SIF STRCOUNT(CUTIN_SKIRT, SKINTYPE) == 0
		CUTIN_SKIRT =
	SIF STRCOUNT(CUTIN_SOCKS, SKINTYPE) == 0
		CUTIN_SOCKS =
	SIF STRCOUNT(CUTIN_ROTOR, SKINTYPE) == 0
		CUTIN_ROTOR =
ENDSELECT

;ガーター系は胖次によって上下を変える。默认は胖次の下
IF CUTIN_PANTIES != ""
	SELECTCASE PANTIES(ARG, CIPTYPE)
	CASE "高開衩", "低腰", "超低腰", "四角内褲", "叶子胖次", "Micro內褲", "開放型開洞胖次"
		SWAP CUTIN_SOCKS, CUTIN_SOCKS2
	ENDSELECT
ENDIF

;穿環の表示はすじ、正面の場合に恥丘穿環のみ対応
IF TALENT:ARG:恥丘穿環
	SELECTCASE SKINTYPE
	CASE "CIPすじ", "CIP正面"
		SELECTCASE CEVENTS("恥丘穿環", ARG)
		CASE "金色", "赤", "緑", "紫", "青"
			CUTIN_PIERCE = %SKINTYPE%恥丘穿環%CEVENTS("恥丘穿環", ARG)%+
		CASEELSE
			CUTIN_PIERCE = %SKINTYPE%恥丘穿環+
		ENDSELECT
	ENDSELECT
ENDIF

;淫紋の表示については、現在すじのみ全パターン対応＆他は基本淫紋のみ
IF MARK:ARG:淫紋
	SELECTCASE INMONTYPE
	CASE ""
	CASE "すじ"
		CUTIN_INMON = CIP淫紋%INMONTYPE%%CONDS("淫紋の種類", ARG)%%CONDS("淫紋の色", ARG)%%CONDS("淫紋の段階", ARG)%+
		SIF CONDS("淫紋の様子", ARG) == "欲求不満"
			CUTIN_INMON += @"CIP淫紋%INMONTYPE%%CONDS("淫紋の種類", ARG)%粉紅1+"
	CASEELSE
		SELECTCASE CONDS("淫紋の種類", ARG)
		CASE "基本"
			CUTIN_INMON = CIP淫紋%INMONTYPE%%CONDS("淫紋の色", ARG)%%CONDS("淫紋の段階", ARG)%+
			SIF CONDS("淫紋の様子", ARG) == "欲求不満"
				CUTIN_INMON += @"CIP淫紋%INMONTYPE%粉紅1+"
		CASEELSE
			CUTIN_INMON = CIP淫紋%INMONTYPE%%CONDS("淫紋の色", ARG)%%CONDS("淫紋の段階", ARG)%+
			SIF CONDS("淫紋の様子", ARG) == "欲求不満"
				CUTIN_INMON += @"CIP淫紋%INMONTYPE%粉紅1+"
		ENDSELECT
	ENDSELECT
ENDIF

SELECTCASE SKINTYPE
CASE "CIP正面", "CIPすじ", "CIPMicro", "CIP蕾丝", "CIP淚珠泳衣"
	SELECTCASE COND("陰毛年齢", ARG)
	CASE 1
		SELECTCASE CONDS("陰毛", ARG)
		CASE "剃过留痕"
			CUTIN_PUBES_UNDER = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%１\[%CONDS("陰毛の色", ARG)%\]+
		CASE "还没長出来"
			CUTIN_PUBES = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%１\[%CONDS("陰毛の色", ARG)%\]+
		ENDSELECT
	CASE 2
		SELECTCASE CONDS("陰毛", ARG)
		CASE "剃过留痕", "还没長出来", "無髭"
			CUTIN_PUBES_UNDER = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
		CASE "自然", "随意生長"
			CUTIN_PUBES = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
		CASE "保养完毕"
			SELECTCASE CEVENTS("陰毛の名称", ARG)
			CASE "小三角形", "長方形", "心型"
				CUTIN_PUBES = %SKINTYPE%陰毛%CEVENTS("陰毛の名称", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
			CASEELSE
				CUTIN_PUBES = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%２\[%CONDS("陰毛の色", ARG)%\]+
			ENDSELECT
			IF COND("还没長出来露出", ARG)
				CUTIN_PUBES_UNDER = %SKINTYPE%陰毛还没長出来２\[%CONDS("陰毛の色", ARG)%\]+
			ELSEIF COND("剃过留痕露出", ARG)
				CUTIN_PUBES_UNDER = %SKINTYPE%陰毛剃过留痕２\[%CONDS("陰毛の色", ARG)%\]+
			ENDIF
		ENDSELECT
	CASE IS >= 3
		SELECTCASE CONDS("陰毛", ARG)
		CASE "剃过留痕", "还没長出来", "無髭"
			CUTIN_PUBES_UNDER = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
		CASE "自然", "随意生長"
			CUTIN_PUBES = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
		CASE "保养完毕"
			SELECTCASE CEVENTS("陰毛の名称", ARG)
			CASE "小三角形", "逆三角形", "卵型", "長方形", "四角形", "心型"
				CUTIN_PUBES = %SKINTYPE%陰毛%CEVENTS("陰毛の名称", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
			CASEELSE
				CUTIN_PUBES = %SKINTYPE%陰毛%CONDS("陰毛", ARG)%\[%CONDS("陰毛の色", ARG)%\]+
			ENDSELECT
			IF COND("还没長出来露出", ARG)
				CUTIN_PUBES_UNDER = %SKINTYPE%陰毛还没長出来\[%CONDS("陰毛の色", ARG)%\]+
			ELSEIF COND("剃过留痕露出", ARG)
				CUTIN_PUBES_UNDER = %SKINTYPE%陰毛剃过留痕\[%CONDS("陰毛の色", ARG)%\]+
			ENDIF
		ENDSELECT
	ENDSELECT
ENDSELECT

IF CUTIN_SKIRT == ""
	CUTIN_SKIRT_OVER =
	CUTIN_SKIRT_BACK =
ENDIF
IF CUTIN_OUTER == "" && CUTIN_SKIRT == ""
	CUTIN_MASK_OUTER =
ELSE
	SELECTCASE OUTER(ARG, SKINTYPE)
	CASE ""
	CASE "迷你热褲", "布鲁马"
	;股間の隙間部分を覆っている休闲褲なら跳蛋コード部分は消す
	CASEELSE
		SIF STRCOUNT(CUTIN_PANST, "開放型") == 0
			CUTIN_ROTOR_OVER =
	ENDSELECT
ENDIF
IF CUTIN_PANST == ""
	CUTIN_MASK_PANST =
ELSE
	IF STRCOUNT(CUTIN_PANST, "開放型")
		SWAP CUTIN_ROTOR, CUTIN_ROTOR_PANST
	ELSE
		CUTIN_ROTOR =
	ENDIF
ENDIF
SIF CUTIN_ROTOR == "" && CUTIN_ROTOR_PANST == ""
	CUTIN_ROTOR_OVER =
SIF CUTIN_PANTIES == ""
	CUTIN_PANTIES_OVER =

IF COND("CIP縮小中", ARG)
	FSIZE2 = MAIDFACESIZE()
	FPOS = NUM_CUTIN * NUMC_MAIDFACE()*50
	BG = CIP背景粉紅2+
	BG_MASK = CIP背景マスク+
	SIF COND("阴蒂ック指令表示中")
		MEMO_value = CFLAG:ARG:優先順位 + 30

	SIF CUTIN_MASK_OUTER != ""
		CUTIN_MASK_OUTER = 縮小%CUTIN_MASK_OUTER%
	SIF CUTIN_MASK_PANST != ""
		CUTIN_MASK_PANST = 縮小%CUTIN_MASK_PANST%

	SELECTCASE SKIRT(ARG, SKINTYPE)
	CASE "百褶裙", "格子裙", "旗袍", "白色和金色装饰的民族衣装"
		SIF CUTIN_SKIRT != ""
			CUTIN_SKIRT = %REPLACE(CUTIN_SKIRT, "CIP", "CIP縮小")%
		SIF CUTIN_SKIRT_OVER != ""
			CUTIN_SKIRT_OVER = %REPLACE(CUTIN_SKIRT_OVER, "CIP", "CIP縮小")%
	ENDSELECT
ENDIF

;これは再現文字列の書式になっている
LOCALS = %BG%%CUTIN_SKIRT_BACK%%CUTIN_SKIN%%CUTIN_SUNTAN%%CUTIN_INMON%%CUTIN_PUBES_UNDER%%CUTIN_PIERCE%%CUTIN_PUBES%%CUTIN_SOCKS%%CUTIN_ROTOR%%CUTIN_PANTIES%%CUTIN_MASK_PANST%%CUTIN_PANST%%CUTIN_ROTOR_PANST%%CUTIN_SOCKS2%%CUTIN_BODYS%%CUTIN_MASK_OUTER%%CUTIN_OUTER%%CUTIN_PANTIES_OVER%%CUTIN_SKIRT%%CUTIN_SHIRT%%CUTIN_ROTOR_OVER%%CUTIN_SKIRT_OVER%%BG_MASK%,{FPOS},{FSIZE},{FSIZE2},{ARG:2},{MEMO_value}/

RETURNF LOCALS


code:
;テスト
@ANIME_LEVELUP_INMON, ARGS, ARG
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC NUM_CUTIN = -1
#DIM DYNAMIC GRAPHICS_WIDTH = 300
#DIM DYNAMIC GRAPHICS_HEIGHT = 300

SIF ARG == 0 && TARGET > 0
	ARG = TARGET

;表示した画像に該当する角色の存在確認
FOR LCOUNT, 0, 6
	SIF LATESTCUTINCHARA:LCOUNT <= 0
		BREAK
	IF ARG == LATESTCUTINCHARA:LCOUNT
		NUM_CUTIN = LCOUNT
		BREAK
	ENDIF
NEXT

SIF NUM_CUTIN < 0
	RETURN 0

;ARGSのスプライトから尺寸を測る
GRAPHICS_WIDTH = GWIDTH(LATESTCUTINID:NUM_CUTIN)
GRAPHICS_HEIGHT = GHEIGHT(LATESTCUTINID:NUM_CUTIN)

CALL OVERLAY_GCREATE, 0, SAVEINMON_BOTTOM:NUM_CUTIN, GRAPHICS_WIDTH, GRAPHICS_HEIGHT
CALL OVERLAY_GCREATE, 1, SAVEINMON_TOP:NUM_CUTIN, GRAPHICS_WIDTH, GRAPHICS_HEIGHT

;COLOR_MATRIXを入力しておく
COLOR_MATRIX_ELEMENTS:0:0 = 255, 0, 0, 0, 0
COLOR_MATRIX_ELEMENTS:1:0 = 0, 255, 0, 0, 0
COLOR_MATRIX_ELEMENTS:2:0 = 0, 0, 255, 0, 0
COLOR_MATRIX_ELEMENTS:3:0 = 0, 0, 0, 255, 0
COLOR_MATRIX_ELEMENTS:4:0 = 0, 0, 0, 0, 255

FOR LCOUNT, 1, 6
	;まずは下地を敷く
	GDRAWG LATESTCUTINID:NUM_CUTIN, 0, 0, 0, GRAPHICS_WIDTH, GRAPHICS_HEIGHT, 0, 0, GRAPHICS_WIDTH, GRAPHICS_HEIGHT

	;透明度の調整
	COLOR_MATRIX_ELEMENTS:3:3 = LCOUNT*51

	;ARGSのスプライトを乗せる
	GDRAWSPRITE LATESTCUTINID:NUM_CUTIN, ARGS, 0, 0, GRAPHICS_WIDTH, GRAPHICS_HEIGHT, COLOR_MATRIX_ELEMENTS:0:0

	;ARGSに重ねる画像を書き込む
	GDRAWG LATESTCUTINID:NUM_CUTIN, 1, 0, 0, GRAPHICS_WIDTH, GRAPHICS_HEIGHT, 0, 0, GRAPHICS_WIDTH, GRAPHICS_HEIGHT

	TWAIT 300, 1
NEXT

GDISPOSE 0
GDISPOSE 1

RETURN 1

license: unknown


code:
;-------------------------------------------------
;ARGの颜绘の横にテ接吻トSTR:1～STR:19を出す
;颜绘変化をさせたい場合にはARGSに入れる
;颜绘や淫紋が表示されない場合にはテ接吻トが出るだけとなる
;-------------------------------------------------
@DIALOGUE_FRAME, ARG, ARGS
#DIM LCOUNT
#DIM LCOUNT2
#DIM MEMO_REDRAW
#DIM MEMO_LINECOUNT
#DIM FSIZE
;テ接吻トのインデント
#DIMS INDENT_TEXT
;1行内のテ接吻トの色
#DIMS TEXT_COLOR
#DIMS HTMLF

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

SIF TFLAG:颜绘表示中 == LINECOUNT
	CALL CLEAR_MAIDFACE

;颜绘変化の指定がある？
CALL SET_CHANGE_FACE, ARG, ARGS

STR:颜绘再現文字列 =
HTMLF =
INDENT_TEXT =
TEXT_COLOR =

MEMO_LINECOUNT = LINECOUNT
;颜绘と淫紋を表示する
CALL PRINT_DIALOGUE, ARG
;表示された場合
IF LINECOUNT > MEMO_LINECOUNT
	;一度描画した物を解体してHPRINT_STRに適用可能な形状にする
	HTMLF = %HTML_GETPRINTEDSTR(0)%
	;ここでいったん表示されている画像を消し、HTMLFを整理したうえで取得しなおす
	CLEARLINE 1
	HTML_TAGSPLIT HTMLF
	HTMLF =
	FOR LCOUNT, 2, RESULT-2
		HTMLF += RESULTS:LCOUNT
	NEXT
ENDIF

;画像が出てるならインデントをつける
IF STR:颜绘再現文字列 != ""
	FSIZE = MAIDFACESIZE()
	INDENT_TEXT = %BL(FSIZE/50 + 1)%
ENDIF

MEMO_LINECOUNT = LINECOUNT
FOR LCOUNT, 0, 20
	SELECTCASE LCOUNT
	;0は颜绘と淫紋を表示する場合は空文字でもCONTINUEしないで続ける
	CASE 0
		SIF COND("颜绘表示中", ARG) == 0 && STR:0 == ""
			CONTINUE
	CASE 19
		SIF STR:LCOUNT == ""
			CONTINUE
	;２行連続空白ならテ接吻ト表示終了
	CASEELSE
		SIF LCOUNT >= 7 && STR:LCOUNT == "" && STR:(LCOUNT + 1) == ""
			BREAK
	ENDSELECT

	;その行の默认文字色を設定
	IF SUBSTRING(STR:LCOUNT, 0, 7) == "#TEXTC="
		TEXT_COLOR = %EXTSTR(STR:LCOUNT, "", ":")%_
		STR:LCOUNT = %EXTSTR(STR:LCOUNT, ":")%
	ENDIF
	;STR:0に颜绘と淫紋の表示を追加
	IF LCOUNT == 0 && COND("颜绘表示中", ARG)
		STR:0 = %TEXT_COLOR%%HTMLF%_ %STR:LCOUNT%
		CALL HPRINT_STRL, STR:LCOUNT
		TEXT_COLOR =
		CONTINUE
	ENDIF
	;HTMLへの分岐
	IF SUBSTRING(STR:LCOUNT, 0, 5) == "HTML:"
		STR:LCOUNT = %TEXT_COLOR%%INDENT_TEXT%_%SUBSTRING(STR:LCOUNT, 5, -1)%
		CALL HPRINT_STRL, STR:LCOUNT
		TEXT_COLOR =
		CONTINUE
	ENDIF

	STR:LCOUNT = %INDENT_TEXT%%STR:LCOUNT%

	;画面内に収圆圈かの格子
	SELECTCASE STRLENS(STR:LCOUNT)
	CASE IS <= NUM("折り返し文字数")
		CALL PRINT_STRL, @"%TEXT_COLOR%%STR:LCOUNT%"
		STR:LCOUNT =
		TEXT_COLOR =
	CASEELSE
		;、を優遇
		IF STRCOUNT(STR:LCOUNT, "、") && STRCOUNTS(STR:LCOUNT, "喜欢的东西:", "讨厌的东西:") == 0 && STRLENS(EXTSTR(STR:LCOUNT, "", "、") ) >= NUM("折り返し文字数")*2/3 && STRLENS(EXTSTR(STR:LCOUNT, "", "、") ) <= NUM("折り返し文字数") - 2
			CALL PRINT_STRL, @"%TEXT_COLOR%%EXTSTR(STR:LCOUNT, "", "、")%、"
			STR:LCOUNT = %EXTSTR(STR:LCOUNT, "、")%
		ELSE
			CALL PRINT_STRL, @"%TEXT_COLOR%%SUBSTRING(STR:LCOUNT, 0, NUM("折り返し文字数")-1)%"
			STR:LCOUNT = %SUBSTRING(STR:LCOUNT, NUM("折り返し文字数")-1, -1)%
		ENDIF
		SELECTCASE STR:LCOUNT
		CASE "", "_"
			TEXT_COLOR =
		CASEELSE
			LCOUNT -= 1
		ENDSELECT
	ENDSELECT
NEXT

;改行のつじつま合わせ
SIF STR:颜绘再現文字列 != ""
	CALL MULTILINE, TFLAG:MAX_height - (LINECOUNT - MEMO_LINECOUNT) + 1
SIF COND("颜绘表示中", ARG)
	TFLAG:颜绘表示中 = LINECOUNT
CSTR:ARG:颜绘変化 =

CALL BLANKLINE

VARSET STR, "", 0, 20
REDRAW MEMO_REDRAW

;-------------------------------------------------
;@PRINT_CUTINのDIALOGUE_FRAME版のようなもの
;颜绘、その下段に淫紋が表示される
;流石に淫紋の隣に角色解説が出るのはシュールなので颜绘オフの時には淫紋もオフ
;-------------------------------------------------
@PRINT_DIALOGUE, ARG
#DIM MEMO_REDRAW
#DIM ypos

SIF ARG == 0 && TARGET > 0
	ARG = TARGET

SIF COND("颜绘表示中", ARG) == 0
	RETURN 0

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

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

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

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

	HTML_PRINT CONVERTSTR(STR:颜绘再現文字列)
ENDIF
REDRAW MEMO_REDRAW

;-------------------------------------------------
;STR毎にWAITするDIALOGUE_FRAME
;STRが空だった場合はその行は止まらないので間を作りたいなら空白文字でも入れといてください
;ARGはTARGETとかARGSに初期の颜绘変化
;STR内で文章の後に"#F"で区切って颜绘を変化させることができる
;例）STR:1 = こんにちは#F笑颜
;-------------------------------------------------
@DIALOGUE_FRAMEW, ARG, ARGS, ARGS:1, ARGS:2, ARGS:3, ARGS:4, ARGS:5, ARGS:6, ARGS:7, ARGS:8, ARGS:9
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC LCOUNT2
#DIM DYNAMIC MEMO_LINECOUNT
#DIM DYNAMIC MEMO_REDRAW
#DIMS DYNAMIC MEMO_EMOTION
#DIM DYNAMIC MEMO_MAIDEFACEID
#DIMS DYNAMIC MEMO_STR, 20

;颜绘がない場合は単純に台詞を出す
IF COND("颜绘表示中", ARG) == 0
	FOR LCOUNT, 0, 20
		VARSET LOCALS
		SPLIT STR:LCOUNT, "#F", LOCALS
		SELECTCASE LOCALS
		CASE ""
		CASEELSE
			SELECTCASE LCOUNT
			CASE 0
				CALL PRINT_STRL, LOCALS
			CASEELSE
				CALL PRINT_STRW, LOCALS
			ENDSELECT
		ENDSELECT
	NEXT
	RETURN 1
ENDIF

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

SIF TFLAG:颜绘表示中 == LINECOUNT
	CALL CLEAR_MAIDFACE

MEMO_LINECOUNT = LINECOUNT
;無駄にMAIDEFACEIDを消費しないために現在的値を記録しておく
MEMO_MAIDEFACEID = MAIDEFACEID

;STRの上書き
FOR LCOUNT, 1, 10
	SIF ARGS:LCOUNT != ""
		STR:LCOUNT = %ARGS:LCOUNT%
NEXT

;表情のコピー
SIF ARGS:0 != ""
	MEMO_EMOTION = %ARGS:0%

;STRの内容をコピー
FOR LCOUNT, 0, 20
	MEMO_STR:LCOUNT = %STR:LCOUNT%
NEXT

;メモを取ったSTRは空にする
VARSET STR, "", 0, 20

FOR LCOUNT, 1, 20
	SELECTCASE LCOUNT
	CASE 19
		SIF MEMO_STR:LCOUNT == ""
			CONTINUE
	;２行連続空白ならテ接吻ト表示終了
	CASEELSE
		SIF LCOUNT >= 7 && MEMO_STR:LCOUNT == "" && MEMO_STR:(LCOUNT + 1) == ""
			BREAK
	ENDSELECT

	;颜绘変化用の処理
	IF STRCOUNT(MEMO_STR:LCOUNT, "#F")
		VARSET LOCALS
		SPLIT MEMO_STR:LCOUNT, "#F", LOCALS
		MEMO_STR:LCOUNT = %LOCALS:0%
		MEMO_EMOTION = %LOCALS:1%
	ENDIF

	;MEMOからSTRの内容をもどしていく
	FOR LCOUNT2, 0, LCOUNT + 1
		STR:LCOUNT2 = %MEMO_STR:LCOUNT2%
	NEXT

	;以前表示させたものは消す
	SIF MEMO_LINECOUNT != LINECOUNT
		CLEARLINE LINECOUNT - MEMO_LINECOUNT

	MAIDEFACEID = MEMO_MAIDEFACEID

	;表示させる
	CALL DIALOGUE_FRAME, ARG, MEMO_EMOTION
	SIF MEMO_STR:LCOUNT != ""
		WAIT
NEXT
CALL BLANKLINE

REDRAW MEMO_REDRAW

;-------------------------------------------------
;上の@DIALOGUE_FRAMEの名前表示追加版
;-------------------------------------------------
@DIALOGUE_FRAME_NAME, ARG, ARGS
STR:0 = - _%DISPLAY_NAME(ARG)%_ -
CALL DIALOGUE_FRAME, ARG, ARGS
;-------------------------------------------------
;@DIALOGUE_FRAMEWの名前表示追加版
;-------------------------------------------------
@DIALOGUE_FRAME_NAMEW, ARG, ARGS, ARGS:1, ARGS:2, ARGS:3, ARGS:4, ARGS:5, ARGS:6, ARGS:7
STR:0 = - _%DISPLAY_NAME(ARG)%_ -
CALL DIALOGUE_FRAMEW, ARG, ARGS, ARGS:1, ARGS:2, ARGS:3, ARGS:4, ARGS:5, ARGS:6, ARGS:7

;-------------------------------------------------
;道具解説用。グラの横にテ接吻トSTR:1～STR:19を出す
;-------------------------------------------------
@DIALOGUE_FRAME_ITEM, ARGS
#DIM LCOUNT
#DIM LCOUNT2
#DIM MEMO_REDRAW
#DIM MEMO_LINECOUNT
#DIM FSIZE

SIF ARGS == ""
	RETURN 0

SIF TFLAG:颜绘表示中 == LINECOUNT
	CALL CLEAR_MAIDFACE

FSIZE = MAIDFACESIZE()

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

HTML_PRINT @"<nobr><nonbutton pos='0'></nonbutton>"

MEMO_LINECOUNT = LINECOUNT
FOR LCOUNT, 0, 20
	SELECTCASE LCOUNT
	CASE 0, 19
		SIF STR:LCOUNT == ""
			CONTINUE
	;２行連続空白ならテ接吻ト表示終了
	CASEELSE
		SIF STR:LCOUNT == "" && STR:(LCOUNT + 1) == ""
			BREAK
	ENDSELECT

	IF SUBSTRING(STR:LCOUNT, 0, 5) == "HTML:"
		STR:LCOUNT = %BL(FSIZE/50 + 1)%%SUBSTRING(STR:LCOUNT, 5, -1)%
		CALL HPRINT_STRL, STR:LCOUNT
		CONTINUE
	ENDIF

	STR:LCOUNT = %BL(FSIZE/50 + 1)%%STR:LCOUNT%

	;画面内に収圆圈かの格子
	SELECTCASE STRLENS(STR:LCOUNT)
	CASE IS <= NUM("折り返し文字数")
		CALL PRINT_STRL, STR:LCOUNT
		STR:LCOUNT =
	CASEELSE
		;、を優遇
		IF STRCOUNT(STR:LCOUNT, "、") && STRLENS(EXTSTR(STR:LCOUNT, "", "、") ) >= NUM("折り返し文字数")*2/3 && STRLENS(EXTSTR(STR:LCOUNT, "", "、") ) <= NUM("折り返し文字数") - 2
			CALL PRINT_STRL, @"%EXTSTR(STR:LCOUNT, "", "、")%、"
			STR:LCOUNT = %EXTSTR(STR:LCOUNT, "、")%
		ELSE
			CALL PRINT_STRL, SUBSTRING(STR:LCOUNT, 0, NUM("折り返し文字数")-1)
			STR:LCOUNT = %SUBSTRING(STR:LCOUNT, NUM("折り返し文字数")-1, -1)%
		ENDIF
		SELECTCASE STR:LCOUNT
		CASE "", "_"
		CASEELSE
			LCOUNT -= 1
		ENDSELECT
	ENDSELECT
NEXT
;改行のつじつま合わせ
FOR LCOUNT, 1, (FSIZE/100) - (LINECOUNT - MEMO_LINECOUNT)
	PRINTL
NEXT

CALL BLANKLINE

VARSET STR, "", 0, 20
REDRAW MEMO_REDRAW

;-------------------------------------------------
;STR毎にWAITするITEM版
;STR内で文章の後に"#G"で区切って表示画像を変更できる
;例）STR:1 = こんにちは#G22まぐろう1
;-------------------------------------------------
@DIALOGUE_FRAME_ITEMW, ARGS
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC LCOUNT2
#DIM DYNAMIC MEMO_LINECOUNT
#DIM DYNAMIC MEMO_REDRAW
#DIMS DYNAMIC MEMO_IMG
#DIMS DYNAMIC MEMO_STR, 20

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

SIF TFLAG:颜绘表示中 == LINECOUNT
	CALL CLEAR_MAIDFACE

MEMO_LINECOUNT = LINECOUNT

;表示画像のコピー
SIF ARGS:0 != ""
	MEMO_IMG = %ARGS:0%

;STRの内容をコピー
FOR LCOUNT, 0, 20
	MEMO_STR:LCOUNT = %STR:LCOUNT%
NEXT

;メモを取ったSTRは空にする
VARSET STR, "", 0, 20

FOR LCOUNT, 1, 20

	SELECTCASE LCOUNT
	CASE 19
		SIF MEMO_STR:LCOUNT == ""
			CONTINUE
	;２行連続空白ならテ接吻ト表示終了
	CASEELSE
		SIF MEMO_STR:LCOUNT == "" && MEMO_STR:(LCOUNT + 1) == ""
			BREAK
	ENDSELECT

	;表示画像変更用の処理
	IF STRCOUNT(MEMO_STR:LCOUNT, "#G")
		VARSET LOCALS
		SPLIT MEMO_STR:LCOUNT, "#G", LOCALS
		MEMO_STR:LCOUNT = %LOCALS:0%
		MEMO_IMG = %LOCALS:1%
	ENDIF

	;MEMOからSTRの内容をもどしていく
	FOR LCOUNT2, 0, LCOUNT + 1
		STR:LCOUNT2 = %MEMO_STR:LCOUNT2%
	NEXT

	;以前表示させたものは消す
	SIF MEMO_LINECOUNT != LINECOUNT
		CLEARLINE LINECOUNT - MEMO_LINECOUNT

	;表示させる
	CALL DIALOGUE_FRAME_ITEM, MEMO_IMG
	SIF MEMO_STR:LCOUNT != ""
		WAIT
NEXT
CALL BLANKLINE

REDRAW MEMO_REDRAW


code:
;-------------------------------------------------
;颜绘を一時的に変化させて表示する
;-------------------------------------------------
;ARGSにはREPRINT_MAIDFACEのARGSに指定できる文字列、颜绘シュミレーターの眉、眼形、嘴形のボタンと同じ名称、吹き出しの種類を"/"区切りで代入する事で颜绘を変更させつつ出力することが出来る
;吹き出しの種類は"对话框憤怒", "对话框汗", "对话框爱心", "对话框兴奋", "对话框惊讶", "对话框睡眠", "对话框困倦", "对话框開心"など
;例）CALL EMOTION_PLUS, "躁动难忍/斜眼/憤怒眉/へ字/对话框憤怒"
;萌え袖V领毛衣を着ている場合には"萌え袖"指定で萌え袖を口元で見せてる状態に出来る
;複数人同時に変化させる場合には、CALL EMOTION_PLUSをする前にARG:1～ARG:4のCSTR:颜绘変化 を変更しておく必要が有ます
;第一製作者　ブリート
;-------------------------------------------------
@EMOTION_PLUS, ARGS, ARG, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
SIF ARG == 0 && TARGET > 0
	ARG = TARGET

IF COND("KOJO_DAILY台詞中")
	CALL EMOTEFACE, ARGS, ARG, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
	RETURN 1
ENDIF

CALL SET_CHANGE_FACE, ARG, ARGS

CALL REPRINT_MAIDFACE, ARGS, ARG, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5

;普通はCSTR:颜绘変化 を重置するが、颜绘シミュ中は重置しない方がやりやすいので保たせる
SIF COND("颜绘シミュ中") == 0
	CVARSET CSTR, GETNUM(CSTR, "颜绘変化")

;-------------------------------------------------
;CSTR:颜绘変化 用の関数
;-------------------------------------------------
@SET_CHANGE_FACE, ARG, ARGS
#DIM LCOUNT

SIF ARG == 0 && TARGET > 0
	ARG = TARGET

SIF ARGS != ""
	CSTR:ARG:颜绘変化 = %ARGS%

;PRINTFORML CSTR:{ARG}:颜绘変化 = %CSTR:ARG:颜绘変化%, CONDS("颜绘コンディション") = %CONDS("颜绘コンディション", ARG)%

;現在的颜绘コンディションと CSTR:颜绘変化 に対する、独自の颜绘変化があるかを格子
STR:颜绘改髪 =
;まずは現在的颜绘コンディションに対応する改髪を、STR:颜绘改髪 に代入しておく
SELECTCASE CONDS("颜绘コンディション", ARG)
CASE "", "重置"
CASEELSE
	STR:颜绘改髪 =
	TRYCALLFORM EMOTION_K{NO:ARG}, CONDS("颜绘コンディション", ARG)
	;改髪する際には重置属性を追加する
	SIF STR:颜绘改髪 != "" && STRCOUNT(CSTR:ARG:颜绘変化改髪, @"＠%CONDS("颜绘コンディション", ARG)%：",) == 0
		CSTR:ARG:颜绘変化改髪 += @"＠%CONDS("颜绘コンディション", ARG)%：重置/%STR:颜绘改髪%_"
ENDSELECT

;続いて各要素について独自変化があるなら置換後を記録しておく
VARSET LOCALS
SPLIT CSTR:ARG:颜绘変化, "/", LOCALS
FOR LCOUNT, 0, 10
	SELECTCASE LOCALS:LCOUNT
	CASE ""
		CONTINUE
	CASEELSE
		STR:颜绘改髪 =
		TRYCALLFORM EMOTION_K{NO:ARG}, LOCALS:LCOUNT
		;改髪する際には重置属性を追加する
		SIF STR:颜绘改髪 != "" && STRCOUNT(CSTR:ARG:颜绘変化改髪, @"＠%LOCALS:LCOUNT%：") == 0
			CSTR:ARG:颜绘変化改髪 += @"＠%LOCALS:LCOUNT%：重置/%STR:颜绘改髪%_"
	ENDSELECT
NEXT

;PRINTFORML CSTR:{ARG}:颜绘変化 = %CSTR:ARG:颜绘変化%, CSTR:颜绘変化改髪 = %CSTR:ARG:颜绘変化改髪%, STR:颜绘改髪 = %STR:颜绘改髪%

;-------------------------------------------------
;一度表示したEMOTION_PLUSを書き換える
;それまで表示していた行も再現して表示することが出来る
;-------------------------------------------------
@CHANGE_EMOTION_PLUS, ARGS, ARG, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC MEMO_REDRAW
#DIM DYNAMIC MEMO_LINE

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

VARSET LOCALS
MEMO_LINE = LINECOUNT - TFLAG:颜绘表示中

FOR LCOUNT, MEMO_LINE, 0, -1
	LOCALS:LCOUNT = %HTML_GETPRINTEDSTR(0)%
	CLEARLINE 1
NEXT

CALL EMOTION_PLUS, ARGS, ARG, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5

FOR LCOUNT, 1, MEMO_LINE + 1
	HTML_PRINT LOCALS:LCOUNT
NEXT

REDRAW MEMO_REDRAW

RETURN 1

;-------------------------------------------------
;最新の颜绘のGraphicsを差し替える
;ARGに角色を指定、颜绘内に存在していれば差し替える
;-------------------------------------------------
@EMOTEFACE, ARGS, ARG, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC LCOUNT2
#DIM DYNAMIC ACTOR, 6
#DIM DYNAMIC ACTORFACEID, 6
#DIM DYNAMIC HIT_COUNT
#DIM ACTOR_POSITION, 6

SIF ARG == 0 && TARGET > 0
	ARG = TARGET

CALL SET_EMOTE, ARGS, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5

;表示している颜绘内にARGと同一の角色がいるか調べる
FOR LCOUNT, 0, 6
	SIF ARG:LCOUNT <= 0
		BREAK
	FOR LCOUNT2, 0, 6
		SIF LATESTFACECHARA:LCOUNT2 <= 0
			BREAK
		;角色が存在した場合は番号とGraphicsIDをメモ
		IF ARG:LCOUNT == LATESTFACECHARA:LCOUNT2
			ACTOR:HIT_COUNT = ARG:LCOUNT
			ACTOR_POSITION:HIT_COUNT = LCOUNT2
			ACTORFACEID:HIT_COUNT = LATESTFACEID:LCOUNT2
			HIT_COUNT += 1
			BREAK
		ENDIF
	NEXT
NEXT

;メモから対象角色を表示しているGraphicsIDを書き換える
FOR LCOUNT, 0, HIT_COUNT
	CALL SET_CHANGE_FACE, ACTOR:LCOUNT, ARGS
	CALL OVERLAY_GCREATE, ACTORFACEID:LCOUNT, EXTSTR(MAIDFACE(ACTOR:LCOUNT, ACTOR_POSITION:LCOUNT), "", ",")
NEXT

CALL RESET_EMOTE, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5

;KOJO_DAILY台詞中でなければ颜绘変化を重置
SIF COND("KOJO_DAILY台詞中") == 0
	CVARSET CSTR, GETNUM(CSTR, "颜绘変化")

RETURN 1

;-------------------------------------------------
;感情を指定して颜绘を出す関数。もしも既に颜绘が表示されている場合には消して上書きします
;ARGSに入れられる文字列は"重置", "甜言蜜语", "夸奖", "心情差", "躁动难忍", "交流中", "睡眠", "刚睡醒", "憤怒", "害羞", "闲"など
;-------------------------------------------------
@REPRINT_MAIDFACE, ARGS, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM LCOUNT

;もしも既に颜绘が表示されている場合には消す
SIF TFLAG:颜绘表示中 == LINECOUNT
	CALL CLEAR_MAIDFACE
SIF ARG == 0 && TARGET > 0
	ARG = TARGET

CALL SET_EMOTE, ARGS, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
CALL PRINT_MAIDFACE, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
CALL RESET_EMOTE, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5

;-------------------------------------------------
;感情をARGSにする
;-------------------------------------------------
@SET_EMOTE, ARGS, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM LCOUNT

FOR LCOUNT, 0, 6
	SIF ARG:LCOUNT <= 0
		BREAK

	VARSET LOCALS
	IF CSTR:(ARG:LCOUNT):颜绘変化 != ""
		SPLIT CSTR:(ARG:LCOUNT):颜绘変化, "/", LOCALS
	ELSE
		SPLIT ARGS, "/", LOCALS
	ENDIF
	SELECTCASE LOCALS:0
	CASE "重置", "甜言蜜语", "夸奖", "心情差", "睡眠", "刚睡醒", "憤怒", "躁动难忍", "交流中", "害羞", "闲"
		TMP_EMOTE:LCOUNT = %LOCALS:0%
	CASEELSE
		CONTINUE
	ENDSELECT

	TMP_CFLAG27:LCOUNT = CFLAG:(ARG:LCOUNT):甜言蜜语
	TMP_CFLAG28:LCOUNT = CFLAG:(ARG:LCOUNT):夸奖
	TMP_CFLAG29:LCOUNT = CFLAG:(ARG:LCOUNT):心情差
	TMP_CFLAG31:LCOUNT = CFLAG:(ARG:LCOUNT):睡眠
	TMP_CFLAG34:LCOUNT = CFLAG:(ARG:LCOUNT):刚睡醒
	TMP_CFLAG36:LCOUNT = CFLAG:(ARG:LCOUNT):憤怒
	TMP_CFLAG70:LCOUNT = CFLAG:(ARG:LCOUNT):躁动难忍
	TMP_CFLAG86:LCOUNT = CFLAG:(ARG:LCOUNT):交流中
	TMP_CFLAG99:LCOUNT = CFLAG:(ARG:LCOUNT):害羞
	TMP_CFLAG117:LCOUNT = CFLAG:(ARG:LCOUNT):闲

	CFLAG:(ARG:LCOUNT):甜言蜜语 = 0
	CFLAG:(ARG:LCOUNT):夸奖 = 0
	CFLAG:(ARG:LCOUNT):心情差 = 0
	CFLAG:(ARG:LCOUNT):睡眠 = 0
	CFLAG:(ARG:LCOUNT):刚睡醒 = 0
	CFLAG:(ARG:LCOUNT):憤怒 = 0
	CFLAG:(ARG:LCOUNT):躁动难忍 = 0
	CFLAG:(ARG:LCOUNT):交流中 = 0
	CFLAG:(ARG:LCOUNT):害羞 = 0
	CFLAG:(ARG:LCOUNT):闲 = 0

	SIF TMP_EMOTE:LCOUNT == "重置"
		CONTINUE

	CFLAG:(ARG:LCOUNT):(TMP_EMOTE:LCOUNT) = 1
NEXT

;-------------------------------------------------
;もともとの感情を設定しなおす
;-------------------------------------------------
@RESET_EMOTE, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM LCOUNT

FOR LCOUNT, 0, 6
	SIF ARG:LCOUNT <= 0
		BREAK
	SIF TMP_EMOTE:LCOUNT == ""
		CONTINUE
	CFLAG:(ARG:LCOUNT):甜言蜜语 = TMP_CFLAG27:LCOUNT
	CFLAG:(ARG:LCOUNT):夸奖 = TMP_CFLAG28:LCOUNT
	CFLAG:(ARG:LCOUNT):心情差 = TMP_CFLAG29:LCOUNT
	CFLAG:(ARG:LCOUNT):睡眠 = TMP_CFLAG31:LCOUNT
	CFLAG:(ARG:LCOUNT):刚睡醒 = TMP_CFLAG34:LCOUNT
	CFLAG:(ARG:LCOUNT):憤怒 = TMP_CFLAG36:LCOUNT
	CFLAG:(ARG:LCOUNT):躁动难忍 = TMP_CFLAG70:LCOUNT
	CFLAG:(ARG:LCOUNT):交流中 = TMP_CFLAG86:LCOUNT
	CFLAG:(ARG:LCOUNT):害羞 = TMP_CFLAG99:LCOUNT
	CFLAG:(ARG:LCOUNT):闲 = TMP_CFLAG117:LCOUNT
NEXT

;文字列ARGSから種類を抜き出す
@CHECK_TYPE(ARGS)
#FUNCTIONS

IF STRCOUNT(ARGS, "眯眯眼")
	RETURNF "眯眯眼"
ELSEIF STRCOUNT(ARGS, "笑颜")
	RETURNF "笑颜"
ELSEIF STRCOUNT(ARGS, "闭眼")
	RETURNF "闭眼"
ELSEIF STRCOUNT(ARGS, "〇〇")
	RETURNF "〇〇"
ELSEIF STRCOUNT(ARGS, "＞＜")
	RETURNF "＞＜"
ELSEIF STRCOUNT(ARGS, "普通眼")
	RETURNF "普通眼"
ELSEIF STRCOUNT(ARGS, "吊眼")
	RETURNF "吊眼"
ELSEIF STRCOUNT(ARGS, "垂眼")
	RETURNF "垂眼"
ELSEIF STRCOUNT(ARGS, "斜眼")
	RETURNF "斜眼"
ELSEIF STRCOUNT(ARGS, "水灵眼")
	RETURNF "水灵眼"
ELSEIF STRCOUNT(ARGS, "縦長目")
	RETURNF "縦長目"
ELSEIF STRCOUNT(ARGS, "重度三白眼")
	RETURNF "重度三白眼"
ELSEIF STRCOUNT(ARGS, "三白眼")
	RETURNF "三白眼"
ENDIF
RETURNF ""

@CHECK_NUM(ARGS, ARGS:1)
#FUNCTIONS
#DIM LCOUNT

IF ARGS:1 != ""
	FOR LCOUNT, 1, 10
		LOCALS = %TOFULL(TOSTR(LCOUNT) )%
		SIF STRCOUNT(ARGS:1, LOCALS)
			RETURNF LOCALS
	NEXT
	RETURNF ""
ENDIF
FOR LCOUNT, 1, 10
	LOCALS = %TOFULL(TOSTR(LCOUNT) )%
	SIF STRCOUNT(ARGS, LOCALS)
		RETURNF LOCALS
NEXT
RETURNF ""

;-------------------------------------------------
;高光の振り分け
;ARGには角色番号、ARGSには左右、ARGS:1には眼形状が入っている
;ARGS:1の書式は例えばARGS == "左"ならば 11普通眼４飘忽左\[%CONDS("左瞳色", ARG)%\] となっている
;-------------------------------------------------
@CHECK_HIGHLIGHT(ARGS, ARGS:1, ARG)
#FUNCTIONS
#DIMS DYNAMIC EYE_TYPE
#DIMS DYNAMIC HIGHLIGHT_TYPE

;まずはARGS:1から瞳色より左側の部分を抜き出す
;ちなみにARGS:1に瞳色指定がないものは瞳が見えていない形状の目(例えば眯眯眼)なので、高光の指定は不要
SELECTCASE ARGS
CASE "左"
	SIF STRCOUNT(ARGS:1, CONDS("左瞳色", ARG) ) == 0
		RETURNF ""
	EYE_TYPE = %EXTSTR(ARGS:1, "", @"\[%CONDS("左瞳色", ARG)%")%
CASE "右"
	SIF STRCOUNT(ARGS:1, CONDS("右瞳色", ARG) ) == 0
		RETURNF ""
	EYE_TYPE = %EXTSTR(ARGS:1, "", @"\[%CONDS("右瞳色", ARG)%")%
ENDSELECT
;高光は半目関係ない
EYE_TYPE = %REPLACE(EYE_TYPE, "半目", "")%

HIGHLIGHT_TYPE = %EYE_TYPE%高光+

RETURNF HIGHLIGHT_TYPE

;-------------------------------------------------
;再現文字列をHTML_PRINT用の文字列に直す。ボタン部分は無視するので注意
;文字列の末尾には順にpos, height, width, ypos, button value, titleを入れる
;-------------------------------------------------
@CONVERTSTR(ARGS)
#FUNCTIONS
#DIM LCOUNT
#DIM LCOUNT2
#DIMS MEMO_ARGS, 12
#DIMS STR_OUTPUT
#DIM MEMO_pos
#DIM MEMO_height
#DIM MEMO_width
#DIM MEMO_ypos
#DIM MEMO_value
#DIMS MEMO_title

TFLAG:MAX_height = 0
STR_OUTPUT =
VARSET MEMO_ARGS
SPLIT ARGS, "/", MEMO_ARGS

FOR LCOUNT2, 0, 12
	SIF MEMO_ARGS:LCOUNT2 == ""
		BREAK

	VARSET LOCALS
	SPLIT MEMO_ARGS:LCOUNT2, ",", LOCALS
	MEMO_ARGS:LCOUNT2 = %LOCALS:0%
	MEMO_pos = TOINT(LOCALS:1)
	MEMO_height = TOINT(LOCALS:2)
	MEMO_width = TOINT(LOCALS:3)
	MEMO_ypos = TOINT(LOCALS:4)
	MEMO_value = TOINT(LOCALS:5)
	MEMO_title = %LOCALS:6%

	TFLAG:MAX_height = MAX(TFLAG:MAX_height, (MEMO_height + MEMO_ypos)/100 - 1)

	VARSET LOCALS
	SPLIT MEMO_ARGS:LCOUNT2, "+", LOCALS
	;LOCALS:0にはvalueとtitleを有ればつける
	IF MEMO_value || COND("颜绘セーブロード中")
		MEMO_value = MAX(MEMO_value, 0)
		STR_OUTPUT += @"<button value='{MEMO_value}' pos='{MEMO_pos}' title='%MEMO_title%'></button>"
	ELSE
		STR_OUTPUT += @"<nonbutton pos='{MEMO_pos}'></nonbutton>"
	ENDIF
	FOR LCOUNT, 1, 100
		SELECTCASE LOCALS:LCOUNT
		CASE ""
			BREAK
		CASEELSE
			STR_OUTPUT += @"<nonbutton pos='{MEMO_pos}'></nonbutton>"
		ENDSELECT
	NEXT
	;メイン画面でのマウス阴蒂ック指令
	SIF LCOUNT2
		CONTINUE
	;SIF COND("阴蒂ック指令表示中")
	;	STR_OUTPUT += @"<button value='{290}' pos='{MEMO_pos}' title='[290]スマホで写真を撮る'></button>"
NEXT

SIF STRCOUNT(STR_OUTPUT, "<nobr>") == 0
	STR_OUTPUT = <nobr>%STR_OUTPUT%
RETURNF STR_OUTPUT

;-------------------------------------------------
;ARGSに再現文字列を入れる事で表示された画像と同じ物を再表示させることが出来る
;これは特写でも颜绘でも再現しちゃう版
;-------------------------------------------------
@REDRAW_STR, ARGS
#DIM LCOUNT
#DIM MEMO_REDRAW

SIF ARGS == ""
	RETURN 0

MEMO_REDRAW = CURRENTREDRAW()
REDRAW 0

HTML_PRINT CONVERTSTR(ARGS)
CALL MULTILINE, TFLAG:MAX_height

REDRAW MEMO_REDRAW

;-------------------------------------------------
;会話登場用の颜绘付き路人を作成する関数
;作成した路人の番号を取得する場合にはCNUM(ARGS)を用いる
;(@CNUM(ARGS)はCALLNAMEがARGSかを見るので、必ずCALLNAMEとARGSは一致させること)
;例)CALL CREATE_MOB, "冨路牟"した後に、冨路牟の番号を使いたい場合はCNUM("冨路牟")で取得できる
;-------------------------------------------------
@CREATE_MOB, ARGS
#DIM MEMO_TARGET
#DIM ACTOR
#DIM LCOUNT

MEMO_TARGET = TARGET

;ベースはドッペル你
ADDCHARA 99

;記述の簡略化のために路人をTARGETにする
TARGET = CHARANUM - 1
;颜绘出力に必要な共通フラグ設定
CFLAG:颜绘 = 1
CFLAG:路人 = 1

CALLNAME:TARGET = %ARGS%
NAME:TARGET = %ARGS%
CSTR:ふりがな = %ARGS%

FOR LCOUNT, 1, 200
	;各角色の口上ファイルで設定しているかを見る
	TRYCALLFORM CREATE_MOB_K{LCOUNT}, ARGS
NEXT

;システム共通路人(今は不在)
SELECTCASE ARGS
;CASE ""
CASE "成海爱琉"
	CSTR:種族 = 人类
	CSTR:髪色 = 焦茶髪
	CSTR:髪長 = 中等長度
	CSTR:前髪 = 斜刘海
	CSTR:後髪 = 自然
	CSTR:改髪 = 麻花辫
	CSTR:呆毛 = 无呆毛
	CSTR:蝴蝶結 = 頭後蝴蝶結
	CSTR:瞳色 = 茶
	CSTR:眼形 = 垂眼２
	CSTR:白眼 = 白眼
	CSTR:眉形 = 通常眉
	CSTR:嘴形 = ヮ
	CSTR:高光 = 高光有
	; CSTR:服 = 女式衬衫/百褶裙
	CALL SET_OTHER, "玳瑁眼鏡"
ENDSELECT

TARGET = MEMO_TARGET

;-------------------------------------------------
;会話登場用の颜绘付き路人を全員消す関数
;-------------------------------------------------
@DEL_MOB
#DIM LCOUNT
#DIM IS_DEL

IS_DEL = 0
FOR LCOUNT, 1, CHARANUM
	IF CFLAG:LCOUNT:路人
		DELCHARA LCOUNT
		IS_DEL = 1
	ENDIF
	SIF IS_DEL
		BREAK
NEXT
SIF IS_DEL
	RESTART
RETURN 1

;-------------------------------------------------
;アプデ角色の颜绘表示用関数
;-------------------------------------------------
@PRINT_UPDATE_MAIDFACE
#DIM LCOUNT
#DIM LCOUNT2
#DIM NUM_ADDCHARA
#DIM ACTOR
#DIM NO_PRINT, 100
#DIM NO_ORDER, 100
#DIM DATE_ORDER, 100
#DIM NOW_TIME

NOW_TIME = (GETTIME() / 1000000000)%1000000

VARSET NO_ORDER
VARSET DATE_ORDER

VARSET LOCALS
SPLIT STR:最新更新角色, "/", LOCALS
FOR LCOUNT, 0, 100
	SIF LOCALS:LCOUNT == ""
		BREAK
	NO_ORDER:LCOUNT = TOINT(LOCALS:LCOUNT)
NEXT

VARSET LOCALS
SPLIT STR:最新更新日時, "/", LOCALS
FOR LCOUNT, 0, 100
	SIF LOCALS:LCOUNT == ""
		BREAK
	DATE_ORDER:LCOUNT = TOINT(LOCALS:LCOUNT)
NEXT

VARSET NO_PRINT
NUM_ADDCHARA = 0
FOR LCOUNT, 0, 100
	SIF NO_ORDER:LCOUNT == 0
		BREAK
	;表示はとりあえず18人まで
	SIF NUM_ADDCHARA >= 18
		BREAK
	;角色メイクフラグ中なら勧誘画面表示できるかを見る
	IF COND("角色メイク中")
		SIF COND("勧誘画面表示", NO_ORDER:LCOUNT) == 0
			CONTINUE
	ENDIF

	;13人目からは1年以内の更新に限る
	IF LCOUNT >= 12
		SIF NOW_TIME - DATE_ORDER:LCOUNT > 10000
			BREAK
	ENDIF

	ADDCHARA NO_ORDER:LCOUNT
	ACTOR = CHARANUM - 1
	CFLAG:ACTOR:颜绘 = 1
	CALL VARSET_MAIDFACE, ACTOR

	;学園に居ない角色は便装
	IF COND("部室出現可能", ACTOR) == 0
		CALL SET_COORDINATE, "便装", ACTOR
	ELSE
		CALL SET_COORDINATE, "制服", ACTOR
	ENDIF

	NO_PRINT:NUM_ADDCHARA = ACTOR
	NUM_ADDCHARA += 1
NEXT

CALL DRAWLINES, "□ 直近の更新角色12人+α(1年以内の更新)でMAX18人表示 □"

IF CONFIG("颜绘勧誘")
	;颜绘パネル中フラグON
	SETBIT FLAG:状況判定, 50
	FOR LCOUNT, 0, (NUM_ADDCHARA/6)+1
		CALL PRINT_MAIDFACE, NO_PRINT:(LCOUNT*6), NO_PRINT:(LCOUNT*6+1), NO_PRINT:(LCOUNT*6+2), NO_PRINT:(LCOUNT*6+3), NO_PRINT:(LCOUNT*6+4), NO_PRINT:(LCOUNT*6+5)

		FOR LCOUNT2, 0, 6
			ACTOR = NO_PRINT:(LCOUNT*6+LCOUNT2)
			SIF ACTOR <= 0
				BREAK
			RESULT = 0
			TRYCALLFORM IS_SINGLE_ENDING_K{NO:ACTOR}
			SIF RESULT
				SETCOLOR DEF_COLOR("爱心粉紅")
			PRINTFORM %TEXT_LJ(@"[{NO:ACTOR, 2}]%NAME:ACTOR%", NUMC_MAIDFACE())%
			RESETCOLOR
		NEXT
		PRINTL
		SIF NO_PRINT:(LCOUNT*6 + 6) == 0
			BREAK
	NEXT
	;颜绘パネル中フラグOFF
	CLEARBIT FLAG:状況判定, 50
ELSE
	FOR LCOUNT, 0, 100
		ACTOR = NO_PRINT:LCOUNT
		SIF ACTOR <= 0
			BREAK
		RESULT = 0
		TRYCALLFORM IS_SINGLE_ENDING_K{NO:ACTOR}
		SIF RESULT
			SETCOLOR DEF_COLOR("爱心粉紅")
		CALL TEXT_SHOP_CHARA_SHOW, NO:ACTOR
		RESETCOLOR
	NEXT
ENDIF
CALL BLANK_DRAWLINE

FOR LCOUNT, 0, NUM_ADDCHARA
	DELCHARA CHARANUM-1
NEXT

;-------------------------------------------------
;勧誘画面の颜绘表示用関数
;ARG:0～ARG:5に値が入っている場合はその番号の角色のみ出力する
;-------------------------------------------------
@PRINT_SHOP_MAIDFACE, ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
#DIM LCOUNT
#DIM LCOUNT2
#DIM NUM_ADDCHARA
#DIM ACTOR
#DIM NO_PRINT, 100
;ARG:0～ARG:5の幾つに値が入っているかをカウントする
#DIM NUM_ARG

NUM_ARG = 0
FOR LCOUNT, 0, 6
	SIF ARG:LCOUNT > 0
		NUM_ARG += 1
NEXT

;刷新过滤器
IF TFLAG:过滤器 == 210 && NUM_ARG == 0
	CALL PRINT_UPDATE_MAIDFACE
	RETURN 1
ENDIF

VARSET NO_PRINT
NUM_ADDCHARA = 0
FOR LCOUNT, 1, 200
	IF NUM_ARG
		SELECTCASE LCOUNT
		CASE ARG:0, ARG:1, ARG:2, ARG:3, ARG:4, ARG:5
		CASEELSE
			CONTINUE
		ENDSELECT
	ELSE
		SIF COND("勧誘画面表示", LCOUNT) == 0
			CONTINUE
	ENDIF

	ADDCHARA LCOUNT
	ACTOR = CHARANUM - 1
	CFLAG:ACTOR:颜绘 = 1
	CALL VARSET_MAIDFACE, ACTOR

	;学園に居ない角色は便装
	IF COND("部室出現可能", ACTOR) == 0
		CALL SET_COORDINATE, "便装", ACTOR
	ELSE
		CALL SET_COORDINATE, "制服", ACTOR
	ENDIF

	NO_PRINT:NUM_ADDCHARA = ACTOR
	NUM_ADDCHARA += 1
NEXT
;表示する角色がいない
SIF NUM_ADDCHARA == 0
	RETURN 0

;颜绘パネル中フラグON
SETBIT FLAG:状況判定, 50

FOR LCOUNT, 0, (NUM_ADDCHARA/6)+1
	CALL PRINT_MAIDFACE, NO_PRINT:(LCOUNT*6), NO_PRINT:(LCOUNT*6+1), NO_PRINT:(LCOUNT*6+2), NO_PRINT:(LCOUNT*6+3), NO_PRINT:(LCOUNT*6+4), NO_PRINT:(LCOUNT*6+5)

	FOR LCOUNT2, 0, 6
		ACTOR = NO_PRINT:(LCOUNT*6+LCOUNT2)
		SIF ACTOR <= 0
			BREAK
		RESULT = 0
		TRYCALLFORM IS_SINGLE_ENDING_K{NO:ACTOR}
		SIF RESULT
			SETCOLOR DEF_COLOR("爱心粉紅")
		IF STRCOUNT(CSVCSTR(NO:ACTOR, GETNUM(CSTR, "CEVENT") ), "情報隠蔽")
			PRINTFORM %TEXT_LJ(@"[{NO:ACTOR, 2}]？？？", NUMC_MAIDFACE())%
		ELSE
			PRINTFORM %TEXT_LJ(@"[{NO:ACTOR, 2}]%NAME:ACTOR%", NUMC_MAIDFACE())%
		ENDIF
		RESETCOLOR
	NEXT
	PRINTL
	SIF NO_PRINT:(LCOUNT*6 + 6) == 0
		BREAK
NEXT

FOR LCOUNT, 0, NUM_ADDCHARA
	DELCHARA CHARANUM-1
NEXT

;颜绘パネル中フラグOFF
CLEARBIT FLAG:状況判定, 50

;-------------------------------------------------
;勧誘画面の颜绘表示に使うRESOURCES生成関数(現在は使用していない)
;-------------------------------------------------
@PRINT_SHOP_MAIDFACE_ALL
#DIM LCOUNT
#DIM LCOUNT2
#DIM NUM_ADDCHARA
#DIM ACTOR
#DIM NO_PRINT, 100
#DIMS TEXT_RESOURCES, 200
;x列 y行＝xCOLUMN yROW
#DIM NUM_COLUMN
#DIM NUM_ROW

;角色メイク中フラグON
SETBIT FLAG:状況判定, 13

VARSET TEXT_RESOURCES
VARSET NO_PRINT
NUM_ADDCHARA = 0
FOR LCOUNT, 1, 200
	;存在する角色なのか判定
	SIF EXISTCSV_EX(LCOUNT) == 0
		CONTINUE

	ADDCHARA LCOUNT

	ACTOR = CHARANUM - 1
	NO_PRINT:NUM_ADDCHARA = ACTOR

	;x列 y行＝xCOLUMN yROW
	NUM_COLUMN = NUM_ADDCHARA%6
	NUM_ROW = (NUM_ADDCHARA%24)/6
	TEXT_RESOURCES:NUM_ADDCHARA = 颜绘{NO:ACTOR},パネル{1+(NUM_ADDCHARA/24)}.png,{180*NUM_COLUMN},{190*NUM_ROW},170,170

	NUM_ADDCHARA += 1
	CFLAG:ACTOR:颜绘 = 1
	SIF COND("休托莉", ACTOR)
		CALL SET_CEVENT, "正体偽装", ACTOR
	CALL PRESET_MAIDFACE, ACTOR
	;学園に居ない角色は便装
	IF COND("部室出現可能", ACTOR) == 0
		CALL SET_COORDINATE, "便装", ACTOR
	ELSE
		CALL SET_COORDINATE, "制服", ACTOR
	ENDIF
NEXT
FOR LCOUNT, 0, (NUM_ADDCHARA/6)+1
	CALL PRINT_MAIDFACE, NO_PRINT:(LCOUNT*6), NO_PRINT:(LCOUNT*6+1), NO_PRINT:(LCOUNT*6+2), NO_PRINT:(LCOUNT*6+3), NO_PRINT:(LCOUNT*6+4), NO_PRINT:(LCOUNT*6+5)
	PRINTL
	SIF NO_PRINT:(LCOUNT*6 + 6) == 0
		BREAK
NEXT

FOR LCOUNT, 0, NUM_ADDCHARA
	DELCHARA CHARANUM-1
NEXT

FOR LCOUNT, 0, NUM_ADDCHARA
	PRINTFORML %TEXT_RESOURCES:LCOUNT%
NEXT

;角色メイク中フラグOFF
CLEARBIT FLAG:状況判定, 13

;-------------------------------------------------
;現在表示されている特写や颜绘の横にテ接吻トを並べる関数
;CALL START_PRINT_LINEUP から CALL PRINT_LINEUPまでのすべての行が対象となる
;CLEARLINEや改行操作をするのでREDRAW 0 必須
;-------------------------------------------------
@START_PRINT_LINEUP, ARGS
REDRAW 0
IF TFLAG:MAX_height == 0
	SELECTCASE ARGS
	CASE "CIP"
		TFLAG:LINECOUNT_LINEUP = LINECOUNT + CUTINSIZE()/100
	CASEELSE
		TFLAG:LINECOUNT_LINEUP = LINECOUNT + MAIDFACESIZE()/100
	ENDSELECT
	RETURN 0
ENDIF

STR:PRINT_LINEUP = %HTML_GETPRINTEDSTR(TFLAG:MAX_height)%
STR:PRINT_LINEUP = %REPLACE(STR:PRINT_LINEUP, "</nobr>
", "")%
CLEARLINE TFLAG:MAX_height + 1
TFLAG:LINECOUNT_LINEUP = LINECOUNT

@PRINT_LINEUP, ARGS
#DIM LCOUNT
#DIM NUM_LINE
VARSET LOCALS

IF TFLAG:MAX_height == 0
	SIF TFLAG:LINECOUNT_LINEUP > LINECOUNT
		CALL MULTILINE, TFLAG:LINECOUNT_LINEUP - LINECOUNT
	RETURN 0
ENDIF

NUM_LINE = 0
FOR LCOUNT, 0, LINECOUNT - TFLAG:LINECOUNT_LINEUP
	LOCALS:NUM_LINE = %HTML_GETPRINTEDSTR(LINECOUNT - TFLAG:LINECOUNT_LINEUP - LCOUNT - 1)%
	NUM_LINE += 1
NEXT

;一番上の行は画像とくっつけるので弄る
LOCALS:0 = %REPLACE(LOCALS:0, @"
<nobr>", "<nonbutton pos='0'>")%
LOCALS:0 = %REPLACE(LOCALS:0, @"</nobr>", "</nonbutton></nobr>")%
LOCALS:0 = %STR:PRINT_LINEUP%%LOCALS:0%

CLEARLINE LINECOUNT - TFLAG:LINECOUNT_LINEUP

FOR LCOUNT, 0, 20
	SELECTCASE LOCALS:LCOUNT
	CASE ""
		IF LCOUNT <= TFLAG:MAX_height
			PRINTL
		ELSE
			BREAK
		ENDIF
	CASEELSE
		HTML_PRINT LOCALS:LCOUNT
	ENDSELECT
NEXT

@RESET_EMOT, ARG
CFLAG:ARG:睡眠 = 0
CFLAG:ARG:甜言蜜语 = 0
CFLAG:ARG:夸奖 = 0
CFLAG:ARG:心情差 = 0
CFLAG:ARG:躁动难忍 = 0
CFLAG:ARG:刚睡醒 = 0
CFLAG:ARG:憤怒 = 0
CFLAG:ARG:害羞 = 0

;GLOBALS:40～63を使う
@SAVE_MAIDFACE, ARGS, ARG
#DIM CHOICE
#DIM MEMO_LINECOUNT
#DIMS MEMO_EMOT

SIF ARG == 0 && TARGET
	ARG = TARGET

MEMO_EMOT = %CSTR:ARG:颜绘変化%
CSTR:ARG:颜绘変化 =

MEMO_LINECOUNT = LINECOUNT
LOADGLOBAL

PRINTL
PRINTFORML 要记录到几号位置呢？点击[DEL]可以进行删除（请注意存档是全游戏存档公用的）
CALL SHOW_FACESAVE, ARG
PRINTFORML [100] 返回　[200] 整理编号

CALL INPUT_SELECT, 48, 100, 200
CHOICE = RESULT

SELECTCASE CHOICE
CASE 200
	CALL SORT_FACESAVE
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 100
CASE 24 TO 47
	GLOBALS:(CHOICE+16) =
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASEELSE
	IF GLOBALS:(CHOICE+40) != ""
		PRINTFORML 覆盖[{CHOICE, 2}]号存档可以吗？
		CALL PRINT_SELECT, "是/否"
		IF RESULT
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
	ENDIF
	STR:颜绘記録 = %ARGS%
	CALL SETFLAG, "颜绘記録からの復元", ARG
	CALL SETFLAG, "颜绘の記録", ARG
	GLOBALS:(CHOICE+40) = %STR:颜绘記録%
ENDSELECT

STR:颜绘記録 = %ARGS%
CALL SETFLAG, "颜绘記録からの復元", ARG
CSTR:ARG:颜绘変化 = %MEMO_EMOT%
SAVEGLOBAL

RETURN 1

@LOAD_MAIDFACE, ARGS, ARG
#DIM CHOICE
#DIM MEMO_LINECOUNT
#DIMS MEMO_EMOT

SIF ARG == 0 && TARGET
	ARG = TARGET

MEMO_EMOT = %CSTR:ARG:颜绘変化%
CSTR:ARG:颜绘変化 =

MEMO_LINECOUNT = LINECOUNT
LOADGLOBAL

PRINTL
PRINTFORML 使用几号存档呢？点击[DEL]可以进行删除
CALL SHOW_FACESAVE, ARG
PRINTFORML [100] 返回　[200] 整理编号

CALL INPUT_SELECT, 48, 100, 200
CHOICE = RESULT

SELECTCASE CHOICE
CASE 200
	CALL SORT_FACESAVE
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 100
	STR:颜绘記録 = %ARGS%
CASE 24 TO 47
	GLOBALS:(CHOICE+16) =
	SAVEGLOBAL
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASEELSE
	IF GLOBALS:(CHOICE+40) == ""
		PRINTFORML [{CHOICE, 2}]番には何も記録されていないようです
		CLEARLINE LINECOUNT - MEMO_LINECOUNT
		RESTART
	ELSE
		STR:颜绘記録 = %GLOBALS:(CHOICE+40)%
	ENDIF
ENDSELECT

CALL SETFLAG, "颜绘記録からの復元", ARG
CALL SETFLAG, "無表情颜绘の記録", ARG
CSTR:ARG:颜绘変化 = %MEMO_EMOT%
SAVEGLOBAL
RETURN 1

@SHOW_FACESAVE, ARG
#DIM LCOUNT
#DIM LCOUNT2

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

SIF NO:ARG != 99
	CALL PRINT_STRL, "黄色_※実際に存在する角色の颜绘を変更する際には、[肤色],[耳の形],[種族]等は変更されません※"
FOR LCOUNT, 0, 24
	ADDCOPYCHARA ARG
	CALL RESET_EMOT, CHARANUM - 1
	TALENT:(CHARANUM - 1):叛逆 = 0
	CFLAG:(CHARANUM - 1):角色用 = LCOUNT
	SELECTCASE GLOBALS:(LCOUNT+40)
	CASE ""
		CALL SET_CEVENT, "颜绘没有", CHARANUM - 1
	CASEELSE
		CALL DEL_CEVENT, "颜绘没有", CHARANUM - 1
		STR:颜绘記録 = %GLOBALS:(LCOUNT+40)%
		CALL SETFLAG, "颜绘記録からの復元", CHARANUM - 1
	ENDSELECT
	SELECTCASE LCOUNT
	CASE 5, 11, 17, 23
		CALL PRINT_MAIDFACE, 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
NEXT

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

@SORT_FACESAVE
#DIM LCOUNT
#DIM LCOUNT2

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


code:
;-------------------------------------------------
;str GBORDER(int xpos, int ypos, int wadth, int height, int imgsize, int style)
;枠線を作るHTMLタグを出力する。<nobr>使用時のみ使用可能
;int xpos, int ypos, int wadth, int heightはフォントサイズに対する％になります（100で全角一文字）
;int imgsizeは画像の尺寸、枠を小さく作りたい時や大きくしたい時に
;int styleは今のところは0以外に意味はない 枠線の画像が増える事をご期待ください
;-------------------------------------------------
@GBORDER(ARG:0, ARG:1, ARG:2 = 100, ARG:3 = 100, ARG:4 = 100, ARG:5)
#FUNCTIONS
#DIM DYNAMIC BORDER_XPOS,2
#DIM DYNAMIC BORDER_YPOS,2
#DIM DYNAMIC BORDER_WIDTH,2
#DIM DYNAMIC BORDER_HEIGHT,2
#DIM DYNAMIC BORDER_STYLE
#DIM DYNAMIC IMG_SIZE
#DIMS DYNAMIC RESULTS_HTML

BORDER_STYLE = ARG:5
IMG_SIZE = ARG:4

BORDER_XPOS:0 = ARG:0
BORDER_YPOS:0 = ARG:1
BORDER_WIDTH:0 = ARG:2
BORDER_HEIGHT:0 = ARG:3

;右線と下線頂点の位置を計算
BORDER_XPOS:1 = BORDER_XPOS:0 + BORDER_WIDTH:0 - IMG_SIZE
BORDER_YPOS:1 = BORDER_YPOS:0 + BORDER_HEIGHT:0 - IMG_SIZE

;上下左右の幅と高さを計算
BORDER_WIDTH:1 = BORDER_WIDTH:0 - (IMG_SIZE * 2)
BORDER_HEIGHT:1 = BORDER_HEIGHT:0 - (IMG_SIZE * 2)

;左上
RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:0}'></nonbutton>"
;左下
RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:0}'></nonbutton>"
;右上
RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:1}'></nonbutton>"
;右下
RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:1}'></nonbutton>"

IF BORDER_WIDTH:1 > 0
	;上
	RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:0 + IMG_SIZE}'></nonbutton>"
	;下
	RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:0 + IMG_SIZE}'></nonbutton>"
ENDIF

IF BORDER_HEIGHT:1 > 0
	;左
	RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:0}'></nonbutton>"
	;右
	RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:1}'></nonbutton>"
ENDIF

SIF BORDER_WIDTH:1 > 0 && BORDER_HEIGHT:1 > 0
	RESULTS_HTML += @"<nonbutton pos='{BORDER_XPOS:0 + IMG_SIZE}'></nonbutton>"

RETURNF RESULTS_HTML

;-------------------------------------------------
;HTML_PRINTのHEIGHTはフォント基準の為、一行の高さとフォントの高さが違う場合には少しずつ移開ていく
;その補正をしてくれる、だいたいの位置にはなるはず
;-------------------------------------------------
@FLC(ARG)
#FUNCTION
#DIM DYNAMIC LINE_SIZE

;一行の高さ*100/フォントサイズ
LINE_SIZE = ARG * GETCONFIG("一行の高さ") / GETCONFIG("フォントサイズ")

RETURNF LINE_SIZE


code:
#DIM Z_DEPTH = -2		;現在一番手前ある描画、仕様前に1減らしておく、-1には全画面への过滤器ーを置きたいので-2が初期値です
#DIM NOW_Z_FADEOUT		;フェードアウト中ならZの位置を記憶する
#DIM POPUP_SETG_COUNT	;@POPUP_SPRITで作成した画像の数
#DIM POPUP_SETB_COUNT	;@POPUP_BUTTONで作成したボタンに使う画像の数
#DIM POPUP_RESULT		;@POPUP_SELECTの返り値が入っている
#DIM LETTERBOX_HEIGHT	;上の黒帯の縦幅
#DIM CUTINID = 2000		;特写のGraphicsID
#DIM LATESTCUTINCHARA, 6	;最後に表示した特写の角色
#DIM LATESTCUTINID, 6		;最後に表示した特写のGraphicsID

#DIM MAIDEFACEID = 3000	;颜绘のGraphicsID
#DIM LATESTFACECHARA, 6	;最後に表示した颜绘の角色
#DIM LATESTFACEID, 6	;最後に表示した颜绘のGraphicsID
;感情の一時保管先
#DIM TMP_CFLAG27, 6
#DIM TMP_CFLAG28, 6
#DIM TMP_CFLAG29, 6
#DIM TMP_CFLAG31, 6
#DIM TMP_CFLAG34, 6
#DIM TMP_CFLAG36, 6
#DIM TMP_CFLAG70, 6
#DIM TMP_CFLAG86, 6
#DIM TMP_CFLAG99, 6
#DIM TMP_CFLAG117, 6
#DIMS TMP_EMOTE, 6

#DIM COLOR_MATRIX_ELEMENTS, 5, 5

;ここに使用しているGraphicsのIDを明記しておく
;0～9 使い捨て、一時的な画像のコピーを作成したり

;10, FADEOUT,FADEIN用の画面全体を暗くする画像
;11, ウィンドウサイズのボタンMap
;12, 1と同サイズのボタン用の画像
;13, 背景画像
;14, 上帯

;30～39
;@POPUP_SPRITで作成されたスプライトをまとめた画像

;40～49
;@POPUP_BUTTONで作成されたボタンに使う画像

;1000～1199
;颜绘パネルで使用する画像

;2000～2999
;特写用

;3000～3499
;颜绘用


code:
;-------------------------------------------------
;画像をスプライト化する関数群
;-------------------------------------------------
;第一製作者　ブリート
;-------------------------------------------------
@MADEFACEPHOTO
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC MEMO_TARGET
#DIM DYNAMIC FACEID
#DIM DYNAMIC ALLCHARACOUNT
#DIM DYNAMIC MADEPHOTOCOUNT
#DIMS DYNAMIC ALLCHARA
#DIMS DYNAMIC MADEPHOTO

;定義されている角色をすべて確認する
FOR LCOUNT, 1, 200
	SIF COND("勧誘可能角色", LCOUNT) == 0
		CONTINUE

	ALLCHARA += @"{LCOUNT}/"
	ALLCHARACOUNT += 1
NEXT

;画像読み込み開始

VARSET LOCALS
SPLIT ALLCHARA, "/", LOCALS

FOR LCOUNT, 0, ALLCHARACOUNT

	PRINTFORML 颜绘パネルを読み込んでいます・・・({LCOUNT}/{ALLCHARACOUNT})

	FACEID = 1000 + TOINT(LOCALS:LCOUNT)
	IF GLOAD(FACEID, FACEID)
		;スプライト名をつける
		SPRITECREATE @"颜绘パネル%LOCALS:LCOUNT%", FACEID
	;失敗したら画像を作成する
	ELSE
		MADEPHOTO += @"%LOCALS:LCOUNT%/"
		MADEPHOTOCOUNT += 1
	ENDIF

	CLEARLINE 1

NEXT

PRINTFORML 颜绘パネルを読み込んでいます・・・({LCOUNT}/{ALLCHARACOUNT})

LOADGLOBAL
;アプデ後は全部作り直す
IF GLOBAL:VER_eraAkumaMaid < GAMEBASE_VERSION
    MADEPHOTO = %ALLCHARA%
    MADEPHOTOCOUNT = ALLCHARACOUNT
	GLOBAL:VER_eraAkumaMaid = GAMEBASE_VERSION
	SAVEGLOBAL
;読み込み失敗がなかったら終了
ELSEIF MADEPHOTOCOUNT == 0
    RETURN 1
ENDIF

;ここからは画像作成

MEMO_TARGET = TARGET

VARSET LOCALS
SPLIT MADEPHOTO, "/", LOCALS

FOR LCOUNT, 0, MADEPHOTOCOUNT

	PRINTFORML 新的颜绘做成中・・・ ({LCOUNT}/{MADEPHOTOCOUNT})

	FACEID = 1000 + TOINT(LOCALS:LCOUNT)

	;ダミー作成
	ADDCHARA TOINT(LOCALS:LCOUNT)
	TARGET = CHARANUM - 1
	CFLAG:颜绘 = 1

	CALL VARSET_MAIDFACE, TARGET

	;服を着せる
	IF CFLAG:夜型
		CALL SET_COORDINATE, "便装"
	ELSE
		CALL SET_COORDINATE, "制服"
	ENDIF

	;画像ID1000～に颜绘パネルを作成する
	;EXTSTR(EXTSTR(MAIDFACE(TARGET, 1), "", ","), "+")はMAIDFACE(TARGET, 1)から背景指定と、
	;末尾の,より右のサイズやマウスオーバーテ接吻トなどを省いたもの(いわゆる{FPOS},{FSIZE},{FSIZE},{0},{MEMO_value},%MEMO_title%/を除く)
	;例えばフェリなら 4直髪長銀+7a普通+9微笑+11眯眯眼左+11眯眯眼右+13領帶西装茶色+16斜刘海銀+18通常眉灰色 のようなものが返ってくる
	CALL OVERLAY_GCREATE, FACEID, @"0e+%EXTSTR(EXTSTR(MAIDFACE(TARGET, 1), "", ","), "+")%"

	;角色の削除
	DELCHARA CHARANUM - 1

	;スプライト名をつける
	SPRITECREATE @"颜绘パネル%LOCALS:LCOUNT%", FACEID

	;作成したパネルをセーブ
	GSAVE FACEID, FACEID
	TWAIT 1, 1
	CLEARLINE 1
NEXT

PRINTFORML 新的颜绘做成中・・・ ({LCOUNT}/{MADEPHOTOCOUNT})

TARGET = MEMO_TARGET

RETURN 2


code:
;-------------------------------------------------
;画像をスプライト化する関数群。現在は使われていない
;-------------------------------------------------
;第一製作者　ブリート
;-------------------------------------------------

@MADEFACE_CUTOUT
#DIM DYNAMIC LCOUNT
#DIM DYNAMIC MEMO_TARGET

;画像ID1000ですでに作成済みか確認する
GCREATE 1000, 1, 1
SIF RESULT == 0
	RETURN 0

MEMO_TARGET = TARGET

FOR LCOUNT, 1, 200

	;角色が定義されてるか確認
	SIF EXISTCSV(LCOUNT) == 0
		CONTINUE

	;ダミー作成
	ADDCHARA LCOUNT
	TARGET = CHARANUM - 1
	CFLAG:颜绘 = 1

	CALL PRESET_MAIDFACE, TARGET

	;服を着せる
	IF CFLAG:夜型
		CALL SET_COORDINATE, "便装"
	ELSE
		CALL SET_COORDINATE, "制服"
	ENDIF

	;画像ID1000～に颜绘パネルを作成する
	;EXTSTR(EXTSTR(MAIDFACE(TARGET, 1), "", ","), "+")はMAIDFACE(TARGET, 1)から背景指定と、
	;末尾の,より右のサイズやマウスオーバーテ接吻トなどを省いたもの(いわゆる{FPOS},{FSIZE},{FSIZE},{0},{MEMO_value},%MEMO_title%/を除く)
	;例えばフェリなら 4直髪長銀+7a普通+9微笑+11眯眯眼左+11眯眯眼右+13領帶西装茶色+16斜刘海銀+18通常眉灰色 のようなものが返ってくる
	CALL OVERLAY_GCREATE, 1000 + LCOUNT, @"0e+%EXTSTR(EXTSTR(MAIDFACE(TARGET, 1), "", ","), "+")%"

	;スプライト名をつける
	SPRITECREATE @"颜绘パネル{LCOUNT}", 1000 + LCOUNT
	;角色の削除
	DELCHARA CHARANUM - 1
NEXT

TARGET = MEMO_TARGET

RETURN 1