code:
@ITEM_BUY(ARG)
#DIM LC
;�`���́��͋����m�F�p���ۂ������̂Ŗ����Ă���
;PRINTFORML {ITEMSALES:62}
CALL ITEM_SALES

DRAWLINE
LC = LINECOUNT
CALL LIST_ITEM("�S��")
SIF LC != LINECOUNT
	DRAWLINE
;�Ƃ肠�����������ɑS���\���ɂ�����TYPE�w����\
PRINTFORML �w������A�C�e����I��ł������� ������:\\%TOSTR(MONEY,"#,###")%
	CALL SHOW_ITEM
DRAWLINE
;ARG�͂��Ԃ�͓�����̓���w���̖��c�H�i�����w���̍��Ղ��j�Ŏg���ĂȂ������̂܂�
SIF !ARG
	PRINTL [200] - �����A�C�e���@[300] - ���Օi�@[400] - ���p�i�@[500] - ���H���@[600] - �f���@[700] - �̎��ω�
PRINT [999] - �S�ĕ\���@�@�@[100] - �߂�

;��ɋ��ʏ���
;SHOP�w���\��ITEM��ǉ������疳���͈͂����킹�邱��
DO
	INPUT
	LOCAL = RESULT
	SELECTCASE LOCAL
	CASE 100
		RETURN 0
	CASE 999
		TFLAG:�\���A�C�e����� = 0
		RESTART
	CASE 200, 300, 400, 500, 600, 700
		TFLAG:�\���A�C�e����� = LOCAL / 100
		RESTART
	CASE IS < 0, IS > 100
		; �����͈�
	CASEELSE
		SIF !ITEM_TYPE(LOCAL, TFLAG:�\���A�C�e�����)
			CONTINUE
		SELECTCASE ITEMSTOCK(LOCAL)
		CASE 1, 4
			;
		CASE 2
			REUSELASTLINE ���؂ł�
			;
		CASE 3
			REUSELASTLINE ������������܂���
			;
		CASE 5
			REUSELASTLINE ���ɏ\�������Ă��܂�
			;
		CASEELSE
			; ���̃X�e�b�v��
			BREAK
		ENDSELECT
	ENDSELECT
LOOP 1

;�w�������{��
SELECTCASE LOCAL
CASE 60 TO 62
	PRINTFORML %ITEMNAME:LOCAL%���K�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		SELECTCASE LOCAL
		CASE 61
			TALENT:MASTER:�����m�� = 1
		CASE 62
			TALENT:MASTER:�֒f�̒m�� = 1
		ENDSELECT
		ITEMSALES:LOCAL = -1
	ENDIF
CASE 63
	PRINTFORML �y�Z�IUP�z���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		ABL:MASTER:�Z�I += 1
	ENDIF
CASE 64
	PRINTFORML �y�Z�IDOWN�z���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		ABL:MASTER:�Z�I -= 1
	ENDIF
CASE 65
	PRINTFORML �y�����ԏ�z���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		CFLAG:MASTER:329 -= 1
	ENDIF
CASE 66
	PRINTFORML �y���L�ϐ�UP�z���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		TALENT:MASTER:61 += 1
	ENDIF
CASE 67
	PRINTFORML �y���L�ϐ�DOWN�z���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		TALENT:MASTER:61 -= 1
	ENDIF
CASE 71
	PRINTFORML �y��̍ޗ�(�o)�z���w�����܂����H
	CALL ASK_YN
	SIF RESULT
		RESTART
	PRINTL �N�Ɏg���܂����H
	CALL SHOW_CHARA_LIST("�I���i")
	LOCAL:1 = RESULT
	SELECTCASE LOCAL:1
	CASE 999
	CASEELSE
		PRINTFORMW %CALLNAME:(LOCAL:1)%�͂ӂ��Ȃ�ɂȂ�܂���
		MONEY -= ITEMPRICE:LOCAL
		TALENT:(LOCAL:1):���� |= 2
		MAXBASE:(LOCAL:1):2 = 10000
		MAXBASE:(LOCAL:1):���� = 1000
		MAXBASE:(LOCAL:1):�u�N = 1500
		SIF BASE:(LOCAL:1):���� > 1000
			BASE:(LOCAL:1):���� = 1000
	ENDSELECT
CASE 72
	PRINTFORML �y��̍ޗ�(��)�z���w�����܂����H
	CALL ASK_YN
	SIF RESULT
		RESTART
	PRINTL �N�Ɏg���܂����H
	CALL SHOW_CHARA_LIST("�ӂ��Ȃ�")
	LOCAL:1 = RESULT
	SELECTCASE LOCAL:1
	CASE 999
	CASEELSE
		PRINTFORMW %CALLNAME:(LOCAL:1)%���̎q�ɂȂ�܂���
		MONEY -= ITEMPRICE:LOCAL
		TALENT:(LOCAL:1):���� = 1
		MAXBASE:(LOCAL:1):2 = 0
		MAXBASE:(LOCAL:1):���� = 0
	ENDSELECT
;CASE 73
;	PRINTFORML �y���L�����f�B�z���w�����܂����H
;	CALL ASK_YN
;	SIF RESULT
;		RESTART
;	PRINTL �N�Ɏg���܂����H
;	FOR LOCAL:1, 0, CHARANUM
;		SIF TALENT:(LOCAL:1):���� == 2
;			CONTINUE
;		SIF TALENT:(LOCAL:1):����̎�
;			CONTINUE
;		SIF CFLAG:(LOCAL:1):�o��
;			CONTINUE
;		PRINTFORML [{LOCAL:1, 3}] - %CALLNAME:(LOCAL:1)%
;	NEXT
;	PRINTFORML
;	PRINTL [999] - �߂�
;	DO
;		INPUT
;		LOCAL:1 = RESULT
;		SELECTCASE LOCAL:1
;		CASE 999
;			BREAK
;		CASE 0 TO CHARANUM - 1
;			SIF TALENT:(LOCAL:1):���� == 2
;				BREAK
;			SIF TALENT:(LOCAL:1):����̎�
;				BREAK
;			SIF CFLAG:(LOCAL:1):�o��
;				BREAK
;			PRINTFORMW %CALLNAME:(LOCAL:1)%��[����̎�]�𓾂܂���
;			MONEY -= ITEMPRICE:LOCAL
;			TALENT:(LOCAL:1):����̎� = 1
;			BREAK
;		ENDSELECT
;	LOOP 1
CASE 74
	PRINTFORML �y�Ԃ��L�����f�B�z���w�����܂����H
	CALL ASK_YN
	SIF RESULT
		RESTART
	PRINTL �N�Ɏg���܂����H
	CALL SHOW_CHARA_LIST("�񏈏�")
	LOCAL:1 = RESULT
	SELECTCASE LOCAL:1
	CASE 999
	CASEELSE
		PRINTFORMW %CALLNAME:(LOCAL:1)%�̏��������Đ����܂���
		MONEY -= ITEMPRICE:LOCAL
		TALENT:(LOCAL:1):���� = 2
	ENDSELECT
CASE 77
	PRINTFORML �y���F�̃L�����f�B�z���w�����܂����H
	CALL ASK_YN
	SIF RESULT
		RESTART
	PRINTL �N�Ɏg���܂����H
	CALL SHOW_CHARA_LIST("�l�Ԏ�")
	LOCAL:1 = RESULT
	SELECTCASE LOCAL:1
	CASE 999
	CASEELSE
		PRINTFORML [4]�l�R�~�~
		PRINTFORML [3]�C�k�~�~
		PRINTFORML [2]�E�T�~�~
		PRINTFORML [1]������
		PRINTFORML
		PRINTFORML [0]����ς��
		DO
			INPUT
			SELECTCASE RESULT
			CASE 0
				RESTART
			CASE 1, 2, 3, 4
				MONEY -= ITEMPRICE:LOCAL
				TALENT:(LOCAL:1):������ = RESULT
				PRINTFORMW %CALLNAME:(LOCAL:1)%��%GET_TALENTNAME(GETNUM(TALENT, "������"), TALENT:(LOCAL:1):������)%�������܂���
				BREAK
			CASEELSE
			ENDSELECT
		LOOP 1
	ENDSELECT
CASE 78
	PRINTFORML �y���F�̃L�����f�B�z���w�����܂����H
	CALL ASK_YN
	SIF RESULT
		RESTART
	PRINTL �N�Ɏg���܂����H
	CALL SHOW_CHARA_LIST("�P���~�~")
	LOCAL:1 = RESULT
	SELECTCASE LOCAL:1
	CASE 999
	CASEELSE
		PRINTFORMW %CALLNAME:(LOCAL:1)%��%GET_TALENTNAME(GETNUM(TALENT, "������"), TALENT:(LOCAL:1):������)%�������܂���
		MONEY -= ITEMPRICE:LOCAL
		TALENT:(LOCAL:1):������ = 0
	ENDSELECT
CASE 95
	PRINTFORML �َq�܂���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		ITEM:LOCAL ++
	ENDIF
CASE 94
	PRINTFORML �y�N���X�}�X�v���[���g�z���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		MONEY -= ITEMPRICE:LOCAL
		ITEM:LOCAL ++
		PRINTFORML �v���[���g�𔃂��܂���
		PRINTFORMW �~��24������ŁA�f�[�g���ɓn���܂�
	ENDIF

;�܂Ƃߔ����o������������̂���������Ȃ�ł���̂̓I�J�V�C�̂�
;��ʂɎg�����̂ł��������������H�Ƃ������ƂŌ���̏����������p��
;�����̕�����R�����g�A�E�g����΂܂Ƃߔ����\
CASE 41
	MONEY -= ITEMPRICE:LOCAL
	ITEM:LOCAL ++
	PRINTW �Z��𐸐����܂���
	RESTART

;���������A�C�e��
CASE 40 TO 60, 91, 92,
	CALL ITEM_MATOMEGAI(LOCAL)
;�P�i�A�C�e��
CASE 0 TO 39
	PRINTFORML %ITEMNAME:LOCAL%���w�����܂����H
	CALL ASK_YN
	IF !RESULT
		ITEM:LOCAL ++
		IF ARG == 1
			MONEY -= ITEMPRICE:LOCAL / 3
		ELSE
			MONEY -= ITEMPRICE:LOCAL
		ENDIF
		IF LOCAL == 36 && ITEM:��ꂽ�P
			PRINTFORMW �V�����̂𔃂����̂ŉ�ꂽ�P�������܂���
			ITEM:��ꂽ�P = 0
		ENDIF
		SETBIT FLAG:�A�C�e���w���ς�, LOCAL
		RESTART
	ENDIF
ENDSELECT
RESTART

;----------------------------------------------------------------------
;  ���j���[�̒ʐM�̔��Ŏg�p����鍀�ڂ̕\�����j���[
;	ARGS:0 �� �\���A�C�e���̃^�C�v
;	ARG:0 (DISCOUNT) �͉͓��p
@SHOW_ITEM, ARGS:0 = "SHOP", ARG:0 = 1
#DIM DISCOUNT
#DIM WIDTH
#DIM ���ڐ�
#DIM LOOP_LO
#DIM LOOP_HI
DISCOUNT = MAX( 1, ARG:0 )

DRAWLINE
WIDTH = GETCONFIG("PRINTC�̕�����")
���ڐ� = 0
CALL ITEM_RANGE, ARGS
LOOP_LO = RESULT:0
LOOP_HI = RESULT:1

FOR LOCAL,LOOP_LO,LOOP_HI
	;�\�����Ȃ�

	;�G��(48)��\�������Ă��Ȃ������̂͂Ȃ��H
	;SIF LOCAL == 48
	;	CONTINUE
	SIF GROUPMATCH( ITEMSTOCK(LOCAL), 1, 4 )
		CONTINUE
	SIF ARGS:0 == "SHOP" && !ITEM_TYPE(LOCAL, TFLAG:�\���A�C�e�����)
		CONTINUE

	LOCALS = [{LOCAL,2}]%ITEMNAME:LOCAL%
	SELECTCASE ITEMSTOCK(LOCAL)
	;����؂�
	CASE 2
		LOCALS:1 = ����
		SETCOLOR 150,150,150
	CASE 5
		LOCALS:1 =
		SETCOLOR 150,150,150
	CASEELSE
		LOCALS:1 = ��{ITEMPRICE:LOCAL / DISCOUNT}
	ENDSELECT
	PRINTFORM %LOCALS,WIDTH,LEFT%%LOCALS:1,7%
	RESETCOLOR
	���ڐ� ++
	SIF ���ڐ� % PRINTCPERLINE() == 0
		PRINTL
NEXT
PRINTL

;--------------------------------------------------------------
; ITEM_RANGE
;	�e��ނ�ITEM�̒l�͈̔͂̍ŏ��l�ƍő�l+1�� RESULT:0 �� RESULT:1 �ŕԂ�
;	���[�v���񂷂��߂̂��̂Ȃ̂ŁA�͈͓��ł��K�������w��̎�ʂ�ITEM�Ƃ͌���Ȃ��B
;	ITEM_TYPE(S)�Ŋm�F���邱��
;--------------------------------------------------------------
@ITEM_RANGE, ARGS = "", ARG = 0
#LOCALSIZE 1
#DIM LO
#DIM HI
LO = 0
HI = 1000
SIF ARGS == ""
	ARGS '= TOSTR( ARG )
SELECTCASE ARGS
CASE "�S��", "0"
	;0�`1000
CASE "SHOP", "1"
	LO = 0
	HI = 100
CASE "����", "SHOP_����", "2"
	LO = 0
	HI = 30
CASE "���Օi", "SHOP_���Օi", "3"
	LO = 40
	HI = 50
CASE "���p�i", "SHOP_���p�i", "4"
	LO = 30
	HI = 100
CASE "���H��", "SHOP_���H��", "5"
	LO = 47
	HI = 60
CASE "�f��", "SHOP_�f��", "6"
	LO = 60
	HI = 70
CASE "�̎��ω�", "SHOP_�̎��ω�", "7"
	LO = 70
	HI = 80

;�R�}���h�p
; �ȉ��d������
CASE "�͓�����", "10"
	;�v�[���ƒ�������
	LO = 0
	HI = 40
CASE "��������i", "20"
;�������p
	LO = 40
	HI = 600
CASE "�H�ނ̔����o��", "30"
	LO = 47
	HI = 51
CASE "����", "40"
	LO = 51
	HI = 60

;�ȍ~�ACSV�����Ȃ���K����

CASE "�ԉ�", "���|�p�i", "50"
;150�`�͉��|�֘A
	LO = 150
	HI = 200
CASE "�`���R", "60"
	LO = 120
	HI = 130
CASE "���", "70"
	LO = 350
	HI = 390
CASE "���̑�", "80"
;�������O���v�����Ȃ������̂ł����
;�˗��p�i��i�i�ނȂǁH
	LO = 100
	HI = 260
CASE "��p", "90"
;����ł͈��ނ̂݁H�i�������̃y���_���g(399)�j
	LO = 399
	HI = 500
CASE "��", "100"
	LO = 500
	HI = 600
CASE "�f��", "110"
;600�`�͑f��
	LO = 600
	HI = 700
CASE "����", "120"
;700�`�͂���
	LO = 700
	HI = 800
CASE "�ߑ�", "130"
;800�`�͈ߑ��H�H�H
	LO = 800
	HI = 900
CASE "����", "140"
;900�`�͍Ւd����
;������������ǂ��`�e�������̂����o���킩��Ȃ���
	LO = 900
	HI = 1000
ENDSELECT
RETURN LO, HI

@ITEM_TYPE(ARG,ARG:1)
#FUNCTION
SIF ARG < 0 || ARG >= 1000 || ITEMNAME:ARG == ""
	RETURNF 0
SELECTCASE ARG:1
	CASE 0
		RETURNF 1
	CASE 2	;����
		SIF INRANGE(ARG, 0, 23 )
			RETURNF 1
	CASE 3	;���Օi
		SIF INRANGE(ARG, 40, 45 ) || ARG == 49
			RETURNF 1
	CASE 4	;���p�i
		SIF INRANGE(ARG, 30, 39)
			RETURNF 1
		SIF GROUPMATCH(ARG, 94, 95)
			RETURNF 1
	CASE 5	;"���H��"
		SIF INRANGE(ARG, 50, 59)
			RETURNF 1
		; ���āA�G��
		SIF GROUPMATCH(ARG, 47, 48)
			RETURNF 1
	CASE 6	;"�f��"
		SIF ARG >= 60 && ARG < 70
			RETURNF 1
	CASE 7	;"�̎��ω�"
		SIF ARG >= 70 && ARG < 80
			RETURNF 1

	; �ȉ��d������
	CASE 10	;�͓�����
		;�v�[���ƒ�������
		SIF ARG == 38 || INRANGE(ARG, 0, 23)
			RETURNF 1
	CASE 20	;��������i
		SIF GROUPMATCH( ARG, 40, 45, 49, 250, 252, 501, 502, 510, 520)
			RETURNF 1
	CASE 30	;�H�ނ̔����o��
		SIF GROUPMATCH( ARG, 47, 48, 50 )
			RETURNF 1
	CASE 40	;��X
		SIF INRANGE(ARG, 51, 59)
			RETURNF 1
	CASE 50	;�ԉ�
		SIF INRANGE(ARG, 150, 199)
			RETURNF 1
	CASE 60 ;�`���R
		SIF INRANGE(ARG, 120, 129)
			RETURNF 1
	CASE 70 ;���
		SIF INRANGE(ARG, 350, 389)
			RETURNF 1
	CASE 80	;"���̑�"
		SIF INRANGE(ARG, 200, 259)
			RETURNF 1
		SIF GROUPMATCH(ARG, 130, 131, 140)
			RETURNF 1
	CASE 90	;"��p"
		SIF INRANGE(ARG, 399, 499)
			RETURNF 1
	CASE 100	;"��"
		SIF INRANGE(ARG, 500, 599)
			RETURNF 1
	CASE 110	;"�f��"
		SIF INRANGE(ARG, 600, 699)
			RETURNF 1
	CASE 120	;"����"
		SIF INRANGE(ARG, 700, 799)
			RETURNF 1
	CASE 130	;"�ߑ�"
		SIF INRANGE(ARG, 800, 899)
			RETURNF 1
	CASE 140	;"����"
		SIF INRANGE(ARG, 900, 999)
			RETURNF 1
ENDSELECT
RETURNF 0

;ITEM_TYPE()�̕�����ł̃^�C�v�w��
@ITEM_TYPES, ARG:0, ARGS:0
#FUNCTION
#LOCALSIZE 1
#DIM TYPE

TYPE = 0
SELECTCASE ARGS:0
CASE "�S��"
	RETURNF 1
CASE "����", "SHOP_����"
	TYPE = 2
CASE "���Օi", "SHOP_���Օi"
	TYPE = 3
CASE "���p�i", "SHOP_���p�i"
	TYPE = 4
CASE "���H��", "SHOP_���H��"
	TYPE = 5
CASE "�f��", "SHOP_�f��"
	TYPE = 6
CASE "�̎��ω�", "SHOP_�̎��ω�"
	TYPE = 7

; �ȉ��d������
CASE "�͓�����"
	;�v�[���ƒ�������
	TYPE = 10
CASE "��������i"
	TYPE = 20
CASE "�H�ނ̔����o��"
	TYPE = 30
CASE "�`���R"
	TYPE = 35
CASE "����"
	TYPE = 40
CASE "�ԉ�", "���|�p�i"
	TYPE = 50
CASE "�`���R"
	TYPE = 60
CASE "���"
	TYPE = 70
CASE "���̑�"
	TYPE = 80
CASE "��p"
	TYPE = 90
CASE "��"
	TYPE = 100
CASE "�f��"
	TYPE = 110
CASE "����"
	TYPE = 120
CASE "�ߑ�"
	TYPE = 130
CASE "����"
	TYPE = 140
ENDSELECT
SIF TYPE
	RETURNF ITEM_TYPE( ARG, TYPE )
RETURNF 0

;�����t���A�C�e���̏���
@ITEM_SALES
;ITEMSALES = 0 �w����
;ITEMSALES = -1 ����
;ITEMSALES = -2 ����
;�Z�I
IF ABL:MASTER:�Z�I < 5
	ITEMSALES:�y�Z�IUP�z = 0
ELSE
	ITEMSALES:�y�Z�IUP�z = -2
ENDIF
IF ABL:MASTER:�Z�I
	ITEMSALES:�y�Z�IDOWN�z = 0
ELSE
	ITEMSALES:�y�Z�IDOWN�z = -2
ENDIF

;���L�ϐ�
IF TALENT:MASTER:���L�ϐ� < 2
	ITEMSALES:�y���L�ϐ�UP�z = 0
ELSE
	ITEMSALES:�y���L�ϐ�UP�z = -2
ENDIF

IF TALENT:MASTER:���L�ϐ� > -2
	ITEMSALES:�y���L�ϐ�DOWN�z = 0
ELSE
	ITEMSALES:�y���L�ϐ�DOWN�z = -2
ENDIF

;TSLv
;	������(ITEM.csv�ł̓R�����g�A�E�g)
IF ABL:MASTER:TSLv > 4
	ITEMSALES:70 = -2
ENDIF

SIF TALENT:MASTER:�֒f�̒m��
	ITEMSALES:�y�֒f�̒m���z = -1
SIF TALENT:MASTER:�����m��
	ITEMSALES:�y�����m���z = -1
;������
SIF TALENT:MASTER:���L�ϐ� == 2
	ITEMSALES:60 = -1

FOR LOCAL, 0, 100
	;ITEMSTOCK�Œe���̂ōl�����Ȃ�
	SIF !STRLENS(ITEMNAME:LOCAL)
		CONTINUE
	SELECTCASE LOCAL
		;��܂�
		CASE 0 TO 39, 94, 95
			ITEMSALES:LOCAL = 0
			SIF ITEM:LOCAL
				ITEMSALES:LOCAL = -1
			;����A�C�e���͍ēx�w���ł���悤�ɗ�O����
			SIF GROUPMATCH(ITEMNAME:LOCAL, "���[�^�[", "�܂��ݎP", "�N���X�}�X�v���[���g", "�َq�܂�")
				CONTINUE
			;�O�̂��߃G���[����
			IF !INRANGE(LOCAL, 0, 39)
			ELSEIF GETBIT(FLAG:�A�C�e���w���ς�, LOCAL)
				ITEMSALES:LOCAL = -1
			ENDIF
		;�Z��
		CASE 41
			ITEMSALES:LOCAL = -2
			SIF ABL:MASTER:���{ >= 2
				ITEMSALES:LOCAL = 0
		;�֒f
		CASE 70 TO 100
			;���؂̏ꍇ�͂��̂܂�
			SIF ITEMSALES:LOCAL == -1
				CONTINUE
			ITEMSALES:LOCAL = -2
			;eraTW�ł�ASSI���������Ȃ��̂ŏ���������
			SELECTCASE LOCAL
			CASE 90, 71 TO 78
			;�֒f�̒m��
				SIF TALENT:MASTER:�֒f�̒m��
					ITEMSALES:LOCAL = 0
				;LOCAL:1 =
				SELECTCASE ITEMNAME:LOCAL
				CASE "��̍ޗ�(�o)"
					SIF FINDCHARA(TALENT:����, 1) == -1
						ITEMSALES:LOCAL = -2
				CASE "��̍ޗ�(��)"
					SIF FINDCHARA(TALENT:����, 3) == -1
						ITEMSALES:LOCAL = -2
				CASE "���L�����f�B"
				;�̂���������L�����f�B�B����̎��ɂȂ�A�R�����g�A�E�g���

				CASE "�Ԃ��L�����f�B"
				;�̂���Ԃ�L�����f�B�B���������Đ�����
				;�S���������Ł����Ȃ��̏ꍇ�͔������Ⴄ�i�I�g�R��TALENT:���� == 0�j����
				;�����܂ł��̃����h�C
					SIF ALLSAMES(-1, FINDCHARA(TALENT:����, 0), FINDCHARA(TALENT:����, -1))
						ITEMSALES:LOCAL = -2
				CASE "���F�̃L�����f�B"
				;�b�̓����𓾂�L�����f�B�B��������������
					SIF FINDCHARA(TALENT:������, 0) == -1
						ITEMSALES:LOCAL = -2
				CASE "���F�̃L�����f�B"
				;�b�̓����𖳂����L�����f�B�B��������������
					SIF !SUMCARRAY(TALENT:������)
						ITEMSALES:LOCAL = -2
				ENDSELECT
			CASE 70, 91, 92
			;�����m��
			;3�Ƃ�������
				SIF TALENT:MASTER:�����m��
					ITEMSALES:LOCAL = 0
			CASE 95
			;�َq�܂�
				ITEMSALES:LOCAL = 0
			ENDSELECT
	ENDSELECT
NEXT

;�����ԏ�
IF CFLAG:MASTER:329
	ITEMSALES:65 = 0
ELSE
	ITEMSALES:65 = -2
ENDIF

@EX_SHOPPING(ARGS,ARGS:1,ARG,ARG:1)
;ARGS ���i���@ARGS:1 �����@ARG ���͂���ԍ��@ARG:1 ���i
VARSET LOCALS
SIF !ARG:1
	ARG:1 = ITEMPRICE:ARG
LOCALS = [{ARG}] %ARGS% ��{ARG:1}
SIF GROUPMATCH( ITEMSTOCK(ARG), 2, 5 )
	SETCOLOR 150,150,150
PRINTFORML %LOCALS,48,LEFT%%ARGS:1%
RESETCOLOR

@BUY_ABLE(ARG,�w���z,��=1,ARG:3)
;ARG=���i
;ARG:1=���i�A0����ITEMPRICE:ARG
;ARG:2=��
;ARG:3=�Z�[���i�l�������j
;�i�����w�������RETURN 1�A�Ȃ�₩���ł��Ă��Ȃ���RETURN 0
#DIM ��
#DIM �w���z
SIF !�w���z
	�w���z = ITEMPRICE:ARG * ��

	�w���z = �w���z * (100 - ARG:3) / 100
IF MONEY < �w���z
	PRINTW ����������Ȃ�
ELSEIF ARG < 0 || ARG >= 1000 || !STRLENS(ITEMNAME:ARG) || ITEMSALES:ARG == -2
	PRINTW �����Ȑ��l�ł�
ELSEIF ITEMSALES:ARG == -1
	PRINTW ����؂�ł�
ELSEIF ITEMSALES:ARG > 0 && ITEMSALES:ARG < ��
	PRINTW ����Ȃɂ���܂���
ELSEIF (�� && ITEM:ARG >= (100 - ��)) || ITEM:ARG > 99
	PRINTW �\�������Ă���
ELSE
	ITEM:ARG += ��
	MONEY -= �w���z
	SELECTCASE ITEMSALES:ARG
	CASE IS > 1
		ITEMSALES:ARG --
	CASE 1
		ITEMSALES:ARG = -1
	ENDSELECT
	PRINTFORMW %ITEMNAME:ARG%����{�w���z}��\@ �� > 1 ? {��}�� #  \@�w�����܂���
	RETURN 1
ENDIF
RETURN 0

;�A�C�e���܂Ƃߔ����֐�
;���ǂ񂿂�񂩂�܂Ƃߔ��������������̂œƗ��֐���
;�K�����@ITEMSTOCK�Ŕ��肵�čw���\�ȃA�C�e���݂̂ŌĂяo������
;�P�̍w����p���낤���܂Ƃߔ����\���낤���w���s�̔���͕K�v�Ȃ̂Ő�ɋ��ʂōs���ĉ�����
;ARG�F�w���ΏۃA�C�e��
@ITEM_MATOMEGAI(ARG)
#DIM �w���\��
#DIM CONST �ő�� = 99

PRINTFORM %ITEMNAME:ARG%�������w�����܂����H
;ITEM:50�ȊO�̌�����A�C�e���ł������悤�ɂ����i������SIF�ȍ~�̏����ł͌��X�����Ȃ��Ă��j
;�s��o�邩��
;SIF ARG == 50
SIF ITEMSALES:ARG > 0
	PRINTFORM (����{ITEMSALES:ARG}��)
PRINTL

�w���\�� = MIN( �ő��  - ITEM:ARG, ( ITEMPRICE:ARG > 0 ? MONEY / ITEMPRICE:ARG # �ő��  ), ( ITEMSALES:ARG > 0 ? ITEMSALES:ARG # �ő��  ) )
�w���\�� = LIMIT( �w���\��, 0, �ő�� )

;�����A�A�C�e�����̒��߂͂��Ƃō��킹��
PRINTL [0]  - ��߂�
SIF �w���\��
 PRINT [1]  - 1�@
SIF �w���\�� >= 5
 PRINT [5]  - 5�@
SIF �w���\�� >= 10
 PRINT [10] - 10�@
SIF �w���\�� >= 20
 PRINT [20] - 20�@
SIF �w���\�� >= 50
 PRINT [50] - 50�@
SIF NOSAMES(�w���\��, 0, 1, 5, 10, 20, 50)
 PRINT [99] - �����邾��
INPUT

IF RESULT >= 1
	RESULT = LIMIT( MIN( �w���\��, RESULT ), 0, 99 )
	;������
	IF ITEMSALES:ARG > 0
		RESULT = MIN( ITEMSALES:ARG, RESULT )
		ITEMSALES:ARG -= RESULT
		SIF ITEMSALES:ARG <= 0
			ITEMSALES:ARG = -1
	ENDIF
	;�w������
	ITEM:ARG += RESULT
	PRINTFORMW %ITEMNAME:ARG%��{RESULT}�A\\{RESULT * ITEMPRICE:ARG}�ōw�����܂���
	MONEY -= RESULT * ITEMPRICE:ARG
ENDIF

;ITEM���������X�g�\���֐�
;�u�Ƃ肠��������Ō��₷���`�ł̎����v�����邱�Ƃɂ���
;�{����@ITEM_TYPE�Ŕ��肷��ق����X�}�[�g�Ȃ̂��������������^�Ȃ̂��l�b�N�ł���
;���ꂩ������z�ɑ��z���d�˂Ă������ꗂ��������̂͊ԈႢ�Ȃ����ЂƂ܂��Ǝ��ɕ��ނ���
;����̔��W�ɂƂ��Ȃ��Ď���瘨�����Ă��������ꂪ����̂Œ���
;�I舂�DRAWLINE������TYPE == "�S��"�ō������ƂɂȂ�̂ŌĂяo�����ł��
;ITEM�������Ƃ���DRAWLINE��d�\�����̕��Q�͂��邩����������[�Ȃ�
@LIST_ITEM(TYPE = "�S��")
#DIMS TYPE
#DIM DYNAMIC �\����
#DIM DYNAMIC LO
#DIM DYNAMIC HI
LO = 0
HI = 1000
�\���� = 0

SELECTCASE TYPE
CASE "�S��"
;���₷�����X�g�ɂ�������
;ITEM�ԍ����ł͂Ȃ��p�r�␫���̋߂����̂ŕ��ׂĂ���_�ɒ���

;����i�Ȃ�
	CALL LIST_ITEM("SHOP_����")
	CALL LIST_ITEM("SHOP_���p�i")
	CALL LIST_ITEM("SHOP_�f��")
	CALL LIST_ITEM("SHOP_�̎��ω�")

;���Օi��
;���̑������Ԃ���Օi
	CALL LIST_ITEM("SHOP_���Օi")
	CALL LIST_ITEM("SHOP_���H��")
	CALL LIST_ITEM("�`���R")
	CALL LIST_ITEM("���")
	CALL LIST_ITEM("���|�p�i")
	CALL LIST_ITEM("���̑�")
	CALL LIST_ITEM("��")

;�f�ނȂǁA����قږ������H
	CALL LIST_ITEM("�f��")
	CALL LIST_ITEM("����")
	CALL LIST_ITEM("�ߑ�")

;�M�d�i�H
	CALL LIST_ITEM("��p")
	CALL LIST_ITEM("����")

;�R�}���h
CASE "��������i", "�͓�����"
	CALL ITEM_RANGE, TYPE
	LO = RESULT:0
	HI = RESULT:1
	FOR LOCAL, LO, HI
		IF ITEM:LOCAL && ITEM_TYPES(LOCAL, TYPE)
			�\���� ++
			PRINTFORMLC �@%ITEMNAME:LOCAL%\@ ITEM:LOCAL > 1 ? �~{ITEM:LOCAL} #\@
			SIF �\���� % 4 == 0
				PRINTL
		ENDIF
	NEXT
	SIF !LINEISEMPTY()
			PRINTL

;�e��ITEM : @ITEM_TYPES �� ITEM_RANGE�ɂ�镪��
; ��̃R�}���h�p�Ɠ����ɂ��Ă��������ǁA�����Ă���
{
CASE "SHOP_����", "SHOP_���Օi", "SHOP_���p�i", "SHOP_���H��", "SHOP_�f��", "SHOP_�̎��ω�",
		"�`���R", "���|�p�i", "���", "���̑�", "��p", "��",
		"�f��", "����", "�ߑ�", "����"
}
	; ���[�v�͈͂̎擾: �ʂ� 0�`1000�Œ�ł��ǂ��񂾂���
	CALL ITEM_RANGE, TYPE
	LO = RESULT:0
	HI = RESULT:1

	FOR LOCAL, LO, HI
		IF ITEM:LOCAL && ITEM_TYPES(LOCAL, TYPE)
			�\���� ++
			PRINTFORMLC �@%ITEMNAME:LOCAL%\@ ITEM:LOCAL > 1 ? �~{ITEM:LOCAL} #\@
			SIF �\���� % 4 == 0
				PRINTL
		ENDIF
	NEXT
	SIF !LINEISEMPTY()
			PRINTL
ENDSELECT

;------------------------------------------------------------------------
;  ���āE�����E�c�̍݌ɕ�[
;	�G����1���̏I����+10�A���X�ɂ͍ő��20���ۊǂ���܂�
;	�ÕĂ�1���̏I����+7�A���X�̍ő�݌ɂ�15�ł�
;	���Ă�1���̏I����+5�A���X�̍ő�݌ɂ�10�ł�
;
@EVENTTURNEND
#DIM zaiko_lcount
#DIM loop_lo
#DIM loop_hi
#PRI
CALL ���X�ɓ���, "�G��",		10,	20
CALL ���X�ɓ���, "�Õ�",		7,	15
CALL ���X�ɓ���, "����",		5,	10

; �ʔ̂̂����͍݌ɂ����Ȃ��ł�
;	��R����������΁A���܂ōs���܂��傤
CALL ���X�ɓ���, "�ǂԂ낭",	5,	10
CALL ���X�ɓ���, "����",		3,	10
CALL ���X�ɓ���, "�S�E��",		1,	10
CALL ���X�ɓ���, "�Î�",		7,	20

CALL ITEM_RANGE, "�ԉ�"
loop_lo = RESULT:0 + 1
loop_hi = RESULT:1
FOR zaiko_lcount, loop_lo, loop_hi
	; �c��1��1��1���ׁA�ő�݌ɂ�3�ł�
	;	�c��e���ɂ���Ƃ䂤�����ɓ{���܂���H
	CALL ���X�ɓ���, TOSTR(zaiko_lcount), 1,	3
NEXT
; RETURN 1 ���Ă͂����܂���

;------------------------------------------------
; ���X�ɓ��� �֐�
;	EVENTTURNEND�ł̓��ׂ� �����ł̔��p�̎��Ɏg��
;
@���X�ɓ���, ���O, ���ח�, �ő�݌�
#LOCALSIZE 1
#DIMS ���O
#DIM ���ח�
#DIM �ő�݌�
#DIM ITEM_NO
SIF ���O == "" || !���ח� || !�ő�݌�
	RETURN
IF ISNUMERIC( ���O )
	ITEM_NO = TOINT( ���O )
ELSE
	ITEM_NO = GETNUM( ITEM, ���O )
ENDIF
SIF ITEM_NO < 0
	RETURN

SELECTCASE ITEMSALES:ITEM_NO
CASE -1
	ITEMSALES:ITEM_NO = ���ח�
CASE IS >= �ő�݌�
	; �ߏ�݌ɂ̂Ƃ��͍݌ɓ��ׂ��Ȃ�
CASE IS > 0
	ITEMSALES:ITEM_NO = MIN( ITEMSALES:ITEM_NO + ���ח�, �ő�݌� )
ENDSELECT


code:
@TURN_RESET
;�����r��
FOR LOCAL, 0, CHARANUM
	SIF !TCVAR:LOCAL:�j�Z
		CONTINUE
	IF TCVAR:LOCAL:�j�Z == 1
		IF TALENT:LOCAL:���� == 1
			TALENT:LOCAL:���� = 0
			EX:LOCAL:�����r���`�F�b�N = 1
		ENDIF
		IF LOCAL && (FLAG:���Ԓ�~ || TCVAR:LOCAL:�D�� || CFLAG:LOCAL:����)
			TALENT:LOCAL:���� = -1
			EX:LOCAL:�����r���`�F�b�N = 1
			CFLAG:LOCAL:292 = 1
		ENDIF
	ENDIF
	IF TCVAR:LOCAL:�j�Z == 2 && TALENT:LOCAL:���� == 2
		TALENT:LOCAL:���� = 0
		EX:LOCAL:�����r���`�F�b�N = 2
	ENDIF
	IF TCVAR:LOCAL:�j�Z == -1 && TALENT:LOCAL:���� == -1
		TALENT:LOCAL:���� = 0
		EX:LOCAL:�����r���`�F�b�N = 1
	ENDIF
NEXT

;����r��
IF TALENT:MASTER:2 & 2
	SELECTCASE SELECTCOM
		CASE 60, 61, 65, 67, 68, 320, 322
			TALENT:MASTER:1 |= 1
		CASE 62, 63, 66, 69, 70, 323
			TALENT:MASTER:1 |= 2
	ENDSELECT
ENDIF
IF TALENT:2 & 2
	SELECTCASE SELECTCOM
		CASE 64
			TALENT:1 |= 1
		CASE 92, 93, 94
			TALENT:1 |= 2
		CASE 71
			IF MASTER_POSE(SET_V, SET_P, 1)
				TALENT:1 |= 2
			ELSE
				TALENT:1 |= 1
			ENDIF
	ENDSELECT
ENDIF

;��������
IF FLAG:���Ԓ�~ == 0
	FOR LOCAL, 1, CHARANUM
		SIF CFLAG:LOCAL:���ӂ� && !TCVAR:LOCAL:���� && !TCVAR:LOCAL:�Z�� && !TCVAR:LOCAL:�D�� && !CFLAG:MASTER:�C�^�Y�� && !TCVAR:LOCAL:�����
			SETBIT CFLAG:LOCAL:�������� , 1
	NEXT
ENDIF
;�L�X����
;���ӎ擾
SIF (SELECTCOM == 312 || SELECTCOM == 602) && TFLAG:193 != 99 && !CFLAG:MASTER:�C�^�Y��
		SETBIT CFLAG:��������, 0

;��������
;���l�擾
IF SELECTCOM == 352 && TFLAG:193
	SETBIT CFLAG:��������, 2
	SETBIT CFLAG:MASTER:��������, 2
	TALENT:MASTER:���l = NO:TARGET
	TALENT:���l = NO:TARGET
	;�Z�t���폜
	IF TALENT:TARGET:�Z�t�� == 1
		TALENT:TARGET:�Z�t�� = 0
	ENDIF
ENDIF

;�H��
SIF SELECTCOM == 414 || SELECTCOM == 415
	CALL RESET_DISH

;����������1�^�[���ۑ�
FOR LOCAL, 0, CHARANUM
	SIF CFLAG:LOCAL:���݈ʒu == SUKIMA()
		CONTINUE
	TCVAR:LOCAL:110 = TCVAR:LOCAL:10
	TCVAR:LOCAL:112 = TCVAR:LOCAL:12

	SIF TCVAR:LOCAL:102
		TCVAR:LOCAL:102 --
	SIF !TCVAR:LOCAL:102
		TCVAR:LOCAL:103 = -1
	SIF TCVAR:LOCAL:104
		TCVAR:LOCAL:104 --
	SIF !TCVAR:LOCAL:104
		TCVAR:LOCAL:105 = -1
	;�̈ʂ̕ۑ�
	FOR LOCAL:1, 1, 11
		TEQUIP:LOCAL:(110 + LOCAL:1) = TEQUIP:LOCAL:(100 + LOCAL:1)
	NEXT
	;�̐�����
	IF TCVAR:LOCAL:�̐�����
		TCVAR:LOCAL:�̐����� --
		SIF TCVAR:LOCAL:�̐����� == 0
			TCVAR:LOCAL:�̐� = 0
	ENDIF
	;�ʒu�֌W����
	IF TCVAR:LOCAL:�ʒu�֌W����
		TCVAR:LOCAL:�ʒu�֌W���� --
		SIF TCVAR:LOCAL:�ʒu�֌W���� == 0
			TCVAR:LOCAL:�ʒu�֌W = 0
	ENDIF
	;���łɎː������p������ϐ��̏�����
	CSTR:LOCAL:10 = /
	CSTR:LOCAL:11 = /
	;�����t���O
	IF FLAG:���Ԓ�~ == 1
	ELSE
		CALL CLOTHES_SETTING_TRAIN(LOCAL)
	ENDIF
	IF BATHROOM(CFLAG:LOCAL:���݈ʒu) && GET_MAPID(CFLAG:LOCAL:���݈ʒu) == MAIN_MAP
		;���C�t���O��MOVEMENT���ʏ����ֈړ����܂���
;		CFLAG:LOCAL:���C = 0
		RESET_STAIN LOCAL
		CFLAG:LOCAL:�S���ː� = 0
		CFLAG:LOCAL:�A�i���ː� = 0
		CFLAG:LOCAL:���ɐ��t = 0
		CFLAG:LOCAL:��ɐ��t = 0
		CFLAG:LOCAL:��ɐ��t = 0
	ELSEIF CFLAG:LOCAL:���C > 120 && !CFLAG:LOCAL:���ӂ�
		STAIN:LOCAL:�` |= ����_�A�i��
	ENDIF
NEXT
;BASE�̕ϓ�
FOR LOCAL, 0, CHARANUM
	SIF CFLAG:LOCAL:���݈ʒu == SUKIMA()
		CONTINUE
	;�u�N�x
	;���Z��
	CFLAG:LOCAL:�u�N�x�Q = BASE:LOCAL:�u�N
	BASE:LOCAL:�u�N = MIN(MAXBASE:LOCAL:�u�N, BASE:LOCAL:�u�N)
	IF NOWEX:LOCAL:�ː�
		IF !MASTER_POSE(SET_V, SET_P) && !MASTER_POSE(SET_A, 1)
			BASE:LOCAL:�u�N = BASE:LOCAL:�u�N * (ABL:LOCAL:�~�] + 1) * (BASE:LOCAL:���� + 200) / ((MAXBASE:LOCAL:���� + 200) * (ABL:LOCAL:�~�] + 10))
		ELSE
			BASE:LOCAL:�u�N = 1000
		ENDIF
	ENDIF
NEXT

SIF CFLAG:MASTER:���ӂ�
	CALL ���ӂӒ�����C�x���g

;�t���O�̃��Z�b�g
TFLAG:192 = 0
TFLAG:193 = 0
TFLAG:194 = 0
TSTR:2 =

;TCVAR�̃��Z�b�g
FOR LOCAL,0,CHARANUM
	SIF CFLAG:LOCAL:���݈ʒu == SUKIMA()
		CONTINUE
	FOR LOCAL:1, 0, 100
		TCVAR:LOCAL:(LOCAL:1) = 0
	NEXT
;�}������
	TCVAR:LOCAL:100 = TEQUIP:LOCAL:50
	TCVAR:LOCAL:101 = TEQUIP:LOCAL:51
NEXT

TFLAG:110 = TCVAR:MASTER:��ꍇ��

;FIRSTTIME��SELECTCOM���Ԃ�����
CALLF FIRSTTIME(SELECTCOM)
FOR LOCAL, 1, CHARANUM
	SIF EXP_UP(15, LOCAL)
		CALLF FIRSTTIME("����", 0, LOCAL)
NEXT
;�ː��ӏ�
FOR LOCAL:1, 0, 60
	IF GETBIT(TFLAG:1, LOCAL:1)
		LOCALS = "�ː�"{LOCAL:1}
		CALLF FIRSTTIME(LOCALS, 0, TARGET)
	ENDIF
NEXT
PREVCOM = SELECTCOM
;�h���R�}���h�̗���
TFLAG:151 = TFLAG:50
;�O���TARGET
IF TFLAG:�O��̃R�}���h���� > 0
	TFLAG:103 = TARGET
	TFLAG:150 = ASSIPLAY
ENDIF

;�o���l��\���p
FOR LOCAL, 0, CHARANUM
	SIF CFLAG:LOCAL:�o��
		CONTINUE
	;���݈ʒu�̕ۑ�
	CFLAG:LOCAL:�O�^�[���ʒu = CFLAG:LOCAL:���݈ʒu
	FOR LOCAL:1, 0, 100
		TCVAR:LOCAL:(400 + LOCAL:1) = EXP:LOCAL:(LOCAL:1)
	NEXT
NEXT
IF BATHCHECK(CFLAG:MASTER:���݈ʒu) && !FLAG:���Ԓ�~ && AT_HOME(MASTER)
	FOR LOCAL,1,CHARANUM
		SIF ���C�ǂ��o������(LOCAL) && CFLAG:LOCAL:���݈ʒu == CFLAG:MASTER:���݈ʒu
			CALL ���C����ǂ��o��(LOCAL)
	NEXT
ENDIF
;TFLAG�̃��Z�b�g
VARSET TFLAG, 0, 0, 100
TFLAG:400 = 0
TFLAG:�ړ��s�\���b�Z�[�W = 0
;�����ƋC�͂��������Ă���
IF !CFLAG:MASTER:����
	IF NEMUKE() >= 960
		BASE:MASTER:�̗� = MAX(BASE:MASTER:�̗� - 5 * TIME_PROGRESS(TIME:1) , 0)
		BASE:MASTER:�C�� = MAX(BASE:MASTER:�C�� - 10 * TIME_PROGRESS(TIME:1) , 0)
	ELSEIF NEMUKE() >= 840
		BASE:MASTER:�C�� = MAX(BASE:MASTER:�C�� - 2 * TIME_PROGRESS(TIME:1) , 0)
	ENDIF
ENDIF

@���ӂӒ�����C�x���g
#DIM �D�哱���m��
;���Ȃ��哱
IF CFLAG:TARGET:���ӂ� == 1 && CFLAG:���܂��Ă�x > 300
;�U��t�]
	IF SHIRAHU(TARGET) && TEQUIP:TARGET:�̈� == 3
		;���C�ȂقǊm�������������������
		;1/�m��
		�D�哱���m�� = 15
		�D�哱���m�� -= TALENT:TARGET:�x�� * 2
		�D�哱���m�� -= TALENT:TARGET:���� * 2
		�D�哱���m�� -= TALENT:TARGET:�v���C�h * 2
		�D�哱���m�� += TALENT:TARGET:�����S * 3
		�D�哱���m�� -= TALENT:TARGET:���I���� * 3
		�D�哱���m�� += TALENT:TARGET:㵒p�S * 2
		�D�哱���m�� -= TALENT:TARGET:�T�h * 5
		�D�哱���m�� += TALENT:TARGET:�}�] * 5

		;RAND�ɓn���̂ōŒ�l��1
		SIF �D�哱���m�� < 1
			�D�哱���m�� = 1
		IF !RAND(�D�哱���m��)
			CFLAG:MASTER:���ӂ� = 2
			TFLAG:COMABLE�Ǘ� = 3
			FOR LOCAL,1,CHARANUM
				IF CFLAG:MASTER:���݈ʒu == CFLAG:LOCAL:���݈ʒu
					CFLAG:LOCAL:���ӂ� = 2
					LOCAL:1 ++
				ENDIF
			NEXT
			PRINTFORML �C���t���ƁA%CALLNAME:TARGET%\@ LOCAL:1 > 1 ? �B #  \@�Ɏ哱����D���Ă���
		ENDIF
	ENDIF
;����哱
ELSEIF CFLAG:TARGET:���ӂ� == 2
	IF BASE:�C�� <= 0
		PRINTFORML %CALLNAME:TARGET%�͂�����Ɣ�ꂽ�ƌ�����%CALLNAME:MASTER%���������
		CALL �����|����I��("��ꂽ")
	ELSEIF CFLAG:���܂��Ă�x <= 0 && !TCVAR:TARGET:�D���ɂ���
		PRINTFORML %CALLNAME:TARGET%�͖��������悤��
		CALL KIGEN_CHANGE(TARGET,100,1)
		BASE:�{�� = 0
		CFLAG:�s�@�� = 0
		CALL ASK_M("�����o��",1,"�������͂܂��������ĂȂ�",1,"�����ƍU�߂�",ABL:�T�h���C >= 3)
		SELECTCASE RESULT
			CASE 0
				PRINTFORML %CALLNAME:TARGET%��%CALLNAME:MASTER%���������
				CALL �����|����I��("����")
			CASE 1
				PRINTFORML %CALLNAME:MASTER%��%CALLNAME:TARGET%�������|����
				CALL KOJO_MESSAGE_SEND("EVENT",30,TARGET,3)
				FOR LOCAL,0,CHARANUM
					CFLAG:(TARGET:LOCAL):���ӂ� = 1
					IF INROOM(CFLAG:MASTER:���݈ʒu) == 2
						CALL DATUI_SHOES(LOCAL,0)
						CALL DATUI_SHOES(MASTER,0)
					ENDIF
				NEXT
			CASE 2
				PRINTFORML %CALLNAME:TARGET%�͖ڂ��ׂ߁A����Ȃ����܂ł��Ă�����ƚ�����
				CALL KOJO_MESSAGE_SEND("EVENT",30,TARGET,4)
				TCVAR:TARGET:�D���ɂ��� = 1
		ENDSELECT
	ELSEIF OAZUKE(TARGET)
		PRINTFORML ����������H�����%CALLNAME:TARGET%�͕s���������c
		SOURCE:���� += 3000
		SOURCE:���] += 500
		SOURCE:���� -= 1500
	ENDIF
ENDIF

@���C�ǂ��o������(ARG)
#FUNCTION
SIF FLAG:70
	RETURNF 0
SIF !GETBIT(TALENT:MASTER:2,1) && HETEROSEX(MASTER,ARG)
	RETURNF 0
SIF TALENT:ARG:㵒p�S < 0 && ABL:ARG:�e�� >= 5
	RETURNF 0
SIF CFLAG:ARG:���ӂ�
	RETURNF 0
SIF CFLAG:ARG:�ԓx < 2
	RETURNF 1
SIF CFLAG:ARG:�������� < 1
	RETURNF 1
SIF !(TALENT:ARG:���� || TALENT:ARG:�Z�t��)
	RETURNF 1

RETURNF 0

@OAZUKE(ARG)
#FUNCTION
SELECTCASE TCVAR:ARG:20
	CASE 41
	;�����V
		SIF SELECTCOM != 320
			RETURNF 1
	CASE 43
	;�o�b�NV
		SIF SELECTCOM != 322
			RETURNF 1
	CASE 44
	;�o�b�NA
		SIF SELECTCOM != 323
			RETURNF 1
ENDSELECT
RETURNF 0

repo_name: akadiya/eratw

license: unknown


code:
@COM604
#DIM ���ݒn�_
#DIM �ړ���n�_
#DIM ���v����,11
#DIM �s����
#DIM ����V���[�g�J�b�g
;�U�􂷂�
VARSET LOCAL
DRAWLINEFORM �`

CALL DRAW_MAP("ODEKAKE")

DRAWLINEFORM �`
PRINTL �ǂ��Ɍ������܂����H
LOCAL = 6000 + (CFLAG:MASTER:���݈ʒu / 100) * 10
���ݒn�_ = (CFLAG:MASTER:���݈ʒu - (CFLAG:MASTER:�f�[�g�� * 100)) / 10
FOR LOCAL:2, 1, 10
	LOCAL ++
	;���݈ʒu�̓X�L�b�v
	IF (LOCAL - 6000) * 10 == CFLAG:MASTER:���݈ʒu
		PRINT [0] -
		PRINTFORM %NAME_FROM_PLACE(LOCAL), 18, LEFT%
		SETCOLOR 0 , 255, 0
		PRINT ���ݒn
		RESETCOLOR
		LOCAL:3 ++
		SIF !(LOCAL:3 % 2)
			PRINTL
		CONTINUE
	ENDIF
	;�n�_������`�ɂȂ�����X�L�b�v
	SIF NAME_FROM_PLACE(LOCAL) == "" || LOCAL > 6000 + ((CFLAG:MASTER:���݈ʒu / 100) * 10) + 9
		CONTINUE
	���v����:(LOCAL:2) = ABS(���ݒn�_ - LOCAL:2) * 3
	;�i��������
	SIF LOCAL == 6048
		���v����:(LOCAL:2) = ABS(���ݒn�_ - 5) * 3 + 3
	;������
	SIF LOCAL == 6049
		���v����:(LOCAL:2) = ABS(���ݒn�_ - 7) * 3 + 3
	����V���[�g�J�b�g = 0
	;�����̔\��
	IF FLAG:�f�[�g���� == 76
		���v����:(LOCAL:2) = (���v����:(LOCAL:2) * 2) / 3
		����V���[�g�J�b�g = 1
	ENDIF
	;�킩�����P�̕��S
	SIF FLAG:�f�[�g���� == 93 && !GETBIT (FLAG:�v�[��, 0)
		���v����:(LOCAL:2) = (���v����:(LOCAL:2) * 3) / 2
	;�V���[�g�J�b�g����
	SELECTCASE LOCAL
		;�����̒|��
		CASE 6041 TO 6047
			IF SHORTCUT(6)
				���v����:(LOCAL:2) = (���v����:(LOCAL:2) * 2) / 3
				����V���[�g�J�b�g = 2
			ENDIF
		;�V�E
		CASE 6081 TO 6085
			IF CFLAG:MASTER:���݈ʒu == �V�E && SHORTCUT(2)
				���v����:(LOCAL:2) = ���v����:(LOCAL:2) / 2
				����V���[�g�J�b�g = 2
			ENDIF
		CASE 6089
			IF SHORTCUT(2)
				���v����:(LOCAL:2) = ���v����:(LOCAL:2) / 2
				����V���[�g�J�b�g = 2
			ENDIF
		;���E
		CASE 6061, 6062
			IF CFLAG:MASTER:���݈ʒu >= 670 && CFLAG:MASTER:���݈ʒu <= 690 && SHORTCUT(3)
				���v����:(LOCAL:2) = ���v����:(LOCAL:2) / 2
				����V���[�g�J�b�g = 2
			ENDIF
		CASE 6067, 6068, 6069
			IF CFLAG:MASTER:���݈ʒu >= 610 && CFLAG:MASTER:���݈ʒu <= 620 && SHORTCUT(3)
				���v����:(LOCAL:2) = ���v����:(LOCAL:2) / 2
				����V���[�g�J�b�g = 2
			ENDIF
	ENDSELECT
	PRINTFORM [{LOCAL:2}] -
	PRINTFORM %NAME_FROM_PLACE(LOCAL)%
	PRINTFORM %" " *(20 - STRLENS(NAME_FROM_PLACE(LOCAL)))%
	SIF ���v����:(LOCAL:2) < 10
		PRINT
	IF ����V���[�g�J�b�g == 1
		SETCOLOR 250, 220, 180
	ELSEIF ����V���[�g�J�b�g == 2
		SETCOLOR 100, 250, 140
	ENDIF
	PRINTFORM {���v����:(LOCAL:2)}��
	RESETCOLOR
	LOCAL:3 ++
	SIF !(LOCAL:3 % 2)
		PRINTL
NEXT
SIF GROUPMATCH(CFLAG:MASTER:�f�[�g��, 2, 4, 5, 6, 8, 9)
	PRINTL
IF CFLAG:MASTER:���݈ʒu == �V�E && (ABL:MASTER:���{ >= 2 || ABL:(FLAG:�f�[�g����):���{ >= 2)
	���v���� = 10
	SIF SHORTCUT(2)
		���v���� = 5
	PRINT [67] - �ފ݁@�@�@�@�@�@�@
	PRINTFORML {���v����}��
ELSEIF CFLAG:MASTER:���݈ʒu == ������ && (ABL:MASTER:���{ >= 2 || ABL:(FLAG:�f�[�g����):���{ >= 2)
	���v���� = 5
	SIF SHORTCUT(3)
		���v���� = 3
	PRINT [68] - ���E�@�@�@�@�@�@�@
	PRINTFORML {���v����}��
ENDIF
PRINTL [100] - �߂�@�@�@�@�@�@�@�@�@[99] - ���̒n��Ɉړ�
$INPUT_LOOP
INPUT
�s���� = RESULT * 10 + CFLAG:MASTER:�f�[�g�� * 100
SIF RESULT == 100 || RESULT == 0
	RETURN -1
IF RESULT == 99
	DRAWLINE
	CALL OTHERREGIONS
	IF RESULT == 100
		RETURN -1
	ELSE
	ENDIF
	RETURN 1
ELSEIF RESULT == 67
	IF CFLAG:MASTER:���݈ʒu == �V�E && (ABL:MASTER:���{ >= 2 || ABL:(FLAG:�f�[�g����):���{ >= 2)
		CFLAG:MASTER:���݈ʒu = �ފ�
		CFLAG:MASTER:�f�[�g�� = 6
		CFLAG:(FLAG:�f�[�g����):���݈ʒu = �ފ�
		CFLAG:(FLAG:�f�[�g����):�f�[�g�� = 6
		IF FLAG:70
			BASE:MASTER:TSP -= ���v���� * 2
		ELSE
			TIME += ���v����
		ENDIF
		RETURN 1
	ELSE
		RETURN -1
	ENDIF
ELSEIF RESULT == 68
	IF CFLAG:MASTER:���݈ʒu == ������ && (ABL:MASTER:���{ >= 2 || ABL:(FLAG:�f�[�g����):���{ >= 2)
		CFLAG:MASTER:���݈ʒu = ���ʘO��
		CFLAG:MASTER:�f�[�g�� = 6
		CFLAG:(FLAG:�f�[�g����):���݈ʒu = ���ʘO��
		CFLAG:(FLAG:�f�[�g����):�f�[�g�� = 6
		IF FLAG:70
			BASE:MASTER:TSP -= ���v���� * 2
		ELSE
			TIME += ���v����
		ENDIF
		RETURN 1
	ELSE
		RETURN -1
	ENDIF
ELSEIF RESULT < 1 || RESULT > (LOCAL - (6000 + (CFLAG:MASTER:���݈ʒu / 100) * 10) + 1)
	CLEARLINE 1
	RESTART
ELSEIF NAME_FROM_PLACE(RESULT + 6000 + (CFLAG:MASTER:���݈ʒu / 100) * 10) == ""
	CLEARLINE 1
	RESTART
ENDIF

CALL SANSAKU_UNIQUEPLACE(�s����)
SIF RESULT == -1
	RESTART

�ړ���n�_ = RESULT
�s���� = �ړ���n�_ * 10 + CFLAG:MASTER:�f�[�g�� * 100
[IF_DEBUG]
PRINTFORML �ړ���n�_��{�ړ���n�_}�A�s�����{�s����}
[ENDIF]
FOR LOCAL,0,CHARANUM
	SIF CHK_DATENOW(CFLAG:LOCAL:�f�[�g��)
		CFLAG:LOCAL:���݈ʒu = �s����
NEXT
IF FLAG:70 == 1
	BASE:MASTER:TSP -= ���v����:�ړ���n�_ * 2
	IF TFLAG:�^��
		BASE:MASTER:TSP -= ���v����:�ړ���n�_ / 3
		CFLAG:(TFLAG:�^��):���݈ʒu = CFLAG:MASTER:���݈ʒu
	ENDIF
ELSEIF GETBIT(FLAG:�u�Ԉړ�, 0) && BASE:MASTER:TSP > ���v����:�ړ���n�_ * 2 && !FLAG:�f�[�g����
	BASE:MASTER:TSP -= ���v����:�ړ���n�_ * 2
ELSE
	TIME += ���v����:�ړ���n�_
	SIF CHK_DATENOW(CFLAG:93:�f�[�g��) && !GETBIT (FLAG:�v�[��, 0)
		BASE:MASTER:�̗� = MAX(BASE:MASTER:�̗� - 50,500)
	PRINTFORML {���v����:�ړ���n�_}��������%STR:(6000 + �s���� / 10)%�Ɉړ�����
ENDIF

RETURN 1

;-------------------------------------------------
;���s�\����
;-------------------------------------------------
;�U�􂷂�
@COM_ABLE604
SIF TFLAG:�ϑz��
	RETURN 0
;�ꊇ�Ǘ�
SIF GLOBAL_COMABLE(604)
	RETURN RESULT
;�f�[�g���ȊO
SIF AT_HOME(MASTER)
	RETURN 0
SIF CFLAG:���ӂ�
	RETURN 0
;�f�[�g����
SIF (CFLAG:���݈ʒu % 100) % 10
	RETURN 0
;�ϑz��
SIF TFLAG:�ϑz�� == 1
	RETURN 0
RETURN 1

@SANSAKU_UNIQUEPLACE(ARG)
#DIM ���ݒn�_
#DIM �ړ���n�_

���ݒn�_ = (CFLAG:MASTER:���݈ʒu - (CFLAG:MASTER:�f�[�g�� * 100)) / 10
�ړ���n�_ = (ARG - (CFLAG:MASTER:�f�[�g�� * 100)) / 10

SELECTCASE ARG
	CASE �ފ�, ���ʘO��, ���ʘO, �V�E
		IF ABL:MASTER:���{ < 1 && ABL:(FLAG:�f�[�g����):���{ < 1
			PRINTFORMW �����������{��t���Ȃ��Ɗ댯��
			CLEARLINE 2
			RETURN -1
		ENDIF
	CASE ���̓s, �Ȍ���, �ʓe�̊X, ���с`���l, �Â��̊C
		IF ABL:MASTER:���{ < 2 && ABL:(FLAG:�f�[�g����):���{ < 2
			PRINTFORMW �����������{��t���Ȃ��Ɗ댯��
			CLEARLINE 2
			RETURN -1
		ENDIF
	CASE 480
		IF !FLAG:70 && !�i�����N������()
			PRINTL ���֓��낤�Ƃ������A������œe�����Ɏ~�߂�ꂽ
			IF ���ݒn�_ == 5
				RETURN -1
			ELSE
				RETURN 5
			ENDIF
		ENDIF
		SIF FLAG:70
			PRINTFORMW ���f�œ�����
	CASE �A�ꍞ�ݏh,���u�z
		IF !FLAG:�f�[�g����
			PRINTW ��l�ōs���Ă��d���Ȃ�
			CLEARLINE 2
			RETURN -1
		ENDIF
		IF MONEY < 3000
			PRINTW ����������Ȃ�
			CLEARLINE 2
			RETURN -1
		ENDIF
		SIF !GETBIT(CFLAG:(FLAG:�f�[�g����):�������� , 1)
			CALL ������((FLAG:�f�[�g����))
		IF TCVAR:(FLAG:�f�[�g����):�����񂹏��� >= 6 && !TCVAR:(FLAG:�f�[�g����):�D��
				PRINTFORMW %CALLNAME:(FLAG:�f�[�g����)%�ɓ���̂����ۂ���Ă��܂���
				IF TCVAR:(FLAG:�f�[�g����):�����񂹏��� == 6
					PRINTFORMW ������%CALLNAME:(FLAG:�f�[�g����)%�͂܂񂴂�ł��Ȃ�������
					CLEARLINE 1
				ENDIF
			CLEARLINE 2
			RETURN -1
		ELSE
			PRINTL \3000������܂��B�X�����ł����H
			CALL ASK_YN
			IF RESULT == 0
				MONEY -= 3000
				IF TCVAR:(FLAG:�f�[�g����):�D��
					PRINTFORMW %CALLNAME:(FLAG:�f�[�g����)%���N�O�Ƃ��Ă���̂��������ƂɁA%CALLNAME:MASTER%�͔ޏ���%STR:(6000 + ARG / 10)%�ւƘA�ꍞ��
				ELSE
					PRINTFORMW %CALLNAME:MASTER%��%CALLNAME:(FLAG:�f�[�g����)%��%STR:(6000 + ARG / 10)%�ɓ�����
				ENDIF
				RETURN �ړ���n�_
			ELSE
				CFLAG:(FLAG:�f�[�g����):���ӂ� = 0
				CFLAG:MASTER:���ӂ� = 0
				RETURN -1
			ENDIF
			CFLAG:(FLAG:�f�[�g����):���ӂ� = 0
			CFLAG:MASTER:���ӂ� = 0
		ENDIF
ENDSELECT

RETURN �ړ���n�_

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/COMF/外出系/COMF604 散策する.ERB


code:
@COM619
#DIM �ǂԂ낭�̔���
#DIM ����̔���
#DIM �S�E���̔���
#DIM �݌ɑ�����
;RAND��������͈̂�����
IF FLAG:�Ō�Ɏ����ɖK�ꂽ�� != DAY
	;������͎����i����
	IF FLAG:�J�n�� == DAY
		�ǂԂ낭�̔��� = RAND:(4 + FLAG:�����̔��p���t���O * 4)
		����̔���     = RAND:(3 + FLAG:�����̔��p���t���O * 3)
		�S�E���̔���   = RAND:(2 + FLAG:�����̔��p���t���O * 2)
	ELSE
		�ǂԂ낭�̔��� = RAND:(6 + FLAG:�����̔��p���t���O * 8)
		����̔���     = RAND:(5 + FLAG:�����̔��p���t���O * 6)
		�S�E���̔���   = RAND:(4 + FLAG:�����̔��p���t���O * 4)
	ENDIF
	;�ݐύw���z�ɉ����Ă��݌ɂ�����
	IF FLAG:�����ł̗ݐύw���z
		�݌ɑ����� = MAX(FLAG:�����ł̗ݐύw���z / 100000 - 2, 0) + 1
		�ǂԂ낭�̔��� += RAND:�݌ɑ�����
		����̔���     += RAND:�݌ɑ�����
		�S�E���̔���   += RAND:�݌ɑ�����
	ENDIF
ENDIF

IF FLAG:�Ō�Ɏ����ɖK�ꂽ�� == 0
	PRINTL �u���߂Ă̂��q���񂾂ˁH�T�[�r�X�����v
ELSEIF DAY - FLAG:�Ō�Ɏ����ɖK�ꂽ�� > 7
	PRINTL �u���v���Ԃ�ł��ˁ[�A�ǂ������������v
ELSEIF FLAG:�Ō�Ɏ����ɖK�ꂽ�� == DAY
	PRINTL �u��������Ⴂ�A���Ă����H�ǂ������́H�v
ELSEIF FLAG:�����ł̗ݐύw���z > 1000000 && FLAG:�J�n�� != DAY
	PRINTL �u��������Ⴂ�A%CALLNAME:MASTER%�̂��߂ɑ�R�d����Ă�������v
ELSEIF FLAG:�J�n�� == DAY
	PRINTL �u�Ԃ����������ˁA�������������q���񂪂قƂ�ǔ����čs�����������v
ELSEIF �ǂԂ낭�̔��� + ����̔��� + �S�E���̔��� > 30
	PRINTL �u��������Ⴂ�A�����������������񂻂���Ă��[�v
ELSE
	PRINTL �u��������Ⴂ�܂��[�v
ENDIF
SIF FLAG:�������拭��
	PRINTFORML �u�������ܔ��拭���L�����y�[��������@�����Ă����Ȃ�F��t�����v
$INPUT_LOOP2
PRINTL [0] - ���𔃂�
PRINTL [1] - ���𔄂�
PRINTL [100] - �߂�
$INPUT_LOOP
INPUT

IF RESULT == 0
	CALL ���w��(�ǂԂ낭�̔���,����̔���,�S�E���̔���)
	GOTO INPUT_LOOP2
ELSEIF RESULT == 1
	CALL ������(�ǂԂ낭�̔���,����̔���,�S�E���̔���)
	GOTO INPUT_LOOP2
ELSEIF RESULT != 100
	GOTO INPUT_LOOP
ENDIF

FLAG:�Ō�Ɏ����ɖK�ꂽ�� = DAY
IF FLAG:�����̗ݐϓ]�����v > 3000000 && FLAG:�����̔��p���t���O == 2
	FLAG:�����̔��p���t���O = 3
	PRINTL
	PRINTL �X���o�悤�Ƃ���ƌĂю~�߂�ꂽ
	PRINTL �u��R�����������Ă���Ė{���ɏ������`�A���x��������Ɣ�����z�������ˁv
ELSEIF FLAG:�����̗ݐϓ]�����v > 1000000 && FLAG:�����̔��p���t���O == 1
	FLAG:�����̔��p���t���O = 2
	PRINTL
	PRINTL �X���o�悤�Ƃ���ƌĂю~�߂�ꂽ
	PRINTL �u��R�����������Ă���ď������[�A������z�����邩������Ɖ����Ă݂Ȃ��H�v
ELSEIF FLAG:�����̗ݐϓ]�����v > 100000 && FLAG:�����̔��p���t���O == 0
	FLAG:�����̔��p���t���O = 1
	PRINTL
	PRINTL �X���o�悤�Ƃ���ƌĂю~�߂�ꂽ
	PRINTL �u���������������Ă���Ă��肪�Ƃ��A���Ɏ��񂩂甃����z������ˁ[�v
ELSE
	PRINTL �u�܂��̂��������[�v
ENDIF
TIME += 10
RETURN -1

@���w��(�ǂԂ낭�̔���,����̔���,�S�E���̔���)
#DIM REF �ǂԂ낭�̔���
#DIM REF ����̔���
#DIM REF �S�E���̔���
#DIM �̔���
#DIM �����\��
#DIM �l����
#DIM �I���������i
#DIM �w����
#DIM �����Ɣ�����

;�l������20���ɐݒ�(�艿��80���Ŕ̔�)
�l���� = 20

;���ꂼ��̂����̍ő及���\����80�ɐݒ�(80�ȏ㎝���Ă�Ƃ��̂����͔����܂���)
�����\�� = 80

PRINTL
IF FLAG:�Ō�Ɏ����ɖK�ꂽ�� == 0
	PRINTL �u���߂Ă�����T�[�r�X���[�v
	;�l������40���ɐݒ�(�艿��60���Ŕ̔�)
	�l���� = 40
ELSE
	PRINTL �u�ǂ��������������[�v
ENDIF
$INPUT_LOOP2
PRINTFORML ������:\\%TOSTR(MONEY,"#,###")%
FOR LOCAL,51,54
	SELECTCASE LOCAL
		CASE 51
			�̔��� = �ǂԂ낭�̔���
		CASE 52
			�̔��� = ����̔���
		CASE 53
			�̔��� = �S�E���̔���
	ENDSELECT
	LOCALS = [{LOCAL}]%ITEMNAME:(LOCAL),8,LEFT%	(\\%TOSTR(ITEMPRICE:(LOCAL) * (100 - �l����) / 100),5,RIGHT%)
	IF ITEMPRICE:LOCAL
		PRINTFORM %LOCALS%
		IF �̔��� == 0
			SETCOLOR C_RED
			PRINT 	(���؂�)
			RESETCOLOR
		ELSE
			PRINTFORM 	(�݌�:{�̔���})
		ENDIF
		IF ITEM:LOCAL >= �����\��
			SETCOLOR C_YELLOW
			PRINTFORM \t����:{ITEM:LOCAL,2,RIGHT}
			FONTSTYLE 1
			PRINTL �w���s��
			RESETCOLOR
			FONTREGULAR
		ELSE
			PRINTFORML \t����:{ITEM:LOCAL,2,RIGHT}
		ENDIF
	ENDIF
NEXT
PRINT [100] - �߂�
$INPUT_LOOP
INPUT
IF RESULT == 100
	RETURN -1
ELSEIF RESULT >= 51 && RESULT <= 53

	;���Ƃł������INPUT���g�����ߍ��̒l��ޔ�
	�I���������i = RESULT

	;�I�񂾔ԍ��ɂ��������Ĕ̔������i�[
	SELECTCASE �I���������i
		CASE 51
			�̔��� = �ǂԂ낭�̔���
		CASE 52
			�̔��� = ����̔���
		CASE 53
			�̔��� = �S�E���̔���
	ENDSELECT

	;�i�؂�̏ꍇ
	IF �̔��� == 0
		PRINTL
		PRINTL �u���߂�Ȃ����A����؂ꂿ�Ⴂ�܂����v

	;�ő及���\���ȏ�̂������������Ă���ꍇ
	ELSEIF ITEM:�I���������i >= �����\��
		PRINTL �u���q����A���ꂾ�������Ă�Ώ\���ł���H�@�ނ��뉵���Ă��傤������[�v

	;����ȊO�̏ꍇ����q�˂�
	ELSE
		�w���� = 0
		$BUY_LOOP
		PRINTFORML %ITEMNAME:�I���������i%���������������c
		PRINTFORML �������F{�w����}
		PRINTFORML [ -10]�@[  -1]�@[  +1]�@[ +10]
		PRINTBUTTON "[�S��] ", 999
		PRINTBUTTON " [���Z�b�g]", -999
		PRINTL
		PRINTBUTTON "[����]", 0
		INPUT
		IF RESULT
			IF RESULT == 999
				�w���� = �̔���
			ELSEIF RESULT == -999
				�w���� = 0
			ELSE
				�w���� = LIMIT(�w���� + RESULT, 0, �̔���)
			ENDIF
			CLEARLINE 6
			GOTO BUY_LOOP
		ENDIF
		;0�ȉ��̒l����͂����ꍇ
		IF �w���� <= 0
			PRINTL
			PRINTW ����ς蔃���̂͂�߂悤
			GOTO INPUT_LOOP2
		;�݌ɂ̐���葽���w�����悤�Ƃ����ꍇ
		ELSEIF �̔��� < �w����
			PRINTW ����Ȃɍ݌ɂ͖����悤��
			GOTO INPUT_LOOP2
		;�ő及���\����葽���w�����悤�Ƃ����ꍇ
		ELSEIF �����\�� < ITEM:�I���������i + �w����
			PRINTW ����ȂɎ����Ă��d�����Ȃ�
			GOTO INPUT_LOOP2
		ENDIF
		CALL BUY_ABLE(�I���������i,0,�w����,�l����)
		�����Ɣ����� = RESULT
		IF FLAG:�����ł̗ݐύw���z > 100000 && !RAND:9 && �����Ɣ�����
			PRINTL
			PRINTL �u���������Ă���Ă��肪�Ƃ��A���ꂨ�܂��ˁv
			PRINTFORMW �\���܂��Ƃ���%ITEMNAME:510%����������\
			ITEM:510 ++
		ELSE
			PRINTL
			PRINTW �u�܂��ǂ���[�v
		ENDIF
		IF �����Ɣ�����
			FLAG:�����ł̗ݐύw���z += ITEMPRICE:�I���������i * (100 - �l����) / 100 * �w����
			;�̔��������������鏈��
			SELECTCASE �I���������i
				CASE 51
					�ǂԂ낭�̔��� -= �w����
				CASE 52
					����̔���     -= �w����
				CASE 53
					�S�E���̔���   -= �w����
			ENDSELECT
		ENDIF
	ENDIF
	GOTO INPUT_LOOP2
ELSE
	GOTO INPUT_LOOP2
ENDIF
RETURN

@������(�ǂԂ낭�̔���,����̔���,�S�E���̔���)
#DIM REF �ǂԂ낭�̔���
#DIM REF ����̔���
#DIM REF �S�E���̔���
#DIM �l����
#DIM ������
#DIM �I���������i
#DIM ���p��
#DIM ���p�z

SELECTCASE FLAG:�����̔��p���t���O
	CASE 0
		;�l������90���ɐݒ�(�艿��10���ōw�����Ă����)
		�l���� = 90
	CASE 1
		;�l������85���ɐݒ�(�艿��15���ōw�����Ă����)
		�l���� = 85
	CASE 2
		;�l������80���ɐݒ�(�艿��20���ōw�����Ă����)
		�l���� = 80
	CASE 3
		;�l������70���ɐݒ�(�艿��30���ōw�����Ă����)
		�l���� = 70
ENDSELECT
SIF FLAG:�������拭��
	�l���� -= 20
PRINTL
PRINT �u
IF FLAG:�������拭��
	PRINT ���拭���L�����y�[������������ʂ�
ELSEIF FLAG:�����̔��p���t���O
	PRINT �����ӗl��������ʂ�
ENDIF
PRINTFORML �艿��{100 - �l����}���Ŕ�������v
PRINTL ���𔄂낤���c
$INPUT_LOOP2
PRINTFORML ������:\\%TOSTR(MONEY,"#,###")%
FOR LOCAL,51,54
	LOCALS = [{LOCAL}]%ITEMNAME:(LOCAL)%
	IF ITEMPRICE:LOCAL
		PRINTFORML %LOCALS%	(\\{ITEMPRICE:(LOCAL) * (100 - �l����) / 100})  	(����:{ITEM:LOCAL})
	ENDIF
NEXT
PRINT [100] - �߂�
$INPUT_LOOP
INPUT
IF RESULT == 100
	RETURN -1
ELSEIF RESULT >= 51 && RESULT <= 53
	;�I�񂾔ԍ��ɂ��������ď��������i�[
	������ = ITEM:RESULT

	;����0�̏ꍇ
	IF ������ == 0
		PRINTL
		PRINTL �i�����Ȃ��̂Ŕ��낤�ɂ�����Ȃ�
	;����0�Ŗ����ꍇ����q�˂�
	ELSE
		;�������INPUT���g�����ߍ��̒l��ޔ�
		�I���������i = RESULT
		���p�� = 0
		$SELL_LOOP
		PRINTFORML %ITEMNAME:�I���������i%���������낤���c
		PRINTFORML ���鐔�F{���p��}
		PRINTFORML [-100]�@[ -10]�@[  -1]�@[  +1]�@[ +10]�@[+100]
		PRINTBUTTON "[�S��] ", 999
		PRINTBUTTON " [���Z�b�g]", -999
		PRINTL
		PRINTBUTTON "[����]", 0
		INPUT
		IF RESULT
			IF RESULT == 999
				���p�� = ������
			ELSEIF RESULT == -999
				���p�� = 0
			ELSE
				���p�� = LIMIT(���p�� + RESULT, 0, ������)
			ENDIF
			CLEARLINE 6
			GOTO SELL_LOOP
		ENDIF
		IF ���p�� <= 0
			PRINTL
			PRINTL ����ς蔄��̂͂�߂悤
			GOTO INPUT_LOOP2
		ENDIF
		IF ���p�� > ������
			PRINTL
			PRINTL ����Ȃɂ������񎝂��ĂȂ�
			GOTO INPUT_LOOP2
		ENDIF

		;�������̔��p�z���Z�o
		���p�z = ITEMPRICE:�I���������i * (100 - �l����) / 100
		ITEM:�I���������i -= ���p��
		MONEY += ���p�z * ���p��
		;���X�͒艿��80���Ŕ̔�
		FLAG:�����̗ݐϓ]�����v += ITEMPRICE:�I���������i * (�l���� - 20) / 100 * ���p��
		PRINTFORMW %ITEMNAME:�I���������i%����{���p�z*���p��}��{���p��}���p���܂���
		;�̔����𑝉������鏈��
		SELECTCASE �I���������i
		CASE 51
			�ǂԂ낭�̔��� += ���p��
		CASE 52
			����̔���     += ���p��
		CASE 53
			�S�E���̔���   += ���p��
		ENDSELECT
	ENDIF
	GOTO INPUT_LOOP2
ELSE
	GOTO INPUT_LOOP
ENDIF
;-------------------------------------------------
;���s�\����
;-------------------------------------------------
;����
@COM_ABLE619
;�ꊇ�Ǘ�
SIF GLOBAL_COMABLE(619)
	RETURN RESULT
IF !AT_HOME(MASTER)
	SIF CFLAG:MASTER:���݈ʒu != �ۉ�����
		RETURN 0
ELSE
	SIF CFLAG:MASTER:���݈ʒu != 211
		RETURN 0
ENDIF
;������
SIF CFLAG:����
	RETURN 0
;���Ԓ�~��
SIF FLAG:70
	RETURN 0
RETURN 1

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/COMF/外出系/COMF619 酒屋.ERB


code:
;�ނ������
@COM621
#DIM �ނꂽ����
#DIM �ނ�p���[
#DIM �ނ�p���[M
#DIM �ނ�p���[T
#DIM �ނ�Ȃ��␳
#DIM �ނ�^
#DIM CHARA
#DIM �������ނ���
�������ނ��� = 0
;�Q���Ҕ���
IF FLAG:�f�[�g����
	CHARA = FLAG:�f�[�g����
ELSEIF TARGET && ABL:TARGET:�e�� >= 5 - ABL:TARGET:�ނ�Z�\
	CHARA = TARGET
ELSE
	CHARA = 0
ENDIF
;���킢�����G�G
IF CHARA == 93 || TARGET == 93
	PRINTFORMW �ޏ��̑O�Œނ������͍̂��Ȃ��̂��c
	RETURN -1
ENDIF

;���ւ���-50�`+50,�A�C�e���₨�F�蓙�ŕ␳�������邱�Ƃ���
�ނ�^ = FLAG:���ւ��C�x���g / 10 - 50
;�ނ�̑�햡�͑҂����Ԃ��ƕ�����
FOR LOCAL, 0, 5
	REUSELASTLINE  \@ CHARA ? %CALLNAME:CHARA%�ƈꏏ�� #  \@�ނ蒆.%"." * LOCAL%
	TWAIT 150, 1
NEXT
;�ނ�p���[�ݒ�
�ނ�p���[M = 10 + ABL:MASTER:�ނ�Z�\ * 15 + �ނ�^ + �ނ�Ȃ��␳
SIF CHARA
	�ނ�p���[T = 10 + ABL:CHARA:�ނ�Z�\ * 15 + �ނ�Ȃ��␳

;�i�ނ�p���[�j���Œނ��
IF RAND:100 < �ނ�p���[M
	�ނ�p���[ = �ނ�p���[M
	$FISH
	;�ނꂽ��␳���Z�b�g
	�ނ�Ȃ��␳ = 0
	;�ނ�p���[�Œނ����̂��ς��
	SELECTCASE MIN(RAND:�ނ�p���[, 100)
	CASE IS < 5
		;�؍�
		�ނꂽ���� = 610
	CASE IS < 10
		;���̎�D
		�ނꂽ���� = 131
	CASE IS < 20
		;�E�O�C
		�ނꂽ���� = 1
	CASE IS < 30
		;�A�}�S
		�ނꂽ���� = 2
	CASE IS < 40
		;���}�������
		�ނꂽ���� = 3
	CASE IS < 50
		;�C���i
		�ނꂽ���� = 4
	CASE IS < 60
		;�J�G��
		�ނꂽ���� = 706
	CASE IS < 70
		IF DAY:2 == 3
			;�T�P,�H
			�ނꂽ���� = 11
		ELSEIF DAY:2 == 4
			;���J�T�M,�~
			�ނꂽ���� = 12
		ELSE
			;�j�W�}�X
			�ނꂽ���� = 13
		ENDIF
	CASE IS < 80
		;���c���E�i�M
		�ނꂽ���� = 14
	CASE IS < 90
		;�J�����`�[
		�ނꂽ���� = 15
	CASE IS < 95
		;���[�^�[
		�ނꂽ���� = 21
	CASEELSE
		IF DAY:2 == 4
			;�X�̗�,�~
			�ނꂽ���� = 609
		ELSE
			;���̒�
			�ނꂽ���� = 606
		ENDIF
		;�{�[�i�X
		IF �������ނ���
			EXP:CHARA:�ނ�o�� ++
		ELSE
			EXP:MASTER:�ނ�o�� ++
		ENDIF
	ENDSELECT
	;�A�C�e���ɒǉ�
	SELECTCASE �ނꂽ����
	CASE IS < 10
		ITEM:�� ++
	CASE IS < 20
		ITEM:���܂��� ++
	CASE 21
		ITEM:���[�^�[ ++
	CASEELSE
		ITEM:�ނꂽ���� ++
	ENDSELECT
;CHARA���ނ����ꍇ
ELSEIF CHARA && RAND:100 < �ނ�p���[T
	�ނ�p���[ = �ނ�p���[T
	�������ނ��� = 1
	GOTO FISH
;�ނ�Ȃ�������␳���Z,�ނ��܂Œ~�ς��Ă���
ELSE
	�ނ�Ȃ��␳ += 10
	�ނꂽ���� = 0
ENDIF

;��{�̌o��
EXP:MASTER:�ނ�o�� ++
SIF CHARA
	EXP:CHARA:�ނ�o�� ++
;�ނ����l�̒ǉ��o��
IF �ނꂽ����
	IF �������ނ���
		EXP:CHARA:�ނ�o�� ++
	ELSE
		EXP:MASTER:�ނ�o�� ++
	ENDIF
ENDIF
;�f�[�g�o��
IF CHK_DATENOW(CFLAG:CHARA:�f�[�g��) && CHARA > 0
	EXP:MASTER:�f�[�g�o�� ++
	EXP:CHARA:�f�[�g�o�� ++
ENDIF

;���Ȃ����ނ�����̗͌���
SIF �ނꂽ���� && !�������ނ���
	DOWNBASE:MASTER:�̗� = 50
DOWNBASE:MASTER:�C�� = 100

;�Q���҂̃\�[�X,�K���ɐݒ肵�Ă܂�,����R�}���h�������󂯂Ȃ��̂ōT���߂�,�������ނ�Ȃ��Ɩ��񔼌�
IF CHARA > 0
	;�Œ�Ŋl������\�[�X
	SOURCE:CHARA:���y = 400
	SOURCE:CHARA:� = 50

	;ABL:�]�����݂�
	IF ABL:�]�� <= 1
		SOURCE:CHARA:���y += (ABL:�]�� * 40)
		SOURCE:CHARA:� += (ABL:�e�� * 20)
	ELSEIF ABL:�]�� <= 3
		SOURCE:CHARA:���y += 200 + (ABL:�]�� * 40)
		SOURCE:CHARA:� += 50 + (ABL:�e�� * 30)
	ELSEIF ABL:�]�� <= 5
		SOURCE:CHARA:���y += 500 + (ABL:�]�� * 40)
		SOURCE:CHARA:� += 200 + (ABL:�e�� * 30)
	ELSEIF ABL:�]�� <= 8
		SOURCE:CHARA:���y += 750 + (ABL:�]�� * 60)
		SOURCE:CHARA:� += 300 + (ABL:�e�� * 40)
	ELSEIF ABL:�]�� <= 11
		SOURCE:CHARA:���y += 1000 + (ABL:�]�� * 60)
		SOURCE:CHARA:� += 600 + (ABL:�e�� * 40)
	ELSE
		SOURCE:CHARA:���y += 1600 + (ABL:�]�� * 30)
		SOURCE:CHARA:� += 1000 + (ABL:�e�� * 20)
	ENDIF
	SIF CHARA != FLAG:�f�[�g����
		SOURCE:CHARA:� = 0

	;�D���x�݂͂Ȃ�

	SOURCE:CHARA:�� = 200 + 100 * ABL:�]��
	SOURCE:CHARA:���� = 200 + 100 * ABL:�T�h���C

	;�މʂ��݂�
	SELECTCASE �ނꂽ����
	;�ނ�Ȃ�
	CASE 0
		TIMES SOURCE:CHARA:���y , 0.50
		TIMES SOURCE:CHARA:�� , 0.50
		TIMES SOURCE:CHARA:���� , 0.50
	;�؍�, ���̎�D
	CASE 610, 131
		TIMES SOURCE:CHARA:���y , 0.10
		TIMES SOURCE:CHARA:�� , 0.50
		TIMES SOURCE:CHARA:���� , 0.50
		SOURCE:CHARA:�B�� = 20
	;�E�O�C, �A�}�S, ���}�������, �C���i
	CASE 1, 2, 3, 4
		TIMES SOURCE:CHARA:���y , 1.00
		TIMES SOURCE:CHARA:�� , 1.00
		TIMES SOURCE:CHARA:���� , 1.00
		SOURCE:CHARA:�B�� = 100
	;�J�G��
	CASE 706
		;�`���m
		IF CHARA == 14
			TIMES SOURCE:CHARA:���y , 2.00
			TIMES SOURCE:CHARA:�� , 2.00
			TIMES SOURCE:CHARA:���� , 2.00
		;�z�K�q
		ELSEIF CHARA == 33
			TIMES SOURCE:CHARA:���y , 0.50
			TIMES SOURCE:CHARA:�� , 0.50
			TIMES SOURCE:CHARA:���� , 0.50
		ELSE
			TIMES SOURCE:CHARA:���y , 1.25
			TIMES SOURCE:CHARA:�� , 1.00
			TIMES SOURCE:CHARA:���� , 1.00
		ENDIF
		SOURCE:CHARA:�B�� = 150
	;�T�P, ���J�T�M, �j�W�}�X, �J�����`�[
	CASE 11, 12, 13, 15
		TIMES SOURCE:CHARA:���y , 1.50
		TIMES SOURCE:CHARA:�� , 1.50
		TIMES SOURCE:CHARA:���� , 1.50
		SOURCE:CHARA:�B�� = 200
	;���c���E�i�M
	CASE 14
		;�݂����[
		IF CHARA == 28
			TIMES SOURCE:CHARA:���y , 2.00
			TIMES SOURCE:CHARA:�� , 2.00
			TIMES SOURCE:CHARA:���� , 2.00
		ELSE
			TIMES SOURCE:CHARA:���y , 1.50
			TIMES SOURCE:CHARA:�� , 1.50
			TIMES SOURCE:CHARA:���� , 1.50
		ENDIF
		SOURCE:CHARA:�B�� = 250
	;���[�^�[
	CASE 21
		SOURCE:CHARA:�~�� = 200
	;�X�̗�, ���̒�
	CASE 609, 606
		TIMES SOURCE:CHARA:���y , 2.00
		TIMES SOURCE:CHARA:�� , 2.00
		TIMES SOURCE:CHARA:���� , 2.00
		SOURCE:CHARA:�B�� = 300
	ENDSELECT
ENDIF

;���Ԍo��
TIME += 20

;�t���O�����n��
TFLAG:SELECTCOM�̕��� = �ނꂽ����
TFLAG:SOURCE�Ȃǂɉe�����Ȃ�SELECTCOM�̕��� = CHARA + (�������ނ��� * 1000)

RETURN 1

;-------------------------------------------------
;���s�\����
;-------------------------------------------------
;�ނ������
@COM_ABLE621
;�ꊇ�Ǘ�
SIF GLOBAL_COMABLE(621)
	RETURN RESULT
;�ނ�Ƃ��Ȃ�
SIF !ITEM:�ނ��
	RETURN 0
;���_�ł͂ł��Ȃ��i���j
SIF !FISHING_SPOT(CFLAG:MASTER:���݈ʒu)
	RETURN 0
;�f�[�g���̓f�[�g����Ƃ���
SIF FLAG:�f�[�g���� && TARGET != FLAG:�f�[�g����
	RETURN 0
;������
SIF CFLAG:MASTER:����
	RETURN 0
;���Ԓ�~��
SIF FLAG:70
	RETURN 0
RETURN 1

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/COMF/外出系/COMF621 釣りをする.ERB


code:
;-------------------------------------------------
;�ړ�
;����n�R�}���h�A���x��1
;-------------------------------------------------
@COM400
#DIM ��������
#DIM ������
#DIM �E�э���
#DIM �����~�܂�Ώ�
#DIM BUTTON�߂�
#DIM BUTTON�ؑ֍�
#DIM BUTTON�ؑ֒�
#DIM BUTTON�ؑ։E
#DIM ����܂���
BUTTON�߂� = MAXROOM + 1
BUTTON�ؑ֍� = MAXROOM + 2
BUTTON�ؑ֒� = MAXROOM + 4
BUTTON�ؑ։E = MAXROOM + 4
����܂��� = 0

IF IN_HOME(TFLAG:195) != 1 && NEXTCOM != -1
	NEXTCOM = -1
	RETURN 0
ENDIF
;�l���J�E���g�����Z�b�g
VARSET COUNTCHARA
;�����̐l���J�E���g��ݒ�
FOR LOCAL,1,CHARANUM
	COUNTCHARA:(CFLAG:LOCAL:���݈ʒu) ++
NEXT
�������� = 0
CALL TURN_RESET

DRAWLINE
;
;	// ����}�b�v�̕\����V�`�������
;

CALL DRAW_MAP

PRINTL
PRINTFORM ����{(CFLAG:MASTER:���݈ʒu)}:
PRINTFORMS NAME_FROM_PLACE(CFLAG:MASTER:���݈ʒu)
PRINTL �ɂ��܂�
;SIF !CAN_MOVE(CFLAG:MASTER:���݈ʒu, CFLAG:MASTER:311) && CFLAG:MASTER:���݈ʒu != CFLAG:MASTER:311
	PRINTL [0] - �����֖߂�
FOR LOCAL, MINROOM(), MAXROOM
	SIF !CAN_MOVE(CFLAG:MASTER:���݈ʒu, LOCAL) & 1
		CONTINUE
	SIF NAME_FROM_PLACE(LOCAL) == ""
		CONTINUE
	SELECTCASE FLAG:�ړ���\��
		CASE 2
			PRINTFORM [{LOCAL}] -
			PRINTFORMSL NAME_FROM_PLACE(LOCAL)
		CASE 1
			PRINTFORM [{LOCAL}]-%NAME_FROM_PLACE(LOCAL),5,LEFT%
		CASE 0
	ENDSELECT
NEXT

IF !CAN_MOVE(CFLAG:MASTER:���݈ʒu, ENTRANCE) & 1 && CFLAG:MASTER:���݈ʒu != ENTRANCE
	PRINTFORM [{ENTRANCE}] -
	PRINTFORMSL NAME_FROM_PLACE(ENTRANCE)
ENDIF
PRINTFORM [{BUTTON�߂�}] - �߂�@�@
PRINTBUTTON "��]", BUTTON�ؑ֍�
PRINTBUTTON "�}�b�v�؂�ւ�",BUTTON�ؑ֒�
PRINTFORM ({TFLAG:�}�b�v�؂�ւ�})
PRINTBUTTON "[��",BUTTON�ؑ։E
SIF TALENT:MASTER:���ꏊ�@�m || TALENT:MASTER:�������@�m
	PRINTFORM �@�@[200] - �@�m���[�h
IF FLAG:�@�m���[�h == 1
	PRINT (��)
ELSEIF FLAG:�@�m���[�h == 2
	PRINT (��)
ENDIF
IF TALENT:MASTER:���ꏊ�@�m && FLAG:�@�m���[�h == 1
	PRINTBUTTON "[Z] - ���ꏊ�@�m�@�@ ", "Z"
ENDIF
IF TALENT:MASTER:�������@�m && FLAG:�@�m���[�h == 2
	PRINTBUTTON "[X] - �������@�m�@�@ ", "X"
ENDIF
PRINTBUTTON "[C] - �ړ���\���ؑց@�@", "C"

IF TALENT:MASTER:100 < -4 && !CFLAG:MASTER:���s
	PRINTL
	PRINT �i�����̂����J���c�j
ELSEIF TALENT:MASTER:100 < -4 && CFLAG:MASTER:���s
	PRINTL
	PRINT �i������Ă��炦�Ίy���j
ENDIF

DO
	INPUTS
	;�V�X�e���n���ɏ���
	SELECTCASE RESULTS
	CASE "Z", "z"
		SIF !TALENT:MASTER:���ꏊ�@�m || !AT_HOME(MASTER) || CFLAG:���ӂ�
			GOTO STR_RETRY
		TFLAG:206 = CFLAG:MASTER:���݈ʒu
		CALL HITOSAGASI()
		INPUT
		IF MAP_CAN_MOVE(RESULT) == 0
			IF TFLAG:�ړ��s�\���b�Z�[�W == 999
				PRINTFORMW �����������Ă���
				CLEARLINE 2
				REUSELASTLINE
			ELSE
				TRYCALLFORM MAP_CANNOT_WORD_{MAIN_MAP}(RESULT)
			ENDIF
			TFLAG:�ړ��s�\���b�Z�[�W = 0
			NEXTCOM = -1
			RETURN 0
		ELSEIF IN_HOME(RESULT) == 1
			CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, RESULT)
			RETURN
		ENDIF
		RESTART
	CASE "X", "x"
		SIF !TALENT:MASTER:�������@�m || !AT_HOME(MASTER) || CFLAG:���ӂ�
			GOTO STR_RETRY
		TFLAG:206 = CFLAG:MASTER:���݈ʒu
		CALL OHEYA_CHECK
		INPUT
		IF MAP_CAN_MOVE(RESULT) == 0
			IF TFLAG:�ړ��s�\���b�Z�[�W == 999
				PRINTFORMW �����������Ă���
				CLEARLINE 2
				REUSELASTLINE
			ELSE
				TRYCALLFORM MAP_CANNOT_WORD_{MAIN_MAP}(RESULT)
			ENDIF
			TFLAG:�ړ��s�\���b�Z�[�W = 0
			NEXTCOM = -1
			RETURN 0
		ELSEIF IN_HOME(RESULT) == 1
			CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, RESULT)
			RETURN
		ENDIF
		RESTART
	CASE "C", "c"
		FLAG:�ړ���\�� += 1
		SIF FLAG:�ړ���\�� > 2
			FLAG:�ړ���\�� = 0
		RESTART
	CASE ""
		CONTINUE
	ENDSELECT

	;���p�����̏ꍇ�̂ݔ���𑱍s
	IF ISNUMERIC(RESULTS)
		RESULT = TOINT(RESULTS)
	ELSE
		$STR_RETRY
		PRINTW �s���ȓ��͂ł�
		CLEARLINE 2
		REUSELASTLINE
		CONTINUE
	ENDIF

	;�V�X�e���n���ɏ���
	SELECTCASE RESULT
	CASE BUTTON�߂�, CFLAG:MASTER:���݈ʒu
		$MOVE_CANCEL
		NEXTCOM = -1
		RETURN -1
	CASE BUTTON�ؑ֍�
		TFLAG:�}�b�v�؂�ւ� -= 1
		SIF TFLAG:�}�b�v�؂�ւ� <= 0
			TFLAG:�}�b�v�؂�ւ� = MAP_PAGES
		RESTART
	CASE BUTTON�ؑ։E
		TFLAG:�}�b�v�؂�ւ� += 1
		SIF TFLAG:�}�b�v�؂�ւ� > MAP_PAGES
			TFLAG:�}�b�v�؂�ւ� = 1
		RESTART
	CASE 0
		IF IN_HOME(CFLAG:MASTER:�����ʒu) != 1
			PRINTW �����ʒu���s���ł��B�����ɕύX���܂��B
			CFLAG:MASTER:�����ʒu = �f�t�H���g�����ʒu
		ENDIF
		CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, CFLAG:MASTER:�����ʒu)
		RETURN
	CASE 200
		IF TALENT:MASTER:���ꏊ�@�m && TALENT:MASTER:�������@�m
			FLAG:�@�m���[�h += 1
			SIF FLAG:�@�m���[�h >= 3
				FLAG:�@�m���[�h = 0
		ELSEIF TALENT:MASTER:���ꏊ�@�m
			FLAG:�@�m���[�h = !FLAG:�@�m���[�h
		ELSEIF TALENT:MASTER:�������@�m
			FLAG:�@�m���[�h = (!FLAG:�@�m���[�h) * 2
		ENDIF
		RESTART
	ENDSELECT

	;�c��͒ʏ�̏ꏊ�̑I���������͌����

	;TW�̕��j�Ƃ��Ĕ񐄏��Ȃ񂾂��ǎ�ł����͂ł��ꂪ����Ɠ��͕����������ĕ֗��Ȃ�
	SIF INRANGE(RESULT, 1, 99)
		RESULT += MAIN_MAP * 100

	SIF RESULT == CFLAG:MASTER:���݈ʒu
		GOTO MOVE_CANCEL

	;�ړ��s�\�Ȃ�e����
	;�ړ��͈͊O
	IF IN_HOME(RESULT) != 1
		TFLAG:�}�b�v�؂�ւ� = 0
		PRINTW �ړ��͈͊O
		CLEARLINE 2
		REUSELASTLINE
		CONTINUE
	;�ړ��s�\��
	ELSEIF MAP_CAN_MOVE(RESULT) == 0
		TFLAG:�}�b�v�؂�ւ� = 0
		IF TFLAG:�ړ��s�\���b�Z�[�W == 999
			PRINTFORMW �����������Ă���
			CLEARLINE 2
			REUSELASTLINE
		ELSE
			TRYCALLFORM MAP_CANNOT_WORD_{MAIN_MAP}(RESULT)
		ENDIF
		TFLAG:�ړ��s�\���b�Z�[�W = 0
		CONTINUE
	ENDIF

	;ELSEIF CAN_SKIPMOVE(MAIN_MAP)	�����S���X�L�b�v���[�u�ɂ���
	CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, RESULT)
	RETURN

	;eraTW4.570proto���_�ł͈ȉ��܂�܂鎀�ɕ���
	;�K��RETURN��RESTART�Ŕ�ԏ�ɁA���Ԍo�ߏ����Ȃǂ�SKIP_MOVE���ł���Ă���
	IF FLAG:70 == 1
		SIF TALENT:MASTER:100 < -4
		BASE:MASTER:TSP -= 15
		BASE:MASTER:TSP -= 5
		IF TFLAG:�^��
			BASE:MASTER:TSP -= 3
			CFLAG:(TFLAG:�^��):���݈ʒu = CFLAG:MASTER:���݈ʒu
		ENDIF
	ELSE
		;���l���m�œ��s���ĂĂ������ʂ�̑��x�ɂȂ�̂��l�̒m�b�̂�������
		SIF TALENT:MASTER:100 < -4 && !CFLAG:MASTER:���s
		TIME += 7
		TIME += 3
		IF CFLAG:93:���s && !GETBIT (FLAG:�v�[��, 0)
			TIME += 2
			BASE:MASTER:�̗� = MAX(BASE:MASTER:�̗� - 5,500)
		ENDIF
	ENDIF

	;eraTW4.570proto���_�ł͉B�����t���O���g���ĂȂ����ۂ��H�H�H
	;�ڂ����d�l��������Ƃ悭�킩��Ȃ�

		;�B����������
	;	�v����
	;IF CFLAG:MASTER:�B����
	;	FOR LOCAL, 1, CHARANUM
	;		;MASTER�̑O�^�[���ʒu�������������ꍇ
	;		IF (CFLAG:LOCAL:311 == CFLAG:MASTER:�O�^�[���ʒu) || (CFLAG:LOCAL:���݈ʒu == CFLAG:MASTER:311 && CFLAG:MASTER:�O�^�[���ʒu == CFLAG:MASTER:311)
	;			CFLAG:LOCAL:�B���� = 0
	;			CFLAG:LOCAL:�C�^�Y�� = 0
	;		ENDIF
	;		;MASTER�̌��݈ʒu�������������ꍇ
	;		SIF ((CFLAG:MASTER:���݈ʒu == CFLAG:LOCAL:311) && CFLAG:LOCAL:����) || ((CFLAG:LOCAL:���݈ʒu == CFLAG:MASTER:311 && CFLAG:MASTER:���݈ʒu == CFLAG:MASTER:311) && CFLAG:LOCAL:����)
	;			CFLAG:LOCAL:�B���� = 1
	;	NEXT
	;	;�����ȊO�͉B���o���Ȃ��c�n�Y
	;	IF CFLAG:MASTER:���݈ʒu < 13
	;		CFLAG:MASTER:�B���� = 0
	;		CFLAG:MASTER:�C�^�Y�� = 0
	;	ENDIF
	;ENDIF
	PREVCOM = 400
	STR:0 = �ړ�
	;NEXTCOM�ɉ�������̒l�������Ă���ꍇ�͂�������������Ȃ�
	;�����łȂ��΂���-1�Ń��Z�b�g
	SIF NEXTCOM == 0
		NEXTCOM = -1
	RETURN 0
	;���ɕ��򂱂��܂�
LOOP 1

;�ړ�
@COM_ABLE400
;�ړ����s����
SIF !TFLAG:100
	RETURN 0
;�ꊇ�Ǘ�
SIF GLOBAL_COMABLE(400)
	RETURN RESULT
SIF CFLAG:���ӂ� == 2
	RETURN 0
SIF CFLAG:MASTER:�C�^�Y��
	RETURN 0
SIF CFLAG:MASTER:�Y���Q��
	RETURN 0
SIF CHK_DATENOW(CFLAG:MASTER:�f�[�g��)
	RETURN 0
;����łȂ�
SIF AT_HOME(MASTER) == 0
	RETURN 0
RETURN 1

@SKIP_MOVE(ARG, �ŏI�ړI�n)
#DIM �b��ړI�n,10
#DIM �b��ړI�n�����
#DIM �ŏI�ړI�n
#DIM ���O�ʒu
#DIM �o���n�_
#DIM �o�ߎ���
#DIM ���p�n�_,20
#DIM ���p��
#DIM RELAY_COUNT
#DIM ���O�̖ړI�n
#DIM TSP����{��

;ARG:0	�o���ʒu
;ARG:1	�ŏI�ړI�n
VARSET LOCAL
VARSET ���p�n�_
�b��ړI�n = �ŏI�ړI�n
�o�ߎ��� = 0
���p�� = 0
TFLAG:�}�b�v�؂�ւ� = 0
IF (CAN_MOVE(CFLAG:MASTER:���݈ʒu, �b��ړI�n) & 1)
	���O�ʒu = ARG
	�o�ߎ��� = 1
	CFLAG:MASTER:���݈ʒu = �ŏI�ړI�n
	GOTO STOP
ELSE
	TRYCALLFORM SKIP_MOVE_{MAIN_MAP}(�ŏI�ړI�n)
	���O�ʒu = RESULT
ENDIF

�o���n�_ = CFLAG:MASTER:���݈ʒu
���O�̖ړI�n = -1

FOR ���p��,0,20
	WHILE !(CAN_MOVE(�o���n�_, �b��ړI�n) & 1)
		TRYCALLFORM SKIP_MOVE_{MAIN_MAP}(�b��ړI�n,�o���n�_)
		[IF_DEBUG]
		PRINTFORML {�b��ړI�n}�ɒ��ڍs���Ȃ�����{RESULT}��ڎw����
		[ENDIF]
		SIF ���O�̖ړI�n == RESULT
			THROW �������[�v���������Ă��܂��B
		���O�̖ړI�n = �b��ړI�n
		�b��ړI�n = RESULT
	WEND
	[IF_DEBUG]
	SETCOLOR C_YELLOW
	PRINTFORML {���p��+1}�߂̎b��ړI�n��%NAME_FROM_PLACE(�b��ړI�n)%�Ɍ���
	RESETCOLOR
	[ENDIF]
	���O�̖ړI�n = -1
	�o�ߎ��� += 1
	���p�n�_:���p�� = �b��ړI�n
	SIF CAN_MOVE(�b��ړI�n,�ŏI�ړI�n) & 1
		BREAK
	�o���n�_ = �b��ړI�n
	�b��ړI�n = �ŏI�ړI�n
NEXT

FOR RELAY_COUNT,1,���p�� + 1
	LOCAL:3 = 0
	FOR LOCAL,1,CHARANUM
		IF CFLAG:LOCAL:���݈ʒu == ���p�n�_:(RELAY_COUNT-1)
			LOCAL:3 = LOCAL
			BREAK
		ENDIF
	NEXT
	PRINTFORM {RELAY_COUNT}�Ԗڂ̒��p�n��%NAME_FROM_PLACE(���p�n�_:(RELAY_COUNT-1))%
	IF LOCAL:3
		RESULT = 0
		TRYCALLFORM M_KOJO_K{(LOCAL:3)}
		PRINTFORML ��%CALLNAME:(LOCAL:3)%���݂�����
		IF FLAG:�����~�܂� == 2
			;�����~�܂�Ȃ�
		ELSEIF FLAG:�����~�܂� == 1 && !RESULT
			;���オ����ꍇ�̂�
		ELSE
			CALL ASK_M("��߂��Ĉړ�����",!FLAG:70,"�������Ĉړ�����",1,"�����~�܂�",1)
			IF RESULT == 2
				CALL KOJO_MESSAGE_SEND("EVENT",4,LOCAL:3,1,0)
				�o�ߎ��� = RELAY_COUNT
				CFLAG:MASTER:���݈ʒu = ���p�n�_:(RELAY_COUNT - 1)
				RESULT = ���p�n�_:RELAY_COUNT
				GOTO STOP
			ELSEIF RESULT == 1
				CALL KOJO_MESSAGE_SEND("EVENT",4,LOCAL:3,3,0)
			ELSE
				CALL KOJO_MESSAGE_SEND("EVENT",4,LOCAL:3,2,0)
			ENDIF
		ENDIF
	ELSE
		PRINTFORML �ɂ͒N�����Ȃ�����
	ENDIF
NEXT

�o�ߎ��� = ���p�� + 1
CFLAG:MASTER:���݈ʒu = �ŏI�ړI�n
RESULT = �ŏI�ړI�n
$STOP
IF IN_TOILET(RESULT)
	CALL �g�C���N��(RESULT)
	SIF RESULT == -1
		CFLAG:MASTER:���݈ʒu = ���O�ʒu
ELSEIF BATHCHECK(RESULT)
	LOCAL:1 = IN_ROOM_MEMBER("MIN", RESULT, "CFLAG", 6)
	IF !LOCAL:1 && !CFLAG:MASTER:���s
		PRINTFORMW ����ɓ�������%CALLNAME:MASTER%�͕��C�ɐZ������
	ELSEIF LOCAL:1 && ���C�ǂ��o������(LOCAL:1) && !CFLAG:MASTER:���s
		PRINTFORMW ����ɋ���%CALLNAME:(LOCAL:1)%�ɒǂ��o����Ă��܂����c
		CALL KOJO_MESSAGE_SEND("EVENT",11,LOCAL:1,1,0)
		CFLAG:MASTER:���݈ʒu = ���O�ʒu
	ELSEIF LOCAL:1 && !CFLAG:MASTER:���s
		IF FLAG:70 == 1
			PRINTFORMW %CALLNAME:(LOCAL:1)%���������������悤���c
		ELSE
			PRINTFORMW ����ɋ���%CALLNAME:(LOCAL:1)%�Ɩڂ��������c
			CALL KOJO_MESSAGE_SEND("EVENT",11,LOCAL:1,2,0)
		ENDIF
		CFLAG:MASTER:���݈ʒu = �ŏI�ړI�n
	ELSE
		FOR LOCAL, 1, CHARANUM
			IF ���C�ǂ��o������(LOCAL) && CFLAG:LOCAL:���s
				PRINTFORMW %CALLNAME:LOCAL%�Ƃ����C�ɓ��낤�Ƃ������f��ꂽ
				CALL KOJO_MESSAGE_SEND("EVENT",23,LOCAL,1,0)
				CFLAG:MASTER:���݈ʒu = ���O�ʒu
				GOTO END
			ELSEIF LOCAL:1 && ���C�ǂ��o������(LOCAL:1)
				PRINTFORMW ����ɋ���%CALLNAME:(LOCAL:1)%�ɒǂ��o����Ă��܂����c
				CALL KOJO_MESSAGE_SEND("EVENT",11,LOCAL:1,1,0)
				CFLAG:MASTER:���݈ʒu = ���O�ʒu
				GOTO END
			ENDIF
		NEXT
		FOR LOCAL, 1, CHARANUM
			IF CFLAG:LOCAL:���s
				PRINTFORMW %CALLNAME:LOCAL%�͈ꏏ�ɂ����C�ɓ����Ă��ꂻ����
				CALL KOJO_MESSAGE_SEND("EVENT",23,LOCAL,2,0)
				BREAK
			ENDIF
		NEXT
		CFLAG:MASTER:���݈ʒu = �ŏI�ړI�n
	ENDIF
ELSEIF RESULT == 54
	CALL �������N��(RESULT)
	SIF RESULT == -1
		CFLAG:MASTER:���݈ʒu = ���O�ʒu
ELSEIF LOCK:(RESULT)
	LOCAL:4 = RESULT
	IF FLAG:70 == 1
		FOR LOCAL, 1, CHARANUM
			IF CFLAG:LOCAL:311 == RESULT && CFLAG:LOCAL:���� && !CFLAG:LOCAL:�o��
				PRINTFORMW �ǂ����%CALLNAME:LOCAL%�͖����Ă���悤��
			ENDIF
		NEXT
		;�ړ�����
		CFLAG:MASTER:���݈ʒu = �ŏI�ړI�n
	ELSEIF FLAG:70 == 0
		FOR LOCAL, 1, CHARANUM
			IF CFLAG:LOCAL:311 == RESULT && CFLAG:LOCAL:���� && !CFLAG:LOCAL:�o��
				PRINTFORMW �ǂ����%CALLNAME:LOCAL%�͖����Ă���悤��
			ELSEIF CFLAG:LOCAL:311 == RESULT && !CFLAG:LOCAL:���� && !CFLAG:LOCAL:�o��
				PRINTFORML �ǂ����%CALLNAME:LOCAL%�͖����Ă���悤��
				PRINTFORMW ������������������c
			ENDIF
			IF CFLAG:LOCAL:���s
				LOCAL:2 = 1
			ELSE
				LOCAL:2 = 0
			ENDIF
		NEXT
		IF LOCAL:2
			CFLAG:MASTER:���݈ʒu = ���O�ʒu
		ELSEIF LOCAL:4 != CFLAG:MASTER:�����ʒu
			CALL ASK_YN("�����ɔE�э���","��߂Ă���")
			IF RESULT == 0
				CALL �����ɔE�э���(LOCAL:4)
				GOTO END
			ELSEIF RESULT == 1
				CFLAG:MASTER:���݈ʒu = ���O�ʒu
			ENDIF
		ENDIF
	ENDIF
ENDIF
$END
[IF_DEBUG]
PRINTFORML {�o�ߎ���}��ړ�������
[ENDIF]

TSP����{�� = 5
SIF TALENT:MASTER:100 < -4
	TSP����{�� += 15
SIF TFLAG:�^��
	TSP����{�� += 3
IF FLAG:70 == 1 || (GETBIT(FLAG:�u�Ԉړ�, 1) && !CFLAG:MASTER:���s && BASE:MASTER:TSP > TSP����{�� * �o�ߎ���)
	BASE:MASTER:TSP -= TSP����{�� * �o�ߎ���
	SIF TFLAG:�^��
		CFLAG:(TFLAG:�^��):���݈ʒu = CFLAG:MASTER:���݈ʒu
ELSE
	SIF TALENT:MASTER:100 < -4 && !CFLAG:MASTER:���s
		TIME += 7 * �o�ߎ���
	TIME += 3 * �o�ߎ���
	IF CFLAG:93:���s && !GETBIT (FLAG:�v�[��, 0)
		TIME += 2 * �o�ߎ���
		BASE:MASTER:�̗� = MAX(BASE:MASTER:�̗� - (5 * �o�ߎ���), 500)
	ENDIF
ENDIF

PREVCOM = 400
STR:0 = �ړ�
;NEXTCOM�ɉ�������̒l�������Ă���ꍇ�͂�������������Ȃ�
;�����łȂ��΂���-1�Ń��Z�b�g
SIF NEXTCOM == 0
	NEXTCOM = -1

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/COMF/日常系/COMF400 移動.ERB


code:
;-------------------------------------------------
;��`���ƂƘb��
;����n�R�}���h�A���x��1
;-------------------------------------------------
@COM420
PRINTL �u�������悤�ł����H�v
PRINTL [0] - �l��T���Ă���
PRINTL [1] - �|����������
PRINTL [2] - git�ɂ���
PRINTL [100] - �߂�
INPUT
IF RESULT == 0
	PRINTL �u�N�����T���ł����H�v
	CALL HITOSAGASI()
ELSEIF RESULT == 1
CALL OHEYA_CHECK
ELSEIF RESULT == 2
	PRINTDATA
		DATAFORM �ugit���g���ƃp�b�`���ꔭ�Ń}�[�W�ł����ł���v
		DATAFORM �ugit������ΕύX�ӏ����ȒP�ɔc���ł���悤�ɂȂ�܂��v
		DATAFORM �u�ߋ��̃R�[�h�������ƕۑ����Ă���܂��v
	ENDDATA
	PRINTW �ǂ���琦�����̂炵��
	RETURN -1
ELSEIF RESULT == 100
	RETURN -1
ELSE
	RETURN -1
ENDIF
INPUTS
RESULT = TOINT(RESULTS)
IF RESULT == 0
	REPLACE RESULTS, CALLNAME:MASTER, "%CALLNAME:MASTER%"
	FOR LOCAL, 1, 19
		SIF STR:LOCAL == RESULTS
			RESULT = LOCAL
	NEXT
ENDIF
SIF RESULT == 0
	RETURN -1
IF FLAG:�[�ˎ{��
	PRINTW �����J���Ȃ���
	RESTART
ENDIF
IF (RESULT >= 26 && RESULT <= 35) && ABL:MASTER:���{ < 1 && !MAIN_MAP && !INRANGE(CFLAG:MASTER:�����ʒu,26,35)
	PRINTFORMW ���n��%CALLNAME:MASTER%�ɂ͌����邱�Ƃ��ł��Ȃ��c
ELSE
	IF IN_HOME(RESULT) == 1
		;NEXTCOM = GETNUM(TRAINNAME, "�ړ�")
		;TFLAG:195 = RESULT
		CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, RESULT)
	ENDIF
ENDIF
RETURN -1

@OHEYA_CHECK
VARSET LOCAL
TFLAG:�ړ��s�\���b�Z�[�W = 0
FOR LOCAL,MINROOM(),MAXROOM
	LOCALS = %NAME_FROM_PLACE(LOCAL)%
	SIF LOCAL == CFLAG:MASTER:311
		LOCALS = %CALLNAME:MASTER%����
	SIF LOCALS == ""
		GOTO SYOURYAKU
	SIF CFLAG:MASTER:���݈ʒu == LOCAL
		SETCOLOR 0 , 255, 0
	PRINTBUTTON "["+LOCALS+"]", LOCAL
	RESETCOLOR
	PRINTFORM %" "*(22-STRLENS(LOCALS))%
	LOCALS = %SEIKETU(LOCAL)%
	PRINTFORM %LOCALS,15,RIGHT%
	RESETCOLOR
	LOCAL:1 ++
	SIF LOCAL:1 % 2 == 0
		PRINTL
	$SYOURYAKU
NEXT
PRINTFORML
DRAWLINE
PRINTBUTTON "[�m�F�I��]", 0

@SEIKETU(ARG)
#FUNCTIONS
IF OUTROOF(CFLAG:MASTER:���݈ʒu) && DAY:2 == 4
	SELECTCASE YOGORE:ARG
		CASE IS < 100
			SETCOLOR C_GREEN
			RETURNF "�ϐ��:�X�b�L��"
		CASE IS < 500
			SETCOLOR C_M_GREEN
			RETURNF "�ϐ��:��"
		CASE IS < 1000
			SETCOLOR C_P_GREEN
			RETURNF "�ϐ��:��⏬"
		CASE IS < 2000
			SETCOLOR 0xFFFFFF
			RETURNF "�ϐ��:��"
		CASE IS < 3500
			SETCOLOR 0xFFFFFF
			RETURNF "�ϐ��:����"
		CASE IS < 5000
			SETCOLOR 0xFFFFFF
			RETURNF "�ϐ��:��"
		CASEELSE
			SETCOLOR 0xFFFFFF
			RETURNF "�ϐ��:��̎R"
	ENDSELECT
ELSE
	SELECTCASE YOGORE:ARG
		CASE IS < 100
			SETCOLOR C_GREEN
			RETURNF "�����x:�ō�"
		CASE IS < 500
			SETCOLOR C_M_GREEN
			RETURNF "�����x:��"
		CASE IS < 1000
			SETCOLOR C_P_GREEN
			RETURNF "�����x:��⍂"
		CASE IS < 2000
			SETCOLOR 0xFFFF00
			RETURNF "�����x:��"
		CASE IS < 3500
			SETCOLOR 0xFF00FF
			RETURNF "�����x:����"
		CASE IS < 5000
			SETCOLOR 0xFF00FF
			RETURNF "�����x:��"
		CASEELSE
			SETCOLOR 0xFF0000
			RETURNF "�����x:�S�~�̎R"
	ENDSELECT
ENDIF

@HITOSAGASI(ARG)
IF ARG
	FOR LOCAL,1,CHARANUM
		SIF CFLAG:LOCAL:�_�ЍݏZ > 0
			CONTINUE
		SIF AT_HOME(LOCAL) == 1
			CONTINUE
		SIF CFLAG:LOCAL:���݈ʒu == MAXROOM && CFLAG:LOCAL:����
			CONTINUE
		FOR LOCAL:1,10,100,10
			IF CFLAG:LOCAL:���݈ʒu == ARG * 100 + LOCAL:1
				PRINTFORML %CALLNAME:LOCAL,15,LEFT%
				LOCAL:2 ++
			ENDIF
		NEXT
	NEXT
	SIF !LOCAL:2
		PRINTFORML �N�����Ȃ�
ELSE
	FOR LOCAL,1,CHARANUM
		SIF AT_HOME(LOCAL) == 0
			CONTINUE
		SIF CFLAG:LOCAL:���݈ʒu < MINROOM()
			CONTINUE
		SIF CFLAG:LOCAL:���݈ʒu == MAXROOM && CFLAG:LOCAL:����
			CONTINUE
		SIF CFLAG:LOCAL:�_�ЍݏZ
			SETCOLOR 160, 210, 255
		PRINTFORM %CALLNAME:LOCAL,15,LEFT%
		RESETCOLOR
		LOCALS = %NAME_FROM_PLACE(CFLAG:LOCAL:���݈ʒu)%
		SIF CFLAG:LOCAL:���݈ʒu == CFLAG:MASTER:311
			LOCALS = %CALLNAME:MASTER%����
		PRINTBUTTON "["+LOCALS+"]", CFLAG:LOCAL:���݈ʒu
		PRINTFORM %" "*(22-STRLENS(LOCALS))%
		IF LOCALS == ""
			PRINTFORML �s���Ȉʒu�ɋ��܂�({CFLAG:LOCAL:���݈ʒu})
		ELSEIF CFLAG:LOCAL:����
			PRINTL �A�Q��
		ELSE
			PRINTL
		ENDIF
	NEXT
	IF FLAG:17
		PRINTL
		FOR LOCAL,1,6
			;���o���Ȃ�X�L�b�v
			SIF !GETBIT(FLAG:17,LOCAL)
				CONTINUE
			PRINTFORM %STR:(200 + LOCAL),15,LEFT%
			LOCALS = %STR:(TFLAG:(200 + LOCAL))%
			;MASTER������荞��
			SIF TFLAG:(200 + LOCAL) == CFLAG:MASTER:311
				LOCALS = %CALLNAME:MASTER%����
			PRINTBUTTON "["+LOCALS+"]", TFLAG:(200 + LOCAL)
			PRINTFORML %" "*MIN(0,(22-STRLENS(LOCALS)))%
		NEXT
	ENDIF
ENDIF
PRINTBUTTON "[�m�F�I��]", 0

;-------------------------------------------------
;���s����
;-------------------------------------------------
;��`���ƂƘb��
@COM_ABLE420
;����O�͕s��
SIF AT_HOME(MASTER) == 0
	RETURN 0
;��~���͕s��
SIF FLAG:70 == 1
	RETURN 0
;�ړ����s����
SIF !TFLAG:100
	RETURN 0
;�ꊇ�Ǘ�
SIF GLOBAL_COMABLE(420)
	RETURN RESULT
SELECTCASE MAIN_MAP
	CASE 0
		;��`���Ƃ��Q�Ă�����_��
		SIF CFLAG:2:����
			RETURN 0
		;��`���Ƃ̋��鏊
		SIF CFLAG:MASTER:���݈ʒu != CFLAG:2:���݈ʒu
			RETURN 0
	CASE 3
		SIF CFLAG:MASTER:���݈ʒu != 323
			RETURN 0
	CASE 9
		SIF CFLAG:MASTER:���݈ʒu != 923
			RETURN 0
	CASEELSE
		RETURN 0
ENDSELECT

SIF CFLAG:���ӂ� == 2
	RETURN 0
RETURN 1

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/COMF/日常系/COMF420 る～ことと話す.ERB


code:
;-------------------------------------------------
;�Ǐ�
;����n�R�}���h�A���x��1
;-------------------------------------------------
@COM436

PRINTL ����ǂ����H
CALL ASK_M("���w", 1, "���p��", 1, "�������Ȗ{", 1, "�L�����Z��", 1)
IF RESULT == 0
	SELECTCASE RAND:10
		;�E�E
		CASE 0
			TFLAG:193 = 1
		;���s
		CASE 1 TO 3
			TFLAG:193 = 2
		;���w
		CASEELSE
			TFLAG:193 = 3
	ENDSELECT
ELSEIF RESULT == 1
	SELECTCASE RAND:10
		;���s
		CASE 0 TO 2
			TFLAG:193 = 4
		;���p
		CASEELSE
			TFLAG:193 = 5
	ENDSELECT
ELSEIF RESULT == 2
	SELECTCASE RAND:9
		;��������
		CASE 0 TO 2
			TFLAG:193 = 6
		;�ی��̈�
		CASE 3 TO 5
			TFLAG:193 = 7
		;�J�[�}�X�[�g��
		CASE 6 TO 8
			TFLAG:193 = 8
		;��΂��{
;		CASEELSE
;		IF !TALENT:MASTER:�֒f�̒m��
;			TFLAG:193 = 9
;		ELSE
;			GOTO LOOP
;		ENDIF
	ENDSELECT
ELSEIF RESULT == 3
	RETURN -1
ENDIF

IF TARGET == 54 && CFLAG:325 == 5
	IF TALENT:����
		PRINTFORM �p�`�����[�ƈꏏ�ɓǏ����y���ނ��Ƃɂ���
	ELSE
		PRINTFORM �p�`�����[�̓Ǐ����I���܂ł�������Ǐ��Ŏ��Ԃ�ׂ����Ƃɂ���
	ENDIF
ENDIF
PRINTFORM %CALLNAME:MASTER%�́A�{�I�ɂ�����
SELECTCASE TFLAG:193
	CASE 1
		PRINT �w�j���W���X���C���[�x
	CASE 2 TO 3
		PRINT ���|��
	CASE 4 TO 5
		PRINT ���p��
	CASE 6
		PRINT �����č����{
	CASE 7
		PRINT �ی��̈�̖{
	CASE 8
		PRINT �w�J�[�}�E�X�[�g���x
;	CASE 9
;		PRINT �^�C�g���̂Ȃ��瑕���̎���C��тт��{
ENDSELECT
PRINTFORML ��ǂ�ł݂�

;3����1�Œǉ��C�x���g
SIF !RAND:3 && TARGET == 54
	TFLAG:194 = 1
;TARGET�����m���g�Ȗ{�ǂ݂���MASTER��TARGET��苳�{������TARGET�̋��{��2�ȏォ�ܕ��̈�
SIF !RAND:5 && TALENT:TARGET:���m && TFLAG:193 >= 6 && TFLAG:193 <= 8 && ABL:MASTER:���{ > ABL:���{ && ABL:���{ >= 2
	TFLAG:194 = 2

SELECTCASE TFLAG:193
	CASE 1
		EXP:MASTER:74 += 5
	CASE 3
	;���w
		EXP:MASTER:75 ++
	CASE 5
	;���p
		SELECTCASE RAND:3
			CASE 0
				EXP:MASTER:71 ++
			CASE 1
				EXP:MASTER:72 ++
			CASE 2
				EXP:MASTER:76 ++
		ENDSELECT
	CASE 6
		CALL RECOVER(MASTER,100,"����")
		CALL RECOVER(MASTER,100,"�u�N")
ENDSELECT

IF TARGET > 0 && CFLAG:�s�� != 5
	;�Œ�Ŋl������\�[�X
	SOURCE:���y = 200
	;�M��
	TFLAG:98 = 3

	;ABL:�]�����݂�
	IF ABL:�]�� <= 1
		SOURCE:���y += (ABL:�]�� * 80)
	ELSEIF ABL:�]�� <= 3
		SOURCE:���y += 300 + (ABL:�]�� * 80)
	ELSEIF ABL:�]�� <= 5
		SOURCE:���y += 700 + (ABL:�]�� * 80)
	ELSEIF ABL:�]�� <= 8
		SOURCE:���y += 950 + (ABL:�]�� * 100)
	ELSEIF ABL:�]�� <= 11
		SOURCE:���y += 1200 + (ABL:�]�� * 90)
	ELSE
		SOURCE:���y += 2000 + (ABL:�]�� * 50)
	ENDIF

	;�D���x���݂�
	IF CFLAG:2 <= 500
		SOURCE:���y += CFLAG:2 * 2
	ELSEIF CFLAG:2 <= 5000
		SOURCE:���y += 1000 + (CFLAG:2 - 500) / 2
	ELSE
		SOURCE:���y += 5000 + (CFLAG:2 - 5000) / 3
	ENDIF
	SIF SOURCE:���y < 0
		SOURCE:���y = 0
ENDIF

DOWNBASE:MASTER:�̗� = 50
DOWNBASE:MASTER:�C�� = 200
TIME += 60
RETURN 1

;-------------------------------------------------
;���s�\����
;-------------------------------------------------
;�Ǐ�
@COM_ABLE436
;���s����
SIF !TFLAG:100
	RETURN 0
;�ꊇ�Ǘ�
SIF GLOBAL_COMABLE(436)
	RETURN RESULT
;�f�[�g����
SIF (CFLAG:���݈ʒu % 100) % 10 && CFLAG:MASTER:���݈ʒu != OMANEKIBEYA()
	RETURN 0
;�Y���Q��
SIF CFLAG:MASTER:�Y���Q��
	RETURN 0
;���ӂӒ�������
SIF CFLAG:MASTER:���ӂ�
	RETURN 0
;�C��0�ł͕s��
SIF BASE:MASTER:�C�� <= 0
	RETURN 0
;�}����
SIF !IS_LIBRARY(CFLAG:MASTER:���݈ʒu)
	RETURN 0
;������
SIF CFLAG:����
	RETURN 0
;���Ԓ�~��
SIF FLAG:70
	RETURN 0
RETURN 1

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/COMF/日常系/COMF436 読書.ERB


code:
;FileName_USERCOM.ERB ------------------------------ Rev1.00
;�R�}���h���菈��
;CALL		SYSTEM
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@USERCOM
#DIM �\�͕\���p�_�~�[
#DIM ��������
#DIM �p���c����
#DIM �Ȃ��ߔ���
$LOOP_USERCOM
;��ʃR�}���h(COMF)
IF RESULT >= 0 && RESULT < 800
	;�A��o������
	IF RESULT == 351 && !CHK_DATENOW(CFLAG:MASTER:�f�[�g��)
		CALL COM_ABLE351
		SIF !RESULT
			RETURN 0
		PRINTL �A��o��
		STR:0 = �A��o��
		CALL COM351
		RETURN 0
	ENDIF
	;�R�}���h�o�^�`�F�b�N
	SIF TRAINNAME:RESULT == ""
		RETURN 0
	;SELECTCOM��TFLAG:3(SELECTCOM�ޔ�)�ɓ��͒l�Z�b�g
	SELECTCOM = RESULT
	TFLAG:3 = SELECTCOM
	;�ꕔ�R�}���h�̓��ꐧ��
	SELECTCASE SELECTCOM
		CASE 100 TO 107,140 TO 145
			IF TALENT:TARGET:�D�P
				PRINTW �D�w�ɂ���Ȏ����킯�ɂ����Ȃ�
				RETURN 0
;			ELSEIF !GETBIT(CFLAG:TARGET:��������, 4)
;				CALL �r�l����
			ENDIF
		CASE 60 TO 71
			IF TALENT:TARGET:�D�P && (CFLAG:TARGET:903 <= 30 || CFLAG:TARGET:903 >= 71)
				PRINTFORMW ����%CALLNAME:TARGET%�ɖ����͂����Ȃ������������낤
				RETURN 0
;			ELSEIF !GETBIT(CFLAG:TARGET:��������, 3)
;				CALL �`����
			ENDIF
	ENDSELECT
	SIF GLOBAL_COMABLE2(SELECTCOM)
		RETURN 0
	;�R�}���h�g�p�\����
	TRYCALLFORM COM_ABLE{SELECTCOM}
	SIF RESULT == 0
		RETURN 0
	;���s����(���s���ۓ�)�`�F�b�N
	TRYCALLFORM CAN_COM{SELECTCOM}(1)
	IF RESULT == 0
		;���s�l�\���̂��ߍēxCAN_COM
		TRYCALLFORM CAN_COM{SELECTCOM}(0)
		RETURN 0
	ENDIF
	;�_�~�[TRAIN
	DOTRAIN 999
;����\���i�������j
ELSEIF RESULT == 800
	CALL SHOW_EQUIP
	TFLAG:Info�\���� = 0
	RETURN 1
;����\��
ELSEIF RESULT == 801
	CALL STAIN_INFO
	TFLAG:Info�\���� = 0
	RETURN 1
;TARGET�ύX
ELSEIF RESULT == 802
	IF !CFLAG:�Y���Q��
		CALL TARGET_CHANGE
		TFLAG:Info�\���� = 0
		RETURN 1
	ENDIF
;TARGET�̏�ԕ\��
ELSEIF RESULT == 803
	IF TARGET == MASTER
		CALL SINGLE_CHARA_STATE(MASTER, "�u�������v")
	ELSE
		CALL TARGET_LIST_STATE
	ENDIF
	TFLAG:Info�\���� = 0
	RETURN 1
;MASTER�̏�ԕ\��
ELSEIF RESULT == 804
	CALL SINGLE_CHARA_STATE(MASTER, "�u�������v")
	TFLAG:Info�\���� = 0
	RETURN 1
;�R�}���h�t�B���^
ELSEIF RESULT == 809
	CALL OPTION_COMMAND_FILTER
ELSEIF RESULT == 815 && FLAG:70 && !CFLAG:TARGET:���� && AT_HOME(MASTER)
	IF BATHCHECK(CFLAG:MASTER:���݈ʒu) || IN_TOILET(CFLAG:MASTER:���݈ʒu)
		PRINTFORMW ���΂ɂ��̏ꏊ�ł͕s����
	ELSEIF TFLAG:�^�� != TARGET
		PRINTFORMW %CALLNAME:MASTER%��%CALLNAME:TARGET%��w������
		TFLAG:�^�� = TARGET
	ELSE
		PRINTFORMW %CALLNAME:MASTER%��%CALLNAME:TARGET%���~�낵��
		TFLAG:�^�� = 0
	ENDIF
ELSEIF RESULT == 816
	FLAG:AA�\�� = !FLAG:AA�\��
;�W��
ELSEIF RESULT == 817 && FLAG:70 && TALENT:MASTER:�W�� && AT_HOME(MASTER) && !CFLAG:���ӂ�
	CALL SYUGO()
ELSEIF RESULT == 817
	FLAG:�}�G�\�� = !FLAG:�}�G�\��
;����E������
ELSEIF RESULT == 820 && EQUIP:0 && !(TFLAG:102 == 3 && TFLAG:���������[�h)
	CALL ����E������
;�����������˂�R�}���h�̐؂藣��
ELSEIF RESULT == 821 && EQUIP:0 && EQUIP:TARGET:�����g�����Q
	IF !TARGET && !FLAG:70 && !CFLAG:MASTER:�C�^�Y��
		CALL SIMATTYAUOJISAN
	ELSE
		SIF CFLAG:TARGET:291 == 0
			CALL �E�ߏ���(TARGET, "�����˂�")
	ENDIF
;�㔼�g������E����
ELSEIF RESULT == 822 && EQUIP:TARGET:0 && EQUIP:TARGET:�㔼�g�����P != 0
	IF !TARGET
		CALL SIMATTYAUOJISAN
	ELSE
		IF EQUIP:TARGET:�㔼�g�㒅�P || EQUIP:TARGET:�㔼�g�㒅�Q || EQUIP:TARGET:�����s�[�X || EQUIP:TARGET:���� || EQUIP:TARGET:�{�f�B�[�X�[�c
			PRINTFORM %CALLNAME:TARGET%��%SHOW_TOP(TARGET,1)%�𔧏R�����A
		ELSE
			PRINTFORM %CALLNAME:TARGET%��
		ENDIF
		PRINTFORMW %CLOTHNAME(7,EQUIP:TARGET:�㔼�g�����P)%���O����
		CALL MESSAGE_�E�ߏ�
		EQUIP:TARGET:�㔼�g�����P = 0
		TEQUIP:TARGET:�㔼�g���ߏ� = 1
		TEQUIP:TARGET:�㔼�g�͂������ = 1
		EQUIP:MASTER:�㔼�g�����P = 0
		TEQUIP:MASTER:�㔼�g���ߏ� = 1
		TEQUIP:MASTER:�㔼�g�͂������ = 1
		RETURN 0
	ENDIF
;�����p�ɂ���
ELSEIF RESULT == 823 && EQUIP:0 && (EQUIP:TARGET:14 != 0 || EQUIP:TARGET:15 != 0 || EQUIP:TARGET:16 != 0 || EQUIP:TARGET:17 != 0 || EQUIP:TARGET:18 != 0)
	IF !TARGET
		CALL SIMATTYAUOJISAN
	ELSE
		CALL �E�ߏ���(TARGET, "�����p�ɂ���")
		CALL �E�ߏ���(MASTER, "�����p�ɂ���")
	ENDIF
;�g�̑��肷��
ELSEIF RESULT == 824 && MEASUREMENTCHECK(CFLAG:TARGET:���݈ʒu)
	IF CFLAG:TARGET:�g�̑��� != 2
		PRINTFORML %CALLNAME:TARGET%�̐g�̑�����s����
		PRINTFORMW ���@�\�͂�\�����邽�тɕϓ����܂��B�Œ肷��Ƃ��I�����I�����Ă�������
		CFLAG:TARGET:�g�̑��� = 2
		CALL MAKE_SIZE(TARGET)
	ELSE
		PRINTFORMW %CALLNAME:TARGET%�̐g�̑�����I������
		CFLAG:TARGET:�g�̑��� = 1
	ENDIF
	RETURN 0
;�������D�R�}���h��
ELSEIF RESULT == 825 && TFLAG:�p���c���D
	IF !FLAG:70
		CALL SIMATTYAUOJISAN
	ELSE
		FOR LOCAL,1,CHARANUM
			IF CFLAG:LOCAL:���݈ʒu == CFLAG:MASTER:���݈ʒu && !CFLAG:LOCAL:�m�[�p�� && EQUIP:LOCAL:�����g�����Q
				PRINTFORMW %CALLNAME:LOCAL%�̂͂��Ă���%PANTSNAME(EQUIP:LOCAL:�����g�����Q)%��E�����ĉ��ɓ��ꂽ
				CALL PANTS_GET(LOCAL)
			ENDIF
		NEXT
		TFLAG:Info�\���� = 0
		RETURN 0
	ENDIF
ELSEIF RESULT == 826
	IF TEQUIP:�ł炵���[�h
		TEQUIP:�ł炵���[�h = 0
	ELSE
		IF TCVAR:MASTER:�C������
			PRINTFORMW �ƂĂ�����ȗ]�T�͂Ȃ��I
	 	ELSEIF (EX:20 + EX:21 + EX:22 + EX:23 + EX:24) > 0
	 		PRINTFORMW ��������ȏ�ł点�Ȃ����낤
	 	ELSE
	 		TEQUIP:�ł炵���[�h = 1
	 	ENDIF
	 ENDIF
;�ߌ��ȃC�^�Y���i�������j
ELSEIF RESULT == 830 && CFLAG:�C�^�Y�� < 2
	PRINTFORML %CALLNAME:MASTER%��%CALLNAME:TARGET%�̕����������Ɣ��R������
	EQUIP:0 = 0
	SIF CFLAG:TARGET:������ < 2
	CFLAG:TARGET:������ = 2
	CALL SET_PRANK(2,TARGET,1)
	CALL �E�ߏ���(TARGET, "�S��", "�u�\���Ȃ��v")
	FOR LOCAL,1,CHARANUM
		CALL CLOTHES_SETTING_TRAIN(LOCAL)
	NEXT
	RETURN 1
;test
;ELSEIF RESULT == 99999
;	TIME:5 = 4
;	RETURN 1
;�����o��
ELSEIF RESULT == 850
	SELECTCOM = RESULT
	TFLAG:3 = SELECTCOM
	DOTRAIN 999
;���ꏊ�@�m=============================================================================================================================
ELSEIF RESULT == 811 && TALENT:MASTER:���ꏊ�@�m && AT_HOME(MASTER) && !CFLAG:���ӂ�
	TFLAG:206 = CFLAG:MASTER:���݈ʒu
	CALL HITOSAGASI()
	INPUTS
	RESULT = TOINT(RESULTS)
	IF RESULT == 0
		REPLACE RESULTS, CALLNAME:MASTER, "%CALLNAME:MASTER%"
		FOR LOCAL, 1, 19
			SIF STR:LOCAL == RESULTS
				RESULT = LOCAL
		NEXT
		TFLAG:Info�\���� = 0
		RETURN 1
	ENDIF
	IF MAP_CAN_MOVE(RESULT) == 0
		IF TFLAG:�ړ��s�\���b�Z�[�W == 999
			PRINTFORMW �����������Ă���
			CLEARLINE 2
			REUSELASTLINE
		ELSE
			TRYCALLFORM MAP_CANNOT_WORD_{MAIN_MAP}(RESULT)
		ENDIF
		TFLAG:�ړ��s�\���b�Z�[�W = 0
		NEXTCOM = -1
		RETURN 0
	ELSEIF IN_HOME(RESULT) == 1
		;NEXTCOM = GETNUM(TRAINNAME, "�ړ�")
		;TFLAG:195 = RESULT
		CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, RESULT)
	ENDIF
	TFLAG:Info�\���� = 0
	RETURN 1
;====================================================
ELSEIF RESULT == 812 && TALENT:MASTER:�������@�m && AT_HOME(MASTER) && !CFLAG:���ӂ�
	TFLAG:206 = CFLAG:MASTER:���݈ʒu
	CALL OHEYA_CHECK
	INPUTS
	RESULT = TOINT(RESULTS)
	IF RESULT == 0
		REPLACE RESULTS, CALLNAME:MASTER, "%CALLNAME:MASTER%"
		FOR LOCAL, 1, 19
			SIF STR:LOCAL == RESULTS
				RESULT = LOCAL
		NEXT
	ENDIF
	IF MAP_CAN_MOVE(RESULT) == 0
		IF TFLAG:�ړ��s�\���b�Z�[�W == 999
			PRINTFORMW �����������Ă���
			CLEARLINE 2
			REUSELASTLINE
		ELSE
			TRYCALLFORM MAP_CANNOT_WORD_{MAIN_MAP}(RESULT)
		ENDIF
		NEXTCOM = -1
		RETURN 0
	ELSEIF IN_HOME(RESULT) == 1
		CALL SKIP_MOVE(CFLAG:MASTER:���݈ʒu, RESULT)
	ENDIF
	TFLAG:Info�\���� = 0
	RETURN 1
ELSEIF RESULT == 813 && TALENT:MASTER:���@�m > 1 && !CFLAG:���ӂ�
	PRINTFORML �C�͂�����āA���~�����ė]���Ă��鏭����T���܂��B
	;CALL ASK_M("��߂�",1,"����",1,"�G�}���g���Ĕ���",CSTR:MASTER:12 != "")
	CALL ASK_M("��߂�",1,"����",1,"�G�}���g���Ĕ���",FLAG:�p���c�A��)
	SELECTCASE RESULT
		CASE 0
			RETURN -1
		CASE 1,2
			PRINTFORMW %CALLNAME:MASTER%��\@RESULT == 2 ?�E�����Ẵp���c�����肵�߁A # \@���_�𓝈ꂵ���I
			SETCOLOR 255,100,255
			FONTBOLD
			FOR LOCAL,1,CHARANUM
				IF CFLAG:LOCAL:���܂��Ă�x >= 500
					PRINTFORML %CALLNAME:LOCAL%�͐��~�����ė]���Ă���c�I
					SIF CFLAG:LOCAL:���݈ʒu == SUKIMA() && RESULT == 2
						PRINTFORML �����āA%CALLNAME:LOCAL%�͍��Ƃɂ���I�@�c�c�����B
				ENDIF
			NEXT
			RESETCOLOR
			FONTREGULAR
			IF RESULT == 1
				BASE:MASTER:�C�� -= 500
			ELSE
				PRINTFORMW %CALLNAME:MASTER%���W���������ƁA��̒��ɂ������p���c�͑�C�ɗn����悤�ɏ�����
				CSTR:MASTER:12 =
				FLAG:�p���c�A�� = 0
				VARSET PANTS_TEMP
				BASE:MASTER:�C�� -= 50
			ENDIF
			SIF !FLAG:70
				TIME += 5
			TFLAG:Info�\���� = 0
			RETURN 1
	ENDSELECT
[SKIPSTART]
;���݂���Ӗ��Ȃ��Ƃ������A�������������p�ԍ����A����
ELSEIF RESULT == 830
	IF !GETBIT (FLAG:1013,0)
		SETBIT FLAG:1013,0
	ELSE
		CLEARBIT FLAG:1013,0
	ENDIF
[SKIPEND]
;�t�B���^----------------------------
ELSEIF RESULT == 839
	FLAG:�Ǝ��A���t�B���^ = !FLAG:�Ǝ��A���t�B���^
	RETURN -1
ELSEIF RESULT >= 831 && RESULT <= 843
	CFLAG:TARGET:(RESULT - 830 + 590) = !CFLAG:TARGET:(RESULT - 830 + 590)
	RETURN -1
;������----------------------------

;�^�[�Q�b�g�ύX
ELSEIF RESULT >=1001 && RESULT < (CHARANUM + 1000) && CFLAG:(RESULT - 1000):����
	TFLAG:104 = (RESULT - 1000)
;������I����
;ELSEIF RESULT == 888
;	BEGIN AFTERTRAIN
;�_�ЂɗU��
ELSEIF RESULT == 990 && CAN_DATE(TARGET)
	CALL �O�o�悩��U���邩(TARGET)
	IF !RESULT
		RETURN 1
	ELSE
		CALL �A��̎��Ԍo��
		CALL SET_DATE(99,TARGET)
		CFLAG:TARGET:���݈ʒu = ENTRANCE
		CFLAG:MASTER:���݈ʒu = ENTRANCE
		CFLAG:TARGET:�f�[�g�� = MAIN_MAP
		CFLAG:MASTER:�f�[�g�� = MAIN_MAP
		CFLAG:TARGET:���s = 60
		CFLAG:MASTER:���s = 60
		IF TARGET == 93 && !GETBIT (FLAG:�v�[��, 0)
			TIME += 30
			BASE:MASTER:�̗� = MAX(BASE:MASTER:�̗� - 500,500)
		ENDIF
		PRINTFORMW �ɂ����ɂ��Ă���%CALLNAME:TARGET%��A��ċA��邱�Ƃɂ���
		RETURN 1
	ENDIF
;�[�ˎ{��
ELSEIF RESULT == 991
	IF CFLAG:MASTER:�����ʒu == 53 && CFLAG:MASTER:���݈ʒu == 53
		FLAG:�[�ˎ{�� = !FLAG:�[�ˎ{��
		RETURN 0
	ELSEIF FLAG:�[�ˎ{��
		FLAG:�[�ˎ{�� = 0
		RETURN 0
	ENDIF
;�f�[�g�ɗU��
ELSEIF RESULT == 992 && CAN_DATE(TARGET)
	CALL �O�o�悩��U���邩(TARGET)
	IF !RESULT
		RETURN 1
	ELSE
		CFLAG:MASTER:���s = 60
		CFLAG:TARGET:���s = 60
		CFLAG:TARGET:�f�[�g�� = CFLAG:MASTER:���݈ʒu / 100
		FLAG:�f�[�g���� = TARGET
		TFLAG:�f�[�g�O�D���x = CFLAG:TARGET:�D���x
		TIME += 1
		PRINTFORMW �ɂ����ɂ��Ă���%CALLNAME:TARGET%��A��ăf�[�g���邱�Ƃɂ���
	ENDIF
;�J�����_�[
ELSEIF RESULT == 993
	CALL �J�����_�[
ELSEIF RESULT == 994
	CALL SHOW_HAVE_COLLECTION()
ELSEIF RESULT == 995
	IF AT_HOME(MASTER)
		INVERTBIT FLAG:�u�Ԉړ�, 1
	ELSE
		INVERTBIT FLAG:�u�Ԉړ�, 0
	ENDIF
;���Ԓ�~����
ELSEIF RESULT == 999 && FLAG:70 == 1 && !CFLAG:���ӂ�
	CALL ���Ԓ�~����
	;�͂����t���O���I�t
	TEQUIP:2 = 0
	TEQUIP:�㔼�g�͂������ = 0
	;�L�����S���̕��ăZ�b�e�B���O
	FOR LOCAL,0,CHARANUM
		CALL CLOTHES_SETTING_TRAIN(LOCAL)
		;�㒅�E�ߍς݃t���O���I�t
		TEQUIP:LOCAL:5 = 0
		;�g�̑���I��
		SIF CFLAG:LOCAL:�g�̑��� == 2
			CFLAG:LOCAL:�g�̑��� = 1
	NEXT
;�����I��
ELSEIF RESULT == 999 && CFLAG:���ӂ�
	SIF CFLAG:MASTER:�C�^�Y�� == 2
		CALL SET_PRANK(0,TARGET,2)
	IF CFLAG:���ӂ� == 2
			SELECTCOM = RESULT
			TFLAG:3 = SELECTCOM
			DOTRAIN 999
	ELSE
		IF FLAG:70 == 1
			FOR LOCAL,0,CHARANUM
				SIF CFLAG:���ӂ� == 2
					CALL SET_DERAY(5,LOCAL)
				CALL ENDUFUFU(LOCAL)
			NEXT
			TFLAG:106 = 0
		ELSE
			CALL AFTER_AFFAIR
			FOR LOCAL,1,CHARANUM
				;���ӂӏI������Ăяo��
				SIF CFLAG:LOCAL:���ӂ� == 1 || (CFLAG:LOCAL:�C�^�Y�� >= 1 && CFLAG:LOCAL:��������L)
					CALL KOJO_MESSAGE_SEND("EVENT",15,LOCAL,2,0)
				CALL ENDUFUFU(LOCAL)
			NEXT
			TFLAG:106 = 0
		ENDIF
		;MASTER�Ƃ̐ڐG�ʒu�����Z�b�g
		CALL TOUCH_SET(0,0,0,1)
		;�͂����t���O���I�t
		TEQUIP:2 = 0
		TEQUIP:�㔼�g�͂������ = 0
		;�L�����S���̕��ăZ�b�e�B���O
		FOR LOCAL,0,CHARANUM
			CALL CLOTHES_SETTING_TRAIN(LOCAL)
			;�㒅�E�ߍς݃t���O���I�t
			TEQUIP:LOCAL:5 = 0
		NEXT
		RETURN 1
	ENDIF
;�C�^�Y���I��
ELSEIF RESULT == 999 && CFLAG:�C�^�Y�� && !CFLAG:���ӂ�
	FOR LOCAL,0,CHARANUM
		CALL SET_PRANK(0,LOCAL,1)
	NEXT
	;MASTER�Ƃ̐ڐG�ʒu�����Z�b�g
	CALL TOUCH_SET(0,0,0,1)
	;�͂����t���O���I�t
	TEQUIP:2 = 0
	TEQUIP:�㔼�g�͂������ = 0
	;�L�����S���̕��ăZ�b�e�B���O
	FOR LOCAL,0,CHARANUM
		CALL CLOTHES_SETTING_TRAIN(LOCAL)
		;�㒅�E�ߍς݃t���O���I�t
		TEQUIP:LOCAL:5 = 0
	NEXT
	RETURN 1
;�Y���Q�I��
ELSEIF RESULT == 999 && CFLAG:�Y���Q��
	FOR LOCAL,0,CHARANUM
		CALL SET_TOGETHER(0,LOCAL,1)
	NEXT
	;MASTER�Ƃ̐ڐG�ʒu�����Z�b�g
	CALL TOUCH_SET(0,0,0,1)
	CALL KOJO_MESSAGE_SEND("EVENT",16,TARGET,2,0)
	;����Ȃ�Q��
	SIF CFLAG:TARGET:����
		CALL CHARA_SLEEP, TARGET,0

	;�͂����t���O���I�t
	TEQUIP:2 = 0
	TEQUIP:�㔼�g�͂������ = 0
	;�L�����S���̕��ăZ�b�e�B���O
	FOR LOCAL,0,CHARANUM
		CALL CLOTHES_SETTING_TRAIN(LOCAL)
		;�㒅�E�ߍς݃t���O���I�t
		TEQUIP:LOCAL:5 = 0
	NEXT
	RETURN 1
;�f�[�g�I��
ELSEIF RESULT == 999 && CHK_DATENOW(CFLAG:MASTER:�f�[�g��) && CFLAG:MASTER:���݈ʒu != OMANEKIBEYA()
	CALL �O�o�悩��A��
	RETURN 1
ELSEIF RESULT == 3000
	TFLAG:PALAM��\�� = !TFLAG:PALAM��\��
ELSEIF RESULT == 3001
	TFLAG:Status��\�� = !TFLAG:Status��\��

;���\�[�X�\���֘A
ELSEIF RESULT == 3100
	;�\���ݒ�̐؂�ւ�
	FLAG:�摜�\���ݒ� = !FLAG:�摜�\���ݒ�
ELSEIF RESULT == 3101
	;�摜�\���l�� -
	FLAG:�摜�\�� = MAX(FLAG:�摜�\��-1,1)

ELSEIF RESULT == 3102
	;�摜�\���l�� +
	FLAG:�摜�\�� = MIN(FLAG:�摜�\��+1,10)

ELSEIF RESULT == 3103
	;�\���ʒu�؂�ւ�
	FLAG:�摜�\���ʒu = !FLAG:�摜�\���ʒu

ELSEIF RESULT == 3104
	;�g�\�� ON/OFF
	FLAG:�摜�g�\�� = !FLAG:�摜�g�\��
ELSEIF RESULT == 3105
	FLAG:�����G��� = !FLAG:�����G���
ELSEIF RESULT == 9999
	FOR LOCAL,1,CHARANUM
		PRINTFORMLC %CALLNAME:LOCAL% ���݈ʒu�F{CFLAG:LOCAL:���݈ʒu}
	NEXT
ENDIF
TFLAG:Info�\���� = 0
RETURN 0

;FileName_USERCOM.ERB ------------------------------ Rev1.00
;TARGET�ύX����
;CALL		USER
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@TARGET_CHANGE
PRINTFORML %CALLNAME:TARGET%�̑�������Ă��܂�
PRINTL [0] - �߂�
FOR LOCAL,1,CHARANUM
	SIF CFLAG:LOCAL:���݈ʒu == CFLAG:MASTER:���݈ʒu
		PRINTFORML [{LOCAL}] - %CALLNAME:LOCAL% (�D���x:{CFLAG:LOCAL:2})
NEXT
INPUT
IF RESULT <= 0 || RESULT >= CHARANUM
	RETURN 0
ELSEIF CFLAG:RESULT:���݈ʒu == CFLAG:MASTER:���݈ʒu
	TFLAG:104 = RESULT
ENDIF

;----------------------------------------------------------
;FileName_USERCOM.ERB ------------------------------ Rev1.00
;����\�������i�������j
;CALL		SYSTEM
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@SHOW_EQUIP
WAIT

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/USERCOM.ERB


code:
;FileName_USERCOM.ERB ------------------------------ Rev1.00
;�R�}���h�\������
;CALL		SYSTEM
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@SHOW_USERCOM
TFLAG:100 = !TFLAG:101
VARSET LOCAL
;�O�^�[����MASTER���ː����������LOCAL:1�փZ�b�g
IF TCVAR:MASTER:112 == 1
	;V
	LOCAL:1 = MASTER_POSE(SET_V,SET_P,1)
ELSEIF TCVAR:MASTER:112 == 2
	;A
	LOCAL:1 = MASTER_POSE(SET_A,SET_P,1)
ENDIF

;TARGET���吨����Ƃ��̓q�}�����ė]��
CALL ANOTHERTARGET_TALK

CALL ��i�`��

;IF (FLAG:70 == 1 && TARGET) || CFLAG:TARGET:���ӂ�
	CALL LOOK_AT
	PRINTL
;ENDIF
CALL DRAW_INFORMATIONLINE("Act_COM")
;PRINT ==Act_COM
CALL �t�B���^�\��

;�R�}���h�\��
FOR LOCAL,0,800
	SIF LOCAL == 355 && (!FLAG:70 || CFLAG:TARGET:344 == 1)
		CONTINUE
	SIF LOCAL == 200 && TFLAG:102 == 2
		PRINTL
	SIF LOCAL == 350 && TFLAG:102 != 2
		PRINTL
	SIF LOCAL == 400 && TFLAG:102 != 2
		PRINTL
	SIF GLOBAL_COMABLE2(LOCAL)
		CONTINUE
	SIF GROUPMATCH(LOCAL,400,604)
		CONTINUE
	RESULT = 0
	;����őΏۃR�}���h���g�p�\���ǂ�������
	TRYCALLFORM COM_ABLE{LOCAL}
	IF RESULT
		SIF !QUICKFILTER(LOCAL)
			CONTINUE
		IF (LOCAL == 42 && TEQUIP:11) || (LOCAL == 43 && TEQUIP:12) || (LOCAL == 44 && TEQUIP:13) || (LOCAL == 45 && TEQUIP:14) || (LOCAL == 46 && TEQUIP:15) || (LOCAL == 47 && TEQUIP:16) || (LOCAL == 48 && TEQUIP:17)
			PRINTFORMC %TRAINNAME:LOCAL%����[{LOCAL,3}]
		ELSEIF LOCAL == 81 && LOCAL:1
			PRINTFORMC ���|���t�F��[{LOCAL,3}]
		ELSEIF LOCAL == 82 && (TALENT:105 == -2 || TALENT:105 == -1)
			PRINTFORMC �i�C�Y��[{LOCAL,3}]
		ELSEIF LOCAL == 60 && (!BEDROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �Ζʗ���[{LOCAL,3}]
		ELSEIF LOCAL == 61 && (!INROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �w�ʗ���[{LOCAL,3}]
		ELSEIF LOCAL == 62 && (!BEDROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �Ζʗ��ʃA�i��[{LOCAL,3}]
		ELSEIF LOCAL == 63 && (!INROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �w�ʗ��ʃA�i��[{LOCAL,3}]
		ELSEIF LOCAL == 73 && TCVAR:PLAYER:�C������
			IF TEQUIP:TARGET:�̈� == 1 && (BEDROOM(CFLAG:PLAYER:���݈ʒu) || (BATHROOM() && ITEM:20))
				PRINTFORMC ��t���v���X[{LOCAL,3}]
			ELSEIF TEQUIP:TARGET:�̈� == 2
				IF CFLAG:TARGET:�������� == 7
					PRINTFORMC �s�܂����[{LOCAL,3}]
				ELSE
					PRINTFORMC ��t�����[{LOCAL,3}]
				ENDIF
			ELSE
				PRINTFORMC %TRAINNAME:LOCAL%[{LOCAL,3}]
			ENDIF
		ELSEIF LOCAL == 92 && (!BEDROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �`�Ζʗ��ʂ����[{LOCAL,3}]
		ELSEIF LOCAL == 93 && (!INROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �`�w�ʗ��ʂ����[{LOCAL,3}]
		ELSEIF LOCAL == 100 && TALENT:TARGET:�c�t
			PRINTFORMC ���K�؂�؂�[{LOCAL,3}]
		ELSEIF LOCAL == 130 && (!BEDROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �Ζʗ��ʂ����[{LOCAL,3}]
		ELSEIF LOCAL == 131 && (!INROOM(CFLAG:PLAYER:���݈ʒu) && !(BATHROOM() && ITEM:20))
			PRINTFORMC �w�ʗ��ʂ����[{LOCAL,3}]
		ELSEIF LOCAL == 301 && CFLAG:TARGET:�s�� == 5
			PRINTFORMC ��������������[{LOCAL,3}]
		ELSEIF LOCAL == 301 && GETBIT(TCVAR:MASTER:���ʂȂ���, 0)
			PRINTFORMC �g���🹂��[{LOCAL,3}]
		ELSEIF LOCAL == 334 && CFLAG:TARGET:350 == 49 && (TALENT:TARGET:��ϐ� == -2 || CFLAG:TARGET:�D�P���o��� == 1)
			PRINTFORMC ���������߂�[{LOCAL,3}]
		ELSEIF LOCAL == 304 && CFLAG:TARGET:350 == 46
			PRINTFORMC �V�тɎQ������[{LOCAL,3}]
		ELSEIF LOCAL == 315
			IF GETBIT(TALENT:TARGET:����,1)
				PRINTFORMC �ƈ���[{LOCAL,3}]
			ELSEIF CFLAG:MASTER:�C�^�Y��
				PRINTFORMC �鏊����[{LOCAL,3}]
			ELSE
				PRINTFORMC �N������[{LOCAL,3}]
			ENDIF
		ELSEIF LOCAL == 350
			IF FLAG:70 == 1 && CFLAG:TARGET:344 == 0
				LOCALS = �C�^�Y������
			ELSEIF (CFLAG:���݈ʒu == �A�ꍞ�ݏh || CFLAG:���݈ʒu == ���u�z)&& !CFLAG:���ӂ�
				LOCALS = �����񂹂�
			ELSEIF CFLAG:���݈ʒu == ���q��
				LOCALS = �����Ȃ��l����
			ELSEIF CFLAG:���݈ʒu == OMANEKIBEYA() && TARGET == 43
				LOCALS = �[���p�̏C�s
			;�x�b�h���Ȃ�
			;���O
			ELSEIF !INROOM(CFLAG:PLAYER:���݈ʒu)
				LOCALS = �����񂹂�
			ELSE
				LOCALS = �����|��
			ENDIF
			SIF GET_TARGETNUM() > 1
				LOCALS = �܂Ƃ߂�%LOCALS%
			PRINTFORMC %LOCALS%[{LOCAL,3}]
		ELSEIF LOCAL == 351 && CFLAG:TARGET:�ԓx > 0
			SETCOLOR C_AQUA
			PRINTFORMC %TRAINNAME:LOCAL%[{LOCAL,3}]
			RESETCOLOR
		ELSEIF LOCAL == 360 && BASE:MASTER:�C�� <= 0
			PRINTFORMC �Ȃ����܂�[{LOCAL,3}]
		ELSEIF LOCAL == 366 && GROUPMATCH(IRAI_CHARA_TO_PROGRESS(TARGET), "�˗��B��", "�˗����s")
			SETCOLOR C_GREEN
			PRINTFORMC �˗��̕�[{LOCAL,3}]
			RESETCOLOR
		ELSEIF LOCAL == 366 && GROUPMATCH(IRAI_CHARA_TO_PROGRESS(TARGET), "�˗������")
			SETCOLOR C_GREEN
			PRINTFORMC �˗��𕷂�[{LOCAL,3}]
			RESETCOLOR
		ELSEIF LOCAL == 367
			SETCOLOR C_GREEN
			PRINTFORMC %NAME_IRAI_ACT()%[{LOCAL,3}]
			RESETCOLOR
		ELSEIF LOCAL == 417 && TIME >= 660 && TIME <= 900
			PRINTFORMC ���Q����[{LOCAL,3}]
		ELSEIF LOCAL == 417
			PRINTFORMC ��������[{LOCAL,3}]
		ELSEIF LOCAL == 420
			SELECTCASE MAIN_MAP
				CASE 0
					LOCALS = ��`����
				CASE 3
					LOCALS = ���C�h�d��
				CASE 9
					LOCALS = �]���r�t�F�A���[
			ENDSELECT
			PRINTFORMC %LOCALS%�Ƙb��[{LOCAL,3}]
		ELSEIF LOCAL == 422 && CFLAG:MASTER:���݈ʒu == 103
			PRINTFORMC �䕧�̐��𒮂�[{LOCAL,3}]
		ELSEIF LOCAL == 431 && (CFLAG:MASTER:���݈ʒu == 24 || CFLAG:MASTER:���݈ʒu == 441)
			PRINTFORMC ����ł��낮[{LOCAL,3}]
		ELSEIF LOCAL == 431 && (CFLAG:MASTER:���݈ʒu == ��O���� || CFLAG:MASTER:���݈ʒu == 940)
			PRINTFORMC ��������[{LOCAL,3}]
		ELSEIF LOCAL == 431 && !SMALL_PLACE(CFLAG:MASTER:���݈ʒu) && GETBIT (FLAG:�v�[��, 1) && !BATHCHECK(CFLAG:MASTER:���݈ʒu)
			PRINTFORMC �v�[���ł��낮[{LOCAL,3}]
		ELSEIF LOCAL == 405 && CFLAG:TARGET:���s && TARGET
			PRINTFORMC �f�[�g[{LOCAL,3}]
		ELSEIF LOCAL == 410 && OUTROOF(CFLAG:MASTER:���݈ʒu) && DAY:2 == 4
			PRINTFORMC �Ⴉ��[{LOCAL,3}]
		ELSEIF LOCAL == 414 && TIME >= 300 && TIME <= 540 && (CFLAG:MASTER:���݈ʒu == 9 || CFLAG:MASTER:���݈ʒu == OMANEKIBEYA())
			PRINTFORMC ���H�ɂ���[{LOCAL,3}]
		ELSEIF LOCAL == 414 && TIME >= 660 && TIME <= 900 && (CFLAG:MASTER:���݈ʒu == 9 || CFLAG:MASTER:���݈ʒu == OMANEKIBEYA())
			PRINTFORMC ���H�ɂ���[{LOCAL,3}]
		ELSEIF LOCAL == 414 && TIME >= 1020 && TIME <= 1200 && (CFLAG:MASTER:���݈ʒu == 9 || CFLAG:MASTER:���݈ʒu == OMANEKIBEYA())
			PRINTFORMC �[�H�ɂ���[{LOCAL,3}]
		ELSEIF LOCAL == 414 && TIME >= 1200 && TIME <= 1440 && (CFLAG:MASTER:���݈ʒu == 9 || CFLAG:MASTER:���݈ʒu == OMANEKIBEYA())
			PRINTFORMC �ӐH�ɂ���[{LOCAL,3}]
		ELSEIF LOCAL == 414 && TIME >= 0 && TIME <= 180 && (CFLAG:MASTER:���݈ʒu == 9 || CFLAG:MASTER:���݈ʒu == OMANEKIBEYA())
			PRINTFORMC ��H�ɂ���[{LOCAL,3}]
		ELSEIF LOCAL == 414 && CFLAG:TARGET:�s�� == 5
			PRINTFORMC �H���x�e[{LOCAL,3}]
		ELSEIF LOCAL == 443
			PRINTFORMC %NAME_UNIQUE_COM(TARGET)%[{LOCAL,3}]
		ELSEIF LOCAL == 464
			LOCALS = %STR:(6000 + SPECIAL_AREAMOVE() / 10)%
			PRINTFORMC %LOCALS%��[{LOCAL,3}]
		ELSEIF LOCAL == 603 && PREVCOM == 603
			PRINTFORMC �������[{LOCAL,3}]
		ELSEIF LOCAL == 698
			PRINTFORMC %OMANEKI_PLACE()%�ɍs��[{LOCAL,3}]
		ELSEIF STRLENS(TRAINNAME:LOCAL)
			PRINTFORMC %TRAINNAME:LOCAL%[{LOCAL,3}]
		ENDIF
	ENDIF
NEXT
RESULT = 0
;�������s���Ȃ牺�L�\�����X�L�b�v
SIF !TFLAG:100
	GOTO SKIP
PRINTL
CALL DRAW_INFORMATIONLINE("Ex_COM")
;SIF !GETBIT (FLAG:USERCOM�t�B���^, 12)
;	PRINTC ����\��[800]
IF GETBIT(FLAG:�u�Ԉړ�, 1) && !CFLAG:MASTER:���s
	SETCOLOR 0x5090FF
ELSE
	SETCOLOR C_GREEN
ENDIF
RESULT = 0
CALL COM_ABLE400
SIF RESULT
	PRINTC �ړ�[400]
IF GETBIT(FLAG:�u�Ԉړ�, 0) && !FLAG:�f�[�g����
	SETCOLOR 0x5090FF
ELSE
	SETCOLOR C_GREEN
ENDIF
RESULT = 0
CALL COM_ABLE604
SIF RESULT
	PRINTC �U��[604]
RESETCOLOR
SIF !GETBIT (FLAG:USERCOM�t�B���^, 0)
	PRINTC ����\��[801]
SIF !CFLAG:�Y���Q�� && GET_TARGETNUM() > 1 && !GETBIT (FLAG:USERCOM�t�B���^, 1)
	PRINTC �����ς���[802]
SIF !GETBIT (FLAG:USERCOM�t�B���^, 2)
	PRINTC �\�͕\��[803]
SIF !GETBIT (FLAG:USERCOM�t�B���^, 3)
	PRINTC �\�͕\��(�}�X�^�[)[804]
SIF !GETBIT(FLAG:USERCOM�t�B���^, 11)
	PRINTC �R�}���h�t�B���^[809]
SIF FLAG:1005
	PRINTC CONFIG[810]
SIF TALENT:MASTER:���ꏊ�@�m && AT_HOME(MASTER) && !CFLAG:���ӂ� && !CFLAG:�Y���Q��
	PRINTC ���ꏊ�@�m[811]
SIF TALENT:MASTER:�������@�m && AT_HOME(MASTER) && !CFLAG:���ӂ� && !CFLAG:�Y���Q��
	PRINTC �������@�m[812]
SIF TALENT:MASTER:���@�m > 1 && !CFLAG:���ӂ�
	PRINTC ���T�m[813]
SIF FLAG:70 && CFLAG:TARGET:344 == 0 && !CFLAG:TARGET:���� && AT_HOME(MASTER) == 1 && TARGET > 0 && !CFLAG:���ӂ�
	PRINTC �������A��[815]
SIF FLAG:70 && TALENT:MASTER:�W�� && AT_HOME(MASTER) == 1 && !CFLAG:���ӂ�
	PRINTC �W��[817]
IF CAN_DATE(TARGET)
	SIF TIME_REQUIRED(MAIN_MAP,CFLAG:MASTER:�f�[�g��) < 10
		SETCOLOR 100, 250, 140
	PRINTFORMC %GET_MAPNAME(MAIN_MAP)%�ɗU��({TIME_REQUIRED(MAIN_MAP,CFLAG:MASTER:�f�[�g��)}��)[990]
	RESETCOLOR
ENDIF
;SIF CFLAG:MASTER:�����ʒu == 53 && CFLAG:MASTER:���݈ʒu == 53 && !FLAG:�[�ˎ{��
;	PRINTC ����߂�[991]
;SIF CFLAG:MASTER:�����ʒu == 53 && CFLAG:MASTER:���݈ʒu == 53 && FLAG:�[�ˎ{��
;	PRINTC �����J����[991]
;;���[�v�ړ������Ƃ��̂��߂�
;IF FLAG:�[�ˎ{�� && CFLAG:MASTER:���݈ʒu != 53
;	SETCOLOR 0 , 255, 0
;	PRINTC �����u������[991]
;	RESETCOLOR
;ENDIF
SIF CHK_DATENOW(CFLAG:MASTER:�f�[�g��) && (!FLAG:70 || CFLAG:TARGET:344 == 1) && CFLAG:�s�� != 5 && CFLAG:6 && !CHK_DATENOW(CFLAG:TARGET:�f�[�g��) && VISIT(TARGET) && CFLAG:MASTER:���݈ʒu != OMANEKIBEYA() && !FLAG:�f�[�g���� && (TALENT:TARGET:�v�� || TALENT:TARGET:���� || TALENT:TARGET:���~) && TFLAG:�ϑz�� != 1
	PRINTC �f�[�g�ɗU��[992]
SIF CFLAG:MASTER:���݈ʒu == CFLAG:MASTER:�����ʒu
	PRINTC �J�����_�[[993]
SIF FLAG:�p���c�A��
	PRINTC �莝���p���c�m�F[994]
IF AT_HOME(MASTER) && GETBIT(FLAG:�u�Ԉړ�, 1)
	SETCOLOR 0x5090FF
ELSEIF !AT_HOME(MASTER) && GETBIT(FLAG:�u�Ԉړ�, 0)
	SETCOLOR 0x5090FF
ENDIF
SIF !GETBIT(FLAG:USERCOM�t�B���^, 13)
	PRINTC �������~�߈ړ�[995]
RESETCOLOR
PRINTL
IF FLAG:70 == 1 && CFLAG:TARGET:344 == 0
	SIF EQUIP:0 && TARGET && CFLAG:���ӂ�
		PRINTC ����E������[820]
	SIF EQUIP:0 && TARGET && EQUIP:TARGET:�����g�����Q != 0
		PRINTC �p���c�������˂�[821]
	IF (TEQUIP:5 == 0 || EQUIP:TARGET:�㔼�g�����P) && CFLAG:���ӂ�
		SIF EQUIP:0 && TARGET && EQUIP:TARGET:�㔼�g�����P != 0 && (EQUIP:TARGET:���� != 0 || EQUIP:TARGET:�㔼�g�㒅�Q != 0 || EQUIP:TARGET:�{�f�B�[�X�[�c == 3)
			PRINTC �㉺�����O��[822]
	ENDIF
	IF TEQUIP:5 == 0 && CFLAG:���ӂ�
		SIF EQUIP:0 && TARGET && (EQUIP:TARGET:�㔼�g�����P != 0 || EQUIP:TARGET:�㔼�g�����Q != 0 || EQUIP:TARGET:�����g�����P != 0 || EQUIP:TARGET:�����g�����Q != 0 || EQUIP:TARGET:���I�^�[�h != 0 || EQUIP:TARGET:�{�f�B�[�X�[�c != 0) && (EQUIP:TARGET:14 != 0 || EQUIP:TARGET:15 != 0 || EQUIP:TARGET:16 != 0 || EQUIP:TARGET:17 != 0 || EQUIP:TARGET:18 != 0)
			PRINTC �����p�ɂ���[823]
	ENDIF
	IF MEASUREMENTCHECK(CFLAG:TARGET:���݈ʒu)
		IF CFLAG:TARGET:�g�̑��� != 2
			PRINTC �g�̑��肷��[824]
		ELSE
			PRINTC �g�̑�����I����[824]
		ENDIF
	ENDIF
	SIF TFLAG:�p���c���D
		PRINTC �p���c���D[825]
	IF TARGET
		IF TEQUIP:�ł炵���[�h
			PRINTC �ł炵�I��[826]
		ELSE
			PRINTC �ł炷[826]
		ENDIF
	ENDIF
	IF CFLAG:���ӂ�
		PRINTC �C�^�Y������߂�[999]
	ELSE
		PRINTC ���Ԓ�~����[999]
	ENDIF
ELSEIF FLAG:70 == 1 && CFLAG:TARGET:344 == 1
		PRINTC ���Ԓ�~����[999]
	IF CFLAG:���ӂ�
		SIF EQUIP:0 && TARGET
			PRINTC ����E������[820]

		IF CFLAG:���ӂ� == 2
			IF TFLAG:���������[�h
				PRINTC �U�蕥��[850]
			ELSE
				PRINTC �����o��[850]
			ENDIF
			IF TEQUIP:�ł炵���[�h
				PRINTC �ł炵�I��[826]
			ELSE
				PRINTC �ł炷[826]
			ENDIF
		ELSE
			PRINTC �����I��[999]
		ENDIF
	ENDIF
ELSEIF CFLAG:���ӂ� && !CFLAG:�C�^�Y��
	SIF EQUIP:0 && TARGET && !(TFLAG:102 == 3 && TFLAG:���������[�h)
		PRINTC ����E������[820]
		IF TARGET
			IF TEQUIP:�ł炵���[�h
				PRINTC �ł炵�I��[826]
			ELSE
				PRINTC �ł炷[826]
			ENDIF
		ENDIF
	IF FLAG:70 == 1 && CFLAG:TARGET:344 == 0
		PRINTC ���Ԓ�~����[999]
	ELSEIF CFLAG:���ӂ� == 2
		IF TFLAG:���������[�h
			PRINTC �U�蕥��[850]
		ELSE
			PRINTC �����o��[850]
		ENDIF
	ELSE
		PRINTC �����I��[999]
	ENDIF
ENDIF

IF CFLAG:�C�^�Y��
	SIF CFLAG:�C�^�Y�� < 2 && (EXP:TARGET:�������o�� > 100 || TCVAR:�����򋭓x || TCVAR:�����[�x > 2000)
		PRINTC �����͂�����[830]
	IF CFLAG:�C�^�Y�� < 2
		PRINTC �C�^�Y���I��[999]
		SIF EQUIP:TARGET:�����g�����Q != 0
			PRINTC �p���c�������˂�[821]
	ENDIF
	SIF CFLAG:�C�^�Y�� > 1
	PRINTC �������I��[999]
ENDIF
IF CFLAG:�Y���Q��
	PRINTC �Y���Q�I��[999]
ENDIF
IF CHK_DATENOW(CFLAG:MASTER:�f�[�g��) && (!FLAG:70 || CFLAG:TARGET:344 == 1) && !CFLAG:MASTER:���ӂ� && CFLAG:MASTER:���݈ʒu != OMANEKIBEYA() && TFLAG:�ϑz�� != 1
	SIF TIME_REQUIRED(MAIN_MAP,CFLAG:MASTER:�f�[�g��) < 10
		SETCOLOR 100, 250, 140
	PRINTFORMC �A�H�ɂ�({TIME_REQUIRED(MAIN_MAP,CFLAG:MASTER:�f�[�g��)}��)[999]
	RESETCOLOR
ENDIF
$SKIP
IF PREVCOM >= 0
	IF TFLAG:151
		STR:0 = %STR:(1500 + TFLAG:151)%
	ELSE
		STR:0 = %TRAINNAME:PREVCOM%
	ENDIF
ENDIF
SIF PREVCOM == 304 && CFLAG:TARGET:350 == 49 && TALENT:TARGET:��ϐ� != -2
	STR:0 = �t�����킷
SIF PREVCOM == 304 && CFLAG:TARGET:350 == 49 && (TALENT:TARGET:��ϐ� == -2 || CFLAG:TARGET:�D�P���o��� == 1)
	STR:0 = ���������߂�
SIF PREVCOM == 304 && CFLAG:TARGET:350 == 51
	STR:0 = �������
IF PREVCOM >= 0 && PREVCOM < 300
	PRINTL
	PRINT ���O�񒲋��R�}���h:
	PRINTS STR:0
	SIF TFLAG:150
		PRINT (����)
	PRINTL ��
ELSE
	PRINTL
	PRINT ���O��R�}���h:
	PRINTS STR:0
	PRINTL ��
ENDIF

path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/コマンド関連/USERCOM_コマンド表示処理.ERB


path: 原版+前人整合等各种readme/パッチ/eraTW4.611用色々改良パッチ/ERB/ステータス表示関連/INFO.ERB