Comments (12)
Next I will work on this issue.
from mjai-reviewer.
This was what I thought at the begining, and even have implemented it partially. I gave up the idea because a Tenhou log viewer can already be embed, and 場況 can be very complex to be described just by tehai and tsumo/dahai. I will re-consider this.
from mjai-reviewer.
Also, fuuros will need to be recorded and displayed correctly as well.
from mjai-reviewer.
I think I can maintain the hand state in reviewing, including:
- tehai (sorted)
- fuuros (also sorted ([0] is naki'd before [1]), and will contain infomation from whose dahai this fuuro was made from)
- targeted pai from tsumo or dahai (if it is dahai, the player who discarded the tile will also be included, just like what it is right now)
Could you help me in the rendering? I can provide the format of data that will be used in the template.
from mjai-reviewer.
Sure! I want to help.
from mjai-reviewer.
The data part is done. You can now pull the latest code, check templates/report.html
and look up for those {# TODO: render these #}
. You can also render a review to check the data structure, I have put them in a <pre>
with json encode.
The template engine is tera.
target_actor
This the actor id we are reviewing. For example if target_actor
is 2, then 3 is 下家, 0 is 対面, 1 is 上家, throughout the whole game.
kyokus[*].end_status
It is an array.
Each of its element has a type
, which is either "hora"
or "ryukyoku"
.
Each element also has a .deltas
, which is an array of score changes. .deltas[0]
is the score delta of actor id 0.
For hora, there is an actor
and a target
. actor
is who 和了, target
is who 放铳. When target == actor
, it means ツモ. If there are multiple ロン, each element represents a single ロン.
Example:
ツモ
[
{
"actor": 0,
"deltas": [
4300,
-1100,
-2100,
-1100,
],
"target": 0,
"type": "hora"
}
]
Double ロン
[
{
"actor": 3,
"deltas": [
0,
0,
-7700,
7700
],
"target": 2,
"type": "hora"
},
{
"actor": 0,
"deltas": [
3900,
0,
-3900,
0
],
"target": 2,
"type": "hora"
}
]
流局
[
{
"deltas": [
-1500,
-1500,
1500,
1500
],
"type": "ryukyoku"
}
]
kyokus[*].entries[*].state
This is the state of 自家.
If pai is from tsumo (何切る), the tehai
will have it as the last element. Except the last pai, all other pais are already sorted.
If pai is from other's dahai (何鳴き), the tehai
won't have the extra last element.
In each element of the fuuros
field, there is a type
field indicating which kind this naki is.
- For "chi", "pon", "daiminkan", there are
target
field describing where the pai is from, andpai
field describing the naki'd pai. - For "kakan", there is no
target
, onlypai
. - For "ankan", there is no
target
orpai
.
All elements in fuuros
have consumed
field, which describes the pais taken from tehai to make the naki.
- For "chi", "pon", it must have and only have 2 elements.
- For "daiminkan", "kakan", it must have and only have 3 elements.
- For "ankan", it must have and only have 3 elements.
You can check templates/macros.html
for how to render a pai. Note the spaces between pais; in tehai display we don't need them. Also we need to rotate the svg to show fuuros correctly.
Example
{
"fuuros": [
{
"consumed": [
"9m",
"9m"
],
"pai": "9m",
"target": 1,
"type": "pon"
}
],
"tehai": [
"2m",
"4m",
"8m",
"2p",
"4p",
"8p",
"1s",
"3s",
"3s",
"5s",
"8s",
"S",
"P",
"2p"
]
}
Use the following to render 牌背 (used in ankan):
<svg class="tile">
<use class="back" xlink:href="#tile"></use>
</svg>
from mjai-reviewer.
Thanks for the quick implementation!
I start working.
from mjai-reviewer.
Some changes are made here:
For "kakan", there is no target
, only pai
.
Now "kakan" has previous_pon_target
, previous_pon_pai
, pai
and consumed
. And the consumed
of it has 2 elements, which are the same as previous pon.
Also, you need to pull the latest code as I edited the templates a little.
from mjai-reviewer.
Is this OK for drawn tile and discard tile?
when 「自家が を引いた時---」
when 「下家が を切った時---」
Display the last tile, "下家"
The same applies to 上家 and 対面
from mjai-reviewer.
When type is "kakan", the fuuro order was changed.
Thank you for pointing it out, I will fix it.
when 「自家が を引いた時---」
I think if you can render the tehai, the text description can be removed now.
when 「下家が を切った時---」
Maybe it is better to use "下家打" than "下家"?
from mjai-reviewer.
When type is "kakan", the fuuro order was changed.
I cannot fix this in template.
For example, the position of "1s" changes.
from mjai-reviewer.
I think if you can render the tehai, the text description can be removed now.
Maybe it is better to use "下家打" than "下家"?
I fixed.
from mjai-reviewer.
Related Issues (20)
- an error occurred during the task, please check your inputs HOT 2
- Submit not allowed on page HOT 2
- Make the catalog of result page float HOT 3
- Support language setting on result page HOT 3
- show the score of four players of each round in game summary part HOT 5
- 一番街牌谱没法review HOT 1
- Is it possible to support 東風戦 online by Mortal?
- Show the current location of player HOT 1
- Format of output of convlog? HOT 3
- 功能建议 玩家和ai打法不一样的时候 显示天凤的进张数统计 HOT 4
- Mortal的工作原理是什么?怎么感觉这里的打法不太对啊
- Mortal needs permanent accounts on tenhou HOT 3
- Json output? Or some API? HOT 1
- 一个Review报告的bug HOT 2
- [报告BUG] 振听判断错误? HOT 1
- "failed to download game log" (Mahjong Soul)
- Hope to add the function for three-player games HOT 1
- 建议增加“网站输入麻雀一番街牌谱ID,自动识别player-id”功能 HOT 1
- 想知道详情里面 这两个公式代表什么意思 HOT 1
- Unable to review logs where someone has negative points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mjai-reviewer.