void sound_menuset( int nitems, newmenu_item *items, int *last_key, int citem ) { nitems = nitems; *last_key=*last_key; if ( Config_digi_volume != items[0].value ) { Config_digi_volume = items[0].value; digi_set_digi_volume( (Config_digi_volume*256)/8 ); digi_play_sample_once( SOUND_DROP_BOMB, F1_0 ); } if ( Config_midi_volume != items[1].value ) { Config_midi_volume = items[1].value; digi_set_midi_volume( (Config_midi_volume*256)/8 ); } if ( Config_master_volume != items[2].value ) { Config_master_volume = items[2].value; digi_set_master_volume( items[2].value ); digi_play_sample_once( SOUND_DROP_BOMB, F1_0 ); } if (shuffle_levels != items[5].value) shuffle_levels = items[5].value; }
void transfer_energy_to_shield() { fix e; //how much energy gets transfered static fix64 last_play_time=0; e = min(min(FrameTime*CONVERTER_RATE,Players[Player_num].energy - INITIAL_ENERGY),(MAX_SHIELDS-Players[Player_num].shields)*CONVERTER_SCALE); if (e <= 0) { if (Players[Player_num].energy <= INITIAL_ENERGY) { HUD_init_message(HM_DEFAULT, "Need more than %i energy to enable transfer", f2i(INITIAL_ENERGY)); } else if (Players[Player_num].shields >= MAX_SHIELDS) { HUD_init_message_literal(HM_DEFAULT, "No transfer: Shields already at max"); } return; } Players[Player_num].energy -= e; Players[Player_num].shields += e/CONVERTER_SCALE; if (last_play_time > GameTime64) last_play_time = 0; if (GameTime64 > last_play_time+CONVERTER_SOUND_DELAY) { digi_play_sample_once(SOUND_CONVERT_ENERGY, F1_0); last_play_time = GameTime64; } }
void joydef_menuset(int nitems, newmenu_item * items, int *last_key, int citem ) { nitems=nitems; *last_key = *last_key; if ( citem==4) { gr_palette_set_gamma(items[4].value); } if ( Config_digi_volume != items[0].value ) { Config_digi_volume = items[0].value; digi_set_digi_volume( (Config_digi_volume*32768)/8 ); digi_play_sample_once( SOUND_DROP_BOMB, F1_0 ); } if (Config_midi_volume != items[1].value ) { Config_midi_volume = items[1].value; digi_set_midi_volume( (Config_midi_volume*128)/8 ); } }
void do_weapon_n_item_stuff() { int i; if (Controls.fire_flare_count > 0) { Controls.fire_flare_count = 0; if (allowed_to_fire_flare()) Flare_create(ConsoleObject); } //Turkey Begin if (!((Game_mode & GM_MULTI) && (Game_mode & GM_TURKEY) && get_team(Player_num))) { //Turkey End if (allowed_to_fire_missile() && Controls.fire_secondary_state) Global_missile_firing_count += Weapon_info[Secondary_weapon_to_weapon_info[Secondary_weapon]].fire_count; if (Global_missile_firing_count) { do_missile_firing(0); Global_missile_firing_count--; } if (Controls.cycle_primary_count > 0) { for (i=0;i<Controls.cycle_primary_count;i++) CyclePrimary (); Controls.cycle_primary_count = 0; } if (Controls.cycle_secondary_count > 0) { for (i=0;i<Controls.cycle_secondary_count;i++) CycleSecondary (); Controls.cycle_secondary_count = 0; } if (Controls.select_weapon_count > 0) { Controls.select_weapon_count--; do_weapon_select(Controls.select_weapon_count>4?Controls.select_weapon_count-5:Controls.select_weapon_count,Controls.select_weapon_count>4?1:0); Controls.select_weapon_count = 0; } if (Controls.headlight_count > 0) { for (i=0;i<Controls.headlight_count;i++) toggle_headlight_active (); Controls.headlight_count = 0; } if (Global_missile_firing_count < 0) Global_missile_firing_count = 0; //Turkey Begin //should we allow turkey to poop? } //Turkey End // Drop proximity bombs. while (Controls.drop_bomb_count > 0) { do_missile_firing(1); Controls.drop_bomb_count--; } if (Controls.toggle_bomb_count > 0) { int bomb = Secondary_last_was_super[PROXIMITY_INDEX]?PROXIMITY_INDEX:SMART_MINE_INDEX; if (!Players[Player_num].secondary_ammo[PROXIMITY_INDEX] && !Players[Player_num].secondary_ammo[SMART_MINE_INDEX]) { digi_play_sample_once( SOUND_BAD_SELECTION, F1_0 ); HUD_init_message_literal(HM_DEFAULT, "No bombs available!"); } else { if (Players[Player_num].secondary_ammo[bomb]==0) { digi_play_sample_once( SOUND_BAD_SELECTION, F1_0 ); HUD_init_message(HM_DEFAULT, "No %s available!",(bomb==SMART_MINE_INDEX)?"Smart mines":"Proximity bombs"); } else { Secondary_last_was_super[PROXIMITY_INDEX]=!Secondary_last_was_super[PROXIMITY_INDEX]; digi_play_sample_once( SOUND_GOOD_SELECTION_SECONDARY, F1_0 ); } } Controls.toggle_bomb_count = 0; } //Turkey Begin //or maybe we shouldnt allow turkey to poop //} //Turkey End if (Controls.energy_to_shield_state && (Players[Player_num].flags & PLAYER_FLAGS_CONVERTER)) transfer_energy_to_shield(); }
// ------------------------------------------------------------------------------------ //if message flag set, print message saying selected void select_weapon(int weapon_num, int secondary_flag, int print_message, int wait_for_rearm) { const char *weapon_name; if (Newdemo_state==ND_STATE_RECORDING ) newdemo_record_player_weapon(secondary_flag, weapon_num); if (!secondary_flag) { if (Primary_weapon != weapon_num) { #ifndef FUSION_KEEPS_CHARGE //added 8/6/98 by Victor Rachels to fix fusion charge bug Fusion_charge=0; //end edit - Victor Rachels #endif if (wait_for_rearm) digi_play_sample_once( SOUND_GOOD_SELECTION_PRIMARY, F1_0 ); #ifdef NETWORK if (Game_mode & GM_MULTI) { if (wait_for_rearm) multi_send_play_sound(SOUND_GOOD_SELECTION_PRIMARY, F1_0); } #endif if (wait_for_rearm) Next_laser_fire_time = GameTime64 + REARM_TIME; else Next_laser_fire_time = 0; Global_laser_firing_count = 0; } Primary_weapon = weapon_num; weapon_name = PRIMARY_WEAPON_NAMES(weapon_num); //save flag for whether was super version Primary_last_was_super[weapon_num % SUPER_WEAPON] = (weapon_num >= SUPER_WEAPON); } else { if (Secondary_weapon != weapon_num) { if (wait_for_rearm) digi_play_sample_once( SOUND_GOOD_SELECTION_SECONDARY, F1_0 ); #ifdef NETWORK if (Game_mode & GM_MULTI) { if (wait_for_rearm) multi_send_play_sound(SOUND_GOOD_SELECTION_PRIMARY, F1_0); } #endif if (wait_for_rearm) Next_missile_fire_time = GameTime64 + REARM_TIME; else Next_missile_fire_time = 0; Global_missile_firing_count = 0; } else { if (wait_for_rearm) { digi_play_sample_once( SOUND_ALREADY_SELECTED, F1_0 ); } } Secondary_weapon = weapon_num; weapon_name = SECONDARY_WEAPON_NAMES(weapon_num); //save flag for whether was super version Secondary_last_was_super[weapon_num % SUPER_WEAPON] = (weapon_num >= SUPER_WEAPON); } if (print_message) { const player *const plr = &Players[Player_num]; if (weapon_num == LASER_INDEX && !secondary_flag) HUD_init_message(HM_DEFAULT, "%s Level %d selected (energy=%i)!", weapon_name, plr->laser_level+1, f2i(plr->energy)); else if (!secondary_flag && (weapon_num == 1 || weapon_num == 6)) HUD_init_message(HM_DEFAULT, "%s selected (ammo=%i/%i)!", weapon_name, PRINTABLE_VULCAN_AMMO(plr->primary_ammo[1]), PRINTABLE_VULCAN_AMMO(CURRENT_VULCAN_AMMO_CAPACITY(Player_num))); else if (!secondary_flag) HUD_init_message(HM_DEFAULT, "%s selected (energy=%i)!", weapon_name, f2i(plr->energy)); else HUD_init_message(HM_DEFAULT, "%s selected (count=%i)!", weapon_name, plr->secondary_ammo[weapon_num]); } }