DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
dngmessageman.cpp
1#include "dngmessageman.hpp"
2
3#include "dun/gameloop.hpp"
4#include "userstatus.hpp"
5
6#ifndef PAL
8char *LanguageStr[1][2] = {
9 {"dun/img/jp/", "dun/img/us/"}
10};
11#endif
12
14 int zone = UserStatus->res_limit_zone_current;
15
16 if (zone >= 0 && zone < 6) {
17 message = 0xB;
18 insert_mes_1 = UserStatus->cur_chara + 0x32;
19 }
20
21 if (UserStatus->res_limit_zone_current == RES_LIMIT_ZONE_NO_WEAPON_CHANGE) {
22 message = 0xD;
23 }
24
25 if (UserStatus->res_limit_zone_current == RES_LIMIT_ZONE_THIRST) {
26 message = 0xE;
27 }
28
29 timer = 0xF0;
30 steev_window = false;
31}
32
33void CDngMessageMan::SetStatus_Dry(float water_max, float water_before, float water_now) {
34 float threshold = 0.1f * water_max;
35
36 if (threshold < water_now && message == 0xAA) {
37 message = -1;
38 }
39
40 if (0.0f < water_now && message == 0xAB) {
41 message = -1;
42 }
43
44 if (threshold <= water_before + 0.5f && !(threshold <= water_now - 0.5f) && message == -1) {
45 message = 0xAA;
46 timer = 0xF0;
47 steev_window = false;
48 }
49
50 if (water_now <= 0.0f && (message == -1 || message == 0xAB)) {
51 message = 0xAB;
52 timer = 0x9FFF6;
53 steev_window = false;
54 }
55}
56
58 if (timer <= 0) {
59 // The ten Steev lines are shown in turn, so the index rides on.
60 message = first + steev_index;
61 timer = 0xF0;
62 steev_window = true;
64
65 if (steev_index > 9) {
66 steev_index = 0;
67 }
68 }
69}
void SetSteevMes(int first)
void SetStatus_Dry(float water_max, float water_before, float water_now)
s32 res_limit_zone_current