code:
;-------------------------------------------------
;相手を紹介してもらったりします
;-------------------------------------------------
@SHOP_CHARA, ARG
#DIM LCOUNT
#DIM MEMO_LINECOUNT
#DIM MEMO_TARGET
#DIM CHOICE
#DIMS CHOICES
#DIM MEMO_BASE, 100

REDRAW 0
;角色メイク中フラグON
SETBIT FLAG:状況判定, 13
;你の血縁フラグ等を記憶
FOR LCOUNT, 0, 100
	MEMO_BASE:LCOUNT = BASE:MASTER:LCOUNT
NEXT
SIF CONFIG("素質的固定与除外")
	CALL SETFLAG, "素質的固定与除外の初期化"

MEMO_LINECOUNT = LINECOUNT

PRINTL
CALL SHOP_CHARA_SHOW

$INPUT_LOOP
IF ISSKIP() == 0
	INPUTS
	CHOICES = %RESULTS%
	CHOICE = TOINT(CHOICES)
ELSE
	CHOICE = ARG
ENDIF

SELECTCASE CHOICE
CASE 999
	RETURN 0
;[200]中等部以下　[201]１年生　[202]２年生　[203]３年生　[204]教師　[205]其他
CASE 200 TO 206, 210
	IF TFLAG:过滤器 == CHOICE
		TFLAG:过滤器 = 0
	ELSE
		TFLAG:过滤器 = CHOICE
	ENDIF
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
CASE 222
	INVERTBIT FLAG:颜绘勧誘, 0
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART

CASE IS >= 1
	SIF COND("勧誘可能角色", CHOICE) == 0
		GOTO INPUT_LOOP

	;出現条件がある場合は個別に判定
	STR:実行条件 =
	TRYCALLFORM ADDCOND_K{CHOICE}("勧誘")

	;ダメだった場合
	IF STR:実行条件 != ""
		CALL PRINT_STRW, STR:実行条件
		[IF_DEBUG]
			PRINTL
			PRINTFORML デバッグモードの特権で条件を無視して勧誘しますか？
			CALL PRINT_SELECT, "是/ズルはしない"
			SIF RESULT == 0
				STR:実行条件 =
		[ENDIF]
		IF STR:実行条件 != ""
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
	ENDIF
	;紹介してもらえるか判定。その角色が既にいるかで判定する
	IF FINDCHARA(NO, CHOICE) >= 0
		SIF CFLAG:FINDCHARA(NO, CHOICE):初期仲間 == 0
			PRINTW 已经勧誘过了呦
		CLEARLINE LINECOUNT - MEMO_LINECOUNT
		RESTART
	ENDIF
;それ以外はだいたい文字列
CASEELSE
	IF COMMENT_ADVISER(CHOICES) != ""
		CLEARLINE 1
		PRINTL
		PRINTFORML ☆%CHOICES%☆
		CALL PRINT_STRW, COMMENT_ADVISER(CHOICES)
	ENDIF

	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
ENDSELECT

MEMO_TARGET = TARGET

;注意書き…を出そうと思ったがいまさらか
;SELECTCASE CSVNAME(CHOICE)
;CASE "生実千裕"
;	CALL PRINT_STRW, @"黄色_注意！この角色はグロ描写こそ無いものの、物理的に%CALLNAME:MASTER%を食べます！！"
;	PRINTFORMW ……本当に勧誘しますか？
;	CALL PRINT_SELECT, "是/否"
;	IF RESULT
;		CLEARLINE LINECOUNT - MEMO_LINECOUNT
;		RESTART
;	ENDIF
;ENDSELECT

;角色解説を入れる
CALL CHARA_MANUAL, CHOICE
;否を選ぶと再入力
IF RESULT == 0
	;表示されていた角色を白紙に戻す
	DELCHARA CHARANUM-1
	TARGET = MEMO_TARGET

	;你のフラグの変化を元に戻す（現在だと血縁のみ）
	FOR LCOUNT, 0, 100
		BASE:MASTER:LCOUNT = MEMO_BASE:LCOUNT
	NEXT

	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	RESTART
ENDIF

;もしも指导者が居ない状態ならば、現在的TARGETを（可能なら）指导者にし、選んだ角色をTARGETにする
SIF ASSI == 0 && TARGET && COND("助手可能")
	ASSI = TARGET

TARGET = CHARANUM - 1

;時間遷移でのフラグ変更を一回呼び出しておく
TRYCALLFORM TIMEEVENT_K{NO:TARGET}

;式神などの特例
IF COND("基本情報隠蔽")
	IF COND("昼")
		PRINTFORM ★学園中发现的不法侵入者
	ELSE
		PRINTFORM ★在家的外面发现的不法侵入者
	ENDIF
	IF CSTR:関係 == "借住"
		PRINTFORMW 带回了家里★
	ELSE
		PRINTFORMW 进行了勧誘★
	ENDIF
ELSEIF COND("種族：自动人形")
	PRINTFORMW ★买了想要的[%CSTR:称号%]%NAME:TARGET%★
ELSEIF COND("種族：式神")
	PRINTFORMW ★失去了力量的原鬼神or原妖。现在是学園的%CSTR:学年%。其名为[%CSTR:称号%]%NAME:TARGET%。现在进行了仪式★
ELSEIF CSTR:学年 == "不法侵入"
	PRINTFORM ★在学園里发现的不法侵入\@ COND("種族：悪魔") ? 悪魔 # 者 \@、
	IF CSTR:関係 == "借住"
		PRINTFORMW 把[%CSTR:称号%]%NAME:TARGET%带回了家★
	ELSE
		PRINTFORMW 勧誘了[%CSTR:称号%]%NAME:TARGET%★
	ENDIF
ELSE
	PRINTFORMW ★勧誘了学園的%CSTR:学年%、[%CSTR:称号%]%NAME:TARGET%★
ENDIF

;勧誘直後内で設定されがちな各種フラグの調整
TALENT:常時尿道塞 = COND("身嗜み：尿道拡張")
TALENT:常時Ａ肛塞 = COND("身嗜み：Ａ拡張")
TALENT:常時Ｖ振動棒 = COND("身嗜み：Ｖ拡張")

FOR LCOUNT, 90, 110
	SIF CEVENT(CSTRNAME:LCOUNT) == 0
		CONTINUE
	CALL DEL_CEVENT_GROUP, CSTRNAME:LCOUNT
	CSTR:(CSTRNAME:LCOUNT) = %CSVCSTR(NO:TARGET, LCOUNT)%
NEXT

PRINTL
MEMO_LINECOUNT = LINECOUNT
;加入後台詞（なくても大丈夫）
CALL EVENT_PROFILE, "勧誘直後", TARGET
SIF LINECOUNT == MEMO_LINECOUNT
	CLEARLINE 1

CALL SETFLAG, "合意", TARGET
;行為の禁止をしている？
SIF CEVENT("尿道調教禁止")
	CALL PRINT_STRW, @"黄色_※注意※ %NAME:TARGET%是禁止尿道調教的角色。無論如何都不會允許"

TFLAG:地の文スキップ = 0
MEMO_LINECOUNT = LINECOUNT
;出現条件の出力。特殊な場合以外は書かなくて良いです
CALL EVENT_PROFILE, "出現条件", TARGET
SIF COND("部室出現可能") && TFLAG:地の文スキップ == 0 && LINECOUNT == MEMO_LINECOUNT
	CALL PRINT_STRW, @"%NAME:TARGET%和%CALLNAME:MASTER%的関系为_黄色_%CSTR:関係%_。因此、会在(昼)的部室里露露面。"

;颜绘の設定
IF CFLAG:颜绘 == 0
	DRAWLINE
	PRINTFORML %NAME:TARGET%还没有設定頭像。要設定吗？
	CALL PRINT_SELECT, "設定/不設定"
	IF RESULT == 0
		CALL SIMULATE_MAIDFACE, TARGET
	ELSE
		PRINTFORMW 今後想要設定的时候、请在设置中调整。
	ENDIF
ENDIF

IF PLACE("部室")
	IF COND("部室出現可能")
		DRAWLINE
		CALL SETFLAG, "優先順位", TARGET
		TFLAG:地の文スキップ = 0
		MEMO_LINECOUNT = LINECOUNT
		CALL EVENT_PROFILE, "初訪問"
		IF TFLAG:地の文スキップ == 0 && LINECOUNT == MEMO_LINECOUNT
			PRINTFORMW ……总而言之现在%CALLNAME:TARGET%会到部室里来了。
		ENDIF
	ELSE
		CFLAG:不在 = 1
		CFLAG:優先順位 = CHARANUM - 2
		TARGET = MEMO_TARGET
	ENDIF
ELSEIF PLACE("自宅")
	IF COND("自宅出現可能")
		CALL SETFLAG, "優先順位", TARGET
	ELSE
		CFLAG:不在 = 1
		CFLAG:優先順位 = CHARANUM - 2
		TARGET = MEMO_TARGET
	ENDIF
ENDIF

@SHOP_CHARA_SHOW
#DIM MEMO_TFLAG

DRAWLINE
CALL PRINT_STRL, @"勧誘对%CALLNAME:MASTER%的体質有兴趣的对象作为部員。详细情报请查看各个角色的_緑_□ 特記事項 □_"
CALL PRINT_STRL, "黄色_（魂的授受的话性交是最簡単的方式、因此如果没有特殊注释的话那么所有人都是作为性伴侣的）"
IF CONFIG("颜绘勧誘")
;	CALL PRINT_STRL, "緑_※颜绘表示中は動作が重いため、マウスではなく番号直接入力が推奨です。また、全角色表示は禁止します※"
ELSE
	CALL PRINT_STRL, "関于特技的情报可以通过按下名字按钮来进行确认"
ENDIF
DRAWLINE
CALL PRINT_STRL, "爱心粉紅_H_已经写好了个人结局的角色会用特殊颜色标注出来_爱心粉紅_H"

DRAWLINE
MEMO_TFLAG = TFLAG:过滤器
IF CONFIG("颜绘勧誘")
	CALL PRINT_SHOP_MAIDFACE
ELSE
	CALL SET_SHOP_CHARA_SHOW, "ＥＮＤ格子"
ENDIF
TFLAG:过滤器 = MEMO_TFLAG
CALL BLANK_DRAWLINE

SELECTCASE TFLAG:过滤器
CASE 200
	CALL PRINT_STR, "[999]返回 _黄色_[200]中等部以下_ [201]１年 [202]２年 [203]３年 [204]教師 [205]其他 [206]男性"
CASE 201
	CALL PRINT_STR, "[999]返回 [200]中等部以下 _黄色_[201]１年_ [202]２年 [203]３年 [204]教師 [205]其他 [206]男性"
CASE 202
	CALL PRINT_STR, "[999]返回 [200]中等部以下 [201]１年 _黄色_[202]２年_ [203]３年 [204]教師 [205]其他 [206]男性"
CASE 203
	CALL PRINT_STR, "[999]返回 [200]中等部以下 [201]１年 [202]２年 _黄色_[203]３年_ [204]教師 [205]其他 [206]男性"
CASE 204
	CALL PRINT_STR, "[999]返回 [200]中等部以下 [201]１年 [202]２年 [203]３年 _黄色_[204]教師_ [205]其他 [206]男性"
CASE 205
	CALL PRINT_STR, "[999]返回 [200]中等部以下 [201]１年 [202]２年 [203]３年 [204]教師 _黄色_[205]其他_ [206]男性"
CASE 206
	CALL PRINT_STR, "[999]返回 [200]中等部以下 [201]１年 [202]２年 [203]３年 [204]教師 [205]其他 _黄色_[206]男性"
CASE 210
	CALL PRINT_STR, "[999]返回 [200]中等部以下 [201]１年 [202]２年 [203]３年 [204]教師 [205]其他 [206]男性"
CASEELSE
	PRINTFORM [999]返回 [200]中等部以下 [201]１年 [202]２年 [203]３年 [204]教師 [205]其他 [206]男性
ENDSELECT

IF TFLAG:过滤器 == 210
	CALL PRINT_STR, @" _黄色_[210]刷新_"
ELSE
	CALL PRINT_STR, @" [210]刷新"
ENDIF

CALL PRINT_STR, @" [222]颜绘\@ CONFIG("颜绘勧誘") ? 〇 # － \@"

PRINTL

;-------------------------------------------------
;勧誘する角色の一覧表示
;ARGSに"ＥＮＤ格子"って入れるとエンディングが書かれている角色の色が変わる
;-------------------------------------------------
@SET_SHOP_CHARA_SHOW, ARGS
#DIM LCOUNT
#DIM LCOUNT2

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

PRINTFORML 　　　%TEXT_LJ("名前", 16)%　%TEXT_LJ("学年",14)%　%TEXT_LJ("称号",22)%　特技
DRAWLINE
;実際に角色を表示
FOR LCOUNT, 1, 200
	SIF COND("勧誘画面表示", LCOUNT) == 0
		CONTINUE

	;その角色が既にいるかで判定
	IF FINDCHARA(NO, LCOUNT) >= 0
		SETCOLOR DEF_COLOR("灰色")
		FONTSTYLE 4
	ENDIF

	;エンディングが書かれているか格子（TRYCALLなのでRESULTに0を代入しておく）
	IF ARGS == "ＥＮＤ格子"
		RESULT = 0
		TRYCALLFORM IS_SINGLE_ENDING_K{LCOUNT}
		SIF RESULT
			SETCOLOR DEF_COLOR("爱心粉紅")
	ENDIF
	CALL TEXT_SHOP_CHARA_SHOW, LCOUNT
	RESETCOLOR
	FONTSTYLE 0
NEXT

@TEXT_SHOP_CHARA_SHOW, ARG
#DIM LCOUNT
;名前、称号、特技
IF ARG >= 100
	PRINTFORM [{ARG}]
ELSE
	PRINTFORM  [{ARG, 2}]
ENDIF
IF STRCOUNT(CSVCSTR(ARG, GETNUM(CSTR, "CEVENT") ), "情報隠蔽")
	PRINTFORM %TEXT_LJ("？？？", 16)%
	PRINTFORM %TEXT_LJ("？？？", 14)%
	PRINTFORM %TEXT_LJ("？？？", 22)%
	PRINTFORML ？？？
	RETURN 1
ELSE
	PRINTFORM %TEXT_LJ(CSVNAME(ARG), 16)%
	IF CSVTALENT(ARG, GETNUM(TALENT, "処女") )
		PRINTFORM %TEXT_LJ(@"%CSVCSTR(ARG, GETNUM(CSTR, "学年") )%(処女)", 14)%
	ELSE
		PRINTFORM %TEXT_LJ(CSVCSTR(ARG, GETNUM(CSTR, "学年") ), 14)%
	ENDIF
	PRINTFORM %TEXT_LJ(CSVCSTR(ARG, GETNUM(CSTR, "称号") ), 22)%
ENDIF

VARSET LOCALS
SPLIT CSVCSTR(ARG, GETNUM(CSTR, "建议") ), "＆", LOCALS
FOR LCOUNT, 0, 10
	SELECTCASE LOCALS:LCOUNT
	CASE ""
		SIF LCOUNT == 0
			PRINTBUTTON "没有", "没有"
		BREAK
	CASEELSE
		PRINTBUTTON LOCALS:LCOUNT, LOCALS:LCOUNT
		SIF LOCALS:(LCOUNT + 1) != ""
			PRINT ＆
	ENDSELECT
NEXT
PRINTL


code:
;-------------------------------------------------
;道具出現条件
;-------------------------------------------------
@SALEITEM_CHECK, ARG
#DIM LCOUNT
#DIM NEXT_LINE
#DIMS NAME_ITEM

CALL SETFLAG, "道具フラグ調整"

DRAWLINE
IF GETBIT(FLAG:ITEM_SHOP, 0) == 0
	PRINTL □ 大人的玩具 □
ELSE
	CALL PRINT_STR, "□ 大人的玩具 … _黄色_本店会为老顾客售出更加舒服的良品_ □_L_"
ENDIF
NEXT_LINE = 0
FOR LCOUNT, 0, 30
	SIF ITEMNAME:LCOUNT == ""
		CONTINUE
	IF ITEMSALES:LCOUNT == 0
		SETCOLOR DEF_COLOR("灰色")
	ELSEIF ITEM:LCOUNT
		SETCOLOR DEF_COLOR("水色")
	ENDIF
	IF ITEM:LCOUNT
		NAME_ITEM = %ITEMNAME:LCOUNT% +{ITEM:LCOUNT}
	ELSE
		NAME_ITEM = %ITEMNAME:LCOUNT%
	ENDIF

	PRINTFORMLC  [{LCOUNT, 2}]%TEXT_LJ(NAME_ITEM, 16)%%TEXT_RJ(MONEY_C(ITEMPRICE:LCOUNT), 9)%

	RESETCOLOR

	NEXT_LINE += 1
	SIF NEXT_LINE%3 == 0
		PRINTL
NEXT
SIF NEXT_LINE%3
	PRINTL

PRINTL
IF GETBIT(FLAG:ITEM_SHOP, 1) == 0
	PRINTL □ 調教道具 □
ELSE
	CALL PRINT_STR, "□ 調教道具 … _黄色_使用高級品的话会在減少不快的情况下更安心的享受PLAY呦_ □_L_"
ENDIF
NEXT_LINE = 0
FOR LCOUNT, 30, 50
	SIF ITEMNAME:LCOUNT == ""
		CONTINUE
	IF ITEMSALES:LCOUNT == 0
		SETCOLOR DEF_COLOR("灰色")
	ELSEIF ITEM:LCOUNT
		SETCOLOR DEF_COLOR("水色")
	ENDIF

	IF ITEM:LCOUNT
		NAME_ITEM = %ITEMNAME:LCOUNT% +{ITEM:LCOUNT}
	ELSE
		NAME_ITEM = %ITEMNAME:LCOUNT%
	ENDIF

	PRINTFORMLC  [{LCOUNT, 2}]%TEXT_LJ(NAME_ITEM, 16)%%TEXT_RJ(MONEY_C(ITEMPRICE:LCOUNT), 9)%

	RESETCOLOR

	NEXT_LINE += 1
	SIF NEXT_LINE%3 == 0
		PRINTL
NEXT
SIF NEXT_LINE%3
	PRINTL

PRINTL
PRINTL □ 消耗品 … 以５個为一个套装进行販售 □
NEXT_LINE = 0
FOR LCOUNT, 50, 60
	SIF ITEMNAME:LCOUNT == ""
		CONTINUE
	IF ITEMSALES:LCOUNT == 0
		SETCOLOR DEF_COLOR("灰色")
	ELSEIF ITEM:LCOUNT
		SETCOLOR DEF_COLOR("水色")
	ENDIF

	NAME_ITEM = %ITEMNAME:LCOUNT%×５

	PRINTFORMLC  [{LCOUNT, 2}]%TEXT_LJ(NAME_ITEM, 16)%%TEXT_RJ(MONEY_C(ITEMPRICE:LCOUNT*5), 9)%

	RESETCOLOR

	NEXT_LINE += 1
	SIF NEXT_LINE%3 == 0
		PRINTL
NEXT
SIF NEXT_LINE%3
	PRINTL

IF TALENT:MASTER:男性 == 0 && ARG == MASTER
	PRINTL
	CALL PRINT_STRL, @"□ 身嗜用品 … _黄色_只有在%CALLNAME:MASTER%不是男性_的时候販売的道具(使用者是%CALLNAME:MASTER%自己) □"
	NEXT_LINE = 0
	FOR LCOUNT, 60, 65
		SIF ITEMNAME:LCOUNT == ""
			CONTINUE
		IF ITEMSALES:LCOUNT == 0
			SETCOLOR DEF_COLOR("灰色")
		ELSEIF ITEM:LCOUNT
			SETCOLOR DEF_COLOR("水色")
		ENDIF
		SELECTCASE ITEMNAME:LCOUNT
		CASE "避妊の護符"
			IF TALENT:MASTER:避妊の護符
				NAME_ITEM = 避妊の護符破棄
			ELSE
				NAME_ITEM = %ITEMNAME:LCOUNT%
			ENDIF
			PRINTFORMLC  [{LCOUNT, 2}]%TEXT_LJ(NAME_ITEM, 16)%%TEXT_RJ(MONEY_C(ITEMPRICE:LCOUNT), 9)%
		CASE "口服避孕薬"
			NAME_ITEM = %ITEMNAME:LCOUNT%×７
			PRINTFORMLC  [{LCOUNT, 2}]%TEXT_LJ(NAME_ITEM, 16)%%TEXT_RJ(MONEY_C(ITEMPRICE:LCOUNT*7), 9)%
		CASEELSE
			NAME_ITEM = %ITEMNAME:LCOUNT%
			PRINTFORMLC  [{LCOUNT, 2}]%TEXT_LJ(NAME_ITEM, 16)%%TEXT_RJ(MONEY_C(ITEMPRICE:LCOUNT), 9)%
		ENDSELECT

		RESETCOLOR

		NEXT_LINE += 1
		SIF NEXT_LINE%3 == 0
			PRINTL
	NEXT
	SIF NEXT_LINE%3
		PRINTL
ENDIF

@EVENT_SHOP
;起きうるイベントの判定に使う
#DIMS EVENT_TABLE
#DIM CHOICE
REDRAW 0
;買い物中フラグON
SETBIT FLAG:状況判定, 21

;寝てたら連れて行かない
IF TARGET == 0 || CFLAG:睡眠

;すでに同伴して買い物した場合も連れてかない
ELSEIF CHOSE_DEVENT("购物")
	PRINTL
	PRINTFORMW 刚刚才带%CALLNAME:TARGET%去过、这次就一个人去买吧。
;それ以外なら連れていける
ELSE
	;買い物同伴中フラグON（続く選択肢で"否"を選ぶとOFFになる）
	SETBIT FLAG:状況判定, 22

	IF CHECK_CLO("裸体") || CHECK_CLO("泳装姿") || CHECK_CLO("体操服姿") || CHECK_CLO("内衣姿") || CHECK_CLO("胖次が見える格好")
		IF COND("学園")
			IF COND("学生")
				EVENT_TABLE = 是(换成制服)/否/
			ELSE
				EVENT_TABLE = 是(换成学園的衣装)/否/
			ENDIF
		ELSE
			EVENT_TABLE = 是(换成便服)/否/
		ENDIF
		IF CHECK_CLO("裸体") && COND("認識阻害可能", MASTER)
			PRINTFORML …她現在穿着不适合外出的装扮、要和%CALLNAME:TARGET%一起去吗？
			SIF ABL:露出癖 >= 9
				EVENT_TABLE += "保持现在的装扮一起去/"
		ELSEIF CHECK_CLO("泳装姿")
			PRINTFORML 她現在穿着泳装、要和%CALLNAME:TARGET%一起去吗？
			SIF ABL:露出癖 >= 3 || TALENT:不知羞恥
				EVENT_TABLE += "保持现在的装扮一起去/"
		ELSEIF CHECK_CLO("体操服姿")
			PRINTFORML 她現在穿着体操服、要和%CALLNAME:TARGET%一起去吗？
			EVENT_TABLE += "保持现在的装扮一起去/"
		ELSEIF CHECK_CLO("内衣姿")
			PRINTFORML 她現在只穿着内衣、要和%CALLNAME:TARGET%一起去吗？
			SIF ABL:露出癖 >= 7
				EVENT_TABLE += "保持现在的装扮一起去/"
		ELSEIF CHECK_CLO("胖次が見える格好")
			PRINTFORML 她現在只穿着%PANTIES(TARGET, "胖次")%、要和%CALLNAME:TARGET%一起去吗？
			SIF ABL:露出癖 >= 5
				EVENT_TABLE += "保持现在的装扮一起去/"
		ENDIF
	;ELSEIF CHECK_CLO("没穿内褲") && COND("胖次形状確認") && (CSVCSTR(NO:TARGET, GETNUM(CSTR, "胖次") ) != "" || CFLAG:胖次没収)
	;	PRINTFORML 現在は\@ CHECK_SKIRT("迷你") ? 迷你 # \@裙にも関わらず没穿内褲のようですが、%CALLNAME:TARGET%も連れていきますか？
	;	IF CFLAG:胖次没収
	;		EVENT_TABLE = 是/否/穿上没收的胖次一起去/
	;	ELSE
	;		EVENT_TABLE = 是/否/穿着胖次一起去/
	;	ENDIF
	ELSE
		PRINTFORML 要和%CALLNAME:TARGET%一起去吗？
		EVENT_TABLE = 是/否/
		SIF COND("胖次没収実行可能") && COND("合意：胖次交易")
			EVENT_TABLE += "没収胖次带过去/"
		;2020/1/31　玛丽酱の中の人加筆
		SIF COND("合意：露出PLAY") && ABL:露出癖 >= 7 && EQUIP:胖次
			EVENT_TABLE += "只穿内衣带过去/"
		SIF COND("合意：露出PLAY") && COND("合意：全裸化") && ABL:露出癖 >= 9 && COND("認識阻害可能", MASTER)
			EVENT_TABLE += "全裸着带过去/"
	ENDIF

	VARSET LOCALS
	SPLIT EVENT_TABLE, "/", LOCALS
	CALL PRINT_SELECT, EVENT_TABLE
	CHOICE = RESULT

	SELECTCASE LOCALS:CHOICE
	CASE "否"
		CALL KOJO_SHOP, "目送"
		;買い物同伴中フラグOFF
		CLEARBIT FLAG:状況判定, 22
	CASE "没収胖次带过去"
		PRINTL
		PRINTFORMW %CALLNAME:MASTER%在外出之際、要求%CALLNAME:TARGET%交出胖次之后再出发。
		CALL KOJO_SHOP, "没収胖次出発"

		PRINTL
		IF EQUIP:胖次
			SIF COND("胖次形状確認") == 0
				CALL TEXT_PANTU_CHECK_SHORT
			CALL SETFLAG, "胖次没収", TARGET
			;買い物胖次没収中フラグON
			SETBIT FLAG:状況判定, 23
		ELSE
			CALL TEXT_PANTU_CHECK, SKIRT(TARGET)
		ENDIF
		PRINTL
	CASE "只穿内衣带过去"
		PRINTL
		PRINTFORMW %CALLNAME:MASTER%在进店之前、要求%CALLNAME:TARGET%脱到只穿内衣。
		CALL SETFLAG, "薄着化：内衣姿", TARGET
		;買い物内衣姿フラグON
		SETBIT FLAG:状況判定, 27
	CASE "全裸着带过去"
		PRINTL
		PRINTFORMW %CALLNAME:MASTER%在进店之前、要求%CALLNAME:TARGET%脱到全裸。
		PRINTFORMW %CALLNAME:TARGET%满脸通红地将衣服一件一件的脱了下来，直到一丝不挂地站在了商店的门前
		PRINTFORMW 被%CALLNAME:MASTER%推搡着，%CALLNAME:TARGET%半推半就的走进了商店
		CALL SETFLAG, "全裸化", TARGET
		;買い物全裸フラグON
		SETBIT FLAG:状況判定, 28
	CASE "穿着胖次一起去", "穿上没收的胖次一起去"
		CALL KOJO_SHOP, "胖次穿かせて出発"
		IF CFLAG:胖次没収
			CALL SETFLAG, "胖次返却", TARGET
			;買い物胖次返却中フラグON
			SETBIT FLAG:状況判定, 24
		ELSE
			CALL SET_COORDINATE, "内衣"
		ENDIF
	CASE "保持现在的装扮一起去"
		CALL KOJO_SHOP, "保持现在的装扮出発"
	;"是"はココ。変な格好なら着替えます
	CASEELSE
		CALL KOJO_SHOP, "一緒に出発"
		IF CHECK_CLO("裸体") || CHECK_CLO("泳装姿") || CHECK_CLO("体操服姿") || CHECK_CLO("内衣姿") || CHECK_CLO("胖次が見える格好")
			IF COND("学園")
				CALL SET_COORDINATE, "制服"
			ELSE
				CALL SET_COORDINATE, "外出装"
			ENDIF
			PRINTFORMW %CALLNAME:TARGET%快速地换好衣服、跟着%CALLNAME:MASTER%一起来了。
		ENDIF
	ENDSELECT
ENDIF
PRINTL
IF COND("買い物同伴中")
	;同伴して買い物したフラグON
	CSTR:DAILYCOM履歴 += "＠购物/"

	IF CHECK_CLO("裸体")
		IF CONFIG("路人Ｈ")
			PRINTFORML 「欢迎……光……临……」
			PRINTFORMW 店員盯着%CALLNAME:TARGET%赤裸的身体、视线有些下流
		ELSE
			PRINTFORML 「欢迎！？ 光……临……？」
			PRINTFORMW 店員被%CALLNAME:TARGET%的様子吓了一跳、什么话都没有说
		ENDIF
	ELSEIF CHECK_CLO("泳装姿") || CHECK_CLO("体操服姿")
		PRINTFORML 「欢迎光临ー」
		PRINTFORMW 店員瞥了一眼%CALLNAME:TARGET%、什么话都没有说
	ELSEIF CHECK_CLO("内衣姿") || CHECK_CLO("胖次が見える格好")
		PRINTFORML 「欢迎光临ー」
		PRINTFORMW 店員瞥了%CALLNAME:TARGET%好几眼、什么话都没有说
	ELSEIF CHECK_SKIRT("迷你")
		PRINTFORML 「欢迎光临ー」
		PRINTFORMW 店員靠近穿着迷你裙的%CALLNAME:TARGET%、对着大腿看了好几眼、什么话都没有说
	ELSE
		PRINTFORMW 「欢迎光临ー」
	ENDIF
ELSE
	PRINTFORMW 「欢迎光临ー」
ENDIF
CALL EVENT_SHOP_BUY, MASTER

@EVENT_SHOP_BUY, ARG
#DIM MEMO_LINECOUNT
#DIM MEMO_LINECOUNT2
#DIM EXIST_KOJO
#DIM CHOICE

#DIM PURCHASE_NUMBER = 1
;商品選択番号などとのバッティングを防ぐために, 購入数の変更は大号数字を加えて表現する
;9999も何かで使用する可能性を考えてとりあえず10000以降を使用するように設定
;Standard+-11でMIN/MAXを表現する Standard+-10以内で就这様購入数の変更を表現する
#DIM CONST Purchase_Number_Standard = 10011
#DIM CONST Possession_Number_Min = 1
#DIM CONST Possession_Number_Max = 99

MEMO_LINECOUNT = LINECOUNT
PRINTL
DRAWLINE

SELECTCASE ARG
CASE MASTER
	PRINTFORML 購入者为%CALLNAME:ARG%　(所持金：%MONEY_C(MONEY)%)
	CALL PRINT_STRL, "要買哪个呢？已持有１个以上的会变成_水色_这个颜色_"
CASE TARGET
	IF CHECK_CLO("裸体")
		CALL PRINT_STR, @"購入者为%CALLNAME:TARGET%_爱心粉紅_(裸体)__L"
	ELSEIF CHECK_CLO("泳装姿")
		CALL PRINT_STR, @"購入者为%CALLNAME:TARGET%_黄色_(泳装姿)__L"
	ELSEIF CHECK_CLO("体操服姿")
		CALL PRINT_STR, @"購入者为%CALLNAME:TARGET%_黄色_(体操服姿)__L"
	ELSEIF CHECK_CLO("内衣姿")
		CALL PRINT_STR, @"購入者为%CALLNAME:TARGET%_黄色_(内衣姿)__L"
	ELSEIF CHECK_CLO("没穿内褲") && COND("胖次形状確認")
		CALL PRINT_STR, @"購入者为%CALLNAME:TARGET%_黄色_(没穿内褲)__L"
	ELSE
		PRINTFORML 購入者为%CALLNAME:TARGET%
	ENDIF
	PRINTFORML 要買哪个呢？　(所持金：%MONEY_C(MONEY)%)
ENDSELECT

DRAWLINE
	CALL PRINT_STRL, "□ 購入個数 … _黄色_最多可以购买指定个数的数量_ □_"
PRINTFORM   {PURCHASE_NUMBER, 2} 個
PRINT
PRINTBUTTON "[ +1]", Purchase_Number_Standard+1
PRINT
PRINTBUTTON "[+10]", Purchase_Number_Standard+10
PRINT
PRINTBUTTON "[ -1]", Purchase_Number_Standard-1
PRINT
PRINTBUTTON "[-10]", Purchase_Number_Standard-10
PRINT
PRINTBUTTON "[MIN]", Purchase_Number_Standard-11
PRINT
PRINTBUTTON "[MAX]", Purchase_Number_Standard+11
PRINTL

CALL SALEITEM_CHECK, ARG
PRINTL
CALL SHOW_ITEM_HAVE
DRAWLINE

IF COND("買い物同伴中") && COND("買い物同伴相手が購入") == 0
	IF ARG != TARGET
		PRINTFORML [100]让%CALLNAME:TARGET%来结账（但是、每个時間段只能进行一次！）
	ELSE
		PRINTFORML [100]果然还是自己来结账吧
	ENDIF
ENDIF

;2020/1/31　玛丽酱の中の人加筆
EXIST_KOJO = 0
MEMO_LINECOUNT2 = LINECOUNT
TRYCALLFORM KOJO_SHOP_K{NO:TARGET}, "询问有什么想要的东西"
SIF LINECOUNT > MEMO_LINECOUNT2
	EXIST_KOJO = 1
CLEARLINE LINECOUNT - MEMO_LINECOUNT2

IF EXIST_KOJO && COND("買い物同伴中") && COND("询问有什么想买的东西") == 0
	PRINTFORML [101]询问%CALLNAME:TARGET%有没有什么想要的东西（但是、每个時間段只能进行一次！）
ENDIF

;何を買ったか、管理するのが面倒なので未実装
;IF COND("買い物同伴中") && COND("購入物をお試し") == 0
;	PRINTFORML [101]%CALLNAME:TARGET%に買った物を使ってもらう（ただし、各時間帯に１回だけ！）
;ENDIF
DRAWLINE

IF CEVENT("槞彁：バイト探し", MASTER) && !CEVENT("槞彁：就労ビザ取得命令", MASTER)
	SIF COND("買い物同伴中") && COND("買い物同伴相手が購入") == 0
		CLEARLINE 1;DRAWLINEを削除しますわよ(これ絶対もっといい方法有るでしょ)
	HTML_PRINT @"<button value='200'>
[200] 听说正在招打工的
</button>"
	DRAWLINE
ENDIF

PRINTFORML [999] 从店里出去

{
	CALL INPUT_SELECT, 100, 100, 101, 200, 999,
		Purchase_Number_Standard+1, Purchase_Number_Standard+10, Purchase_Number_Standard-1,
		Purchase_Number_Standard-10, Purchase_Number_Standard-11, Purchase_Number_Standard+11
}

CHOICE = RESULT

SELECTCASE CHOICE
CASE 999
	IF COND("買い物同伴中")
		IF CHECK_CLO("裸体") || CHECK_CLO("内衣姿")
			PRINTFORMW 「非常感谢。欢迎您下次光临」
		ELSEIF CHECK_SKIRT("迷你")
			PRINTFORML 「谢谢惠顾ー」
			PRINTFORMW 店員深深鞠着躬目送%CALLNAME:TARGET%离開了。
		ELSE
			PRINTFORMW 「谢谢惠顾ー」
		ENDIF
	ELSE
		PRINTFORMW 「谢谢惠顾ー」
	ENDIF
	IF COND("買い物同伴中")
		IF COND("買い物全裸中")
			PRINTL
			PRINTFORMW 走出店的%CALLNAME:MASTER%把%CALLNAME:TARGET%穿着的东西还了回去。
			CALL SET_MEMO_DRESS, "脱掉的衣服一览", TARGET
		ELSEIF COND("買い物内衣姿")
			PRINTL
			PRINTFORMW 走出店的%CALLNAME:MASTER%把%CALLNAME:TARGET%穿着的东西还了回去。
			CALL SET_MEMO_DRESS, "脱掉的衣服一览", TARGET
			CFLAG:薄着变成了 = 0
		ELSEIF COND("買い物胖次没収中")
			PRINTL
			PRINTFORMW 从店里出来的%CALLNAME:MASTER%把胖次还给了%CALLNAME:TARGET%。
			CALL SETFLAG, "胖次返却", TARGET
		ENDIF
		CALL KOJO_SHOP, "购物終了"
		;何か購入したなら記録
		IF COND("買上品数") > 0
			STR:日常イベント名 = 買東西
			CALL SET_PREV_DAILYCOM
		ENDIF
	ENDIF
	REDRAW 1
	PURCHASE_NUMBER = 1
	RETURN 0
CASE 200
	IF CEVENT("槞彁：バイト探し", MASTER) && !CEVENT("槞彁：就労ビザ取得命令", MASTER)
		;ここに槞彁の就労ビザ発行命令
		IF COND("買い物同伴中") && NO:TARGET == 15
			;PRINTFORMW 槞彁同伴時メッセージ
			IF CEVENT("槞彁：槞彁を連れてきて", MASTER) == 0
				;初手で槞彁を連れて店来了場合
				PRINTFORMW 「欢迎光临ー」
				PRINTFORMW 「ん？アルバイト欲しくないかだって？」
				PRINTFORMW 「そうだねぇ、ちょっとそろそろアルバイトの一人でも雇っても良いかもしれんねぇ」
				PRINTFORMW 「じゃあ...って、もう来てるのか、話が早いね」
				PRINTL
				PRINTFORMW 「はは、安心しなよこの子を襲ったりなんて不会」
				PRINTFORMW 槞彁は你の後ろに隠れて様子を見ている
				PRINTFORMW 「おや、お嬢酱悪魔かい？珍しいねぇ、職業悪魔として来たわけじゃないのかい？」
				PRINTFORMW 店員はやけに悪魔の事について詳しい...
				PRINTFORMW 「このお店には色々な人が来るからねぇ、殺人鬼が来ようが創造主が来ようが気にしなくなっちゃったよ。ハハハ」
				PRINTFORMW 「ところで...職業悪魔じゃないということは就労ビザは酱と発行してもらってるかい？」

				CALL CALL_LIB("アルバイト探しイベント：店員との会話")
			ELSE
				;連れてこいと言われたので連れてきた
				PRINTFORMW 「お、その子が話に出てたアルバイト希望の子かい？」
				PRINTFORMW 「はは、安心しなよこの子を襲ったりなんて不会」
				PRINTFORMW 槞彁は你の後ろに隠れて様子を見ている
				PRINTFORMW 「おや、お嬢酱悪魔かい？珍しいねぇ、職業悪魔として来たわけじゃないのかい？」
				PRINTFORMW 店員はやけに悪魔の事について詳しい...
				PRINTFORMW 「このお店には色々な人が来るからねぇ、殺人鬼が来ようが創造主が来ようが気にしなくなっちゃったよ。ハハハ」
				PRINTFORMW 「ところで...職業悪魔じゃないということは就労ビザは酱と発行してもらってるかい？」

				CALL CALL_LIB("アルバイト探しイベント：店員との会話")
			ENDIF
			CALL SET_CEVENT, "槞彁：就労ビザ取得命令", MASTER
		ELSEIF CEVENT("槞彁：槞彁を連れてきて", MASTER)
			PRINTFORMW 「アルバイトの子、楽しみにしてるよ」
			;HTML_PRINT @"
%CNAME("槞彁")%を連れてこのお店に来よう...
"
			HTML_PRINT @"
%NAME:FINDCHARA(NO, 15)%を連れてこのお店に来よう...
";槞彁を桑付けしたくないのでこちらを使うわよ
			WAIT
		ELSE
			PRINTFORMW 「欢迎光临ー」
			PRINTFORMW 「ん？アルバイト欲しくないかだって？」
			PRINTFORMW 「そうだねぇ、ちょっとそろそろアルバイトの一人でも雇っても良いかもしれんねぇ」
			PRINTFORMW 「じゃあ、今度アルバイト希望の子連れきてよ」
			;HTML_PRINT @"
%CNAME("槞彁")%を連れてこのお店に来よう...
"
			HTML_PRINT @"
%NAME:FINDCHARA(NO, 15)%を連れてこのお店に来よう...
";槞彁を桑付けしたくないのでこちらを使うわよ
			WAIT
			CALL SET_CEVENT, "槞彁：槞彁を連れてきて", MASTER
		ENDIF
	ENDIF
CASE 101
	IF COND("買い物同伴中") && COND("询问有什么想买的东西") == 0
		CALL KOJO_SHOP, "询问有什么想要的东西"
		CLEARLINE 1
		WAIT
		;partnerに欲しい物を聞けるのは一回だけ
		;買い物同伴相手の欲しい物フラグON
		SETBIT FLAG:状況判定, 29
	ENDIF
CASE 100
	IF COND("買い物同伴中") && COND("買い物同伴相手が購入") == 0
		IF ARG != TARGET
			ARG = TARGET
			CALL KOJO_SHOP, "会計交代"
		ELSE
			ARG = MASTER
		ENDIF
	ENDIF
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
CASE Purchase_Number_Standard-11
	PURCHASE_NUMBER = Possession_Number_Min
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
CASE Purchase_Number_Standard+11
	PURCHASE_NUMBER = Possession_Number_Max
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
CASE Purchase_Number_Standard-10 TO Purchase_Number_Standard+10
	PURCHASE_NUMBER = LIMIT(PURCHASE_NUMBER + CHOICE - Purchase_Number_Standard, 1, Possession_Number_Max)
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
CASEELSE
	;売ってない番号を選択したらやり直し
	IF ITEMSALES:CHOICE == 0
		SELECTCASE ITEMNAME:CHOICE
		CASE "極太振動棒", "腕型振動棒", "馬型振動棒"
			SIF ITEM:振動棒套装 == 0
				PRINTFORMW 只有购买了『振動棒套装』的客人才可以购买大型振动棒。
		ENDSELECT

		CLEARLINE LINECOUNT - MEMO_LINECOUNT
		RESTART
	ENDIF
	;今買った物
	STR:購入道具 = %ITEMNAME:CHOICE%

	IF ARG == TARGET
		CALL KOJO_SHOP, "商品購入"
		;何を買わされたかフラグON
		CALL SET_SEVENT, ITEMNAME:CHOICE
	ENDIF

	CALL CALC_COUNT_BUYABLE(CHOICE, PURCHASE_NUMBER, Possession_Number_Min, Possession_Number_Max)
	IF RESULT != PURCHASE_NUMBER
		PURCHASE_NUMBER = RESULT
		CALL PRINT_STRL, @"黄色_%RESULTS%"
	ENDIF

	SELECTCASE CHOICE
	;大人のおもちゃ
	CASE 0 TO 29
		;+値は最初の1個購入時点で+0なので所持数+購入数-1
		PRINTFORMW ＜%ITEMNAME:CHOICE%\@ ITEM:CHOICE + PURCHASE_NUMBER > 1 ? +{ITEM:CHOICE + PURCHASE_NUMBER - 1}#\@を購入しました＞
		IF !ITEM:CHOICE
			;補足があるならここで
			SELECTCASE ITEMNAME:CHOICE
			CASE "振動棒套装"
				PRINTFORMW 普通尺寸的、稍微大一点的、双頭振動棒的三个一套的套装。
			CASE "拘束具"
				PRINTFORMW 各種拘束道具、縄、口枷、眼罩的组合套装。
			CASE "尿道探针"
				PRINTFORML □ 補足 □---------------------------------------------------------------------
				PRINTFORM 在對尿道進行擴張的時候、如果具有
				CALL PRINT_COLORTEXT, "[性器拡張知識]", DEF_COLOR("黄色")
				PRINTFORM 或
				CALL PRINT_COLORTEXT, "[拡張適性]", DEF_COLOR("黄色")
				PRINTFORML 的话会更容易出現進展。
				PRINTFORM 尽管并不是对拡張的容易度有影響的素質、
				CALL PRINT_COLORTEXT, "[倒錯的]", DEF_COLOR("黄色")
				PRINTFORML 有这些的话就可以抑制反感
				PRINTFORML
				PRINTFORML 尿道的快感是、初期的時候疼痛非常强烈而没有快感
				PRINTFORML 随着経験的累积、痛苦会減少、习惯被玩弄尿道之后就没问题了
				PRINTFORM 积累了因为玩弄尿道而絶頂的経験之后、
				CALL PRINT_COLORTEXT, "[尿道性感]", DEF_COLOR("黄色")
				PRINTFORML 就可以觉醒出来了
				CALL PRINT_COLORTEXT, "[尿道性感]", DEF_COLOR("黄色")
				PRINTFORMW 没有的话就基本上不怎么能变舒服、所以请尽早取得
			ENDSELECT
		ENDIF

		ITEM:CHOICE += PURCHASE_NUMBER
		MONEY -= ITEMPRICE:CHOICE * PURCHASE_NUMBER

		IF GETBIT(FLAG:ITEM_SHOP, 0) == 0
			PRINTL
			PRINTFORMW ……店員从里面拿出了贴着『%ITEMNAME:CHOICE% +{ITEM:CHOICE}』的商品摆在了同一个位置。
			PRINTFORMW 看起来、越买就越会出现质量更好的东西的様子(会把不需要的东西替换掉)。
			CALL PRINT_STR, "詳细地问了一下、_黄色_+X的玩具大概会增加X成的舒服程度_的様子。_W_"
			SETBIT FLAG:ITEM_SHOP, 0
		ENDIF
	;調教道具
	CASE 30 TO 49
		;+値は最初の1個購入時点で+0なので所持数+購入数-1
		PRINTFORMW ＜%ITEMNAME:CHOICE%\@ ITEM:CHOICE + PURCHASE_NUMBER > 1 ? +{ITEM:CHOICE + PURCHASE_NUMBER - 1}#\@を購入しました＞

		ITEM:CHOICE += PURCHASE_NUMBER
		MONEY -= ITEMPRICE:CHOICE * PURCHASE_NUMBER

		IF GETBIT(FLAG:ITEM_SHOP, 1) == 0
			PRINTL
			PRINTFORMW ……店員从里面拿出了贴着『%ITEMNAME:CHOICE% +{ITEM:CHOICE}』的商品摆在了同一个位置。
			PRINTFORMW 看起来、越买就越会出现质量更好的东西的様子(会把不需要的东西替换掉)。
			CALL PRINT_STR, "詳细地问了一下、_黄色_+X的調教道具大概会減少X値左右的反感_的様子。_W_"
			SETBIT FLAG:ITEM_SHOP, 1
		ENDIF
	CASE 54
			PRINTFORMW 在店里打发了时间
	;潤滑液など、消耗品
	CASE 50 TO 59
		PRINTFORMW ＜购买了%ITEMNAME:CHOICE%{PURCHASE_NUMBER}套件（\@ PURCHASE_NUMBER > 1 ? {PURCHASE_NUMBER*5}個#５個\@）＞

		ITEM:CHOICE += 5 * PURCHASE_NUMBER
		MONEY -= ITEMPRICE:CHOICE * 5 * PURCHASE_NUMBER
	;使用道具、素質道具
	CASEELSE
		CALL USE_ITEM
	ENDSELECT

	IF COND("買い物同伴中")
		;今買った物を記録
		SIF CSTR:SHOP_BUY履歴 == ""
			CSTR:SHOP_BUY履歴 = /
		CSTR:SHOP_BUY履歴 = %CSTR:SHOP_BUY履歴%%ITEMNAME:CHOICE%\/

		;角色同伴なら反応あったり
		SIF ARG != TARGET
			CALL KOJO_SHOP, "店内待機"

		;partnerが買ってくれるのは一回だけ
		IF ARG == TARGET
			PRINTL
			PRINTFORMW 接下来就是%CALLNAME:MASTER%来继续买东西了。
			ARG = MASTER
			;買い物同伴相手が購入フラグON
			SETBIT FLAG:状況判定, 25
		ENDIF
	ENDIF
	PURCHASE_NUMBER = Possession_Number_Min
ENDSELECT

RESTART

;-------------------------------------------------
;道具購入可能数
;@RETURN RESULT 道具購入可能数
;               ITEMPRICEが0のときは最小購入数を返す
;@RETURN RESULTS 道具購入可能数が指定より減少した場合にユーザーに表示するエラー文章
;                指定が通る場合は空文字列を返す
;-------------------------------------------------
@CALC_COUNT_BUYABLE, CHOICE, PURCHASE_NUMBER, Possession_Number_Min, Possession_Number_Max
#DIM CHOICE
#DIM PURCHASE_NUMBER
#DIM Possession_Number_Min
#DIM Possession_Number_Max
#DIM PRICE
#DIM LIMIT_BY_MONEY
#DIM LIMIT_BY_NUMBER
#DIM IS_CONSUMABLE

SIF ITEMPRICE:CHOICE == 0
	RETURN Possession_Number_Min
IS_CONSUMABLE = 50 <= CHOICE && CHOICE <= 59
PURCHASE_NUMBER = LIMIT(PURCHASE_NUMBER, Possession_Number_Min, Possession_Number_Max)

;消耗品(50-59番)は5個組販売
PRICE = IS_CONSUMABLE ? ITEMPRICE:CHOICE*5 # ITEMPRICE:CHOICE
LIMIT_BY_MONEY = MONEY/PRICE
LIMIT_BY_NUMBER  = IS_CONSUMABLE ? (Possession_Number_Max - ITEM:CHOICE)/5 # Possession_Number_Max - ITEM:CHOICE

IF PURCHASE_NUMBER == MIN(PURCHASE_NUMBER, LIMIT_BY_MONEY, LIMIT_BY_NUMBER)
	RESULTS '= ""
	RETURN PURCHASE_NUMBER
ENDIF

;所持金制限と所持数制限が同じ場合は所持数制限のメッセージを優先するほうが分かりやすいか
IF LIMIT_BY_MONEY < LIMIT_BY_NUMBER
	PURCHASE_NUMBER = LIMIT_BY_MONEY
	RESULTS '= @"因为所持金不足只能购买{PURCHASE_NUMBER}\@ IS_CONSUMABLE ? 套 # 個 \@"
ELSE
	PURCHASE_NUMBER = LIMIT_BY_NUMBER
	RESULTS '= @"因为所持数制限（最大{Possession_Number_Max}個）只能购买{PURCHASE_NUMBER}\@ IS_CONSUMABLE ? 套 # 個 \@"
ENDIF
RETURN PURCHASE_NUMBER

;-------------------------------------------------
;道具使用
;-------------------------------------------------
@USE_ITEM, ARGS
#DIM LCOUNT
#DIM CHOICE, 2
#DIM MEMO, 10
#DIM MEMO_LINECOUNT
#DIMS TEXT_AFTERBUY

TEXT_AFTERBUY =
MEMO_LINECOUNT = LINECOUNT

DRAWLINE
SELECTCASE STR:購入道具
CASE "避妊の護符"
	IF TALENT:MASTER:避妊の護符
		PRINTFORML 要破坏%CALLNAME:MASTER%身上的避妊の護符吗？
	ELSE
		PRINTFORML 要穿上避妊の護符吗？
		CALL PRINT_STRL, "※有着避妊魔法的Ｔ字形的小小的護符。_爱心粉紅_効果永続、穿戴在子宫之中_※"
	ENDIF
	CALL PRINT_SELECT, "是/否"
	SIF RESULT
		RETURN 0
	;付けている場合には取下
	IF TALENT:MASTER:避妊の護符
		PRINTFORMW ＜拽了一下%CALLNAME:MASTER%的子宮口里垂下的绳子、避妊の護符被破壊了＞
		TALENT:MASTER:避妊の護符 = 0
	ELSE
		PRINTFORML ＜%CALLNAME:MASTER%的子宮戴上了避妊の護符＞
		PRINTFORMW 从子宮口里垂下了一条用来去除護符的柔软的绳子…
		;即座に避妊の効果が出る
		CALL SETFLAG, "妊娠フラグ消去", MASTER
		TALENT:MASTER:避妊の護符 = 1
	ENDIF
	MONEY -= ITEMPRICE:(STR:購入道具)
	RETURN 1
CASE "口服避孕薬"
	PRINTFORMW ＜口服避孕薬买了7个＞
	CFLAG:MASTER:口服避孕薬 = 1
	TALENT:MASTER:口服避孕薬派 = 1
	ITEM:(STR:購入道具) += 7
	MONEY -= ITEMPRICE:(STR:購入道具)*7
	RETURN 1
CASE "事后避孕药"
	PRINTFORML 要喝事后避孕药吗？（能够防止现在受精了的卵子着床）
	CALL PRINT_SELECT, "是/否"
	SELECTCASE RESULT
	CASE 0
		PRINTFORMW %CALLNAME:MASTER%喝下了事后避孕药。
		CALL SETFLAG, "事后避孕药", MASTER
		MONEY -= ITEMPRICE:(STR:購入道具)
		RETURN 1
	CASE 1
		RETURN 0
	ENDSELECT
CASE "脱毛剤"
	PRINTFORML 要脱陰毛还是%TEXTS("腋")%毛？
	IF COND("陰毛", MASTER) <= 3
		CALL PRINT_STRL, @"灰色_ [×] 陰毛　（現在は：%CONDS("陰毛", MASTER)%）"
	ELSE
		PRINTFORML  [ 0] 陰毛　（現在は：%CONDS("陰毛", MASTER)%）
	ENDIF
	IF COND("腋毛", MASTER) <= 3
		CALL PRINT_STRL, @"灰色_ [×] %TEXTS("腋")%毛　（現在は：%CONDS("腋毛", MASTER)%）"
	ELSE
		PRINTFORML  [ 1] %TEXTS("腋")%毛　（現在は：%CONDS("腋毛", MASTER)%）
	ENDIF
	PRINTFORML [100] 果然还是算了
	CALL INPUT_SELECT, 2, 100
	SELECTCASE RESULT
	CASE 100
		RETURN 0
	CASE 0
		IF COND("陰毛", MASTER) <= 3
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
		BASE:MASTER:陰毛 = 200
		TEXT_AFTERBUY = %CALLNAME:MASTER%の陰毛が[%CONDS("陰毛", MASTER)%]变成了！
	CASE 1
		IF COND("腋毛", MASTER) <= 3
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
		BASE:MASTER:腋毛 = 200
		TEXT_AFTERBUY = %CALLNAME:MASTER%の腋毛が[%CONDS("腋毛", MASTER)%]变成了！
	ENDSELECT
	MONEY -= ITEMPRICE:(STR:購入道具)

CASE "生毛薬"
	PRINTFORML 要长陰毛还是%TEXTS("腋")%毛？
	IF COND("陰毛", MASTER) >= 7
		CALL PRINT_STRL, @"灰色_ [×] 陰毛　（現在は：%CONDS("陰毛", MASTER)%）"
	ELSE
		PRINTFORML  [ 0] 陰毛　（現在は：%CONDS("陰毛", MASTER)%）
	ENDIF
	IF COND("腋毛", MASTER) >= 7
		CALL PRINT_STRL, @"灰色_ [×] %TEXTS("腋")%毛　（現在は：%CONDS("腋毛", MASTER)%）"
	ELSE
		PRINTFORML  [ 1] %TEXTS("腋")%毛　（現在は：%CONDS("腋毛", MASTER)%）
	ENDIF
	PRINTFORML [100] 果然还是算了
	CALL INPUT_SELECT, 2, 100
	SELECTCASE RESULT
	CASE 100
		RETURN 0
	CASE 0
		IF COND("陰毛", MASTER) >= 7
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
		BASE:MASTER:陰毛 = BASE:MASTER:陰毛/100*100 + 100
		SELECTCASE BASE:MASTER:陰毛
		CASE 300
			BASE:MASTER:陰毛 += 100
		ENDSELECT
		TEXT_AFTERBUY = %CALLNAME:MASTER%の陰毛が[%CONDS("陰毛", MASTER)%]变成了！

	CASE 1
		IF COND("腋毛", MASTER) >= 7
			CLEARLINE LINECOUNT - MEMO_LINECOUNT
			RESTART
		ENDIF
		BASE:MASTER:腋毛 = BASE:MASTER:腋毛/100*100 + 100
		SELECTCASE BASE:MASTER:腋毛
		CASE 300, 500
			BASE:MASTER:腋毛 += 100
		ENDSELECT
		TEXT_AFTERBUY = %CALLNAME:MASTER%の腋毛が[%CONDS("腋毛", MASTER)%]变成了！
	ENDSELECT
	MONEY -= ITEMPRICE:(STR:購入道具)

ENDSELECT

PRINTFORMW %TEXT_AFTERBUY%
CALL SETFLAG, "道具フラグ調整"
IF ITEMSALES:(STR:購入道具)
	CLEARLINE LINECOUNT - MEMO_LINECOUNT
	PRINTFORML %TEXT_AFTERBUY%
	RESTART
ENDIF
RETURN 1

VARSET LOCAL
FOR LCOUNT, 1, CHARANUM
	LOCAL:LCOUNT = 0

	;登録番号・名前・体力・其他ステータスをまとめて表示
	SELECTCASE STR:購入道具
	CASE "脱毛剤"
		SIF COND("陰毛", LCOUNT) <= 2 && COND("腋毛", LCOUNT) <= 2
			CONTINUE
		CALL PRINT_NUM_NAME, "陰毛＆腋毛", LCOUNT
	CASE "生毛薬"
		SIF (COND("陰毛", LCOUNT) == 0 || COND("陰毛", LCOUNT) >= 7) && (COND("腋毛", LCOUNT) == 0 || COND("腋毛", LCOUNT) >= 7)
			CONTINUE
		CALL PRINT_NUM_NAME, "陰毛＆腋毛", LCOUNT
	CASE "避妊の護符"
		SIF TALENT:LCOUNT:妊娠 || TALENT:LCOUNT:処女 || TALENT:LCOUNT:Ｖ妊娠不能 || COND("着床確認", LCOUNT)
			CONTINUE
		CALL PRINT_NUM_NAME, "避妊措置", LCOUNT
	CASEELSE
		CALL PRINT_NUM_NAME, "能力表示", LCOUNT
	ENDSELECT

	LOCAL:LCOUNT = 1
NEXT
PRINTL  [100]返回

$INPUT_LOOP
INPUT

IF RESULT == 100
	RETURN 0
ELSEIF RESULT < MASTER || RESULT >= CHARANUM
	GOTO INPUT_LOOP
ELSEIF LOCAL:RESULT == 0
	GOTO INPUT_LOOP
ENDIF

;選択角色をCHOICEに保存
CHOICE = RESULT

;お会計はSELECTCASEの終了後なので、RESTARTさせる場合にはその前に代金を頂くこと
SELECTCASE STR:購入道具
;陰毛を生やす
CASE "生毛薬"
	IF COND("陰毛", CHOICE) == 0 || COND("陰毛", CHOICE) >= 7
		RESULT = 1
	ELSEIF COND("腋毛", CHOICE) == 0 || COND("腋毛", CHOICE) >= 7
		RESULT = 0
	ELSE
		PRINTFORML 要长陰毛还是%TEXTS("腋")%毛？
		PRINTFORML [ 0] 陰毛
		PRINTFORML [ 1] %TEXTS("腋")%毛
		CALL INPUT_SELECT, 2
	ENDIF
	IF RESULT == 0
		PRINTFORMW ＜%CALLNAME:CHOICE%的阴部的毛生长了＞
		SELECTCASE COND("陰毛", CHOICE)
		CASE IS <= 5
			BASE:CHOICE:陰毛 = 600
		CASE 6
			BASE:CHOICE:陰毛 = 700
		ENDSELECT
	ELSE
		PRINTFORMW ＜%CALLNAME:CHOICE%的%TEXTS("腋")%毛生长了＞
		BASE:CHOICE:腋毛 = 700
	ENDIF
	SIF COND("種族：人形", CHOICE)
		PRINTFORMW 然而、因为%CALLNAME:CHOICE%是人偶所以并不能无法生长。
;陰毛を失くす
CASE "脱毛剤"
	IF COND("陰毛", CHOICE) <= 2
		RESULT = 1
	ELSEIF COND("腋毛", CHOICE) <= 2
		RESULT = 0
	ELSE
		PRINTFORML 要脱陰毛还是%TEXTS("腋")%毛？
		PRINTFORML [ 0] 陰毛
		PRINTFORML [ 1] %TEXTS("腋")%毛
		CALL INPUT_SELECT, 2
	ENDIF
	IF RESULT == 0
		PRINTFORMW ＜%CALLNAME:CHOICE%的阴部脱毛了＞
		BASE:CHOICE:陰毛 = 200
		;人形なら、白虎化
		SIF COND("種族：人形", CHOICE)
			BASE:CHOICE:陰毛 = 100
	ELSE
		PRINTFORMW ＜%CALLNAME:CHOICE%の%TEXTS("腋")%毛脱毛了＞
		BASE:CHOICE:腋毛 = 200
		SIF COND("種族：人形", CHOICE)
			BASE:CHOICE:腋毛 = 100
	ENDIF
;避妊の護符
CASE "避妊の護符"
	;付けている場合には取下
	IF TALENT:CHOICE:避妊の護符
		PRINTFORMW ＜拽了一下%CALLNAME:CHOICE%的子宮口里垂下的绳子、避妊の護符被破壊了＞
		TALENT:CHOICE:避妊の護符 = 0
	ELSE
		PRINTFORML ＜%CALLNAME:CHOICE%的子宮内装备了避妊の護符＞
		PRINTFORMW 从子宮口里垂下了一条用来去除護符的柔软的绳子…
		;即座に避妊の効果が出る
		CALL SETFLAG, "妊娠フラグ消去", CHOICE
		TALENT:CHOICE:避妊の護符 = 1
		MONEY -= ITEMPRICE:(STR:購入道具)
	ENDIF

	SWAP TARGET, CHOICE
	CALL KOJO_EVENT, "避妊の護符"
	SWAP TARGET, CHOICE

	IF MONEY >= ITEMPRICE:(STR:購入道具)
		RESTART
	ELSE
		RETURN 0
	ENDIF
ENDSELECT

;代金はここで支払う（一部例外有）
MONEY -= ITEMPRICE:(STR:購入道具)

license: unknown


code:
;ARGには作成する角色のNO、ARGSは名前が変更された場合にはそれが入っている
@CHARA_MANUAL, ARG, ARGS
#DIM MEMO_FLAG

MEMO_FLAG = FLAG:項目OFF
STR:髪記録 =
STR:表情記録 =
STR:淫紋記録 =
FLAG:項目OFF = 0

CALL CHARA_MANUAL_MAIN, ARG, ARGS

FLAG:項目OFF = MEMO_FLAG
STR:髪記録 =
STR:表情記録 =
STR:淫紋記録 =
SIF RESULT
	RETURN 1
RETURN 0

@CHARA_MANUAL_MAIN, ARG, ARGS
#DIMS CHOICES
#DIM ACTOR

;解説、弱点、性格、難易度、助手能力表示
CALL PROFILE, ARG, ARGS

ACTOR = CHARANUM-1
IF FLAG:オープニング
	CALL PRINT_STRL, "NOBUTTON_这様可以吗？（[ 3]～[ 4]在設定後也会随机属性）"
	IF ACTOR == MASTER
		CALL PRINT_STRL, "[ 0]是　_NOBUTTON_[×]否　_[ 2]随机属性　[ 3]素質的操作　[ 4]Config"
	ELSE
		CALL PRINT_STRL, @"[ 0]是　_NOBUTTON_[×]否　_[ 2]随机属性　[ 3]素質的操作　[ 4]Config　[ 5]\@ CFLAG:ACTOR:颜绘 ? 変更 # 設定 \@颜绘"
	ENDIF
ELSE
	IF COND("種族：悪魔", ACTOR) && COND("基本情報隠蔽", ACTOR) == 0
		PRINTPLAINFORM 这个悪魔可以吗？（[ 3]～[ 4]在設定後也会随机属性）
	ELSEIF CSTR:ACTOR:学年 == "初等部" && COND("基本情報隠蔽", ACTOR) == 0
		PRINTPLAINFORM 这孩子可以吗？（[ 3]～[ 4]在設定後也会随机属性）
	ELSE
		PRINTPLAINFORM 这个人可以吗？（[ 3]～[ 4]在設定後也会随机属性）
	ENDIF
	PRINTL
	IF ACTOR == MASTER
		PRINTFORML [ 0]是　[ 1]否　[ 2]随机属性　[ 3]素質の操作　[ 4]Config
	ELSE
		IF MARK:ACTOR:淫紋
			PRINTFORML [ 0]是　[ 1]否　[ 2]随机属性　[ 3]素質的操作　[ 4]Config　[ 5]\@ CFLAG:ACTOR:颜绘 ? 変更 # 設定 \@颜绘 [ 6]淫紋変更
		ELSE
			PRINTFORML [ 0]是　[ 1]否　[ 2]随机属性　[ 3]素質的固定与除外　[ 4]Config　[ 5]\@ CFLAG:ACTOR:颜绘 ? 変更 # 設定 \@颜绘
		ENDIF
	ENDIF
ENDIF

SIF ISSKIP()
	RETURN 1

INPUTS
CHOICES = %RESULTS%

SELECTCASE CHOICES
CASE "0"
	RETURN 1
CASE "1"
	IF FLAG:オープニング == 0
		;紹介文既読フラグOFF
		CLEARBIT FLAG:状況判定, 12
		RETURN 0
	ENDIF
CASE "3"
	CALL FIX_TALENT
CASE "4"
	CALL SET_CONFIGURE, "角色定制関連"
CASE "5"
	IF ACTOR == MASTER
	ELSE
		CALL SIMULATE_MAIDFACE, ACTOR
		CALL SETFLAG, "髪の記録", ACTOR
		CALL SETFLAG, "表情の記録", ACTOR
	ENDIF
CASE "6"
	IF MARK:ACTOR:淫紋
		PRINTL
		PRINTFORML ※現段階是LV{MARK:ACTOR:淫紋}、可以通过其他选择来确认淫纹画数增加时的形状※
		CALL SIMULATE_INMON, ACTOR

		STR:淫紋記録 = 淫紋：%CONDS("淫紋の種類", ACTOR)%
	ENDIF
;項目ONOFFボタン
CASE "搾精排行"
	INVERTBIT FLAG:項目OFF, 0
CASE "助手的任务指示"
	INVERTBIT FLAG:項目OFF, 1
CASE "角色介绍"
	INVERTBIT FLAG:項目OFF, 2
CASE "身嗜み"
	INVERTBIT FLAG:項目OFF, 3
CASE "服装詳細"
	INVERTBIT FLAG:項目OFF, 4
CASE "合意"
	INVERTBIT FLAG:項目OFF, 5
CASE "性癖・弱点"
	INVERTBIT FLAG:項目OFF, 6
CASE "自室の状態"
	INVERTBIT FLAG:項目OFF, 7
CASE "属性与外表"
	INVERTBIT FLAG:項目OFF, 8
CASE "宝珠"
	INVERTBIT FLAG:項目OFF, 9
CASE "経験"
	INVERTBIT FLAG:項目OFF, 10
CASE "胖次收藏"
	INVERTBIT FLAG:項目OFF, 11
CASE "能力"
	INVERTBIT FLAG:項目OFF, 12
CASE "刻印"
	INVERTBIT FLAG:項目OFF, 13
CASE "素質"
	INVERTBIT FLAG:項目OFF, 14
CASE "家族構成"
	INVERTBIT FLAG:項目OFF, 15
CASE "相性"
	INVERTBIT FLAG:項目OFF, 16
CASE "性処理"
	INVERTBIT FLAG:項目OFF, 17
CASE "射精排行"
	INVERTBIT FLAG:項目OFF, 18
CASE "所持道具一覧"
	INVERTBIT FLAG:項目OFF, 19
CASE "特記事項"
	INVERTBIT FLAG:項目OFF, 20
CASE "特別経験"
	;(21, 22)が(0, 0)通常簡易表示→(1, 0)詳細表示→(1, 1)項目OFF→(0, 0)…と阴蒂ック毎に変化する
	IF GETBIT(FLAG:項目OFF, 21) == 0
		INVERTBIT FLAG:項目OFF, 21
	ELSEIF GETBIT(FLAG:項目OFF, 22) == 0
		INVERTBIT FLAG:項目OFF, 22
	ELSE
		INVERTBIT FLAG:項目OFF, 21
		INVERTBIT FLAG:項目OFF, 22
	ENDIF
CASE "平常的装扮"
	INVERTBIT FLAG:項目OFF, 23
CASE "出産の記録"
	INVERTBIT FLAG:項目OFF, 24
ENDSELECT

;表示されていた角色を白紙に戻す
DELCHARA ACTOR
CLEARLINE LINECOUNT - TFLAG:LINECOUNT_PROFILE
RESTART

;ARGには作成する角色のNO、ARGSは名前が変更されている場合にはそれが入っている
@PROFILE, ARG, ARGS
#DIM LCOUNT
#DIM LCOUNT2
#DIM MEMO_TARGET
#DIM MEMO_MASTER
;角色メイクの時の固定素質
#DIMS TALENT_FIX
;角色メイクの時の除外素質
#DIMS TALENT_RMV

ADDCHARA ARG

REDRAW 0

MEMO_TARGET = TARGET

TARGET = CHARANUM-1

CALL EVENT_PROFILE, "能力変化", TARGET

SIF CALLNAME:TARGET == ""
	CALLNAME:TARGET = %NAME:TARGET%

;いくつかの先に固定処理しておいた方が良い素質を処理（経験などに絡むもの）
;性別変化は角色によっては禁止
IF TALENT:性反転 || TALENT:具現 || TALENT:男性 || CSVTALENT(NO:TARGET, GETNUM(TALENT, "扶她") )
ELSE
	IF CEVENT("固定：扶她", MASTER)
		TALENT:扶她 = 1
		TALENT:男性 = 0
		TALENT:女性 = 0
	ELSEIF CEVENT("除外：扶她", MASTER)
		TALENT:扶她 = 0
		TALENT:女性 = 1
	ENDIF
ENDIF
IF CEVENT("固定：処女", MASTER) && TALENT:男性 == 0
	TALENT:処女 = 1
ELSEIF CEVENT("除外：処女", MASTER) && TALENT:男性 == 0
	TALENT:処女 = 0
ENDIF
IF CEVENT("固定：童貞", MASTER) && PENIS(TARGET)
	TALENT:童貞 = 1
ELSEIF CEVENT("除外：童貞", MASTER) && PENIS(TARGET)
	TALENT:童貞 = 0
ENDIF
IF CEVENT("固定：性経験皆無", MASTER)
	SIF PENIS(TARGET)
		TALENT:童貞 = 1
	SIF TALENT:男性 == 0
		TALENT:処女 = 1
ENDIF
;３围設定に絡むもの
IF CEVENT("固定：苗条", MASTER)
	TALENT:苗条 = 1
	TALENT:豐腴 = 0
ELSEIF CEVENT("除外：苗条", MASTER)
	TALENT:苗条 = 0
ELSEIF CEVENT("固定：豐腴", MASTER)
	TALENT:豐腴 = 1
	TALENT:苗条 = 0
ELSEIF CEVENT("除外：豐腴", MASTER)
	TALENT:豐腴 = 0
ENDIF

CALL CHANGE_TALENT, TARGET
CALL SETFLAG, "識別番号", TARGET
CALL RESET_EXP_GAIN, TARGET
CALL GET_EXABL, TARGET
CALL GET_EXTALENT, TARGET
CALL SET_3SIZE, TARGET
CALL SETFLAG, "陰毛と腋毛", TARGET
CALL SETFLAG, "乳頭の詳細設定", TARGET
CALL SETFLAG, "陰核の詳細設定", TARGET
CALL SETFLAG, "阴茎詳細設定", TARGET
CALL VARSET_MAIDFACE, TARGET

IF COND("角色メイク中")
	SIF STR:髪記録 != ""
		CALL SETFLAG, "髪記録からの復元", TARGET
	SIF STR:表情記録 != ""
		CALL SETFLAG, "表情記録からの復元", TARGET
	IF STR:淫紋記録 != ""
		CALL DEL_CEVENT_GROUP, "淫紋", TARGET
		CALL SET_CEVENT, STR:淫紋記録, TARGET
	ENDIF
ENDIF
SIF STR:髪記録 != "" || STR:表情記録 != ""
	CFLAG:颜绘 = 1

;身高の固定と除外は先に行う
IF CEVENT("固定：高大", MASTER)
	CALL CALC, "高大化", TARGET
ELSEIF CEVENT("除外：高大", MASTER)
	SIF TALENT:高大
		CALL CALC, "普通体型化", TARGET
ELSEIF CEVENT("固定：娇小", MASTER)
	CALL CALC, "娇小化", TARGET
ELSEIF CEVENT("除外：娇小", MASTER)
	SIF TALENT:娇小
		CALL CALC, "普通体型化", TARGET
ENDIF

;３围設定に絡むもの
IF CEVENT("除外：苗条", MASTER)
	IF COND("苗条")
		FOR LCOUNT, 0, 100
			SIF COND("苗条") == 0
				BREAK
			BASE:腰圍 += BASE:身高*2/100
		NEXT
	ENDIF
ELSEIF CEVENT("除外：豐腴", MASTER)
	IF COND("豐腴")
		FOR LCOUNT, 0, 100
			SIF COND("豐腴") == 0
				BREAK
			BASE:腰圍 -= BASE:身高*2/100
		NEXT
	ENDIF
ENDIF

;角色メイク時の素質固定or除外を行う
VARSET LOCALS
SPLIT TEXTS("固定可能な素質"), "/", LOCALS

FOR LCOUNT, 0, 100
	SIF LOCALS:LCOUNT == ""
		BREAK

	TALENT_FIX = 固定：%LOCALS:LCOUNT%
	TALENT_RMV = 除外：%LOCALS:LCOUNT%

	;固定素質
	IF CEVENT(TALENT_FIX, MASTER)
		SELECTCASE LOCALS:LCOUNT
		CASE "筋肉"
			SIF TALENT:筋肉
				CONTINUE
			TALENT:筋肉 = 1
		CASE "乳頭肥大"
			SIF TALENT:乳頭肥大
				CONTINUE
			TALENT:乳頭肥大 = 1
		CASE "陥没乳頭"
			SIF TALENT:陥没乳頭
				CONTINUE
			TALENT:陥没乳頭 = 1
		CASE "巨乳輪"
			SIF TALENT:巨乳輪
				CONTINUE
			TALENT:巨乳輪 = 1
		CASE "陰核肥大"
			SIF TALENT:陰核肥大
				CONTINUE
			TALENT:陰核肥大 = 1
		CASE "陰核包茎"
			SIF TALENT:陰核包茎
				CONTINUE
			TALENT:陰核包茎 = 1
		CASE "短小"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:阴茎 = 0
		CASE "並根"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:阴茎 = 1
		CASE "巨根"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:阴茎 = 2
		CASE "馬根"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:阴茎 = 3
		CASE "真性包茎"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:包茎 = 2
		CASE "假性包茎"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:包茎 = 1
		CASE "露茎"
			SIF PENIS(TARGET) == 0
				CONTINUE
			TALENT:包茎 = 0
		CASE "貧乳"
			SIF TALENT:男性
				CONTINUE
			CALL CALC, "貧乳化", TARGET
		CASE "並乳"
			SIF TALENT:男性
				CONTINUE
			CALL CALC, "並乳化", TARGET
		CASE "巨乳"
			SIF TALENT:男性
				CONTINUE
			CALL CALC, "巨乳化", TARGET
		CASE "爆乳"
			SIF TALENT:男性
				CONTINUE
			CALL CALC, "爆乳化", TARGET
		CASE "超乳"
			SIF TALENT:男性
				CONTINUE
			CALL CALC, "超乳化", TARGET
		CASE "小尻"
			SIF COND("小尻")
				CONTINUE

			TALENT:巨尻 = 0
			FOR LCOUNT2, 0, 100
				SIF COND("小尻")
					BREAK
				BASE:臀圍 -= BASE:身高*2/100
			NEXT
			TALENT:小尻 = 1
		CASE "並尻"
			IF COND("小尻")
				TALENT:小尻 = 0
				FOR LCOUNT2, 0, 100
					SIF COND("小尻") == 0
						BREAK
					BASE:臀圍 += BASE:身高*2/100
				NEXT
			ELSEIF COND("巨尻")
				TALENT:巨尻 = 0
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") == 0
						BREAK
					BASE:臀圍 -= BASE:身高*2/100
				NEXT
			ENDIF
		CASE "巨尻"
			SIF COND("巨尻") == 1
				CONTINUE

			IF COND("巨尻") == 0
				TALENT:小尻 = 0
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻")
						BREAK
					BASE:臀圍 += BASE:身高*2/100
				NEXT
			ELSE
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") <= 1
						BREAK
					BASE:臀圍 -= BASE:身高*2/100
				NEXT
			ENDIF
			TALENT:巨尻 = 1
		CASE "爆尻"
			SIF COND("巨尻") == 2
				CONTINUE

			IF COND("巨尻") <= 1
				TALENT:小尻 = 0
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") >= 2
						BREAK
					BASE:臀圍 += BASE:身高*2/100
				NEXT
			ELSE
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") <= 2
						BREAK
					BASE:臀圍 -= BASE:身高*2/100
				NEXT
			ENDIF
			TALENT:巨尻 = 2
		CASE "超尻"
			SIF COND("巨尻") == 3
				CONTINUE

			TALENT:小尻 = 0
			FOR LCOUNT2, 0, 100
				SIF COND("巨尻") == 3
					BREAK
				BASE:臀圍 += BASE:身高*2/100
			NEXT
			TALENT:巨尻 = 3
		CASE "褐色肌"
			TALENT:肤色 = 1
		CASE "色白"
			TALENT:肤色 = 2
		CASE "青肌"
			TALENT:肤色 = 3
		CASE "色黒"
			TALENT:肤色 = 4
		CASE "萝莉"
			TALENT:外見年齢 = 1
		CASE "少女"
			TALENT:外見年齢 = 2
		CASE "大姐姐"
			TALENT:外見年齢 = 3
		CASE "大人"
			TALENT:外見年齢 = 4
		CASE "美穴"
			SIF TALENT:男性 || TALENT:性器年齢 == 1
				CONTINUE
			TALENT:性器年齢 = MAX(TALENT:性器年齢 -1, 1)
		CASE "色素沉淀（弱）"
			SIF TALENT:男性
				CONTINUE
			TALENT:性器年齢 = 2
		CASE "色素沉淀"
			SIF TALENT:男性
				CONTINUE
			TALENT:性器年齢 = 3
		CASE "色素沉淀（強）"
			SIF TALENT:男性
				CONTINUE
			TALENT:性器年齢 = 4
		CASE "黑木耳"
			SIF TALENT:男性
				CONTINUE
			TALENT:性器年齢 = 5
		;男性でないなら追加
		CASE "母乳体質", "子宮性感"
			SIF TALENT:男性 == 0
				TALENT:(LOCALS:LCOUNT) = 1
		;阴茎が無いなら追加
		CASE "絶頂失禁体質"
			SIF PENIS(TARGET) == 0
				TALENT:(LOCALS:LCOUNT) = 1
		;純粋追加
		CASE "腸液分泌体質", "嘔吐反射耐性", "拡張適性", "喉性感", "尿道性感", "气味弱点", "発情体質"
			TALENT:(LOCALS:LCOUNT) = 1
		ENDSELECT
	;除外素質
	ELSEIF CEVENT(TALENT_RMV, MASTER)
		SELECTCASE LOCALS:LCOUNT
		CASE "筋肉"
			TALENT:筋肉 = 0
		CASE "乳頭肥大"
			TALENT:乳頭肥大 = 0
		CASE "陥没乳頭"
			TALENT:陥没乳頭 = 0
		CASE "巨乳輪"
			TALENT:巨乳輪 = 0
		CASE "陰核肥大"
			TALENT:陰核肥大 = 0
		CASE "陰核包茎"
			TALENT:陰核包茎 = 0
		CASE "短小"
			SIF PENIS(TARGET) == 0 || SIZE("阴茎", TARGET) != 0
				CONTINUE

			SELECTCASE RAND:10
			CASE 8, 9
				TALENT:阴茎 = 3
			CASE 6, 7
				TALENT:阴茎 = 2
			CASEELSE
				TALENT:阴茎 = 1
			ENDSELECT
		CASE "並根"
			SIF PENIS(TARGET) == 0 || SIZE("阴茎", TARGET) != 1
				CONTINUE

			SELECTCASE RAND:10
			CASE 8, 9
				TALENT:阴茎 = 3
			CASE 4 TO 7
				TALENT:阴茎 = 2
			CASEELSE
				TALENT:阴茎 = 0
			ENDSELECT
		CASE "巨根"
			SIF PENIS(TARGET) == 0 || SIZE("阴茎", TARGET) != 2
				CONTINUE

			SELECTCASE RAND:10
			CASE 7 TO 9
				TALENT:阴茎 = 3
			CASE 3 TO 6
				TALENT:阴茎 = 1
			CASEELSE
				TALENT:阴茎 = 0
			ENDSELECT
		CASE "馬根"
			SIF PENIS(TARGET) == 0 || SIZE("阴茎", TARGET) != 3
				CONTINUE

			SELECTCASE RAND:10
			CASE 5 TO 9
				TALENT:阴茎 = 2
			CASE 1 TO 4
				TALENT:阴茎 = 1
			CASEELSE
				TALENT:阴茎 = 0
			ENDSELECT

		CASE "真性包茎"
			SIF PENIS(TARGET) == 0 || COND("真性包茎") == 0
				CONTINUE

			SIF RAND:3
				TALENT:包茎 = 1
		CASE "假性包茎"
			SIF PENIS(TARGET) == 0 || COND("假性包茎") == 0
				CONTINUE

			SIF RAND:3
				TALENT:包茎 = 2
		CASE "露茎"
			SIF PENIS(TARGET) == 0 || TALENT:包茎
				CONTINUE
			IF RAND:3
				TALENT:包茎 = 1
			ELSE
				TALENT:包茎 = 2
			ENDIF
		CASE "貧乳"
			SIF TALENT:男性 || TALENT:貧乳 == 0
				CONTINUE

			SELECTCASE RAND:10
			CASE 9
				CALL CALC, "超乳化", TARGET
			CASE 8
				CALL CALC, "爆乳化", TARGET
			CASE 7
				CALL CALC, "巨乳化", TARGET
			CASEELSE
				CALL CALC, "並乳化", TARGET
			ENDSELECT
		CASE "並乳"
			SIF TALENT:男性 || TALENT:貧乳 || TALENT:巨乳
				CONTINUE

			SELECTCASE RAND:10
			CASE 8, 9
				CALL CALC, "超乳化", TARGET
			CASE 5 TO 7
				CALL CALC, "爆乳化", TARGET
			CASE 2 TO 4
				CALL CALC, "巨乳化", TARGET
			CASEELSE
				CALL CALC, "貧乳化", TARGET
			ENDSELECT
		CASE "巨乳"
			SIF TALENT:男性 || TALENT:巨乳 != 1
				CONTINUE

			SELECTCASE RAND:10
			CASE 7 TO 9
				CALL CALC, "超乳化", TARGET
			CASE 4 TO 6
				CALL CALC, "爆乳化", TARGET
			CASE 0
				CALL CALC, "貧乳化", TARGET
			CASEELSE
				CALL CALC, "並乳化", TARGET
			ENDSELECT
		CASE "爆乳"
			SIF TALENT:男性 || TALENT:巨乳 != 2
				CONTINUE

			SELECTCASE RAND:10
			CASE 7 TO 9
				CALL CALC, "超乳化", TARGET
			CASE 4 TO 6
				CALL CALC, "巨乳化", TARGET
			CASE 0
				CALL CALC, "貧乳化", TARGET
			CASEELSE
				CALL CALC, "並乳化", TARGET
			ENDSELECT
		CASE "超乳"
			SIF TALENT:男性 || TALENT:巨乳 != 3
				CONTINUE

			SELECTCASE RAND:10
			CASE 7 TO 9
				CALL CALC, "爆乳化", TARGET
			CASE 4 TO 6
				CALL CALC, "巨乳化", TARGET
			CASE 0
				CALL CALC, "貧乳化", TARGET
			CASEELSE
				CALL CALC, "並乳化", TARGET
			ENDSELECT
		CASE "小尻"
			SIF COND("小尻") == 0
				CONTINUE

			TALENT:巨尻 = 0
			FOR LCOUNT2, 0, 100
				SIF COND("小尻") == 0
					BREAK
				BASE:臀圍 += BASE:身高*3/100
			NEXT
			CALL SETFLAG, "臀圍設定", TARGET
		CASE "並尻"
			SIF COND("小尻") || COND("巨尻")
				CONTINUE
			IF RAND:3 == 0
				FOR LCOUNT2, 0, 100
					SIF COND("小尻")
						BREAK
					BASE:臀圍 -= BASE:身高*3/100
				NEXT
			ELSE
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻")
						BREAK
					BASE:臀圍 += BASE:身高*3/100
				NEXT
			ENDIF
			CALL SETFLAG, "臀圍設定", TARGET
		CASE "巨尻"
			SIF COND("巨尻") != 1
				CONTINUE

			IF RAND:2
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") != 1
						BREAK
					BASE:臀圍 += BASE:身高*3/100
				NEXT
			ELSE
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") != 1
						BREAK
					BASE:臀圍 -= BASE:身高*3/100
				NEXT
			ENDIF
			CALL SETFLAG, "臀圍設定", TARGET
		CASE "爆尻"
			SIF COND("巨尻") != 2
				CONTINUE

			IF RAND:2
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") != 2
						BREAK
					BASE:臀圍 += BASE:身高*3/100
				NEXT
			ELSE
				FOR LCOUNT2, 0, 100
					SIF COND("巨尻") != 2
						BREAK
					BASE:臀圍 += BASE:身高*3/100
				NEXT
			ENDIF
			CALL SETFLAG, "臀圍設定", TARGET
		CASE "超尻"
			SIF COND("巨尻") != 3
				CONTINUE

			FOR LCOUNT2, 0, 100
				SIF COND("巨尻") < 3
					BREAK
				BASE:臀圍 -= BASE:身高*3/100
			NEXT
			CALL SETFLAG, "臀圍設定", TARGET
		CASE "褐色肌"
			SIF	TALENT:肤色 == 1
				TALENT:肤色 = 0
		CASE "色白"
			SIF	TALENT:肤色 == 2
				TALENT:肤色 = 0
		CASE "青肌"
			SIF	TALENT:肤色 == 3
				TALENT:肤色 = 0
		CASE "色黒"
			SIF	TALENT:肤色 == 4
				TALENT:肤色 = 0
		CASE "萝莉"
			SIF TALENT:外見年齢 == 1
				TALENT:外見年齢 = 3
		CASE "少女"
			SIF TALENT:外見年齢 == 2
				TALENT:外見年齢 = 3
		CASE "大姐姐"
			SIF TALENT:外見年齢 == 3
				TALENT:外見年齢 = 2
		CASE "大人"
			SIF TALENT:外見年齢 == 4
				TALENT:外見年齢 = 3
		CASE "美穴"
			SIF TALENT:男性
				CONTINUE
			TALENT:性器年齢 = MAX(TALENT:性器年齢, TALENT:外見年齢)
		CASE "色素沉淀（弱）"
			SIF TALENT:男性
				CONTINUE
			SIF TALENT:性器年齢 == 2
				TALENT:性器年齢 = 3
		CASE "色素沉淀"
			SIF TALENT:男性
				CONTINUE
			SIF TALENT:性器年齢 == 3
				TALENT:性器年齢 = 4
		CASE "色素沉淀（強）"
			SIF TALENT:男性
				CONTINUE
			SIF TALENT:性器年齢 == 4
				TALENT:性器年齢 = 3
		CASE "黑木耳"
			SIF TALENT:男性
				CONTINUE
			SIF TALENT:性器年齢 == 5
				TALENT:性器年齢 = 4

		;純粋除外
		CASE "腸液分泌体質", "嘔吐反射耐性", "拡張適性", "喉性感", "尿道性感", "气味弱点", "母乳体質", "子宮性感", "絶頂失禁体質", "発情体質"
			TALENT:(LOCALS:LCOUNT) = 0
		ENDSELECT
	ENDIF
NEXT

CALL SETFLAG, "性器年齢", TARGET

;角色メイク専用素質の消去
TALENT:苗条 = 0
TALENT:豐腴 = 0

CALL CHECK_FAV_ONANIE, TARGET
CALL CHECK_FAV_POSITION, TARGET

;初期仲間？
IF CHARANUM == 3
	CFLAG:初期仲間 = 1
	CFLAG:初期同居 = 1
ENDIF
;夜型や初期同居具合
SIF CFLAG:夜型
	CFLAG:初期同居 = 1
SIF CFLAG:初期同居
	CALL SETFLAG, "同居：一直", TARGET
CALL SETFLAG, "同居解消不可能の自動設定", TARGET

;衣装の設定
CALL SETFLAG, "初期衣装", TARGET
;勧誘時は外套脱がせる
CALL RESET_OTHER, "外套", TARGET
CALL SET_COUNTER_BASE
CALL SETFLAG, "属性", TARGET
SIF TALENT:好色
	BASE:欲求不満 += RAND:51
;同居：一直を設定します
SIF CFLAG:夜型
	CALL SETFLAG, "同居：一直", TARGET
;もしも関係が未定義なら学年依存
SIF CSTR:関係 == ""
	CSTR:関係 = %CONDS("間柄")%

;名前変更した？
IF ARGS != ""
	NAME:TARGET = %ARGS%
	CALLNAME:TARGET = %NAME:TARGET%
ENDIF

IF FLAG:オープニング == 0 && COND("角色メイク中")
	IF COND("紹介文既読") == 0
		CALL VARSET_PROFILE
		CALL EVENT_PROFILE, "勧誘", TARGET

		;紹介文既読フラグON
		SETBIT FLAG:状況判定, 12
	ENDIF
	;勧誘イベント内で角色の数値を変更させていた場合
	FOR LCOUNT, 0, VARSIZE("CFLAG")
		SIF CFLAG:0:LCOUNT >= 0
			CFLAG:LCOUNT = CFLAG:0:LCOUNT
	NEXT
	FOR LCOUNT, 0, VARSIZE("BASE")
		SIF BASE:0:LCOUNT >= 0
			BASE:LCOUNT = BASE:0:LCOUNT
	NEXT
	FOR LCOUNT, 0, VARSIZE("TALENT")
		SIF TALENT:0:LCOUNT >= 0
			TALENT:LCOUNT = TALENT:0:LCOUNT
	NEXT
	FOR LCOUNT, 0, VARSIZE("ABL")
		SIF ABL:0:LCOUNT >= 0
			ABL:LCOUNT = ABL:0:LCOUNT
	NEXT
	FOR LCOUNT, 0, VARSIZE("EXP")
		SIF EXP:0:LCOUNT >= 0
			EXP:LCOUNT = EXP:0:LCOUNT
	NEXT
	FOR LCOUNT, 0, VARSIZE("CSTR")
		SIF CSTR:0:LCOUNT != "-1"
			CSTR:LCOUNT = %CSTR:0:LCOUNT%
	NEXT
ENDIF

;男、女の判定
SELECTCASE PENIS(TARGET)
CASE 0
	TALENT:女性 = 1
CASEELSE
	TALENT:女性 = 0
ENDSELECT
;Ｖ妊娠可能かどうかの設定
SIF COND("一般にＶ妊娠不能")
	TALENT:Ｖ妊娠不能 = 1

;誕生日の設定
BASE:誕生日 = RAND:120 + 1
;相性の設定
RELATION:TARGET:(NO:TARGET) = 120
BASE:排泄物 = RAND:4 + RAND:4
MAXBASE:排泄欲 = 10000
BASE:尿意 = LIMIT(500*(RAND:10 + RAND:10) - 3000, 0, 5000)
MAXBASE:尿意 = 10000
CALL SETFLAG, "安全危険日判定", TARGET
CALL SETFLAG, "学力の設定", TARGET

TFLAG:LINECOUNT_PROFILE = LINECOUNT

IF COND("角色メイク中")
	FOR LCOUNT, 90, 110
		SIF CEVENT(CSTRNAME:LCOUNT)
			CSTR:(CSTRNAME:LCOUNT) = %CEVENTS(CSTRNAME:LCOUNT)%
	NEXT
	CALL NEW_PRINT_STATE, TARGET, "角色メイク"
ENDIF
;初期变量をここで記録
CALL SETFLAG, "初期变量記録", TARGET
CALL SETFLAG, "普段の髪型記録", TARGET

TARGET = MEMO_TARGET

;主人のCEVENTで固定素質と除外素質を記録する
@FIX_TALENT
#DIM MEMO_LINECOUNT
#DIM LCOUNT
#DIM NUM_TALENT
#DIM ABL_SAMON
#DIM CHOICE
#DIMS TALENT_FIX
#DIMS TALENT_RMV

REDRAW 0

;固定or除外できる総数
ABL_SAMON = 3

MEMO_LINECOUNT = LINECOUNT
PRINTL
PRINTFORML 从特定的素質选择最多３個来进固定or除外、可以进行角色定制操作
PRINTFORML 不过、也有会部分素质会在同時除外/選択時发生冲突
CALL PRINT_STRL, "顺便一提、在背景设定是性転換或者扶她或男性之类的角色时、_黄色_性別の操作会不起作用"
CALL PRINT_STRL, "固定的素質用_緑_緑色_、除外的素質用_青_青色_表示"
CALL PRINT_STRL, "那么就从以下的素质里选择吧。選択顺序是从_緑_固定_→_青_除外_→不选择 这様変化的"
PRINTL

VARSET LOCALS
SPLIT TEXTS("固定可能な素質"), "/", LOCALS

NUM_TALENT = 0
FOR LCOUNT, 0, 100
	SIF LOCALS:LCOUNT == ""
		BREAK

	TALENT_FIX = 固定：%LOCALS:LCOUNT%
	TALENT_RMV = 除外：%LOCALS:LCOUNT%

	SIF CEVENT(TALENT_FIX, MASTER)
		SETCOLOR DEF_COLOR("緑")
	SIF CEVENT(TALENT_RMV, MASTER)
		SETCOLOR DEF_COLOR("青")

	PRINTFORM  [{LCOUNT, 2}]%TEXT_LJ(LOCALS:LCOUNT, 14)%

	RESETCOLOR

	NUM_TALENT += 1
	SIF NUM_TALENT%4 == 0
		PRINTL
NEXT
SIF NUM_TALENT%4
	PRINTL
PRINTL
PRINTFORML  [99]重置固定与除外
PRINTFORML [100]这様就好

CALL INPUT_SELECT, NUM_TALENT, 99, 100

CHOICE = RESULT

SELECTCASE CHOICE
CASE 100
	RETURN 1
CASE 99
	CALL SETFLAG, "素質的固定与除外の初期化"
CASEELSE
	;まずは固定or除外or指定无、の判定
	TALENT_FIX = 固定：%LOCALS:CHOICE%
	TALENT_RMV = 除外：%LOCALS:CHOICE%
	;固定→除外
	IF CEVENT(TALENT_FIX, MASTER)
		CALL DEL_CEVENT, TALENT_FIX, MASTER

		SELECTCASE LOCALS:CHOICE
		;除外できない要素かどうか
		CASE "性経験皆無"
		CASEELSE
			CALL SET_CEVENT, TALENT_RMV, MASTER
		ENDSELECT
	;除外→指定无
	ELSEIF CEVENT(TALENT_RMV, MASTER)
		CALL DEL_CEVENT, TALENT_RMV, MASTER
	;指定无→固定
	ELSE
		;同居できない素質の固定を消す
		SELECTCASE LOCALS:CHOICE
		CASE "処女", "童貞"
			CALL DEL_CEVENT, "固定：性経験皆無", MASTER
			CALL DEL_CEVENT, "除外：性経験皆無", MASTER
		CASE "性経験皆無"
			CALL DEL_CEVENT, "固定：処女", MASTER
			CALL DEL_CEVENT, "固定：童貞", MASTER
			CALL DEL_CEVENT, "除外：処女", MASTER
			CALL DEL_CEVENT, "除外：童貞", MASTER
		CASE "扶她", "絶頂失禁体質"
			CALL DEL_CEVENT, "固定：扶她", MASTER
			CALL DEL_CEVENT, "固定：絶頂失禁体質", MASTER
			CALL DEL_CEVENT, "除外：扶她", MASTER
			CALL DEL_CEVENT, "除外：絶頂失禁体質", MASTER
		CASE "短小", "並根", "巨根", "馬根"
			CALL DEL_CEVENT, "固定：短小", MASTER
			CALL DEL_CEVENT, "固定：並根", MASTER
			CALL DEL_CEVENT, "固定：巨根", MASTER
			CALL DEL_CEVENT, "固定：馬根", MASTER
			CALL DEL_CEVENT, "除外：短小", MASTER
			CALL DEL_CEVENT, "除外：並根", MASTER
			CALL DEL_CEVENT, "除外：巨根", MASTER
			CALL DEL_CEVENT, "除外：馬根", MASTER
		CASE "真性包茎", "假性包茎", "露茎"
			CALL DEL_CEVENT, "固定：真性包茎", MASTER
			CALL DEL_CEVENT, "固定：假性包茎", MASTER
			CALL DEL_CEVENT, "固定：露茎", MASTER
			CALL DEL_CEVENT, "除外：真性包茎", MASTER
			CALL DEL_CEVENT, "除外：假性包茎", MASTER
			CALL DEL_CEVENT, "除外：露茎", MASTER
		CASE "高大", "娇小"
			CALL DEL_CEVENT, "固定：高大", MASTER
			CALL DEL_CEVENT, "固定：娇小", MASTER
			CALL DEL_CEVENT, "除外：高大", MASTER
			CALL DEL_CEVENT, "除外：娇小", MASTER
		CASE "苗条", "豐腴"
			CALL DEL_CEVENT, "固定：苗条", MASTER
			CALL DEL_CEVENT, "固定：豐腴", MASTER
			CALL DEL_CEVENT, "除外：苗条", MASTER
			CALL DEL_CEVENT, "除外：豐腴", MASTER
		CASE "貧乳", "並乳", "巨乳", "爆乳", "超乳"
			CALL DEL_CEVENT, "固定：貧乳", MASTER
			CALL DEL_CEVENT, "固定：並乳", MASTER
			CALL DEL_CEVENT, "固定：巨乳", MASTER
			CALL DEL_CEVENT, "固定：爆乳", MASTER
			CALL DEL_CEVENT, "固定：超乳", MASTER
			CALL DEL_CEVENT, "除外：貧乳", MASTER
			CALL DEL_CEVENT, "除外：並乳", MASTER
			CALL DEL_CEVENT, "除外：巨乳", MASTER
			CALL DEL_CEVENT, "除外：爆乳", MASTER
			CALL DEL_CEVENT, "除外：超乳", MASTER
		CASE "小尻", "並尻", "巨尻", "爆尻", "超尻"
			CALL DEL_CEVENT, "固定：小尻", MASTER
			CALL DEL_CEVENT, "固定：並尻", MASTER
			CALL DEL_CEVENT, "固定：巨尻", MASTER
			CALL DEL_CEVENT, "固定：爆尻", MASTER
			CALL DEL_CEVENT, "固定：超尻", MASTER
			CALL DEL_CEVENT, "除外：小尻", MASTER
			CALL DEL_CEVENT, "除外：並尻", MASTER
			CALL DEL_CEVENT, "除外：巨尻", MASTER
			CALL DEL_CEVENT, "除外：爆尻", MASTER
			CALL DEL_CEVENT, "除外：超尻", MASTER
		CASE "褐色肌", "色白", "青肌", "色黒"
			CALL DEL_CEVENT, "固定：褐色肌", MASTER
			CALL DEL_CEVENT, "固定：色白", MASTER
			CALL DEL_CEVENT, "固定：青肌", MASTER
			CALL DEL_CEVENT, "固定：色黒", MASTER
			CALL DEL_CEVENT, "除外：褐色肌", MASTER
			CALL DEL_CEVENT, "除外：色白", MASTER
			CALL DEL_CEVENT, "除外：青肌", MASTER
			CALL DEL_CEVENT, "除外：色黒", MASTER
		CASE "萝莉", "少女", "大姐姐", "大人"
			CALL DEL_CEVENT, "固定：萝莉", MASTER
			CALL DEL_CEVENT, "固定：少女", MASTER
			CALL DEL_CEVENT, "固定：大姐姐", MASTER
			CALL DEL_CEVENT, "固定：大人", MASTER
			CALL DEL_CEVENT, "除外：萝莉", MASTER
			CALL DEL_CEVENT, "除外：少女", MASTER
			CALL DEL_CEVENT, "除外：大姐姐", MASTER
			CALL DEL_CEVENT, "除外：大人", MASTER
		CASE "美穴", "色素沉淀（弱）", "色素沉淀", "色素沉淀（強）", "黑木耳"
			CALL DEL_CEVENT, "固定：美穴", MASTER
			CALL DEL_CEVENT, "固定：色素沉淀（弱）", MASTER
			CALL DEL_CEVENT, "固定：色素沉淀", MASTER
			CALL DEL_CEVENT, "固定：色素沉淀（強）", MASTER
			CALL DEL_CEVENT, "固定：黑木耳", MASTER
			CALL DEL_CEVENT, "除外：美穴", MASTER
			CALL DEL_CEVENT, "除外：色素沉淀（弱）", MASTER
			CALL DEL_CEVENT, "除外：色素沉淀", MASTER
			CALL DEL_CEVENT, "除外：色素沉淀（強）", MASTER
			CALL DEL_CEVENT, "除外：黑木耳", MASTER
		ENDSELECT

		;既に選択可能個数分選択している？
		IF STRCOUNTS(CSTR:MASTER:CEVENT, "固定：", "除外：") >= ABL_SAMON
			PRINTFORMW 選择数超过了上限
		;指定无→固定
		ELSE
			CALL SET_CEVENT, TALENT_FIX, MASTER
		ENDIF
	ENDIF
ENDSELECT

CLEARLINE LINECOUNT - MEMO_LINECOUNT
RESTART

;角色ARGの素質や経験などを適切な値に再設定したり、随机で変化させたりする
@CHANGE_TALENT, ARG
#DIM LCOUNT
;処女？
IF TALENT:処女 == 1
	TALENT:出産経験 = 0
	EXP:Ｖ経験 = 0
	EXP:Ｖ性交経験 = 0
	EXP:腰靈活経験 = 0
	EXP:Ｖ拡張経験 = 0
	BASE:胎児の父親 = 0
ENDIF
;童貞？
IF TALENT:童貞
	EXP:Ｖ挿入経験 = 0
ELSEIF PENIS(TARGET)
	SIF EXP:Ｖ挿入経験 == 0
		EXP:Ｖ挿入経験 = 1
ENDIF
;種族は？
SIF CSTR:種族 == ""
	CSTR:種族 = 人类

FOR LCOUNT, 0, 100
	IF CEVENT("固定：性経験皆無", MASTER)
		EXP:LCOUNT = 0
	;所持している経験の揺らぎ
	ELSEIF EXP:LCOUNT
		EXP:LCOUNT = MAX(MULTIPLY(EXP:LCOUNT, 50 + (RAND:6 + RAND:6)*10), 1)
	ENDIF
NEXT
EXP:Ｖ経験 = MAX(EXP:Ｖ経験, EXP:Ｖ性交経験, EXP:Ｖ拡張経験)
EXP:Ａ経験 = MAX(EXP:Ａ経験, EXP:Ａ性交経験, EXP:Ａ拡張経験)

;以下の随机素質は一時保留
;拡張適性はレア素質
;SIF RAND:10 == 0
;	TALENT:拡張適性 = 1
;わーい母乳が出るぞ！（レア素質）
;SIF TALENT:男性 == 0 && TALENT:貧乳 == 0 && RAND:10 + (TALENT:巨乳 + 1)/2 >= 9
;	TALENT:母乳体質 = 1
;口交経験豊富だと嘔吐反射耐性が有るかも
;SIF EXP:口交経験 + EXP:喉性交経験 >= MAX(50, RAND:300)
;	TALENT:嘔吐反射耐性 = 1
;喉性感
;SIF TALENT:Ｍ性向*3 + ABL:Ｍ感覚 + GET_EXP_LV(EXP:口交経験) + GET_EXP_LV(EXP:喉性交経験) >= RAND:20
;	TALENT:喉性感 = 1
;子宮性感
;SIF TALENT:男性 == 0 && TALENT:Ｖ性向*3 + ABL:Ｖ感覚 + GET_EXP_LV(EXP:Ｖ経験) + GET_EXP_LV(EXP:Ｖ性交経験) >= RAND:20
;	TALENT:子宮性感 = 1
;尿道性感
;SIF TALENT:倒錯的 + RAND:10 >= 9
;	TALENT:尿道性感 = 1
;气味弱点
;IF (TALENT:動物耳 > 0)*3 + (TALENT:汚臭敏感 - TALENT:汚臭鈍感)*2 + (ABL:欲望 + 1)/2 + RAND:10 >= 9
;	TALENT:气味弱点 = 1
;	TALENT:汚臭鈍感 = 0
;ENDIF

;拡張度の上限に応じて拡張度にぶれがある（上限側になりやすい）
IF CONFIG("ＶＡ拡張の手動ＬＶＵＰ")
	LOCAL = CALCF("Ｖ拡張の上限", TARGET)
	SIF LOCAL > ABL:Ｖ拡張
		ABL:Ｖ拡張 = LIMIT(RAND:LOCAL + RAND:2 + RAND:2, ABL:Ｖ拡張, LOCAL)

	LOCAL = CALCF("Ａ拡張の上限", TARGET)
	SIF LOCAL > ABL:Ａ拡張
		ABL:Ａ拡張 = LIMIT(RAND:LOCAL + RAND:2 + RAND:2, ABL:Ａ拡張, LOCAL)
ELSE
	ABL:Ｖ拡張 = CALCF("Ｖ拡張の上限", TARGET)
	ABL:Ａ拡張 = CALCF("Ａ拡張の上限", TARGET)
ENDIF

;精液弱点のも良いですよね
IF TALENT:精液弱点 == 0 && ABL:精液中毒 > RAND:5
	IF EXP:口交経験 && RANDIF(1, EXP:Ｖ性交経験, EXP:Ａ性交経験)
		TALENT:精液弱点 = 1p0
	ELSEIF EXP:Ｖ性交経験 && RANDIF(1, EXP:Ａ性交経験)
		TALENT:精液弱点 = 1p1
	ELSEIF EXP:Ａ性交経験
		TALENT:精液弱点 = 1p2
	ENDIF
ENDIF
SIF TALENT:大力士 && RAND:3 == 0
	TALENT:筋肉 = 1

CALL SETFLAG, "属性", TARGET


code:
;-------------------------------------------------
;SHOP.ERBのTINPUT関連の処理を関数化
;-------------------------------------------------
;-------------------------------------------------
;颜绘の动画のフレーム周りの処理
;-------------------------------------------------
@FLIRT_AND_ANIMATION
#DIM LCOUNT
#DIM PRANK
#DIM PRANK_COUNT

PRANK = 0
PRANK_COUNT = 1

;动画ーションONの場合の自动调戏初期設定
IF CONFIG("自动调戏動作中")
	SELECTCASE CONFIG("自动调戏")
	CASE 0
		PRANK = 201
	CASEELSE
		IF FLAG:なんかして欲しい
			SELECTCASE FLAG:なんかして欲しい
			CASE 3
				PRANK = CONFIG("自动调戏")*2 + 1
			CASE 2
				PRANK = CONFIG("自动调戏")*3 + 1
			CASEELSE
				PRANK = CONFIG("自动调戏")*5 + 1
			ENDSELECT
		ELSEIF STATE("酔酒", MASTER) || STATE("酔酒", TARGET)
			PRANK = CONFIG("自动调戏")*(RAND:6 + 5) + 1
		ELSE
			PRANK = CONFIG("自动调戏")*10 + 1
		ENDIF
	ENDSELECT
ENDIF

;フレーム数カウント初期値
FOR LCOUNT, 0, NUM_ANIME
	ANIME_FCOUNT:LCOUNT = RAND:20
NEXT

CALL FLIRT_AND_ANIMATION_MAIN, PRANK, PRANK_COUNT

@FLIRT_AND_ANIMATION_MAIN, PRANK, PRANK_COUNT
#DIM LCOUNT
#DIM PRANK
#DIM PRANK_COUNT
#DIM CHOICE

SELECTCASE NUM_ANIME
CASE IS >= 1
	TINPUT 100, 9999, 0, ""
;ここには来ないが念のため
CASEELSE
	INPUT
ENDSELECT

CHOICE = RESULT

SELECTCASE CHOICE
CASE 9999
	CLEARLINE 1
	SELECTCASE PRANK_COUNT
	CASE PRANK
		CALL EVENT_FLIRT
	CASEELSE
		FOR LCOUNT, 0, NUM_ANIME
			IF CFLAG:(ANIME_CHARA:LCOUNT):睡眠
				SELECTCASE ANIME_FCOUNT:LCOUNT
				CASE 40, 71
					CALL OVERLAY_GCREATE, LATESTFACEID:LCOUNT, @"%EXTSTR(@"%MAIDFACE_ANIME(ANIME_CHARA:LCOUNT, LCOUNT)%", "", ",")%"
				ENDSELECT
			ELSEIF CFLAG:(ANIME_CHARA:LCOUNT):刚睡醒 || STATE("困倦", ANIME_CHARA:LCOUNT)
				SELECTCASE ANIME_FCOUNT:LCOUNT
				CASE 76, 78, 81, 110, 111
					CALL OVERLAY_GCREATE, LATESTFACEID:LCOUNT, @"%EXTSTR(@"%MAIDFACE_ANIME(ANIME_CHARA:LCOUNT, LCOUNT)%", "", ",")%"
				ENDSELECT
			ELSE
				SELECTCASE ANIME_FCOUNT:LCOUNT
				;まばたき
				CASE 39, 40, 41, 42
					CALL OVERLAY_GCREATE, LATESTFACEID:LCOUNT, @"%EXTSTR(@"%MAIDFACE_ANIME(ANIME_CHARA:LCOUNT, LCOUNT)%", "", ",")%"
				;よそ見は保留
				;CASE 55, 69, 70, 71, 72, 80

				ENDSELECT
			ENDIF
		NEXT

		;フレームカウント処理
		FOR LCOUNT, 0, NUM_ANIME
			IF CFLAG:(ANIME_CHARA:LCOUNT):睡眠
				SELECTCASE ANIME_FCOUNT:LCOUNT
				CASE IS >= 71
					ANIME_FCOUNT:LCOUNT = RAND:20
				CASEELSE
					ANIME_FCOUNT:LCOUNT += 1
				ENDSELECT
			ELSEIF CFLAG:(ANIME_CHARA:LCOUNT):刚睡醒 || STATE("困倦", ANIME_CHARA:LCOUNT)
				SELECTCASE ANIME_FCOUNT:LCOUNT
				CASE IS >= 111
					ANIME_FCOUNT:LCOUNT = RAND:20
				CASEELSE
					ANIME_FCOUNT:LCOUNT += 1
				ENDSELECT
			ELSE
				SELECTCASE ANIME_FCOUNT:LCOUNT
				CASE IS >= 80
					ANIME_FCOUNT:LCOUNT = RAND:20
				CASEELSE
					ANIME_FCOUNT:LCOUNT += 1
				ENDSELECT
			ENDIF
		NEXT

		;自动调戏しない場合に放置しているとカウントが無限に増加するので１万毎に重置する
		;（PRANKの最大値は6001）
		PRANK_COUNT = PRANK_COUNT%10000 + 1
		RESTART
	ENDSELECT
CASE IS >= 0
	FLAG:なんかして欲しい = 0
	CALL USERSHOP_PRE, CHOICE
ENDSELECT

;-------------------------------------------------
;自动调戏のTINPUT関連の処理を関数化
;-------------------------------------------------
@FLIRT
#DIM CHOICE
IF CONFIG("自动调戏動作中")
	SELECTCASE CONFIG("自动调戏")
	CASE 0
		TINPUT 20000, 9999, 0, ""
	CASEELSE
		IF FLAG:なんかして欲しい
			SELECTCASE FLAG:なんかして欲しい
			CASE 3
				TINPUT CONFIG("自动调戏")*200, 9999, 0, ""
			CASE 2
				TINPUT CONFIG("自动调戏")*350, 9999, 0, ""
			CASEELSE
				TINPUT CONFIG("自动调戏")*500, 9999, 0, ""
			ENDSELECT
		ELSEIF STATE("酔酒", MASTER) || STATE("酔酒", TARGET)
			TINPUT CONFIG("自动调戏")*(RAND:501 + 500), 9999, 0, ""
		ELSE
			TINPUT CONFIG("自动调戏")*1000, 9999, 0, ""
		ENDIF
	ENDSELECT
ELSE
	INPUT
ENDIF
CHOICE = RESULT

SELECTCASE CHOICE
CASE 9999
	CLEARLINE 1
	SIF CONFIG("自动调戏動作中")
		CALL EVENT_FLIRT
CASE IS >= 0
	FLAG:なんかして欲しい = 0
	CALL USERSHOP_PRE, CHOICE
ENDSELECT

;-------------------------------------------------
;自动调戏関連の処理を関数化
;-------------------------------------------------
@EVENT_FLIRT
#DIM MEMO_TARGET
#DIM MEMO_LINECOUNT

MEMO_TARGET = TARGET

MEMO_LINECOUNT = LINECOUNT
;特定行動後の派生イベントなど(partner以外のイベントが起きる事もある)
IF RAND:2
	SETBIT FLAG:状況判定, 38
	CALL EVENT_DAILY_EX, DAILYNUM("卖个破绽"), "卖个破绽"
	CLEARBIT FLAG:状況判定, 38
ENDIF

IF LINECOUNT == MEMO_LINECOUNT
	PRINTL
	TARGET = 0
	;発情期や躁动难忍している人優先
	SIF RAND:3 == 0
		TARGET = FIND_COND("発情期", "現在存在")
	SIF TARGET == 0 && RAND:3 == 0
		TARGET = FIND_COND("躁动难忍", "現在存在")
	SIF TARGET == 0
		TARGET = FIND_COND("現在存在")
	SETBIT FLAG:状況判定, 39
	CALL USERSHOP_PRE, 240
	CLEARBIT FLAG:状況判定, 39
ENDIF

IF CONFIG("partnerの自動変更") && TARGET != MEMO_TARGET
	CALL SETFLAG, "対象指定", TARGET
ELSEIF FLAG:SELECT_USERSHOP == 0
	;partnerがイベントで居なくなった場合を除いて、partnerを復帰させる
	SIF COND("現在存在", MEMO_TARGET)
		TARGET = MEMO_TARGET
	SIF CONFIG("partnerの自動変更") && FIND_COND("現在存在")
		CALL SETFLAG, "対象指定", FIND_COND("現在存在")
ENDIF

FLAG:なんかして欲しい += 1
SIF FLAG:なんかして欲しい >= 4
	FLAG:なんかして欲しい = RAND:4
CVARSET CFLAG, GETNUM(CFLAG, "KOJO_DAILY済")