code:
1,��������
;(BIT 0=�L�X 1=���ӂ� 2=���l 3=A 4=SM)
2,�D���x
3,�ُ�o��
4,�M���x
6,�ԓx
7,��{�����Z�b�g
8,�����I�v�V����
10,��݈���
11,��݈����
12,�f�[�g��
13,�f�[�g��C�x���g�t���O
14,������
15,���[�^�[�}��
16,���[�^�[A�}��
17,�_���o��
18,�ʎ�
19,���Ӕ���
20,����Q��
;�i0=�s�Q�� 1=�Q�� 2=��Î� 3=�E���ς݁j

30,�_�ЍݏZ
31,�����p��
;(BIT 0=���� 1=���l 2=���ԋ��� 3=���� 4=�K������ 5=���� 6=�L�X��)
32,��ƌ��
33,�Z�ݍ��ݕK�v�M���x
34,�ƒ�
35,�ŗL�R�}���h
40,���C�o��
41,�I�i�o��
;(1=�ڌ����ꂽ 2=�����ăL���� 3=����ꂿ�����)
42,�锇��
;(BIT 0=�\�t�g1=�Z�N�n��2=�K�`�Z�N�n��3=���Ӕ�}��4=���Ӄb�N�X5=���C�v6=����7=���S8=�N������)

;100~125�̓p���c�Ǘ�

;CFLAG:200�`239�̓m�[�}�������p�^�[���L���p
;CFLAG:240�`260�̓p�W���}�p�^�[���L���p

284,�u�N�x
285,�u�N�x�Q
286,�S���ː�
287,�A�i���ː�
288,���ɐ��t
289,��ɐ��t
290,��ɐ��t
291,�m�[�p��
292,�����o�j�Z�p
293,�p���c2
294,���Ȃ��̃p���c
295,�����Ȃ�ʊJ�����\�[�X�ǉ�

300,���݈ʒu
301,�O�^�[���ʒu
310,�n��
311,�����ʒu
;312,�N������
313,����
;314,�N������
;315,�A�Q����
316,����
317,���ӂ�
318,�u�`�M��
319,����
320,���s
321,�H��
322,�s�@��
323,���C
324,��ڌ�
325,�s��
326,�E��
327,�s������
328,�O��
330,�B����
331,�C�^�Y��
332,���o�n�D
333,�f�B���C
334,�Y���Q��
335,��|��
336,������
337,�����ʒu
338,��������
340,���܂��Ă�x
341,���Ԓ�~�����ւ�
342,�x���ړ���
343,�p�W���}
344,���Ԓ�~�s��
345,���Ԓ�~�o��
346,���Z�����Ď肪�����Ȃ�
347,�I�i�j�[����
348,�Еt���d����
349,�Еt���ꏊ

350,�E��
;(40,���| 41,��b 42,�퓬 43,���{ 44,���� 45,���y 46,�V�� 47,������ 48,����̏��� 49,����ɎQ�� 50,�ЂÂ�)
351,�g�̑���
352,���K����
353,�A���
354,�A�Q����
355,�N������
356,�悭�s���n��
357,�o���ʒu
358,����ʒu
359,���_���K
360,�o��
361,�ʔN
362,�������K
363,�ړ����␳
364,�ړ��ߓx

370,�������o
371,��������L
372,���Ԓ�~����L
373,�Ȃ肫�����L
374,�j�Z�L�����Z������L

380,���͉��
381,����
382,�ψّO�̌`��
383,�o�����^�C��

400,��O���ꑍ������
401,���n�����򑍓�����
402,���n���������C�x���g

403,�˗���
;�p�^�[�����ו�������
;   -1�@�˗���������/ 1�@�˗������/ 2�@�˗���/ 3�@�˗��B��/ 4�@�����؂�/ 5�@�񍐖Y��/ 6�@�˗����s/
;    103 �˗��I���i�����j/104 �˗��I���i�����؂�j/105 �˗��I���i�񍐖Y��j/106 �˗��I���i���s�j
404,�˗����e

410,
411,�˗��ΏۂP
412,�˗��ΏۂQ
413,�˗��ΏۂR
414,�˗��ΏۂS
415,�˗��ΏۂT

;420~431�͊e���_�}�b�v�ւ̗��K�␳�ɂ���\��

;450~461�o���ʒu��

500,�D���ȑ̈�
501,�A�i���J������
502,�����r���L�O��
503,�����r���Ώ�
504,�����r������
505,����r���L�O��
506,����r������
507,�A�i�������r���L�O��
508,�A�i�������r���Ώ�
509,�A�i�������r������
510,�t�@�[�X�g�L�X�r���L�O��
511,�t�@�[�X�g�L�X�r������
512,�t�@�[�X�g�L�X�r���Ώ�

515,�݌v�S�����t
516,�݌v�A�i�����t
517,�݌v����
518,�݌v�Ԃ�����

527,������
;(0=�Ȃ� 1=�C�^�Y�� 2=������)
528,�D����
529,���ˈ���
530,������S��
531,�A��

550,�p���炢
551,�U�f
552,�ϋɐ�
553,�^�`

560,���i�X��

591,�u�A���t�B���^
592,�`�A���t�B���^
595,��d�A���t�B���^
596,�r�l�A���t�B���^

597,�Z�N�n���A���t�B���^

;CFLAG:600�`639�͂��C�ɓ���ߑ��p�^�[���L���p
;CFLAG:650�͈ߑ��Z�b�gID���w�肷��
;�������A300�Ȃ炨�C�ɓ���ߑ��A301�Ȃ�p���C�`�A302�Ȃ�S�����w�肳���
650,�p�W���}�w��
651,���傤�̂ς��
652,�p�W���}�p���c
653,�w��p���c

655,�����ɂ���ߑ�,;���C����ߑ���ݒ肵�����ǂ����A���艼������₱�����̂łЂ炪�Ȃɂ��܂�
656,�ߑ��ꎞ�ύX,;���ꗧ���Ă���Ƃ��͕���E�����R�}���h�����s����܂ŕ��i���ɖ߂�Ȃ�

;CFLAG:700�@���ւ����s�t���O�iMASTER�̖ڂ̑O�ł�TARGET�̂����ւ������j
;���ꂿ����ƍH�v����΂����C�̒��ւ���p�W���}���ւ��ɂ����p���������ł�
700,���ւ����s

900,��������,;7�Ŋ댯��
901,�q�{�����q
902,�ɂ�������
903,�D�P�o�ߓ���
904,�������N�A�b�v
905,�񕜑��x�_�E��
906,�����o�D�P
907,�D�P�ɂ��ǉ��T�C�Y
908,�o�Y�o�ߓ�
909,�玙�l��
910,���o�ː�
911,�D�P���o���
912,�q���l��
913,�q��␳
914,�Y�x

920,���u��p�^�[��

;CFLAG:1000�`1999	 ����p�m�ۗ̈�
;CFLAG:1000	����Z���N�^�p


code:
1,�d�����
2,�E��

;10�`20:�Љ�A���ݒl�ł͂Ȃ��L����CSV���Q�Ƃ��Ă��܂��i�����ɉ����ĕς���Ȃ������g�p�̂��Ɓj

;50~�͈ߕ��̉����Ɏg���Ă݂�\��

;(�^�[���J�n����/�ŏ������A/1/�Ȃ�1�Ԃ̃L�����Ɏː�,/1/4/�Ȃ�1�Ԃ�4�Ԃ̃L�����Ɏː�)
10,�ː�����p
11,�ː��㏈���p
;12�̓p���c�֘A�����Ŏg�p�̍��Ղ���A�d�l�ύX���������͂�
;CSTR:15�̓��u���Ŏg�p��

40,�t�@�[�X�g�L�X�ʒu
41,�����r���ʒu
42,�`�����r���ʒu

repo_name: akadiya/eratw

license: unknown


code:
2,�ː��ӏ�
3,�R���h�[��
4,�ː��������x

12,�ː������ӏ��t���O
;�i1=�S�� 2=�A�i�� 3=��� 4=���� 5=�p�C�Y�� 6=�f�� 7=���R�L 8=�̕\ 9=�A�i����d 10=���� 11=�G��j

15,�j�Z
16,
17,�`�j�Z
20,�J�E���^�[�s��
21,�J�E���^�[�s���̔h��

30,�J�E���^�[�s������t���O

40,��D
60,�\���J�b�g

100,V�}���Ǘ��t���O
101,A�}���Ǘ��t���O

;�i1�^�[�������j
102,V�ɒ��o�����ꂽ�t���O
104,A�ɒ��o�����ꂽ�t���O

103,V�ɒ��o�������L�����̔ԍ�
105,A�ɒ��o�������L�����̔ԍ�

106,���y���x
107,�C������
108,��d�t���O
109,�s��
111,�ː��Q�[�W������
112,�n�s�t���O
115,�u�N����
117,����
118,�ł炵��
120,�̐�
121,�̐�����
122,�ʒu�֌W
123,�ʒu�֌W����

130,��ꍇ��
131,��������擾�p
132,�{��
133,�D�����o��
134,�������֎~����
135,�s�����x

138,��
139,�����
140,�Z��
141,���A��
142,����
143,���ʂȂ���
;(0=�g��, 1= )
144,����
145,�D��
146,�҂���
147,�~���s���x�Ǘ�
148,�����򋭓x
;(0=�ʏ퐇���@1=�[�������@2=���ɐ[�������@3=����)
149,�����[�x
150,�����򂨒��g�p

170,��|���␳

180,���o
181,�����񂹏���
182,�����������
183,�L�X�L�����Z��
184,�˗��𕷂���

190,���ւ�
191,�A�i�U�[���i��

200,�����
201,YARASERO_REASON

250,�q���󕠓x
251,�q���󕠃J�E���g

298,���t�Q��
299,���t����
300,��������
301,��b�݌v�l
302,��b�s�\
303,�X�L���V�b�v����
304,�����œ���
305,�H��

;306,�����̎���
;307,�����̑N�x

308,�����̖�
;(bit0=���� 0=�Z���� 1=���� 3=���h 4=���� 5=���T�r 6=������ 21=�Z�� 22=���A�� 23=����� 24=������)
309,��蓹����
310,�G������
;311,�y�H����
312,�󕠎���
313,�f�U�[�g�󕠎���
314,�L�X����
315,��`���Ȃ�
316,����
317,����C�x���g
318,�����������̉���
319,�A���֎~
320,�D���ɂ���
321,���ꂨ�d��
322,�d���̗L��
323,��`������
324,����
325,�d���J�n
326,�d���I��
327,������
328,�x�e��
329,����K��
330,�{���̕���
331,���x�㏸����

;TCVAR:350�`399 ����p�m�ۗ̈�

400,�b�o��
401,�u�o��
402,�`�o��
403,�a�o��
404,�l�o��
406,�b�Ⓒ�o��
407,�u�Ⓒ�o��
408,�`�Ⓒ�o��
409,�a�Ⓒ�o��
490,�l�Ⓒ�o��
;�Ⓒ�o��
410,�Ⓒ�o��
411,�ː��o��
412,�����o��
413,���A�o��
414,���t�o��
415,�����o��

;�s���o��
420,�u�����o��
421,�`�����o��
422,���Ԍo��
423,�������Ԍo��
424,����o��
425,�����o��
426,�p�C�Y���o��
427,�L�X�o��
428,����g�p�o��

;���_�o��
440,��d���y�o��
441,����o��
442,��ɉ��y�o��
443,�n�s���y�o��

;�����o��
450,�����o��
451,���Y�o��
452,�Q�C�o��
453,�ُ�o��
454,�u�g���o��
455,�`�g���o��
456,�ٔ��o��

;���̑�
470,���|�o��
471,��b�o��
472,�B�e�o��
473,��ʌo��
474,�퓬�o��
479,���t�o��


code:
;�֐��u����
;-------------------------------------------------
;�A�C�e���̔���@ITEMSTOCK
;�߂�l1 �A�C�e�������݂��Ȃ�
;�߂�l2 ����
;�߂�l3 ����������Ȃ�
;�߂�l4 �����𖞂����Ă��Ȃ�
;�߂�l5 ���ł�99�������Ă���
;-------------------------------------------------
@ITEMSTOCK(ARG)
#FUNCTION
SIF !STRLENS(ITEMNAME:ARG)
	RETURNF 1
SIF ITEMSALES:ARG == -2
	RETURNF 4
SIF ITEMSALES:ARG == -1
	RETURNF 2
SIF (MONEY < ITEMPRICE:ARG && !TFLAG:194) || (TFLAG:194 == 1 && MONEY < ITEMPRICE:ARG / 3)
	RETURNF 3
SIF ITEM:ARG >= 99
	RETURNF 5
RETURNF 0

;-------------------------------------------------
;�֐���:CHOICE
;�T�@�v:�Q�`�S���֐�
;���@��:ARGS:0�c������e
;      :ARGS:1�`4�c�I�����̕�����(3,4�ȗ���)
;�߂�l:���[�U���͌���(0�`3)
;�I�������̖����A�V���v���ȑI�����쐬�֐�
;����Ƃ��ł��g���邩������Ȃ�
;�Ƃ肠����4���܂ŁB���₵�Ă���������
;-------------------------------------------------
@CHOICE(ARGS:0, ARGS:1, ARGS:2, ARGS:3, ARGS:4)
PRINTSL ARGS:0
FOR LOCAL, 0, 4
	PRINTFORML [{LOCAL}] - %ARGS:(1 + LOCAL)%
	SIF LOCAL && !STRLENS(ARGS:(2 + LOCAL))
		BREAK
NEXT
$INPUT_LOOP
INPUT
SELECTCASE RESULT
	CASE 0 TO LOCAL - 1
	CASEELSE
		CALL SIMATTYAUOJISAN
		CLEARLINE 1
		GOTO INPUT_LOOP
ENDSELECT
RETURN RESULT
;-------------------------------------------------
;�I������\�������͌��ʂ�Ԃ��֐� �����𖞂����Ȃ��I�������O���[�\���ɂ��Ė����ɂ��邱�Ƃ��\
;�����ɃZ���t�Ə���(0�Ŗ����A��0�ŗL��)���w��B�ő�5�܂�
;�߂�l�͑I�������I�����̔ԍ�
;-------------------------------------------------
@ASK_M(ARGS:0, ARG:0, ARGS:1, ARG:1, ARGS:2, ARG:2, ARGS:3, ARG:3, ARGS:4, ARG:4, ARGS:5, ARG:5)
CURRENTREDRAW
LOCAL:0 = RESULT
REDRAW 0
FOR LOCAL:0, 0, 6
	IF ARGS:(LOCAL:0) != ""
		IF ARG:(LOCAL:0)
			PRINTBUTTON @"{LOCAL:0, 2, RIGHT}[%ARGS:(LOCAL:0)%]", LOCAL:0
		ELSE
			SETCOLOR 0x606060
			PRINTPLAINFORM {LOCAL:0, 2, RIGHT}[%ARGS:(LOCAL:0)%]
			RESETCOLOR
		ENDIF
		PRINTL
	ENDIF
NEXT
$INPUT_LOOP
INPUT
IF RESULT < 0 || RESULT > 5 || ARGS:RESULT == "" || !ARG:RESULT
	CLEARLINE 1
	GOTO INPUT_LOOP
ENDIF
REDRAW LOCAL:0
RETURN RESULT
;-------------------------------------------------
;�����ƃJ���X�}�ǂ���ł�������I�����̂��߂̊֐�
;-------------------------------------------------
@PAY_YEN_OR_CM(ARG,ARG:1)
PRINTFORML [0] ��߂�
PRINTFORML [1] \\{ARG}�����@�@�i���݂̏������F\\{MONEY}�j
PRINTFORML [2] CM{ARG:1}�����@�i���݂̏����J���X�}�FCM{MONEY:2}�j
$INPUT_LOOP
INPUT
SELECTCASE RESULT
	CASE 0
	CASE 1
		IF MONEY < ARG
			PRINTFORMW ����������܂���
			GOTO INPUT_LOOP
		ENDIF
		MONEY -= ARG
	CASE 2
		IF MONEY < ARG:2
			PRINTFORMW �J���X�}������܂���
			GOTO INPUT_LOOP
		ENDIF
		MONEY -= ARG:2
	CASEELSE
		GOTO INPUT_LOOP
ENDSELECT
RETURN RESULT
;-------------------------------------------------
;�֐���:GET_REVISION
;�T�@�v:�ėp�␳�l�擾�֐�
;���@��:ARG:0�c�Q�Ƃ��鐔�l
;�߂�l:�␳��̒l
;���@�l:�����֐�
;���鐔�l���A����l�ɑQ�߂��Ă������l�ɕϊ��������Ƃ���
;�㏸�����������Ƃ����ɏ���ɒB����A�傫���Ƌt�ɂȂ��Ȃ�����܂ŋ߂Â��Ȃ�
;-------------------------------------------------
@GET_REVISION(ARG:0, ���, �㏸��)
#FUNCTION
#DIM ���
#DIM �㏸��
RETURNF ��� - �㏸�� * ��� / (�㏸�� + ARG:0)

;eg 10000,2000,20000����2000-2000*20000/30000

@GET_REVISION2(ARG:0, ���, �㏸��)
#FUNCTION
#DIM ���
#DIM �㏸��
RETURNF ��� * (ARG:0 + 1) / (�㏸�� + ARG:0 + 1)

;eg 5000*1001/1201

;-------------------------------------------------
;�֐���:PRINT_BASE
;�T�@�v:�ėp�␳�l�擾�֐�
;���@��:ARGS �o�[�̖��O
;		ARG:0�c�Q�Ƃ���L�����ԍ�
;       ARG:1�c�x�[�X�̔ԍ�
;       ARG:2�c�o�[�̒���
;BAR��\�����������Ƃ���
;-------------------------------------------------
@PRINT_BASE(ARGS,ARG:0,ARG:1,ARG:2)
PRINTFORM %ARGS,%
BAR BASE:ARG:(ARG:1),MAXBASE:ARG:(ARG:1),ARG:2
PRINTFORML ({BASE:ARG:(ARG:1)}/{MAXBASE:ARG:(ARG:1)})

;FileName_COMMON.ERB ------------------------------- Rev1.00
;�������胉�C���\���֐�
;CALL		USER
;ARG		ARGS:�\�����C����, ARG:0 line_to_"-", ARG:1 ���C����
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@DRAW_INFORMATIONLINE(ARGS,ARG,ARG:1)
#DIMS EQUAL
#DIMS MINUS
EQUAL = =
MINUS = -
LOCAL = ARG:1

IF ARGS =="Info"
	SIF TFLAG:Info�\����
		RETURN
	TFLAG:Info�\���� = 1
ENDIF
SIF !ARG:1
	LOCAL = 150
IF ARG == 1
	PRINTSINGLEFORMS "-- %ARGS% " + "%(MINUS * MAX((LOCAL - STRLENS(ARGS)),0))%"
ELSE
	PRINTSINGLEFORMS "== %ARGS% " + "%(EQUAL * 150)%"
ENDIF
;-------------------------------------------------
;�Ⓒ���ȂǁA�`�Ƃa�Ƃc�Ɓc�݂����Ȋ����Łu�Ɓv�łȂ��ŗ񋓂��邽�߂̊֐�
;�����ɕ\�����镶����Ə���(0�Ŗ����A��0�ŗL��)���w��B�ő�5�܂�
;-------------------------------------------------
@PRINT_EMUNERATE(�\��:1,����:1,�\��:2,����:2,�\��:3,����:3,�\��:4,����:4,�\��:5,����:5)
#DIMS �\��,6
#DIM ����,6

SIF ����:1
	PRINTFORM %�\��:1%
SIF ����:1 && (����:2 || ����:3 || ����:4 || ����:5)
	PRINT ��
SIF ����:2
	PRINTFORM %�\��:2%
SIF ����:2 && (����:3 || ����:4 || ����:5)
	PRINT ��
SIF ����:3
	PRINTFORM %�\��:3%
SIF ����:3 && (����:4 || ����:5)
	PRINT ��
SIF ����:4
	PRINTFORM %�\��:4%
SIF ����:4 && ����:5
	PRINT ��
SIF ����:5
	PRINTFORM %�\��:5%
;-------------------------------------------------
;�����Ń��C�h���痬�p�����Ă��������܂����B���ӁB
;�P��1/�P��2/�c/�P��n �̏����ŏ����ꂽARGS:0�`�̒P��̂ǂꂩ�𓙊m���ŕԂ�
;(ARGS����������̂͊֐��Ȃǂ��˂����܂�邱�Ƃ�z�肵�Ă��邽��)
;�Q�͉����o�͂��Ȃ��I���Ƃ���
;�I�����̐���100�܂Ŋg���ARESULT�ޔ������ǉ�
;���I���������m���Ȃ�FOR-NEXT�g��Ȃ��Ă悢�Ǝv�����̂�RAND�ōς܂���
;-------------------------------------------------
@TEXTR(ARGS, ARGS:1, ARGS:2, ARGS:3, ARGS:4, ARGS:5, ARGS:6)
#FUNCTIONS
#DIM  L_RESULT               ;RESULT�ޔ�p
#DIMS DYNAMIC CHOICES        ;����
#DIMS DYNAMIC STR_ARRAY, 100 ;�I�����i�[�p�̈ꎞ�ϐ�
;�܂���ɂ܂Ƃ߂�
ARGS = %ARGS%\/%ARGS:1%\/%ARGS:2%\/%ARGS:3%\/%ARGS:4%\/%ARGS:5%\/%ARGS:6%
;�s�v��"/"�������
;���ARGS�������//����������o���Ĕ���̎ז��ɂȂ�̂�
;1.//�͒u���ō��
;2.�Ŗ�����/�Ȃ���
ARGS '= REPLACE(ARGS, "\/\/", "")
SIF CHARATU(ARGS, STRLENSU(ARGS) - 1) == "/"
	ARGS '= SUBSTRINGU(ARGS, 0, STRLENSU(ARGS) - 1)
SPLIT ARGS, "/", STR_ARRAY
CHOICES '= STR_ARRAY:(RAND:RESULT)
SIF CHOICES == "�Q"
	CHOICES =
RESULT = L_RESULT
RETURNF CHOICES
;-------------------------------------------------
;���ǔ���֐�@ONCE
;�����Ŏg�p����֐��ł�
;ARGS�̓C�x���g�ԍ��AARG�͐^���Ə��񔻒���X�V���Ȃ��AARG:1�̓L�����o�^�ԍ��i�ȗ������TARGET,-1�Ȃ�MASTER�j
;{�C�x���g�ԍ�}/�@�Ƃ����������CSTR:1�ɂԂ�����ł����܂�
;-------------------------------------------------
@ONCE(ARGS,ARG, ARG:1)
#FUNCTION
;ARG:2�̕ϊ�
ARG:1 = ARG:1 ? ARG:1 # TARGET
ARG:1 = ARG:1 == -1 ? MASTER # ARG:1

SIF CSTR:(ARG:1):1 == ""
	CSTR:(ARG:1):1 = /

LOCALS = /%ARGS%/
IF STRCOUNT(CSTR:(ARG:1):1,LOCALS)
	RETURNF 0
ELSEIF ARG
	RETURNF 1
ENDIF
;���񔻒�X�V
CSTR:(ARG:1):1 = %CSTR:(ARG:1):1%%ARGS%/
RETURNF 1

;FileName_COMMON.ERB ------------------------------- Rev1.00
;�t���O���Z�b�g����
;CALL		SYSTEM
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@EVENTTRAIN
FOR LOCAL,0,CHARANUM
	CSTR:LOCAL:1 =
NEXT

;-------------------------------------------------
;���ǔ���֐�@FIRSTTIME
;�����Ŏg�p����֐��ł��B
;ARGS�̓C�x���g�ԍ��AARG�͐^���Ə��񔻒���X�V���Ȃ��AARG:1�̓L�����o�^�ԍ��i�ȗ������TARGET,-1�Ȃ�MASTER�j
;{�C�x���g�ԍ�}/�@�Ƃ����������CSTR:0�ɂԂ�����ł����܂�
;-------------------------------------------------
@FIRSTTIME(ARGS,ARG, ARG:1)
#FUNCTION
;ARG:1�̕ϊ�
ARG:1 = ARG:1 ? ARG:1 # TARGET
ARG:1 = ARG:1 == -1 ? MASTER # ARG:1
SIF CSTR:(ARG:1):0 == ""
	CSTR:(ARG:1):0 = /

LOCALS = /%ARGS%/
IF STRCOUNT(CSTR:(ARG:1):0,LOCALS)
	RETURNF 0
ELSEIF ARG
	RETURNF 1
ENDIF
;���񔻒�X�V
CSTR:(ARG:1):0 = %CSTR:(ARG:1):0%%ARGS%/
RETURNF 1

;-------------------------------------------------
;�֐���:EXP_UP
;�T�@�v:�o���l�ϓ��`�F�b�N
;���@��:ARG:0�c�Q�Ƃ���EXP
;       ARG:1�c�Q�Ƃ���L�����ԍ�
;-------------------------------------------------
@EXP_UP(ARG,ARG:1)
#FUNCTION
RETURNF EXP:(ARG:1):ARG - TCVAR:(ARG:1):(400 + ARG)

;-------------------------------------------------
;�֐���:INVAGINA
;�T�@�v:V�ɉ��������Ă���̂���Ԃ�
;���@��:ARG:0�c�Q�Ƃ���L�����ԍ�
;�߂�l:0�Ȃ�
;�߂�l:1 �y�j�X
;�߂�l:2 �o�C�u
;-------------------------------------------------
@INVAGINA(ARG)
#FUNCTION
IF TEQUIP:ARG:50
	IF TALENT:PLAYER:2 & 2
		RETURNF 1
	ELSE
		RETURNF 3
	ENDIF
ELSEIF TEQUIP:ARG:�o�C�u
	RETURNF 2
ENDIF
;-------------------------------------------------
;�֐���:INANAL
;�T�@�v:A�ɉ��������Ă���̂���Ԃ�
;���@��:ARG:0�c�Q�Ƃ���L�����ԍ�
;�߂�l:0�Ȃ�
;�߂�l:1 �y�j�X
;�߂�l:2 �A�i���o�C�u
;�߂�l:3 �A�i���r�[�Y
;-------------------------------------------------
@INANAL(ARG)
#FUNCTION
IF TEQUIP:ARG:51
	RETURNF 1
ELSEIF TEQUIP:ARG:�A�i���o�C�u
	RETURNF 2
ELSEIF TEQUIP:ARG:�A�i���r�[�Y
	RETURNF 3
ENDIF
;-------------------------------------------------
;�֐���:HETEROSEX
;ARG��ARG:1�̐��ʂ��������ǂ�����Ԃ��ق�Ƃ�HOMOSEX�����ǌꊴ�������̂�
;������������̂��A�����Ȃ����̂�j�Ƃ���
;�߂�l0=�ِ�
;�߂�l1=����(���Y)
;�߂�l2=����(�Q�C)
;-------------------------------------------------
@HETEROSEX(ARG,ARG:1)
#FUNCTION
IF GETBIT(TALENT:ARG:2,0) == GETBIT(TALENT:(ARG:1):2,0)
	IF GETBIT(TALENT:ARG:2,0)
		RETURNF 1
	ELSE
		RETURNF 2
	ENDIF
ELSE
	RETURNF 0
ENDIF

;-------------------------------------------------
;�֐���:GET_TARGETNUM
;��������TARGET�̐���Ԃ�
;�����p�~����FOR-NEXT��r�����č�����
;-------------------------------------------------
@GET_TARGETNUM()
#FUNCTION
RETURNF MAX(0, FINDELEMENT(TARGET, 0) - 1)
;-------------------------------------------------
;�֐���:IN_ROOM_MEMBER
;�����̒��œ���v�f�ł̍Œ�E�ō������L�������擾
;ARGS MAX��MIN����I��
;ARG �����̔ԍ�
;ARGS:1 �ΏۂƂȂ�ϐ��̖��O
;ARG:1 �ϐ��̔ԍ�
;-------------------------------------------------
@IN_ROOM_MEMBER, ARGS, ARG, ARGS:1, ARG:1
#FUNCTION
VARSET LOCAL, 0
SELECTCASE ARGS:1
	CASE "CFLAG"
		FOR LOCAL, 1, CHARANUM
			SIF CFLAG:LOCAL:���݈ʒu != ARG
				CONTINUE
			IF LOCAL:3++ == 0
				LOCAL:1 = CFLAG:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MAX" && LOCAL:1 < CFLAG:LOCAL:(ARG:1)
				LOCAL:1 = CFLAG:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MIN" && LOCAL:1 > CFLAG:LOCAL:(ARG:1)
				LOCAL:1 = CFLAG:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF LOCAL:1 == CFLAG:LOCAL:(ARG:1) && RAND:2
				LOCAL:1 = CFLAG:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ENDIF
		NEXT
		RETURNF LOCAL:2
	CASE "TCVAR"
		FOR LOCAL, 1, CHARANUM
			SIF CFLAG:LOCAL:���݈ʒu != ARG
				CONTINUE
			IF LOCAL:3++ == 0
				LOCAL:1 = TCVAR:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MAX" && LOCAL:1 < TCVAR:LOCAL:(ARG:1)
				LOCAL:1 = TCVAR:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MIN" && LOCAL:1 > TCVAR:LOCAL:(ARG:1)
				LOCAL:1 = TCVAR:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF LOCAL:1 == TCVAR:LOCAL:(ARG:1) && RAND:2
				LOCAL:1 = TCVAR:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ENDIF
		NEXT
		RETURNF LOCAL:2
	CASE "ABL"
		FOR LOCAL, 1, CHARANUM
			SIF CFLAG:LOCAL:���݈ʒu != ARG
				CONTINUE
			IF LOCAL:3++ == 0
				LOCAL:1 = ABL:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MAX" && LOCAL:1 < ABL:LOCAL:(ARG:1)
				LOCAL:1 = ABL:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MIN" && LOCAL:1 > ABL:LOCAL:(ARG:1)
				LOCAL:1 = ABL:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF LOCAL:1 == ABL:LOCAL:(ARG:1) && RAND:2
				LOCAL:1 = ABL:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ENDIF
		NEXT
		RETURNF LOCAL:2
	CASE "TALENT"
		FOR LOCAL, 1, CHARANUM
			SIF CFLAG:LOCAL:���݈ʒu != ARG
				CONTINUE
			IF LOCAL:3++ == 0
				LOCAL:1 = TALENT:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MAX" && LOCAL:1 < TALENT:LOCAL:(ARG:1)
				LOCAL:1 = TALENT:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF ARGS == "MIN" && LOCAL:1 > TALENT:LOCAL:(ARG:1)
				LOCAL:1 = TALENT:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ELSEIF LOCAL:1 == TALENT:LOCAL:(ARG:1) && RAND:2
				LOCAL:1 = TALENT:LOCAL:(ARG:1)
				LOCAL:2 = LOCAL
			ENDIF
		NEXT
		RETURNF LOCAL:2
ENDSELECT
;FileName_COMMON.ERB ------------------------------- Rev1.00
;TARGET�Đݒ�֐�
;CALL		USER
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
;
;���X�g�֐��ƃ\�[�g�֐����ł����̂ł��Ȃ�ȈՉ��ł�������
@TARGETSET_CHACK(OP)
#DIMS OP         ;SHOW_STATUS�͓����X�V�����ƃ}�Y�C�̂ŃX�L�b�v����p
#DIM  TARGET_CNT ;�^�[�Q�b�g�̐�
#DIM  L_ID       ;REF�΍�A�n������
#DIM  SWAP_ID    ;���݂�TARGET�w�菈���p�̈ꎞ�ϐ�
;���ӂӒ���TARGET�𓦂����i����o�Ƃ��ŃY�����Ⴄ�̂Łj
SIF !TFLAG:���݂�TARGET && (CFLAG:TARGET:���ӂ� || CFLAG:MASTER:������)
	TFLAG:���݂�TARGET = TARGET

CALL MAKE_CHARA_LIST("TARGET���X�g", L_ID, TARGET, TARGET_CNT)
SIF !TARGET_CNT
	RETURN
CALL SORT_LIST("�D���~��", TARGET, TARGET_CNT)

LOCAL:1 = TARGET
IF TFLAG:���݂�TARGET > 0
	LOCAL:1 = FINDELEMENT(TARGET, TFLAG:���݂�TARGET)
	IF LOCAL:1 == -1
		LOCAL:1 = 0
		TFLAG:���݂�TARGET = 0
	ENDIF
	LOCAL:1 = TARGET:(LOCAL:1)
ENDIF
ARRAYSHIFT TARGET, 1, LOCAL:1

SIF STRCOUNT(OP, "�u�����X�V�����v")
	RETURN

;�����m�F�̓��X�g���ł���Ă���̂ł����ł͕K�v�Ȃ�
FOR LOCAL, 1, 1 + TARGET_CNT
	CFLAG:(TARGET:LOCAL):���� = 1
NEXT

;FileName_COMMON.ERB ------------------------------- Rev1.00
;�f�[�g�����i�s
;CALL		USER
;ARG		�i�߂鎞�ԁi10���P�ʁj
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@DATE_GOES_ON(ARG)
IF (CFLAG:MASTER:���݈ʒu % 100) % 10 && !AT_HOME(MASTER) && CFLAG:MASTER:���݈ʒu != OMANEKIBEYA()
	IF (CFLAG:MASTER:���݈ʒu % 100 % 10) - ARG < 0
		LOCAL:1 = CFLAG:MASTER:���݈ʒu - (CFLAG:MASTER:���݈ʒu % 100 % 10)
	ELSE
		LOCAL:1 = CFLAG:���݈ʒu - ARG
	ENDIF
	FOR LOCAL,0,CHARANUM
		SIF CHK_DATENOW(CFLAG:LOCAL:�f�[�g��)
			CFLAG:LOCAL:���݈ʒu = LOCAL:1
	NEXT
ENDIF
;====================================================
@���Z�␳(ARG)
#FUNCTION
RETURNF 1 + (ABL:PLAYER:ARG - 2) / 10
;====================================================

;-------------------------------------------------
;�֐���:RECOVER
;�T�@�v:BASE�񕜏���
;���@��:ARGS
;		ARG:0�c�Q�Ƃ���L�����ԍ�
;		ARG:1�c�񕜗�
;       ARGS�c�x�[�X
;		ARGS:1	�\���t��
;-------------------------------------------------
@RECOVER(ARG,ARG:1,ARGS,ARGS:1)
#DIM  BASE_ID
BASE_ID = FINDELEMENT(BASENAME, ARGS)
BASE:ARG:(ARGS) = LIMIT(BASE:ARG:(ARGS) + ARG:1, 0, MAXBASE:ARG:(ARGS))
IF ARGS != "" && CFLAG:ARG:���݈ʒu == CFLAG:MASTER:���݈ʒu
	IF ARG:1 > 0
		CALL COLORMESSAGE(@"%BASENAME:BASE_ID%�{{ARG:1} �i%CALLNAME:ARG%�j(%ARGS:1%)",C_GREEN,1)
	ELSEIF ARG:1 < 0
		CALL COLORMESSAGE(@"%BASENAME:BASE_ID%�|{ARG:1 * -1} �i%CALLNAME:ARG%�j",C_RED,1)
	ENDIF
ENDIF

;-------------------------------------------------
;�֐���:RECOVER_PERMIL
;�T�@�v:BASE�����񕜏���
;���@��:ARGS
;		ARG:0�c�Q�Ƃ���L�����ԍ�
;       ARGS�c�x�[�X
;�񕜗ʂ�0.1%�P��
;-------------------------------------------------
@RECOVER_PERMIL(ARG,�񕜗�,ARGS,�񕜑��x�̉e��)
#DIM �񕜗�
#DIM �񕜑��x�̉e��
SIF !TALENT:ARG:2 & 2 && ARGS == "����"
	�񕜗� = 0
LOCAL = MAXBASE:ARG:(ARGS) * �񕜗� / 1000
SIF �񕜑��x�̉e��
	LOCAL = LOCAL * (TALENT:ARG:�񕜑��x + 4) / 4
BASE:ARG:(ARGS) = LIMIT(BASE:ARG:(ARGS) + LOCAL, 0, MAXBASE:ARG:(ARGS))

;-------------------------------------------------
;�֐���:BUFF_BASE
;�T�@�v:����BASE���ꎞ�I�ɋ���
;-------------------------------------------------
@BUFF_BASE(ARG,�����\��,�ϓ��l)
#DIM �ϓ��l
#DIM �����\��
SIF !TALENT:ARG:2 & 2 && �����\�� == 6
	�ϓ��l = 0
SIF �ϓ��l < 0 && ABS(�ϓ��l) > MAXBASE:ARG:�����\��
	�ϓ��l = MAXBASE:ARG:�����\�� * -1

MAXBASE:ARG:�����\�� += �ϓ��l
BASE:ARG:�����\�� += �ϓ��l
BUFF:ARG:�����\�� += �ϓ��l

;-------------------------------------------------
;�֐���:BUFF_RESET
;�T�@�v:�o�t�����S�Ƀ��Z�b�g
;-------------------------------------------------
@BUFF_RESET
FOR LOCAL,0,CHARANUM
	FOR LOCAL:1, 0, 16
		MAXBASE:LOCAL:(LOCAL:1) -= BUFF:LOCAL:(LOCAL:1)
		BASE:LOCAL:(LOCAL:1) -= BUFF:LOCAL:(LOCAL:1)
		BUFF:LOCAL:(LOCAL:1) = 0
	NEXT
NEXT

;-------------------------------------------------
;�֐���:CHANGE_CFLAG
;�T�@�v:���b�Z�[�W�t��CFLAG�ϓ�
;�}�C�i�X�ɂ͂Ȃ�Ȃ��悤�ɂȂ��Ă�̂Œ���
;-------------------------------------------------
@CHANGE_CFLAG(�ϓ��t���O,�Ώ�,�ϓ���)
#DIM �ϓ��t���O
#DIM �Ώ�
#DIM �ϓ���

CFLAG:�Ώ�:�ϓ��t���O = MAX(CFLAG:�Ώ�:�ϓ��t���O + �ϓ���, 0)
IF �ϓ��� > 0
	CALL COLORMESSAGE(@"%CFLAGNAME:�ϓ��t���O%�{{�ϓ���}�i%CALLNAME:�Ώ�%�j",C_YELLOW,2,1)
ELSE
	CALL COLORMESSAGE(@"%CFLAGNAME:�ϓ��t���O%�|{-�ϓ���}�i%CALLNAME:�Ώ�%�j",C_RED,2,1)
ENDIF
;-------------------------------------------------
;�֐���:SHIRAHU
;�T�@�v:���ʂɈӎ��������Ԃ��@2���ƃE�t�t��
;-------------------------------------------------
@SHIRAHU(ARG)
#FUNCTION
IF FLAG:70
	RETURNF 0
ELSEIF !CFLAG:ARG:���� && !CFLAG:ARG:�Y���Q�� && !TCVAR:ARG:�D�� && !CFLAG:ARG:����
	IF TFLAG:102 == 2
		RETURNF 2
	ELSE
		RETURNF 1
	ENDIF
ELSE
	RETURNF 0
ENDIF

;-------------------------------------------------
;�֐���:BETWEENTIME
;�T�@�v:TIME��ARG����ARG:1�܂ł̊ԂȂ̂��Ԃ��֐�
;-------------------------------------------------
@BETWEENTIME(ARG,ARG:1)
#FUNCTION
IF ARG < ARG:1
	IF TIME >= ARG && TIME < ARG:1
		RETURNF 1
	ELSE
		RETURNF 0
	ENDIF
ELSE
	IF TIME >= ARG || TIME < ARG:1
		RETURNF 1
	ELSE
		RETURNF 0
	ENDIF
ENDIF
;-------------------------------------------------
;�֐���:VISIT
;�T�@�v:���̃L�����̊������ԑт��ǂ�����Ԃ��֐�
;-------------------------------------------------
@VISIT(ARG)
#FUNCTION
RETURNF BETWEENTIME(CFLAG:ARG:���K����,CFLAG:ARG:�A���)
;-------------------------------------------------
;�֐���:��������
;�T�@�v:�Z�ݍ��݃L�������Q�Ă邩�ǂ�����Ԃ��֐��������̂�S���g����悤��
;�Q�Ă��1��Ԃ�
;-------------------------------------------------
@��������(ARG)
#FUNCTION
SIF ARG == MASTER
	RETURNF CFLAG:MASTER:����
IF CFLAG:ARG:����
	RETURNF 1
ELSEIF !BETWEENTIME(CFLAG:ARG:�N������, CFLAG:ARG:�A�Q����)
	RETURNF 1
ELSE
	RETURNF 0
ENDIF
;-------------------------------------------------
;�֐���:�q���̐�������
;�T�@�v:�L����ARG�̎q�����Q�Ă邩�ǂ�����Ԃ��֐�
;�Q�Ă��1��Ԃ�
;-------------------------------------------------
@�q���̐�������(ARG)
#FUNCTION
#DIM �q���̋N������
#DIM �q���̏A�Q����
SIF !TALENT:ARG:�玙��
	RETURNF 0
�q���̋N������ = CFLAG:ARG:�N������
�q���̏A�Q���� = CFLAG:ARG:�A�Q���� - 120 + (CFLAG:ARG:�A�Q���� - 120 < 0 ? 1440 # 0 )
IF !BETWEENTIME(�q���̋N������, �q���̏A�Q����)
	RETURNF 1
ELSE
	RETURNF 0
ENDIF
;-------------------------------------------------
;�֐���:WORKING
;�T�@�v:���̃L�����̎d�����ԑт��ǂ�����Ԃ��֐�
;-------------------------------------------------
@WORKING(ARG)
#FUNCTION
IF !SHIRAHU(ARG)
	RETURNF 0
ELSEIF !BETWEENTIME(TCVAR:ARG:�d���J�n,TCVAR:ARG:�d���I��)
	RETURNF 0
ELSEIF BASE:ARG:�d���� <= 0
	RETURNF 0
ELSEIF CHARA_HOLIDAY(ARG)
	RETURNF 0
ELSE
	RETURNF 1
ENDIF
;-------------------------------------------------
;�֐���:�A�����s
;�T�@�v:����R�}���h�A�����s�����ۃy�i���e�B���������邩
;�߂�l:0���ƃy�i���������Ȃ�
;-------------------------------------------------
@�A�����s()
#FUNCTION
SELECTCASE PREVCOM
	CASE 1,60,61,65,67,68,300,304,410,604,621
		RETURNF 0
	CASEELSE
		RETURNF 1
ENDSELECT

;-------------------------------------------------
;�֐���:�J�E���^�[�s���R�}���h
;�߂�l:0�łȂ��ƃJ�E���^�[�s��
;-------------------------------------------------
@�J�E���^�[�s���R�}���h(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 697 TO 699
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT
;-------------------------------------------------
;�֐���:ENDUFUFU
;�T�@�v:���ӂӏI�������Z�b�g����
;-------------------------------------------------
@ENDUFUFU(ARG)
;���Ԓ�~���͕����Z�b�g���Ȃ�
;����������Ȃǂ͂��ׂă��Z�b�g�������ɂ���܂�
SIF !FLAG:70
	CALL CHANGE_CLOTHES(ARG, "�ߑ����Z�b�g")
;������TEQUIP��
CALL CLOTHES_SETTING_TRAIN(ARG)

;�E�t�t���n�������Z�b�g
;TEQUIP:ARG:10-TEQUIP:ARG:149������������
VARSET TEQUIP:ARG:0, 0, 10, 150
;FOR ARG:1,10,150
;	TEQUIP:ARG:(ARG:1) = 0
;NEXT

;�ː��֌W���Z�b�g
IF TFLAG:102 < 2
	BASE:ARG:�ː� = 0
	TCVAR:ARG:�C������ = 0
ENDIF
CFLAG:ARG:���ӂ� = 0
TEQUIP:ARG:50 = -1
TEQUIP:ARG:51 = -1
TEQUIP:ARG:�㔼�g�͂������ = 0
TEQUIP:ARG:�����g���炵��� = 0
TCVAR:ARG:����� = 0
TCVAR:ARG:�D���ɂ��� = 0

;�ꉞMASTER���������i���Ƃ��Ȃ��ƁA�I������������������\�������\��������̂�
IF CFLAG:MASTER:���ӂ�
	CFLAG:MASTER:���ӂ� = 0
	CALL CHANGE_CLOTHES(MASTER, "�ߑ����Z�b�g")
	CALL CLOTHES_SETTING_TRAIN(MASTER)
	VARSET TEQUIP:MASTER:0, 0, 10, 150
	TEQUIP:MASTER:50 = -1
	TEQUIP:MASTER:51 = -1
	TEQUIP:MASTER:�㔼�g�͂������ = 0
	TEQUIP:MASTER:�����g���炵��� = 0
ENDIF

IF CFLAG:����
	IF CFLAG:ARG:���ɐ��t
		PRINTFORML %CALLNAME:MASTER%��%CALLNAME:ARG%�̌��̒��Ɏc���Ă������t���n������
		CFLAG:ARG:���ɐ��t = 0
	ENDIF
	IF CFLAG:ARG:��ɐ��t || CFLAG:ARG:��ɐ��t
		PRINTFORM %CALLNAME:MASTER%��%CALLNAME:ARG%��
		IF CFLAG:ARG:��ɐ��t && !CFLAG:ARG:��ɐ��t
			PRINTFORM ��ɂւ΂����
		ELSEIF !CFLAG:ARG:��ɐ��t && CFLAG:ARG:��ɐ��t
			PRINTFORM ��ɂ��т����
		ELSE
			PRINTFORM ��Ǝ�������Ă���
		ENDIF
		PRINTFORML ���t��@���Ƃ���
		CFLAG:ARG:��ɐ��t = 0
		CFLAG:ARG:��ɐ��t = 0
	ENDIF
ENDIF
IF !FLAG:70
	TFLAG:�^�� = 0
	IF CFLAG:ARG:���ɐ��t
		PRINTFORML %CALLNAME:ARG%�͌��̒��Ɏc���Ă������t��\@ ABL:ARG:���t���� > 2 ? ���݊����� # �f���o���� \@
		CFLAG:ARG:���ɐ��t = 0
	ENDIF
	IF CFLAG:ARG:��ɐ��t || CFLAG:ARG:��ɐ��t
		PRINTFORM %CALLNAME:ARG%��
		IF CFLAG:ARG:��ɐ��t && !CFLAG:ARG:��ɐ��t
			PRINTFORM ��ɂւ΂����
		ELSEIF !CFLAG:ARG:��ɐ��t && CFLAG:ARG:��ɐ��t
			PRINTFORM ��ɂ��т����
		ELSE
			PRINTFORM ��Ǝ�������Ă���
		ENDIF
		PRINTFORML ���t��\@ ABL:ARG:���t���� > 2 ? ���Ɋ܂� # �@���� \@
		CFLAG:ARG:��ɐ��t = 0
		CFLAG:ARG:��ɐ��t = 0
	ENDIF
ENDIF
;-------------------------------------------------------------
;ARG�Ƃ��Ȃ��������������ꍇ�A���҂Ƀ��Y�i�Q�C�j�o����ǉ�����֐�
;-------------------------------------------------------------
@ADD_EXP_LESNIAN(UP_EXP,ARG,ARGS)
#DIM UP_EXP
#DIM SAMESEX

;���������ȗ������TARGET����
SIF !ARG
	ARG = TARGET
IF HETEROSEX(ARG,MASTER)
	SAMESEX = 50 + HETEROSEX(ARG,MASTER)
	EXP:SAMESEX += UP_EXP
	EXP:PLAYER:SAMESEX += UP_EXP
	IF ARGS != ""
		CALL COLORMESSAGE(@"%EXPNAME:SAMESEX%�{{UP_EXP}�i%CALLNAME:ARG%�j",C_YELLOW,2,1)
		CALL COLORMESSAGE(@"%EXPNAME:SAMESEX%�{{UP_EXP}�i%CALLNAME:MASTER%�j",C_YELLOW,2,1)
	ENDIF
ENDIF

;-------------------------------------------------
;�C�x���g�ȂǂŃL�����ꍇ�̏���
;-------------------------------------------------
@GET_ANGRY(ARG)
CFLAG:ARG:�s�@�� = 1
CFLAG:ARG:�u�`�M�� = 1
TALENT:ARG:�@�� = -1

;FileName_COMMON.ERB ------------------------------- Rev1.00
;�𐌂���Ԏ擾
;CALL		USER
;ARG		�L����No
;RETURN		�𐌂����_toSTR
;COMMENT
;-----------------------------------------------------------
@ALCOHOL_FACE(ARG)
#FUNCTIONS
SIF BASE:ARG:���C <= 2
	RETURNF "�@�f�ʁ@"
SELECTCASE BASE:ARG:���C
	CASE IS > (MAXBASE:ARG:���C / 10) * 8
		RETURNF "���ł���"
;	CASE IS > (MAXBASE:ARG:���C / 10) * 7
;		RETURNF "�ւׂꂯ"
	CASE IS > (MAXBASE:ARG:���C / 10) * 5
		RETURNF "�����ǂ�"
	CASE IS <= (MAXBASE:ARG:���C / 10) * 5
		RETURNF "�ق됌��"
ENDSELECT
;-------------------------------------------------
;�͂��^������ �̑I������\�������͌��ʂ�Ԃ��֐�
;���� 0=�m��I�����̕�����A1=�ے�I�����̕�����
;�߂�l 0=�͂��A1=������
;-------------------------------------------------
@ASK_YN(ARGS:0 = "��  ��", ARGS:1 = "������")
CURRENTREDRAW
LOCAL:0 = RESULT
REDRAW 0
PRINTBUTTON @" [%ARGS:0%]", 0
PRINTL
PRINTBUTTON @" [%ARGS:1%]", 1
PRINTL
$INPUT_LOOP
INPUT
IF RESULT != 0 && RESULT != 1
	CLEARLINE 1
	GOTO INPUT_LOOP
ENDIF
REDRAW LOCAL:0
RETURN RESULT
;-------------------------------------------------
;����ȋ@�\�����{�^�����쐬����֐�
;ARG�͓��͂���鐔���AARG:1��1��ݒ肷��ƊD�F�ɁA
;ARG:2��1��ݒ肷��ƃ{�^�������F�AARG:3��1��ݒ肷��ƃ{�^��������(�D�F)
;-------------------------------------------------
@PRINTBUTTON_EX(ARGS:0, ARG,ARG:1,ARG:2,ARG:3)
IF ARG:3
	SETCOLOR C_L_GRAY
	PRINTFORM %ARGS:0%
ELSE
	SIF ARG:2
		SETCOLOR C_YELLOW
	SIF ARG:1
		SETCOLOR C_L_GRAY
	PRINTBUTTON @"%ARGS:0%", ARG
ENDIF
RESETCOLOR
;-------------------------------------------------
;����ȋ@�\�����{�^�����쐬����֐�
;ARG�͓��͂���鐔���AARG:1��1��ݒ肷��ƊD�F�ɁA
;ARG:2��1��ݒ肷��ƃ{�^�������F�AARG:3��1��ݒ肷��ƃ{�^��������(�D�F)
;-------------------------------------------------
@PRINTBUTTON_EXC(ARGS:0, ARG,ARG:1,ARG:2,ARG:3)
IF ARG:3
	SETCOLOR C_L_GRAY
	PRINTFORMC %ARGS:0%
ELSE
	SIF ARG:2
		SETCOLOR C_YELLOW
	SIF ARG:1
		SETCOLOR C_L_GRAY
	PRINTBUTTONC @"%ARGS:0%", ARG
ENDIF
RESETCOLOR
;-------------------------------------------------
;Fisher-Yates�A���S���Y���ɂ��V���b�t���z��̍쐬
;��p�z��SHAFFLE_ARRAY���g�p
;���� 0:�z��̒����i0�`ARG:0-1�܂ł̃V���b�t���j
;-------------------------------------------------
@FISHER_YATES_SHAFFLE(ARG:0)
;�V���b�t���z��̏�����
SIF !INRANGE(ARG:0 , 1 , 499)
	THROW ����({ARG:0})���ُ�ł��B1�`499�͈̔͂Ŏw�肵�Ă��������B
VARSET SHAFFLE_ARRAY , 0
;SHAFFLE_ARRAY�̏�����
FOR LOCAL:0 , 0 , ARG:0
	SHAFFLE_ARRAY:(LOCAL:0) = LOCAL:0
NEXT

FOR LOCAL:0 , 0 , ARG:0 - 1
	LOCAL:1 = RAND(LOCAL:0 , ARG:0)
	SWAP SHAFFLE_ARRAY:(LOCAL:0), SHAFFLE_ARRAY:(LOCAL:1)
NEXT
;�I�[�p��-1���Z�b�g
SHAFFLE_ARRAY:(ARG:0) = -1
RETURN 0

@NEMUKE()
#FUNCTION
LOCAL =  TIME + 1440 * DAY - TFLAG:���Ȃ��N�� - TFLAG:198
RETURNF LOCAL

;-------------------------------------------------
;�����\��(ARG)
;�^����ꂽTIME��H��MM���\���ɕϊ�
;-------------------------------------------------
@�����\��(ARG)
#FUNCTIONS
#DIM HOUR
#DIM MINUTE
#DIMS ����
HOUR   = ARG / 60
MINUTE = ARG % 60
���� = %TOSTR(HOUR)%��%TOSTR(MINUTE,"00")%��
RETURNF ����
;-------------------------------------------------
;TIMESTOP(ARG)
;���̃L�����̎��Ԓ�~��Ԃ�Ԃ�
;0=���Ԓ�~�Ȃ��i�ӎ�����j�@1=���Ԓ�~���E����i�ӎ�����j�@2=���S�Ɏ~�߂��Ă�i�ӎ����Ȃ���ԁj
;-------------------------------------------------
@TIMESTOP(ARG)
#FUNCTION
;�����𗪂���TARGET
SIF !ARG
	ARG = TARGET
IF !FLAG:70
	LOCAL = 0
ELSEIF CFLAG:ARG:344 == 1
	LOCAL = 1
ELSE
	LOCAL = 2
ENDIF
RETURNF LOCAL

@KIGEN_CHANGE(ARG,�m��,�X��)
#DIM �m��
#DIM �X��
;�X����1�ɂ����+�̂݁A-1�ɂ����-�̂�
SIF TALENT:ARG:����R����
	�m�� /= 2
IF RAND:100 < �m��
	IF !�X��
		IF !RAND:2
			TALENT:ARG:�@�� ++
		ELSE
			TALENT:ARG:�@�� --
		ENDIF
	ELSE
		TALENT:ARG:�@�� += �X��
	ENDIF
ENDIF
TALENT:ARG:�@�� = LIMIT(TALENT:ARG:�@��,-1,1)

;-------------------------------------------------
;ARG���j�����ł��Ȃ����j�Ȃ�1
;ARG���������ł��Ȃ������Ȃ�2��Ԃ�
;���爤�~�����Ŗ���
;-------------------------------------------------
@OTOKOGIRAI(ARG)
#FUNCTION
;����
SIF TALENT:ARG:���ʚn�D == -1
	RETURNF 0
;����
SIF TALENT:ARG:����
	RETURNF 0
SIF TALENT:ARG:���~
	RETURNF 0
;�j����
IF TALENT:ARG:���ʚn�D & 1 && !(TALENT:PLAYER:2 & 1)
	RETURNF 1
;������
ELSEIF TALENT:ARG:���ʚn�D & 2 && !(TALENT:PLAYER:2 & 2)
	RETURNF 2
ENDIF
RETURNF 0

;-------------------------------------------------
;�L�����`�F�b�NF�֐�
;-------------------------------------------------
;�L�����N�^�[����������ɍ��v���Ă��邩�ǂ�����Ԃ�
;������TYPE���ƂɎw��
;�������������ɖ��O�����鎞�̓L�������X�g�N���X�֐��𑝐݂��邱�Ƃɂ���
;-------------------------------------------------
@CHECK_CHARA(C_ID, TYPE = "����")
#FUNCTION
#LOCALSIZE 1
#LOCALSSIZE 1
#DIMS DYNAMIC TYPE ;����^�C�v�ADYNAMIC�����̂ő��d�Ăяo���\
#DIM C_ID          ;�o�^�ԍ�
SELECTCASE TYPE
;��{����
CASE "����"
	RETURNF !CFLAG:C_ID:�o��
CASE "�ח�"
	RETURNF (TALENT:C_ID:�v�� || TALENT:C_ID:���� || TALENT:C_ID:���~ || TALENT:C_ID:���l || TALENT:C_ID:�Z�t��)
CASE "��݈���"
;C_ID��MASTER�̎�݂������Ă���
	RETURNF CFLAG:C_ID:��݈���
CASE "��݈����"
;C_ID��MASTER�Ɏ�݂������Ă���
	RETURNF CFLAG:C_ID:��݈����
CASE "��������"
	RETURNF (MARK:C_ID:�������� >= 1)
CASE "��������"
	RETURNF (MARK:C_ID:�������� >= 1)
CASE "�����o��"
	RETURNF (EXP:C_ID:�����o�� >= 1)
CASE "��������"
	RETURNF (CFLAG:C_ID:�������� >= 1)
CASE "����"
	RETURNF (CFLAG:C_ID:���݈ʒu == CFLAG:MASTER:���݈ʒu)
CASE "�S��"
	{
	SIF EQUIP:C_ID:�A�N�Z�T�� || EQUIP:C_ID:�X�q || EQUIP:C_ID:�C || EQUIP:C_ID:�C��
		 || EQUIP:C_ID:�����g�����P || EQUIP:C_ID:�����g�����Q
		 || EQUIP:C_ID:�㔼�g�����P || EQUIP:C_ID:�㔼�g�����Q
		 || EQUIP:C_ID:���I�^�[�h || EQUIP:C_ID:�{�f�B�[�X�[�c || EQUIP:C_ID:�����s�[�X || EQUIP:C_ID:����
		 || EQUIP:C_ID:�Y�{�� || EQUIP:C_ID:�����g�㒅 || EQUIP:C_ID:�X�J�[�g
		 || EQUIP:C_ID:�㔼�g�㒅�P || EQUIP:C_ID:�㔼�g�㒅�Q || EQUIP:C_ID:�O��
		 || EQUIP:C_ID:���̑��P || EQUIP:C_ID:���̑��Q || EQUIP:C_ID:���̑��R || EQUIP:C_ID:�r������
	}
		RETURNF 0
	RETURNF 1
CASE "�I���i"
	RETURNF TALENT:C_ID:���� == 1
CASE "�ӂ��Ȃ�"
	RETURNF TALENT:C_ID:���� == 3
CASE "�P���~�~"
	RETURNF TALENT:C_ID:������ != 0
CASE "�l�Ԏ�"
	RETURNF TALENT:C_ID:������ == 0
CASE "�񏈏�"
	SIF TALENT:C_ID:���� == 2
		RETURNF 0
	RETURNF GROUPMATCH(TALENT:C_ID:����, 0, -1)
CASEELSE
	THROW �s����TYPE%TYPE%
ENDSELECT

;-------------------------------------------------
;�L������r�֐�
;-------------------------------------------------
;�S�����K�{
;�X�}�[�g�Ƃ͒������R�s�y�S�������ł���
;-------------------------------------------------
@CHARA_COMPARE(VAR_NAME, VAR_ID, CHARA_A, TYPE, CHARA_B)
#FUNCTION
#DIMS VAR_NAME ;��r�ΏۃL�����ϐ�
#DIM  VAR_ID   ;��r�ΏۃL�����ϐ���ID
#DIM  CHARA_A  ;��r�ΏۃL����A�̓o�^�ԍ�
#DIMS TYPE     ;��r���e
#DIM  CHARA_B  ;��r�ΏۃL����B�̓o�^�ԍ�
SELECTCASE VAR_NAME
CASE "ABL"
	SELECTCASE TYPE
	CASE "=="
		RETURNF ABL:CHARA_A:VAR_ID == ABL:CHARA_B:VAR_ID
	CASE ">"
		RETURNF ABL:CHARA_A:VAR_ID > ABL:CHARA_B:VAR_ID
	CASE ">="
		RETURNF ABL:CHARA_A:VAR_ID >= ABL:CHARA_B:VAR_ID
	CASE "<"
		RETURNF ABL:CHARA_A:VAR_ID < ABL:CHARA_B:VAR_ID
	CASE "<="
		RETURNF ABL:CHARA_A:VAR_ID <= ABL:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "BASE"
	SELECTCASE TYPE
	CASE "=="
		RETURNF BASE:CHARA_A:VAR_ID == BASE:CHARA_B:VAR_ID
	CASE ">"
		RETURNF BASE:CHARA_A:VAR_ID > BASE:CHARA_B:VAR_ID
	CASE ">="
		RETURNF BASE:CHARA_A:VAR_ID >= BASE:CHARA_B:VAR_ID
	CASE "<"
		RETURNF BASE:CHARA_A:VAR_ID < BASE:CHARA_B:VAR_ID
	CASE "<="
		RETURNF BASE:CHARA_A:VAR_ID <= BASE:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "MAXBASE"
	SELECTCASE TYPE
	CASE "=="
		RETURNF MAXBASE:CHARA_A:VAR_ID == MAXBASE:CHARA_B:VAR_ID
	CASE ">"
		RETURNF MAXBASE:CHARA_A:VAR_ID > MAXBASE:CHARA_B:VAR_ID
	CASE ">="
		RETURNF MAXBASE:CHARA_A:VAR_ID >= MAXBASE:CHARA_B:VAR_ID
	CASE "<"
		RETURNF MAXBASE:CHARA_A:VAR_ID < MAXBASE:CHARA_B:VAR_ID
	CASE "<="
		RETURNF MAXBASE:CHARA_A:VAR_ID <= MAXBASE:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "EXP"
	SELECTCASE TYPE
	CASE "=="
		RETURNF EXP:CHARA_A:VAR_ID == EXP:CHARA_B:VAR_ID
	CASE ">"
		RETURNF EXP:CHARA_A:VAR_ID > EXP:CHARA_B:VAR_ID
	CASE ">="
		RETURNF EXP:CHARA_A:VAR_ID >= EXP:CHARA_B:VAR_ID
	CASE "<"
		RETURNF EXP:CHARA_A:VAR_ID < EXP:CHARA_B:VAR_ID
	CASE "<="
		RETURNF EXP:CHARA_A:VAR_ID <= EXP:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "CFLAG"
	SELECTCASE TYPE
	CASE "=="
		RETURNF CFLAG:CHARA_A:VAR_ID == CFLAG:CHARA_B:VAR_ID
	CASE ">"
		RETURNF CFLAG:CHARA_A:VAR_ID > CFLAG:CHARA_B:VAR_ID
	CASE ">="
		RETURNF CFLAG:CHARA_A:VAR_ID >= CFLAG:CHARA_B:VAR_ID
	CASE "<"
		RETURNF CFLAG:CHARA_A:VAR_ID < CFLAG:CHARA_B:VAR_ID
	CASE "<="
		RETURNF CFLAG:CHARA_A:VAR_ID <= CFLAG:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "PALAM"
	SELECTCASE TYPE
	CASE "=="
		RETURNF PALAM:CHARA_A:VAR_ID == PALAM:CHARA_B:VAR_ID
	CASE ">"
		RETURNF PALAM:CHARA_A:VAR_ID > PALAM:CHARA_B:VAR_ID
	CASE ">="
		RETURNF PALAM:CHARA_A:VAR_ID >= PALAM:CHARA_B:VAR_ID
	CASE "<"
		RETURNF PALAM:CHARA_A:VAR_ID < PALAM:CHARA_B:VAR_ID
	CASE "<="
		RETURNF PALAM:CHARA_A:VAR_ID <= PALAM:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "TALENT"
	SELECTCASE TYPE
	CASE "=="
		RETURNF TALENT:CHARA_A:VAR_ID == TALENT:CHARA_B:VAR_ID
	CASE ">"
		RETURNF TALENT:CHARA_A:VAR_ID > TALENT:CHARA_B:VAR_ID
	CASE ">="
		RETURNF TALENT:CHARA_A:VAR_ID >= TALENT:CHARA_B:VAR_ID
	CASE "<"
		RETURNF TALENT:CHARA_A:VAR_ID < TALENT:CHARA_B:VAR_ID
	CASE "<="
		RETURNF TALENT:CHARA_A:VAR_ID <= TALENT:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "TCVAR"
	SELECTCASE TYPE
	CASE "=="
		RETURNF TCVAR:CHARA_A:VAR_ID == TCVAR:CHARA_B:VAR_ID
	CASE ">"
		RETURNF TCVAR:CHARA_A:VAR_ID > TCVAR:CHARA_B:VAR_ID
	CASE ">="
		RETURNF TCVAR:CHARA_A:VAR_ID >= TCVAR:CHARA_B:VAR_ID
	CASE "<"
		RETURNF TCVAR:CHARA_A:VAR_ID < TCVAR:CHARA_B:VAR_ID
	CASE "<="
		RETURNF TCVAR:CHARA_A:VAR_ID <= TCVAR:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASE "MARK"
	SELECTCASE TYPE
	CASE "=="
		RETURNF MARK:CHARA_A:VAR_ID == MARK:CHARA_B:VAR_ID
	CASE ">"
		RETURNF MARK:CHARA_A:VAR_ID > MARK:CHARA_B:VAR_ID
	CASE ">="
		RETURNF MARK:CHARA_A:VAR_ID >= MARK:CHARA_B:VAR_ID
	CASE "<"
		RETURNF MARK:CHARA_A:VAR_ID < MARK:CHARA_B:VAR_ID
	CASE "<="
		RETURNF MARK:CHARA_A:VAR_ID <= MARK:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT

CASEELSE
	THROW �s����VAR_NAME�@%VAR_NAME%
ENDSELECT

[SKIPSTART]
�R�����R�s�y���Ēu������΍��ڂ��ӂ₹��
CASE "CVAR"
	SELECTCASE TYPE
	CASE "=="
		RETURNF CVAR:CHARA_A:VAR_ID == CVAR:CHARA_B:VAR_ID
	CASE ">"
		RETURNF CVAR:CHARA_A:VAR_ID > CVAR:CHARA_B:VAR_ID
	CASE ">="
		RETURNF CVAR:CHARA_A:VAR_ID >= CVAR:CHARA_B:VAR_ID
	CASE "<"
		RETURNF CVAR:CHARA_A:VAR_ID < CVAR:CHARA_B:VAR_ID
	CASE "<="
		RETURNF CVAR:CHARA_A:VAR_ID <= CVAR:CHARA_B:VAR_ID
	CASEELSE
		THROW �s����TYPE�@%TYPE%
	ENDSELECT
[SKIPEND]

;-------------------------------------------------
;�X�e�[�^�X�]���\���֐�
;-------------------------------------------------
;����@PRINT_�A���t�@�x�b�g�]��
;������]���Ώې��l�ɂ��邱�ƂŔėp����
;RANK_SCALE�̖��̂��킩��₷������
;-------------------------------------------------
@PRINT_RANK(VAR_VALUE, RANK_SCALE)
#DIM  VAR_VALUE  ;�]���Ώې��l
#DIMS RANK_SCALE ;�]���Ɏg�p����ړx�̎��
#DIM  RANK       ;�]�������N�A�����������قǗD�G
#DIM  RANK_NUM   ;�]���ړx�Ɋ܂܂��]���̎퐔
CALL CALC_RANK(VAR_VALUE, RANK_SCALE, RANK, RANK_NUM)
CALL PRINT_ALPHABET(RANK, RANK_NUM)

;-------------------------------------------------
;�X�e�[�^�X�]���Z�o�֐�
;-------------------------------------------------
;RANK_SCALE�ɂ��ƂÂ���VAR_VALUE�̕]�����s��
;REF�ɂ��RANK/RANK_NUM�Ƃ��ēn���ꂽ�����̐��l�𒼐ڏ���������
;-------------------------------------------------
@CALC_RANK(VAR_VALUE, RANK_SCALE, RANK, RANK_NUM)
#DIM      VAR_VALUE  ;�]���Ώې��l
#DIMS     RANK_SCALE ;�]���Ɏg�p����ړx�̎��
#DIM  REF RANK       ;�]�������N�A�����������قǗD�G
#DIM  REF RANK_NUM   ;�]���ړx�Ɋ܂܂��]���̎퐔
SELECTCASE RANK_SCALE
CASE "MAX_50000"
;�D���x�p
	RANK_NUM = 10
	SELECTCASE VAR_VALUE
	CASE IS >= 50000
		RANK = 0
	CASE IS >= 30000
		RANK = 1
	CASE IS >= 10000
		RANK = 2
	CASE IS >=  5000
		RANK = 3
	CASE IS >=  3000
		RANK = 4
	CASE IS >=  1500
		RANK = 5
	CASE IS >=  1000
		RANK = 6
	CASE IS >=   500
		RANK = 7
	CASE IS >=   100
		RANK = 8
	CASEELSE
		RANK = 9
	ENDSELECT
CASE "MAX_20000"
;�M���x�p
	RANK_NUM = 10
	SELECTCASE VAR_VALUE
	CASE IS >= 20000
		RANK = 0
	CASE IS >= 10000
		RANK = 1
	CASE IS >=  3000
		RANK = 2
	CASE IS >=  1000
		RANK = 3
	CASE IS >=   500
		RANK = 4
	CASE IS >=   150
		RANK = 5
	CASE IS >=   100
		RANK = 6
	CASE IS >=    50
		RANK = 7
	CASE IS >=    10
		RANK = 8
	CASEELSE
		RANK = 9
	ENDSELECT
CASE "MAX_99"
;�Z�p�n�ȊO��ABL
	;�������c�ɕ��ԂƔ��Ɍ��ɂ���������ňӐ}�I�ɃC���f���g���炵�Ă܂�
	RANK_NUM = 10
	SELECTCASE VAR_VALUE
	CASE IS >= 99
			RANK = 0
	CASE IS >= 75
			RANK = 1
	CASE IS >= 50
			RANK = 2
	CASE IS >= 20
			RANK = 3
	CASE IS >= 10
			RANK = 4
	CASE IS >=  5
			RANK = 5
	CASE IS >=  3
			RANK = 6
	CASE IS >=  2
			RANK = 7
	CASE IS >=  1
			RANK = 8
	CASEELSE
			RANK = 9
	ENDSELECT
CASE "MAX_6"
;�Z�\�nABL
	RANK_NUM = 7
	SELECTCASE VAR_VALUE
	CASE IS >= 6
			RANK = 0
	CASE IS >= 5
			RANK = 1
	CASE IS >= 4
			RANK = 2
	CASE IS >= 3
			RANK = 3
	CASE IS >= 2
			RANK = 4
	CASE IS >= 1
			RANK = 5
	CASEELSE
			RANK = 6
	ENDSELECT
CASEELSE
	THROW �s����RANK_SCALE %RANK_SCALE%
ENDSELECT

;-------------------------------------------------
;�����N�]���\���֐�
;-------------------------------------------------
;�����N�]��(�������������قǗD�G)�̓��e���A���t�@�x�b�g�\�L���ăJ���[�\������
;�`�����������Ă��ʂ�PRINT_RANK�łȂ��Ƃ��g���邼
;-------------------------------------------------
@PRINT_ALPHABET(RANK, RANK_NUM)
#DIM RANK
#DIM RANK_NUM
#DIMS CONST STR_RANK10, 10 = "Ex", "SS", " S", " A", " B", " C", " D", " E", " F", " G"
#DIMS CONST STR_RANK7,   7 = "Ex", " S", " A", " B", " C", " D", " E"
{
#DIMS  CONST C_RANK10, 10 =
	"C_P_PURPLE", "C_WHITE", "C_WHITE", "C_PINK", "C_RED",
	"C_ORANGE", "C_YELLOW", "C_GREEN", "C_AQUA", "C_GRAY"
}
#DIMS  CONST C_RANK7,   7 = "C_P_PURPLE", "C_WHITE", "C_PINK", "C_RED", "C_ORANGE", "C_YELLOW", "C_GRAY"
SELECTCASE RANK_NUM
CASE 10
	CALL COLOR_PRINT(STR_RANK10:RANK, C_RANK10:RANK, 2)
CASE  7
	CALL COLOR_PRINT(STR_RANK7:RANK, C_RANK7:RANK, 2)
CASEELSE
	THROW �s����RANK_NUM {RANK_NUM}
ENDSELECT
RESETCOLOR

;-------------------------------------------------
;�F�t��PRINT�֐�
;-------------------------------------------------
;�n����������n�����F��PRINT����RESETCOLOR
;�L��ϐ���DIM���Ă���F���̂݉\�i�ǉ��͗e�Ձj
;-------------------------------------------------
@COLOR_PRINT(ARGS, C_NAME, STR_NUM = 2)
#DIMS C_NAME
#DIM  STR_NUM
SIF !STRLENS(ARGS)
	RETURN
SELECTCASE C_NAME
CASE "C_P_PURPLE"
	SETCOLOR C_P_PURPLE
CASE "C_WHITE"
	SETCOLOR C_WHITE
CASE "C_PINK"
	SETCOLOR C_PINK
CASE "C_RED"
	SETCOLOR C_RED
CASE "C_ORANGE"
	SETCOLOR C_ORANGE
CASE "C_YELLOW"
	SETCOLOR C_YELLOW
CASE "C_GREEN"
	SETCOLOR C_GREEN
CASE "C_AQUA"
	SETCOLOR C_AQUA
CASE "C_GRAY"
	SETCOLOR C_GRAY
CASEELSE
	THROW �s����C_NAME %C_NAME%
ENDSELECT
PRINTFORM %ARGS, STR_NUM%
RESETCOLOR

;-------------------------------------------------
;BASE�J���[�o�[�֐�
;-------------------------------------------------
;�̗͂Ȃǂ̃J���[�o�[
;-------------------------------------------------
@BASE_BAR(C_ID, BASE_NAME, BAR_LENGTH, COLOR_NAME, OP)
#DIM  C_ID
#DIMS BASE_NAME
#DIM  BAR_LENGTH
#DIMS COLOR_NAME
#DIMS OP
#DIM  BASE_ID
BASE_ID = FINDELEMENT(BASENAME, BASE_NAME)
SIF BASE_ID < 0
	THROW ���݂��Ȃ�BASE_NAME %BASE_NAME%
SIF !STRCOUNT(OP, "�u��ޕ\�L�����v")
	PRINTFORM %BASE_NAME, 4%
CALL PRINT_COLORBAR(BASE:C_ID:BASE_ID, MAXBASE:C_ID:BASE_ID, BAR_LENGTH, UNICODE(0x2585), UNICODE(0x2585), BARCOLORSET(COLOR_NAME), RESULT:1)
IF !STRCOUNT(OP, "�u�����\�L�����v")
	IF BUFF:C_ID:BASE_ID > 0
		SETCOLOR C_AQUA
	ELSEIF BUFF:C_ID:BASE_ID < 0
		SETCOLOR C_YELLOW
	ENDIF
	PRINTFORM  ({BASE:C_ID:BASE_ID,5}/{MAXBASE:C_ID:BASE_ID,5})
	RESETCOLOR
ENDIF
SIF STRCOUNT(OP, "�u���s�v")
	PRINTFORML

;-------------------------------------------------
;�J���[�X�^���v�֐�
;-------------------------------------------------
;����̋L�������̐F�ŕ��ׂ�
;MARK�̕\���p�����ǂȂ񂩂��̑��ɂ��g����ł��傤
;-------------------------------------------------
@COLOR_STAMP(STAMP_NUM, MAX_NUM, STAMP_STR, STAMP_COLOR)
#DIM  STAMP_NUM   ;���ׂ�X�^���v�̐�
#DIM  MAX_NUM     ;�X�^���v�̍ő吔
#DIMS STAMP_STR   ;�X�^���v�Ɏg�p���镶����
#DIM  STAMP_COLOR ;�X�^���v�̐F
#DIM  STAMP_LENGTH;�X�^���v������̒���
STAMP_LENGTH = STRLENS(STAMP_STR)
SIF !STAMP_LENGTH
	THROW STAMP_STR���w�肳��Ă��܂���
SIF STAMP_COLOR
	SETCOLOR STAMP_COLOR
PRINTFORM %" " * (MAX_NUM - STAMP_NUM) * STAMP_LENGTH%
PRINTFORM %STAMP_STR * STAMP_NUM%
RESETCOLOR

;-------------------------------------------------
;�L�������I�֐�
;-------------------------------------------------
;�L�������X�g���烉���_����1����I�o����
;�߂�l�͓o�^�ԍ��A���s������-1
;-------------------------------------------------
@RAND_CHARASELECT(L_TYPE = "��l���ȊO�̃L�������X�g")
#DIMS L_TYPE                       ;���I�Ώۃ^�C�v
#DIM  L_ID                         ;���X�g�̃N���XID
#DIM  CHARA_LIST, �L�����N�^����� ;�쐬���郊�X�g
#DIM  CHARA_CNT                    ;�L�����J�E���^
CALL MAKE_CHARA_LIST("��l���ȊO�̃L�������X�g", L_ID, CHARA_LIST, CHARA_CNT)
SIF !CHARA_CNT
	RETURN -1
RETURN CHARA_LIST:(RAND:CHARA_CNT)

;----------------------------------------------------------------------------------------------------
;�L�����̓o�ꔻ��
;�Ƃ肠�������Ȃ��͒e���悤�ɂ���
;----------------------------------------------------------------------------------------------------
@CAN_MEET(CHARA)
#FUNCTION
#DIM CHARA
SIF !CHARA
	RETURNF 0
SIF !EXISTCSV(CHARA)
	RETURNF 0
SIF CFLAG:CHARA:�o��
	RETURNF 0
SIF CHARA == FLAG:�Ȃ肫��
	RETURNF 0
RETURNF 1

;----------------------------------------------------------------------------------------------------
;���ݒn�_����ړ��\�ȏꏊ�ֈړ�
;��������ǂ��o�����Ƃ��Ȃ�
;----------------------------------------------------------------------------------------------------
@GETOUT(ARG)
FOR LOCAL,MINROOM(),MAXROOM
	IF CAN_MOVE(CFLAG:ARG:���݈ʒu, LOCAL) & 1
		CFLAG:ARG:���݈ʒu = LOCAL
		BREAK
	ENDIF
NEXT

;----------------------------------------------------------------------------------------------------
;�L�����̃����_���I���֐�
;�蔲�������łł��邾���ȑf�Ȓ��I�֐����Ǝv�����iRAND_CHARASELECT�͂��ƋÂ�߂��j
;�n�����L�����͑I�΂�Ȃ�
;�o�փL��������������Ɩ������[�v�̂����ꂪ����̂���_
;��_�Ƃ͂������S�L�����Ώۂ̒��I�ł�
;�ɒ[�ȃv���C���O�����Ȃ���Ζ��ɂ͂Ȃ�Ȃ��A�͂�
;----------------------------------------------------------------------------------------------------
@RAND_PERSON(CHARA)
#FUNCTION
#DIM CHARA
#DIM HIT_CHARA
DO
	HIT_CHARA = RAND(1, �L�����N�^�����)
	SIF !CAN_MEET(HIT_CHARA) || HIT_CHARA == CHARA
		CONTINUE
	BREAK
LOOP 1
RETURNF HIT_CHARA

;----------------------------------------------------------------------------------------------------
;����ʒu�擾�֐�
;----------------------------------------------------------------------------------------------------
@GET_CHARAHOME(CHARA)
#FUNCTION
#DIM CHARA
;MASTER�����ʒu���܂��Ă�
SIF CHARA == MASTER
	RETURNF CFLAG:CHARA:�����ʒu
;�Z�ݍ��ރt���O�����Ă�Ȃ猈�܂��Ă�
SIF CHARA == FLAG:�Z�ݍ��݃L����
	RETURNF CFLAG:CHARA:�����ʒu
;�Z���s��̃L�����͐��
SIF GROUPMATCH(CSVCFLAG(CHARA, GETNUM(CFLAG, "�����ʒu")), 0, 99)
	RETURNF -100
RETURNF CSVCFLAG(CHARA, GETNUM(CFLAG, "�����ʒu"))

;----------------------------------------------------------------------------------------------------
;�ꏊ���擾�֐�
;MAIN_MAP����ŋ������ς���Ă��܂��Čl�I�ɋC��������
;���_�FGET_MAP_REPLACEMENT���g�p�ς݂�PLACE_ID���󂯎��ƌ듮����U��}�b�v�̏ꏊID�͎󂯎��܂���
;----------------------------------------------------------------------------------------------------
@GET_PLACENAME(PLACE_ID)
#FUNCTIONS
#DIM PLACE_ID
SIF PLACE_ID == SUKIMA()
	RETURNF "�X�L�}���"
SIF PLACE_ID == OMANEKIBEYA()
	RETURNF OMANEKI_PLACE()
IF GET_MAPID(PLACE_ID) == MAIN_MAP
	RETURNF NAME_FROM_PLACE(PLACE_ID)
ELSE
	RETURNF STR:(6000 + GET_MAP_REPLACEMENT(PLACE_ID) / 10)
ENDIF

;----------------------------------------------------------------------------------------------------
;�����ʒu�̒n�於�擾�֐�
;���ݒ�Ȃ�Ƃ肠����"�s��"��
;----------------------------------------------------------------------------------------------------
@AREANAME_CHARA_HOME(C_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM C_ID
#DIM HOME_ID
HOME_ID = GET_CHARAHOME(C_ID)
SIF HOME_ID <= 0
	RETURNF "�s��"
RETURNF MAP_AREANAME(HOME_ID)

;----------------------------------------------------------------------------------------------------
;���݈ʒu�̒n�於�擾�֐�
;----------------------------------------------------------------------------------------------------
@AREANAME_CHARA_NOW(C_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM C_ID
RETURNF MAP_AREANAME(CFLAG:C_ID:���݈ʒu)

;----------------------------------------------------------------------------------------------------
;�z�񒊑IF�֐�
;----------------------------------------------------------------------------------------------------
@ARRAY_HIT(HIT_LIST, LIST_SIZE)
#FUNCTION
#DIM REF HIT_LIST ;�m�����z���X�g
#DIM     LIST_SIZE;�m�����z���X�g�̃T�C�Y
#DIM     CHK_ID   ;����ΏۂƂȂ�v�f
#DIM     HIT_RAND ;���I��������
LOCAL = MAX(SUMARRAY(HIT_LIST, 0, LIST_SIZE),1)
HIT_RAND = RAND(0, LOCAL)
;DEBUGPRINTFORML LIST_SIZE��{LIST_SIZE}�@HIT_RAND{HIT_RAND}
FOR CHK_ID, 0, LIST_SIZE
	SIF HIT_RAND < SUMARRAY(HIT_LIST, 0, CHK_ID + 1)
		RETURNF CHK_ID
NEXT
;THROW ���I���s
;�J�E���^�[���I���s�ɂ��THROW�������������Ă�̂Ű1��Ԃ����Ƃɂ���
RETURNF -1

;----------------------------------------------------------------------------------------------------
;�z��RAND���֐�
;�d�������Ȃ��Ȃ̂œK�XFISHER_YATES_SHAFFLE�Ǝg�������ĉ�����
;----------------------------------------------------------------------------------------------------
@ARRAY_RAND(RAND_ARRAY, ARRAY_SIZE, RAND_MIN, RAND_MAX)
#DIM REF RAND_ARRAY; �Ώ۔z��
#DIM     ARRAY_SIZE; �z��T�C�Y�i1�ȏ�j
#DIM     RAND_MIN  ; RAND�̉����i0�ȏ�j
#DIM     RAND_MAX  ; RAND�̏��-1�A���̐����̂͒��I�ɑI�΂�Ȃ��iRAND_MIN+1�ȏ�j
#DIM     ID_ARRAY  ; ���[�v�p
FOR ID_ARRAY, 0, ARRAY_SIZE
	RAND_ARRAY:ID_ARRAY = RAND(RAND_MIN, RAND_MAX)
NEXT

;----------------------------------------------------------------------------------------------------
;FISHER_YATES_SHAFFLE�iF�֐��Łj
;�\�[�X��wikipedia
;CALLF FUNC_FISHER_YATES_SHAFFLE(LOCAL, 10)
;�����LOCAL:0�`9��0�`9���d���Ȃ��ő�������
;----------------------------------------------------------------------------------------------------
@FUNC_FISHER_YATES_SHAFFLE(ARRAY, ARRAY_SIZE)
#FUNCTION
#DIM REF ARRAY   ;�Ώ۔z��
#DIM ARRAY_SIZE  ;�z��̒����i2�ȏ�̐��l�ɂ��ĉ������j
#DIM ELE_SHAFFLE ;�V���b�t���Ώۗv�f
VARSET ARRAY, -1
ARRAY:0 = 0
;�v�f0�ɑ΂��遫�̏����͕K��0�ɂȂ�񂾂���1�ȍ~�ł���
FOR LOCAL:0, 1, ARRAY_SIZE
	ELE_SHAFFLE = RAND(0, LOCAL:0 + 1)
	;�����ς��Ȃ��悤�Ȃ�if�݂�����f�ʂ��̕������������Ȃ��Ȃ����肹�񂩁H
	;SIF ELE_SHAFFLE != LOCAL:0
	ARRAY:(LOCAL:0) = ARRAY:ELE_SHAFFLE
	ARRAY:ELE_SHAFFLE = LOCAL:0
NEXT

;----------------------------------------------------------------------------------------------------
;�����s�����\���֐�
;���̒��ȈՃA�j���[�V����
;1�b��1�s�ǋL���Ă�����֐�����
;�n���ꂽ�z��̗v�f�����Ԃɕ\������
;�{�i�I�ɓ����������Ȃ�ςɂ߁[�����g��
;�g�p�ӏ��̓i�Y�[�����̃_�E�W���O�R�}���h
;----------------------------------------------------------------------------------------------------
@PRINT_GROUP(COMMENT, NUM_COMMENT, TIME_REDRAW = 1000)
#DIMS REF COMMENT         ;�\�����镶����̔z��
#DIM  NUM_COMMENT         ;�z��̗v�f��
#DIM  PREV_REDRAW         ;�ꎞ�ޔ�p
#DIM  TIME_REDRAW         ;�s�ǉ��̊Ԋu�A�W����1�b
#DIM  DYNAMIC NOW_COMMENT ;�\���B������p
PREV_REDRAW = CURRENTREDRAW()
REDRAW 0
FOR LOCAL:0, 0, NUM_COMMENT
	FOR LOCAL:1, 0, NUM_COMMENT
		IF LOCAL:1 <= NOW_COMMENT
			PRINTFORML %COMMENT:(LOCAL:1)%
		ELSE
			PRINTFORML
		ENDIF
	NEXT
	TWAIT TIME_REDRAW, 0
	NOW_COMMENT ++
	SIF LOCAL:0 < NUM_COMMENT -1
		CLEARLINE NUM_COMMENT
NEXT
REDRAW PREV_REDRAW
WAIT

;----------------------------------------------------------------------------------------------------
;ARG(DAY)��N�����ɕϊ�����֐�
;----------------------------------------------------------------------------------------------------
@DAY_TO_DATE(ARG)
#FUNCTION
VARSET LOCAL
;�~�̌�31���͗�O
SIF ARG % 124 == 0
	LOCAL:5 = 1
;�N��
LOCAL:1 = ARG / 124
SIF !LOCAL:5
	LOCAL:1 += 1
;��
IF LOCAL:5
	LOCAL:2 = 4
ELSE
	LOCAL:2 = ARG % 124 / 31 + 1
ENDIF
;��
IF LOCAL:5 || ARG % 124 % 31 == 0
	LOCAL:3 = 31
ELSE
	LOCAL:3 = ARG % 124 % 31
ENDIF
LOCAL = LOCAL:1 * 1000 + LOCAL:2 * 100 + LOCAL:3
RETURNF LOCAL

;----------------------------------------------------------------------------------------------------
;ARG(�N����)��DAY�ɕϊ�����֐�
;----------------------------------------------------------------------------------------------------
@DATE_TO_DAY(ARG)
#FUNCTION
VARSET LOCAL
LOCAL += (ARG / 1000 - 1) * 124
LOCAL += (ARG % 1000 / 100 - 1) * 31
LOCAL += ARG % 1000 % 100
RETURNF LOCAL

;----------------------------------------------------------------------------------------------------
;ARG(DAY)��N�����i�j���j�ŕ\������֐�
;ARG���N�����ł���Ȃ�ARG:1��^�ɂ��邱��
;----------------------------------------------------------------------------------------------------
@PRINT_DATE(ARG, ARG:1)
;ARG��DAY�Ɣ���
IF !ARG:1
	LOCAL:1 = DAY_TO_DATE(ARG)
	LOCAL:2 = ARG
;ARG��N�����Ɣ���
ELSE
	LOCAL:1 = ARG
	LOCAL:2 = DATE_TO_DAY(ARG)
ENDIF
LOCAL:3 = LOCAL:1 % 1000 / 100
PRINTFORM {LOCAL:1 / 1000}�N�� %GET_MONTH(LOCAL:3)% {LOCAL:1 % 1000 % 100}���i%GET_DAY(LOCAL:2)%�j


code:
;FileName_JOB.ERB ----------------------------- Rev1.00
;�x�����菈��
;CALL		USER
;ARG		�L����NO
;ARG:1(�ȗ���)	0:�d�����I����Ă���΋x�� 1:�d���̂�����͎d�����i�d���ʁE�I�����������Ȃ��j
;RETURN		0:�d����, 1:�x��
;COMMENT
;-----------------------------------------------------------
@CHARA_HOLIDAY(ARG, ARG:1=0)
#FUNCTION

;�c�d���ʁE�d���I�����Ԃ��m�F���邩����
IF !ARG:1
	SIF BASE:ARG:�d���� <= 0
		RETURNF 1
	SIF TCVAR:ARG:�d���I�� > 0 && TIME > TCVAR:ARG:�d���I��
		RETURNF 1
ENDIF
RETURNF TCVAR:ARG:�d���J�n == -1

;-----------------------------------------------------------
;@CHARA_HOLIDAY���番��
;MOVEMENT���Ă΂��x�ɍX�V�����
;ARG:1��1��ݒ肷��Ɖ����d�����ɂ��X�L�b�v�𖳎�
;-----------------------------------------------------------
@�d�����e�ݒ�(ARG, ARG:1)
#DIM ���|��
#DIM �x��FLG
VARSET LOCAL
�x��FLG = 0

;CFLAG:350 �E��i40,���|�@41,��b�@42,�퓬�@43,���{�@44,�����@45,���y 46,�V�� 47,�������i��`���Ȃ��j 48,����� 49,����Q�� 50,����ЂÂ� 51,�����̐���
;TCVAR:��`���Ȃ� =1 ��`���Ȃ� =2 ��`���Ă������I���Ȃ�
;����n�̂��d���͂����ł͐ݒ肵�܂���B����.ERB���Q�Ƃ��Ă��������B

;�f�P�l�͂��d��������܂��B�����҂ł��ˁB
;IF ARG == 30
	;����͔�Ԃł�
;	IF (DAY % 2 == 1)
;		BASE:ARG:�d���� = 0
;		�x��FLG = 1
;	ENDIF

IF !ARG:1
	;���ݎd�����Ȃ�߂�
	SIF CFLAG:ARG:�s�� == 5
		RETURN

	;����ɎQ������z�͂��̓��̎d�����x��
	IF FLAG:����J�Ãt���O > 0 && CFLAG:ARG:����Q�� > 0
		IF !GROUPMATCH(CFLAG:ARG:�E��, 48, 49, 50, 51)
			TCVAR:ARG:�d���J�n = -1
			TCVAR:ARG:�d���I�� = -1
		ENDIF
		RETURN
	ENDIF
ENDIF

IF CFLAG:ARG:�Y�x
	�x��FLG = 1
	TCVAR:ARG:�d���J�n = -1
	TCVAR:ARG:�d���I�� = -1
	RETURN
ENDIF

;�d���J�n�E�d���I��������-1�ɂ���(�J�n������-1�Ȃ�x���Ɣ���)
TCVAR:ARG:�d���J�n = -1
TCVAR:ARG:�d���I�� = -1

;���d���̏���
;�얲
IF ARG == 1
		���|�� = 0
		IF YOGORE:�Q�� > 1000
			CFLAG:ARG:�E�� = �Q��
			���|�� = 1
		ELSE
			FOR LOCAL,1,6
				IF YOGORE:LOCAL > 1000
					CFLAG:ARG:�E�� = LOCAL
					���|�� = 1
				ENDIF
			NEXT
		ENDIF
		IF ���|�� && TIME < TCVAR:ARG:�d���I��
			;��2���Ԃقǂ��|��
			MAXBASE:ARG:�d���� = 1200
			CFLAG:ARG:�E�� = 40
			;TCVAR:ARG:��`���Ȃ� = 1
			TCVAR:ARG:���� = 0
			TCVAR:ARG:�d���J�n = 360
			TCVAR:ARG:�d���I�� = 480
			�x��FLG = 0
		ELSE
			MAXBASE:ARG:�d���� = 0
			�x��FLG = 1
		ENDIF
;��`����
ELSEIF ARG == 2
	IF (DAY % 7 < 6 && DAY % 7 != 0)
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 1080
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 8
		CFLAG:ARG:�E�� = 44
		TCVAR:ARG:���� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;����
;���j�͖������A���j�����̑���
ELSEIF ARG == 4
	IF ( DAY % 7 == 1 || DAY % 7 == 3 )
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 960
		TCVAR:ARG:�d���I�� = 1140
		CFLAG:ARG:�E�� = 11
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 5
		TCVAR:ARG:���� = 216
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�T�j�[
ELSEIF ARG == 5
	IF ( DAY % 7 == 6 || DAY % 7 == 0 )
		MAXBASE:ARG:�d���� = 4200
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 1020
		CFLAG:ARG:�E�� = 32
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���i�`��
ELSEIF ARG == 6
	IF ( DAY % 7 == 6 || DAY % 7 == 0)
		MAXBASE:ARG:�d���� = 4200
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 1020
		CFLAG:ARG:�E�� = 32
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�X�^�[
ELSEIF ARG == 7
	IF ( DAY % 7 == 6 || DAY % 7 == 0 )
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 32
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�����͕������N�����Č�������
ELSEIF ARG == 8
	IF ( DAY % 7 > 0 && DAY % 7 < 6 )
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 360
		TCVAR:ARG:�d���I�� = 720
		CFLAG:ARG:�E�� = 49
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�����������Â�
ELSEIF ARG == 9
	IF ( DAY % 7 > 0 && DAY % 7 < 6 )
		;�Ԃ�1���ԐQ��̂ł��̗�
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 1020
		CFLAG:ARG:�E�� = 49
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�� ���j�͎����݁A���j�̓g���[�j���O
ELSEIF ARG == 10
	IF DAY % 7 == 1
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 960
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 10
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSEIF DAY % 7 == 3
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 960
		TCVAR:ARG:�d���I�� = 1140
		CFLAG:ARG:�E�� = 11
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;������
ELSEIF ARG == 11
	IF DAY % 7 == 1
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 780
		TCVAR:ARG:�d���I�� = 1140
		CFLAG:ARG:�E�� = 6
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���[�~�A
ELSEIF ARG == 12
	IF DAY % 7 == 2 && CFLAG:ARG:�D�P�o�ߓ��� <= 71 && MAIN_MAP != 1
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 1320
		TCVAR:ARG:�d���I�� = 1440
		CFLAG:ARG:�E�� = ���n���ʂ�
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 0
		TCVAR:ARG:���� = 705
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�޲���
ELSEIF ARG == 13
	IF ( DAY % 7 == 6 || DAY % 7 == 0 )
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 32
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�H
ELSEIF ARG == 14
	IF ( DAY % 7 == 6 || DAY % 7 == 0 )
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 32
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	;���N���āA�Ⴊ�~���Ă���ƗV��
	ELSEIF TIME:5 == 8
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 360
		TCVAR:ARG:�d���I�� = 420
		CFLAG:ARG:�E�� = 343
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	;�Đ��ꐰ�V�A�C�X��
	ELSEIF (DAY:2 == 2 && TIME:5 < 2)
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 900
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		TCVAR:ARG:���� = 213
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;398����
ELSEIF ARG == 15
	IF (DAY % 7 == 1 || DAY % 7 == 3 || DAY % 7 == 5)
		IF TIME <= 720
			MAXBASE:ARG:�d���� = 2400
			TCVAR:ARG:�d���J�n = 480
			TCVAR:ARG:�d���I�� = 720
			CFLAG:ARG:�E�� = 309
			CFLAG:ARG:�E�� = 40
			TCVAR:ARG:���� = 5
			TCVAR:ARG:���� = 215
		ELSEIF TIME > 720 && TIME < 1020 && !BASE:ARG:�d����
			BASE:ARG:�d���� = 1200
		ELSE
			MAXBASE:ARG:�d���� = 1200
			TCVAR:ARG:�d���J�n = 1020
			TCVAR:ARG:�d���I�� = 1140
			CFLAG:ARG:�E�� = 313
			CFLAG:ARG:�E�� = 44
			TCVAR:ARG:���� = 5
			TCVAR:ARG:���� = 215
		ENDIF
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���~���A
ELSEIF ARG == 16
	IF DAY % 7 == 0
		MAXBASE:ARG:�d���� = 300
		TCVAR:ARG:�d���J�n = 1110
		TCVAR:ARG:�d���I�� = 1140
		CFLAG:ARG:�E�� = 327
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�A���X
ELSEIF ARG == 17
	IF DAY % 14 == 0
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 5
		TCVAR:ARG:���� = 216
		�x��FLG = 0
		TCVAR:ARG:��`���Ȃ� = 1
	ELSEIF (DAY:3 == 7 || DAY:3 == 16 || DAY:3 == 17 || DAY:3 == 27)
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 720

		IF FLAG:�Z�ݍ��݃L���� == ARG
			;�_�ЂɏZ�ݍ��݂��Ă���ꍇ�@�_�Ђ̑䏊
			CFLAG:ARG:�E�� = 8
		ELSE
			;����ȊO�@�����̉Ƃ̃L�b�`��
			CFLAG:ARG:�E�� = 525
		ENDIF
		CFLAG:ARG:�E�� = 44
		TCVAR:ARG:���� = 0
		TCVAR:ARG:���� = 216
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�O�o��
ELSEIF ARG >= 20 && ARG <= 22
	IF  DAY % 28 == 21
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 780
		TCVAR:ARG:�d���I�� = 1140
		CFLAG:ARG:�E�� = 202
		TCVAR:ARG:��`���Ȃ� = 1
		CFLAG:ARG:�E�� = 47
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�݂��
ELSEIF ARG == 23
	IF DAY % 7 == 3
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 780
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 216
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���@25
ELSEIF ARG == 25
	IF ( DAY:3 == 5 || DAY:3 == 20 )
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 4
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���@26
ELSEIF ARG == 26
	IF (DAY:2 == 4 && DAY:3 == 30)
		MAXBASE:ARG:�d���� = 8400
		TCVAR:ARG:�d���J�n = 780
;		TCVAR:ARG:�d���I�� = 180
		CFLAG:ARG:�E�� = 4
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�݂����[�͂��܂ɉ�����J���Ă܂��B�Ď��D���ł��B
ELSEIF ARG == 28
;�O���Ɉ�x����J���Ă܂�
	IF DAY % 3 == 0
		MAXBASE:ARG:�d���� = 4800
		TCVAR:ARG:�d���J�n = 960
		TCVAR:ARG:�d���I�� = 1440
		CFLAG:ARG:�E�� = 44
		TCVAR:ARG:���� = 2
		CFLAG:ARG:�E�� = 444
		TCVAR:ARG:���� = 550;���c����
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�����
ELSEIF ARG == 29
	IF DAY % 7 == 5
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 808
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 4
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���c����
ELSEIF ARG == 31
	IF (DAY % 7 == 5 || DAY % 7 == 2)
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 720
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�_�ގq�l
ELSEIF ARG == 32
	IF DAY:2 == 2 && DAY:3 == 5
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 540
		TCVAR:ARG:�d���I�� = 720
		CFLAG:ARG:�E�� = 222
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		TCVAR:ARG:���� = 212;���������
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�z�K�q�l
ELSEIF ARG == 33
	IF MONEY < 500
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 660
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 8
		CFLAG:ARG:�E�� = 44
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�V�q
ELSEIF ARG == 34
	IF DAY % 7 == 6
		MAXBASE:ARG:�d���� = 100
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 610
		CFLAG:ARG:�E�� = 3
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�ߋ肳��Ƃ������ۃQ�X�g�̂��Ȃ��ŗ��l�R���g
ELSEIF ARG == 35
	IF DAY % 7 == 2
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 1200
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 830
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;����
ELSEIF ARG == 36
	IF (DAY % 7 > 0 && DAY % 7 <= 5)
		MAXBASE:ARG:�d���� = 5000
		TCVAR:ARG:�d���J�n = 420
		TCVAR:ARG:�d���I�� = 720
		CFLAG:ARG:�E�� = 928
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 3
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;����
ELSEIF ARG == 37
	IF ( DAY % 7 > 0 && DAY % 7 <= 5 )
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 930
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 2
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���P
ELSEIF ARG == 40
	IF ( DAY % 7 == 2 || DAY % 7 == 5 )
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 1200
		TCVAR:ARG:�d���I�� = 1440
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 1
		IF DAY % 7 == 2
			;���@���q��
			CFLAG:ARG:�E�� = 109
		ELSE
			CFLAG:ARG:�E�� = 222
		ENDIF
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�ʂ��͖����Z���ɏ������Ɨ���
ELSEIF ARG == 41
	IF DAY:3 == 6
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 1320
		TCVAR:ARG:�d���I�� = 1380
		CFLAG:ARG:�E�� = 313
		CFLAG:ARG:�E�� = 44
		TCVAR:ARG:���� = 5
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�ؐ�@43
ELSEIF ARG == 43
	IF DAY % 7 < 6
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 420;7��
		TCVAR:ARG:�d���I�� = 540;16��
		CFLAG:ARG:�E�� = 722
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSEIF DAY % 7 == 6
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 660;11��
		TCVAR:ARG:�d���I�� = 960;16��
		CFLAG:ARG:�E�� = 217
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�G����
ELSEIF ARG == 44
	;�����\�܁A�O�\���ɐl���֖��@���o��
	IF ( DAY:3 == 15 || DAY:3 == 30 )
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 3
		TCVAR:ARG:�d���J�n = 840
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���I�� = 1140
		�x��FLG = 0
	;����ȊO�̓��͐��ꂩ�܂�Ȃ�5%�̊m���Ŗ��@�̐X�̍̏W�A���������C���}�b�v�����@�̐X�̂Ƃ�����
	ELSEIF TIME:5 <= 3 && FLAG:���ւ��C�x���g < 50 && MAIN_MAP == 5
		IF !RAND:2
			CFLAG:ARG:�E�� = 540
		ELSE
			CFLAG:ARG:�E�� = 507
		ENDIF
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 3
		TCVAR:ARG:�d���J�n = 420
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���I�� = 720
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�t����
ELSEIF ARG == 50
	IF DAY % 2
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 1140
		TCVAR:ARG:�d���I�� = 1200
		CFLAG:ARG:�E�� = 329
		CFLAG:ARG:�E�� = 46
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���ǂ�
ELSEIF ARG == 52
	IF DAY % 7 == 4
		MAXBASE:ARG:�d���� = 4800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 1080
		CFLAG:ARG:�E�� = 405
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 2
		SIF TALENT:MASTER:�����m��
			TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSEIF DAY % 7 == 2
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 900
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 3
		TCVAR:ARG:���ւ� = OBJNAME_TO_ID(ARG, "GET", "�ߑ��Z�b�g", "���ǂ�򔄂�Z�b�g")
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�ς����͋؋�����̈���������
ELSEIF ARG == 54
	IF !TALENT:ARG:���� || DAY % 7 == 6
		CFLAG:ARG:�E�� = 310
		TCVAR:ARG:�d���J�n = 480
		IF CFLAG:ARG:2 < 100
			MAXBASE:ARG:�d���� = 9000
			TCVAR:ARG:�d���I�� = 1380
		ELSEIF CFLAG:ARG:2 < 500
			MAXBASE:ARG:�d���� = 7200
			TCVAR:ARG:�d���I�� = 1200
		ELSEIF CFLAG:ARG:2 < 1000
			MAXBASE:ARG:�d���� = 3600
			TCVAR:ARG:�d���I�� = 840
		ELSEIF CFLAG:ARG:2 < 3000
			MAXBASE:ARG:�d���� = 2400
			TCVAR:ARG:�d���I�� = 720
		ELSE
			MAXBASE:ARG:�d���� = 1200
			TCVAR:ARG:�d���I�� = 600
		ENDIF
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�Ђ����͂����̐�`�ɓ]�E���܂���
ELSEIF ARG == 55
	IF (DAY % 7 == 1 || DAY % 7 == 4)
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 720
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 3
		TCVAR:ARG:���� = 216
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�_�q
ELSEIF ARG == 56
	IF ( DAY % 7 == 1 || DAY % 7 == 3 || DAY % 7 == 5)
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 780
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 126
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;������
ELSEIF ARG == 57
	IF FESTIVAL() == "����"
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = ����
		TCVAR:ARG:��`���Ȃ� = 1
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSEIF DAY % 7 == 0
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 11
		TCVAR:ARG:��`���Ȃ� = 1
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF

;����͓y���ȊO�����܂Ŗ��
ELSEIF ARG == 58
	IF ( DAY % 7 > 0 && DAY % 7 <= 5 )
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 360
		TCVAR:ARG:�d���I�� = 720
		CFLAG:ARG:�E�� = 301
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 2
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�������͖����Z���ɗ���
ELSEIF ARG == 59
	IF DAY:3 == 6
		MAXBASE:ARG:�d���� = 600
		CFLAG:ARG:�E�� = 313
		TCVAR:ARG:�d���J�n = 1320
		TCVAR:ARG:�d���I�� = 1380
		CFLAG:ARG:�E�� = 44
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�p���X�B
ELSEIF ARG == 60
	IF (DAY % 7 > 0 && DAY % 7 <= 5)
		MAXBASE:ARG:�d���� = 600
		CFLAG:ARG:�E�� = 946
		TCVAR:ARG:�d���J�n = 780
		TCVAR:ARG:�d���I�� = 1080
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�P�l�͖����~�͂̐��b
ELSEIF ARG == 62
	MAXBASE:ARG:�d���� = 600
	TCVAR:ARG:�d���J�n = 780
	TCVAR:ARG:�d���I�� = 840
	CFLAG:ARG:�E�� = 421
	CFLAG:ARG:�E�� = 43
	TCVAR:ARG:���� = 0
	�x��FLG = 0
;�E�V
ELSEIF ARG == 64
	IF DAY % 7 == 4
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 960
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 10
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���@65 ���΂͒��N���Ē�������ߌ�A���؋x�݁A���y�͌ߌォ��Q��܂ŁB���͂��x�݁@6������22���A�Q�B7������14����14������21��
ELSEIF ARG == 65
	IF ( DAY % 7 == 1 || DAY % 7 == 2 )
		MAXBASE:ARG:�d���� = 4200
		TCVAR:ARG:�d���J�n = 420
		TCVAR:ARG:�d���I�� = 840
		CFLAG:ARG:�E�� = 802
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 2
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSEIF ( DAY % 7 == 5 || DAY % 7 == 6 )
		MAXBASE:ARG:�d���� = 4200
		TCVAR:ARG:�d���J�n = 840
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 805
		CFLAG:ARG:�E�� = 42
		TCVAR:ARG:���� = 2
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�d���͓y���ȊO14���܂Ŏ��q���Ŏ��ƒ��A�c���30���͌�Еt��
ELSEIF ARG == 67
	IF (DAY % 7 > 0 && DAY % 7 <= 5 && FESTIVAL() == "")
		MAXBASE:ARG:�d���� = 3900
		TCVAR:ARG:�d���J�n = 480
		TCVAR:ARG:�d���I�� = 870
		CFLAG:ARG:�E�� = 222
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�H�� 4���Ɉ�x�̂��Ԃ̎����
ELSEIF ARG == 68
	IF DAY:2 < 4 && GROUPMATCH(DAY:3,2,6,10,14,18,22,26,30)
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 360
		TCVAR:ARG:�d���I�� = 600
		CFLAG:ARG:�E�� = 438
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;����
ELSEIF ARG == 70
	IF (DAY % 7 == 3 || DAY % 7 == 4)
		MAXBASE:ARG:�d���� = 4800
		TCVAR:ARG:�d���J�n = 540
		TCVAR:ARG:�d���I�� = 1020
		CFLAG:ARG:�E�� = 213
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:��`���Ȃ� = 2
		TCVAR:ARG:���� = 2
		�x��FLG = 0
	ELSEIF (DAY % 7 == 1 || DAY % 7 == 2 || DAY % 7 == 5)
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 1080
		TCVAR:ARG:�d���I�� = 1200
		CFLAG:ARG:�E�� = 213
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�i�Ԃ͓��j�ȊO�[���܂ł�������f�@�B��҂�����ˁA�d���Ȃ���
ELSEIF ARG == 72
	IF (DAY % 7 > 0 && DAY % 7 <= 6)
		MAXBASE:ARG:�d���� = 4800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 1080
		CFLAG:ARG:�E�� = 404
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 5
		TCVAR:ARG:��`���Ȃ� = 2
		TCVAR:ARG:���� = 503
		;�����m���Ƌ��{���K�v
		SIF ABL:MASTER:���{ < 3 || !TALENT:MASTER:�����m��
			TCVAR:ARG:��`���Ȃ� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���f�B�X��
ELSEIF ARG == 75
	IF DAY % 7 == 3
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 420
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 436
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�����͌������ɓn���炷�邯�Ǔ񕪂̈�ŃT�{��
ELSEIF ARG == 76
	SIF !TCVAR:ARG:�d���̗L��
		TCVAR:ARG:�d���̗L�� = RAND:2 + 1
	IF (DAY % 7 == 1 || DAY % 7 == 3 || DAY % 7 == 5) && TCVAR:ARG:�d���̗L�� == 2
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = �O�r�̐�
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���@79
ELSEIF ARG == 79
	���|�� = 0
	FOR LOCAL,701,733
		SELECTCASE LOCAL
			CASE 703,704
				CONTINUE
			CASE 708
				CONTINUE
			CASE 712 TO 730
				CONTINUE
		ENDSELECT
		IF YOGORE:LOCAL > 1000
			CFLAG:ARG:�E�� = LOCAL
			���|�� = 1
		ENDIF
	NEXT
	IF FESTIVAL() == "���Ղ�"
		MAXBASE:ARG:�d���� = 6000
		TCVAR:ARG:�d���J�n = 420
		TCVAR:ARG:�d���I�� = 1200
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 2
		�x��FLG = 0
	ELSEIF DAY % 7 == 6
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 720
		TCVAR:ARG:�d���I�� = 1020
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 1
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;����
ELSEIF ARG == 80
	IF DAY:3 >= 15 && DAY:3 <= 20
		MAXBASE:ARG:�d���� = 1800
		TCVAR:ARG:�d���J�n = 600
		TCVAR:ARG:�d���I�� = 780
		CFLAG:ARG:�E�� = 221
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�@�q
ELSEIF ARG == 81
	IF DAY:3 >= 25 && DAY:3 <= 28
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 1140
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 232
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�����[
ELSEIF ARG == 82
	IF DAY:3 >= 25 && DAY:3 <= 28
		MAXBASE:ARG:�d���� = 1200
		TCVAR:ARG:�d���J�n = 1140
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 232
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;��ց@�o����Ǝd������サ�܂���
ELSEIF ARG == 85
	IF (DAY % 7 == 2 || DAY % 7 == 4)
		MAXBASE:ARG:�d���� = 3000
		TCVAR:ARG:�d���J�n = 420
		TCVAR:ARG:�d���I�� = 720
		CFLAG:ARG:�E�� = 102
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:���� = 4
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;��
ELSEIF ARG == 87
	IF (DAY % 7 > 0 && DAY % 7 <= 4)
		MAXBASE:ARG:�d���� = 4200
		TCVAR:ARG:�d���J�n = 300
		TCVAR:ARG:�d���I�� = 720
		CFLAG:ARG:�E�� = 103
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 0
		�x��FLG = 0
	ELSEIF DAY % 7 == 5
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 780
		TCVAR:ARG:�d���I�� = 840
		CFLAG:ARG:�E�� = 103
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�F��
ELSEIF ARG == 89
	IF DAY:3 == 4
		MAXBASE:ARG:�d���� = 9600
		TCVAR:ARG:�d���J�n = 480 ;8��23��
		TCVAR:ARG:�d���I�� = 1380
		CFLAG:ARG:�E�� = 121
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 0
		TCVAR:ARG:��`���Ȃ� = 0
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�ɂ��ɂ��
ELSEIF ARG == 90
	IF DAY:3 == 4
		MAXBASE:ARG:�d���� = 9600
		TCVAR:ARG:�d���J�n = 480
		TCVAR:ARG:�d���I�� = 1380
		CFLAG:ARG:�E�� = 121
		CFLAG:ARG:�E�� = 43
		TCVAR:ARG:���� = 5
		TCVAR:ARG:��`���Ȃ� = 2
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�Ƃ���
ELSEIF ARG == 91
	IF DAY % 7 == 2
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 1200
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 830
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;�z�s�@�_��_�̊��U�S��
ELSEIF ARG == 92
	IF DAY % 7 == 3 || DAY % 7 == 6
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 720
		TCVAR:ARG:�d���I�� = 960
		CFLAG:ARG:�E�� = 202
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 3
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;��\��o��
ELSEIF ARG >= 94 && ARG <= 95
	IF  DAY % 28 == 7
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 900
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 202
		TCVAR:ARG:��`���Ȃ� = 1
		CFLAG:ARG:�E�� = 47
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;����
ELSEIF ARG == 96
	IF  DAY % 28 == 7
		MAXBASE:ARG:�d���� = 3600
		TCVAR:ARG:�d���J�n = 900
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 202
		TCVAR:ARG:��`���Ȃ� = 1
		CFLAG:ARG:�E�� = 47
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSEIF DAY % 7 == 2
		MAXBASE:ARG:�d���� = 600
		TCVAR:ARG:�d���J�n = 1200
		TCVAR:ARG:�d���I�� = 1260
		CFLAG:ARG:�E�� = 830
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 5
		�x��FLG = 0
	ELSE
		MAXBASE:ARG:�d���� = 0
		�x��FLG = 1
	ENDIF
;���ׁ@
ELSEIF ARG == 97
	IF DAY % 7 == 1
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 1260
		TCVAR:ARG:�d���I�� = 1440
		CFLAG:ARG:�E�� = 301
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 1
	ELSEIF DAY % 7 == 3
		MAXBASE:ARG:�d���� = 2400
		TCVAR:ARG:�d���J�n = 1260
		TCVAR:ARG:�d���I�� = 1440
		CFLAG:ARG:�E�� = 540
		CFLAG:ARG:�E�� = 41
		TCVAR:ARG:���� = 1
	ELSE
		MAXBASE:ARG:�d���� = 0
	ENDIF

;���̐l�����͍��Z�������d���ɂ͂��Ă܂���B���d���ĕ�W�B�����d���Ɨ��l�͕s����ɖZ�����񂾂낤�Ȃ��c�c
ELSE
	�x��FLG = 1
ENDIF
IF �x��FLG == 0
	CFLAG:ARG:�E�� = GET_JOBPLACE("�d��",ARG)
ENDIF

;FileName_JOB.ERB ----------------------------- Rev1.00
;�d�����̈ړ�����
;CALL		USER
;ARG		�L����NO
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@JOBMOVE(ARG)
#DIM �O�̐E��
SIF CFLAG:ARG:����Q�� > 0 || GROUPMATCH(CFLAG:ARG:�E��,48,49,50,51)
	RETURN
�O�̐E�� = CFLAG:ARG:�E��
;�얲
IF ARG == 1
	IF YOGORE:(CFLAG:ARG:�E��) <= 1000
		LOCAL:1 = 0
		FOR LOCAL,1,6
			IF YOGORE:LOCAL <= 1000
				CONTINUE
			ELSE
				CFLAG:ARG:�E�� = LOCAL
				LOCAL:1 ++
			ENDIF
		NEXT
		IF YOGORE:�Q�� >= 1000
			CFLAG:ARG:�E�� = �Q��
			LOCAL:1 ++
		ENDIF
		SIF !LOCAL:1
			BASE:ARG:�d���� = 0
	ENDIF
;��
ELSEIF ARG == 10
	IF DAY % 7 == 3
		TCVAR:ARG:��`���Ȃ� = 0
	ELSE
		TCVAR:ARG:��`���Ȃ� = 1
	ENDIF
;������
ELSEIF ARG == 11
	IF TIME >= 960
		CFLAG:ARG:�E�� = 11
		CFLAG:ARG:�E�� = 42
	ELSE
		CFLAG:ARG:�E�� = 6
		CFLAG:ARG:�E�� = 40
	ENDIF
;�A���X
ELSEIF ARG == 17
	;�������I���Ό�Еt������`����
	IF TIME >= 720
		TCVAR:ARG:��`���Ȃ� = 0
	;�������Ŗ����Ȃ��`����
	ELSEIF DAY % 14 > 0
		TCVAR:ARG:��`���Ȃ� = 0
	;�������͎�`���Ȃ�
	ELSE
		TCVAR:ARG:��`���Ȃ� = 1
	ENDIF
;�݂����[
ELSEIF ARG == 28
	;�d���݂͎�`����
	IF BASE:ARG:�d���� > 3000
		TCVAR:ARG:��`���Ȃ� = 0
	;������o�������`���Ă����Ԃ͕ς��Ȃ�
	ELSE
		TCVAR:ARG:��`���Ȃ� = 2
	ENDIF
;��
ELSEIF ARG == 29
	;���{�ƐM�����K�v
	IF CFLAG:ARG:�M���x < 500 || ABL:MASTER:���{ < 3
		TCVAR:ARG:��`���Ȃ� = 1
	ELSE
		TCVAR:ARG:��`���Ȃ� = 0
	ENDIF
;�ؐ�
ELSEIF ARG == 43
	IF DAY % 7 == 6
		IF TIME >= 840
			CFLAG:ARG:�E�� = 212
			CFLAG:ARG:�E�� = 41
		ELSE
			CFLAG:ARG:�E�� = 218
			CFLAG:ARG:�E�� = 41
		ENDIF
	ENDIF
;�G�����@�O��̏������玞�Ԃ��o�߂��ĂȂ���΃X���[
ELSEIF ARG == 44 && TIME:0 != TCVAR:ARG:357
	;�o��
	IF DAY:3 == 15 || DAY:3 == 30
		;�q���̑����A�v��A��{�́|�R�`�{�T
		LOCAL:1 = RAND:8
		LOCAL:1 -= 3
		;���J�A���́|�P
		SIF TIME:5 == 6 || TIME:5 == 7
		LOCAL:1 -= 1
		;�J�A��́|�Q
		SIF TIME:5 == 4 || TIME:5 == 8
		LOCAL:1 -= 2
		;��J�A����A�݂���A�����́|�R
		SIF TIME:5 == 5 || TIME:5 == 9 || TIME:5 == 12 || TIME:5 == 13
		LOCAL:1 -= 1
		;���A�_�C�������h�_�X�g�́{�Q
		SIF TIME:7 >= 1
		LOCAL:1 += 2
		;�q�������Ȃ��Ȃ��葝�₷
		SIF TCVAR:ARG:354 < 5
		LOCAL:1 += 1
		;�q���������Ȃ��茸�炷
		SIF TCVAR:ARG:354 > 25
		LOCAL:1 -= 3
		TCVAR:ARG:354 += LOCAL:1
		SIF LOCAL:1 > 0
		TCVAR:ARG:355 += LOCAL:1
		;�����q�����}�C�i�X�ɂȂ�����O�ɂ���
		SIF TCVAR:ARG:354 < 0
		TCVAR:ARG:354 = 0
		;���݂̋q�������ȏゾ�ƃG�����̃T�|�ɉ��
		IF TCVAR:ARG:354 > 25
			CFLAG:ARG:�E�� = 43
		;�����łȂ���ΌĂэ��݂�
		ELSE
			CFLAG:ARG:�E�� = 41
		ENDIF
	;�̏W�@�G�����̍̏W�ʂ��v��
	ELSE
		;�̏W�ʂ����������Ȃ�Ȃ��悤��
		SIF TCVAR:ARG:357 < 420 || TCVAR:ARG:357 > 720
		TCVAR:ARG:357 = 420
		;�v�Z����(���݂�TIME-�O��v�Z����TIME)*1�`20�̗���
		TCVAR:ARG:354 += (TIME:0 - TCVAR:ARG:357) * (RAND:20 + 1)
		;�̏W�ʂ��ő�d���ʂ���������I��
		SIF TCVAR:ARG:354 > MAXBASE:ARG:�d����
		BASE:ARG:�d���� = 1
	ENDIF
;�d��
ELSEIF ARG == 67
	;���Ƃ��I���Ό�Еt������`����
	IF TIME >= 840
		CFLAG:ARG:�E�� = 40
		TCVAR:ARG:��`���Ȃ� = 0
	;���x�݂͓��R����
	ELSEIF TIME >= 720 && TIME <= 780
		TCVAR:ARG:��`���Ȃ� = 1
	;���{��3�ȏォ�M���x��50�ȏ�Ȃ���Ƃ���`����
	ELSEIF ABL:MASTER:���{ >= 3 && CFLAG:ARG:�M���x >= 50
		TCVAR:ARG:��`���Ȃ� = 2
	;����ȊO�͎�`���Ȃ�
	ELSE
		TCVAR:ARG:��`���Ȃ� = 1
	ENDIF
ENDIF
IF �O�̐E�� != CFLAG:ARG:�E��
	CFLAG:ARG:�E�� = GET_JOBPLACE("�d��",ARG)
ENDIF

;FileName_JOB.ERB ------------------------------- Rev1.00
;�d�����擾
;CALL		USER
;ARG		VOID
;RETURN		VOID
;COMMENT
;-----------------------------------------------------------
@GET_JOBNAME(ARG)
#FUNCTIONS
SELECTCASE ARG
CASE 1
	LOCALS = �|��
CASE 2
	LOCALS = �Ǝ�
CASE 4
	LOCALS = �g���[�j���O
CASE 8 TO 9
	LOCALS = ����
CASE 10
	IF DAY % 7 == 3
		LOCALS = �g���[�j���O
	ELSE
		LOCALS = ������
	ENDIF
CASE 11
	IF TIME >= 960
		LOCALS = �g���[�j���O
	ELSE
		LOCALS = ���@���
	ENDIF
CASE 12
	LOCALS = �H���̊m��
;�`���m
CASE 14
	SIF CFLAG:ARG:�E�� == 41
		LOCALS = �A�C�X��
;���~���A
CASE 16
	LOCALS = ���j���̓���
;�A���X
CASE 17
;��`���Ȃ��Ȃ�l�`���A�����Ȃ�Ǝ�
	IF TCVAR:ARG:��`���Ȃ�
		LOCALS = �l�`��
	ELSEIF CFLAG:ARG:�E�� == 44
		LOCALS = �Ǝ�
	ELSE
		LOCALS = ��Еt��
	ENDIF
;�O�o��
CASE 20 TO 22
	LOCALS = �R���T�[�g
CASE 23
	LOCALS = �����o��
CASE 25
	LOCALS = ���E�Ǘ�
CASE 26
	LOCALS = ���E�Ǘ�
CASE 28
	IF BASE:ARG:�d���� > 3000
		LOCALS = �d����
	ELSE
		LOCALS = ����̎d��
	ENDIF
CASE 29
	LOCALS = �L�����M
CASE 31
	LOCALS = ���U
CASE 32
	LOCALS = �g�̑���
CASE 33
	LOCALS = ����
CASE 34
	LOCALS = ��|��
CASE 35
	LOCALS = ��b
CASE 36
	LOCALS = ����̊Ǘ�
CASE 37
	LOCALS = �o�͊Ǘ�
CASE 40
	LOCALS = �x�r�[�V�b�^�[
CASE 41
	LOCALS = ����
CASE 43
	IF DAY % 7 == 6
		LOCALS = �H�ו���
	ELSE
		LOCALS = �C�s
	ENDIF
CASE 44
	IF DAY:3 == 15 || DAY:3 == 30
		LOCALS = ���@���̏o��
	ELSE
		LOCALS = �̏W
	ENDIF
CASE 52
	IF DAY % 7 == 2
		LOCALS = �򔄂�
	ELSE
		LOCALS = ����
	ENDIF
CASE 54
	LOCALS = �Ǐ�
CASE 55
	LOCALS = ���U
CASE 56
	LOCALS = �C�s
CASE 57
	IF FESTIVAL() == "����"
		LOCALS = �\�y
	ELSE
		LOCALS = �\�y�̗��K
	ENDIF
CASE 58
	LOCALS = ���
CASE 59
	LOCALS = ����
CASE 60
	LOCALS = ���̌�����
CASE 62
	LOCALS = �~�͂̐��b
CASE 64
	LOCALS = ������
CASE 65
	LOCALS = �x��
CASE 67
	IF TIME >= 720 && TIME <= 780
		LOCALS = �����x��
	ELSEIF TIME >= 840
		LOCALS = ��Еt��
	ELSE
		LOCALS = ���q���̎���
	ENDIF
CASE 68
	LOCALS = ���Ԃ̎����
CASE 70
	IF DAY % 7 == 3 || DAY % 7 == 4
		LOCALS = �X��
	ELSE
		LOCALS = ��������
	ENDIF
CASE 72
	LOCALS = �f�@
CASE 75
	LOCALS = �ō̏W
CASE 76
	LOCALS = �D��
CASE 79
	LOCALS = ��W��
CASE 80
	LOCALS = ���M���
CASE 81
	LOCALS = ���|�[�g
CASE 82
	LOCALS = ���|�[�g
CASE 85
	LOCALS = �|��
CASE 87
	IF DAY % 7 == 5
		LOCALS = ���@
	ELSE
		LOCALS = �΍s
	ENDIF
CASE 89
	LOCALS = �����e�i���X�i��j
CASE 90
	LOCALS = �����e�i���X
CASE 91
	LOCALS = ��b
CASE 94
	LOCALS = �R���T�[�g
CASE 95
	LOCALS = �R���T�[�g
CASE 96
	IF DAY % 28 == 7
		LOCALS = �R���T�[�g
	ELSE
		LOCALS = ��b
	ENDIF
CASEELSE
	LOCALS = �d��
ENDSELECT

RETURNF LOCALS

@SPECIALJOB(ARG)
SELECTCASE ARG
	CASE 1
		PRINTFORML ������%CALLNAME:ARG%�͗d���ގ��̎d�������邻����
		INPUT
		PRINTL [0]��`��
		PRINTL [1]����΂ꂢ��
		IF RESULT == 0
			IF ABL:MASTER:�퓬�\�� < 2
				PRINTL ����܂Ƃ��ɂȂ邩�痈��Ȃƌ���ꂽ�c
			ELSE
				PRINTFORML %CALLNAME:ARG%���S�O���Ȃ�������s��F�߂Ă��ꂽ
				PRINTFORML %STR:(CFLAG:ARG:�E�� / 10 + 6000)%�Ɍ������܂�
			ENDIF
		ELSE
			PRINTFORML %CALLNAME:MASTER%��%CALLNAME:ARG%�ɐ����𑗂���
		ENDIF
ENDSELECT


code:
@KICKOUT_0(ARG)
#FUNCTION
SELECTCASE CFLAG:MASTER:���݈ʒu
	CASE 13
		RETURNF 12
	CASE 24
		RETURNF 23
	CASE 30
		RETURNF 27
	CASE 39
		RETURNF 38
ENDSELECT

@BATHCHECK_0(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 13,24,30,39
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT
RETURNF 0

@BATHROOM_0()
#FUNCTION
IF CFLAG:MASTER:���݈ʒu == ���� || CFLAG:MASTER:���݈ʒu == 23
	RETURNF 24
ELSEIF (CFLAG:MASTER:���݈ʒu >= 26 && CFLAG:MASTER:���݈ʒu <= 35)
	RETURNF 30
ELSEIF (CFLAG:MASTER:���݈ʒu >= 36 &&  CFLAG:MASTER:���݈ʒu <= 51)
	RETURNF 39
ELSE
	RETURNF 13
ENDIF
RETURNF 0

@BEDROOM_0(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 15,17,18,19,32,33,34,43,44,52,53,54,55
		RETURNF 1
	CASE 16
		SIF FLAG:15
			RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT
RETURNF 0

@MOON_WATCH_POINT_0(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 10,24
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT

@KITCHEN_0(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 8,29,42
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT

@INROOM_0(ARG)
#FUNCTION
SIF OMANEKIBEYA() == ARG
	RETURNF 1
SELECTCASE CHK_INHOME(ARG)
	CASE 4,8,9,10,12,13,14,15,17,18,19,23,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55
		RETURNF 1
	CASE 16
		SIF FLAG:15
			RETURNF 1
		RETURNF 0
	CASEELSE
		RETURNF 0
ENDSELECT

@OUTROOF_0(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 1,2,5,11,20,22,25,47
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT

@CATNAP_PLACE_0(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 9,10,13,15,17,18,19,32,33,34,43,44,52,53,54,55
		RETURNF 1
	CASE 16
		SIF FLAG:15
			RETURNF 1
		RETURNF 0
	CASEELSE
		RETURNF 0
ENDSELECT

;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------
@MAP_SEARCH_REPLACEMENT_0(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 1,22
		RETURNF 10
	CASE 2,5,11,21
		RETURNF 20
	CASE 3,4
		RETURNF 30
	CASE 6 TO 20
		RETURNF 40
	CASE 23 TO 36
		RETURNF 50
	CASE 36 TO 51
		RETURNF 60
	CASE 52 TO 56
		RETURNF 40
ENDSELECT
RETURNF 0

@MAP0_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 0
	SIF INRANGE(PLACE_ID, 26, 35)
		RETURNF "�O�d���̉�"
	SIF INRANGE(PLACE_ID, 36, 51)
		RETURNF "�������"
	;SIF INRANGE(PLACE_ID, 1, 25) || INRANGE(PLACE_ID, 52, 56)
	RETURNF "����_��"
ELSE
	SELECTCASE PLACE_ID
	CASE 50
		RETURNF "�O�d���̉�"
	CASE 60
		RETURNF "�������"
	;CASE 10, 20, 30, 40
	CASEELSE
		RETURNF "����_��"
	ENDSELECT
ENDIF


code:
@KICKOUT_1()
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 12
		RETURNF 107
ENDSELECT
RETURNF 101

@BATHCHECK_1(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 12
		RETURNF 1
ENDSELECT
RETURNF 0

@OPENPLACE_1(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	;���O
	CASE 1,2,6,21
		RETURNF 2
	;���ցA�L��
	CASE 4,7,8,9,10,11
		RETURNF 1
	CASE 23,29
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT

@MAP_UNIQUEMESSAGE_1
VARSET LOCAL
SELECTCASE CFLAG:MASTER:���݈ʒu
	CASE 104
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML �傫�Ȗ؋����u����Ă���
		RETURN 1
	CASE 109
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML �ؒ���̌F���u����Ă���
		RETURN 1
	CASE 110
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML ����ɑ卪���݂邳��Ă���
		RETURN 1
	CASE 119
		FOR LOCAL,1,CHARANUM
			IF CFLAG:LOCAL:���݈ʒu == 112
				LOCAL:1 = LOCAL
				LOCAL:2 ++
			ENDIF
		NEXT
		CALL DRAW_INFORMATIONLINE("Info",1)
		IF !LOCAL:2
			PRINTFORML ���Ȃ���ɂ��ĕ��C��`����閧���u������
		ELSE
			PRINTFORML �閧���u��ʂ��ē�������%CALLNAME:(LOCAL:1)%\@ LOCAL:2 > 1? ����# \@��������
			PRINTFORML ��i���ȁI
		ENDIF
		RETURN 1
	CASEELSE

ENDSELECT

;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------
@MAP_SEARCH_REPLACEMENT_1(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 103,104
		RETURNF 140
	CASE 121
		RETURNF 150
	CASE 101 TO 122
		RETURNF 130
	CASE 123 TO 133
		RETURNF 160
ENDSELECT
RETURNF 0

@MAP1_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 1
	SIF INRANGE(PLACE_ID, 123, 133)
		RETURNF "��������"
	;SIF INRANGE(PLACE_ID, 101, 122)
	RETURNF "���@��"
ELSE
	SELECTCASE PLACE_ID
	CASE 160
		RETURNF "��������"
	CASEELSE
		RETURNF "���@��"
	ENDSELECT
ENDIF


code:
@KICKOUT_2()
#FUNCTION
;SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
;	CASE 12
;		RETURNF 107
;ENDSELECT
;RETURNF 101

@BATHCHECK_2(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
ENDSELECT
RETURNF 0

@MAP_UNIQUEMESSAGE_2
CALL DRAW_INFORMATIONLINE("Info",1)
IF WITH_MOB()
	RETURN 1
ELSE
	SELECTCASE CFLAG:MASTER:���݈ʒu
		CASE 205
			IF INRANGE(TIME, 540, 1020)
				PRINTFORML ���邩��ɂ��C�̂Ȃ������ȉ͓��������̎�t�����Ă���
			ELSE
				PRINTFORML �����w�͕܂��Ă���
			ENDIF
		CASE 213
			PRINTFORML �X���ɂ͂�������̖{�I������ł���
		CASE 222
			IF TIME >= 480 && TIME <= 720 || TIME >= 780 && TIME <= 840 && FLAG: 70 != 1
				PRINTDATA
					DATAFORM �������̎q���B��%CALLNAME:TARGET%�̎��Ƃ��󂯂Ă���c
				ENDDATA
				PRINTL
			ELSEIF TIME >= 720 && TIME <= 780 && FLAG:70 != 1
				PRINTDATA
					DATAFORM ���q���̎q���B��%CALLNAME:TARGET%�ƐH�����Ă���c
				ENDDATA
				PRINTL
			ELSEIF TIME >= 480 && TIME <= 840 && FLAG:70 == 1 && !CFLAG:MASTER:���ӂ�
				PRINTDATA
					DATAFORM ���q���̎q���B�͒�~���Ă���c
				ENDDATA
				PRINTL
			ELSEIF TIME >= 480 && TIME <= 840 && FLAG:70 == 1 && CFLAG:MASTER:���ӂ�
				PRINTDATA
					DATAFORM %CALLNAME:TARGET%�͎��q���̎q���B�̑O�ŏP���Ă���c
				ENDDATA
				PRINTL
			ENDIF
		CASE 203 TO 206
			SIF !RAND:50 && INRANGE(TIME, 540, 1020)
				PRINTFORML ��܂��������Ђ��ʂ̒j���A�ʍs�l�ɉ����M�S�Ɍ���Ă���
	ENDSELECT
ENDIF
RETURN 1

;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------

@MAP_SEARCH_REPLACEMENT_2(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 201 TO 207, 219,220
		RETURNF 210
	CASE 225
		RETURNF 260
	CASE 213,215,216,226
		RETURNF 220
	CASE 211,212,217,218
		RETURNF 230
	CASE 222,224
		RETURNF 240
	CASE 223
		RETURNF 250
	CASE 214,221,230 TO 237
		RETURNF 270
ENDSELECT
RETURNF 0

@MAP2_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
RETURNF "�l��"


code:
@KICKOUT_3()
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 33
		RETURNF 332
	CASE 38
		RETURNF 335
ENDSELECT
RETURNF 101

@BATHCHECK_3(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 33,38
		RETURNF 1
ENDSELECT
RETURNF 0

@BATHROOM_3(ARG)
#FUNCTION
IF CFLAG:MASTER:���݈ʒu >= 1 && CFLAG:MASTER:���݈ʒu <= 33
	RETURNF 333
ELSEIF (CFLAG:MASTER:���݈ʒu >= 34 &&  CFLAG:MASTER:���݈ʒu <= 42)
	RETURNF 338
ELSE
	RETURNF 333
ENDIF
RETURNF 0

@MAP_UNIQUEMESSAGE_3
CALL DRAW_INFORMATIONLINE("Info",1)
IF WITH_MOB()
	IF FLAG:70
		PRINTFORML �z�t�S�u��������~���Ă���c
	ELSEIF CFLAG:MASTER:���݈ʒu == 329
		PRINTFORML �z�t�S�u�������L�̐��b�����Ă���c
	ELSE
		PRINTFORML �z�t�S�u�����������Ă���c
	ENDIF
	RETURN 1
ELSEIF !FLAG:70
	IF CFLAG:MASTER:���݈ʒu == 318
		PRINTFORML �n������������������Ă���c
		RETURN 1
	ELSEIF CFLAG:MASTER:���݈ʒu == 329
		PRINTFORML �˂����񂪂���
		RETURN 1
	ENDIF
ENDIF

;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------
@MAP_SEARCH_REPLACEMENT_3(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 343,346,347,348
		RETURNF 310
	CASE 344,345
		RETURNF 320
	CASE 334 TO 342
		RETURNF 330
	CASE 301 TO 308
		RETURNF 340
	CASE 309,315 TO 330,332,333
		RETURNF 350
	CASE 313,314
		RETURNF 360
	CASE 310 TO 312
		RETURNF 370
	CASE 331
		RETURNF 380
ENDSELECT
RETURNF 0

@MAP3_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 3
	SIF INRANGE(PLACE_ID, 301, 333)
		RETURNF "�g����"
	SIF INRANGE(PLACE_ID, 334, 342)
		RETURNF "����̔p�m��"
	;SIF INRANGE(PLACE_ID, 343, 348)
	RETURNF "���̌�"
ELSE
	SELECTCASE PLACE_ID
	CASE 330
		RETURNF "����̔p�m��"
	CASE 340, 350, 360, 370, 380
		RETURNF "�g����"
	CASEELSE
		RETURNF "���̌�"
	ENDSELECT
ENDIF


code:
@KICKOUT_4()
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 20
		RETURNF 419
	CASE 41
		RETURNF 434
	CASE 54
		RETURNF 465
ENDSELECT

@BATHROOM_4()
#FUNCTION
IF CFLAG:MASTER:���݈ʒu >= 401 && CFLAG:MASTER:���݈ʒu <= 430
	RETURNF 420
ELSE
	RETURNF 441
ENDIF
RETURNF 0

@BATHCHECK_4(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(ARG)
	CASE 20,41,54
		RETURNF 1
	CASEELSE
		RETURNF 0
ENDSELECT
RETURNF 0

@MAP_UNIQUEMESSAGE_4
CALL DRAW_INFORMATIONLINE("Info",1)
IF WITH_MOB()
	IF FLAG:70
		PRINTFORML �C�i�o�B����~���Ă���
	ELSEIF GROUPMATCH(TIME:2,1,6,7)
		PRINTFORML �C�i�o�B�������Ă���c
	ELSEIF !DAY:3 % 10
		IF !TALENT:MASTER:2 & 2
			PRINTFORML ����̃C�i�o�B�͖�X�Ƃ��Ă���c�c
		ELSE
			PRINTFORML ����̃C�i�o�B���狭��Ȏ�����������c�c
		ENDIF
	ELSE
		SELECTCASE RAND:5
			CASE 0
				PRINTFORML �C�i�o�B��������Ă���
			CASE 1
				PRINTFORML �C�i�o�B���V��ł���
			CASE 2
				PRINTFORML �C�i�o�B���b�������Ă���
			CASE 3
				PRINTFORML �C�i�o�ƃC�i�o�������񂱂��Ă���
			CASE 4
				PRINTFORML �C�i�o�B���ςݏd�Ȃ��Ă���
		ENDSELECT
	ENDIF
	RETURN 1
ENDIF

;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------

@MAP_SEARCH_REPLACEMENT_4(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 401 TO 406
		RETURNF 450
	CASE 407 TO 430
		RETURNF 480
	CASE 431
		RETURNF 440
	CASE 432,433,442,445
		RETURNF 430
	CASE 434,435,440,441
		RETURNF 420
	CASE 436,437
		RETURNF 460
	CASE 438,439
		RETURNF 470
	CASE 450 TO 466
		RETURNF 490
	CASE 443,444,446,447
		RETURNF 410
ENDSELECT
RETURNF 0

@MAP4_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 4
	SIF INRANGE(PLACE_ID, 401, 430)
		RETURNF "�i����"
	SIF INRANGE(PLACE_ID, 436, 437)
		RETURNF "�����̋u"
	SIF PLACE_ID == 438
		RETURNF "���z�̔�"
	SIF INRANGE(PLACE_ID, 450, 466)
		RETURNF "������"
	RETURNF "�����̒|��"
ELSE
	SELECTCASE PLACE_ID
	CASE 450, 480
		RETURNF "�i����"
	CASE 460
		RETURNF "�����̋u"
	CASE 470
		RETURNF "���z�̔�"
	CASE 490
		RETURNF "������"
	CASEELSE
		RETURNF "�����̒|��"
	ENDSELECT
ENDIF


code:
@KICKOUT_5()
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 14
		RETURNF 511
	CASE 37
		RETURNF 534
	CASE 26
		RETURNF 525
ENDSELECT
;RETURNF 101

@BATHCHECK_5(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
ENDSELECT
RETURNF 0

@BATHROOM_5(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
ENDSELECT
RETURNF 0

@MAP_UNIQUEMESSAGE_5
SELECTCASE CFLAG:MASTER:���݈ʒu
	CASE 502
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML �G���ȕi���������ƕ���ł���
		PRINTFORML �u�񔄕i�v�̕\�����₽��Ƒ����c�c
	CASE 503
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML �������̉Ƃ̗����ƈ�˂�������
;	CASE 520
;		CALL DRAW_INFORMATIONLINE("Info",1)
;		PRINTFORML �u�V�z�j���v�Ə����ꂽ�傫�ȉԗւ�����ł���
	CASE 524
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML �I�ɖ�r�Ɛl�`������ł���
	CASE 543
		CALL DRAW_INFORMATIONLINE("Info",1)
		PRINTFORML ���ɂ͓��̂̒m��Ȃ������U��΂��Ă���
ENDSELECT

RETURN 1
;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------

@MAP_SEARCH_REPLACEMENT_5(ARG)
#FUNCTION
SELECTCASE ARG
;�X�̓����
	CASE 501,534 TO 537, 544
		RETURNF 510
;������
	CASE 502
		RETURNF 520
;�Ö؂̑��
	CASE 540 TO 545
		RETURNF 530
;���J���@�X
	CASE 510 TO 515
		RETURNF 540
;�l�`�̗m��
	CASE 520 TO 533
		RETURNF 550
;�Ďv�̓�
	CASE 506
		RETURNF 560
;������
	CASEELSE
		RETURNF 570
ENDSELECT
RETURNF 0

@MAP5_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 5
	SIF INRANGE(PLACE_ID, 510, 515)
		RETURNF "�������̓X"
	SIF INRANGE(PLACE_ID, 520, 531)
		RETURNF "�l�`�̗m��"
	SIF INRANGE(PLACE_ID, 534, 537)
		RETURNF "�G�����̓X"
	SIF PLACE_ID == 502
		RETURNF "������"
	SIF PLACE_ID == 506
		RETURNF "������"
	SIF PLACE_ID == 509
		RETURNF "�Ďv�̓�"
	;SIF INRANGE(PLACE_ID, 343, 348)
	RETURNF "���@�̐X"
ELSE
	SELECTCASE PLACE_ID
	CASE 520
		RETURNF "������"
	CASE 540
		RETURNF "�������̓X"
	CASE 550
		RETURNF "�l�`�̗m��"
	CASE 560
		RETURNF "�Ďv�̓�"
	CASE 570
		RETURNF "������"
	CASEELSE
		RETURNF "���@�̐X"
	ENDSELECT
ENDIF


code:
@KICKOUT_7()
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 35
		RETURNF 703
	CASE 21
		RETURNF 729
ENDSELECT

@BATHCHECK_7(ARG)
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
ENDSELECT
RETURNF 0

@MAP_UNIQUEMESSAGE_7
CALL DRAW_INFORMATIONLINE("Info",1)
SELECTCASE CFLAG:MASTER:���݈ʒu
	CASE 703
		IF DAY:2 == 2 && TALENT:MASTER:�`�� == 4 && GROUPMATCH(TIME:2,5,6,7)
			PRINTFORML �ҊԂ̌��ɖ�����ꂽ�u�������A%CALLNAME:MASTER%�̂܂����ь����Ă���
			PRINTFORML ���z�I�Ȍ��i���c�c
		ENDIF
ENDSELECT

;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------

@MAP_SEARCH_REPLACEMENT_7(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 703,704,735
	;�����̑�
		RETURNF 720
	CASE 708
	;���寂̒r
		RETURNF 730
	CASE 720 TO 730
	;��l�̉��~
		RETURNF 750
	CASE 712
	;�Ԍ���n���Z���^�[
		RETURNF 760
	CASEELSE
	;�[�̎��C
		RETURNF 710
ENDSELECT
RETURNF 0

@MAP7_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 7
	SIF INRANGE(PLACE_ID, 715, 719)
		RETURNF "�H�o���̉�"
	SIF INRANGE(PLACE_ID, 720, 730)
		RETURNF "��l�̉��~"
	RETURNF "�d���̎R�̎R�["
ELSE
	SELECTCASE PLACE_ID
	CASE 750
		RETURNF "��l�̉��~"
	CASEELSE
		RETURNF "�d���̎R�̎R�["
	ENDSELECT
ENDIF


code:
@KICKOUT_8()
#FUNCTION
SELECTCASE CHK_INHOME(CFLAG:MASTER:���݈ʒu)
	CASE 25
		RETURNF 822
	CASE 37
		RETURNF 834
ENDSELECT

@MAP_UNIQUEMESSAGE_8
CALL DRAW_INFORMATIONLINE("Info",1)
IF WITH_MOB()
	RETURN 1
ELSE
	SELECTCASE CFLAG:MASTER:���݈ʒu
		CASE 803
			IF INRANGE(TIME, 540, 1020)
				PRINTFORML ���邩��ɂ��C�̂Ȃ������ȉ͓��������̎�t�����Ă���
			ELSE
				PRINTFORML �����w�͕܂��Ă���
			ENDIF
	ENDSELECT
ENDIF
RETURN 1
;-----------------------------------------
;�񎩑�ɍ����ւ���ꏊID��Ԃ��֐�
;ARG,�Ώ�ID
;RETURNF,�����ւ��ςݑΏ�ID
;-----------------------------------------

@MAP_SEARCH_REPLACEMENT_8(ARG)
#FUNCTION
SELECTCASE ARG
	CASE 805,830 TO 850
	;�V�E
		RETURNF 890
	CASE 801,802,803,806 TO 809
	;��
		RETURNF 810
	CASE 805
	;�u
		RETURNF 820
	CASE 814
	;��
		RETURNF 830
	CASE 804,811,813,815
	;����
		RETURNF 840
	CASEELSE
	;�{�a
		RETURNF 850
ENDSELECT
RETURNF 0

@MAP8_AREANAME(PLACE_ID)
#FUNCTIONS
#LOCALSIZE 1
#LOCALSSIZE 1
#DIM PLACE_ID
IF MAIN_MAP == 8
	SIF PLACE_ID == 804 || INRANGE(PLACE_ID, 811, 825)
		RETURNF "���_��"
	SIF PLACE_ID == 805 || INRANGE(PLACE_ID, 830, 842)
		RETURNF "�V�E"
	;SIF INRANGE(PLACE_ID, 801, 810)
	RETURNF "�d���̎R�̎R��"
ELSE
	SELECTCASE PLACE_ID
	CASE 890
		RETURNF "�V�E"
	;�R�̌΂͎��_�Ђ̕~�n���Ɋ܂߂��Ⴂ�܂�
	CASE 830, 840, 850
		RETURNF "���_��"
	CASEELSE
		RETURNF "�d���̎R�̎R��"
	ENDSELECT
ENDIF