summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-10-19 12:08:36 +0800
committerIru Cai <mytbk920423@gmail.com>2018-10-19 13:13:38 +0800
commit439d0375604873ecc7ba38d0d88197c035ffe833 (patch)
tree447c97a49c5286c67174ec3fa588f04622f9ec71
parent9e1149e9e326ec8928e73a0c87fbf58ae536206e (diff)
downloadrich4-439d0375604873ecc7ba38d0d88197c035ffe833.tar.xz
check_news
-rw-r--r--csrc/news.c108
1 files changed, 108 insertions, 0 deletions
diff --git a/csrc/news.c b/csrc/news.c
index c968605..816ddea 100644
--- a/csrc/news.c
+++ b/csrc/news.c
@@ -1,4 +1,112 @@
#include "mkf/mkf.h"
+#include "land.h"
+
+int check_news(int v)
+{
+ edi = 1;
+ esi = 0;
+
+ switch (v) {
+ case 0:
+ case 1:
+ if (dw_496b30 == 0)
+ return 0;
+ else
+ return 1;
+ case 2:
+ case 3:
+ if (dw_496b60 == 0)
+ return 0;
+ else
+ return 1;
+ case 4:
+ case 5:
+ case 15:
+ for (int i = 1; i <= dw_498e98; i++) {
+ if (hlands[i].level != 0)
+ return 1;
+ }
+ for (int i = 1; i <= dw_498e8c; i++) {
+ if (blands[i].level != 0)
+ return 1;
+ }
+ return 0;
+ case 7:
+ for (int i = 1; i <= dw_498e98; i++) {
+ if (hlands[i].owner == 0)
+ return 1;
+ }
+ for (int i = 1; i <= dw_498e8c; i++) {
+ if (blands[i].owner == 0)
+ return 1;
+ }
+ return 0;
+ case 8:
+ case 9:
+ case 12:
+ for (int i = 1; i <= dw_498e98; i++) {
+ if (hlands[i].owner != 0)
+ return 1;
+ }
+ for (int i = 1; i <= dw_498e8c; i++) {
+ if (blands[i].owner != 0)
+ return 1;
+ }
+ return 0;
+ case 10:
+ case 13:
+ for (int i = 0; i < nplayers; i++) {
+ for (int j = 0; j < 12; j++) {
+ if (players[i].who_plays == 0)
+ continue;
+ if (player_stocks[i * 12 + j].amount != 0)
+ return 1;
+ }
+ }
+ return 0;
+ case 16:
+ for (int i = 0; i < nplayers; i++) {
+ if (players[i].who_plays == 0)
+ continue;
+ if (players[i].traffic_method == 0)
+ return 1;
+ }
+ return 0;
+ case 17:
+ for (int i = 0; i < nplayers; i++) {
+ if (players[i].who_plays == 0)
+ continue;
+ if (players[i].traffic_method != 0)
+ return 1;
+ }
+ return 0;
+ case 28:
+ for (int i = 0; i < 12; i++) {
+ if (byte [i * 36 + 0x496986]) != 0
+ return 1;
+ }
+ return 0;
+ case 29:
+ for (int i = 1; i <= dw_498e90; i++) {
+ eax = dw_498e7c + i * 0x34;
+ dl = byte [eax + 0x18];
+ if (dl != 0) {
+ eax = dl - 1;
+ if (fcn.0040d73f(eax) == 1)
+ return 1;
+ }
+ }
+ return 0;
+ case 35:
+ for (int i = 1; i <= dw_498e90; i++) {
+ if (dword [dw_498e7c + i * 0x34 + 0x28] > 10000)
+ return 1;
+ }
+ return 0;
+ default:
+ return 1;
+ }
+}
void news_events(void)
{