summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-09-23 22:11:04 +0800
committerIru Cai <mytbk920423@gmail.com>2018-09-23 22:11:04 +0800
commitd6d4c85f075ed71dfa64ceb135fc083f4f948b64 (patch)
treeaf6bb7fc409aca0028c3a6bdf38d1dd9d62ccef9
parent6e0dd28c50e35790555892df5cb280b5b2b9d4f7 (diff)
downloadrich4-d6d4c85f075ed71dfa64ceb135fc083f4f948b64.tar.xz
winter sleep card
-rw-r--r--csrc/cards.c27
-rw-r--r--csrc/player_action.c6
-rw-r--r--csrc/player_info.h2
3 files changed, 33 insertions, 2 deletions
diff --git a/csrc/cards.c b/csrc/cards.c
index 909c054..eda94c1 100644
--- a/csrc/cards.c
+++ b/csrc/cards.c
@@ -942,6 +942,33 @@ int stop_card()
return edi;
}
+int winter_sleep_card()
+{
+ consume_a_card(current_player, 15);
+ int c = players[current_player].character;
+ player_say(current_player, 3, card_strings[c][0][14]);
+
+ for (int i = 0; i < 8; i++) {
+ if (i < 4) {
+ if (i == current_player || players[i].who_plays == 0 || players[i].f8 == 0 || players[i].days_in_hotel != 0)
+ continue;
+ fcn.0040df69(i, current_player, price_index * 150);
+ players[i].days_sleep_walking = 0;
+ players[i].days_winter_sleep = 5;
+ players[i].total_winter_sleep_days += 5;
+ continue;
+ } else {
+ ch = special_players[i].f10;
+ if (ch != 0)
+ continue;
+ special_players[i].days_sleep_walking = 0;
+ special_players[i].days_winter_sleep = 5;
+ }
+ }
+ player_action_2(0, 0, 1);
+ return 1;
+}
+
int tortoise_walking_card()
{
if (players[current_player].who_plays == 1) {
diff --git a/csrc/player_action.c b/csrc/player_action.c
index 27fe977..2e2fe2f 100644
--- a/csrc/player_action.c
+++ b/csrc/player_action.c
@@ -23,7 +23,11 @@ typedef struct
uint16_t f2;
uint16_t f4;
uint16_t f6;
- uint8_t f8[6];
+ uint8_t f8[2];
+ uint8_t f10; // 0x498df2
+ uint8_t f11;
+ uint8_t days_winter_sleep; // 0x498df4
+ uint8_t days_sleep_walking; // 0x498df5
uint8_t days_stopping;
uint8_t days_tortoise_walking;
} special_player_info;
diff --git a/csrc/player_info.h b/csrc/player_info.h
index f1305f1..0264ac6 100644
--- a/csrc/player_info.h
+++ b/csrc/player_info.h
@@ -46,7 +46,7 @@ typedef struct
/* 0x40 */
uint8_t f64;
uint8_t f65;
- uint8_t f66;
+ uint8_t total_winter_sleep_days;
uint8_t f67;
uint16_t f68;
uint16_t f70;