diff --git a/common/main/game.h b/common/main/game.h index dfeae7546..65de18b7e 100644 --- a/common/main/game.h +++ b/common/main/game.h @@ -215,7 +215,15 @@ void reset_rear_view(void); #if defined(DXX_BUILD_DESCENT_I) void game_init_render_buffers (int render_max_w, int render_max_h); +static inline int game_mode_hoard() +{ + return 0; +} #elif defined(DXX_BUILD_DESCENT_II) +static inline int game_mode_hoard() +{ + return (Game_mode & GM_HOARD); +} // returns ptr to escort robot, or NULL struct object *find_escort(); diff --git a/d2x-rebirth/main/collide.c b/d2x-rebirth/main/collide.c index 619b2f429..dc0529d58 100644 --- a/d2x-rebirth/main/collide.c +++ b/d2x-rebirth/main/collide.c @@ -1843,7 +1843,7 @@ void drop_player_eggs(object *playerobj) // If the player had proximity bombs, maybe arm one of them. - if ((Game_mode & GM_MULTI) && !(Game_mode & GM_HOARD)) + if ((Game_mode & GM_MULTI) && !game_mode_hoard()) { rthresh = 30000; while ((Players[playerobj->id].secondary_ammo[PROXIMITY_INDEX]%4==1) && (d_rand() < rthresh)) { @@ -1901,7 +1901,7 @@ void drop_player_eggs(object *playerobj) } - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) { // Drop hoard orbs @@ -1941,7 +1941,7 @@ void drop_player_eggs(object *playerobj) // Drop the secondary weapons // Note, proximity weapon only comes in packets of 4. So drop n/2, but a max of 3 (handled inside maybe_drop..) Make sense? - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) maybe_drop_secondary_weapon_egg(playerobj, PROXIMITY_INDEX, (Players[playerobj->id].secondary_ammo[PROXIMITY_INDEX])/4); maybe_drop_secondary_weapon_egg(playerobj, SMART_INDEX, Players[playerobj->id].secondary_ammo[SMART_INDEX]); diff --git a/d2x-rebirth/main/fuelcen.c b/d2x-rebirth/main/fuelcen.c index f315b2b35..73bdb5984 100644 --- a/d2x-rebirth/main/fuelcen.c +++ b/d2x-rebirth/main/fuelcen.c @@ -773,7 +773,7 @@ void fuelcen_check_for_hoard_goal(segment *segp) segment2 *seg2p = &Segment2s[segp-Segments]; Assert( segp != NULL ); - Assert (Game_mode & GM_HOARD); + Assert (game_mode_hoard()); if (Player_is_dead) return; diff --git a/d2x-rebirth/main/multi.c b/d2x-rebirth/main/multi.c index 2ca88d700..763288640 100644 --- a/d2x-rebirth/main/multi.c +++ b/d2x-rebirth/main/multi.c @@ -685,7 +685,7 @@ void multi_compute_kill(int killer, int killed) if (killer_pnum == killed_pnum) { - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) { if (Game_mode & GM_TEAM) team_kills[get_team(killed_pnum)] -= 1; @@ -724,7 +724,7 @@ void multi_compute_kill(int killer, int killed) else { - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) { if (Game_mode & GM_TEAM) { @@ -780,7 +780,7 @@ void multi_compute_kill(int killer, int killed) { HUD_init_message(HM_MULTI, "%s %s %s!", killer_name, TXT_KILLED, TXT_YOU); multi_add_lifetime_killed(); - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) { if (Players[Player_num].secondary_ammo[PROXIMITY_INDEX]>3) multi_send_play_by_play (1,killer_pnum,Player_num); @@ -2652,7 +2652,7 @@ void multi_powcap_cap_objects() if (!(Game_mode & GM_NETWORK)) return; - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) Players[Player_num].secondary_ammo[PROXIMITY_INDEX]+=Proximity_dropped; Players[Player_num].secondary_ammo[SMART_MINE_INDEX]+=Smartmines_dropped; Proximity_dropped=0; @@ -2672,14 +2672,14 @@ void multi_powcap_cap_objects() // Don't do the adjustment stuff for Hoard mode - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) Players[Player_num].secondary_ammo[2]/=4; Players[Player_num].secondary_ammo[7]/=4; for (index=0;index-1) + if (game_mode_hoard() && objnum>-1) multi_send_drop_flag(objnum,seed); Players[Player_num].secondary_ammo[PROXIMITY_INDEX]--; @@ -4306,9 +4306,9 @@ void DropFlag () { int objnum,seed; - if (!(Game_mode & GM_CAPTURE) && !(Game_mode & GM_HOARD)) + if (!(Game_mode & GM_CAPTURE) && !game_mode_hoard()) return; - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) { DropOrb(); return; @@ -4358,7 +4358,7 @@ void multi_send_drop_flag (int objnum,int seed) map_objnum_local_to_local(objnum); - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) if (Game_mode & GM_NETWORK) PowerupsInMine[objp->id]++; @@ -4386,7 +4386,7 @@ void multi_do_drop_flag (const ubyte *buf) if (objnum!=-1) Objects[objnum].ctype.powerup_info.count = ammo; - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) { if (Game_mode & GM_NETWORK) PowerupsInMine[powerup_id]++; @@ -4593,7 +4593,7 @@ void multi_do_ranking (const ubyte *buf) void multi_send_play_by_play (int num,int spnum,int dpnum) { - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) return; return; @@ -4611,7 +4611,7 @@ void multi_do_play_by_play (const ubyte *buf) int spnum=buf[2]; int dpnum=buf[3]; - if (!(Game_mode & GM_HOARD)) + if (!game_mode_hoard()) { Int3(); // Get Leighton, something bad has happened. return; diff --git a/d2x-rebirth/main/net_udp.c b/d2x-rebirth/main/net_udp.c index 6e04b0677..521ee2d04 100644 --- a/d2x-rebirth/main/net_udp.c +++ b/d2x-rebirth/main/net_udp.c @@ -1980,7 +1980,7 @@ void net_udp_update_netgame(void) if (HoardEquipped()) { - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) { Netgame.game_flags |=NETGAME_FLAG_HOARD; if (Game_mode & GM_TEAM) diff --git a/d2x-rebirth/main/newdemo.c b/d2x-rebirth/main/newdemo.c index 6973b590e..4648888f2 100644 --- a/d2x-rebirth/main/newdemo.c +++ b/d2x-rebirth/main/newdemo.c @@ -2806,10 +2806,10 @@ int newdemo_read_frame_information(int rewrite) #ifdef NETWORK Game_mode = Newdemo_game_mode; - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) init_hoard_data(); - if (Game_mode & GM_CAPTURE || Game_mode & GM_HOARD) + if (Game_mode & GM_CAPTURE || game_mode_hoard()) multi_apply_goal_textures (); Game_mode = GM_NORMAL; #endif diff --git a/d2x-rebirth/main/powerup.c b/d2x-rebirth/main/powerup.c index c63dcf083..d42a69699 100644 --- a/d2x-rebirth/main/powerup.c +++ b/d2x-rebirth/main/powerup.c @@ -169,7 +169,7 @@ void do_megawow_powerup(int quantity) Players[Player_num].flags |= PLAYER_FLAGS_QUAD_LASERS; Players[Player_num].laser_level = MAX_SUPER_LASER_LEVEL; - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) Players[Player_num].secondary_ammo[PROXIMITY_INDEX] = 12; @@ -620,7 +620,7 @@ int do_powerup(object *obj) break; case POW_HOARD_ORB: - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) if (Players[Player_num].secondary_ammo[PROXIMITY_INDEX]<12) { powerup_basic(15, 0, 15, 0, "Orb!!!"); Players[Player_num].secondary_ammo[PROXIMITY_INDEX]++; diff --git a/similar/main/gamecntl.c b/similar/main/gamecntl.c index 78c295f2d..3672fc7cf 100644 --- a/similar/main/gamecntl.c +++ b/similar/main/gamecntl.c @@ -225,7 +225,7 @@ int which_bomb() // If hoard game, only let the player drop smart mines - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) return SMART_MINE_INDEX; bomb = Secondary_last_was_super[PROXIMITY_INDEX]?SMART_MINE_INDEX:PROXIMITY_INDEX; diff --git a/similar/main/gamerend.c b/similar/main/gamerend.c index 0a82a2530..1f16b808f 100644 --- a/similar/main/gamerend.c +++ b/similar/main/gamerend.c @@ -236,7 +236,7 @@ void show_netplayerinfo() eff=0; #if defined(DXX_BUILD_DESCENT_II) - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) { if (PhallicMan==-1) gr_printf(0x8000,y,"There is no record yet for this level."); diff --git a/similar/main/gauges.c b/similar/main/gauges.c index 4a65bc872..1049a53f9 100644 --- a/similar/main/gauges.c +++ b/similar/main/gauges.c @@ -995,7 +995,7 @@ extern grs_bitmap Orb_icons[2]; void hud_show_orbs (void) { - if (Game_mode & GM_HOARD) { + if (game_mode_hoard()) { int x=0,y=LINE_SPACING+FSPACY(1); grs_bitmap *bm; @@ -2718,7 +2718,7 @@ void show_HUD_names() #if defined(DXX_BUILD_DESCENT_I) show_indi = ((/*(Game_mode & ( GM_CAPTURE | GM_HOARD ) && Players[pnum].flags & PLAYER_FLAGS_FLAG) || */(Game_mode & GM_BOUNTY && pnum == Bounty_target)) && (is_friend || !(Players[pnum].flags & PLAYER_FLAGS_CLOAKED))); #elif defined(DXX_BUILD_DESCENT_II) - show_indi = (((Game_mode & ( GM_CAPTURE | GM_HOARD ) && Players[pnum].flags & PLAYER_FLAGS_FLAG) || (Game_mode & GM_BOUNTY && pnum == Bounty_target)) && (is_friend || !(Players[pnum].flags & PLAYER_FLAGS_CLOAKED))); + show_indi = (((((Game_mode & GM_CAPTURE ) || game_mode_hoard()) && Players[pnum].flags & PLAYER_FLAGS_FLAG) || (Game_mode & GM_BOUNTY && pnum == Bounty_target)) && (is_friend || !(Players[pnum].flags & PLAYER_FLAGS_CLOAKED))); #endif if (Newdemo_state == ND_STATE_PLAYBACK) { @@ -2785,7 +2785,7 @@ void show_HUD_names() #if defined(DXX_BUILD_DESCENT_II) if (Game_mode & GM_CAPTURE) gr_setcolor((get_team(pnum) == TEAM_BLUE)?BM_XRGB(31,0,0):BM_XRGB(0,0,31)); - else if (Game_mode & GM_HOARD) + else if (game_mode_hoard()) { if (Game_mode & GM_TEAM) gr_setcolor((get_team(pnum) == TEAM_RED)?BM_XRGB(31,0,0):BM_XRGB(0,0,31)); diff --git a/similar/main/kmatrix.c b/similar/main/kmatrix.c index 14eb8738e..180368136 100644 --- a/similar/main/kmatrix.c +++ b/similar/main/kmatrix.c @@ -218,7 +218,7 @@ void kmatrix_redraw(kmatrix_screen *km) #if defined(DXX_BUILD_DESCENT_II) if (Game_mode & GM_CAPTURE) gr_string( 0x8000, FSPACY(10), "CAPTURE THE FLAG SUMMARY"); - else if (Game_mode & GM_HOARD) + else if (game_mode_hoard()) gr_string( 0x8000, FSPACY(10), "HOARD SUMMARY"); else #endif diff --git a/similar/main/lighting.c b/similar/main/lighting.c index 88837161d..53d66d60a 100644 --- a/similar/main/lighting.c +++ b/similar/main/lighting.c @@ -254,7 +254,7 @@ g3s_lrgb compute_light_emission(int objnum) Headlights[Num_headlights++] = obj; light_intensity = HEADLIGHT_SCALE; } - else if ((Game_mode & GM_HOARD) && Players[obj->id].secondary_ammo[PROXIMITY_INDEX]) // If hoard game and player, add extra light based on how many orbs you have Pulse as well. + else if (game_mode_hoard() && Players[obj->id].secondary_ammo[PROXIMITY_INDEX]) // If hoard game and player, add extra light based on how many orbs you have Pulse as well. { fix s,hoardlight; hoardlight=i2f(Players[obj->id].secondary_ammo[PROXIMITY_INDEX])/2; //i2f(12)); diff --git a/similar/main/object.c b/similar/main/object.c index 3b7880f7c..8db4556d0 100644 --- a/similar/main/object.c +++ b/similar/main/object.c @@ -1554,7 +1554,7 @@ void start_player_death_sequence(object *player) killer_pnum = Objects[Players[Player_num].killer_objnum].id; // If Hoard, increase number of orbs by 1. Only if you haven't killed yourself. This prevents cheating - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) if (Players[Player_num].secondary_ammo[PROXIMITY_INDEX]<12) if (!(Players[Player_num].killer_objnum == Players[Player_num].objnum || ((Game_mode & GM_TEAM) && get_team(Player_num) == get_team(killer_pnum)))) Players[Player_num].secondary_ammo[PROXIMITY_INDEX]++; @@ -1705,7 +1705,7 @@ void object_move_one( object * obj ) #if defined(DXX_BUILD_DESCENT_II) if (Game_mode & GM_CAPTURE) fuelcen_check_for_goal (&Segments[obj->segnum]); - if (Game_mode & GM_HOARD) + if (game_mode_hoard()) fuelcen_check_for_hoard_goal (&Segments[obj->segnum]); #endif