diff --git a/src/news_item.h b/src/news_item.h index 4b49fd123a..3de7ada5a5 100644 --- a/src/news_item.h +++ b/src/news_item.h @@ -22,6 +22,7 @@ #define _NEWS_ITEM_H_ #include "rct2.h" +#include "map.h" #include "strings.h" diff --git a/src/park.c b/src/park.c index 13f3728c2f..ede941b52a 100644 --- a/src/park.c +++ b/src/park.c @@ -157,10 +157,10 @@ int calculate_park_rating() if (ride->type == RIDE_TYPE_NULL) continue; - if (ride->var_140 == -1) + if (ride->excitement == -1) continue; - _ax += ride->var_140 / 8; - _bx += ride->var_142 / 8; + _ax += ride->excitement / 8; + _bx += ride->intensity / 8; } _ax = min(1000, _ax); _bx = min(1000, _bx); @@ -198,10 +198,10 @@ int calculate_park_rating() if (ride->type == RIDE_TYPE_NULL) continue; - if (ride->var_140 == -1) + if (ride->excitement == -1) continue; - _ax += ride->var_140 / 8; - _bx += ride->var_142 / 8; + _ax += ride->excitement / 8; + _bx += ride->intensity / 8; num_rides++; } diff --git a/src/ride.h b/src/ride.h index d7a251dbeb..2519125595 100644 --- a/src/ride.h +++ b/src/ride.h @@ -29,7 +29,9 @@ */ typedef struct { uint8 type; // 0x000 - uint32 var_001; + uint8 subtype; // 0x001 + uint16 pad_002; + uint8 var_004; uint8 pad_005[0x44]; uint8 status; // 0x049 uint16 var_04A; @@ -40,9 +42,9 @@ typedef struct { uint8 pad_072[0x14]; uint16 train_car_map[1]; // 0x86 Points to the first car in the train uint8 pad_088[0x68]; - sint16 excitement; // 0x0F0 - sint16 intensity; // 0x0F2 - sint16 nausea; // 0x0F4 + sint16 var_0F0; + sint16 var_0F2; + sint16 var_0F4; uint8 pad_0F6[0x2E]; sint16 var_124; sint16 var_126; @@ -55,9 +57,9 @@ typedef struct { sint16 var_134; sint16 var_136; uint8 pad_138[0x08]; - sint16 var_140; - sint16 var_142; - uint16 pad_144; + sint16 excitement; // 0x140 + sint16 intensity; // 0x142 + uint16 nausea; // 0x144 uint16 reliability; // 0x146 uint16 pad_148; uint16 var_14A; diff --git a/src/scenario.c b/src/scenario.c index 846bfd89a3..717cc27b35 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -584,7 +584,11 @@ void scenario_success() scenario_end(); } - +/** +* Checks if there are 10 rollercoasters of different subtype with +* excitement >= 600 . +* rct2: +**/ void scenario_objective5_check() { int rcs = 0; @@ -599,13 +603,13 @@ void scenario_objective5_check() ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[i]); if (ride->type == RIDE_TYPE_NULL) continue; - subtype_id = (uint8)ride->var_001; + subtype_id = (uint8)ride->subtype; subtype_p = RCT2_GLOBAL(0x009ACFA4 + subtype_id * 4, uint32); if ((RCT2_GLOBAL(subtype_p + 0x1BE, sint8) == 2 || RCT2_GLOBAL(subtype_p + 0x1BF, sint8) == 2) && ride->status == RIDE_STATUS_OPEN && - ride->var_140 >= 600 && type_already_counted[subtype_id] == 0){ + ride->excitement >= 600 && type_already_counted[subtype_id] == 0){ type_already_counted[subtype_id]++; rcs++; } @@ -615,7 +619,11 @@ void scenario_objective5_check() scenario_success(); } - +/** + * Checks if there are 10 rollercoasters of different subtype with + * excitement > 700 and a minimum length; + * rct2: 0x0066A6B5 + **/ void scenario_objective8_check() { int rcs = 0; @@ -631,14 +639,15 @@ void scenario_objective8_check() ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[i]); if (ride->type == RIDE_TYPE_NULL) continue; - subtype_id = (uint8)ride->var_001; + subtype_id = (uint8)ride->subtype; subtype_p = RCT2_GLOBAL(0x009ACFA4 + subtype_id * 4, uint32); if ((RCT2_GLOBAL(subtype_p + 0x1BE, sint8) == 2 || RCT2_GLOBAL(subtype_p + 0x1BF, sint8) == 2) && ride->status == RIDE_STATUS_OPEN && - ride->var_140 >= 600 && type_already_counted[subtype_id] == 0){ + ride->excitement >= 600 && type_already_counted[subtype_id] == 0){ + // this calculates the length, no idea why it's done so complicated though. uint8 limit = ride->pad_088[63]; uint32 sum = 0; for (int j = 0; j < limit; ++j) { @@ -718,7 +727,6 @@ void scenario_objectives_check() case OBJECTIVE_10_ROLLERCOASTERS_LENGTH://8 scenario_objective8_check(); - //RCT2_CALLPROC_EBPSAFE(0x0066A6B5); break; case OBJECTIVE_FINISH_5_ROLLERCOASTERS://9 @@ -727,7 +735,7 @@ void scenario_objectives_check() int rcs = 0; for (int i = 0; i < 255; i++) { ride = &(RCT2_ADDRESS(RCT2_ADDRESS_RIDE_LIST, rct_ride)[i]); - if (ride->status && ride->var_140 > objective_currency) + if (ride->status && ride->excitement > objective_currency) rcs++; } if (rcs >= 5) @@ -764,9 +772,9 @@ void scneario_entrance_fee_too_high_check() uint16 magic = RCT2_GLOBAL(0x013580EE, uint16), park_entrance_fee = RCT2_GLOBAL(RCT2_ADDRESS_PARK_ENTRANCE_FEE, uint16); int max_fee = magic + (magic / 2); - uint32 game_flags = RCT2_GLOBAL(RCT2_ADDRESS_GAME_FLAGS, uint32), packed_xy; + uint32 game_flags = RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32), packed_xy; - if (game_flags & GAME_FLAGS_PARK_OPEN && park_entrance_fee > max_fee) { + if (game_flags & PARK_FLAGS_PARK_OPEN && park_entrance_fee > max_fee) { for (int i = 0; RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] != SPRITE_LOCATION_NULL; ++i) { x = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] + 16; y = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Y, uint16)[i] + 16;