code:
2018/08/31
eraTW4.630proto用ミラダの石訪問販売デイリーパッチ

・ミラダの石訪問販売デイリーの実装
・適宜リファクタリング

◆対象環境
eraTW4.630protoのバニラ環境

以下のパッチはマージ済み

[eraT0010724]eraTW4.630proto用外出マップ正邪宅追加他パッチ
	キャラ番号直打ちから_Rename.csvを利用して可読性を上げてるのはぜひ他の人にも広めたい
	目についた所だけでも少しずつ修正しておきたいです
[eraT0010726]eraTW4.630proto用パンツとブラ処理改変+αパッチ
	ブラジャー処理での総当たり分岐直打ち指定から
	各パンツ側にコーディネートするブラの情報を持たせるリファクタリングがとてもよい
	適当に改良しときました
	・MAKE_INTしなければ0が返るのでノーブラはそれでよし
	・衣装セット.ERBで使用している@CLOTHES_ID関数を使えば装備部位と衣服名称を使って衣服が指定できます
		コメントなしでもどのブラが対応してるのかわかるようになります
		CALLF MAKE_INT(V_NAME, 10)
			↓
		CALLF MAKE_INT(V_NAME, CLOTHES_ID("上半身下着１", "Ｔシャツ"))
	・ついでに@今日のブラジャーにてノーブラが発生するように仕込むなど、夏はノーブラ率上がります
	　その他、ヤリマン時空（全員ヤリマンモード）だと安易にエロくなります
	　とりあえず非ヤリマン時空において、ニューゲームで1日に1キャラ程度はノーブラの娘が発生するくらいの確率
	・ブラジャー抽選に確率系を織り交ぜた結果、途中でブラの種類が変わるようになるバグが出た
	　ぱんつと同じ要領で、今日のブラ、パジャマ用ブラを抽選するように処理を組みました
	　@今日のブラジャーはF関数化

◆内容
・248スレ>>494、ラルバ、舞、里乃、隠岐奈のよく行く地域を暫定で-1に設定
　@遭遇判定はちゃんと読んでいないから内容把握してない
　口上修正はやってない
・既存デイリー系の微妙なリファクタリング
・副産物として、拠点マップのYOGORE値合計と平均を取れるF関数をCOMMONに入れた
・ITEM獲得とそのアナウンスができる関数を作ってCOMMONに入れた
　IDと取得個数を渡して使います
　使ってみたらとても便利なので円とカリスマの入手と支払い用の関数も用意しときました
　既存の処理の置き換えはとりあえず、デイリー系と依頼系だけやってみた
・ミラダの石訪問販売デイリーの実装
　一発ネタのインパクト勝負
　音の出ないeraでうるせぇ！と思ってもらえれば大成功
　ただし現状ではエロはほぼ無いよ
　最初の選択肢で訪問販売お断りすると以後来訪しません
・夢精デイリーで稀にミラダの石が入手できるように
・HPH_PRINT関数で使ってるcolorをC_H_PINKとして広域定義しました
　HEARTMARK関数で使ってるcolorが微妙に違う色だったのでC_H_PINKに揃えました
　C_H_PINKはいい感じに使いやすいピンク色ではないかなと思います
　C_PINKは色が薄すぎて通常色と見分けがつきにくく、C_D_PINKはちょっと毒々しい
・ブラ関連の諸々の変更
　衣装関連でまたバグでるかも……

◆出てた意見の拾い直しなど
>「神社の方から来たんですけど～愛欲を独占する～」　悪質押し売り訪問販売パターン
>てゐちゃんから買う
セールスは実装しました
なんつーかモブ兎娘のクセに無闇にキャラが立ってしまったねぇ？
脳内設定的にはてゐちゃんと同じような服装、貧乳（まな板ではない）、Ｂ敏感
深く掘り下げて考えてるわけではありません

>畑で掘り当てる
>釣る
>あなたはギターを弾いてみた　ｺﾞｯ　　el○na的投石が実はパターン
つくるのは簡単そうだけどとりあえず各コマンドの拡張はパス
１．畑は農民専用になっちゃうけどいいのかな？一日一回のコマンドってのは入手頻度を調整しやすいかも？
２．釣りは拡張を見越した作りになってて実装は楽なはず
３．演奏に関しては報酬とか設定しだすと面倒だと思う（現時点では影も形もないので）
余談ですが演奏系は別方向（フレーバー方面、好感度系の実績？）としての拡張案を考えてます

>店で買った綺麗な石が実は　パターン
これは実装しにくい
「雑多な商品が置いてあって売買が可能な店」がない

>もみもみ「ここほれワンワン」　飼い犬が見つける
これは描写を工夫すればデイリーとして実装できる
「いつの間にうちのあなたは犬を飼ってたんだYO!!」は避けなければ
　地霊殿（犬その他動物各種）、華扇屋敷（動物各種）、永遠亭（妖怪兎）、紅魔館（妖精メイド）
　聖徳道場（門下生）、命蓮寺（檀家）、守谷神社（信者）、白玉楼（幽霊・未実装）
各拠点のそれっぽいモブが偶然拾ってくるイベントをつくる？
陥落済みの同居キャラを参加させてもいいかもね
石コレクションしてるのってわかさぎ姫だっけか

>謎の存在から授かる「石が欲しいか･･････」　パターン
代償がありそうでこえーよｗ

>セフレを孕ませると、パンツを履く者が増えた報酬にパンツ神から貰える
孕ませ限定にするよりは年始に決める方針ごとに条件を満たすと石をもらえるとか？

>ミラダの苗
元が高額アイテムだから調整が難しそう
ローターとの価格比較で検討するとわかるが
例）価格が10倍だから入手頻度を1/10にしたい→栽培日数を10倍
とかするとダルくなるし、かといって苗を高額にすると結局入手は容易にならなくて意味が薄い
確率に頼る方向でランダムアイテム入手系の苗という選択肢が有力だろうか

>お姉ちゃんから出てくる
苦痛刻印つくのはやめましょう

>スロットで1/8192で「ミ」「ラ」「ダ」が出現
ごめん
スロットまわりはちと手に負えない

>願掛けによりお腹の中の子供がミラダの石に変化する（母親は出産時に【狂気】付与）
>ひとり立ちした娘からビデオレター（意味深）と一緒に届く（母親に【狂気】付与）
そこはほら、にゃんにゃんの固有コマンド実装じゃない？
こわいから絶対に作らないけど

>採掘要素入れようぜ
>そこでミダラの石か低確率で手に入るんだ
morphの貧弱な脳みそでは地底の炭鉱での過酷な日雇労働生活くらいにしかそのアイディアは膨らませられない
でも幻想郷は石炭が活用されるようなスチームパンクな空間ではないと思うんだ
まー、金鉱とかでもなんでもいいけど
その場合でもミラダの石はあくまでも付随要素であってメインの何かが別に必要になるよね

◆その他
・メインのパッチの改造部分よりも衣装関連いじるほうがしんどかった
・ついでに環境を変えたせいでtabが半角スペースになってて焦った
・SETCOLOR周りの処理を整理しようとしたが挫折した
・固有下着関連のエラーは直してない
・やっぱエロ書くの難しいや
・演奏拡張するかも（フレーバー方面）
　内容は大体考えた
・TALENT:淫乱の使用箇所
　TWにはTALENT:淫乱の取得処理は存在しない
　……しかし、唯一、ナズーリンのみが口上独自処理で淫乱を取得できてしまうのであった
　寺に住んでるくせに全然煩悩を克服できてないじゃないか
　なんだこのエロネズミは（大好きです）
　口上作者の意図としてはフレーバーらしいが、SOURCEに補正が入るので完全なフレーバーにはならない

　":淫乱"の使用箇所のうち、下着関連に仕込んだのはmorphである
　毎度すんません
　下着に関してはとりあえずセフレによる判定に変えておきました
　他はcom系とsource関連が大半なはず、微妙に口上で使ってる箇所もある
・@CHARAMOVE_DATA系をキャラデータ関数に移植したくなってきた
　引数の数からして現実的に可能なはず
　作業の量からして現実的につらいはず

◆つくったひと：morph
・morphのつくった以外のところの扱いはつくったひとに聞いて下さい
・配布・改造・流用、好きにしてください
・でも、その際のサポートは自分でやってね

※　era＝R-18全般の常識的な取り扱いとして例えば以下のような事はやめて下さい

・未成年者がいっぱいいる場所で広める
・R-18以外のモノをメインに扱ってる場所で取り上げる


code:
2018/09/30

eraTW4.632用口上関連微修正

口上における未実装COM分岐の地の文制御バグのついでに
口上の誤字修正などのちょっとした修正を行った

◆対象環境
eraTW4.632のバニラ環境
たぶんパッチの競合もないと思うけど確認はしてない

◆内容
・口上における未実装COM分岐の地の文制御バグ>>225の修正
・ついでに主にしばらく動きのない口上のちょっとしたメンテナンス
　上記バグ調査がてら覗いて確認したのが紅魔組だったので見た範囲で修正（全口上全箇所調査したわけじゃありません）
　藍しゃまは最近更新あったけどついでのついでだ
　誤字修正
　　博霊→博麗
　　K25、K43、K87（藍、華扇、星）
　K59　小悪魔
　　@M_KOJO_MESSAGE_COM_K59_302_1
　　　スキンシップ口上
　　　場所指定33で番号直打ち（ルナの部屋）になってたけどコレ多分333の誤りだよねってののついでに@BATHROOM()での判定に変更
　　　他の口上のスキンシップ口上も風呂場判定を切り替えたほうがよいのだろうか？
　　@M_KOJO_MESSAGE_COM_K59_350_1
　　　押し倒し口上
　　　番号直打ちを改めがてら、紅魔館以外のMAPでも正しく表示されるように
　　　書いてあって使えそうな文章が表示されないって寂しいじゃん？
　　誤字修正
　　　コーヒーを"炒れた"→"淹れた"
　　　修正済みだったようだが漏れがあったので直した
　K54　パチュリー
　　古い仕様の名残が残ってる気がする
　　CFLAG:300→CFLAG:現在位置に変更
　　CFLAG:311→CFLAG:初期位置に変更
　　数箇所で場所番号直打ち333を@BATHROOM()による判定に変更（ただし、汚れ値を参照するものはそのまま）
　　数箇所でパッチェさんの自室を番号直打ち7にしてたのでCFLAG:初期位置による判定に変更
　　数箇所で汚れ値の参照にFLAGを使用していたのは古い仕様っぽいのでYOGOREに修正
　　紅魔組のキャラ番号を直打ちしてたのを[[レミリア]]などに変更
　　@BATHROOM()の使い方がおかしい箇所を修正
　　CMATCHを使ってた大浴場内での同室キャラ数判定を@GET_TARGETNUM()に変更

◆つくったひと：morph
・morphのつくった以外のところの扱いはつくったひとに聞いて下さい
・配布・改造・流用、好きにしてください
・でも、その際のサポートは自分でやってね

※　era＝R-18全般の常識的な取り扱いとして例えば以下のような事はやめて下さい

・未成年者がいっぱいいる場所で広める
・R-18以外のモノをメインに扱ってる場所で取り上げる

repo_name: akadiya/eratw

license: unknown


code:
;�ėp�E�L�������X�g�쐬�֐�
;�����ɂ��Ă�CHECK_CHARA�֐����Q��
;�����ɍ��v����L�����̃��X�g���쐬����
;F�֐������Ŏg����悤��F�֐���
@MAKE_CHARA_LIST(LIST_TYPE, L_ID, CHARA_LIST, CHARA_CNT)
#FUNCTION
#LOCALSIZE 1
#LOCALSSIZE 1
#DIMS LIST_TYPE
#DIM C_ID
#DIM REF L_ID       ;���X�g�̃N���XID
#DIM REF CHARA_LIST ;�L�����ꗗ
#DIM REF CHARA_CNT  ;�L�����J�E���^
VARSET CHARA_LIST
VARSET CHARA_CNT
L_ID = OBJNAME_TO_ID(0, "GET", "�L�������X�g", LIST_TYPE)
IF L_ID == -1
	FOR C_ID, 0, CHARANUM
		SIF !CHECK_CHARA(C_ID, LIST_TYPE)
			CONTINUE
		CHARA_LIST:CHARA_CNT = C_ID
		CHARA_CNT ++
	NEXT
ELSE
	FOR C_ID, 0, CHARANUM
		SIF !GET_INT(C_ID, "�L�������X�g", L_ID, "����")
			CONTINUE
		CHARA_LIST:CHARA_CNT = C_ID
		CHARA_CNT ++
	NEXT
ENDIF
; PRINTFORMW CHARA_CNT{CHARA_CNT}

;@SHOW_CHARA_LIST���@�\���肷���Ďg���ɂ����Ȃ����̂ŃV���v���Ȃ��
;�z��Ɏ��߂��Ă��鐔�l�̃L������������Ɩ�����Ƀ{�^���Ƃ��ĕ\�����邾��
;��ɃL�������X�g����ĂȂ��Ƃ����܂���
;���X�g�ɖ������l�͒e���A999�̓L�����Z�������ł�
@SIMPLE_CHARA_LIST(CHARA_LIST, CHARA_CNT, OP)
#DIM  REF CHARA_LIST ;���X�g�{�́A�o�^�ԍ��ɂċL�^
#DIM  REF CHARA_CNT  ;���X�g�ɊY�������L�����̐�
#DIMS OP
FOR LOCAL, 0, CHARA_CNT
	PRINTFORML [{LOCAL, 3}] - %CALLNAME:(CHARA_LIST:LOCAL)%
NEXT
PRINTFORML
PRINTFORML [999] - ���ǂ�
DO
	INPUT
	SELECTCASE RESULT
	CASE 999
		RETURN 999
	CASEELSE
		SIF INRANGE(RESULT, 0, CHARA_CNT - 1)
			RETURN RESULT
		REUSELASTLINE �����ȓ��͂ł�
		CONTINUE
	ENDSELECT
LOOP 1

;���X�g�\�[�g�֐�
;�Ώ۔z��ϐ���o�^�ԍ��̗���Ƃ݂Ȃ���INPUT_STR�̓��e�ɉ�����SORT���Ȃ���
;�����͑S�ĕK�{
;�\�[�g���̂͂Ƃ��������̑��̐��䕔������╡�G��������
;�\�[�g�A���S���Y����wikipedia����R�s�y���Ă݂��m�[���\�[�g
;1�����Ƃ��̃f�[�^�g���킯�łȂ��V���v���Ȃ̂ł����񂶂�ˁH
;INPUT_STR�Ɏg���镶����́uDISP_MEMO:X�{�i�~��or�����j�v
;DISP_MEMO�Ŗ��O�Փ˂��N�����ƃo�O��̂Œǉ��̍ۂ͒���
;��̓I�ɂ�"����"�͍���Ƃ������Ƃɂ��Ă���̂Ōo���p�ɒǉ����Ă��g���Ȃ�
;DISP_MEMO��ύX����Ȃ�@CHARA_BUTTON,@SHOW_CHARA_LIST���ύX�̕K�v������̂Œ���
;F�֐������Ŏg����悤��F�֐���
@SORT_LIST(INPUT_STR, CHARA_LIST, CHARA_CNT)
#FUNCTION
#DIMS     INPUT_STR  ;�\�[�g���e�̎w��
#DIM      MEMO_TYPE  ;����̃\�[�g���ځACSV�ł̗v�f��
#DIMS     CHECK_VAR  ;�`�F�b�N�ΏۂƂȂ�ϐ���
#DIMS     CHECK_TYPE ;��r���Z�q�̎��
#DIM      NUM_LOOP   ;���[�v��
#DIM  REF CHARA_LIST ;�L�������X�g�̓��e�z��
#DIM      CHARA_CNT  ;���X�g�Ɋ܂܂��L������
;�\�[�g���ڂ̎��
{
#DIMS CONST DISP_MEMO , 25 =
	"�̗�", "�C��",
	"�b��", "�u��", "�`��", "�a��", "�l��",
	"�e��", "�]��", "�~�]", "�Z�I",
	"�w�Z", "��Z", "���Z", "���Z", "�S�Z", "�`�Z",
	"���", "���y", "�s��", "����", "����",
	"�D��", "�M��", "�~��"
}
;�\�[�g���ڂ̊e�L�����ϐ��ɂ�����ʒu
{
#DIM CONST MEMO_ID , 25 =
	 0,  1,
	 0,  1,  2,  3,  4,
	 9, 10, 11, 12,
	50, 51, 52, 53, 54, 55,
	 0,  1,  2,  3,  5,
	 2,  4,340
}
;�\�[�g���ڂ̌���
MEMO_TYPE = 0
NUM_LOOP = VARSIZE("DISP_MEMO")
FOR LOCAL, 0, NUM_LOOP
	IF STRCOUNT(INPUT_STR, DISP_MEMO:LOCAL)
		MEMO_TYPE = LOCAL
		BREAK
	ENDIF
	SIF LOCAL == NUM_LOOP - 1
		THROW �s����INPUT_STR�@%INPUT_STR%
NEXT

SELECTCASE DISP_MEMO:MEMO_TYPE
CASE "�̗�", "�C��"
	CHECK_VAR '= "BASE"
CASE "�b��", "�u��", "�`��", "�a��", "�l��", "�e��", "�]��", "�~�]", "�Z�I"
	CHECK_VAR '= "ABL"
CASE "�w�Z", "��Z", "���Z", "���Z", "�S�Z", "�`�Z",
	CHECK_VAR '= "ABL"
CASE "���", "���y", "�s��", "����", "����",
	CHECK_VAR '= "MARK"
CASE "�D��", "�M��", "�~��"
	CHECK_VAR '= "CFLAG"
CASEELSE
	THROW �s����DISP_MEMO:MEMO_TYPE %DISP_MEMO:MEMO_TYPE%�AMEMO_TYPE {MEMO_TYPE}
ENDSELECT

IF STRCOUNT(INPUT_STR, "�~��")
	CHECK_TYPE '= ">="
ELSEIF STRCOUNT(INPUT_STR, "����")
	CHECK_TYPE '= "<="
ELSE
	THROW �s����INPUT_STR %INPUT_STR%
ENDIF

;�\�[�g������
LOCAL:0 = 1
WHILE LOCAL:0 < CHARA_CNT
	SIF !(LOCAL:0)
		LOCAL:0 ++
	IF CHARA_COMPARE(CHECK_VAR, MEMO_ID:MEMO_TYPE, CHARA_LIST:(LOCAL:0 - 1), CHECK_TYPE, CHARA_LIST:(LOCAL:0))
		LOCAL:0 ++
	ELSE
		SWAP CHARA_LIST:(LOCAL:0 - 1), CHARA_LIST:(LOCAL:0)
		LOCAL:0 --
	ENDIF
WEND

;�e�N���X�����X�g���\��
;�ƂĂ��������CLASS���ɑ��݂�����̂�񎦂���A���񂾂�
@CLASS_LIST(CLASS_NAME, CHECK_NAME)
#DIMS CLASS_NAME  ;�\���ΏۂƂȂ�N���X�̖���
#DIMS CHECK_NAME  ;����Ώۍ��ځiINT����j�A���ݒ�Ȃ瑶�݂�����̂����ׂĕ\��
IF STRLENS(CHECK_NAME)
	FOR LOCAL, OBJ_ID_FIRST, OBJ_ID_LAST + 1
		SIF !GET_INT(0, CLASS_NAME, LOCAL, CHECK_NAME)
			CONTINUE
		PRINTFORML [{LOCAL, 3}] - %GET_STR(0, CLASS_NAME, LOCAL, "���O")%
	NEXT
ELSE
	FOR LOCAL, OBJ_ID_FIRST, OBJ_ID_LAST + 1
		SIF !STRLENS(GET_STR(0, CLASS_NAME, LOCAL, "���O"))
			CONTINUE
		PRINTFORML [{LOCAL, 3}] - %GET_STR(0, CLASS_NAME, LOCAL, "���O")%
	NEXT
ENDIF

;--------------------------------------------------------------------------
;�L�����J�E���g�֐�
;�n���ꂽ�L�������X�g�ɏ������ăL�����̃J�E���g���s��
;--------------------------------------------------------------------------

;�L�����D���x�J�E���g�֐�
;�L�������X�g�����ōD���x��BORDER�ȏ�̃L�������J�E���g����
@CHARA_CNT_FAVOR(C_LIST, L_NUM, BORDER)
#FUNCTION
#DIM REF     C_LIST
#DIM         L_NUM
#DIM         BORDER
#DIM         L_ID
#DIM DYNAMIC L_CNT
FOR L_ID, 0, L_NUM
	SIF CFLAG:(C_LIST:L_ID):�D���x >= BORDER
		L_CNT ++
NEXT
RETURNF L_CNT

;�L�����D���x�J�E���g�֐�
;�L�������X�g�����Ŗʎ��̂���L�������J�E���g����
@CHARA_CNT_KNOWN(C_LIST, L_NUM)
#FUNCTION
#DIM REF     C_LIST
#DIM         L_NUM
#DIM         L_ID
#DIM DYNAMIC L_CNT
FOR L_ID, 0, L_NUM
	SIF CFLAG:(C_LIST:L_ID):�ʎ� >= 1
		L_CNT ++
NEXT
RETURNF L_CNT

;�ח��n�J�E���g�����֐�
;�Z�t���A�v��A����A���~�̂����ꂩ��ł��Y������L�������J�E���g
@CHARA_CNT_ALL_FALLEN(C_LIST, L_NUM)
#FUNCTION
#DIM REF     C_LIST
#DIM         L_NUM
#DIM         L_ID
#DIM DYNAMIC L_CNT
FOR L_ID, 0, L_NUM
	SIF (TALENT:(C_LIST:L_ID):�Z�t�� || TALENT:(C_LIST:L_ID):���~ || TALENT:(C_LIST:L_ID):�v�� || TALENT:(C_LIST:L_ID):����)
		L_CNT ++
NEXT
RETURNF L_CNT

;�Z�t��/�v������锼�����J�E���g�A���Ԃ�g���݂��͂Ȃ�
;���̊ח��Ɉڍs����ƃJ�E���g����Ȃ��Ȃ�̂������Ԃ�g���ɂ����Ǝv���
@CHARA_CNT_SEMI_FALLEN(C_LIST, L_NUM)
#FUNCTION
#DIM REF     C_LIST
#DIM         L_NUM
#DIM         L_ID
#DIM DYNAMIC L_CNT
FOR L_ID, 0, L_NUM
	SIF (TALENT:(C_LIST:L_ID):�Z�t�� || TALENT:(C_LIST:L_ID):�v��)
		L_CNT ++
NEXT
RETURNF L_CNT

;���~�Ɨ�������銮�����J�E���g
@CHARA_CNT_FULL_FALLEN(C_LIST, L_NUM)
#FUNCTION
#DIM REF     C_LIST
#DIM         L_NUM
#DIM         L_ID
#DIM DYNAMIC L_CNT
FOR L_ID, 0, L_NUM
	SIF (TALENT:(C_LIST:L_ID):���~ || TALENT:(C_LIST:L_ID):����)
		L_CNT ++
NEXT
RETURNF L_CNT

;--------------------------------------------------------------------------
;������GAME_TITLE���g���n
;MUSICROOM�����p
;--------------------------------------------------------------------------
@MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM REF C_LIST    ;�o��L�������X�g
#DIM REF C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
#DIM     VAR_DUMMY ;�_�~�[�p�ϐ�
CALLF MAKE_CHARA_LIST(@"%G_TITLE%�o��L����", VAR_DUMMY, C_LIST, C_CNT)
SIF STRCOUNT(OP, "�u���@���O�v")
	CALLF LIST_REMOVE_PC(G_TITLE, C_LIST, C_CNT)

;���@���O�֐�
;��i�o��L�������X�g�A��i���������ɂ���
;���@�L��������i�o��L�������X�g���珜������
;�T�|�[�g�œ���L���������@�����ɂ���i�ו�������̂߂�ǂ����[�̂Łj
@LIST_REMOVE_PC(G_TITLE, C_LIST, L_NUM)
#FUNCTION
#DIMS        G_TITLE
#DIM REF     C_LIST
#DIM REF     L_NUM
#DIM         L_ID
#DIM         L_LAST
L_LAST = L_NUM - 1
FOR L_ID, L_LAST, -1, -1
	SIF !GET_INT(, "�L�����f�[�^", C_LIST:L_ID, @"%G_TITLE%���@")
		CONTINUE
	ARRAYREMOVE C_LIST, L_ID, 1
	L_NUM --
NEXT

@CHARA_CNT_FAVOR_BY_GAMETITLE(G_TITLE, OP, BORDER)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM     C_LIST    ;�o��L�������X�g
#DIM     BORDER    ;臒l�A���̐��l�ȏ�̃L�������J�E���g
#DIM     C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
CALLF MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
RETURNF CHARA_CNT_FAVOR(C_LIST, C_CNT, BORDER)

@CHARA_CNT_KNOWN_BY_GAMETITLE(G_TITLE, OP)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM     C_LIST    ;�o��L�������X�g
#DIM     C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
CALLF MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
RETURNF CHARA_CNT_KNOWN(C_CNT, C_CNT)

@CHARA_CNT_KNOWN_BY_GAMETITLE(G_TITLE, OP)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM     C_LIST    ;�o��L�������X�g
#DIM     C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
CALLF MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
RETURNF CHARA_CNT_KNOWN(C_CNT, C_CNT)

@CHARA_CNT_ALL_FALLEN_BY_GAMETITLE(G_TITLE, OP)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM     C_LIST    ;�o��L�������X�g
#DIM     C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
CALLF MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
RETURNF CHARA_CNT_ALL_FALLEN(C_CNT, C_CNT)

@CHARA_CNT_SEMI_FALLEN_BY_GAMETITLE(G_TITLE, OP)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM     C_LIST    ;�o��L�������X�g
#DIM     C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
CALLF MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
RETURNF CHARA_CNT_SEMI_FALLEN(C_CNT, C_CNT)

@CHARA_CNT_FULL_FALLEN_BY_GAMETITLE(G_TITLE, OP)
#FUNCTION
#DIMS    G_TITLE   ;�Q�[���^�C�g��
#DIM     C_LIST    ;�o��L�������X�g
#DIM     C_CNT     ;�o��L������
#DIMS    OP        ;���s�I�v�V�����A�u���@���O�v�Ȃ烊�X�g���玩�@�����O����
CALLF MAKE_CHARA_LIST_BY_GAMETITLE(G_TITLE, C_LIST, C_CNT, OP)
RETURNF CHARA_CNT_FULL_FALLEN(C_CNT, C_CNT)


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�ő�6�܂�
;�߂�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, ARGS:6, ARG:6)
#DIM CONST �I������� = 6
CURRENTREDRAW
LOCAL:0 = RESULT
REDRAW 0
FOR LOCAL:0, 0, (�I������� + 1)
	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 > �I������� || 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�̈ꎞ�ϐ�
L_RESULT = RESULT
;�܂���ɂ܂Ƃ߂�
ARGS = %ARGS%\/%ARGS:1%\/%ARGS:2%\/%ARGS:3%\/%ARGS:4%\/%ARGS:5%\/%ARGS:6%
;�s�v��"/"�������
;���ARGS�������//����������o���Ĕ���̎ז��ɂȂ�̂�
;1.//�͒u���ō��
;2.�Ŗ�����/�Ȃ���iSPLIT��RAND�����̂܂܎g���s����j
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

CALLF MAKE_CHARA_LIST("TARGET���X�g", L_ID, TARGET, TARGET_CNT)
SIF !TARGET_CNT
	RETURN
CALLF 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))
SIF ARG:1 > 0 && ARG:1 < 100
	RETURN
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,���b�Z�[�W)
#DIM �ϓ��l
#DIM �����\��
#DIM ���b�Z�[�W
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
SIF ���b�Z�[�W
	CALL COLORMESSAGE(@"%CALLNAME:ARG%��%BASENAME:�����\��%���ꎞ�I��\@ �ϓ��l > 0? �オ����# ��������\@",C_YELLOW,1)
;-------------------------------------------------
;�֐���: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
SIF TARGET != TFLAG:103
	RETURNF 0
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, ����t�^)
#DIM ����t�^

CFLAG:ARG:�s�@�� = 1
CFLAG:ARG:�u�`�M�� = 1
BASE:ARG:�{�� = MAXBASE:ARG:�{��
TALENT:ARG:�@�� = -1
MARK:ARG:�������� = MIN(MARK:ARG:�������� + ����t�^, 3)
MARK:ARG:�����擾���� = MAX(MARK:ARG:�����擾����,MARK:ARG:��������)

;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 ����

;-------------------------------------------------
;�����ϊ�(HOUR, MINUTE)
;�^����ꂽHOUR��MINUTE����TIME�p�ɕϊ�
;�O�̂��߂�HOUR��25��������MINUTE��61�������肵���ꍇ�ɂ��Ή�����
;��jCLOCK_TO_TIME(10, 0)������ƕԂ鐔�l��600
;eraTW�̈����00:01�`24:00�͈̔́A�ڂ�����@INFO_GO_NEXTDAY������
;-------------------------------------------------
@CLOCK_TO_TIME(HOUR, MINUTE)
#FUNCTION
#DIM HOUR
#DIM MINUTE
SIF HOUR == 24 && MINUTE == 0
	RETURNF 24 * 60
HOUR   = (HOUR + MINUTE / 60) % 24
MINUTE = MINUTE % 60
RETURNF HOUR * 60 + MINUTE

;-------------------------------------------------
;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

;-------------------------------------------------
;���@�m�̌ʔ���F�֐�
;-------------------------------------------------
;���щ������Ȃ��Ă��@�m�ł���悤��
;�R�}���h�Ƃ��Ă̗��@�m�͎g�p�s�\
@NOTICE_LUST(C_ID)
#FUNCTION
#DIM C_ID
SIF C_ID == MASTER
	RETURNF 0
SIF TALENT:MASTER:���@�m
	RETURNF 1
SIF EXP:C_ID:�f�[�g�o�� + EXP:C_ID:����o�� >= 100
	RETURNF 1
RETURNF 0

;-------------------------------------------------
;�������������̌ʔ���F�֐�
;-------------------------------------------------
;���щ������Ȃ��Ă������ł���悤��
@NOTICE_CYCLE(C_ID)
#FUNCTION
#DIM C_ID
SIF !GETBIT(TALENT:C_ID:����, 0)
	RETURNF 0
;�����͔̂c�����Ƃ邶���
SIF C_ID == MASTER
	RETURNF 1
SIF FLAG:������������
	RETURNF 1
SIF EXP:C_ID:�f�[�g�o�� + EXP:C_ID:����o�� >= 200
	RETURNF 1
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:��������� >= 1)
CASE "�q����"
	RETURNF (CFLAG:C_ID:�q���l�� >= 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 "�D�P"
	RETURNF TALENT:C_ID:�D�P
CASE "�玙��"
	RETURNF TALENT:C_ID:�玙��
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���^
CALLF 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
ELSEIF ARG % 124 % 31 == 0
	LOCAL:2 = ARG % 124 / 31
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

@PRINT_DATE_F(ARG)
#FUNCTIONS
LOCAL = DAY_TO_DATE(ARG)
LOCAL:1 = LOCAL / 1000
LOCAL:2 = LOCAL % 1000 / 100
LOCAL:3 = LOCAL % 1000 % 100
LOCALS = {LOCAL:1}�N�� %GET_MONTH(LOCAL:2)%��{LOCAL:3}��
RETURNF LOCALS

;----------------------------------------------------------------------------------------------------
;����������J�E���gF�֐�
;----------------------------------------------------------------------------------------------------
;TARGET_STR�Ɋ܂܂�镡���̕�����̐�����������
;TARGET_STR�AKEY_STR�Ƃ���"/"���d�؂�Ƃ��ĕ����̒P����J�E���g����
;TARGET_STR�AKEY_STR�ň�x�ɓn���P��̎�ނ͂��ꂼ��100��ޖ����A��Q��1000�����ɂ��邱��
;
;�����j
;TARGET_STR�F"������/������/������/����/�˂�/�˂�/"
;��P�j
;�@KEY_STR�F"������/�˂�/"
;�@"������"��3�A"�˂�"��2�ō��v�l��5��Ԃ�
;��Q�j
;�@KEY_STR�F"����/�˂�/"
;�@"����"��1�A"�˂�"��2�ō��v�l��3��Ԃ�
;��R�j
;�@KEY_STR�F"������/������/"
;�@"������"��3�A�̏�����2�񕪂����6��Ԃ�
;----------------------------------------------------------------------------------------------------
@STR_MULTI_COUNT(TARGET_STR, KEY_STR)
#FUNCTION
#DIMS TARGET_STR             ;�����Ώە�����
#DIMS KEY_STR                ;������������Q�A��Q�̎�ނ̏����100���
#DIMS DYNAMIC KEY_LIST, 100  ;������̒P�ꃊ�X�g
#DIM  DYNAMIC KEY_CNT,  100  ;�e�P��̏o����
#DIM  DYNAMIC KEY_NUM        ;�P��̑���
#DIM          KEY_ID         ;���[�v�����p
#DIM  DYNAMIC STR_CNT        ;�J�E���g��
#DIMS DYNAMIC TEMP_STR, 1000 ;SPLIT�p�ꎟ�z��
#DIM  DYNAMIC TEMP_NUM       ;�ꎟ�z��Ŏg�p�����v�f��
#DIM          TEMP_RESULT    ;RESULT�ޔ�
;�O�̂���
TARGET_STR '= REPLACE(TARGET_STR, "\/+", "/")
CALLF CNT_SPLIT(KEY_STR, KEY_LIST, KEY_CNT, KEY_NUM)

TEMP_RESULT = RESULT
SPLIT TARGET_STR, "/", TEMP_STR
TEMP_NUM = RESULT
FOR KEY_ID, 0, KEY_NUM
	STR_CNT += MATCH(TEMP_STR, KEY_LIST:KEY_ID, 0, TEMP_NUM) * KEY_CNT:KEY_ID
NEXT
RESULT = TEMP_RESULT
RETURNF STR_CNT

;----------------------------------------------------------------------------------------------------
;�J�E���g�@�\��SPLIT�֐�
;----------------------------------------------------------------------------------------------------
;�ERESULT�����������AF�֐����ł��g�p�\
;�ECALLF�Ŏg�p�̂��ƁAREF���g�p���ĕϐ��𒼐ڏ���������
;�E�����K�{�A�P�ꃊ�X�g/�o�������X�g�̔z�����ɒ��ӁI
;�E��؂蕶����"/"�ŌŒ�
;�ESTR�p�̔z��ϐ��ƕʂɁA�e�P��̏o���񐔃��X�g��ǉ�
;�E�߂�l�P�jSTR_LIST�A"/"�ŕ�������o�͂����P�ꃊ�X�g
;�E�߂�l�Q�jCNT_LIST�A�e�P��̏o���񐔃��X�g
;�E�߂�l�R�jSTR_NUM�A�P��̎�ނ̑���
;�ETARGET_STR�ň�x�ɓn���P��̎�ނ�100��ޖ����A��Q��1000�����ɂ��邱��
;�����)
;TARGET_STR�F"�얲/�얲/�얲/�얲/������/������/���c/"
;�@STR_LIST:0 == "�얲"
;�@STR_LIST:1 == "������"
;�@STR_LIST:2 == "���c"
;�@CNT_LIST:0 == 4   ;"�얲"�̏o���񐔂�4��
;�@CNT_LIST:1 == 2   ;"������"�̏o���񐔂�2��
;�@CNT_LIST:2 == 1   ;"���c"�̏o���񐔂�1��
;�@STR_NUM    == 3   ;"�얲"�A"������"�A"���c"�ō��v3���
;----------------------------------------------------------------------------------------------------
@CNT_SPLIT(TARGET_STR, STR_LIST, CNT_LIST, STR_NUM)
#FUNCTION
#DIMS         TARGET_STR     ;�����Ώ�STR
#DIMS         NEW_STR        ;�X�V�p�ꎞSTR
#DIMS REF     STR_LIST       ;�P�ꃊ�X�g
#DIM  REF     CNT_LIST       ;�e�P��̏o�������X�g
#DIM  REF     STR_NUM        ;�P��̎�ނ̑���
#DIMS DYNAMIC TEMP_STR, 1000 ;SPLIT�p�ꎟ�z��
#DIM  DYNAMIC TEMP_NUM       ;�ꎟ�z��Ŏg�p�����v�f��
#DIM          TEMP_RESULT    ;RESULT�ޔ�
#DIM          TEMP_ID        ;���[�v�p
VARSET STR_LIST
VARSET CNT_LIST
STR_NUM = 0

TEMP_RESULT = RESULT
SPLIT TARGET_STR, "/", TEMP_STR
TEMP_NUM = RESULT
FOR TEMP_ID, 0, TEMP_NUM
	;����������
	SIF !STRLENS(TEMP_STR:TEMP_ID)
		CONTINUE
	;�d������
	SIF FINDELEMENT(STR_LIST, TEMP_STR:TEMP_ID, 0, STR_NUM, 1) != -1
		CONTINUE
	STR_LIST:STR_NUM '= TEMP_STR:TEMP_ID
	CNT_LIST:STR_NUM  = MATCH(TEMP_STR, TEMP_STR:TEMP_ID)
	STR_NUM ++
NEXT
RESULT = TEMP_RESULT

;----------------------------------------------------------------------------------------------------
;SPLIT���߂�F�֐���
;----------------------------------------------------------------------------------------------------
;F�֐��p��RESULT���������������������
;�ECALLF��p
;�EREF�g�p
;�E��؂蕶����"/"�̂�
;----------------------------------------------------------------------------------------------------
@FUNC_SPLIT(KEY_STR, SPLIT_STR)
#FUNCTIONS
#DIMS     KEY_STR     ;�W�J��������
#DIMS REF SPLIT_STR   ;�W�J�敶����
#DIM      TEMP_RESULT ;RESULT�����΍�
RESULT = TEMP_RESULT
VARSET SPLIT_STR
SPLIT KEY_STR, "/", SPLIT_STR
TEMP_RESULT = RESULT

;----------------------------------------------------------------------------------------------------
;���s���̐l����Ԃ��֐�
;----------------------------------------------------------------------------------------------------
@���s�l��()
#FUNCTION
RETURNF (CHARANUM - 1) - CMATCH(CFLAG:���s , 0, 1, CHARANUM)
;MASTER�����ɓ���Ȃ��̂�CHARANUM - 1�ł�

;----------------------------------------------------------------------------------------------------
;DAIRY_EV0����؂�o��
;���MAP��YOGORE�֘A����
;���O�����F�������n�_��YOGORE�̈������Ăǂ��Ȃ��Ă񂾂�H
;----------------------------------------------------------------------------------------------------
;���_�}�b�v�̉���̍��v�l��Ԃ�
@SUM_ALL_YOGORE()
#FUNCTION
RETURNF SUMARRAY(YOGORE, MINROOM(), MAXROOM)

;���_�}�b�v�̉���̕��ϒl��Ԃ�
@AVERAGE_YOGORE()
#FUNCTION
RETURNF SUM_ALL_YOGORE() / ROOM_NUM()

;���_�}�b�v�ɑ��݂���n�_�̐���Ԃ�
;�������n�_���l�����ĂȂ��_�ɒ���
@ROOM_NUM()
#FUNCTION
RETURNF MAXROOM % 100

;----------------------------------------------------------------------------------------------------
;���b�Z�[�W�t���ŃA�C�e��/�~/�J���X�}����肵����x�������肷��֐�
;�Ƃ肠�������̐�����
;----------------------------------------------------------------------------------------------------
@GET_ITEM(ITEM_ID, ITEM_NUM, PRINT_TYPE)
#DIM ITEM_ID
#DIM ITEM_NUM
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
IF ITEM:ITEM_ID + ITEM_NUM >= 100
	CALL COLORMESSAGE(@"%ITEMNAME:ITEM_ID%�͎�������Ȃ�����", C_YELLOW, PRINT_TYPE)
	ITEM:ITEM_ID = MAX(ITEM:ITEM_ID, 99)
ELSE
	CALL COLORMESSAGE(@"%ITEMNAME:ITEM_ID%��{ITEM_NUM}��ɓ��ꂽ", C_YELLOW, PRINT_TYPE)
	ITEM:ITEM_ID += ITEM_NUM
ENDIF

@LOST_ITEM(ITEM_ID, ITEM_NUM, PRINT_TYPE)
#DIM ITEM_ID
#DIM ITEM_NUM
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF ITEM:ITEM_ID <= 0
	RETURN
CALL COLORMESSAGE(@"%ITEMNAME:ITEM_ID%��{ITEM_NUM}������", C_YELLOW, PRINT_TYPE)
ITEM:ITEM_ID = MAX(ITEM:ITEM_ID - ITEM_NUM, 0)

@GET_MONEY_YEN(VALUE, PRINT_TYPE)
#DIM VALUE
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF VALUE <= 0
	RETURN
CALL COLORMESSAGE(@"\\{VALUE}����ɓ��ꂽ", C_YELLOW, PRINT_TYPE)
MONEY += VALUE

@GET_MONEY_CM(VALUE, PRINT_TYPE)
#DIM VALUE
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF VALUE <= 0
	RETURN
CALL COLORMESSAGE(@"{VALUE}�J���X�}����ɓ��ꂽ", C_YELLOW, PRINT_TYPE)
MONEY:2 += VALUE

@LOST_MONEY_YEN(VALUE, PRINT_TYPE)
#DIM VALUE
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF VALUE <= 0
	RETURN
CALL COLORMESSAGE(@"\\{VALUE}��������", C_YELLOW, PRINT_TYPE)
MONEY = MAX(0, MONEY - VALUE)

@LOST_MONEY_CM(VALUE, PRINT_TYPE)
#DIM VALUE
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF VALUE <= 0
	RETURN
CALL COLORMESSAGE(@"{VALUE}�J���X�}��������", C_YELLOW, PRINT_TYPE)
MONEY:2 = MAX(0, MONEY:2 - VALUE)

@PAY_MONEY_YEN(VALUE, PRINT_TYPE)
#DIM VALUE
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF VALUE <= 0
	RETURN
CALL COLORMESSAGE(@"\\{VALUE}���x������", C_YELLOW, PRINT_TYPE)
MONEY = MAX(0, MONEY - VALUE)

@PAY_MONEY_CM(VALUE, PRINT_TYPE)
#DIM VALUE
#DIM PRINT_TYPE;�\���`���@0=�ʏ�@1=L�@2=W
SIF VALUE <= 0
	RETURN
CALL COLORMESSAGE(@"{VALUE}�J���X�}���x������", C_YELLOW, PRINT_TYPE)
MONEY:2 = MAX(0, MONEY:2 - VALUE)


code:
;���݂̃o�[�W�������i�[(NYE:"X.YY  NYE"�Aproto:"X.YYproto"�A�C����:"X.YY�C��Z"�Ŕ��p9�������œ���\)
#DIMS CONST eraTW_Version = "4.632"

;SAVESTR
#DIM CONST �{�̃o�[�W���� = 8

;�ח�����
#DIM CONST REQUIRED_TRUST_���� = 700
#DIM CONST REQUIRED_FAVOR_���� = 3000
#DIM CONST REQUIRED_AFFECTION_���� = 10

#DIM CONST REQUIRED_TRUST_�v�� = 250
#DIM CONST REQUIRED_FAVOR_�v�� = 1500
#DIM CONST REQUIRED_AFFECTION_�v�� = 5

#DIM CONST REQUIRED_FAVOR_�Z�t�� = 1500
#DIM CONST REQUIRED_DESIRE_�Z�t�� = 5
#DIM CONST REQUIRED_ECSTACY_�Z�t�� = 100

#DIM CONST REQUIRED_FAVOR_���~ = 3000
#DIM CONST REQUIRED_DESIRE_���~ = 10
#DIM CONST REQUIRED_ECSTACY_���~ = 500

;TFLAG

#DIM CONST ���g�p�� = 60
#DIM CONST ��g�p�� = 61
#DIM CONST �b�g�p�� = 62
#DIM CONST �u�g�p�� = 63
#DIM CONST �`�g�p�� = 64
#DIM CONST �a�g�p�� = 65

#DIM CONST ���| = 40
#DIM CONST ��b = 41
#DIM CONST �퓬 = 42
#DIM CONST ���{ = 43

;#DIM CONST ���� = 44

#DIM CONST ���y = 45
#DIM CONST �V�� = 46
#DIM CONST ������ = 47
#DIM CONST ����� = 48

#DIM CONST ENKAI_SANKA = 49

#DIM CONST ����̕ЂÂ� = 50
#DIM CONST �����Ԃ�� = 51
;== �_�Г� ==
#DIM CONST ���� = 1
#DIM CONST ���� = 2
#DIM CONST �ΑK�� = 3
#DIM CONST �{�a = 4
#DIM CONST �萅�� = 5
#DIM CONST ���u = 6
#DIM CONST �y�� = 7
#DIM CONST �䏊 = 8
#DIM CONST ���� = 9
#DIM CONST ���� = 10
#DIM CONST ��i�P���\�j = 11
#DIM CONST �E�ߏ� = 12

;#DIM CONST ���C = 13

#DIM CONST �g�C�� = 14
#DIM CONST �얲���� = 15
#DIM CONST �{������ = 16
#DIM CONST �������[�� = 17
#DIM CONST ������ = 18
#DIM CONST �傫���[�� = 19
#DIM CONST �{�a�̗� = 20
#DIM CONST ���_�Е��� = 21
#DIM CONST �Q�� = 22
#DIM CONST ����E�E�ߏ� = 23
#DIM CONST ���� = 24
#DIM CONST ����̐X = 25

;== �O�d���̉� ==
#DIM CONST �O�d���̉ƁE���� = 26
#DIM CONST �O�d���̉ƁE�L�� = 27
#DIM CONST �O�d���̉ƁE�K�i = 28
#DIM CONST �O�d���̉ƁE�L�b�`�� = 29
#DIM CONST �O�d���̉ƁE���C = 30
#DIM CONST �O�d���̉ƁE��K�L�� = 31
#DIM CONST �T�j�[���� = 32
#DIM CONST ���i���� = 33
#DIM CONST �X�^�[���� = 34
#DIM CONST �O�d���̉ƁE�n���� = 35

;== ������� ==
#DIM CONST ������ՑO = 36
#DIM CONST ������ՁE��K�ʘH = 37
#DIM CONST ������ՁE���ʏ� = 38
#DIM CONST ������ՁE���� = 39
#DIM CONST ������ՁE�g�C�� = 40
#DIM CONST ������ՁE�H�����k�b�� = 41
#DIM CONST ������ՁE������ = 42
#DIM CONST �������� = 43
#DIM CONST ����莄�� = 44
#DIM CONST ������ՁE�K�i = 45
#DIM CONST ������ՁE��K�ʘH = 46
#DIM CONST ������ՁE�͋� = 47
#DIM CONST ������ՁE��ꎑ���� = 48
#DIM CONST ������ՁE������ = 49
#DIM CONST ������ՁE��񎑗��� = 50
#DIM CONST ������ՁE�q�� = 51

#DIM CONST ���� = 52
#DIM CONST �[�� = 53
#DIM CONST ���l�̒����� = 54
#DIM CONST �a�� = 55
#DIM CONST �Q���̌����� = 56

;== SPOT ==
;- ���@�� -
;#DIM CONST ���@���Q�� = 110
#DIM CONST ���n���ʂ� = 110
#DIM CONST �}������̉� = 120
#DIM CONST ���@������ = 130
#DIM CONST ���@���{�� = 140
#DIM CONST ��n = 150
#DIM CONST �������� = 160

;- �l�Ԃ̗� -
#DIM CONST �L�� = 210
#DIM CONST ���ƒ� = 220
#DIM CONST �ۉ����� = 230
#DIM CONST ���q�� = 240
#DIM CONST ��O���� = 250
#DIM CONST �A�ꍞ�ݏh = 260
#DIM CONST �����X = 270

;- �g���� -
#DIM CONST ���̌� = 310
#DIM CONST �X�̂��܂��� = 320
#DIM CONST �p�m�� = 330
#DIM CONST ���� = 340
#DIM CONST �L�� = 350
#DIM CONST �H�� = 360
#DIM CONST ��}���� = 370
#DIM CONST �n���� = 380

;- �����̒|�� -
#DIM CONST �|�ѓ���� = 410
#DIM CONST �����̏��� = 420
#DIM CONST �Ίp�̒|�� = 430
#DIM CONST �e�̓��� = 440
#DIM CONST �i���� = 450
#DIM CONST �����̋u = 460
#DIM CONST ���z�̔� = 470
#DIM CONST �i�������m�@ = 480

;- ���@�̐X -
#DIM CONST �X�̓���� = 510
#DIM CONST ������ = 520
#DIM CONST �Ö؂̑�� = 530
#DIM CONST ���J���@�X = 540
#DIM CONST �l�`�̗m�� = 550
#DIM CONST �Ďv�̓� = 560
#DIM CONST ������ = 570

;- �O�r�̐�`���E -
#DIM CONST ���L�̓� = 610
#DIM CONST �O�r�̐� = 620
#DIM CONST �}���q�K = 630
#DIM CONST �ފ� = 670
#DIM CONST ���ʘO�� = 680
#DIM CONST ���ʘO = 690

;- �d���̎R �R�[ -
#DIM CONST �[�̎��C = 710
#DIM CONST �����̑� = 720
#DIM CONST ���寂̒r = 730
#DIM CONST ���ׂ̉B��ƑO = 740
#DIM CONST ��l�̉��~ = 750
#DIM CONST �Ԍ���n���Z���^�[ = 760

;- �d���̎R �R�� -
#DIM CONST ��V�̑� = 810
#DIM CONST ��i�̋u = 820
#DIM CONST �R�̌� = 830
#DIM CONST ���_�Ћ��� = 840
#DIM CONST ���_�Ж{�a = 850

#DIM CONST �V�E = 890

;- �n�� -
#DIM CONST ���z���� = 910
#DIM CONST �n���̐[�� = 920
#DIM CONST ���n���X�� = 930
#DIM CONST ���n������ = 940
#DIM CONST ���u�z = 950
#DIM CONST �n��a = 960
#DIM CONST �ܔM�n���� = 970

;- ���̐��E�`�� -
#DIM CONST �ň��ʘH = 1010

#DIM CONST ���̓s = 1050
#DIM CONST �Ȍ��� = 1060
#DIM CONST �ʓe�̊X = 1070
#DIM CONST ���с`���l = 1080
#DIM CONST �Â��̊C = 1090

#DEFINE ���ԑ� TIME:2
;1= ����(4�`6) 2=���ߑO(6�`12) 3=��(12�`15) 4=��������(15�`18) 5=�[(18�`20) 6=��(20�`23) 7=�[��(23�`4)
#DEFINE �V�� TIME:5
;0= ���� 1=���V 2=���� 3=�� 4=�J 5=��J 6=���J 7=�� 8=�� 9=���� 10=�א� 11=���� 12=�݂��� 13=����� 14= 15=(Bit 0:�����t���O 1:��BIT 2:�JBIT 3:��BIT)

;�`��֌W
#DIM CONST ���X�g�\���s�� = 20
#DIMS CONST �O�̃y�[�W = "<"
#DIMS CONST ���̃y�[�W = ">"
#DIMS CONST �O�̃L���� = "<<"
#DIMS CONST ���̃L���� = ">>"
#DIMS CONST ��߂� = "^"
#DIM CONST �ĕ`�� = -1
#DIM CONST �A�� = -2
#DIM CONST �`�`�\�� = 99

;�{�[�i�X�p
#DIMS BONUS_3_DESCRIPTION, 15
#DIM BONUS_3_ABLE, 15
#DIMS BONUS_4_DESCRIPTION, 15
#DIM BONUS_4_ABLE, 15
#DIMS BONUS_5_DESCRIPTION, 15
#DIM BONUS_5_ABLE, 15

;�L��������������K�X���₵�Ă�������
#DIM CONST �L�����N�^����� = 130

#DIM CONST �ȈՔ\�͕\���ő�y�[�W�ԍ� = 4
#DIM CONST �ڍה\�͕\���ő�y�[�W�ԍ� = 4
#DIM CONST ���O�\������ = 14
#DIM �\�[�g����, (�ȈՔ\�͕\���ő�y�[�W�ԍ� + 1) * 10

#DIM CONST MAXPANTS = 27
#DIM CONST �p���c�Ǘ� = 100
#DIM CONST MAXBRA = 22

#DIM SAVEDATA MAIN_MAP

#DIM SAVEDATA YOGORE, 1100
#DIM SAVEDATA LOCK, 1100

#DIM SAVEDATA PLANT_TYPE, 5
#DIM SAVEDATA PLANT_DAYS, 5
#DIM SAVEDATA PLANT_GROW, 5
#DIM SAVEDATA PLANT_DRY, 5
#DIMS SAVEDATA HATAKE_NAME, 5

#DIM SAVEDATA CHARISMA_RATE, 190
#DIM SAVEDATA CHARISMA_TENDENCY, 190

#DIM SAVEDATA CM_SELL_PERIOD
#DIM SAVEDATA CM_SELL_MONTH
#DIM SAVEDATA CM_SELL_AMT
#DIM SAVEDATA CM_SELL_PRICE
#DIM SAVEDATA CM_COMMISSION
#DIM SAVEDATA CM_LIMIT
#DIM SAVEDATA CM_INT_RATE

#DIM COUNTCHARA, 1100

#DIM MAXROOM
#DIM ����
#DIM SAVEDATA �f�t�H���g�����ʒu
#DIM ENTRANCE
#DIM SAVEDATA ���__���
#DIM SAVEDATA ���__��
#DIM KEHAI
#DIM PRIVATEROOM, 100
#DIM MAP_PAGES
#DIMS MAPNAME, 10

#DIMS SAVEDATA ������\��

#DIM CONST RANDOM_CHARANUM = 127
#DIM RANDOM_TALENT_RATE,180
#DIM RANDOM_BASE,2
#DIM CONST MOB_FACETYPES = 11

#DIM BEFORE_MOUSOU_EXP14; ���t�o��
#DIM BEFORE_MOUSOU_EXP15; �����o��
#DIM BEFORE_MOUSOU_EXP16; �S�ˌo��
#DIM BEFORE_MOUSOU_EXP20; �u�����o��
#DIM BEFORE_MOUSOU_EXP21; �`�����o��
#DIM BEFORE_MOUSOU_EXP24; ����o��
#DIM BEFORE_MOUSOU_EXP25; �����o��
#DIM BEFORE_MOUSOU_EXP27; �L�X�o��
#DIM BEFORE_MOUSOU_EXP28; ����g�p�o��
#DIM BEFORE_MOUSOU_EXP29; �}���o��
#DIM BEFORE_MOUSOU_EXP53; �ُ�o��

#DIM CONST BASE_�̗� = 0
#DIM CONST BASE_�C�� = 1
#DIM CONST BASE_���� = 6
#DIM CONST BASE_TSP = 8

#DIM CONST ����_�L�X = 1p0
#DIM CONST ����_���ӂ� = 1p1
#DIM CONST ����_���l = 1p2
#DIM CONST ����_�A�i�� = 1p3
#DIM CONST ����_���d = 1p4
#DIM CONST ����_����d = 1p5
#DIM CONST ����_����d = 1p6
#DIM CONST ����_����d = 1p7
#DIM CONST ����_�ҕ�d = 1p8

#DIM CONST ����_���t = 1p0
#DIM CONST ����_�y�j�X = 1p1
#DIM CONST ����_���t = 1p2
#DIM CONST ����_�A�i�� = 1p3
#DIM CONST ����_��� = 1p4
#DIM CONST ����_�S�t = 1p5
#DIM CONST ����_�j�Z�� = 1p6
#DIM CONST ����_�`���R = 1p7

#DIM CONST �r��_�y�j�X = 1p1
#DIM CONST �r��_�o�C�u = 1p2
#DIM CONST �r��_�y�j�o�� = 1p3
#DIM CONST �r��_���� = 1p4
#DIM CONST �r��_�D�� = 1p9
#DIM CONST �r��_���Ԓ�~ = 1p10
#DIM CONST �r��_���� = 1p11
#DIM CONST �r��_�v�� = 1p12
#DIM CONST �r��_����� = 1p13
#DIM CONST �r��_������ = 1p14
#DIM CONST �r��_�Ȃ����� = 1p15
#DIM CONST �r��_���� = 1p16

#DIM CONST �ُ�_�l�d�Ⓒ = 1p2
#DIM CONST �ُ�_�����o�C�u = 1p4
#DIM CONST �ُ�_�g�� = 1p5
#DIM CONST �ُ�_��O���A = 1p6
#DIM CONST �ُ�_�r�� = 1p7
#DIM CONST �ُ�_�|�� = 1p11

#DIM CONST SET_FROM_P = 101
#DIM CONST SET_FROM_C = 102
#DIM CONST SET_FROM_YUBI = 103
#DIM CONST SET_FROM_M = 104
#DIM CONST SET_FROM_B = 105
#DIM CONST SET_FROM_V = 106
#DIM CONST SET_FROM_A = 107
#DIM CONST SET_FROM_LEG = 108

#DIM CONST SET_P = 1
#DIM CONST SET_C = 2
#DIM CONST SET_YUBI = 3
#DIM CONST SET_M = 4
#DIM CONST SET_B = 5
#DIM CONST SET_V = 6
#DIM CONST SET_A = 7
#DIM CONST SET_LEG = 8

;�z��̓ǂݍ��ݏ��������_���ɂ��邽�߂̔z��BFISHER_YATES_SHAFFLE�ɂăV���b�t�����܂�
#DIM SHAFFLE_ARRAY, 500
;�����̒��g�B
#DIM SAVEDATA MORIYA_BOX, 300

;�A�j���t�B���^
#DIM CONST �A�j���t�B���^_�}�� = 1p0
#DIM CONST �A�j���t�B���^_�Ⓒ = 1p1
#DIM CONST �A�j���t�B���^_�ː� = 1p2
#DIM CONST �A�j���t�B���^_��� = 1p3

;�p���c�ꎞ�ۑ�
#DIM CHARADATA SAVEDATA PANTS_TEMP, 35
#DIM FOUND_PANTS_TYPE
#DIM FOUND_PANTS_OWNER

;�d����
#DIMS JOB_NAME, 120

;�˗��ݒ萔����@�Ƃ肠�����ȃG�l��30�ɂ��Ă���
#DIM CONST MAX_IRAI = 30

;�˗��X���b�g
#DIM SAVEDATA IRAI_SLOT, 6
#DIM SAVEDATA IRAI_DATA, 6
#DIM SAVEDATA IRAI_SUB,  6
;�˗�����
#DIM SAVEDATA IRAI_DEADLINE, 6

;��������̍��ڂ͔p�~
;�˗���
#DIM SAVEDATA IRAI_CLIENT, 6
;�˗��̏������Ȃǂ��ꎞ�ۑ����邽�߂̕ϐ�
#DIM IRAI_SETTING_DEADLINE,MAX_IRAI
#DIM IRAI_SETTING_TARGET,MAX_IRAI
#DIM IRAI_SETTING_CLIENT,MAX_IRAI
#DIMS IRAI_SETTING_COMMANDNAME,MAX_IRAI
;�����܂�

#DIM CHARADATA SAVEDATA BUFF,16

#DIM CHARADATA SAVEDATA COUNTER_SIKOU, 140

;�}���R���{�p
#DIM CHARADATA SAVEDATA EFFECTIVE_PATTERN_V, 3
#DIM CHARADATA SAVEDATA EFFECTIVE_PATTERN_A, 3

;�q���̖��O
#DIMS CHARADATA SAVEDATA CHILDNAME, 11
;�q���̔N��
;#DIM CHARADATA SAVEDATA CHILD_AGE, 11
;�q���̐���
#DIM CHARADATA SAVEDATA CHILD_SEX, 11
;�q���̒a�����P�iX���ځj
#DIM CHARADATA SAVEDATA CHILD_BIRTHDAY, 11
;�q���̒a�����Q�iX�NX��XX���j
#DIM CHARADATA SAVEDATA CHILD_BIRTHDATE, 11
;�q���̈���x
#DIM CHARADATA SAVEDATA CHILD_LOVE, 11
;�q���̒a���������̓V�C
#DIMS CHARADATA SAVEDATA CHILD_WEATHER, 11

#DIM CONST CHILD_���� = 25
#DIM CONST CHILD_�ߋ� = 26
#DIM CONST CHILD_���܂藧�� = 28
#DIM CONST CHILD_�悿�悿 = 30
#DIM CONST CHILD_���� = 35
#DIM CONST CHILD_��b = 45
#DIM CONST CHILD_���� = 55
#DIM CONST CHILD_�A�w = 60
#DIM CONST CHILD_�����O = 90
#DIM CONST CHILD_���� = 120

#DIM ROOMDATA, 100
#DIM CONST �ꏊ_�z�c	= 1p0
#DIM CONST �ꏊ_����	= 1p1	;INROOM
#DIM CONST �ꏊ_���C	= 1p2
#DIM CONST �ꏊ_�~�[	= 1p3
#DIM CONST �ꏊ_�P��	= 1p4
#DIM CONST �ꏊ_�׋�	= 1p5
#DIM CONST �ꏊ_�x�e	= 1p6
#DIM CONST �ꏊ_�g�C��	= 1p7
#DIM CONST �ꏊ_�V��	= 1p8	;OUTROOF_0
#DIM CONST �ꏊ_����	= 1p9
#DIM CONST �ꏊ_�V�̐�	= 1p10
#DIM CONST �ꏊ_�؉�	= 1p11
#DIM CONST �ꏊ_������	= 1p12
#DIM CONST �ꏊ_���ʂ� = 1p13	;OPENPLACE_0
#DIM CONST �ꏊ_������ = 1p14
#DIM CONST �ꏊ_����	= 1p15	;SMALL_PLACE_0
#DIM CONST �ꏊ_�L��	= 1p16
#DIM CONST �ꏊ_�������Q_�\ = 1p17	;CATNAP_PLACE_0
#DIM CONST �ꏊ_�������Q_�펞�� = 1p18
#DIM CONST �ꏊ_�g�̑��� = 1p19
#DIM CONST �ꏊ_���u = 1p20
#DIM CONST �ꏊ_���u�Q = 1p21
#DIM CONST �ꏊ_���u�R = 1p22
#DIM CONST �ꏊ_�ߑa = 1p23
#DIM CONST �ꏊ_�v���C�x�[�g = 1p24
#DIM CONST �ꏊ_�����̏� = 1p25

#DIM CONST �ꏊ_���܂�Ȃ�	= 1p30
#DIM CONST �ꏊ_�������[��	= 1p31

#DIM CONST �ꏊ_�����ʒu	= 1p61
#DIM CONST �ꏊ_����		= 1p62
#DIM CONST �ꏊ_����= 1p63

#DIM CONST YOBAI_�\�t�g = 1p0
#DIM CONST YOBAI_�Z�N�n�� = 1p1
#DIM CONST YOBAI_�K�`�Z�N�n�� = 1p2
#DIM CONST YOBAI_���Ӕ�}�� = 1p3
#DIM CONST YOBAI_���Ӄb�N�X = 1p4
#DIM CONST YOBAI_���C�v = 1p5
#DIM CONST YOBAI_���� = 1p6
#DIM CONST YOBAI_���S = 1p7

;�퓬�֘A
#DIM ENEMY_NUM
#DIMS ENEMY_NAME
#DIM ENEMY_HP
#DIM ENEMY_MAXHP
#DIM ENEMY_ATK
#DIM ENEMY_ATK_DIRECTION

#DIMS ENEMY_SKILL_NAME
#DIM ENEMY_SKILL_ATK
#DIM ENEMY_SKILL_SPD
#DIM ENEMY_SKILL_WAIT

;�F
#DIM CONST C_GREEN    = 0x00FF00
#DIM CONST C_P_GREEN  = 0x70C070
#DIM CONST C_L_GREEN  = 0x90EE90
#DIM CONST C_TEAL     = 0x008080
#DIM CONST C_M_GREEN  = 0x00FA9A

#DIM CONST C_YELLOW   = 0xFFFF00
#DIM CONST C_P_YELLOW = 0x505020
#DIM CONST C_CREAM    = 0xFFFFCC

#DIM CONST C_ORANGE   = 0xFFA500
#DIM CONST C_RED      = 0xFF0000
#DIM CONST C_D_RED    = 0x990000
#DIM CONST C_P_PURPLE = 0xC070C0

#DIM CONST C_BLUE     = 0x0000FF
#DIM CONST C_AQUA     = 0x66FFFF
#DIM CONST C_P_BLUE   = 0x7070C0

#DIM CONST C_WHITE    = 0xC0C0C0
#DIM CONST C_L_GRAY   = 0x777777
#DIM CONST C_GRAY     = 0x404040

#DIM CONST C_PINK     = 0xFFCCFF
#DIM CONST C_D_PINK   = 0x990099
#DIM CONST C_H_PINK   = 0xFF69B4

;�J�[�h�Q�[���p�ϐ�
;����p��BJ�ȊO�̊֐��ł��Q�Ƃł���悤�ɍL��ϐ���
;
;�ꉞ�킩��₷�����U�@�̎g������z�肵�č����
;�@CARD_HAND:0:0 == 5       ;�v���C���[0�̎�D0��5�ł�
;�@CARD_HAND:0:1 == 1       ;�v���C���[0�̎�D1��1�ł�
;
;����Ȏg�������ł���i��D�̋L�^�̈���R�D�Ɠ��������m�ۂ��Ă��邽�߁j
;�@CARD_HAND:0:1 == 5       ;CARD1�̓v���C���[5�������Ă܂�
;�@CARD_HAND:0:2 == 1       ;CARD2�̓v���C���[1�������Ă܂�
;�@CARD_HAND:0:3 == -1      ;CARD3��ɕ�����ꂽ��Ԃł�
;�@CARD_HAND:0:4 == -2      ;CARD4�͂��̃Q�[���ł͎g�p���܂���
;�g�p�ϐ������k�ł��邪��D�̏��ԂȂǂ͋L�^�ł��Ȃ��̂����_
;���Ə������e����₱����
;
;���������60���͎Q�������邱�Ƃ��\
;�ECARD_DECK�Ƀf�b�L�̃V���b�t���󋵂��L�^����
;�ECARD_HAND:X:Y�͕ϑ��I�ɗ��p����
;�@X=0,Y=1-60�ł�L���@�ɂ��e�J�[�h�̕��z�󋵂��L�^
;�@X=1,Y=1-60�ł͎Q���L������ID���L�^
;�����Ƃ��A���̋K�͂��ƃJ�[�h���̖̂���������Ȃ���

#DIM NUM_JOKER              ;�g�p����W���[�J�[�̐�
#DIM CONST MAX_JOKER = 8    ;�W���[�J�[�̏����8��
#DIM NUM_CARD               ;�f�b�L�Ɋ܂܂��J�[�h�̖���
#DIM NUM_CARD_PL            ;�J�[�h�Q�[���̎Q���v���C���[�l���i�ő�10�j
#DIM CONST MAX_CARD_PL = 10 ;�Q���v���C���[�����10��
#DIM CARD_PL_ID, 10         ;�ePL�̓o�^�ԍ��A���܂�Ƃ��g���ĂȂ�
#DIM CARD_DECK, 60          ;�R�D�A1�`52�{�W���[�J�[0�`8���A���v60��
#DIM NEW_CARD               ;���Ɉ����R�D�̔ԍ��i�����ݏ�����R�D�̖����j
#DIM CARD_HAND, 10, 60      ;�ePL�̎�D
#DIM NUM_HAND, 10           ;�ePL�̏�������

;�J�[�h�i�g�����v�j�Q�[���p�ėp������ϐ�
;���ӓ_�Ƃ��Ă�
;SUIT:0���u�H�v��RANK:0���uJK�v�ɂ��Ă���_
{
#DIMS CONST CARD_SUIT, 5  = "�H",
	@"%UNICODE(0x2660)%",
	@"%UNICODE(0x2663)%",
	@"%UNICODE(0x2665)%",
	@"%UNICODE(0x2666)%"
}
{
#DIMS CONST CARD_RANK, 14 = "JK",
	"�`", "�Q", "�R", "�S", "�T",
	"�U", "�V", "�W", "�H", "10",
	"�i", "�p", "�j"
}

#DIM CONST COM�N���L���b�v = 42
#DIM CONST COM�I�i�z�[�� = 43;�K�v�Ȃ�����
#DIM CONST COM�o�C�u = 44
#DIM CONST COM�A�i���o�C�u = 45
#DIM CONST COM�A�i���r�[�Y = 46;�K�v�Ȃ�����
#DIM CONST COM�j�v���L���b�v = 47
#DIM CONST COM����@ = 48;�K�v�Ȃ�����
#DIM CONST COM�A�C�}�X�N = 104
#DIM CONST COM�� = 105
#DIM CONST COM�{�[���M���O = 106;�K�v�Ȃ�����
#DIM CONST COM���� = 146;�K�v�Ȃ�����
#DIM CONST COM�g���o���[�� = 147;�K�v�Ȃ�����
#DIM CONST COM�A�i���d�� = 148;�K�v�Ȃ�����
#DIM CONST COM�r�f�I�B�e = 183;�K�v�Ȃ�����
#DIM CONST COM�����C��v���C = 187;�K�v�Ȃ�����
#DIM CONST COM�V�����[ = 188
#DIM CONST COM�V�ȃv���C = 189
#DIM CONST COM�������P = 351

;�y�Ȋ֘A
{
#DIMS CONST T_PROJECT_GENRE =
	"�����i���o�["
	, "�����_�i���o�["
}
;	, "���y�b�c"
;	, "����"

{
#DIMS CONST T_PROJECT_TITLE_�����i���o�[ =
	"�����ˈٓ`"
	, "���������^"
	, "����������"
	, "�������z��"
	, "�������Y�k"
	, "�����g����"
	, "�����d�X��"
	, "�����i�鏴"
	, "�����ԉf��"
	, "�������_�^"
	, "�����n��a"
	, "�������@�D"
	, "�����_��_"
	, "�����P�j��"
	, "��������`"
	, "�����V����"
}

{
#DIMS CONST T_PROJECT_TITLE_�����_�i���o�[ =
	"�������z�i�V�i���I�ȁj"
	, "�������z�i�L�����ȁj"
	, "�������Ԓ�"
	, "������z�V�i�V�i���I�ȁj"
	, "������z�V�i�L�����ȁj"
	, "������z�V���i�V�i���I�ȁj"
	, "������z�V���i�L�����ȁj"
	, "�_�u���X�|�C���["
	, "�d����푈"
	, "�����S�Y�O�i�V�i���I�ȁj"
	, "�����S�Y�O�i�L�����ȁj"
	, "�e���A�}�m�W���N"
	, "�����[��^�i�V�i���I�ȁj"
	, "�����[��^�i�L�����ȁj"
	, "�����߈ˉ؁i�V�i���I�ȁj"
	, "�����߈ˉ؁i�L�����ȁj"
	, "�镕�i�C�g���A�_�C�A���["
}

{
#DIMS CONST T_PROJECT_TITLE_���y�b�c =
	"�H���l�`"
	, "�@����s"
	, "����Ȋw���I"
	, "�K�ѓ��C��"
	, "��󖂏p"
	, "���m�̉ԁ@���m�̗�"
	, "���D���"
	, "�ɜQ������"
	, "���Δ�����"
	, "�������"
}

{
#DIMS CONST T_PROJECT_TITLE_���� =
	"���������j�I"
	, "�����O����"
	, "�����R����"
	, "������ވ�"
}