Teyaku is paid to the appropriate players
This commit is contained in:
parent
76da2656b4
commit
e8a1389cda
17
game.c
17
game.c
@ -560,6 +560,19 @@ void run_frame_selecting_dekiyaku_action(Game *g) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pay_teyaku_to_player(Game *g, Player *p) {
|
||||||
|
int points = teyaku_points(&p->teyaku);
|
||||||
|
transfer_kan(g, &p->points, &g->player.points, points);
|
||||||
|
transfer_kan(g, &p->points, &g->right.points, points);
|
||||||
|
transfer_kan(g, &p->points, &g->left.points, points);
|
||||||
|
}
|
||||||
|
|
||||||
|
void pay_teyaku(Game *g) {
|
||||||
|
pay_teyaku_to_player(g, &g->player);
|
||||||
|
pay_teyaku_to_player(g, &g->right);
|
||||||
|
pay_teyaku_to_player(g, &g->left);
|
||||||
|
}
|
||||||
|
|
||||||
void run_frame_calculating_scores(Game *g) {
|
void run_frame_calculating_scores(Game *g) {
|
||||||
no_dekiyaku_end_of_round_dialog(g);
|
no_dekiyaku_end_of_round_dialog(g);
|
||||||
|
|
||||||
@ -616,6 +629,7 @@ void run_frame_calculating_scores(Game *g) {
|
|||||||
if (hp[1] > hp[2]) g->dealer = &g->right;
|
if (hp[1] > hp[2]) g->dealer = &g->right;
|
||||||
else g->dealer = &g->left;
|
else g->dealer = &g->left;
|
||||||
}
|
}
|
||||||
|
pay_teyaku(g);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -656,8 +670,9 @@ void run_frame_calculating_dekiyaku_score(Game *g) {
|
|||||||
} else if (g->left.dekiyaku_action == DEKIYAKU_ACTION_CANCEL || g->left.dekiyaku_action == DEKIYAKU_ACTION_SHOUBU) {
|
} else if (g->left.dekiyaku_action == DEKIYAKU_ACTION_CANCEL || g->left.dekiyaku_action == DEKIYAKU_ACTION_SHOUBU) {
|
||||||
calculate_dekiyaku_score(g, &g->left);
|
calculate_dekiyaku_score(g, &g->left);
|
||||||
} else {
|
} else {
|
||||||
// Hands are exhausted
|
// TODO: Hands are exhausted
|
||||||
}
|
}
|
||||||
|
pay_teyaku(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_frame_end_of_round(Game *g) {
|
void run_frame_end_of_round(Game *g) {
|
||||||
|
Loading…
Reference in New Issue
Block a user