Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mizukami
committed
Nov 1, 2016
1 parent
bc1edc1
commit 9e234de
Showing
35 changed files
with
5,523 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
2002/9/3 | ||
�@�@�@�@�@�@�@�@�@�@�@�@�܂������p�ΐ푊��v���O�C�� | ||
|
||
�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�u�A�J�M�vver. 1.00 | ||
|
||
�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@����F�@�Z�R�C�A | ||
�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@E-mail : sequoia_tm@hotmail.com | ||
|
||
�����e | ||
�@����̓t���[�\�t�g�̊ȈՖ����Q�[���u�܂������v�y�сu�˂���_�܂������v�� | ||
�T�|�[�g����Ă���ΐ푊��v���O�C���d�l�̃v���O�C���\�t�g�ł��B������g���ƁA | ||
�u�܂������v�őΐ�ł��鑊��Ƃ��āA�u�A�J�M�v���lj�����܂��B | ||
|
||
����҂���̃R�����g | ||
�����o���ɋÂ��Ă݂܂����B�A�J�M���F�X�ڂ₢�Ă��܂��B���܂��ł���������� | ||
�_�߂Ă���܂����A�܂����ł���������Ɓi���Ȃ��Ă�(^^;�j�����Ȃ��Ƃ������� | ||
���܂�����S�҂̕��ɂ͊����̈����ł���Ɏv���邩������܂��A���������� | ||
��Ȃ��悤�ɑł��Ă����Ύ��R�Ə�B����Ǝv���܂��B�i�z���g����j | ||
ver0.50 2001/9/25 | ||
�����[�X | ||
ver1.00 2002/9/3 | ||
�E�����ł���悤�ɂȂ����B(���惋�[���ł͂��܂���܂���) | ||
�E�����o���̒lj��E�ύX�i�����P�O�O�ȏ�j�B | ||
�E�V�����e�������A���v�Ƃ炸���ł���悤�ɂȂ����B | ||
�E�U�荞�݂ɂ����Ȃ����B | ||
�@��{�I�Ƀf�t�H���g���[���Ή��Ȃ̂ŐԔv�E����ڂȂǂ͍l�����Ă��܂���B | ||
���ʂ��ӎ������ł������ł���悤�ɂȂ�A�܂��o�[�W�����A�b�v����\��ł��B | ||
���z��o�O�Ȃǂ́A������܂Ł� sequoia_tm@hotmail.com | ||
|
||
���g�p���@ | ||
�@���Ƀt�@�C�����𓀂�����A�o�Ă��� Akagi_1.0.dll �Ƃ����t�@�C�����u�܂����� | ||
��v���C���X�g�[������Ă���f�B���N�g���ɒu���Ă��������B���ꂾ���łn�j�ł��B | ||
|
||
���𓀂��Ă��t�@�C�����\������Ȃ��ꍇ | ||
�@Windows�̃f�t�H���g�̐ݒ�ł́ADLL�͕\������Ȃ��悤�ɂȂ��Ă��܂��B���̐� | ||
��́A�ȉ��̂悤�ɂ��ĕύX���邱�Ƃ��o���܂��B | ||
|
||
�@�@��InternetExplorer�Ɠ������Ă���ꍇ | ||
�@�@�E[�}�C �R���s���[�^]���J�����������B | ||
�@�@�E�E�B���h�E�㕔�̃��j���[����A[�\��]-[�t�H���_ �I�v�V����]��I�����Ă� | ||
�@�@�@�������B | ||
�@�@�E[�\��]�^�u��I��ł��������B | ||
�@�@�E�u�t�@�C���̕\���v���u���ׂẴt�@�C����\������v�ɂ��āA[OK]���N���b | ||
�@�@�@�N�����������B | ||
|
||
�@�@��InternetExplorer�Ɠ������Ă��Ȃ��ꍇ | ||
�@�@�E[�}�C �R���s���[�^]���J�����������B | ||
�@�@�E�E�B���h�E�㕔�̃��j���[����A[�\��]-[�I�v�V����]��I�����Ă��������B | ||
�@�@�E[�\��]�^�u��I��ł��������B | ||
�@�@�E�u���ׂẴt�@�C����\���v���`�F�b�N���āA[OK]���N���b�N���Ă��������B | ||
|
||
�����쌠�� | ||
�{�\�t�g�E�F�A�̓t���[�E�F�A�ł��B | ||
�@�{�\�t�g�E�F�A�̒��쌠�͍�҂����L���Ă��܂��B | ||
�z�z�͎��R�ł����]�ڂ��s���ꍇ�͎��O�Ƀ��[���ł��A�����������B | ||
���̃\�t�g�E�F�A���g�p�������ɂ���Đ����������Ȃ��Q�A���Q�ɑ��� | ||
�@��҂͈�̐ӔC��Ȃ����̂Ƃ��܂��B | ||
�ł���Ί��z�����[���ʼn������B |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module BitOperation | ||
LOWORD_MASK = 0x0000_ffff | ||
HIWORD_MASK = 0xffff_0000 | ||
WORD_BITS = 16 | ||
|
||
def loword(bit) | ||
bit & LOWORD_MASK | ||
end | ||
|
||
def hiword(bit) | ||
(bit & HIWORD_MASK) >> WORD_BITS | ||
end | ||
|
||
def make_lparam(hiword, loword) | ||
(LOWORD_MASK | HIWORD_MASK) & ((hiword << WORD_BITS) | (loword & LOWORD_MASK)) | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
require 'mjai/pai.rb' | ||
|
||
module TransMaujong | ||
module MJPI | ||
INITIALIZE = 1 | ||
SUTEHAI = 2 | ||
ONACTION = 3 | ||
STARTGAME = 4 | ||
STARTKYOKU = 5 | ||
ENDKYOKU = 6 | ||
ENDGAME = 7 | ||
DESTROY = 8 | ||
YOURNAME = 9 | ||
CREATEINSTANCE = 10 | ||
BASHOGIME = 11 | ||
ISEXCHANGEABLE = 12 | ||
ONEXCHANGE = 13 | ||
end | ||
|
||
module MJMI | ||
GETTEHAI = 1 | ||
GETKAWA = 2 | ||
GETDORA = 3 | ||
GETSCORE = 4 | ||
GETHONBA = 5 | ||
GETREACHBOU = 6 | ||
GETRULE = 7 | ||
GETVERSION = 8 | ||
GETMACHI = 9 | ||
GETAGARITEN = 10 | ||
GETHAIREMAIN = 11 | ||
GETVISIBLEHAIS = 12 | ||
FUKIDASHI = 13 | ||
KKHAIABILITY = 14 | ||
GETWAREME = 15 | ||
SETSTRUCTTYPE = 16 | ||
SETAUTOFUKIDASHI = 17 | ||
LASTTSUMOGIRI = 18 | ||
SSPUTOABILITY = 19 | ||
GETYAKUHAN = 20 | ||
GETKYOKU = 21 | ||
GETKAWAEX = 22 | ||
ANKANABILITY = 23 | ||
end | ||
|
||
module MJPIR | ||
NO_AKA5 = 0x0000_0001 | ||
HAI_MASK = 0x0000_00ff | ||
NAKI_MASK = 0xffff_ff00 | ||
SUTEHAI = 0x0000_0100 | ||
REACH = 0x0000_0200 | ||
KAN = 0x0000_0400 | ||
TSUMO = 0x0000_0800 | ||
NAGASHI = 0x0000_1000 | ||
PON = 0x0000_2000 | ||
CHII1 = 0x0000_4000 | ||
CHII2 = 0x0000_8000 | ||
CHII3 = 0x0001_0000 | ||
MINKAN = 0x0002_0000 | ||
ANKAN = 0x0004_0000 | ||
RON = 0x0008_0000 | ||
ERROR = 0x8000_0000 | ||
end | ||
|
||
module MJRL | ||
KUITAN = 1 | ||
KANSAKI = 2 | ||
PAO = 3 | ||
RON = 4 | ||
MOCHITEN = 5 | ||
BUTTOBI = 6 | ||
WAREME = 7 | ||
AKA5 = 8 | ||
SHANYU = 9 | ||
SHANYU_SCORE = 10 | ||
KUINAOSHI = 11 | ||
AKA5S = 12 | ||
URADORA = 13 | ||
SCORE0REACH = 14 | ||
RYANSHIBA = 15 | ||
DORAPLUS = 16 | ||
FURITEN_REACH = 17 | ||
NANNYU = 18 | ||
NANNYU_SCORE = 19 | ||
KARATEN = 20 | ||
PINZUMO = 21 | ||
NOTENOYANAGARE = 22 | ||
KANINREACH = 23 | ||
TOPOYAAGARIEND = 24 | ||
KIRIAGE_MANGAN = 25 | ||
DBLRONCHONBO = 26 | ||
|
||
end | ||
|
||
module MJR | ||
NOTCARED = 0xffff_ffff | ||
end | ||
|
||
module MJEK | ||
AGARI = 1 | ||
RYUKYOKU = 2 | ||
CHONBO = 3 | ||
end | ||
|
||
module MJST | ||
INKYOKU = 1 | ||
BASHOGIME = 2 | ||
end | ||
|
||
module MJKS | ||
REACH = 1 | ||
NAKI = 2 | ||
end | ||
|
||
class Mjai::Pai | ||
@@offset_map = {"m" => 0, "p" => 9 , "s" => 18, "t" => 27} | ||
|
||
# Mjai::Pai -> Pai number | ||
def to_mau_i | ||
# Maujong defines pai's id below | ||
# 1m, ..., 9m, 1p, ..., 9p, 1s, ..., 9s, E, S, W, N, P, F, C | ||
# 0, ..., 8, 9, ..., 17, 18, ..., 26, 27, 28, 29, 30, 31, 32, 33 | ||
@number + @@offset_map[@type] - 1 | ||
end | ||
|
||
def to_mau_i_r | ||
red_offset = (@red) ? 64 : 0 | ||
|
||
@number + @@offset_map[@type] - 1 + red_offset | ||
end | ||
|
||
# Pai number -> Mjai::Pai | ||
def self.from_mau_i(pai_number) | ||
red = false | ||
type = nil | ||
|
||
# number of red hais is added by 64 | ||
if [68, 77, 86].include?(pai_number) then | ||
red = true | ||
pai_number = pai_number - 64 | ||
end | ||
|
||
case pai_number | ||
when 0..8 | ||
pai_number = pai_number - 0 + 1 | ||
type = "m" | ||
when 9..17 | ||
pai_number = pai_number - 9 + 1 | ||
type = "p" | ||
when 18..26 | ||
pai_number = pai_number - 18 + 1 | ||
type = "s" | ||
when 27..33 | ||
pai_number = pai_number - 27 + 1 | ||
type = "t" | ||
else | ||
raise(ArgumentError, "wrong pai number: #{pai_number}") | ||
end | ||
|
||
Mjai::Pai.new(type, pai_number, red) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require "mjai/jsonizable" | ||
|
||
|
||
module Mjai | ||
|
||
class Action < JSONizable | ||
|
||
define_fields([ | ||
[:type, :symbol], | ||
[:reason, :symbol], | ||
[:gametype, :symbol], | ||
[:actor, :player], | ||
[:target, :player], | ||
[:pao, :player], | ||
[:pai, :pai], | ||
[:consumed, :pais], | ||
[:pais, :pais], | ||
[:tsumogiri, :boolean], | ||
[:possible_actions, :actions], | ||
[:cannot_dahai, :pais], | ||
[:id, :number], | ||
[:bakaze, :pai], | ||
[:kyoku, :number], | ||
[:honba, :number], | ||
[:kyotaku, :number], | ||
[:oya, :player], | ||
[:dora_marker, :pai], | ||
[:uradora_markers, :pais], | ||
[:tehais, :pais_list], | ||
[:uri, :string], | ||
[:names, :strings], | ||
[:hora_tehais, :pais], | ||
[:yakus, :yakus], | ||
[:fu, :number], | ||
[:fan, :number], | ||
[:hora_points, :number], | ||
[:tenpais, :booleans], | ||
[:deltas, :numbers], | ||
[:scores, :numbers], | ||
[:text, :string], | ||
[:message, :string], | ||
[:log, :string_or_null], | ||
[:logs, :strings_or_nulls], | ||
]) | ||
|
||
end | ||
|
||
end |
Oops, something went wrong.