diff --git a/osx/boe.actions.cpp b/osx/boe.actions.cpp index 101d87ea..de258ff0 100644 --- a/osx/boe.actions.cpp +++ b/osx/boe.actions.cpp @@ -139,8 +139,7 @@ std::queue special_queue; bool end_scenario = false; bool current_bash_is_bash = false; -void init_screen_locs() //// -{ +void init_screen_locs() { short i,j,k,l; RECT startup_base = {279,5,327,306}; RECT shop_base = {63,12,99,267}; @@ -281,8 +280,7 @@ void init_screen_locs() //// item_area_rect.right = ITEM_WIN_UL_X + 271; } -bool prime_time() -{ +bool prime_time() { if((overall_mode < MODE_TALK_TOWN) || (overall_mode == MODE_COMBAT)) return true; return false; @@ -1460,8 +1458,7 @@ void handle_monster_actions(bool& need_redraw, bool& need_reprint) { } } -bool someone_awake() -{ +bool someone_awake() { short i; for(i = 0; i < 6; i++) @@ -1472,8 +1469,7 @@ bool someone_awake() } -void handle_menu_spell(eSpell spell_picked) -{ +void handle_menu_spell(eSpell spell_picked) { eSkill spell_type = (*spell_picked).type; if(!prime_time()) { ASB("Finish what you're doing first."); @@ -1519,8 +1515,7 @@ void handle_menu_spell(eSpell spell_picked) handle_action(event); } -void initiate_outdoor_combat(short i) -{ +void initiate_outdoor_combat(short i) { short m,n; location to_place; @@ -1662,8 +1657,7 @@ bool handle_keystroke(sf::Event& event){ char chr = keyToChar(chr2, event.key.shift); - switch(chr) - { + switch(chr) { case '&': add_string_to_buf("If Valorim ..."); @@ -2141,8 +2135,7 @@ bool handle_keystroke(sf::Event& event){ return are_done; } -void do_load() -{ +void do_load() { fs::path file_to_load = nav_get_party(); if(!file_to_load.empty()) if(!load_party(file_to_load)) @@ -2153,8 +2146,7 @@ void do_load() menu_activate(); } -void post_load() -{ +void post_load() { current_switch = 6; reset_item_max(); @@ -2183,9 +2175,8 @@ void post_load() adjust_monst_menu(); } -void do_save(short mode) //mode; // 0 - normal 1 - save as -{ +void do_save(short mode) { if(overall_mode > MODE_TOWN) { add_string_to_buf("Save: Only while outdoors, or in "); add_string_to_buf(" town and not looking/casting. "); @@ -2262,8 +2253,7 @@ void do_rest(long length, int hp_restore, int mp_restore) { adjust_spell_menus(); } -void increase_age()//// -{ +void increase_age() { short i,j,item,how_many_short = 0,r1,store_day; bool update_stat = false; @@ -2539,8 +2529,7 @@ void handle_hunting() { } -void switch_pc(short which) -{ +void switch_pc(short which) { cPlayer store_pc; if(current_switch < 6) { @@ -2563,8 +2552,7 @@ void switch_pc(short which) } } -void drop_pc(short which) -{ +void drop_pc(short which) { std::string choice; choice = cChoiceDlog("delete-pc-confirm.xml",{"yes","no"}).show(); @@ -2581,8 +2569,7 @@ void drop_pc(short which) put_pc_screen(); } -void handle_death() -{ +void handle_death() { std::string choice; overall_mode = MODE_STARTUP; @@ -2613,8 +2600,7 @@ void handle_death() } -void start_new_game() -{ +void start_new_game() { short i; std::string choice; using kb = sf::Keyboard; @@ -2676,8 +2662,7 @@ void start_new_game() party_in_memory = true; } -location get_cur_direction(location the_point) -{ +location get_cur_direction(location the_point) { location store_dir; // This is a kludgy adjustment to adjust for the screen shifting between Exile I & II @@ -2786,8 +2771,7 @@ static void run_waterfalls(short mode){ // mode 0 - town, 1 - outdoors } } -bool outd_move_party(location destination,bool forced) -{ +bool outd_move_party(location destination,bool forced) { char create_line[60]; short boat_num,horse_num,spec_num; location real_dest, sector_p_in; @@ -2989,8 +2973,7 @@ bool outd_move_party(location destination,bool forced) return false; } -bool town_move_party(location destination,short forced)//// -{ +bool town_move_party(location destination,short forced) { char create_line[60],keep_going = true; short boat_there,horse_there,spec_num; ter_num_t ter; @@ -3134,8 +3117,7 @@ bool town_move_party(location destination,short forced)//// -bool someone_poisoned() -{ +bool someone_poisoned() { short i; for(i = 0; i < 6; i++) @@ -3144,8 +3126,7 @@ bool someone_poisoned() return false; } -short nearest_monster() -{ +short nearest_monster() { short i = 100,j,s; for(j = 0; j < 10; j++) @@ -3156,18 +3137,15 @@ short nearest_monster() return i; } -void setup_outdoors(location where) -{ +void setup_outdoors(location where) { update_explored(where); } -short get_outdoor_num()//// -{ +short get_outdoor_num() { return (scenario.out_width * (univ.party.outdoor_corner.y + univ.party.i_w_c.y) + univ.party.outdoor_corner.x + univ.party.i_w_c.x); } -short count_walls(location loc) // TODO: Generalize this function -{ +short count_walls(location loc) { // TODO: Generalize this function unsigned char walls[31] = {5,6,7,8,9, 10,11,12,13,14, 15,16,17,18,19, 20,21,22,23,24, 25,26,27,28,29, 30,31,32,33,34, 35}; short answer = 0; @@ -3186,8 +3164,7 @@ short count_walls(location loc) // TODO: Generalize this function return answer; } -bool is_sign(ter_num_t ter) -{ +bool is_sign(ter_num_t ter) { if(scenario.ter_types[ter].special == eTerSpec::IS_A_SIGN) return true; diff --git a/osx/boe.combat.cpp b/osx/boe.combat.cpp index 99147f88..3bbedad0 100644 --- a/osx/boe.combat.cpp +++ b/osx/boe.combat.cpp @@ -284,8 +284,7 @@ bool center_on_monst; -void start_outdoor_combat(cOutdoors::cCreature encounter,ter_num_t in_which_terrain,short num_walls) -{ +void start_outdoor_combat(cOutdoors::cCreature encounter,ter_num_t in_which_terrain,short num_walls) { short i,j,how_many,num_tries = 0; // short low[10] = {15,7,3,3,1,1,1,7,2,1}; // short high[10] = {30,10,5,5,3,2,1,10,4,1}; @@ -412,8 +411,7 @@ void start_outdoor_combat(cOutdoors::cCreature encounter,ter_num_t in_which_terr } -bool pc_combat_move(location destination) //// -{ +bool pc_combat_move(location destination) { short dir,monst_hit,s1,s2,i,monst_exist,switch_pc; bool keep_going = true,forced = false,check_f = false; location monst_loc,store_loc; @@ -537,21 +535,18 @@ bool pc_combat_move(location destination) //// return false; } -void char_parry() -{ +void char_parry() { univ.party[current_pc].parry = (univ.party[current_pc].ap / 4) * (2 + stat_adj(current_pc,eSkill::DEXTERITY) + univ.party[current_pc].skills[eSkill::DEFENSE]); univ.party[current_pc].ap = 0; } -void char_stand_ready() -{ +void char_stand_ready() { univ.party[current_pc].parry = 100; univ.party[current_pc].ap = 0; } -void pc_attack(short who_att,short target)//// -{ +void pc_attack(short who_att,short target) { short r1,r2,weap1 = 24, weap2 = 24,i,store_hp,skill_item; eSkill what_skill1 = eSkill::DEXTERITY, what_skill2 = eSkill::DEXTERITY; cCreature *which_m; @@ -832,8 +827,7 @@ short calc_spec_dam(eItemAbil abil,short abil_str,cCreature *monst) { return store; } -void place_target(location target) -{ +void place_target(location target) { short i; if(num_targets_left > 0) { @@ -882,8 +876,7 @@ void place_target(location target) } } -void do_combat_cast(location target)//// -{ +void do_combat_cast(location target) { short adjust,r1,r2,targ_num,level,bonus = 1,i,item,store_sound = 0; cCreature *cur_monst; bool freebie = false,ap_taken = false,cost_taken = false; @@ -1378,28 +1371,24 @@ void do_combat_cast(location target)//// print_buf(); } -void handle_marked_damage() -{ +void handle_marked_damage() { short i; for(i = 0; i < 6; i++) - if(univ.party[i].marked_damage > 0) - { + if(univ.party[i].marked_damage > 0) { // TODO: Perhaps there should be a way of determining the correct race here? damage_pc(i,univ.party[i].marked_damage,DAMAGE_MARKED,eRace::UNKNOWN,0); univ.party[i].marked_damage = 0; } for(i = 0; i < univ.town->max_monst(); i++) - if(monst_marked_damage[i] > 0) - { + if(monst_marked_damage[i] > 0) { damage_monst(i, current_pc, monst_marked_damage[i], 0, DAMAGE_MARKED,0); // was 9 rather than 10; probably a mistake monst_marked_damage[i] = 0; } } -void load_missile() //// -{ +void load_missile() { short i,bow = 24,arrow = 24,thrown = 24,crossbow = 24,bolts = 24,no_ammo = 24; for(i = 0; i < 24; i++) { @@ -1609,8 +1598,7 @@ void fire_missile(location target) { // Select next active PC and, if necessary, run monsters // if monsters go or PC switches (i.e. if need redraw above), return true -bool combat_next_step() -{ +bool combat_next_step() { bool to_return = false; short store_pc; // will print current pc name is active pc changes @@ -1661,8 +1649,7 @@ bool combat_next_step() // Find next active PC, return true is monsters need running, and run monsters is slow spells // active -bool pick_next_pc() -{ +bool pick_next_pc() { bool store = false; if(current_pc == 6) @@ -1697,8 +1684,7 @@ bool pick_next_pc() } -void combat_run_monst() -{ +void combat_run_monst() { short i,item,item_level; bool update_stat = false; @@ -1781,8 +1767,7 @@ void combat_run_monst() } -void do_monster_turn() -{ +void do_monster_turn() { bool acted_yet, had_monst = false,printed_poison = false,printed_disease = false,printed_acid = false; bool redraw_not_yet_done = true; bool special_called = false; @@ -2156,18 +2141,24 @@ void do_monster_turn() place_spell_pattern(square,cur_monst->cur_loc,CLOUD_STINK,7); if((cur_monst->radiate_1 == 10) && (get_ran(1,1,100) < 5)){ if(summon_monster(cur_monst->radiate_2, - cur_monst->cur_loc,130,cur_monst->attitude)) - {monst_spell_note(cur_monst->number,33); play_sound(61);} + cur_monst->cur_loc,130,cur_monst->attitude)) { + monst_spell_note(cur_monst->number,33); + play_sound(61); + } } if((cur_monst->radiate_1 == 11) && (get_ran(1,1,100) < 20)){ if(summon_monster(cur_monst->radiate_2, - cur_monst->cur_loc,130,cur_monst->attitude)) - {monst_spell_note(cur_monst->number,33); play_sound(61);} + cur_monst->cur_loc,130,cur_monst->attitude)) { + monst_spell_note(cur_monst->number,33); + play_sound(61); + } } if((cur_monst->radiate_1 == 12) && (get_ran(1,1,100) < 50)){ if(summon_monster(cur_monst->radiate_2, - cur_monst->cur_loc,130,cur_monst->attitude)) - {monst_spell_note(cur_monst->number,33); play_sound(61);} + cur_monst->cur_loc,130,cur_monst->attitude)) { + monst_spell_note(cur_monst->number,33); + play_sound(61); + } } if((cur_monst->radiate_1 == 14) && !special_called && party_can_see_monst(i)) { short s1, s2, s3; @@ -2275,8 +2266,7 @@ void do_monster_turn() monsters_going = false; } -void monster_attack_pc(short who_att,short target) -{ +void monster_attack_pc(short who_att,short target) { cCreature *attacker; short r1,r2,i,store_hp,sound_type = 0; eDamageType dam_type = DAMAGE_WEAPON; @@ -2381,8 +2371,7 @@ void monster_attack_pc(short who_att,short target) // Petrification touch if((attacker->spec_skill == 30) && (pc_has_abil_equip(target,eItemAbil::PROTECT_FROM_PETRIFY) == 24) - && (get_ran(1,0,20) + univ.party[target].level / 4 + univ.party[target].status[eStatus::BLESS_CURSE]) <= 14) - { + && (get_ran(1,0,20) + univ.party[target].level / 4 + univ.party[target].status[eStatus::BLESS_CURSE]) <= 14) { add_string_to_buf(" Petrifying touch!"); print_buf(); kill_pc(target,eMainStatus::STONE); // petrified, duh! @@ -2465,8 +2454,7 @@ void monster_attack_pc(short who_att,short target) damage_pc(target,r1,DAMAGE_COLD,eRace::UNKNOWN,0); } // Killing touch - if(attacker->spec_skill == 35) - { + if(attacker->spec_skill == 35) { add_string_to_buf(" Killing touch!"); r1 = get_ran(20,1,10); damage_pc(target,r1,DAMAGE_UNBLOCKABLE,eRace::UNKNOWN,0); @@ -2490,8 +2478,7 @@ void monster_attack_pc(short who_att,short target) } -void monster_attack_monster(short who_att,short attackee) -{ +void monster_attack_monster(short who_att,short attackee) { cCreature *attacker,*target; short r1,r2,i,store_hp,sound_type = 0; eDamageType dam_type = DAMAGE_WEAPON; @@ -2640,9 +2627,8 @@ void monster_attack_monster(short who_att,short attackee) } -void monst_fire_missile(short m_num,short bless,short level,location source,short target) //short target; // 100 + - monster is target -{ +void monst_fire_missile(short m_num,short bless,short level,location source,short target) { cCreature *m_target; short r1,r2,dam[40] = { 0,1,2,3,4, 6,8,7,0,0, 0,0,0,0,0, 0,0,0,0,0, @@ -2905,9 +2891,8 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor } -bool monst_breathe(cCreature *caster,location targ_space,short dam_type)//// //dam_type; // 0 - fire 1 - cold 2 - magic -{ +bool monst_breathe(cCreature *caster,location targ_space,short dam_type) { short level,missile_t[4] = {13,6,8,8}; eDamageType type[4] = {DAMAGE_FIRE, DAMAGE_COLD, DAMAGE_MAGIC, DAMAGE_UNBLOCKABLE}; location l; @@ -2943,8 +2928,7 @@ bool monst_breathe(cCreature *caster,location targ_space,short dam_type)//// return true; } -bool monst_cast_mage(cCreature *caster,short targ)//// -{ +bool monst_cast_mage(cCreature *caster,short targ) { short r1,j,spell,i,level,target_levels,friend_levels_near,x; bool acted = false; location target,vict_loc,ashes_loc,l; @@ -3264,8 +3248,7 @@ bool monst_cast_mage(cCreature *caster,short targ)//// return acted; } -bool monst_cast_priest(cCreature *caster,short targ) -{ +bool monst_cast_priest(cCreature *caster,short targ) { short r1,r2,spell,i,x,level,target_levels,friend_levels_near; bool acted = false; location target,vict_loc,l; @@ -3558,8 +3541,7 @@ bool monst_cast_priest(cCreature *caster,short targ) return acted; } -void damage_target(short target,short dam,eDamageType type) -{ +void damage_target(short target,short dam,eDamageType type) { if(target == 6) return; if(target < 6) damage_pc(target,dam,type,eRace::UNKNOWN,0); @@ -3569,24 +3551,21 @@ void damage_target(short target,short dam,eDamageType type) // target = find_fireball_loc(caster->m_loc,1,(caster->attitude == 1) ? 0 : 1,&target_levels); -location find_fireball_loc(location where,short radius,short mode,short *m) //short mode; // 0 - hostile casting 1 - friendly casting -{ +location find_fireball_loc(location where,short radius,short mode,short *m) { location check_loc,cast_loc(120,0); short cur_lev,level_max = 10; for(check_loc.x = 1; check_loc.x < univ.town->max_dim() - 1; check_loc.x ++) for(check_loc.y = 1; check_loc.y < univ.town->max_dim() - 1; check_loc.y ++) if(dist(where,check_loc) <= 8 && can_see(where,check_loc,sight_obscurity) < 5 && sight_obscurity(check_loc.x,check_loc.y) < 5) { - { - cur_lev = count_levels(check_loc,radius); - if(mode == 1) - cur_lev = cur_lev * -1; - if( ((cur_lev > level_max) || ((cur_lev == level_max) && (get_ran(1,0,1) == 0))) - && (dist(where,check_loc) > radius)) { - level_max = cur_lev; - cast_loc = check_loc; - } + cur_lev = count_levels(check_loc,radius); + if(mode == 1) + cur_lev = cur_lev * -1; + if( ((cur_lev > level_max) || ((cur_lev == level_max) && (get_ran(1,0,1) == 0))) + && (dist(where,check_loc) > radius)) { + level_max = cur_lev; + cast_loc = check_loc; } } *m = level_max; @@ -3594,8 +3573,7 @@ location find_fireball_loc(location where,short radius,short mode,short *m) return cast_loc; } -location closest_pc_loc(location where) -{ +location closest_pc_loc(location where) { short i; location pc_where(120,120); @@ -3606,8 +3584,7 @@ location closest_pc_loc(location where) return pc_where; } -short count_levels(location where,short radius) -{ +short count_levels(location where,short radius) { short i,store = 0; for(i = 0; i < univ.town->max_monst(); i++) @@ -3628,8 +3605,7 @@ short count_levels(location where,short radius) return store; } -bool pc_near(short pc_num,location where,short radius) -{ +bool pc_near(short pc_num,location where,short radius) { // Assuming not looking if(overall_mode >= MODE_COMBAT) { if(univ.party[pc_num].main_status == eMainStatus::ALIVE && vdist(univ.party[pc_num].combat_pos,where) <= radius) @@ -3641,9 +3617,7 @@ bool pc_near(short pc_num,location where,short radius) else return false; } -/*short pc_there(where) -location where; -{ +/*short pc_there(location where) { short i; for(i = 0; i < 6; i++) @@ -3652,28 +3626,25 @@ location where; return 6; } */ -bool monst_near(short m_num,location where,short radius,short active) //short active; // 0 - any monst 1 - monster need be active -{ +bool monst_near(short m_num,location where,short radius,short active) { if((univ.town.monst[m_num].active != 0) && (vdist(univ.town.monst[m_num].cur_loc,where) <= radius) && ((active == 0) || (univ.town.monst[m_num].active == 2)) ) return true; else return false; } -void fireball_space(location loc,short dam) -{ +void fireball_space(location loc,short dam) { place_spell_pattern(square,loc,DAMAGE_FIRE,dam,7); } -static void place_spell_pattern(effect_pat_type pat,location center,unsigned short type,short who_hit) //type; // 0 - take codes in pattern, OW make all nonzero this type // Types 0 - Null 1 - web 2 - fire barrier 3 - force barrier 4 - force wall 5 - fire wall // 6 - anti-magic field 7 - stink cloud 8 - ice wall 9 - blade wall 10 - quickfire // 11 - dispel 12 - sleep field // 50 + i - 80 : id6 fire damage 90 + i - 120 : id6 cold damage 130 + i - 160 : id6 magic dam. // if prep for anim is true, supporess look checks and go fast -{ +static void place_spell_pattern(effect_pat_type pat,location center,unsigned short type,short who_hit) { short i,j,r1,k = 0; unsigned short effect; location spot_hit; @@ -3955,8 +3926,7 @@ static void place_spell_pattern(effect_pat_type pat,location center,unsigned sho } } } -void handle_item_spell(location loc,short num) -{ +void handle_item_spell(location loc,short num) { // TODO: This function is currently unused switch(num) { case 82: // Pyhrrus @@ -3994,8 +3964,7 @@ void place_spell_pattern(effect_pat_type pat,location center,eDamageType type,sh place_spell_pattern(pat, center, code + dice, who_hit); } -void modify_pattern(effect_pat_type *pat,unsigned short type) -{ +void modify_pattern(effect_pat_type *pat,unsigned short type) { short i,j; for(i = 0; i < 9; i++) @@ -4004,8 +3973,7 @@ void modify_pattern(effect_pat_type *pat,unsigned short type) pat->pattern[i][j] = type; } -void do_shockwave(location target) -{ +void do_shockwave(location target) { short i; start_missile_anim(); @@ -4023,8 +3991,7 @@ void do_shockwave(location target) handle_marked_damage(); } -void radius_damage(location target,short radius, short dam, eDamageType type)//// -{ +void radius_damage(location target,short radius, short dam, eDamageType type) { short i; if(is_town()) { @@ -4055,8 +4022,7 @@ void radius_damage(location target,short radius, short dam, eDamageType type)/// handle_marked_damage(); } // Slightly kludgy way to only damage PCs in space) -void hit_pcs_in_space(location target,short dam,eDamageType type,short report,short hit_all) -{ +void hit_pcs_in_space(location target,short dam,eDamageType type,short report,short hit_all) { // TODO: Looks like this no longer does what it claims. //short store_active[T_M],i; @@ -4069,12 +4035,11 @@ void hit_pcs_in_space(location target,short dam,eDamageType type,short report,sh // univ.town.monst[i].active = store_active[i]; } -void hit_space(location target,short dam,eDamageType type,short report,short hit_all) //type; // 0 - weapon 1 - fire 2 - poison 3 - general magic 4 - unblockable 5 - cold // 6 - demon 7 - undead //short report; // 0 - no 1 - print result //hit_all; // 0 - nail top thing 1 - hit all in space + 10 ... no monsters -{ +void hit_space(location target,short dam,eDamageType type,short report,short hit_all) { short i; bool stop_hitting = false,hit_monsters = true; @@ -4128,8 +4093,7 @@ void hit_space(location target,short dam,eDamageType type,short report,short hit -void do_poison() -{ +void do_poison() { short i,r1 = 0; bool some_poison = false; @@ -4158,8 +4122,7 @@ void do_poison() } -void handle_disease() -{ +void handle_disease() { short i,r1 = 0; bool disease = false; @@ -4206,8 +4169,7 @@ void handle_disease() } } -void handle_acid() -{ +void handle_acid() { short i,r1 = 0; bool some_acid = false; @@ -4230,8 +4192,7 @@ void handle_acid() } } -bool no_pcs_left() -{ +bool no_pcs_left() { short i = 0; while(i < 6) { @@ -4243,8 +4204,7 @@ bool no_pcs_left() } -bool hit_end_c_button() -{ +bool hit_end_c_button() { bool end_ok = true; if(which_combat_type == 0) { @@ -4262,8 +4222,7 @@ bool hit_end_c_button() return end_ok; } -bool out_monst_all_dead() -{ +bool out_monst_all_dead() { short i; for(i = 0; i < univ.town->max_monst(); i++) @@ -4275,8 +4234,7 @@ bool out_monst_all_dead() return true; } -void end_combat() -{ +void end_combat() { short i; for(i = 0; i < 6; i++) { @@ -4298,8 +4256,7 @@ void end_combat() } -bool combat_cast_mage_spell() -{ +bool combat_cast_mage_spell() { short target,i,store_sp,bonus = 1,r1,store_sound = 0,store_m_type = 0,num_opp = 0; eSpell spell_num; char c_line[60]; @@ -4496,8 +4453,7 @@ bool combat_cast_mage_spell() } -bool combat_cast_priest_spell() -{ +bool combat_cast_priest_spell() { short target,i,store_sp,bonus,store_sound = 0,store_m_type = 0,num_opp = 0; eSpell spell_num; char c_line[60]; @@ -4654,8 +4610,7 @@ bool combat_cast_priest_spell() else return true; } -void start_spell_targeting(eSpell num, bool freebie) -{ +void start_spell_targeting(eSpell num, bool freebie) { // First, remember what spell was cast. spell_being_cast = num; @@ -4694,8 +4649,7 @@ void start_spell_targeting(eSpell num, bool freebie) } } -void start_fancy_spell_targeting(eSpell num, bool freebie) -{ +void start_fancy_spell_targeting(eSpell num, bool freebie) { short i; location null_loc(120,0); @@ -4752,8 +4706,7 @@ void start_fancy_spell_targeting(eSpell num, bool freebie) num_targets_left = minmax(1,8,num_targets_left); } -void spell_cast_hit_return() -{ +void spell_cast_hit_return() { if(force_wall_position < 10) { force_wall_position = (force_wall_position + 1) % 8; @@ -4788,8 +4741,7 @@ static void process_force_cage(location loc, short i) { } } -void process_fields() -{ +void process_fields() { short i,j,k,r1; location loc; char qf[64][64]; @@ -4911,8 +4863,7 @@ void process_fields() monsters_going = false; } -void scloud_space(short m,short n) -{ +void scloud_space(short m,short n) { // TODO: Is it correct for these to not affect monsters? location target; //cPopulation::cCreature; @@ -4937,8 +4888,7 @@ void scloud_space(short m,short n) } } -void web_space(short m,short n) -{ +void web_space(short m,short n) { location target; short i; @@ -4959,8 +4909,7 @@ void web_space(short m,short n) web_pc(i,3); } } -void sleep_cloud_space(short m,short n) -{ +void sleep_cloud_space(short m,short n) { location target; short i; @@ -4983,13 +4932,11 @@ void sleep_cloud_space(short m,short n) } -void take_m_ap(short num,cCreature *monst) -{ +void take_m_ap(short num,cCreature *monst) { monst->ap = max(0,monst->ap - num); } -void add_new_action(short pc_num) -{ +void add_new_action(short pc_num) { if(pc_num < 6) univ.party[pc_num].ap++; } diff --git a/osx/boe.dlgutil.cpp b/osx/boe.dlgutil.cpp index 740e71c6..be0c6072 100644 --- a/osx/boe.dlgutil.cpp +++ b/osx/boe.dlgutil.cpp @@ -129,8 +129,7 @@ shop_type: 11 - priest spells 12 alchemy */ -void start_shop_mode(short shop_type,short shop_min,short shop_max,short cost_adj,const char* store_name) -{ +void start_shop_mode(short shop_type,short shop_min,short shop_max,short cost_adj,const char* store_name) { RECT area_rect; // This would be a place to hide the text box, if I add it. @@ -172,8 +171,7 @@ static void update_last_talk(int new_node) { } } -void end_shop_mode() -{ +void end_shop_mode() { RECT dummy_rect = {0,0,0,0}; // This would be a place to show the text box, if I add it (and if this is not an outdoor shop). @@ -200,8 +198,7 @@ void end_shop_mode() redraw_screen(REFRESH_TERRAIN | REFRESH_BAR); } -void handle_shop_event(location p) -{ +void handle_shop_event(location p) { short i,store_what_picked; p.x -= 5; @@ -233,8 +230,7 @@ void handle_shop_event(location p) } } -void handle_sale(short what_chosen,short cost) -{ +void handle_sale(short what_chosen,short cost) { cItemRec base_item; short what_magic_shop,what_magic_shop_item,i; RECT dummy_rect = {0,0,0,0}; @@ -372,8 +368,7 @@ void handle_sale(short what_chosen,short cost) } -void handle_info_request(short what_chosen) -{ +void handle_info_request(short what_chosen) { cItemRec base_item; short what_magic_shop,what_magic_shop_item; @@ -405,8 +400,7 @@ void handle_info_request(short what_chosen) } } -void set_up_shop_array() -{ +void set_up_shop_array() { short i,shop_pos = 0; bool cursed_item = false; cItemRec store_i; @@ -529,8 +523,7 @@ void set_up_shop_array() shop_sbar->setMaximum(i); } -void start_talk_mode(short m_num,short personality,m_num_t monst_type,short store_face_pic)//// -{ +void start_talk_mode(short m_num,short personality,m_num_t monst_type,short store_face_pic) { RECT area_rect; std::string place_string1; @@ -571,8 +564,7 @@ void start_talk_mode(short m_num,short personality,m_num_t monst_type,short stor } -void end_talk_mode() -{ +void end_talk_mode() { // This would be where to hide the text box, if I add it. overall_mode = store_pre_talk_mode; if(overall_mode == MODE_TALK_TOWN) @@ -589,8 +581,7 @@ void end_talk_mode() redraw_screen(REFRESH_TERRAIN | REFRESH_BAR); } -void handle_talk_event(location p) -{ +void handle_talk_event(location p) { short i,get_pc,s1 = -1,s2 = -1,s3 = -1; char asked[4]; std::string place_string1, place_string2; @@ -1001,15 +992,13 @@ void handle_talk_event(location p) place_talk_str(place_string1,place_string2,0,dummy_rect); } -void store_responses() -{ +void store_responses() { } -void do_sign(short town_num, short which_sign, short sign_type) //town_num; // Will be 0 - 200 for town, 200 - 290 for outdoors //short sign_type; // terrain type -{ +void do_sign(short town_num, short which_sign, short sign_type) { char sign_text[256]; location view_loc; @@ -1088,8 +1077,7 @@ void save_prefs(bool resetHelp){ } } -static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) -{ +static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) { // TODO: I should no longer need done_yet as this now only handles the okay and cancel buttons; the LEDs are now handled automatically by the cLed class (and the cLedGroup class, for LED groups). bool done_yet = false,did_cancel = false,reset_help = false; short i; @@ -1153,8 +1141,7 @@ static bool prefs_event_filter (cDialog& me, std::string id, eKeyMod) return true; } -void pick_preferences() -{ +void pick_preferences() { make_cursor_sword(); cDialog prefsDlog("preferences.xml"); @@ -1221,8 +1208,7 @@ void pick_preferences() changed_display_mode = true; } -static void put_party_stats(cDialog& me) -{ +static void put_party_stats(cDialog& me) { short i; @@ -1250,8 +1236,7 @@ static void put_party_stats(cDialog& me) draw_startup(0); } -static bool edit_party_event_filter(cDialog& me, std::string item_hit, eKeyMod) -{ +static bool edit_party_event_filter(cDialog& me, std::string item_hit, eKeyMod) { if(item_hit == "done") { me.toast(true); } else if(item_hit == "help") { @@ -1301,8 +1286,7 @@ static bool edit_party_event_filter(cDialog& me, std::string item_hit, eKeyMod) } extern bool pc_gworld_loaded; -void edit_party() -{ +void edit_party() { bool munch_pc_graphic = false; make_cursor_sword(); @@ -1340,8 +1324,7 @@ void edit_party() } -static bool tip_of_day_event_filter(cDialog& me, std::string item_hit, eKeyMod) -{ +static bool tip_of_day_event_filter(cDialog& me, std::string item_hit, eKeyMod) { std::string place_str; if(item_hit == "done") { @@ -1356,8 +1339,7 @@ static bool tip_of_day_event_filter(cDialog& me, std::string item_hit, eKeyMod) return true; } -void tip_of_day() -{ +void tip_of_day() { std::string place_str; store_tip_page_on = get_ran(1,0,NUM_HINTS - 1); @@ -1379,8 +1361,7 @@ void tip_of_day() } -static void put_scen_info(cDialog& me) -{ +static void put_scen_info(cDialog& me) { unsigned int i; std::ostringstream sout; const char *ratings[] = {"G","PG","R","NC-17"}; @@ -1414,8 +1395,7 @@ static void put_scen_info(cDialog& me) } } -static static bool pick_a_scen_event_filter(cDialog& me, std::string item_hit, eKeyMod) -{ +static static bool pick_a_scen_event_filter(cDialog& me, std::string item_hit, eKeyMod) { if(item_hit == "cancel") { me.setResult(-1); me.toast(false); @@ -1437,8 +1417,7 @@ static static bool pick_a_scen_event_filter(cDialog& me, std::string item_hit, e return true; } -short pick_a_scen() -{ +short pick_a_scen() { build_scen_headers(); @@ -1468,8 +1447,7 @@ short pick_a_scen() return pickScen.getResult(); } -short pick_prefab_scen() -{ +short pick_prefab_scen() { make_cursor_sword(); diff --git a/osx/boe.fileio.cpp b/osx/boe.fileio.cpp index 71fb20c2..aaea1196 100644 --- a/osx/boe.fileio.cpp +++ b/osx/boe.fileio.cpp @@ -245,8 +245,7 @@ void init_town(){ // formerly part of load_town } -void shift_universe_left() -{ +void shift_universe_left() { short i,j; make_cursor_watch(); @@ -282,8 +281,7 @@ void shift_universe_left() } -void shift_universe_right() -{ +void shift_universe_right() { short i,j; make_cursor_watch(); @@ -316,8 +314,7 @@ void shift_universe_right() } -void shift_universe_up() -{ +void shift_universe_up() { short i,j; make_cursor_watch(); @@ -351,8 +348,7 @@ void shift_universe_up() } -void shift_universe_down() -{ +void shift_universe_down() { short i,j; make_cursor_watch(); @@ -388,8 +384,7 @@ void shift_universe_down() } -void position_party(short out_x,short out_y,short pc_pos_x,short pc_pos_y) //// -{ +void position_party(short out_x,short out_y,short pc_pos_x,short pc_pos_y) { short i,j; if((pc_pos_x != minmax(0,47,pc_pos_x)) || (pc_pos_y != minmax(0,47,pc_pos_y)) || @@ -422,8 +417,7 @@ void position_party(short out_x,short out_y,short pc_pos_x,short pc_pos_y) //// } -void build_outdoors() -{ +void build_outdoors() { short i,j; for(i = 0; i < 48; i++) for(j = 0; j < 48; j++) { @@ -448,8 +442,7 @@ void build_outdoors() } -short onm(char x_sector,char y_sector) -{ +short onm(char x_sector,char y_sector) { short i; i = y_sector * scenario.out_width + x_sector; @@ -459,8 +452,7 @@ short onm(char x_sector,char y_sector) // This adds the current outdoor map info to the saved outdoor map info -void save_outdoor_maps() -{ +void save_outdoor_maps() { short i,j; for(i = 0; i < 48; i++) @@ -491,9 +483,7 @@ void save_outdoor_maps() } } -void add_outdoor_maps() // This takes the existing outdoor map info and supplements it -// with the saved map info -{ +void add_outdoor_maps() { // This takes the existing outdoor map info and supplements it with the saved map info short i,j; for(i = 0; i < 48; i++) @@ -526,8 +516,7 @@ void add_outdoor_maps() // This takes the existing outdoor map info and supplem -void fix_boats() -{ +void fix_boats() { short i; for(i = 0; i < 30; i++) @@ -581,8 +570,7 @@ void start_data_dump() { } } -void build_scen_headers() -{ +void build_scen_headers() { fs::path scenDir = progDir; scenDir /= "Blades of Exile Scenarios"; printf("%s\n%s\n",progDir.c_str(),scenDir.c_str()); diff --git a/osx/boe.graphics.cpp b/osx/boe.graphics.cpp index 12568367..0eeac47d 100644 --- a/osx/boe.graphics.cpp +++ b/osx/boe.graphics.cpp @@ -163,8 +163,7 @@ bool supressing_some_spaces = false; location ok_space[4] = {loc(),loc(),loc(),loc()}; sf::Image hold_pict; -void adjust_window_mode() -{ +void adjust_window_mode() { RECT r; sf::ContextSettings winSettings; winSettings.stencilBits = 1; @@ -199,8 +198,7 @@ void adjust_window_mode() } // TODO: Move to boe.startup.cpp -void plop_fancy_startup() -{ +void plop_fancy_startup() { sf::Texture pict_to_draw; sf::Event event; short i,j; @@ -270,23 +268,19 @@ void plop_fancy_startup() } } -void init_startup() -{ +void init_startup() { startup_loaded = true; startup_gworld.loadFromImage(*ResMgr::get("startup")); startup_button_orig.loadFromImage(*ResMgr::get("startbut")); anim_mess.loadFromImage(*ResMgr::get("startanim")); } -void init_animation() -{} +void init_animation() {} -void next_animation_step() -{} +void next_animation_step() {} -void draw_startup(short but_type) -{ +void draw_startup(short but_type) { RECT to_rect; RECT r1 = {-1000,-1000,5,1000},r2 = {-1000,-1000,1000,5},r3 = {418,-1000,2000,1000}, r4 = {-1000,579,1000,2500}; @@ -311,8 +305,7 @@ void draw_startup(short but_type) draw_startup_stats(); } -void draw_startup_anim(bool advance) -{ +void draw_startup_anim(bool advance) { static short startup_anim_pos = 43; // was a global variable, but since it's only used in this function I moved it here RECT anim_to = {4,1,44,276},anim_from; RECT anim_size = {0,0,48,301}; @@ -325,8 +318,7 @@ void draw_startup_anim(bool advance) rect_draw_some_item(anim_mess,anim_from,anim_to,ul,sf::BlendAlpha); } -void draw_startup_stats() -{ +void draw_startup_stats() { RECT from_rect,to_rect,party_to = {0,0,36,28},pc_rect,frame_rect; short i; char str[256]; @@ -438,8 +430,7 @@ void draw_startup_stats() -void draw_start_button(short which_position,short which_button) -{ +void draw_start_button(short which_position,short which_button) { RECT from_rect,to_rect; // TODO: Change third button (Windows calls it "Support and Downloads") const char *button_labels[] = {"Load Game","Make New Party","How To Order", @@ -473,8 +464,7 @@ void draw_start_button(short which_position,short which_button) win_draw_string(mainPtr,to_rect,button_labels[which_position],eTextMode::CENTRE,style,ul); } -void main_button_click(RECT button_rect) -{ +void main_button_click(RECT button_rect) { button_rect.offset(ul); mainPtr.setActive(); clip_rect(mainPtr, button_rect); @@ -489,8 +479,7 @@ void main_button_click(RECT button_rect) undo_clip(mainPtr); } -void arrow_button_click(RECT button_rect) -{ +void arrow_button_click(RECT button_rect) { button_rect.offset(ul); mainPtr.setActive(); clip_rect(mainPtr, button_rect); @@ -506,8 +495,7 @@ void arrow_button_click(RECT button_rect) } -void reload_startup()//// -{ +void reload_startup() { if(startup_loaded) return; @@ -520,8 +508,7 @@ void reload_startup()//// //load_main_screen(); } -void end_startup() -{ +void end_startup() { if(!startup_loaded) return; @@ -542,8 +529,7 @@ static void loadImageToRenderTexture(sf::RenderTexture& tex, std::string imgName } // This loads the graphics at the top of the game. -void Set_up_win () -{ +void Set_up_win () { RECT temp_rect = {0,0,0,280},map_world_rect; RECT map_rect = {0,0,384,384}; RECT pc_rect = {0,0,216,113}; @@ -564,8 +550,7 @@ void Set_up_win () } -void load_main_screen() -{ +void load_main_screen() { if(invenbtn_gworld.getSize().x > 0) return; @@ -620,8 +605,7 @@ void redraw_screen(int refresh) { } } -void put_background() -{ +void put_background() { tessel_ref_t bg_pict; if(overall_mode == MODE_STARTUP) @@ -649,9 +633,8 @@ void put_background() tileImage(mainPtr, RECT(mainPtr), bg_pict); } -void draw_buttons(short mode) //mode; // 0 - regular 1 - button action -{ +void draw_buttons(short mode) { RECT source_rect = {0,0,37,258}, dest_rec; bool spec_draw = false; if(mode == 1) { @@ -677,15 +660,13 @@ void draw_buttons(short mode) rect_draw_some_item(buttons_gworld, source_rect, mainPtr, dest_rec, sf::BlendAdd); } -void reset_text_bar() -{ +void reset_text_bar() { remember_tiny_text = 300; } -void draw_text_bar(short mode) //short mode; // 0 - no redraw 1 - forced -{ +void draw_text_bar(short mode) { //short num_rect[3] = {12,10,4}; // Why? Just... why? short i; location loc; @@ -793,8 +774,7 @@ void refresh_text_bar() { // this is used for determinign whether to round off walkway corners // right now, trying a restrictive rule (just cave floor and grass, mainly) -bool is_nature(char x, char y, unsigned char ground_t) -{ +bool is_nature(char x, char y, unsigned char ground_t) { ter_num_t ter_type; ter_type = coord_to_ter((short) x,(short) y); @@ -814,10 +794,9 @@ ter_num_t get_ter_from_ground(unsigned char ground){ std::vector forcecage_locs; -void draw_terrain(short mode) //mode ... if 1, don't place on screen after redoing // if 2, only redraw over active monst -{ +void draw_terrain(short mode) { char q,r; location where_draw; location sector_p_in,view_loc; @@ -1063,8 +1042,7 @@ static ter_num_t get_ground_for_shore(ter_num_t ter){ else return ter; } -void place_trim(short q,short r,location where,ter_num_t ter_type) -{ +void place_trim(short q,short r,location where,ter_num_t ter_type) { bool at_top = false,at_bot = false,at_left = false,at_right = false; location targ; @@ -1189,10 +1167,9 @@ void place_trim(short q,short r,location where,ter_num_t ter_type) } } -void draw_trim(short q,short r,short which_trim,ter_num_t ground_ter) //which_trim is 3 -> drawing wall trim -> might shift down if ground is grass //short which_mode; // 0 top 1 bottom 2 left 3 right 4 up left 5 up right 6 down right 7 down left -{ +void draw_trim(short q,short r,short which_trim,ter_num_t ground_ter) { /* TODO: Windows has a check for frills being enabled: if(!frills_on || (((current_ground == 2) || (current_ground == 36)) && (PSD[SDF_COMPATIBILITY_FULL_TRIMS] == 0))) return; @@ -1294,8 +1271,7 @@ void draw_trim(short q,short r,short which_trim,ter_num_t ground_ter) } -bool extend_road_terrain(ter_num_t ter) -{ +bool extend_road_terrain(ter_num_t ter) { eTrimType trim = scenario.ter_types[ter].trim_type; eTerSpec spec = scenario.ter_types[ter].special; ter_num_t flag = scenario.ter_types[ter].flag1.u; @@ -1360,8 +1336,7 @@ static bool connect_roads(ter_num_t ter){ return false; } -void place_road(short q,short r,location where, bool here) -{ +void place_road(short q,short r,location where, bool here) { location draw_loc; ter_num_t ter; RECT to_rect; @@ -1479,8 +1454,7 @@ void place_road(short q,short r,location where, bool here) } } -void draw_rest_screen() -{ +void draw_rest_screen() { eGameMode store_mode; store_mode = overall_mode; @@ -1489,13 +1463,12 @@ void draw_rest_screen() overall_mode = store_mode ; } -void boom_space(location where,short mode,short type,short damage,short sound) // if mode is 100, force //short type; // 0 - flame 1 - magic 2 - poison 3 - blood 4 - cold // 10s digit indicates sound 0 - normal ouch 1 - small sword 2 - loud sword // 3 - pole 4 - club 5 - fireball hit 6 - squish 7 - cold // 8 - acid 9 - claw 10 - bite 11 - slime 12 - zap 13 - missile hit -{ +void boom_space(location where,short mode,short type,short damage,short sound) { location where_draw(4,4); RECT source_rect = {0,0,36,28},text_rect,dest_rect = {13,13,49,41},big_to = {13,13,337,265},store_rect; short del_len; @@ -1590,8 +1563,7 @@ void boom_space(location where,short mode,short type,short damage,short sound) } -void draw_pointing_arrows() -{ +void draw_pointing_arrows() { // TODO: The duplication of RECT here shouldn't be necessary... RECT sources[4] = { RECT{352,28,360,36}, // up @@ -1612,8 +1584,7 @@ void draw_pointing_arrows() } } -void redraw_terrain() -{ +void redraw_terrain() { RECT to_rect; to_rect = win_to_rects[0]; @@ -1628,8 +1599,7 @@ void redraw_terrain() } -void draw_targets(location center) -{ +void draw_targets(location center) { RECT source_rect = {74,36,85,47},dest_rect; short i = 0; @@ -1645,9 +1615,8 @@ void draw_targets(location center) } } -void frame_space(location where,short mode,short width,short height) //mode; // 0 - red 1 - green -{ +void frame_space(location where,short mode,short width,short height) { location where_put; RECT to_frame; @@ -1667,8 +1636,7 @@ void frame_space(location where,short mode,short width,short height) } -void erase_spot(short i,short j) -{ +void erase_spot(short i,short j) { RECT to_erase; to_erase = coord_to_rect(i,j); @@ -1676,8 +1644,7 @@ void erase_spot(short i,short j) } -void draw_targeting_line(location where_curs) -{ +void draw_targeting_line(location where_curs) { location which_space,store_loc; short i,j,k,l; RECT redraw_rect,redraw_rect2,terrain_rect = {0,0,351,279},target_rect; @@ -1755,8 +1722,7 @@ void draw_targeting_line(location where_curs) } -bool party_toast() -{ +bool party_toast() { short i; for(i = 0; i < 6; i++) @@ -1765,8 +1731,7 @@ bool party_toast() return true; } -void redraw_partial_terrain(RECT redraw_rect) -{ +void redraw_partial_terrain(RECT redraw_rect) { RECT from_rect; from_rect = redraw_rect; @@ -1780,8 +1745,7 @@ void redraw_partial_terrain(RECT redraw_rect) } /* -void HideShowMenuBar( ) -{ +void HideShowMenuBar( ) { GDHandle mainScreen; // store current gray region that displays diff --git a/osx/boe.graphutil.cpp b/osx/boe.graphutil.cpp index 849f818c..2ba2f8bc 100644 --- a/osx/boe.graphutil.cpp +++ b/osx/boe.graphutil.cpp @@ -79,11 +79,10 @@ RECT boat_rects[4] = {RECT{0,0,36,28}, RECT{0,28,36,56},RECT{0,56,36,84},RECT{0, bool gave_no_g_error = false; eAmbientSound ambient_sound; -void draw_one_terrain_spot (short i,short j,short terrain_to_draw) //// //short dest; // 0 - terrain gworld 1 - screen // if terrain_to_draw is -1, do black // if terrain_to_draw >= 10000, force to draw graphic which is terrain_to_draw - 10000 -{ +void draw_one_terrain_spot (short i,short j,short terrain_to_draw) { RECT where_draw; RECT source_rect; sf::Texture* source_gworld; @@ -142,8 +141,7 @@ void draw_one_terrain_spot (short i,short j,short terrain_to_draw) //// anim_type = -1; } - if(anim_type >= 0) - { + if(anim_type >= 0) { if((is_town()) || (is_out())) anim_onscreen = true; } @@ -151,8 +149,7 @@ void draw_one_terrain_spot (short i,short j,short terrain_to_draw) //// rect_draw_some_item(*source_gworld, source_rect, terrain_screen_gworld, where_draw); } -void draw_monsters() //// -{ +void draw_monsters() { short i,j = 0,k; short width,height; RECT source_rect,to_rect; @@ -327,9 +324,8 @@ void play_see_monster_str(unsigned short m, location monst_loc) { } } -void draw_pcs(location center,short mode) //short mode; // 0 - put pcs in gworld 1 - only rectangle around active pc -{ +void draw_pcs(location center,short mode) { short i; RECT source_rect,active_pc_rect; location where_draw; @@ -411,8 +407,7 @@ void draw_items(location where){ } } -void draw_outd_boats(location center) -{ +void draw_outd_boats(location center) { location where_draw; RECT source_rect; short i; @@ -441,8 +436,7 @@ void draw_outd_boats(location center) } } -void draw_town_boat(location center) -{ +void draw_town_boat(location center) { location where_draw; RECT source_rect; short i; @@ -578,9 +572,8 @@ void draw_party_symbol(location center) { // Give the position of the monster graphic in the picture resource // Will store monsters the same in Exile's II and III -RECT get_monster_rect (unsigned short type_wanted,short mode) //// //short mode; // 0 - left 1 - right 2 - both -{ +RECT get_monster_rect (unsigned short type_wanted,short mode) { RECT store_rect; short i; @@ -595,9 +588,8 @@ RECT get_monster_rect (unsigned short type_wanted,short mode) //// } // Give the position of the monster graphic in the template in memory -RECT get_monster_template_rect (pic_num_t picture_wanted,short mode,short which_part) //// //mode; // 0 - left 1 - right +10 - combat mode -{ +RECT get_monster_template_rect (pic_num_t picture_wanted,short mode,short which_part) { RECT store_rect = {0,0,36,28}; short adj = 0; @@ -613,8 +605,7 @@ RECT get_monster_template_rect (pic_num_t picture_wanted,short mode,short which_ // Returns rect for drawing an item, if num < 25, rect is in big item template, // otherwise in small item template -RECT get_item_template_rect (short type_wanted)//// -{ +RECT get_item_template_rect (short type_wanted) { RECT store_rect; if(type_wanted < 45) { @@ -634,8 +625,7 @@ RECT get_item_template_rect (short type_wanted)//// } // Is this a fluid that gets shore plopped down on it? -bool is_fluid(ter_num_t ter_type)//// -{ +bool is_fluid(ter_num_t ter_type) { // if(((ter_type >= 71) && (ter_type <= 76)) || (ter_type == 90)) // return true; // return false; @@ -643,8 +633,7 @@ bool is_fluid(ter_num_t ter_type)//// } // Is this a beach that gets shore plopped down next to it? -bool is_shore(ter_num_t ter_type)//// -{ +bool is_shore(ter_num_t ter_type) { if(is_fluid(ter_type)) return false; if(scenario.ter_types[ter_type].trim_type == eTrimType::WATERFALL) @@ -663,8 +652,7 @@ bool is_shore(ter_num_t ter_type)//// } // These two functions used to determine wall round-cornering -bool is_wall(ter_num_t ter_type)//// -{ +bool is_wall(ter_num_t ter_type) { return scenario.ter_types[ter_type].trim_type == eTrimType::WALL; // short pic; // @@ -675,8 +663,7 @@ bool is_wall(ter_num_t ter_type)//// // // return false; } -bool is_ground(ter_num_t ter_type) -{ +bool is_ground(ter_num_t ter_type) { if(scenario.ter_types[ter_type].trim_type == eTrimType::WALL) return false; if(scenario.ter_types[ter_type].block_horse) @@ -686,8 +673,7 @@ bool is_ground(ter_num_t ter_type) return true; } -char get_fluid_trim(location where,ter_num_t ter_type) -{ +char get_fluid_trim(location where,ter_num_t ter_type) { bool at_top = false,at_bot = false,at_left = false,at_right = false; ter_num_t store; char to_return = 0; diff --git a/osx/boe.infodlg.cpp b/osx/boe.infodlg.cpp index b80ee56e..4a5c24cc 100644 --- a/osx/boe.infodlg.cpp +++ b/osx/boe.infodlg.cpp @@ -113,9 +113,8 @@ static bool display_spells_event_filter(cDialog& me, std::string item_hit, eSkil } return true; } -void display_spells(eSkill mode,short force_spell,cDialog* parent) //short force_spell; // if 100, ignore -{ +void display_spells(eSkill mode,short force_spell,cDialog* parent) { using namespace std::placeholders; if(force_spell < 100) { if(mode == eSkill::MAGE_SPELLS) @@ -137,8 +136,7 @@ void display_spells(eSkill mode,short force_spell,cDialog* parent) spellInfo.run(); } -static void put_skill_info(cDialog& me) -{ +static void put_skill_info(cDialog& me) { std::string store_text; short pos; @@ -172,8 +170,7 @@ static bool display_skills_event_filter(cDialog& me, std::string item_hit, eKeyM return true; } -void display_skills(eSkill force_skill,cDialog* parent) -{ +void display_skills(eSkill force_skill,cDialog* parent) { if(force_skill != eSkill::INVALID) skill_pos = int(force_skill); if(skill_pos < 0) @@ -324,8 +321,7 @@ static bool display_pc_item_event_filter(cDialog& me, std::string item_hit, cIte return true; } -void display_pc_item(short pc_num,short item,cItemRec si,cDialog* parent) -{ +void display_pc_item(short pc_num,short item,cItemRec si,cDialog* parent) { using namespace std::placeholders; cItemRec store_i; if(pc_num == 6) @@ -363,8 +359,7 @@ void display_pc_item(short pc_num,short item,cItemRec si,cDialog* parent) } -static void put_monst_info(cDialog& me, const cCreature& store_m) -{ +static void put_monst_info(cDialog& me, const cCreature& store_m) { std::string store_text; std::string str; short abil,i; @@ -467,10 +462,9 @@ static bool display_monst_event_filter(cDialog& me, std::string item_hit, cCreat return true; } -void display_monst(short array_pos,cCreature *which_m,short mode) //creature_data_type *which_m; // if NULL, show full roster //short mode; // if 1, full roster, else use monster from store_m -{ +void display_monst(short array_pos,cCreature *which_m,short mode) { using namespace std::placeholders; position = array_pos; full_roster = false; @@ -546,8 +540,7 @@ static bool display_alchemy_event_filter(cDialog& me, std::string item_hit, eKey return true; } -void display_alchemy() -{ +void display_alchemy() { std::string get_text; cur_entry = 3; @@ -684,8 +677,7 @@ static bool give_pc_extra_info(cDialog& me, std::string item_hit, const short pc return true; } -void give_pc_info(short pc_num) -{ +void give_pc_info(short pc_num) { using namespace std::placeholders; short i; std::string str; @@ -706,8 +698,7 @@ void give_pc_info(short pc_num) pcInfo.run(); } -static bool adventure_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod) -{ +static bool adventure_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod) { unsigned short i; std::string place_str; char temp_str[256]; @@ -780,8 +771,7 @@ static bool adventure_notes_event_filter(cDialog& me, std::string item_hit, eKey return true; } -void adventure_notes() -{ +void adventure_notes() { unsigned short i; char place_str[256]; @@ -829,8 +819,7 @@ void adventure_notes() encNotes.run(); } -static void put_talk(cDialog& me) -{ +static void put_talk(cDialog& me) { short personality; char place_str[256]; @@ -887,8 +876,7 @@ static bool talk_notes_event_filter(cDialog& me, std::string item_hit, eKeyMod) return true; } -void talk_notes() -{ +void talk_notes() { short i; @@ -946,8 +934,7 @@ static bool journal_event_filter(cDialog& me, std::string item_hit, eKeyMod) { return true; } -void journal() -{ +void journal() { unsigned short i; char place_str[256]; @@ -979,15 +966,13 @@ void journal() journal.run(); } -void add_to_journal(short event) -{ +void add_to_journal(short event) { if(univ.party.add_to_journal(event, calc_day())) ASB("Something was added to your journal."); } // Call call this anywhere, but don't forget parent!!! -static void give_help(short help1,short help2,cDialog* parent) -{ +static void give_help(short help1,short help2,cDialog* parent) { bool help_forced = false; std::string str1,str2; @@ -1018,8 +1003,7 @@ void give_help(short help1, short help2, cDialog& parent) { give_help(help1, help2, &parent); } -void put_spec_item_info (short which_i) -{ +void put_spec_item_info (short which_i) { cStrDlog display_strings(scenario.scen_strs(60 + 1 + which_i * 2),"", scenario.scen_strs(60 + which_i * 2),scenario.intro_pic,PIC_SCEN); display_strings.setSound(57); diff --git a/osx/boe.itemdata.cpp b/osx/boe.itemdata.cpp index 5952b7c6..83259691 100644 --- a/osx/boe.itemdata.cpp +++ b/osx/boe.itemdata.cpp @@ -28,8 +28,7 @@ short loot_max[5] = {3,8,40,800,4000}; -cItemRec get_stored_item(short which) -{ +cItemRec get_stored_item(short which) { cItemRec s_item; if((which >= 400) || (which < 0)) { @@ -41,8 +40,7 @@ cItemRec get_stored_item(short which) return s_item; } -cItemRec get_food() -{ +cItemRec get_food() { cItemRec food('food'); // {11,0, 0,0,0,0,0,0, 62,0,0,0,0, 0, 0,0, {0,0},"Food", "Food",0,0,0,0}; food.graphic_num += get_ran(1,0,2); @@ -107,31 +105,26 @@ cItemRec get_armor(short loot) { return armor; } -cItemRec get_helm(short loot) -{ +cItemRec get_helm(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::HELM); } -cItemRec get_gloves(short loot) -{ +cItemRec get_gloves(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::GLOVES); } -cItemRec get_boots(short loot) -{ +cItemRec get_boots(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::BOOTS); } -cItemRec get_shield(short loot) -{ +cItemRec get_shield(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::SHIELD); } -cItemRec get_potion(short loot) -{ +cItemRec get_potion(short loot) { cItemRec p; if(get_ran(1,0,80) < 20 * (4 - loot)) @@ -141,13 +134,11 @@ cItemRec get_potion(short loot) return p; } -cItemRec get_scroll(short loot) -{ +cItemRec get_scroll(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::SCROLL); } -cItemRec get_missile(short loot) -{ +cItemRec get_missile(short loot) { if(get_ran(1,0,2) < 2) return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::ARROW,eItemType::THROWN_MISSILE,eItemType::BOW); return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::CROSSBOW,eItemType::BOLTS,eItemType::MISSILE_NO_AMMO); @@ -158,18 +149,15 @@ cItemRec get_poison(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::WEAPON_POISON); } -cItemRec get_wand(short loot) -{ +cItemRec get_wand(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::WAND); } -cItemRec get_ring(short loot) -{ +cItemRec get_ring(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::RING); } -cItemRec get_necklace(short loot) -{ +cItemRec get_necklace(short loot) { return pull_item_of_type(loot,loot_min[loot],loot_max[loot],eItemType::NECKLACE); } diff --git a/osx/boe.items.cpp b/osx/boe.items.cpp index 73b4344d..3c1ae8b7 100644 --- a/osx/boe.items.cpp +++ b/osx/boe.items.cpp @@ -69,8 +69,7 @@ std::map excluding_types = { short selected,item_max = 0; -void sort_pc_items(short pc_num) -{ +void sort_pc_items(short pc_num) { cItemRec store_item; using it = eItemType; static std::map item_priority = { @@ -116,8 +115,7 @@ bool give_to_party(cItemRec item, short print_result) { } //// -bool give_to_pc(short pc_num,cItemRec item,short print_result,bool allow_overload) -{ +bool give_to_pc(short pc_num,cItemRec item,short print_result,bool allow_overload) { short free_space; char announce_string[60]; @@ -169,9 +167,8 @@ bool give_to_pc(short pc_num,cItemRec item,short print_result,bool allow_overl } // TODO: Utilize the second parameter in special node processing -bool forced_give(short item_num,eItemAbil abil) //// // if abil > 0, force abil, else ignore -{ +bool forced_give(short item_num,eItemAbil abil) { short i,j; cItemRec item; char announce_string[60]; @@ -197,30 +194,26 @@ bool forced_give(short item_num,eItemAbil abil) //// return false; } -bool GTP(short item_num) -{ +bool GTP(short item_num) { cItemRec item; item = get_stored_item(item_num); return give_to_party(item,true); } -bool silent_GTP(short item_num) -{ +bool silent_GTP(short item_num) { cItemRec item; item = get_stored_item(item_num); return give_to_party(item,false); } -void give_gold(short amount,bool print_result)//// -{ +void give_gold(short amount,bool print_result) { if(amount < 0) return; univ.party.gold = univ.party.gold + amount; if(print_result) put_pc_screen(); } -bool take_gold(short amount,bool print_result) -{ +bool take_gold(short amount,bool print_result) { if(univ.party.gold < amount) return false; univ.party.gold = univ.party.gold - amount; @@ -304,13 +297,11 @@ bool party_check_class(unsigned int item_class,short mode) { } return false; } -short amount_pc_can_carry(short pc_num) -{ +short amount_pc_can_carry(short pc_num) { return 100 + (15 * min(univ.party[pc_num].skills[eSkill::STRENGTH],20)) + (univ.party[pc_num].traits[eTrait::STRENGTH] * 30) + (univ.party[pc_num].traits[eTrait::BAD_BACK] * -50); } -short pc_carry_weight(short pc_num) -{ +short pc_carry_weight(short pc_num) { short i,storage = 0; bool airy = false,heavy = false; @@ -331,16 +322,14 @@ short pc_carry_weight(short pc_num) return storage; } -void give_food(short amount,bool print_result)//// -{ +void give_food(short amount,bool print_result) { if(amount < 0) return; univ.party.food = univ.party.food + amount; if(print_result) put_pc_screen(); } -short take_food(short amount,bool print_result) -{ +short take_food(short amount,bool print_result) { short diff; diff = amount - univ.party.food; @@ -357,8 +346,7 @@ short take_food(short amount,bool print_result) return 0; } -short pc_has_space(short pc_num) -{ +short pc_has_space(short pc_num) { short i = 0; while(i < 24) { @@ -371,8 +359,7 @@ short pc_has_space(short pc_num) // returns 1 if OK, 2 if no room, 3 if not enough cash, 4 if too heavy, 5 if too many of item // Made specials cases for if item is gold or food -short pc_ok_to_buy(short pc_num,short cost,cItemRec item) //// -{ +short pc_ok_to_buy(short pc_num,short cost,cItemRec item) { short i; if(item.variety != eItemType::GOLD && item.variety != eItemType::FOOD) { @@ -395,9 +382,8 @@ short pc_ok_to_buy(short pc_num,short cost,cItemRec item) //// } -void take_item(short pc_num,short which_item) //short pc_num,which_item; // if which_item > 30, don't update stat win, item is which_item - 30 -{ +void take_item(short pc_num,short which_item) { short i; bool do_print = true; @@ -424,8 +410,7 @@ void take_item(short pc_num,short which_item) put_item_screen(stat_window,1); } -void remove_charge(short pc_num,short which_item) -{ +void remove_charge(short pc_num,short which_item) { if(univ.party[pc_num].items[which_item].charges > 0) { univ.party[pc_num].items[which_item].charges--; if(univ.party[pc_num].items[which_item].charges == 0) { @@ -438,8 +423,7 @@ void remove_charge(short pc_num,short which_item) } -void enchant_weapon(short pc_num,short item_hit,short enchant_type,short new_val) -{ +void enchant_weapon(short pc_num,short item_hit,short enchant_type,short new_val) { char store_name[60]; //// @@ -500,8 +484,7 @@ void enchant_weapon(short pc_num,short item_hit,short enchant_type,short new_val univ.party[pc_num].items[item_hit].full_name = store_name; } -void equip_item(short pc_num,short item_num) -{ +void equip_item(short pc_num,short item_num) { unsigned short num_equipped_of_this_type = 0; unsigned short num_hands_occupied = 0; short i; @@ -567,8 +550,7 @@ void equip_item(short pc_num,short item_num) } -void drop_item(short pc_num,short item_num,location where_drop) -{ +void drop_item(short pc_num,short item_num,location where_drop) { std::string choice; short how_many = 0; cItemRec item_store; @@ -624,8 +606,7 @@ void drop_item(short pc_num,short item_num,location where_drop) } } -bool place_item(cItemRec item,location where,bool forced) -{ +bool place_item(cItemRec item,location where,bool forced) { short i; for(i = 0; i < NUM_TOWN_ITEMS; i++) @@ -649,8 +630,7 @@ bool place_item(cItemRec item,location where,bool forced) return true; } -void destroy_an_item() -{ +void destroy_an_item() { short i; ASB("Too many items. Some item destroyed."); // for(i = 0; i < NUM_TOWN_ITEMS; i++) @@ -678,8 +658,7 @@ void destroy_an_item() } -void give_thing(short pc_num, short item_num) -{ +void give_thing(short pc_num, short item_num) { short who_to,how_many = 0; cItemRec item_store; bool take_given_item = true; @@ -720,8 +699,7 @@ void give_thing(short pc_num, short item_num) } } -void combine_things(short pc_num) -{ +void combine_things(short pc_num) { short i,j,test; for(i = 0; i < 24; i++) { @@ -751,8 +729,7 @@ void combine_things(short pc_num) } // Procedure only ready for town and outdoor -short dist_from_party(location where) -{ +short dist_from_party(location where) { short store = 1000, i; if((overall_mode >= MODE_COMBAT) && (overall_mode < MODE_TALKING)) { @@ -766,8 +743,7 @@ short dist_from_party(location where) } // TODO: I have no idea what is going on here, other than that it seems to have something to do items being picked up in town -void set_item_flag(cItemRec *item) -{ +void set_item_flag(cItemRec *item) { if((item->is_special > 0) && (item->is_special < 65)) { item->is_special--; univ.party.item_taken[univ.town.num][item->is_special / 8] = @@ -776,9 +752,8 @@ void set_item_flag(cItemRec *item) } } -short get_item(location place,short pc_num,bool check_container) //short pc_num; // if 6, any -{ +short get_item(location place,short pc_num,bool check_container) { short i,taken = 0; bool item_near = false; short mass_get = 1; @@ -824,8 +799,7 @@ short get_item(location place,short pc_num,bool check_container) } -void make_town_hostile() -{ +void make_town_hostile() { set_town_attitude(0, -1, 1); return; } @@ -882,8 +856,7 @@ void set_town_attitude(short lo,short hi,short att) { // TODO: Set town status to "dead"? Could reuse above with magic att (eg -1), or write new function. -static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& current_getting_pc, const std::vector& item_array) -{ +static void put_item_graphics(cDialog& me, size_t& first_item_shown, short& current_getting_pc, const std::vector& item_array) { short i,storage; cItemRec item; char message[256]; @@ -1044,10 +1017,9 @@ static bool display_item_event_filter(cDialog& me, std::string id, size_t& first bool pc_gworld_loaded = false; // Returns true is a theft committed -bool display_item(location from_loc,short pc_num,short mode, bool check_container) //pc_num; // < 6 - this pc only 6 - any pc //short mode; // 0 - adjacent 1 - all in sight -{ +bool display_item(location from_loc,short pc_num,short mode, bool check_container) { // short item_array[130]; std::vector item_array; short i; @@ -1119,14 +1091,12 @@ bool show_get_items(std::string titleText, std::vector& itemRefs, sho } -//void fancy_choice_dialog_event_filter (short item_hit) -//{ +//void fancy_choice_dialog_event_filter (short item_hit) { // toast_dialog(); // dialog_answer = item_hit; //} -short custom_choice_dialog(std::array& strs,short pic_num,ePicType pic_type,std::array& buttons) //// -{ +short custom_choice_dialog(std::array& strs,short pic_num,ePicType pic_type,std::array& buttons) { make_cursor_sword(); std::vector vec; @@ -1206,10 +1176,9 @@ static bool get_num_of_items_event_filter(cDialog& me, std::string, eKeyMod) { return true; } -short get_num_of_items(short max_num) //town_num; // Will be 0 - 200 for town, 200 - 290 for outdoors //short sign_type; // terrain type -{ +short get_num_of_items(short max_num) { char sign_text[256]; make_cursor_sword(); @@ -1234,14 +1203,12 @@ void init_mini_map() { makeFrontWindow(mainPtr); } -void make_cursor_watch() -{ +void make_cursor_watch() { set_cursor(watch_curs); } //// -void place_glands(location where,m_num_t m_type) -{ +void place_glands(location where,m_num_t m_type) { cItemRec store_i; cMonster monst; @@ -1253,8 +1220,7 @@ void place_glands(location where,m_num_t m_type) } } -short party_total_level() -{ +short party_total_level() { short i,j = 0; for(i = 0; i < 6; i++) @@ -1263,8 +1229,7 @@ short party_total_level() return j; } -void reset_item_max() -{ +void reset_item_max() { short i; for(i = 0; i < NUM_TOWN_ITEMS; i++) @@ -1272,17 +1237,15 @@ void reset_item_max() item_max = i + 1; } -short item_val(cItemRec item) -{ +short item_val(cItemRec item) { if(item.charges == 0) return item.value; return item.charges * item.value; } //// rewrite -void place_treasure(location where,short level,short loot,short mode) //short mode; // 0 - normal, 1 - force -{ +void place_treasure(location where,short level,short loot,short mode) { cItemRec new_item; short amt,r1,i,j; @@ -1439,8 +1402,7 @@ cItemRec return_treasure(short loot) { } -void refresh_store_items() -{ +void refresh_store_items() { short i,j; short loot_index[10] = {1,1,1,1,2,2,2,3,3,4}; diff --git a/osx/boe.locutils.cpp b/osx/boe.locutils.cpp index 5280a070..3b9a3090 100644 --- a/osx/boe.locutils.cpp +++ b/osx/boe.locutils.cpp @@ -68,16 +68,14 @@ bool is_combat() { } // -//void set_terrain_blocked() -//{ +//void set_terrain_blocked() { // short i; // // for(i = 0; i < 256; i++) // terrain_blocked[i] = scenario.ter_types[i].blockage; //} -//short dist(location p1,location p2) -//{ +//short dist(location p1,location p2) { // return s_sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y)); //} // @@ -87,23 +85,20 @@ bool is_combat() { // return max(i,j); //} -bool adjacent(location p1,location p2) -{ +bool adjacent(location p1,location p2) { if((abs((short) (p1.x - p2.x)) <= 1) && (abs((short) (p1.y - p2.y)) <= 1)) return true; else return false; } -bool point_onscreen(location center,location check) -{ +bool point_onscreen(location center,location check) { if((abs((short) (center.x - check.x)) <=4) && (abs((short) (center.y - check.y)) <= 4)) return true; else return false; } -short set_direction (location old_pt, location new_pt) -{ +short set_direction (location old_pt, location new_pt) { if(old_pt.x == new_pt.x) { if(old_pt.y > new_pt.y) return DIR_N; @@ -123,8 +118,7 @@ short set_direction (location old_pt, location new_pt) return DIR_E; } -location global_to_local(location global) -{ +location global_to_local(location global) { location local; local = global; @@ -135,8 +129,7 @@ location global_to_local(location global) return local; } // TODO: I fixed the above function, but it's impossible to fix this one without adding a parameter (which would be i_w_c) -location local_to_global(location local) -{ +location local_to_global(location local) { location global; global = local; @@ -146,23 +139,20 @@ location local_to_global(location local) global.y = global.y + 48; return global; } -bool loc_off_world(location p1) -{ +bool loc_off_world(location p1) { if((p1.x < 0) || (p1.x > univ.town->max_dim()) || (p1.y < 0) || (p1.y > univ.town->max_dim())) return true; else return false; } -bool loc_off_act_area(location p1) -{ +bool loc_off_act_area(location p1) { if((p1.x > univ.town->in_town_rect.left) && (p1.x < univ.town->in_town_rect.right) && (p1.y > univ.town->in_town_rect.top) && (p1.y < univ.town->in_town_rect.bottom)) return false; return true; } -location get_cur_loc() -{ +location get_cur_loc() { switch(overall_mode) { case MODE_OUTDOORS: case MODE_LOOK_OUTDOORS: return univ.party.p_loc; @@ -179,8 +169,7 @@ location get_cur_loc() } // TODO: Don't hardcode this! -bool is_lava(short x,short y)//// -{ +bool is_lava(short x,short y) { ter_num_t ter; ter = coord_to_ter(x,y); @@ -231,8 +220,7 @@ short combat_obscurity(short x, short y) { return sight_obscurity(x,y); } -ter_num_t coord_to_ter(short x,short y) -{ +ter_num_t coord_to_ter(short x,short y) { ter_num_t what_terrain; if((overall_mode == MODE_OUTDOORS) || (overall_mode == MODE_LOOK_OUTDOORS)) @@ -245,8 +233,7 @@ ter_num_t coord_to_ter(short x,short y) } //// -bool is_container(location loc) -{ +bool is_container(location loc) { ter_num_t ter; if((univ.town.is_barrel(loc.x,loc.y)) || (univ.town.is_crate(loc.x,loc.y))) @@ -257,8 +244,7 @@ bool is_container(location loc) return false; } -void update_explored(location dest) -{ +void update_explored(location dest) { location shortdest,look; location look2; @@ -296,8 +282,7 @@ void update_explored(location dest) // All purpose function to check is spot is free for travel into. -bool is_blocked(location to_check) -{ +bool is_blocked(location to_check) { short i,gr; ter_num_t ter; @@ -356,8 +341,7 @@ bool is_blocked(location to_check) return true; } -bool monst_on_space(location loc,short m_num) -{ +bool monst_on_space(location loc,short m_num) { if(univ.town.monst[m_num].active == 0) return false; @@ -369,8 +353,7 @@ bool monst_on_space(location loc,short m_num) return false; } -short monst_there(location where) // returns 90 if no -{ +short monst_there(location where) { // returns 90 if no short i; for(i = 0; i < univ.town->max_monst(); i++) @@ -378,8 +361,7 @@ short monst_there(location where) // returns 90 if no return i; return 90; } -bool monst_can_be_there(location loc,short m_num) -{ +bool monst_can_be_there(location loc,short m_num) { short i,j; location destination; @@ -399,8 +381,7 @@ bool monst_can_be_there(location loc,short m_num) return true; } -bool monst_adjacent(location loc,short m_num) -{ +bool monst_adjacent(location loc,short m_num) { short i,j; location destination; @@ -414,8 +395,7 @@ bool monst_adjacent(location loc,short m_num) return false; } -bool monst_can_see(short m_num,location l) -{ +bool monst_can_see(short m_num,location l) { short i,j; location destination; @@ -429,8 +409,7 @@ bool monst_can_see(short m_num,location l) return false; } -bool party_can_see_monst(short m_num) -{ +bool party_can_see_monst(short m_num) { short i,j; location destination; @@ -444,8 +423,7 @@ bool party_can_see_monst(short m_num) return false; } -bool can_see_monst(location l,short m_num) -{ +bool can_see_monst(location l,short m_num) { short i,j; location destination; @@ -459,8 +437,7 @@ bool can_see_monst(location l,short m_num) return false; } -bool outd_is_blocked(location to_check) -{ +bool outd_is_blocked(location to_check) { short i; if(overall_mode == MODE_OUTDOORS) { @@ -476,16 +453,14 @@ bool outd_is_blocked(location to_check) return false; } -bool special_which_blocks_monst(location to_check) -{ +bool special_which_blocks_monst(location to_check) { if(scenario.ter_types[coord_to_ter(to_check.x,to_check.y)].blockage == eTerObstruct::BLOCK_MONSTERS) return true; else return false; } // Checks if space is a special that prevents movement into or placement of a PC on -bool is_special(location to_check) -{ +bool is_special(location to_check) { ter_num_t which_ter; if(!special_which_blocks_monst(to_check)) @@ -496,8 +471,7 @@ bool is_special(location to_check) else return false; } -bool outd_is_special(location to_check) -{ +bool outd_is_special(location to_check) { if(overall_mode == MODE_OUTDOORS) { if(scenario.ter_types[univ.out[to_check.x][to_check.y]].blockage == eTerObstruct::BLOCK_MONSTERS) { return true; @@ -507,8 +481,7 @@ bool outd_is_special(location to_check) return false; } -bool impassable(ter_num_t terrain_to_check) -{ +bool impassable(ter_num_t terrain_to_check) { if(blocksMove(scenario.ter_types[terrain_to_check].blockage)) return true; else return false; @@ -517,8 +490,7 @@ bool impassable(ter_num_t terrain_to_check) // TODO: What on earth is this and why does it mangle the blockage? // NOTE: Seems to return 5 for "blocks sight", 1 for "obstructs missiles", 0 otherwise // So it should probably be called something like "get_opacity" instead. -short get_blockage(ter_num_t terrain_type) -{ +short get_blockage(ter_num_t terrain_type) { // little kludgy in here for pits if((terrain_type == 90) && (is_combat()) && (which_combat_type == 0)) return 5; @@ -534,8 +506,7 @@ short get_blockage(ter_num_t terrain_type) -short light_radius() -{ +short light_radius() { short store = 1,i; short extra_levels[6] = {10,20,50,75,110,140}; @@ -548,8 +519,7 @@ short light_radius() return store; } -bool pt_in_light(location from_where,location to_where) // Assumes, of course, in town or combat -{ +bool pt_in_light(location from_where,location to_where) { // Assumes, of course, in town or combat if(univ.town->lighting_type == 0) return true; @@ -565,8 +535,7 @@ bool pt_in_light(location from_where,location to_where) // Assumes, of course, i return false; } -bool combat_pt_in_light(location to_where) -{ +bool combat_pt_in_light(location to_where) { short i,rad; if((univ.town->lighting_type == 0) || (which_combat_type == 0)) @@ -587,8 +556,7 @@ bool combat_pt_in_light(location to_where) return false; } -bool party_sees_a_monst() // Returns true is a hostile monster is in sight. -{ +bool party_sees_a_monst() { // Returns true is a hostile monster is in sight. short i; for(i = 0; i < univ.town->max_monst(); i++) { @@ -603,8 +571,7 @@ bool party_sees_a_monst() // Returns true is a hostile monster is in sight. // Returns 6 if can't see, O.W. returns the # of a PC that can see -short party_can_see(location where) -{ +short party_can_see(location where) { short i; if(is_out()) { @@ -632,8 +599,7 @@ short party_can_see(location where) return 6; } -location push_loc(location from_where,location to_where) -{ +location push_loc(location from_where,location to_where) { location loc_to_try; loc_to_try = to_where; @@ -659,8 +625,7 @@ location push_loc(location from_where,location to_where) // TODO: This seems to be wrong; impassable implies "blocks movement", which two other blockages also do -bool spot_impassable(short i,short j) -{ +bool spot_impassable(short i,short j) { ter_num_t ter; ter = coord_to_ter(i,j); @@ -669,16 +634,14 @@ bool spot_impassable(short i,short j) else return false; } -void swap_ter(short i,short j,ter_num_t ter1,ter_num_t ter2) -{ +void swap_ter(short i,short j,ter_num_t ter1,ter_num_t ter2) { if(coord_to_ter(i,j) == ter1) alter_space(i,j,ter2); else if(coord_to_ter(i,j) == ter2) alter_space(i,j,ter1); } -void alter_space(short i,short j,ter_num_t ter) -{ +void alter_space(short i,short j,ter_num_t ter) { location l; l.x = i; diff --git a/osx/boe.main.cpp b/osx/boe.main.cpp index 65e82951..ef05c27f 100644 --- a/osx/boe.main.cpp +++ b/osx/boe.main.cpp @@ -212,8 +212,7 @@ int main(int /*argc*/, char* argv[]) { // //MW specified argument and return type. -void Initialize(void) -{ +void Initialize(void) { /* Initialize all the needed managers. */ //InitCursor(); @@ -259,8 +258,7 @@ void Initialize(void) } -void Handle_One_Event() -{ +void Handle_One_Event() { static const long twentyTicks = time_in_ticks(20).asMilliseconds(); static const long fortyTicks = time_in_ticks(40).asMilliseconds(); @@ -298,8 +296,7 @@ void Handle_One_Event() mainPtr.display(); return; } - switch(event.type) - { + switch(event.type) { case sf::Event::KeyPressed: if(flushingInput) return; if(!(event.key.*systemKey)) @@ -377,8 +374,7 @@ void Handle_One_Event() } -void Handle_Update() -{ +void Handle_Update() { redraw_screen(REFRESH_NONE); if(map_visible) draw_map(false); @@ -395,8 +391,7 @@ static void handleUpdateWhileScrolling(volatile bool& doneScrolling, int refresh } // TODO: Pass the event object around instead of keeping a global one -void Mouse_Pressed() -{ +void Mouse_Pressed() { if(had_text_freeze > 0) { had_text_freeze--; return; @@ -430,15 +425,13 @@ void Mouse_Pressed() } -void close_program() -{ +void close_program() { // TODO: Ultimately we would like to have cleanup happen automatically, negating the need for this function //end_music(); if(univ.town.loaded()) univ.town.unload(); } -void handle_apple_menu(int item_hit) -{ +void handle_apple_menu(int item_hit) { switch(item_hit) { case 1: @@ -451,8 +444,7 @@ void handle_apple_menu(int item_hit) } } -void handle_file_menu(int item_hit) -{ +void handle_file_menu(int item_hit) { std::string choice; short i; @@ -517,8 +509,7 @@ void handle_file_menu(int item_hit) } } -void handle_options_menu(int item_hit) -{ +void handle_options_menu(int item_hit) { short choice,i; switch(item_hit) { @@ -605,8 +596,7 @@ void handle_options_menu(int item_hit) } } -void handle_help_menu(int item_hit) -{ +void handle_help_menu(int item_hit) { std::string dialogToShow; switch(item_hit) { case 1: dialogToShow = "help-outdoor.xml"; break; @@ -620,8 +610,7 @@ void handle_help_menu(int item_hit) cChoiceDlog(dialogToShow).show(); // TODO: Windows version has an option to bring up Windows help for the game; should we have something equivalent for Mac? } -void handle_library_menu(int item_hit) -{ +void handle_library_menu(int item_hit) { switch(item_hit) { case 1: display_spells(eSkill::MAGE_SPELLS,100,0); break; @@ -641,8 +630,7 @@ void handle_library_menu(int item_hit) } } -void handle_actions_menu(int item_hit) -{ +void handle_actions_menu(int item_hit) { sf::Event dummyEvent = {sf::Event::KeyPressed}; switch(item_hit) { case 1: @@ -669,13 +657,11 @@ void handle_actions_menu(int item_hit) } // TODO: Let this function take a cMonster* instead of the item_hit -void handle_monster_info_menu(int item_hit) -{ +void handle_monster_info_menu(int item_hit) { display_monst(item_hit - 1, NULL,1); } -//void load_cursors() -//{ +//void load_cursors() { // short i,j; // for(i = 0; i < 3; i++) // for(j = 0; j < 3; j++) @@ -697,8 +683,7 @@ void handle_monster_info_menu(int item_hit) // //} -//void set_cursor(CursHandle which_curs) -//{ +//void set_cursor(CursHandle which_curs) { // HLock ((Handle) which_curs); // SetCursor (*which_curs); // HUnlock((Handle) which_curs); @@ -733,8 +718,7 @@ static cursor_type get_mode_cursor(){ return sword_curs; // this should never be reached, though } -void change_cursor(location where_curs) -{ +void change_cursor(location where_curs) { cursor_type cursor_needed; location cursor_direction; RECT world_screen = {23, 23, 346, 274}; @@ -834,8 +818,7 @@ void incidental_noises(bool on_surface){ // Chicken: 92 } -void pause(short length) -{ +void pause(short length) { long len; len = (long) length; @@ -850,8 +833,7 @@ void pause(short length) // TODO: I think this should be in a better place, maybe in cParty? // stuff done legit, i.e. flags are within proper ranges for stuff done flag -bool sd_legit(short a, short b) -{ +bool sd_legit(short a, short b) { if((minmax(0,299,a) == a) && (minmax(0,9,b) == b)) return true; return false; diff --git a/osx/boe.menus.mac.mm b/osx/boe.menus.mac.mm index e677a322..53ade652 100644 --- a/osx/boe.menus.mac.mm +++ b/osx/boe.menus.mac.mm @@ -153,8 +153,7 @@ void init_menubar() { menu_activate(); } -void init_spell_menus() -{ +void init_spell_menus() { short i,j; for(i = 0; i < 2; i++) @@ -165,8 +164,7 @@ void init_spell_menus() -void adjust_spell_menus() -{ +void adjust_spell_menus() { short i,j,spell_pos = 0; NSMenu* spell_menu; char spell_name[256]; diff --git a/osx/boe.monster.cpp b/osx/boe.monster.cpp index 1b37dde6..e2d24088 100644 --- a/osx/boe.monster.cpp +++ b/osx/boe.monster.cpp @@ -80,8 +80,7 @@ short charm_odds[20] = {90,90,85,80,78, 75,73,60,40,30, 20,10,4,1,0, 0,0,0,0,0}; // return monst; //} -short out_enc_lev_tot(short which) -{ +short out_enc_lev_tot(short which) { short count = 0,i; short num[7] = {22,8,4,4,3,2,1}; @@ -94,8 +93,7 @@ short out_enc_lev_tot(short which) return count; } -void create_wand_monst() -{ +void create_wand_monst() { short r1,r2,r3,i = 0,num_tries = 0; location p_loc; @@ -135,8 +133,7 @@ void create_wand_monst() } } -void place_outd_wand_monst(location where,cOutdoors::cWandering group,short forced) -{ +void place_outd_wand_monst(location where,cOutdoors::cWandering group,short forced) { short i = 0,j = 0; location l; @@ -171,8 +168,7 @@ void place_outd_wand_monst(location where,cOutdoors::cWandering group,short forc } -location get_monst_head(short m_num) -{ +location get_monst_head(short m_num) { location l; l = univ.town.monst[m_num].cur_loc; @@ -183,13 +179,11 @@ location get_monst_head(short m_num) return l; } -short get_monst_picnum(m_num_t monst) -{ +short get_monst_picnum(m_num_t monst) { return scenario.scen_monsters[monst].picture_num; } -ePicType get_monst_pictype(m_num_t monst) -{ +ePicType get_monst_pictype(m_num_t monst) { ePicType type = PIC_MONST; short n = scenario.scen_monsters[monst].picture_num; if(n >= 1000){ @@ -213,17 +207,15 @@ ePicType get_monst_pictype(m_num_t monst) return type; } -void get_monst_dims(m_num_t monst,short *width, short *height) -{ +void get_monst_dims(m_num_t monst,short *width, short *height) { *width = scenario.scen_monsters[monst].x_width; *height = scenario.scen_monsters[monst].y_width; } // Used to set up monsters for outdoor wandering encounters. -void set_up_monst(short mode,m_num_t m_num) //mode; // 0 - unfriendly 1 - friendly & fightin' -{ +void set_up_monst(short mode,m_num_t m_num) { short which; for(which = 0; which < univ.town->max_monst(); which++) @@ -237,8 +229,7 @@ void set_up_monst(short mode,m_num_t m_num) } } -void do_monsters() -{ +void do_monsters() { short i,j,r1,target; location l1,l2; bool acted_yet = false; @@ -335,8 +326,7 @@ void do_monsters() } //// -bool monst_hate_spot(short which_m,location *good_loc) -{ +bool monst_hate_spot(short which_m,location *good_loc) { location prospect,loc; loc = univ.town.monst[which_m].cur_loc; @@ -353,8 +343,7 @@ bool monst_hate_spot(short which_m,location *good_loc) || (univ.town.is_force_wall(loc.x,loc.y) && (univ.town.monst[which_m].radiate_1 != 3) && ((univ.town.monst[which_m].immunities & 3) == 0)) // hate shock cloud? || (((univ.town.monst[which_m].mu > 0) || (univ.town.monst[which_m].cl > 0)) - && univ.town.is_antimagic(loc.x,loc.y))) // hate antimagic - { + && univ.town.is_antimagic(loc.x,loc.y))) { // hate antimagic prospect = find_clear_spot(loc,1); if(prospect.x > 0) { *good_loc = prospect; @@ -365,8 +354,7 @@ bool monst_hate_spot(short which_m,location *good_loc) else return false; } -short monst_pick_target(short which_m) -{ +short monst_pick_target(short which_m) { cCreature *cur_monst; short targ_pc,targ_m; @@ -440,8 +428,7 @@ short monst_pick_target(short which_m) } -short monst_pick_target_monst(cCreature *which_m) -{ +short monst_pick_target_monst(cCreature *which_m) { short min_dist = 1000,i,cur_targ = 6; for(i = 0; i < univ.town->max_monst(); i++) { @@ -460,8 +447,7 @@ short monst_pick_target_monst(cCreature *which_m) return cur_targ; } -short monst_pick_target_pc(short m_num,cCreature *which_m)//// -{ +short monst_pick_target_pc(short m_num,cCreature *which_m) { short num_tries = 0,r1,store_targ = 6; if(which_m->attitude % 2 == 0) @@ -494,8 +480,7 @@ short monst_pick_target_pc(short m_num,cCreature *which_m)//// } // returns 6 if no -short select_active_pc() -{ +short select_active_pc() { short r1, num_tries = 0; r1 = get_ran(1,0,5); @@ -505,8 +490,7 @@ short select_active_pc() return r1; } -short closest_pc(location where) -{ +short closest_pc(location where) { short how_close = 200,i,store = 6; for(i = 0; i < 6; i++) @@ -517,9 +501,8 @@ short closest_pc(location where) return store; } -short closest_monst(location where,short mode) //mode; // 1 - closest hostile to PCs 2 - closest friendly to PCs -{ +short closest_monst(location where,short mode) { short how_close = 200,i,store = 6; for(i = 0; i < univ.town->max_monst(); i++) @@ -532,8 +515,7 @@ short closest_monst(location where,short mode) return store; } -short switch_target_to_adjacent(short which_m,short orig_target) -{ +short switch_target_to_adjacent(short which_m,short orig_target) { location monst_loc; short i,num_adj = 0; @@ -603,8 +585,7 @@ short switch_target_to_adjacent(short which_m,short orig_target) } -bool rand_move(char i) -{ +bool rand_move(char i) { bool acted_yet = false; short j; location store_loc; @@ -659,8 +640,7 @@ bool rand_move(char i) -bool seek_party(short i,location l1,location l2) -{ +bool seek_party(short i,location l1,location l2) { bool acted_yet = false; short m,n; if((l1.x > l2.x) && (l1.y > l2.y)) @@ -688,8 +668,7 @@ bool seek_party(short i,location l1,location l2) return acted_yet; } -bool flee_party(short i,location l1,location l2) -{ +bool flee_party(short i,location l1,location l2) { bool acted_yet = false; if((l1.x > l2.x) & (l1.y > l2.y)) @@ -715,8 +694,7 @@ bool flee_party(short i,location l1,location l2) return acted_yet; } -bool try_move(short i,location start,short x,short y) -{ +bool try_move(short i,location start,short x,short y) { location dest; dest = start; @@ -735,8 +713,7 @@ bool try_move(short i,location start,short x,short y) return 0; } -bool combat_move_monster(short which,location destination) -{ +bool combat_move_monster(short which,location destination) { if(!monst_can_be_there(destination,which)) @@ -760,9 +737,8 @@ bool combat_move_monster(short which,location destination) // Looks at all spaces within 2, looking for a spot which is clear of nastiness and beings // returns {0,0} if none found // THIS MAKES NO ADJUSTMENTS FOR BIG MONSTERS!!! -location find_clear_spot(location from_where,short mode) //mode; // 0 - normal 1 - prefer adjacent space -{ +location find_clear_spot(location from_where,short mode) { location loc,store_loc; short num_tries = 0,r1; @@ -787,8 +763,7 @@ location find_clear_spot(location from_where,short mode) return store_loc; } -short pc_there(location where) -{ +short pc_there(location where) { short i; for(i = 0; i < 6; i++) @@ -797,8 +772,7 @@ short pc_there(location where) return 6; } -location random_shift(location start) -{ +location random_shift(location start) { location store; store = start; @@ -808,8 +782,7 @@ location random_shift(location start) return store; } -bool outdoor_move_monster(short num,location dest) -{ +bool outdoor_move_monster(short num,location dest) { if(!outd_is_blocked(dest) && !outd_is_special(dest) && (dest != univ.party.p_loc) && @@ -822,8 +795,7 @@ bool outdoor_move_monster(short num,location dest) else return false; } -bool town_move_monster(short num,location dest) -{ +bool town_move_monster(short num,location dest) { if(!monst_check_special_terrain(dest,1,num)) return false; @@ -837,18 +809,18 @@ bool town_move_monster(short num,location dest) else return false; } -bool monster_placid(short m_num) -{ +bool monster_placid(short m_num) { if((univ.town.monst[m_num].attitude == 0) || - ((univ.town.monst[m_num].attitude == 2) && (PSD[SDF_HOSTILES_PRESENT] == 0))) - { return true;} - else { return false;} + ((univ.town.monst[m_num].attitude == 2) && (PSD[SDF_HOSTILES_PRESENT] == 0))) { + return true; + } else { + return false; + } } // This damages a monster by any fields it's in, and destroys any barrels or crates // it's stiing on. -void monst_inflict_fields(short which_monst) -{ +void monst_inflict_fields(short which_monst) { short i,j,r1,k; location where_check; cCreature *which_m; @@ -932,9 +904,8 @@ void monst_inflict_fields(short which_monst) } -bool monst_check_special_terrain(location where_check,short mode,short which_monst) //mode; // 1 - town 2 - combat -{ +bool monst_check_special_terrain(location where_check,short mode,short which_monst) { ter_num_t ter = 0; short r1,i,guts = 0; bool can_enter = true,mage = false; @@ -1104,8 +1075,7 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon return can_enter; } -void forced_place_monster(m_num_t which,location where) -{ +void forced_place_monster(m_num_t which,location where) { // TODO: Windows version has logic to destroy unimportant monsters to make room, but the real issue here is the non-dynamic nature of the monster array, so a better fix would be to use an std::vector in cPopulation... and then this function wouldn't even be needed. bool free_spot = false; short i = 0,r1; @@ -1123,8 +1093,7 @@ void forced_place_monster(m_num_t which,location where) place_monster(which,where); } -void magic_adjust(cCreature *which_m,short *how_much) -{ +void magic_adjust(cCreature *which_m,short *how_much) { if(which_m->spec_skill == 26) { *how_much = 0; if(32767 - which_m->health > 3) @@ -1137,8 +1106,7 @@ void magic_adjust(cCreature *which_m,short *how_much) *how_much = 0; } -void poison_monst(cCreature *which_m,short how_much) -{ +void poison_monst(cCreature *which_m,short how_much) { if(which_m->immunities & 64) how_much = how_much / 2; if(which_m->immunities & 128) { @@ -1152,8 +1120,7 @@ void poison_monst(cCreature *which_m,short how_much) monst_spell_note(which_m->number,34); } -void acid_monst(cCreature *which_m,short how_much) -{ +void acid_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->status[eStatus::ACID] = minmax(-8,8, which_m->status[eStatus::ACID] + how_much); if(how_much >= 0) @@ -1162,8 +1129,7 @@ void acid_monst(cCreature *which_m,short how_much) monst_spell_note(which_m->number,48); } -void slow_monst(cCreature *which_m,short how_much) -{ +void slow_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->status[eStatus::HASTE_SLOW] = minmax(-8,8, which_m->status[eStatus::HASTE_SLOW] - how_much); if(how_much >= 0) @@ -1172,8 +1138,7 @@ void slow_monst(cCreature *which_m,short how_much) monst_spell_note(which_m->number,35); } -void curse_monst(cCreature *which_m,short how_much) -{ +void curse_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->status[eStatus::BLESS_CURSE] = minmax(-8,8, which_m->status[eStatus::BLESS_CURSE] - how_much); if(how_much >= 0) @@ -1182,8 +1147,7 @@ void curse_monst(cCreature *which_m,short how_much) monst_spell_note(which_m->number,36); } -void web_monst(cCreature *which_m,short how_much) -{ +void web_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->status[eStatus::WEBS] = minmax(-8,8, which_m->status[eStatus::WEBS] + how_much); if(how_much >= 0) @@ -1192,8 +1156,7 @@ void web_monst(cCreature *which_m,short how_much) monst_spell_note(which_m->number,37); } -void scare_monst(cCreature *which_m,short how_much) -{ +void scare_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->morale = which_m->morale - how_much; // TODO: I don't think there's currently any way to increase monster morale at the moment - add one! @@ -1203,8 +1166,7 @@ void scare_monst(cCreature *which_m,short how_much) monst_spell_note(which_m->number,47); } -void disease_monst(cCreature *which_m,short how_much) -{ +void disease_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->status[eStatus::DISEASE] = minmax(-8,8, which_m->status[eStatus::DISEASE] + how_much); if(how_much >= 0) @@ -1214,8 +1176,7 @@ void disease_monst(cCreature *which_m,short how_much) } -void dumbfound_monst(cCreature *which_m,short how_much) -{ +void dumbfound_monst(cCreature *which_m,short how_much) { magic_adjust(which_m,&how_much); which_m->status[eStatus::DUMB] = minmax(-8,8, which_m->status[eStatus::DUMB] + how_much); if(how_much >= 0) @@ -1225,9 +1186,8 @@ void dumbfound_monst(cCreature *which_m,short how_much) } -void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amount) // Also used for sleep and paralyze, which_statys is 0 means charm -{ +void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amount) { short r1; @@ -1269,8 +1229,7 @@ void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amo //one_sound(53); } } -void record_monst(cCreature *which_m) -{ +void record_monst(cCreature *which_m) { short r1; char str[60]; @@ -1302,8 +1261,7 @@ void record_monst(cCreature *which_m) } // returns 90 is no placement, OW returns # of spot //// -short place_monster(m_num_t which,location where) -{ +short place_monster(m_num_t which,location where) { short i = 0; while((i < univ.town->max_monst()) && ((univ.town.monst[i].active != 0) || @@ -1333,10 +1291,9 @@ short place_monster(m_num_t which,location where) } // returns true if placement was successful -bool summon_monster(m_num_t which,location where,short duration,short given_attitude) //which; // if in town, this is caster loc., if in combat, this is where to try // to put monster -{ +bool summon_monster(m_num_t which,location where,short duration,short given_attitude) { location loc; short which_m,spot; @@ -1386,15 +1343,13 @@ bool summon_monster(m_num_t which,location where,short duration,short given_atti return true; } -void activate_monsters(short code,short /*attitude*/) -{ +void activate_monsters(short code,short /*attitude*/) { short i; if(code == 0) return; for(i = 0; i < univ.town->max_monst(); i++) - if(univ.town.monst[i].spec_enc_code == code) - { + if(univ.town.monst[i].spec_enc_code == code) { univ.town.monst[i] = univ.town->creatures(i); univ.town.monst[i].spec_enc_code = 0; univ.town.monst[i].active = 2; // TODO: Can thes be commented out? \/ @@ -1409,8 +1364,7 @@ void activate_monsters(short code,short /*attitude*/) } } -short get_encumberance(short pc_num) -{ +short get_encumberance(short pc_num) { short store = 0,i,what_val; for(i = 0; i < 24; i++) @@ -1425,8 +1379,7 @@ short get_encumberance(short pc_num) return store; } -m_num_t get_summon_monster(short summon_class) -{ +m_num_t get_summon_monster(short summon_class) { short i,j; for(i = 0; i < 200; i++) { diff --git a/osx/boe.newgraph.cpp b/osx/boe.newgraph.cpp index 17c769f9..a0ddc08a 100644 --- a/osx/boe.newgraph.cpp +++ b/osx/boe.newgraph.cpp @@ -138,8 +138,7 @@ RECT explode_place_rect[30]; //char anim_string[60]; char last_light_mask[13][13]; -void apply_unseen_mask() -{ +void apply_unseen_mask() { // TODO: This is causing major lag and not even working properly return; RECT base_rect = {9,9,53,45},to_rect,big_to = {13,13,337,265}; @@ -178,8 +177,7 @@ void apply_unseen_mask() } } -void apply_light_mask(bool onWindow) -{ +void apply_light_mask(bool onWindow) { static Region dark_mask_region; RECT temp = {0,0,108,84},paint_rect,base_rect = {0,0,36,28}; RECT big_to = {13,13,337,265}; @@ -268,8 +266,7 @@ void apply_light_mask(bool onWindow) dark_mask_region.offset(ul); } -void start_missile_anim() -{ +void start_missile_anim() { short i; if(boom_anim_active) @@ -287,13 +284,11 @@ void start_missile_anim() have_boom = false; } -void end_missile_anim() -{ +void end_missile_anim() { boom_anim_active = false; } -void add_missile(location dest,short missile_type,short path_type,short x_adj,short y_adj) -{ +void add_missile(location dest,short missile_type,short path_type,short x_adj,short y_adj) { short i; if(!boom_anim_active) @@ -316,8 +311,7 @@ void add_missile(location dest,short missile_type,short path_type,short x_adj,sh } } -void run_a_missile(location from,location fire_to,short miss_type,short path,short sound_num,short x_adj,short y_adj,short len) -{ +void run_a_missile(location from,location fire_to,short miss_type,short path,short sound_num,short x_adj,short y_adj,short len) { // if((cartoon_happening) && (anim_step < 140)) // return; start_missile_anim(); @@ -326,8 +320,7 @@ void run_a_missile(location from,location fire_to,short miss_type,short path,sho end_missile_anim(); } -void run_a_boom(location boom_where,short type,short x_adj,short y_adj)//// -{ +void run_a_boom(location boom_where,short type,short x_adj,short y_adj) { // if((cartoon_happening) && (anim_step < 140)) // return; @@ -339,8 +332,7 @@ void run_a_boom(location boom_where,short type,short x_adj,short y_adj)//// end_missile_anim(); } -void mondo_boom(location l,short type) -{ +void mondo_boom(location l,short type) { short i; start_missile_anim(); @@ -351,8 +343,7 @@ void mondo_boom(location l,short type) end_missile_anim(); } -void add_explosion(location dest,short val_to_place,short place_type,short boom_type,short x_adj,short y_adj) -{ +void add_explosion(location dest,short val_to_place,short place_type,short boom_type,short x_adj,short y_adj) { short i; if(PSD[SDF_NO_FRILLS] > 0) @@ -381,8 +372,7 @@ void add_explosion(location dest,short val_to_place,short place_type,short boom_ } } -void do_missile_anim(short num_steps,location missile_origin,short sound_num) -{ +void do_missile_anim(short num_steps,location missile_origin,short sound_num) { // TODO: Get rid of temp_rect, at least RECT temp_rect,missile_origin_base = {1,1,17,17},active_area_rect,to_rect,from_rect; short i,store_missile_dir; @@ -518,8 +508,7 @@ void do_missile_anim(short num_steps,location missile_origin,short sound_num) rect_draw_some_item(terrain_screen_gworld.getTexture(),oldRect,to_rect,ul); } -short get_missile_direction(location origin_point,location the_point) -{ +short get_missile_direction(location origin_point,location the_point) { location store_dir; short dir = 0; // To reuse legacy code, will renormalize the_point, which is missile destination, @@ -552,10 +541,9 @@ short get_missile_direction(location origin_point,location the_point) return dir; } -void do_explosion_anim(short /*sound_num*/,short special_draw) // sound_num currently ignored // special_draw - 0 normal 1 - first half 2 - second half -{ +void do_explosion_anim(short /*sound_num*/,short special_draw) { RECT temp_rect,active_area_rect,to_rect,from_rect; RECT base_rect = {0,0,36,28},text_rect; char str[60]; @@ -704,8 +692,7 @@ shop_type: 11 - priest spells 12 alchemy */ -void click_shop_rect(RECT area_rect) -{ +void click_shop_rect(RECT area_rect) { draw_shop_graphics(1,area_rect); mainPtr.display(); @@ -729,9 +716,8 @@ static graf_pos calc_item_rect(int num,RECT& to_rect) { return std::make_pair(from_gw, from_rect); } -void draw_shop_graphics(bool pressed,RECT clip_area_rect) // mode 1 - drawing dark for button press -{ +void draw_shop_graphics(bool pressed,RECT clip_area_rect) { RECT area_rect,item_info_from = {11,42,24,56}; RECT face_rect = {6,6,38,38}; @@ -926,8 +912,7 @@ void draw_shop_graphics(bool pressed,RECT clip_area_rect) shop_sbar->draw(); } -void refresh_shopping() -{ +void refresh_shopping() { // TODO: The duplication of RECT here shouldn't be necessary... RECT from_rects[4] = {RECT{0,0,62,279},RECT{62,0,352,253},RECT{62,269,352,279},RECT{352,0,415,279}}; RECT to_rect; @@ -979,8 +964,7 @@ void click_talk_rect(word_rect_t word) { place_talk_face(); } -cItemRec store_mage_spells(short which_s) -{ +cItemRec store_mage_spells(short which_s) { cItemRec spell('spel');// = {21,0, 0,0,0,0,0,0, 53,0,0,0,0, 0, 0,0, {0,0},"", "",0,0,0,0}; static const short cost[62] = { // TODO: Costs for the level 1-3 spells @@ -1004,8 +988,7 @@ cItemRec store_mage_spells(short which_s) return spell; } -cItemRec store_priest_spells(short which_s) -{ +cItemRec store_priest_spells(short which_s) { cItemRec spell('spel');// = {21,0, 0,0,0,0,0,0, 53,0,0,0,0, 0, 0,0, {0,0},"", "",0,0,0,0}; static const short cost[62] = { // TODO: Costs for the level 1-3 spells @@ -1027,8 +1010,7 @@ cItemRec store_priest_spells(short which_s) spell.full_name = str.c_str(); return spell; } -cItemRec store_alchemy(short which_s) -{ +cItemRec store_alchemy(short which_s) { cItemRec spell('spel');// = {21,0, 0,0,0,0,0,0, 53,0,0,0,0, 0, 0,0, {0,0},"", "",0,0,0,0}; static const short val[20] = { 50,75,30,130,100, @@ -1047,8 +1029,7 @@ cItemRec store_alchemy(short which_s) return spell; } -void get_item_interesting_string(cItemRec item,char *message) -{ +void get_item_interesting_string(cItemRec item,char *message) { if(item.property) { strcpy(message,"Not yours."); return; @@ -1104,9 +1085,8 @@ void get_item_interesting_string(cItemRec item,char *message) sprintf(message,"Uses: %d",item.charges); } -void place_talk_str(std::string str_to_place,std::string str_to_place2,short color,RECT c_rect) // color 0 - regular 1 - darker -{ +void place_talk_str(std::string str_to_place,std::string str_to_place2,short color,RECT c_rect) { RECT area_rect; RECT title_rect = {19,48,42,260}; @@ -1243,8 +1223,7 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col if(c_rect.right == 0) place_talk_face(); } -void refresh_talking() -{ +void refresh_talking() { RECT tempRect(talk_gworld); rect_draw_some_item(talk_gworld.getTexture(),tempRect,talk_area_rect,ul); place_talk_face(); diff --git a/osx/boe.party.cpp b/osx/boe.party.cpp index 77ba0a94..6cce4487 100644 --- a/osx/boe.party.cpp +++ b/osx/boe.party.cpp @@ -153,8 +153,7 @@ short store_pc_graphic; //mode; // 0 - prefab 1 - regular 2 - debug // Note: mode 1 is never used -void init_party(short mode) -{ +void init_party(short mode) { // TODO: Remove in favour of cParty constructor. short i,j,k,l; @@ -282,8 +281,7 @@ void init_party(short mode) // Until that time, the party scen vals are uninited // Then, it inits the party properly for starting the scenario based // on the loaded scenario -void init_party_scen_data() -{ +void init_party_scen_data() { short i,j,k,l; bool stored_item = false; short store_help; @@ -404,8 +402,7 @@ void init_party_scen_data() // When the party is placed into a scen from the startinbg screen, this is called to put the game into game // mode and load in the scen and init the party info // party record already contains scen name -void put_party_in_scen(std::string scen_name) -{ +void put_party_in_scen(std::string scen_name) { short i,j; std::array strs; std::array buttons = {-1,-1,-1}; @@ -503,9 +500,8 @@ void put_party_in_scen(std::string scen_name) } } -bool create_pc(short spot,cDialog* parent) //spot; // if spot is 6, find one -{ +bool create_pc(short spot,cDialog* parent) { bool still_ok = true; if(spot == 6) { @@ -564,8 +560,7 @@ bool create_pc(short spot,cDialog* parent) return true; } -bool take_sp(short pc_num,short amt) -{ +bool take_sp(short pc_num,short amt) { if(univ.party[pc_num].cur_sp < amt) return false; univ.party[pc_num].cur_sp -= amt; @@ -575,8 +570,7 @@ bool take_sp(short pc_num,short amt) -void heal_pc(short pc_num,short amt) -{ +void heal_pc(short pc_num,short amt) { if(univ.party[pc_num].cur_health > univ.party[pc_num].max_health) return; if(univ.party[pc_num].main_status != eMainStatus::ALIVE) @@ -587,8 +581,7 @@ void heal_pc(short pc_num,short amt) } -void heal_party(short amt) -{ +void heal_party(short amt) { short i; for(i = 0; i < 6; i++) @@ -596,8 +589,7 @@ void heal_party(short amt) heal_pc(i,amt); } -void cure_pc(short pc_num,short amt) -{ +void cure_pc(short pc_num,short amt) { if(univ.party[pc_num].main_status != eMainStatus::ALIVE) return; if(univ.party[pc_num].status[eStatus::POISON] <= amt) @@ -606,8 +598,7 @@ void cure_pc(short pc_num,short amt) one_sound(51); } -void cure_party(short amt) -{ +void cure_party(short amt) { short i; for(i = 0; i < 6; i++) @@ -617,8 +608,7 @@ void cure_party(short amt) } // if how_much < 0, bless -void curse_pc(short which_pc,short how_much) -{ +void curse_pc(short which_pc,short how_much) { if(univ.party[which_pc].main_status != eMainStatus::ALIVE) return; if(univ.party[which_pc].main_status == eMainStatus::ALIVE) { @@ -633,8 +623,7 @@ void curse_pc(short which_pc,short how_much) give_help(59,0); } -void dumbfound_pc(short which_pc,short how_much) -{ +void dumbfound_pc(short which_pc,short how_much) { short r1; if(univ.party[which_pc].main_status != eMainStatus::ALIVE) @@ -661,8 +650,7 @@ void dumbfound_pc(short which_pc,short how_much) adjust_spell_menus(); give_help(28,0); } -void disease_pc(short which_pc,short how_much) -{ +void disease_pc(short which_pc,short how_much) { short r1,level; if(univ.party[which_pc].main_status != eMainStatus::ALIVE) @@ -691,9 +679,8 @@ void disease_pc(short which_pc,short how_much) give_help(29,0); } -void sleep_pc(short which_pc,short how_much,eStatus what_type,short adjust) // higher adjust, less chance of saving -{ +void sleep_pc(short which_pc,short how_much,eStatus what_type,short adjust) { short r1,level; if(univ.party[which_pc].main_status != eMainStatus::ALIVE) return; @@ -738,8 +725,7 @@ void sleep_pc(short which_pc,short how_much,eStatus what_type,short adjust) } // if how_much < 0, haste -void slow_pc(short which_pc,short how_much)//// -{ +void slow_pc(short which_pc,short how_much) { if(univ.party[which_pc].main_status != eMainStatus::ALIVE) return; if(univ.party[which_pc].main_status == eMainStatus::ALIVE) { @@ -755,8 +741,7 @@ void slow_pc(short which_pc,short how_much)//// give_help(35,0); } -void web_pc(short which_pc,short how_much) -{ +void web_pc(short which_pc,short how_much) { if(univ.party[which_pc].main_status != eMainStatus::ALIVE) return; if(univ.party[which_pc].main_status == eMainStatus::ALIVE) { @@ -769,8 +754,7 @@ void web_pc(short which_pc,short how_much) give_help(31,0); } -void acid_pc(short which_pc,short how_much) -{ +void acid_pc(short which_pc,short how_much) { if(univ.party[which_pc].main_status != eMainStatus::ALIVE) return; if(pc_has_abil_equip(which_pc,eItemAbil::ACID_PROTECTION) < 24) { @@ -787,8 +771,7 @@ void acid_pc(short which_pc,short how_much) put_pc_screen(); } -void increase_light(short amt) -{ +void increase_light(short amt) { short i; location where; @@ -808,8 +791,7 @@ void increase_light(short amt) put_pc_screen(); } -void restore_sp_pc(short pc_num,short amt) -{ +void restore_sp_pc(short pc_num,short amt) { if(univ.party[pc_num].cur_sp > univ.party[pc_num].max_sp) return; univ.party[pc_num].cur_sp += amt; @@ -817,8 +799,7 @@ void restore_sp_pc(short pc_num,short amt) univ.party[pc_num].cur_sp = univ.party[pc_num].max_sp; } -void restore_sp_party(short amt) -{ +void restore_sp_party(short amt) { short i; for(i = 0; i < 6; i++) @@ -826,8 +807,7 @@ void restore_sp_party(short amt) restore_sp_pc(i,amt); } -void award_party_xp(short amt) -{ +void award_party_xp(short amt) { short i; for(i = 0; i < 6; i++) @@ -835,8 +815,7 @@ void award_party_xp(short amt) award_xp(i,amt); } -void award_xp(short pc_num,short amt) -{ +void award_xp(short pc_num,short amt) { short adjust,add_hp; short xp_percent[30] = { 150,120,100,90,80,70,60,50,50,50, @@ -913,8 +892,7 @@ void award_xp(short pc_num,short amt) } } -void drain_pc(short which_pc,short how_much) -{ +void drain_pc(short which_pc,short how_much) { if(univ.party[which_pc].main_status == eMainStatus::ALIVE) { univ.party[which_pc].experience = max(univ.party[which_pc].experience - how_much,0); sprintf ((char *) c_line, " %s drained.",(char *) univ.party[which_pc].name.c_str()); @@ -968,9 +946,8 @@ short check_party_stat(eSkill which_stat, short mode) { } -bool poison_weapon( short pc_num, short how_much,short safe) //short safe; // 1 - always succeeds -{ +bool poison_weapon( short pc_num, short how_much,short safe) { short i,weap = 24,p_level,r1; short p_chance[21] = { 40,72,81,85,88,89,90, @@ -1010,8 +987,7 @@ bool poison_weapon( short pc_num, short how_much,short safe) } } -bool is_weapon(short pc_num,short item) -{ +bool is_weapon(short pc_num,short item) { // TODO: Uh, why aren't bows, crossbows, thrown missiles, no-ammo missiles included? (There's probably a reason though.) if((univ.party[pc_num].items[item].variety == eItemType::ONE_HANDED) || (univ.party[pc_num].items[item].variety == eItemType::TWO_HANDED) || @@ -1022,9 +998,8 @@ bool is_weapon(short pc_num,short item) } -void cast_spell(eSkill type) //short type; // 0 - mage 1 - priest -{ +void cast_spell(eSkill type) { eSpell spell; if((is_town()) && (univ.town.is_antimagic(univ.town.p_loc.x,univ.town.p_loc.y))) { @@ -1050,8 +1025,7 @@ void cast_spell(eSkill type) } } -bool repeat_cast_ok(eSkill type) -{ +bool repeat_cast_ok(eSkill type) { short who_would_cast; eSpellSelect store_select; eSpell what_spell; @@ -1090,9 +1064,8 @@ bool repeat_cast_ok(eSkill type) } -void give_party_spell(short which) //// //which; // 100 + x : priest spell x -{ +void give_party_spell(short which) { short i; bool sound_done = false; char str[60]; @@ -1127,8 +1100,7 @@ void give_party_spell(short which) //// } } -void do_mage_spell(short pc_num,eSpell spell_num) -{ +void do_mage_spell(short pc_num,eSpell spell_num) { short i,j,item,target,r1,adj,store; location where; @@ -1296,8 +1268,7 @@ void do_mage_spell(short pc_num,eSpell spell_num) } } -void do_priest_spell(short pc_num,eSpell spell_num) //// -{ +void do_priest_spell(short pc_num,eSpell spell_num) { short r1,r2, target, i,item,store,adj,x,y; location loc; location where; @@ -1692,8 +1663,7 @@ void do_priest_spell(short pc_num,eSpell spell_num) //// } } -void cast_town_spell(location where) //// -{ +void cast_town_spell(location where) { short adjust,r1,targ,store; location loc; ter_num_t ter; @@ -1835,8 +1805,7 @@ void cast_town_spell(location where) //// } } -bool cast_spell_on_space(location where, eSpell spell) -{ +bool cast_spell_on_space(location where, eSpell spell) { short i,s1 = 0,s2 = 0,s3 = 0; for(i = 0; i < 50; i++) @@ -1851,8 +1820,7 @@ bool cast_spell_on_space(location where, eSpell spell) return true; } -void crumble_wall(location where) // TODO: Add something like this to the spreading quickfire function -{ +void crumble_wall(location where) { // TODO: Add something like this to the spreading quickfire function ter_num_t ter; if(loc_off_act_area(where)) @@ -1866,8 +1834,7 @@ void crumble_wall(location where) // TODO: Add something like this to the spread } -void do_mindduel(short pc_num,cCreature *monst) -{ +void do_mindduel(short pc_num,cCreature *monst) { short i = 0,adjust,r1,r2,balance = 0; adjust = (univ.party[pc_num].level + univ.party[pc_num].skills[eSkill::INTELLIGENCE]) / 2 - monst->level * 2; @@ -1929,8 +1896,7 @@ void do_mindduel(short pc_num,cCreature *monst) } // mode 0 - dispel spell, 1 - always take 2 - always take and take fire and force too -void dispel_fields(short i,short j,short mode) -{ +void dispel_fields(short i,short j,short mode) { short r1; if(mode == 2) { @@ -1989,8 +1955,7 @@ bool pc_can_cast_spell(short pc_num,eSkill type) { return false; } -bool pc_can_cast_spell(short pc_num,eSpell spell_num) -{ +bool pc_can_cast_spell(short pc_num,eSpell spell_num) { short level,store_w_cast; eSkill type = (*spell_num).type; @@ -2135,8 +2100,7 @@ static void put_target_status_graphics(cDialog& me, short for_pc) { } } -static void draw_spell_pc_info(cDialog& me) -{ +static void draw_spell_pc_info(cDialog& me) { short i; for(i = 0; i < 6; i++) { @@ -2157,8 +2121,7 @@ static void draw_spell_pc_info(cDialog& me) } -static void put_pc_caster_buttons(cDialog& me) -{ +static void put_pc_caster_buttons(cDialog& me) { short i; @@ -2396,11 +2359,10 @@ static bool finish_pick_spell(cDialog& me, bool spell_toast, const short store_s return true; } -eSpell pick_spell(short pc_num,eSkill type) // 70 - no spell OW spell num //short pc_num; // if 6, anyone //short type; // 0 - mage 1 - priest //short situation; // 0 - out 1 - town 2 - combat -{ +eSpell pick_spell(short pc_num,eSkill type) { // 70 - no spell OW spell num using namespace std::placeholders; eSpell store_spell = type == eSkill::MAGE_SPELLS ? store_mage : store_priest; short former_target = store_spell_target; @@ -2520,9 +2482,8 @@ eSpell pick_spell(short pc_num,eSkill type) // 70 - no spell OW spell num } -void print_spell_cast(eSpell spell,eSkill which) //short which; // 0 - mage 1 - priest -{ +void print_spell_cast(eSpell spell,eSkill which) { short spell_num = (which == eSkill::PRIEST_SPELLS ? int(spell) - 100 : int(spell)); sprintf ((char *) c_line, "Spell: %s ", (which == eSkill::MAGE_SPELLS) ? (char *) mage_s_name[spell_num] : (char *) priest_s_name[spell_num]); @@ -2559,8 +2520,7 @@ void start_town_targeting(eSpell s_num,short who_c,bool freebie) { spell_freebie = freebie; } -void do_alchemy() //// -{ +void do_alchemy() { static const eItemAbil ingred1_needed[20] = { eItemAbil::HOLLY,eItemAbil::COMFREY,eItemAbil::HOLLY,eItemAbil::COMFREY,eItemAbil::WORMGRASS, eItemAbil::NETTLE,eItemAbil::NETTLE,eItemAbil::WORMGRASS,eItemAbil::GRAYMOLD,eItemAbil::WORMGRASS, @@ -2676,8 +2636,7 @@ static bool alch_choice_event_filter(cDialog& me, std::string item_hit, eKeyMod) return true; } -short alch_choice(short pc_num) -{ +short alch_choice(short pc_num) { short difficulty[20] = {1,1,1,3,3, 4,5,5,7,9, 9,10,12,12,9, 14,19,10,16,20}; short i,store_alchemy_pc; char get_text[256]; @@ -2709,9 +2668,8 @@ short alch_choice(short pc_num) } extern bool pc_gworld_loaded; -bool pick_pc_graphic(short pc_num,short mode,cDialog* parent) // mode ... 0 - create 1 - created -{ +bool pick_pc_graphic(short pc_num,short mode,cDialog* parent) { bool munch_pc_graphic = false; store_graphic_pc_num = pc_num; @@ -2752,10 +2710,9 @@ static bool pc_name_event_filter(cDialog& me, short store_train_pc) { return true; } -bool pick_pc_name(short pc_num,cDialog* parent) //town_num; // Will be 0 - 200 for town, 200 - 290 for outdoors //short sign_type; // terrain type -{ +bool pick_pc_name(short pc_num,cDialog* parent) { using namespace std::placeholders; make_cursor_sword(); @@ -2768,9 +2725,8 @@ bool pick_pc_name(short pc_num,cDialog* parent) return 1; } -m_num_t pick_trapped_monst() -// ignore parent in Mac version -{ +m_num_t pick_trapped_monst() { + // ignore parent in Mac version short i; std::string sp; cMonster get_monst; @@ -2801,15 +2757,13 @@ m_num_t pick_trapped_monst() } -bool flying() -{ +bool flying() { if(PSD[SDF_PARTY_FLIGHT] == 0) return false; else return true; } -void poison_pc(short which_pc,short how_much) -{ +void poison_pc(short which_pc,short how_much) { short level; if(univ.party[which_pc].main_status == eMainStatus::ALIVE) { @@ -2835,16 +2789,14 @@ void poison_pc(short which_pc,short how_much) put_pc_screen(); } -void poison_party(short how_much) -{ +void poison_party(short how_much) { short i; for(i = 0; i < 6; i++) poison_pc(i,how_much); } -void affect_pc(short which_pc,eStatus type,short how_much)//// //type; // which status to affect -{ +void affect_pc(short which_pc,eStatus type,short how_much) { if(univ.party[which_pc].main_status != eMainStatus::ALIVE) return; @@ -2855,9 +2807,8 @@ void affect_pc(short which_pc,eStatus type,short how_much)//// univ.party[which_pc].status[type] = max(univ.party[which_pc].status[type],0); put_pc_screen(); } -void affect_party(eStatus type,short how_much) //type; // which status to affect -{ +void affect_party(eStatus type,short how_much) { short i; for(i = 0; i < 6; i++) @@ -2866,16 +2817,14 @@ void affect_party(eStatus type,short how_much) put_pc_screen(); } -void void_sanctuary(short pc_num) -{ +void void_sanctuary(short pc_num) { if(univ.party[pc_num].status[eStatus::INVISIBLE] > 0) { add_string_to_buf("You become visible!"); univ.party[pc_num].status[eStatus::INVISIBLE] = 0; } } -void hit_party(short how_much,eDamageType damage_type) -{ +void hit_party(short how_much,eDamageType damage_type) { short i; bool dummy; @@ -2886,8 +2835,7 @@ void hit_party(short how_much,eDamageType damage_type) put_pc_screen(); } -void slay_party(eMainStatus mode) -{ +void slay_party(eMainStatus mode) { short i; boom_anim_active = false; @@ -2897,13 +2845,12 @@ void slay_party(eMainStatus mode) put_pc_screen(); } -bool damage_pc(short which_pc,short how_much,eDamageType damage_type,eRace type_of_attacker, short sound_type) //short damage_type; // 0 - weapon 1 - fire 2 - poison 3 - general magic 4 - unblockable // 5 - cold 6 - undead attack 7 - demon attack // 10 - marked damage, from during anim mode ... no boom, and totally unblockable // 30 + * same as *, but no print // 100s digit - sound data -{ +bool damage_pc(short which_pc,short how_much,eDamageType damage_type,eRace type_of_attacker, short sound_type) { short i, r1,level; bool do_print = true; @@ -3082,8 +3029,7 @@ bool damage_pc(short which_pc,short how_much,eDamageType damage_type,eRace type_ return true; } -void kill_pc(short which_pc,eMainStatus type) -{ +void kill_pc(short which_pc,eMainStatus type) { short i = 24; bool dummy,no_save = false; location item_loc; @@ -3137,8 +3083,7 @@ void kill_pc(short which_pc,eMainStatus type) set_stat_window(current_pc); } -void set_pc_moves() -{ +void set_pc_moves() { short i,r,i_level; for(i = 0; i < 6; i++) @@ -3175,8 +3120,7 @@ void set_pc_moves() } -void take_ap(short num) -{ +void take_ap(short num) { univ.party[current_pc].ap = max(0,univ.party[current_pc].ap - num); } diff --git a/osx/boe.specials.cpp b/osx/boe.specials.cpp index b1d8c340..bd845f78 100644 --- a/osx/boe.specials.cpp +++ b/osx/boe.specials.cpp @@ -86,9 +86,8 @@ std::map abil_chart = { }; // TODO: I bet this is completely unused; it looks like it does nothing. -bool town_specials(short which,short /*t_num*/) //short which; // number, 0 - 49, of special -{ +bool town_specials(short which,short /*t_num*/) { bool can_enter = true; short spec_id; location l; @@ -106,11 +105,10 @@ bool town_specials(short which,short /*t_num*/) return can_enter; } -bool handle_wandering_specials (short /*which*/,short mode) // which is unused //short mode; // 0 - pre 1 - end by victory 2 - end by flight // wanderin spec 99 -> generic spec -{ +bool handle_wandering_specials (short /*which*/,short mode) { // TODO: Is loc_in_sec the correct location to pass here? // (I'm pretty sure it is, but I should verify it somehow.) @@ -133,11 +131,10 @@ bool handle_wandering_specials (short /*which*/,short mode) } -bool check_special_terrain(location where_check,eSpecCtx mode,short which_pc,short *spec_num, - bool *forced) // returns true if can enter this space // sets forced to true if definitely can enter -{ +bool check_special_terrain(location where_check,eSpecCtx mode,short which_pc,short *spec_num, + bool *forced) { ter_num_t ter; short r1,i,door_pc,pic_type = 0,ter_pic = 0; eTerSpec ter_special; @@ -443,8 +440,7 @@ bool check_special_terrain(location where_check,eSpecCtx mode,short which_pc,sho } //print_nums(1,which_pc,current_pc); break; - case eTerSpec::CALL_SPECIAL: - { + case eTerSpec::CALL_SPECIAL: { short spec_type = 0; if(ter_flag2.u == 3){ if(mode == eSpecCtx::TOWN_MOVE || (mode == eSpecCtx::COMBAT_MOVE && which_combat_type == 1)) @@ -491,8 +487,7 @@ bool check_special_terrain(location where_check,eSpecCtx mode,short which_pc,sho // This procedure find the effects of fields that would affect a PC who moves into // a space or waited in that same space -void check_fields(location where_check,eSpecCtx mode,short which_pc) -{ +void check_fields(location where_check,eSpecCtx mode,short which_pc) { short r1,i; if(mode != eSpecCtx::COMBAT_MOVE && mode != eSpecCtx::TOWN_MOVE && mode != eSpecCtx::OUT_MOVE) { @@ -597,8 +592,7 @@ void check_fields(location where_check,eSpecCtx mode,short which_pc) fast_bang = 0; } -void use_spec_item(short item) -{ +void use_spec_item(short item) { short i,j,k; location null_loc; @@ -607,8 +601,7 @@ void use_spec_item(short item) } -void use_item(short pc,short item) -{ +void use_item(short pc,short item) { bool take_charge = true,inept_ok = false; short level,i,j,item_use_code,str,type,r1; short sp[3] = {}; // Dummy values to pass to run_special; not actually used @@ -1188,8 +1181,7 @@ void use_item(short pc,short item) } // Returns true if an action is actually carried out. This can only be reached in town. -bool use_space(location where) -{ +bool use_space(location where) { ter_num_t ter; short i; location from_loc,to_loc; @@ -1271,8 +1263,7 @@ bool use_space(location where) // Note ... if this is a container, the code must first process any specials. If //specials return false, can't get items inside. If true, can get items inside. // Can't get items out in combat. -bool adj_town_look(location where) -{ +bool adj_town_look(location where) { ter_num_t terrain; bool can_open = true,item_there = false,got_special = false; short i = 0,s1 = 0, s2 = 0, s3 = 0; @@ -1318,9 +1309,8 @@ bool adj_town_look(location where) } // PSOE - place_special_outdoor_encounter -void PSOE(short which_special,unsigned char *stuff_done_val,short where_put) // if always, stuff_done_val is NULL -{ +void PSOE(short which_special,unsigned char *stuff_done_val,short where_put) { short i,j,graphic_num = 0; if(stuff_done_val != NULL) { @@ -1351,8 +1341,7 @@ void PSOE(short which_special,unsigned char *stuff_done_val,short where_put) //play_sound(0); } -void out_move_party(char x,char y) -{ +void out_move_party(char x,char y) { location l; l.x = x;l.y = y; @@ -1362,9 +1351,8 @@ void out_move_party(char x,char y) update_explored(l); } -void teleport_party(short x,short y,short mode) // mode - 0=full teleport flash 1=no teleport flash 2=only fade flash 3=only arrival flash -{ +void teleport_party(short x,short y,short mode) { short i; location l; bool fadeIn = false, fadeOut = false; @@ -1412,8 +1400,7 @@ void teleport_party(short x,short y,short mode) } -void fade_party() -{ +void fade_party() { short i; location l; @@ -1428,8 +1415,7 @@ void fade_party() end_missile_anim(); } -void change_level(short town_num,short x,short y) -{ +void change_level(short town_num,short x,short y) { location l(x,y); if((town_num < 0) || (town_num >= scenario.num_towns)) { @@ -1444,14 +1430,13 @@ void change_level(short town_num,short x,short y) // Damaging and killing monsters needs to be here because several have specials attached to them. -bool damage_monst(short which_m, short who_hit, short how_much, short how_much_spec, eDamageType dam_type, short sound_type) //short which_m, who_hit, how_much, how_much_spec; // 6 for who_hit means dist. xp evenly 7 for no xp //short dam_type; // 0 - weapon 1 - fire 2 - poison 3 - general magic 4 - unblockable 5 - cold // 6 - demon 7 - undead // 9 - marked damage, from during anim mode //+10 = no_print // 100s digit - damage sound for boom space -{ +bool damage_monst(short which_m, short who_hit, short how_much, short how_much_spec, eDamageType dam_type, short sound_type) { cCreature *victim; short r1,which_spot; location where_put; @@ -1638,8 +1623,7 @@ bool damage_monst(short which_m, short who_hit, short how_much, short how_much_s return true; } -void kill_monst(cCreature *which_m,short who_killed) -{ +void kill_monst(cCreature *which_m,short who_killed) { short xp,i,j,s1,s2,s3; location l; @@ -1724,8 +1708,7 @@ void kill_monst(cCreature *which_m,short who_killed) // Pushes party and monsters around by moving walls and conveyor belts. //This is very fragils, and only hands a few cases. -void push_things()//// -{ +void push_things() { bool redraw = false; short i,k; ter_num_t ter; @@ -1853,8 +1836,7 @@ void push_things()//// } } -void special_increase_age(long length, bool queue) -{ +void special_increase_age(long length, bool queue) { unsigned short i; short s1,s2,s3; bool redraw = false,stat_area = false; @@ -1959,8 +1941,7 @@ void run_special(pending_special_type spec, short* a, short* b, short* redraw) { // start spec - the number of the first spec to call // a,b - 2 values that can be returned // redraw - 1 if now need redraw -void run_special(eSpecCtx which_mode,short which_type,short start_spec,location spec_loc,short *a,short *b,short *redraw) -{ +void run_special(eSpecCtx which_mode,short which_type,short start_spec,location spec_loc,short *a,short *b,short *redraw) { short cur_spec,cur_spec_type,next_spec,next_spec_type; cSpecial cur_node; int num_nodes = 0; @@ -2063,8 +2044,7 @@ void run_special(eSpecCtx which_mode,short which_type,short start_spec,location } } -cSpecial get_node(short cur_spec,short cur_spec_type) -{ +cSpecial get_node(short cur_spec,short cur_spec_type) { cSpecial dummy_node; dummy_node = scenario.scen_specials[0]; @@ -2095,8 +2075,7 @@ cSpecial get_node(short cur_spec,short cur_spec_type) // TODO: Make cur_spec_type an enum void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, - short *next_spec,short *next_spec_type,short *a,short *b,short *redraw) -{ + short *next_spec,short *next_spec_type,short *a,short *b,short *redraw) { bool check_mess = false; std::string str1,str2; short store_val = 0,i,j; @@ -2348,8 +2327,7 @@ void general_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, // TODO: What was next_spec_type for? Is it still needed? void oneshot_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, - short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) -{ + short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) { bool check_mess = true,set_sd = true; std::array strs; short i,j; @@ -2405,9 +2383,13 @@ void oneshot_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, for(i = 0; i < 3; i++) get_strs(strs[i * 2],strs[i * 2 + 1],cur_spec_type, spec.m1 + i * 2 + spec_str_offset[cur_spec_type],spec.m1 + i * 2 + 1 + spec_str_offset[cur_spec_type]); - if(spec.m2 > 0) - {buttons[0] = 1; buttons[1] = spec.ex1a; buttons[2] = spec.ex2a; - if((spec.ex1a >= 0) || (spec.ex2a >= 0)) buttons[0] = 20; } + if(spec.m2 > 0) { + buttons[0] = 1; + buttons[1] = spec.ex1a; + buttons[2] = spec.ex2a; + if((spec.ex1a >= 0) || (spec.ex2a >= 0)) + buttons[0] = 20; + } if(spec.m2 <= 0) {buttons[0] = spec.ex1a;buttons[1] = spec.ex2a;} if((buttons[0] < 0) && (buttons[1] < 0)) { giveError("Dialog box ended up with no buttons."); @@ -2529,8 +2511,7 @@ void oneshot_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, // TODO: What was next_spec_type for? Is it still needed? void affect_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, - short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) -{ + short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) { bool check_mess = true; short i,pc = 6,r1; cSpecial spec; @@ -2593,8 +2574,7 @@ void affect_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, } } break; - case eSpecType::DAMAGE: - { + case eSpecType::DAMAGE: { r1 = get_ran(spec.ex1a,1,spec.ex1b) + spec.ex2a; eDamageType dam_type = (eDamageType) spec.ex2b; if(pc < 0) { @@ -2923,8 +2903,7 @@ void affect_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, // TODO: What was next_spec_type for? Is it still needed? void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, - short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) -{ + short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) { bool check_mess = false; std::string str1, str2, str3; short i,j,k; @@ -3336,8 +3315,7 @@ void ifthen_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, } } -void set_terrain(location l, ter_num_t terrain_type) -{ +void set_terrain(location l, ter_num_t terrain_type) { ter_num_t former = univ.town->terrain(l.x,l.y); univ.town->terrain(l.x,l.y) = terrain_type; if(scenario.ter_types[terrain_type].special == eTerSpec::CONVEYOR) @@ -3348,8 +3326,7 @@ void set_terrain(location l, ter_num_t terrain_type) // TODO: What was next_spec_type for? Is it still needed? void townmode_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, - short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) -{ + short *next_spec,short */*next_spec_type*/,short *a,short *b,short *redraw) { static const char*const stairDlogs[8] = { "basic-stair-up.xml", "basic-stair-down.xml", "basic-slope-up.xml", "basic-slope-down.xml", @@ -3953,8 +3930,7 @@ void outdoor_spec(eSpecCtx which_mode,cSpecial cur_node,short cur_spec_type, } } -void setsd(short a,short b,short val) -{ +void setsd(short a,short b,short val) { if(!sd_legit(a,b)) { giveError("The scenario attempted to change an out of range Stuff Done flag."); return; @@ -3962,8 +3938,7 @@ void setsd(short a,short b,short val) PSD[a][b] = val; } -void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,short *a,short *b) -{ +void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,short *a,short *b) { eEncNoteType note_type; switch(cur_type) { case 0: @@ -4008,8 +3983,7 @@ void handle_message(eSpecCtx which_mode,short cur_type,short mess1,short mess2,s display_strings.show(); } -void get_strs(std::string& str1,std::string& str2,short cur_type,short which_str1,short which_str2) -{ +void get_strs(std::string& str1,std::string& str2,short cur_type,short which_str1,short which_str2) { short num_strs[3] = {260,108,135}; if(((which_str1 >= 0) && (which_str1 != minmax(0,num_strs[cur_type],which_str1))) || diff --git a/osx/boe.startup.cpp b/osx/boe.startup.cpp index feebea19..d5ef37c6 100644 --- a/osx/boe.startup.cpp +++ b/osx/boe.startup.cpp @@ -42,8 +42,7 @@ extern eGameMode overall_mode; RECT startup_button[6]; // TODO: Always returns false, so make it void -bool handle_startup_press(location the_point) -{ +bool handle_startup_press(location the_point) { std::string scen_name; short i,scen; @@ -117,8 +116,7 @@ bool handle_startup_press(location the_point) } /* -void start_game () -{ +void start_game () { init_party(0); setup_outdoors(party.p_loc); diff --git a/osx/boe.text.cpp b/osx/boe.text.cpp index 60f86b5f..e2cac559 100644 --- a/osx/boe.text.cpp +++ b/osx/boe.text.cpp @@ -111,8 +111,7 @@ extern sf::Texture bg_gworld; // Draws the pc area in upper right //void win_draw_string(WindowPtr dest_window,RECT dest_rect,char *str,short mode,short line_height) -void put_pc_screen() -{ +void put_pc_screen() { char to_draw[256]; short i = 0,j; RECT erase_rect = {17,2,98,269},to_draw_rect,from_rect; @@ -233,9 +232,8 @@ void put_pc_screen() // 4 - in shop, selling armor // 5 - in shop, selling all // 6 - in shop, augmenting weapon,shop_identify_cost is type -void put_item_screen(short screen_num,short suppress_buttons) // if suppress_buttons > 0, save time by not redrawing buttons -{ +void put_item_screen(short screen_num,short suppress_buttons) { std::ostringstream sout; short i_num,item_offset; short i = 0,j,pc; @@ -371,8 +369,7 @@ void put_item_screen(short screen_num,short suppress_buttons) item_stats_gworld.display(); } -void place_buy_button(short position,short pc_num,short item_num) -{ +void place_buy_button(short position,short pc_num,short item_num) { RECT dest_rect,source_rect; // TODO: The duplication of RECT here shouldn't be necessary... RECT button_sources[3] = {RECT{24,0,36,30},RECT{36,0,48,30},RECT{48,0,60,30}}; @@ -453,8 +450,7 @@ void place_buy_button(short position,short pc_num,short item_num) // name, use, give, drop, info, sell/id // shortcuts - if which_button_to_put is 10, all 4 buttons now // if which_button_to_put is 11, just right 2 -void place_item_button(short which_button_to_put,short which_slot,short which_button_position,short extra_val) -{ +void place_item_button(short which_button_to_put,short which_slot,short which_button_position,short extra_val) { RECT from_rect = {0,0,18,18},to_rect; if(which_button_position == 0) { // this means put little item graphic, extra val is which_graphic @@ -497,15 +493,13 @@ void place_item_button(short which_button_to_put,short which_slot,short which_bu rect_draw_some_item(invenbtn_gworld, from_rect, item_stats_gworld, to_rect, sf::BlendAlpha); } } -//RECT get_custom_rect (short which_rect) //// -//{ +//RECT get_custom_rect (short which_rect) { // RECT store_rect = {0,0,36,28}; // // OffsetRect(&store_rect,28 * (which_rect % 10),36 * (which_rect / 10)); // return store_rect; //} -void place_item_bottom_buttons() -{ +void place_item_bottom_buttons() { RECT pc_from_rect = {0,0,36,28},but_from_rect = {30,60,46,78},to_rect; RECT spec_from_rect = {0,60,15,95}, job_from_rect = {15,60,30,95}, help_from_rect = {46,60,59,76}; // TODO: What about when the buttons are pressed? @@ -530,8 +524,7 @@ void place_item_bottom_buttons() rect_draw_some_item(invenbtn_gworld, help_from_rect, item_stats_gworld, to_rect, sf::BlendAlpha); } -void set_stat_window(short new_stat) -{ +void set_stat_window(short new_stat) { short i,array_pos = 0; stat_window = new_stat; @@ -563,8 +556,7 @@ void set_stat_window(short new_stat) } -short first_active_pc() -{ +short first_active_pc() { short i = 0; for(i = 0; i < 6; i++) @@ -574,8 +566,7 @@ short first_active_pc() } -void refresh_stat_areas(short mode) -{ +void refresh_stat_areas(short mode) { short i; sf::BlendMode x; // TODO: The duplication of RECT here shouldn't be necessary... @@ -602,8 +593,7 @@ void refresh_stat_areas(short mode) //// // get job info gone -short total_encumberance(short pc_num) -{ +short total_encumberance(short pc_num) { short store = 0,i,what_val; for(i = 0; i < 24; i++) @@ -754,8 +744,7 @@ void print_party_stats() { } -short do_look(location space) -{ +short do_look(location space) { short i,j,num_items = 0; bool gold_here = false, food_here = false, is_lit = true; location from_where; @@ -908,8 +897,7 @@ short do_look(location space) return print_terrain(space); } -short town_boat_there(location where) -{ +short town_boat_there(location where) { short i; // Num boats stores highest # of boat in town @@ -919,8 +907,7 @@ short town_boat_there(location where) return i; return 30; } -short out_boat_there(location where) -{ +short out_boat_there(location where) { short i; for(i = 0; i < 30; i++) @@ -930,8 +917,7 @@ short out_boat_there(location where) return 30; } -short town_horse_there(location where) -{ +short town_horse_there(location where) { short i; // Num boats stores highest # of boat in town @@ -941,8 +927,7 @@ short town_horse_there(location where) return i; return 30; } -short out_horse_there(location where) -{ +short out_horse_there(location where) { short i; for(i = 0; i < 30; i++) @@ -951,8 +936,7 @@ short out_horse_there(location where) return i; return 30; } -void notify_out_combat_began(cOutdoors::cWandering encounter,short *nums) -{ +void notify_out_combat_began(cOutdoors::cWandering encounter,short *nums) { short i; std::string msg; @@ -978,15 +962,13 @@ void notify_out_combat_began(cOutdoors::cWandering encounter,short *nums) } } -std::string get_m_name(m_num_t num) -{ +std::string get_m_name(m_num_t num) { //// //strcpy((char *) str,(char *) scenario.scen_monsters[num].m_name); return scenario.scen_monsters[num].m_name; } -std::string get_ter_name(ter_num_t num) -{ +std::string get_ter_name(ter_num_t num) { std::string store_name = "Pit"; //// @@ -998,15 +980,13 @@ std::string get_ter_name(ter_num_t num) return store_name; } -void print_monst_name(m_num_t m_type) -{ +void print_monst_name(m_num_t m_type) { std::string msg = get_m_name(m_type) + ':'; add_string_to_buf((char *) msg.c_str()); } -void print_monst_attacks(m_num_t m_type,short target) //short target; // < 100 - pc >= 100 monst -{ +void print_monst_attacks(m_num_t m_type,short target) { //char store_string3[60]; std::string msg = get_m_name(m_type); @@ -1019,8 +999,7 @@ void print_monst_attacks(m_num_t m_type,short target) } //// -void damaged_message(short damage,short type) -{ +void damaged_message(short damage,short type) { std::ostringstream sout; sout << " " << get_str("monster-abilities",130 + type); sout << " for " << damage; @@ -1028,15 +1007,13 @@ void damaged_message(short damage,short type) } // This prepares the monster's string for the text bar -std::string print_monster_going(m_num_t m_num,short ap) -{ +std::string print_monster_going(m_num_t m_num,short ap) { std::ostringstream sout(get_m_name(m_num)); sout << " (ap: " << ap << ')'; return sout.str(); } -void monst_spell_note(m_num_t number,short which_mess) -{ +void monst_spell_note(m_num_t number,short which_mess) { std::string msg = get_m_name(number); switch(which_mess) { case 1: @@ -1202,9 +1179,8 @@ void monst_spell_note(m_num_t number,short which_mess) add_string_to_buf((char *) msg.c_str()); } -void monst_cast_spell_note(m_num_t number,short spell,short type) //short type; // 0 - mage 1- priest -{ +void monst_cast_spell_note(m_num_t number,short spell,short type) { std::string msg = get_m_name(number); msg += " casts:"; add_string_to_buf((char *) msg.c_str()); @@ -1213,16 +1189,14 @@ void monst_cast_spell_note(m_num_t number,short spell,short type) add_string_to_buf((char *) msg.c_str()); } -void monst_breathe_note(m_num_t number) -{ +void monst_breathe_note(m_num_t number) { std::string msg = get_m_name(number); msg += " breathes."; add_string_to_buf((char *) msg.c_str()); } -void monst_damaged_mes(short which_m,short how_much,short how_much_spec) -{ +void monst_damaged_mes(short which_m,short how_much,short how_much_spec) { std::string msg = get_m_name(univ.town.monst[which_m].number); msg = " " + msg + " takes "; std::ostringstream sout(msg); @@ -1233,23 +1207,20 @@ void monst_damaged_mes(short which_m,short how_much,short how_much_spec) add_string_to_buf((char *) msg.c_str()); } -void monst_killed_mes(short which_m) -{ +void monst_killed_mes(short which_m) { std::string msg = get_m_name(univ.town.monst[which_m].number); msg = " " + msg + " dies."; add_string_to_buf((char *) msg.c_str()); } -void print_nums(short a,short b,short c) -{ +void print_nums(short a,short b,short c) { std::ostringstream sout; sout << "debug: " << a << ' ' << b << ' ' << c; add_string_to_buf((char *) sout.str().c_str()); } -short print_terrain(location space) -{ +short print_terrain(location space) { ter_num_t which_terrain; if(overall_mode == MODE_LOOK_OUTDOORS) { @@ -1265,8 +1236,7 @@ short print_terrain(location space) } -void add_string_to_buf(std::string str, unsigned short indent) -{ +void add_string_to_buf(std::string str, unsigned short indent) { if(overall_mode == MODE_STARTUP) return; @@ -1352,16 +1322,14 @@ void add_string_to_buf(std::string str, unsigned short indent) } -void init_buf() -{ +void init_buf() { short i; for(i = 0; i < TEXT_BUF_LEN; i++) sprintf((char *) text_buffer[buf_pointer].line, " "); } -void print_buf () -{ +void print_buf () { short num_lines_printed = 0,ctrl_val; short line_to_print; short start_print_point; @@ -1402,19 +1370,16 @@ void print_buf () text_area_gworld.display(); } -void restart_printing() -{ +void restart_printing() { lines_to_print = 0; //clear_text_panel(); } -void restore_mode() -{ +void restore_mode() { overall_mode = store_mode; } -void through_sending() -{ +void through_sending() { mark_where_printing_long = buf_pointer + LINES_IN_TEXT_WIN - 1; if(mark_where_printing_long > TEXT_BUF_LEN - 1) mark_where_printing_long -= TEXT_BUF_LEN; @@ -1423,8 +1388,7 @@ void through_sending() /* Draw a bitmap in the world window. hor in 0 .. 8, vert in 0 .. 8, object is ptr. to bitmap to be drawn, and masking is for Copybits. */ -void Draw_Some_Item (sf::Texture& src_gworld, RECT src_rect, sf::RenderTarget& targ_gworld,location target, char masked, short main_win) -{ +void Draw_Some_Item (sf::Texture& src_gworld, RECT src_rect, sf::RenderTarget& targ_gworld,location target, char masked, short main_win) { RECT destrec = {0,0,36,28}; if((target.x < 0) || (target.y < 0) || (target.x > 8) || (target.y > 8)) @@ -1449,8 +1413,7 @@ void Draw_Some_Item (sf::Texture& src_gworld, RECT src_rect, sf::RenderTarget& t } // TODO: This seems to duplicate logic found in graphtool to get a rect from a picture index -RECT coord_to_rect(short i,short j) -{ +RECT coord_to_rect(short i,short j) { RECT to_return; to_return.left = 13 + BITMAP_WIDTH * i; @@ -1462,22 +1425,19 @@ RECT coord_to_rect(short i,short j) } -void make_cursor_sword() -{ +void make_cursor_sword() { set_cursor(sword_curs); } -short calc_day() -{ +short calc_day() { return (short) ((univ.party.age) / 3700) + 1; } -bool day_reached(unsigned char which_day, unsigned char which_event) // which_day is day event should happen // which_event is the univ.party.key_times value to cross reference with. // if the key_time is reached before which_day, event won't happen // if it's 0, event always happens -{ +bool day_reached(unsigned char which_day, unsigned char which_event) { // Windows version unconditionally added 20 days for no reason at all. // Instead, let's add 10 days, but only if easy mode enabled. if(PSD[SDF_EASY_MODE]) which_day += 10; diff --git a/osx/boe.town.cpp b/osx/boe.town.cpp index 6a91ad66..5249a7d3 100644 --- a/osx/boe.town.cpp +++ b/osx/boe.town.cpp @@ -113,16 +113,14 @@ RECT map_title_rect = {3,50,15,300}; RECT map_bar_rect = {15,50,27,300}; unsigned char map_graphic_placed[8][64]; // keeps track of what's been filled on map -void force_town_enter(short which_town,location where_start) -{ +void force_town_enter(short which_town,location where_start) { town_force = which_town; town_force_loc = where_start; } //// -void start_town_mode(short which_town, short entry_dir) //short entry_dir; // if 9, go to forced -{ +void start_town_mode(short which_town, short entry_dir) { short i,m,n; char message[60]; short j,k,town_number; @@ -250,15 +248,13 @@ void start_town_mode(short which_town, short entry_dir) // Now, appearing/disappearing monsters might have arrived/disappeared. case 1: - if(day_reached(univ.town.monst[j].monster_time, univ.town.monst[j].time_code)) - { + if(day_reached(univ.town.monst[j].monster_time, univ.town.monst[j].time_code)) { univ.town.monst[j].active = 1; univ.town.monst[j].time_flag=0; // Now remove time flag so it doesn't get reappearing } break; case 2: - if(day_reached(univ.town.monst[j].monster_time, univ.town.monst[j].time_code)) - { + if(day_reached(univ.town.monst[j].monster_time, univ.town.monst[j].time_code)) { univ.town.monst[j].active = 0; univ.town.monst[j].time_flag=0; // Now remove time flag so it doesn't get disappearing again } @@ -375,14 +371,12 @@ void start_town_mode(short which_town, short entry_dir) // Thrash town? - if(univ.party.m_killed[univ.town.num] > univ.town->max_num_monst) - { + if(univ.party.m_killed[univ.town.num] > univ.town->max_num_monst) { town_toast = true; add_string_to_buf("Area has been cleaned out."); } if(univ.town->town_chop_time > 0) { - if(day_reached(univ.town->town_chop_time,univ.town->town_chop_key)) - { + if(day_reached(univ.town->town_chop_time,univ.town->town_chop_key)) { add_string_to_buf("Area has been abandoned."); for(i = 0; i < univ.town->max_monst(); i++) if((univ.town.monst[i].active > 0) && (univ.town.monst[i].active < 10) && @@ -532,8 +526,10 @@ void start_town_mode(short which_town, short entry_dir) univ.party[m].items[n].variety = eItemType::NO_ITEM; } - for(i = 0; i < univ.town->max_monst(); i++) - {univ.town.monst[i].targ_loc.x = 0; univ.town.monst[i].targ_loc.y = 0;} + for(i = 0; i < univ.town->max_monst(); i++) { + univ.town.monst[i].targ_loc.x = 0; + univ.town.monst[i].targ_loc.y = 0; + } //// check horses for(i = 0; i < 30; i++) { @@ -560,8 +556,7 @@ void start_town_mode(short which_town, short entry_dir) } -location end_town_mode(short switching_level,location destination) // returns new party location -{ +location end_town_mode(short switching_level,location destination) { // returns new party location location to_return; bool data_saved = false,combat_end = false; short i,j,k; @@ -705,8 +700,7 @@ void handle_leave_town_specials(short /*town_number*/, short which_spec,location queue_special(eSpecCtx::LEAVE_TOWN, 2, which_spec, univ.party.p_loc); } -bool abil_exists(eItemAbil abil) // use when outdoors -{ +bool abil_exists(eItemAbil abil) { // use when outdoors short i,j; for(i = 0; i < 6; i++) @@ -724,8 +718,7 @@ bool abil_exists(eItemAbil abil) // use when outdoors -void start_town_combat(short direction) -{ +void start_town_combat(short direction) { short i; place_party(direction); @@ -765,8 +758,7 @@ void start_town_combat(short direction) } -short end_town_combat() -{ +short end_town_combat() { short num_tries = 0,r1,i; r1 = get_ran(1,0,5); @@ -783,8 +775,7 @@ short end_town_combat() return univ.party[r1].dir; } -void place_party(short direction) -{ +void place_party(short direction) { bool spot_ok[14] = {true,true,true,true,true,true,true, true,true,true,true,true,true,true}; location pos_locs[14]; @@ -839,9 +830,8 @@ void place_party(short direction) } } -void create_out_combat_terrain(short type,short num_walls,short /*spec_code*/) // spec_code is encounter's spec_code -{ +void create_out_combat_terrain(short type,short num_walls,short /*spec_code*/) { short i,j,k,r1,ter_type; static const short ter_base[16] = { 2,0,36,50,71,0,0,0, @@ -1064,8 +1054,7 @@ void create_out_combat_terrain(short type,short num_walls,short /*spec_code*/) } -void elim_monst(unsigned short which,short spec_a,short spec_b) -{ +void elim_monst(unsigned short which,short spec_a,short spec_b) { short i; if(!sd_legit(spec_a,spec_b)) @@ -1081,9 +1070,8 @@ void elim_monst(unsigned short which,short spec_a,short spec_b) -void dump_gold(short print_mes) //short print_mes; // 0 - no 1 - yes -{ +void dump_gold(short print_mes) { // Mildly kludgy gold check if(univ.party.gold > 30000) { univ.party.gold = 30000; @@ -1105,8 +1093,7 @@ void dump_gold(short print_mes) -void pick_lock(location where,short pc_num) -{ +void pick_lock(location where,short pc_num) { ter_num_t terrain; short r1,which_item; bool will_break = false; @@ -1154,8 +1141,7 @@ void pick_lock(location where,short pc_num) } } -void bash_door(location where,short pc_num) //// -{ +void bash_door(location where,short pc_num) { ter_num_t terrain; short r1,unlock_adjust; @@ -1180,8 +1166,7 @@ void bash_door(location where,short pc_num) //// } -void erase_specials()//// -{ +void erase_specials() { location where; short k,sd1,sd2; cSpecial sn; @@ -1223,8 +1208,7 @@ void erase_specials()//// } } -void erase_out_specials() -{ +void erase_out_specials() { short out_num; cSpecial sn; @@ -1269,8 +1253,7 @@ void erase_out_specials() } // returns id # of special at where, or 50 if there is none. -short get_town_spec_id(location where) -{ +short get_town_spec_id(location where) { short i = 0; while((univ.town->special_locs[i] != where) && (i < 50)) @@ -1279,8 +1262,7 @@ short get_town_spec_id(location where) } // TODO: I don't think we need this -void clear_map() -{ +void clear_map() { RECT map_world_rect(map_gworld); // if(!map_visible) { @@ -1389,8 +1371,7 @@ void draw_map(bool need_refresh) { title_string = "No map in combat."; canMap = false; } - else if((is_town()) && ((univ.town.num == -1) || (univ.town.num == -1))) - { + else if((is_town()) && ((univ.town.num == -1) || (univ.town.num == -1))) { title_string = "No map here."; canMap = false; }else if((is_town() && univ.town->defy_mapping)) { @@ -1419,8 +1400,7 @@ void draw_map(bool need_refresh) { for(where.x= area_to_put_on_map_rect.left; where.x < area_to_put_on_map_rect.right; where.x++) for(where.y= area_to_put_on_map_rect.top; where.y < area_to_put_on_map_rect.bottom; where.y++) - if((map_graphic_placed[where.x / 8][where.y] & (unsigned char)(s_pow(2,where.x % 8))) == 0) - { + if((map_graphic_placed[where.x / 8][where.y] & (unsigned char)(s_pow(2,where.x % 8))) == 0) { draw_rect = orig_draw_rect; draw_rect.offset(6 * where.x + small_adj, 6 * where.y + small_adj); @@ -1576,8 +1556,7 @@ void draw_map(bool need_refresh) { -bool is_door(location destination) -{ +bool is_door(location destination) { if(scenario.ter_types[univ.town->terrain(destination.x,destination.y)].special == eTerSpec::UNLOCKABLE || scenario.ter_types[univ.town->terrain(destination.x,destination.y)].special == eTerSpec::CHANGE_WHEN_STEP_ON) @@ -1586,8 +1565,7 @@ bool is_door(location destination) } -void display_map() -{ +void display_map() { // Show the automap if it's not already visible if(map_visible) return; RECT the_rect; @@ -1602,8 +1580,7 @@ void display_map() void check_done() { } -bool quadrant_legal(short i, short j) -{ +bool quadrant_legal(short i, short j) { if(univ.party.outdoor_corner.x + i >= scenario.out_width) return false; if(univ.party.outdoor_corner.y + j >= scenario.out_height) diff --git a/osx/boe.townspec.cpp b/osx/boe.townspec.cpp index 1ae93357..90d7a493 100644 --- a/osx/boe.townspec.cpp +++ b/osx/boe.townspec.cpp @@ -35,8 +35,7 @@ extern cUniverse univ; char answer[256]; /*bool (which) -short which; -{ +short which; { short choice,i; item_record_type treas[] = { {0,0,0,0,0,0,0,0,0,0,0,0,false,false,false,{0,0},"",""} @@ -59,8 +58,7 @@ short which; -void activate_monster_enc(short enc_num,std::string list,short str,short strsnd,short *flip_bit) -{ +void activate_monster_enc(short enc_num,std::string list,short str,short strsnd,short *flip_bit) { if(*flip_bit == 0) { cStrDlog display_enc_string(get_str(list,str),"","",8,PIC_DLOG); display_enc_string.setSound(strsnd); @@ -70,12 +68,11 @@ void activate_monster_enc(short enc_num,std::string list,short str,short strsnd, } } -bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) //short pc_num; // 6 - BOOM! 7 - pick here //short trap_type; // 0 - random 1 - blade 2 - dart 3 - gas 4 - boom 5 - paralyze 6 - no // 7 - level drain 8 - alert 9 - big flames 10 - dumbfound 11 - disease 1 // 12 - disease all -{ +bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) { short r1,skill,i,num_hits = 1,i_level; short trap_odds[30] = {5,30,35,42,48, 55,63,69,75,77, 78,80,82,84,86, 88,90,92,94,96,98,99,99,99,99,99,99,99,99,99}; @@ -204,8 +201,7 @@ bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) return true; } -location get_spec_loc(short which) -{ +location get_spec_loc(short which) { location where; short i; @@ -218,8 +214,7 @@ location get_spec_loc(short which) // 0 if no pull. // 1 if pull // levers should always start to left. -short handle_lever(location w) -{ +short handle_lever(location w) { if(cChoiceDlog("basic-lever.xml",{"pull", "leave"}).show() == "leave") return 0; play_sound(94); @@ -227,8 +222,7 @@ short handle_lever(location w) return 1; } -void switch_lever(location w) -{ +void switch_lever(location w) { alter_space(w.x,w.y,scenario.ter_types[univ.town->terrain(w.x,w.y)].trans_to_what); } diff --git a/osx/pcedit/pc.action.cpp b/osx/pcedit/pc.action.cpp index c88b16dd..c1eb4f41 100644 --- a/osx/pcedit/pc.action.cpp +++ b/osx/pcedit/pc.action.cpp @@ -53,9 +53,8 @@ extern RECT edit_rect[5][2]; //extern RECT pc_area_buttons[6][6] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later //extern RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 - -bool handle_action(sf::Event event) //short mode; // ignore, -{ +bool handle_action(sf::Event event) { short i; location the_point; @@ -113,8 +112,7 @@ bool handle_action(sf::Event event) return to_return; } -void flash_rect(RECT /*to_flash*/) -{ +void flash_rect(RECT /*to_flash*/) { // TODO: Think of a good way to do this //InvertRect (&to_flash); @@ -122,16 +120,14 @@ void flash_rect(RECT /*to_flash*/) sf::sleep(time_in_ticks(5)); } -static bool get_num_event_filter(cDialog& me, std::string id, eKeyMod) -{ +static bool get_num_event_filter(cDialog& me, std::string id, eKeyMod) { me.toast(id == "okay"); me.setResult(me["number"].getTextAsNum()); return true; } -void edit_gold_or_food(short which_to_edit) //0 - gold 1 - food -{ +void edit_gold_or_food(short which_to_edit) { location view_loc; @@ -153,8 +149,7 @@ void edit_gold_or_food(short which_to_edit) univ.party.food = dialog_answer; } -void edit_day() -{ +void edit_day() { location view_loc; @@ -173,8 +168,7 @@ void edit_day() univ.party.age = (long long) (3700) * (long long) (dialog_answer); } -void combine_things(short pc_num) -{ +void combine_things(short pc_num) { short i,j,test; for(i = 0; i < 24; i++) { @@ -203,8 +197,7 @@ void combine_things(short pc_num) } } -bool give_to_pc(short pc_num,cItemRec item, short /*print_result*/) -{ +bool give_to_pc(short pc_num,cItemRec item, short /*print_result*/) { short free_space; if(item.variety == eItemType::NO_ITEM) @@ -219,8 +212,7 @@ bool give_to_pc(short pc_num,cItemRec item, short /*print_result*/) return false; } -bool give_to_party(cItemRec item,short print_result) -{ +bool give_to_party(cItemRec item,short print_result) { short i = 0; while(i < 6) { @@ -231,21 +223,18 @@ bool give_to_party(cItemRec item,short print_result) return false; } -void give_gold(short amount,bool /*print_result*/) -{ +void give_gold(short amount,bool /*print_result*/) { univ.party.gold = univ.party.gold + amount; } -bool take_gold(short amount,bool /*print_result*/) -{ +bool take_gold(short amount,bool /*print_result*/) { if(univ.party.gold < amount) return false; univ.party.gold = univ.party.gold - amount; return true; } -short pc_has_space(short pc_num) -{ +short pc_has_space(short pc_num) { short i = 0; while(i < 24) { @@ -256,9 +245,8 @@ short pc_has_space(short pc_num) return 24; } -void take_item(short pc_num,short which_item) //short pc_num,which_item; // if which_item > 20, don't update stat win, item is which_item - 20 -{ +void take_item(short pc_num,short which_item) { short i; if(univ.party[pc_num].weap_poisoned == which_item && univ.party[pc_num].status[eStatus::POISONED_WEAPON] > 0) { @@ -277,8 +265,7 @@ void take_item(short pc_num,short which_item) } -void edit_xp(cPlayer *pc) -{ +void edit_xp(cPlayer *pc) { location view_loc; make_cursor_sword(); diff --git a/osx/pcedit/pc.editors.cpp b/osx/pcedit/pc.editors.cpp index 9f06cbad..4642de90 100644 --- a/osx/pcedit/pc.editors.cpp +++ b/osx/pcedit/pc.editors.cpp @@ -109,9 +109,8 @@ static bool select_pc_event_filter (cDialog& me, std::string item_hit, eKeyMod) return true; } -short char_select_pc(short active_only,short free_inv_only,const char *title) //active_only; // 0 - no 1 - yes 2 - disarm trap -{ +short char_select_pc(short active_only,short free_inv_only,const char *title) { short item_hit,i; make_cursor_sword(); @@ -141,16 +140,14 @@ short char_select_pc(short active_only,short free_inv_only,const char *title) return item_hit; } -short select_pc(short active_only,short free_inv_only) //active_only; // 0 - no 1 - yes 2 - disarm trap -{ +short select_pc(short active_only,short free_inv_only) { if(active_only == 2) return char_select_pc(active_only,free_inv_only,"Trap! Who will disarm?"); else return char_select_pc(active_only,free_inv_only,"Select a character:"); } -static short party_total_level() -{ +static short party_total_level() { short i,j = 0; for(i = 0; i < 6; i++) @@ -225,8 +222,7 @@ void display_pc(short pc_num,short mode, cDialog* parent) { pcInfo.run(); } -static void display_traits_graphics(cDialog& me) -{ +static void display_traits_graphics(cDialog& me) { short i,store; std::string race = "race" + boost::lexical_cast(int(store_pc->race) + 1); @@ -286,9 +282,8 @@ static bool pick_race_select_led(cDialog& me, std::string item_hit, bool losing, return store_trait_mode == 0; } -void pick_race_abil(cPlayer *pc,short mode) //mode; // 0 - edit 1 - just display 2 - can't change race -{ +void pick_race_abil(cPlayer *pc,short mode) { using namespace std::placeholders; static const char*const start_str1 = "Click on button by name for description."; static const char*const start_str2 = "Click on advantage button to add/remove."; @@ -321,8 +316,7 @@ const char* alch_names[20] = { "Strong Strength (10)","Bliss (16)","Strong Power (20)" }; -void display_alchemy(bool allowEdit) -{ +void display_alchemy(bool allowEdit) { short i; make_cursor_sword(); @@ -353,8 +347,7 @@ void display_alchemy(bool allowEdit) // TODO: This dialog needs some kind of context system really badly to avoid the rampant globals // MARK: Start spend XP dialog -static void do_xp_keep(short pc_num,short mode,std::map& store_skills) -{ +static void do_xp_keep(short pc_num,short mode,std::map& store_skills) { for(i = 0; i < 19; i++) { eSkill skill = eSkill(i); univ.party[pc_num].skills[skill] = store_skills[skill]; @@ -369,8 +362,7 @@ static void do_xp_keep(short pc_num,short mode,std::map& store_ski } -static void draw_xp_skills(cDialog& me,std::map& store_skills) -{ +static void draw_xp_skills(cDialog& me,std::map& store_skills) { short i; // TODO: Wouldn't it make more sense for it to be red when you can't buy the skill rather than red when you can? for(i = 0; i < 19; i++) { @@ -598,10 +590,9 @@ static bool spend_xp_event_filter(cDialog& me, std::string item_hit, eKeyMod mod return true; } -bool spend_xp(short pc_num, short mode, cDialog* parent) //short mode; // 0 - create 1 - train // returns 1 if cancelled -{ +bool spend_xp(short pc_num, short mode, cDialog* parent) { using namespace std::placeholders; store_train_pc = pc_num; store_train_mode = mode; diff --git a/osx/pcedit/pc.fileio.cpp b/osx/pcedit/pc.fileio.cpp index b260996d..050d9507 100644 --- a/osx/pcedit/pc.fileio.cpp +++ b/osx/pcedit/pc.fileio.cpp @@ -50,13 +50,11 @@ bool load_scen_item_defs(char scen_name[256]); extern fs::path progDir; -void leave_town() -{ +void leave_town() { store_flags[0] = 5790; } -void remove_party_from_scen() -{ +void remove_party_from_scen() { store_flags[1] = 200; party_in_scen = false; load_base_item_defs(); @@ -66,8 +64,7 @@ void remove_party_from_scen() * XXX This was referenced but not defined, so I copied the implementation * from blxfileio.c. Need to check that it's OK. */ -short init_data(short flag) -{ +short init_data(short flag) { long k = 0; k = (long) flag; diff --git a/osx/pcedit/pc.graphics.cpp b/osx/pcedit/pc.graphics.cpp index addd3053..14e1723a 100644 --- a/osx/pcedit/pc.graphics.cpp +++ b/osx/pcedit/pc.graphics.cpp @@ -63,8 +63,7 @@ sf::Texture items_gworld,tiny_obj_gworld,fields_gworld,roads_gworld,boom_gworld, sf::Texture monst_gworld[NUM_MONST_SHEETS],terrain_gworld[NUM_TER_SHEETS],anim_gworld,talkfaces_gworld; sf::Texture vehicle_gworld, small_ter_gworld; -void init_main_buttons() -{ +void init_main_buttons() { short i; int indent = 0, indent2 = 0; @@ -87,8 +86,7 @@ void init_main_buttons() pc_area_buttons[0][0].top=pc_info_rect.top; pc_area_buttons[0][0].bottom=pc_area_buttons[0][0].top + 56; - for(i=0; i<6; i++) - { + for(i=0; i<6; i++) { pc_area_buttons[i][0].left = 20; pc_area_buttons[i][0].right = pc_area_buttons[0][0].left + 56; pc_area_buttons[i][2].left = 20; @@ -225,8 +223,7 @@ void init_main_buttons() } -void Set_up_win () -{ +void Set_up_win () { title_gworld.loadFromImage(*ResMgr::get("pcedtitle")); invenbtn_gworld.loadFromImage(*ResMgr::get("invenbtns")); status_gworld.loadFromImage(*ResMgr::get("staticons")); @@ -240,8 +237,7 @@ static void display_party(); static void draw_items(); -void redraw_screen() -{ +void redraw_screen() { draw_main_screen(); display_party(); draw_items(); @@ -256,8 +252,7 @@ static void frame_dlog_rect(sf::RenderWindow& target, RECT rect) { text.draw(); } -void draw_main_screen() -{ +void draw_main_screen() { RECT source_rect, dest_rec,dest_rect; RECT reg_rect; @@ -324,8 +319,7 @@ void draw_main_screen() } // TODO: Not quite sure what the first parameter is for -void do_button_action(short /*which_pc*/,short which_button) -{ +void do_button_action(short /*which_pc*/,short which_button) { current_pressed_button = which_button; redraw_screen(); @@ -337,9 +331,8 @@ void do_button_action(short /*which_pc*/,short which_button) //extern RECT pc_area_buttons[6][6] ; // 0 - whole 1 - pic 2 - name 3 - stat strs 4,5 - later //extern RECT item_string_rects[24][4]; // 0 - name 1 - drop 2 - id 3 - -void draw_items() //short clear_first; // 0 - redraw over, 1 - don't redraw over -{ +void draw_items() { short i; char to_draw[256]; RECT d_from = {12,28,24,42},i_from = {12,42,24,56},dest_rect; @@ -396,10 +389,9 @@ void draw_items() } -void display_party() //short mode; // 0 - 5 this pc, 6 - all //short clear_first; // 1 - redraw over what's already there, 0 - don't redraw over -{ +void display_party() { short i,k,string_num, cur_rect=0; char to_draw[256], skill_value[256]; RECT from_base = {0,0,36,28},from_rect,no_party_rect,temp_rect; @@ -487,8 +479,7 @@ void display_party() style.font = FONT_PLAIN; style.lineHeight = 9; string_num=1; - for( k = 0; k < 19 ; ++k) - { + for( k = 0; k < 19 ; ++k) { temp_rect = pc_skills_rect[k]; temp_rect.left = pc_skills_rect[k].left + 80; @@ -1047,8 +1038,7 @@ void record_display_strings(){} // p2cstr(str); //} -void make_cursor_sword() -{ +void make_cursor_sword() { set_cursor(sword_curs); } diff --git a/osx/pcedit/pc.main.cpp b/osx/pcedit/pc.main.cpp index 639aac12..bbb34703 100644 --- a/osx/pcedit/pc.main.cpp +++ b/osx/pcedit/pc.main.cpp @@ -127,8 +127,7 @@ int main(int /*argc*/, char* argv[]) { // //MW specified argument and return type. -void Initialize(void) -{ +void Initialize(void) { check_for_intel(); @@ -151,8 +150,7 @@ void Initialize(void) mainPtr.create(sf::VideoMode(590, 440), "Blades of Exile Character Editor", sf::Style::Titlebar | sf::Style::Close); } -void Handle_One_Event() -{ +void Handle_One_Event() { if(!mainPtr.pollEvent(event)) return; init_main_buttons(); @@ -179,8 +177,7 @@ void Handle_One_Event() } } -void Mouse_Pressed() -{ +void Mouse_Pressed() { bool try_to_end; try_to_end = handle_action(event); @@ -188,8 +185,7 @@ void Mouse_Pressed() All_Done = verify_restore_quit(false); } -void handle_apple_menu(int item_hit) -{ +void handle_apple_menu(int item_hit) { //char desk_acc_name[256]; //short desk_acc_num; @@ -204,8 +200,7 @@ void handle_apple_menu(int item_hit) } } -void handle_file_menu(int item_hit) -{ +void handle_file_menu(int item_hit) { fs::path file; switch(item_hit) { @@ -244,8 +239,7 @@ static void display_strings(short nstr, pic_num_t pic) { display_strings.show(); } -void handle_extra_menu(int item_hit) -{ +void handle_extra_menu(int item_hit) { short i; //cVehicle v_boat = {{12,17},{0,0},{0,0},80,true,false}; @@ -333,8 +327,7 @@ void handle_extra_menu(int item_hit) redraw_screen(); } -void handle_edit_menu(int item_hit) -{ +void handle_edit_menu(int item_hit) { short i,j,k; if(file_in_mem.empty()) { @@ -448,8 +441,7 @@ void handle_edit_menu(int item_hit) //} // TODO: Let this take the item directly instead of the index -void handle_item_menu(int item_hit) -{ +void handle_item_menu(int item_hit) { cItemRec store_i; if(file_in_mem.empty()) { @@ -461,16 +453,14 @@ void handle_item_menu(int item_hit) give_to_pc(current_active_pc,store_i,false); } -//void set_cursor(CursHandle which_curs) -//{ +//void set_cursor(CursHandle which_curs) { // HLock ((Handle) which_curs); // SetCursor (*which_curs); // HUnlock((Handle) which_curs); //} -bool verify_restore_quit(bool mode) //short mode; // 0 - quit 1- restore -{ +bool verify_restore_quit(bool mode) { std::string choice; if(file_in_mem.empty()) @@ -485,8 +475,7 @@ bool verify_restore_quit(bool mode) return true; } -//pascal bool cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit) -//{ +//pascal bool cd_event_filter (DialogPtr hDlg, EventRecord *event, short *dummy_item_hit) { // char chr,chr2; // short the_type,wind_hit,item_hit; // Handle the_handle = NULL; diff --git a/osx/scenedit/scen.actions.cpp b/osx/scenedit/scen.actions.cpp index 86e87b2e..208686cb 100644 --- a/osx/scenedit/scen.actions.cpp +++ b/osx/scenedit/scen.actions.cpp @@ -173,8 +173,7 @@ bool handle_action(location the_point,sf::Event /*event*/) { draw_lb_slot(i,0); mainPtr.display(); if(overall_mode == MODE_INTRO_SCREEN) { - switch(i) - { + switch(i) { case 3: // new if(build_scenario()){ overall_mode = MODE_MAIN_SCREEN; @@ -199,8 +198,7 @@ bool handle_action(location the_point,sf::Event /*event*/) { } } else if((overall_mode == MODE_MAIN_SCREEN) || (overall_mode == MODE_EDIT_TYPES)) { - switch(i) - { + switch(i) { case 0: break; @@ -300,8 +298,7 @@ bool handle_action(location the_point,sf::Event /*event*/) { draw_rb_slot(i + right_top,0); mainPtr.display(); change_made = true; - switch(right_hit / 1000) - { + switch(right_hit / 1000) { case 1: edit_ter_type(j); update_item_menu(); @@ -441,8 +438,7 @@ bool handle_action(location the_point,sf::Event /*event*/) { erasing_mode = true; mouse_button_held = true; } - else - { + else { mouse_button_held = true; set_cursor(wand_curs); set_terrain(spot_hit,current_terrain_type); @@ -1268,8 +1264,7 @@ void swap_terrain() { if(a < 0) return; for(i = 0; i < ((editing_town) ? town->max_dim() : 48); i++) - for(j = 0; j < ((editing_town) ? town->max_dim() : 48); j++) - { + for(j = 0; j < ((editing_town) ? town->max_dim() : 48); j++) { ter = (editing_town) ? town->terrain(i,j) : current_terrain.terrain[i][j]; if((ter == a) && (get_ran(1,1,100) <= c)) { if(editing_town) @@ -1326,8 +1321,7 @@ void handle_keystroke(char chr,char chr2,sf::Event event) { store_ter = current_terrain_type; - switch(chr) - { + switch(chr) { /* case 'g': set_new_terrain(current_ground); @@ -1997,12 +1991,10 @@ bool fix_cave(location l) { else { // not edge */ if(!is_wall(i-1,j)) { - if(!is_wall(i,j-1)) - { + if(!is_wall(i,j-1)) { ter_to_fix = 11; } - else - { + else { if(!is_wall(i,j+1)) ter_to_fix = 14; else ter_to_fix = 12; @@ -2013,8 +2005,7 @@ bool fix_cave(location l) { } else { // wall(i-1,j) - if(!is_wall(i+1,j)) - { + if(!is_wall(i+1,j)) { if(!is_wall(i, j-1)) ter_to_fix = 8; else if(!is_wall(i,j+1)) @@ -2023,9 +2014,8 @@ bool fix_cave(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_wall(i, j-1)) ter_to_fix = 9; else if(!is_wall(i,j+1)) @@ -2094,12 +2084,10 @@ bool fix_mountain(location l) { else { // not edge if(!is_mountain(i-1,j)) { - if(!is_mountain(i,j-1)) - { + if(!is_mountain(i,j-1)) { ter_to_fix = 29; } - else - { + else { if(!is_mountain(i,j+1)) ter_to_fix = 31; else ter_to_fix = 30; @@ -2110,8 +2098,7 @@ bool fix_mountain(location l) { } else { // wall(i-1,j) - if(!is_mountain(i+1,j)) - { + if(!is_mountain(i+1,j)) { if(!is_mountain(i, j-1)) ter_to_fix = 27; else if(!is_mountain(i,j+1)) @@ -2120,9 +2107,8 @@ bool fix_mountain(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_mountain(i, j-1)) ter_to_fix = 28; else if(!is_mountain(i,j+1)) @@ -2189,12 +2175,10 @@ bool fix_hill(location l) { else { // not edge if(!is_hill_or_mountain(i-1,j)) { - if(!is_hill_or_mountain(i,j-1)) - { + if(!is_hill_or_mountain(i,j-1)) { ter_to_fix = 29; } - else - { + else { if(!is_hill_or_mountain(i,j+1)) ter_to_fix = 31; else ter_to_fix = 30; @@ -2205,8 +2189,7 @@ bool fix_hill(location l) { } else { // wall(i-1,j) - if(!is_hill_or_mountain(i+1,j)) - { + if(!is_hill_or_mountain(i+1,j)) { if(!is_hill_or_mountain(i, j-1)) ter_to_fix = 27; else if(!is_hill_or_mountain(i,j+1)) @@ -2215,9 +2198,8 @@ bool fix_hill(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_hill_or_mountain(i, j-1)) ter_to_fix = 28; else if(!is_hill_or_mountain(i,j+1)) @@ -2287,12 +2269,10 @@ bool fix_water(location l) { else { // not edge if(!is_water(i-1,j)) { - if(!is_water(i,j-1)) - { + if(!is_water(i,j-1)) { ter_to_fix = 29; } - else - { + else { if(!is_water(i,j+1)) ter_to_fix = 31; else ter_to_fix = 30; @@ -2303,8 +2283,7 @@ bool fix_water(location l) { } else { // wall(i-1,j) - if(!is_water(i+1,j)) - { + if(!is_water(i+1,j)) { if(!is_water(i, j-1)) ter_to_fix = 27; else if(!is_water(i,j+1)) @@ -2313,9 +2292,8 @@ bool fix_water(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_water(i, j-1)) ter_to_fix = 28; else if(!is_water(i,j+1)) @@ -2410,12 +2388,10 @@ bool out_fix_cave(location l) { else { // not edge if(!is_wall(i-1,j)) { - if(!is_wall(i,j-1)) - { + if(!is_wall(i,j-1)) { ter_to_fix = 11; } - else - { + else { if(!is_wall(i,j+1)) ter_to_fix = 14; else ter_to_fix = 12; @@ -2426,8 +2402,7 @@ bool out_fix_cave(location l) { } else { // wall(i-1,j) - if(!is_wall(i+1,j)) - { + if(!is_wall(i+1,j)) { if(!is_wall(i, j-1)) ter_to_fix = 8; else if(!is_wall(i,j+1)) @@ -2436,9 +2411,8 @@ bool out_fix_cave(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_wall(i, j-1)) ter_to_fix = 9; else if(!is_wall(i,j+1)) @@ -2507,12 +2481,10 @@ bool out_fix_mountain(location l) { else { // not edge if(!is_mountain(i-1,j)) { - if(!is_mountain(i,j-1)) - { + if(!is_mountain(i,j-1)) { ter_to_fix = 29; } - else - { + else { if(!is_mountain(i,j+1)) ter_to_fix = 31; else ter_to_fix = 30; @@ -2523,8 +2495,7 @@ bool out_fix_mountain(location l) { } else { // wall(i-1,j) - if(!is_mountain(i+1,j)) - { + if(!is_mountain(i+1,j)) { if(!is_mountain(i, j-1)) ter_to_fix = 27; else if(!is_mountain(i,j+1)) @@ -2533,9 +2504,8 @@ bool out_fix_mountain(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_mountain(i, j-1)) ter_to_fix = 28; else if(!is_mountain(i,j+1)) @@ -2602,12 +2572,10 @@ bool out_fix_hill(location l) { else { // not edge if(!is_hill_or_mountain(i-1,j)) { - if(!is_hill_or_mountain(i,j-1)) - { + if(!is_hill_or_mountain(i,j-1)) { ter_to_fix = 29; } - else - { + else { if(!is_hill_or_mountain(i,j+1)) ter_to_fix = 31; else ter_to_fix = 30; @@ -2618,8 +2586,7 @@ bool out_fix_hill(location l) { } else { // wall(i-1,j) - if(!is_hill_or_mountain(i+1,j)) - { + if(!is_hill_or_mountain(i+1,j)) { if(!is_hill_or_mountain(i, j-1)) ter_to_fix = 27; else if(!is_hill_or_mountain(i,j+1)) @@ -2628,9 +2595,8 @@ bool out_fix_hill(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_hill_or_mountain(i, j-1)) ter_to_fix = 28; else if(!is_hill_or_mountain(i,j+1)) @@ -2700,12 +2666,10 @@ bool out_fix_water(location l) { else { // not edge if(!is_water(i-1,j)) { - if(!is_water(i,j-1)) - { + if(!is_water(i,j-1)) { ter_to_fix = 29; } - else - { + else { if(!is_water(i,j+1)) ter_to_fix = 31; else ter_to_fix = 30; @@ -2716,8 +2680,7 @@ bool out_fix_water(location l) { } else { // wall(i-1,j) - if(!is_water(i+1,j)) - { + if(!is_water(i+1,j)) { if(!is_water(i, j-1)) ter_to_fix = 27; else if(!is_water(i,j+1)) @@ -2726,9 +2689,8 @@ bool out_fix_water(location l) { } - else //wall(i+1,j) + else { //wall(i+1,j) - { if(!is_water(i, j-1)) ter_to_fix = 28; else if(!is_water(i,j+1)) diff --git a/osx/scenedit/scen.graphics.cpp b/osx/scenedit/scen.graphics.cpp index 7d333d40..de2573e0 100644 --- a/osx/scenedit/scen.graphics.cpp +++ b/osx/scenedit/scen.graphics.cpp @@ -613,8 +613,7 @@ void draw_terrain(){ tileImage(ter_draw_gworld,terrain_rect,bg[17]); frame_rect(ter_draw_gworld, terrain_rect, sf::Color::Black); for(q = 0; q < 9; q++) - for(r = 0; r < 9; r++) - { + for(r = 0; r < 9; r++) { where_draw.x = q; where_draw.y = r; if(editing_town) { @@ -1082,8 +1081,7 @@ void draw_frames() { RECT draw_rect; for(q = 0; q < 9; q++) { - for(r = 0; r < 9; r++) - { + for(r = 0; r < 9; r++) { which_pt.x = cen_x + q - 4; which_pt.y = cen_y + r - 4; draw_rect.top = 23 + r * 36; diff --git a/osx/scenedit/scen.main.cpp b/osx/scenedit/scen.main.cpp index 6bf88e42..2ef6db65 100644 --- a/osx/scenedit/scen.main.cpp +++ b/osx/scenedit/scen.main.cpp @@ -186,8 +186,7 @@ void Handle_One_Event() { if(!mainPtr.waitEvent(event)) return; - switch(event.type) - { + switch(event.type) { case sf::Event::KeyPressed: if(!(event.key.*systemKey)) handle_keystroke(chr,chr2,event); diff --git a/osx/scenedit/scen.townout.cpp b/osx/scenedit/scen.townout.cpp index 3e45853d..ea91734d 100644 --- a/osx/scenedit/scen.townout.cpp +++ b/osx/scenedit/scen.townout.cpp @@ -1026,8 +1026,7 @@ bool save_town_wand() { short i,j; #if 0 for(i = 0; i < 4; i++) - for(j = 0; j < 4; j++) - { + for(j = 0; j < 4; j++) { town->wandering[i].monst[j] = CDGN(835,2 + i * 4 + j); if(cre(town->wandering[i].monst[j],0,255,"Wandering monsters must all be from 0 to 255 (0 means no monster)." ,"",835)) return false; @@ -1040,8 +1039,7 @@ void put_town_wand_in_dlog() { short i,j; #if 0 for(i = 0; i < 4; i++) - for(j = 0; j < 4; j++) - { + for(j = 0; j < 4; j++) { CDSN(835,2 + i * 4 + j,town->wandering[i].monst[j]); } #endif diff --git a/osx/tools/fileio.cpp b/osx/tools/fileio.cpp index 7ad7727e..f6a0f4cd 100644 --- a/osx/tools/fileio.cpp +++ b/osx/tools/fileio.cpp @@ -680,8 +680,7 @@ bool load_outdoor_str(location which_out, short which_str, char* str){ bool tryLoadPictFromResourceFile(fs::path& gpath, sf::Image& graphics_store); #endif -void load_spec_graphics() -{ +void load_spec_graphics() { static const char*const noGraphics = "The game will still work without the custom graphics, but some things will not look right."; short i; fs::path path(scenario.scen_file); @@ -1099,9 +1098,8 @@ bool load_party_v2(fs::path file_to_load, bool town_restore, bool in_scen, bool return true; } -bool save_party(fs::path dest_file) //mode; // 0 - normal 1 - save as -{ +bool save_party(fs::path dest_file) { if(!fs::exists(tempDir)) fs::create_directories(tempDir); bool in_scen = univ.party.scen_name != ""; diff --git a/osx/tools/graphtool.cpp b/osx/tools/graphtool.cpp index e021744e..e09930bb 100644 --- a/osx/tools/graphtool.cpp +++ b/osx/tools/graphtool.cpp @@ -411,8 +411,7 @@ void draw_terrain(){ FrameRect(&terrain_rect); SetPortWindowPort(mainPtr); for(q = 0; q < 9; q++) - for(r = 0; r < 9; r++) - { + for(r = 0; r < 9; r++) { where_draw.x = q; where_draw.y = r; if(editing_town) { t_to_draw = t_d.terrain[cen_x + q - 4][cen_y + r - 4]; diff --git a/osx/tools/mathutil.cpp b/osx/tools/mathutil.cpp index eaaadeaa..adcd212d 100644 --- a/osx/tools/mathutil.cpp +++ b/osx/tools/mathutil.cpp @@ -26,8 +26,7 @@ short s_pow(short x,short y){ return (short) pow((double) x, (double) y); } -short s_sqrt(short val) -{ +short s_sqrt(short val) { return (short) sqrt((double)(val)); } diff --git a/osx/tools/porting.cpp b/osx/tools/porting.cpp index 942abe9f..676468a6 100644 --- a/osx/tools/porting.cpp +++ b/osx/tools/porting.cpp @@ -41,8 +41,7 @@ void port_town(legacy::town_record_type* dummy_town_ptr){ } -static void port_dummy_t_d(short size,char *buffer) -{ +static void port_dummy_t_d(short size,char *buffer) { short i; legacy::big_tr_type *d1; legacy::ave_tr_type *d2; @@ -94,8 +93,7 @@ static void port_dummy_t_d(short size,char *buffer) } } -void port_talk_nodes(legacy::talking_record_type* dummy_talk_ptr) -{ +void port_talk_nodes(legacy::talking_record_type* dummy_talk_ptr) { short i; if(cur_scen_is_mac != mac_is_intel) @@ -110,8 +108,7 @@ void port_talk_nodes(legacy::talking_record_type* dummy_talk_ptr) } } -void port_t_d(legacy::big_tr_type* old) -{ +void port_t_d(legacy::big_tr_type* old) { short i; if(cur_scen_is_mac != mac_is_intel) return; @@ -128,8 +125,7 @@ void port_t_d(legacy::big_tr_type* old) } } -void port_ave_t(legacy::ave_tr_type* old) -{ +void port_ave_t(legacy::ave_tr_type* old) { short i; if(cur_scen_is_mac != mac_is_intel) return; @@ -146,8 +142,7 @@ void port_ave_t(legacy::ave_tr_type* old) } } -void port_tiny_t(legacy::tiny_tr_type* old) -{ +void port_tiny_t(legacy::tiny_tr_type* old) { short i; if(cur_scen_is_mac != mac_is_intel) return; @@ -164,8 +159,7 @@ void port_tiny_t(legacy::tiny_tr_type* old) } } -void port_scenario(legacy::scenario_data_type* temp_scenario) -{ +void port_scenario(legacy::scenario_data_type* temp_scenario) { short i,j; if(cur_scen_is_mac != mac_is_intel) @@ -259,8 +253,7 @@ void port_item_list(legacy::scen_item_data_type* old){ } } -void port_out(legacy::outdoor_record_type *out) -{ +void port_out(legacy::outdoor_record_type *out) { short i; if(cur_scen_is_mac != mac_is_intel) @@ -428,8 +421,7 @@ void port_c_town(legacy::current_town_type* old){ } } -void flip_spec_node(legacy::special_node_type *spec) -{ +void flip_spec_node(legacy::special_node_type *spec) { flip_short(&(spec->type)); flip_short(&(spec->sd1)); flip_short(&(spec->sd2)); @@ -443,8 +435,7 @@ void flip_spec_node(legacy::special_node_type *spec) flip_short(&(spec->jumpto)); } -void flip_short(int16_t *s) -{ +void flip_short(int16_t *s) { char store,*s1, *s2; s1 = (char *) s; @@ -455,8 +446,7 @@ void flip_short(int16_t *s) } -void flip_long(int32_t *s) -{ +void flip_long(int32_t *s){ char store,*s1, *s2, *s3, *s4; s1 = (char *) s; @@ -473,8 +463,7 @@ void flip_long(int32_t *s) } // TODO: This was because Windows stored its rect members in a different order, but since we now have our own rect class, it shouldn't be needed. -static void alter_rect(legacy::Rect *r) -{ +static void alter_rect(legacy::Rect *r) { short a; a = r->top; @@ -484,8 +473,7 @@ static void alter_rect(legacy::Rect *r) r->bottom = r->right; } -void flip_rect(legacy::Rect* s) -{ +void flip_rect(legacy::Rect* s) { flip_short((int16_t *) &(s->top)); flip_short((int16_t *) &(s->bottom)); flip_short((int16_t *) &(s->left)); diff --git a/osx/tools/soundtool.cpp b/osx/tools/soundtool.cpp index ac421bce..93cfc523 100644 --- a/osx/tools/soundtool.cpp +++ b/osx/tools/soundtool.cpp @@ -101,8 +101,7 @@ void play_sound(short which, short how_many_times) { // if < 0, play asynch if(always_async.find(which) != always_async.end()) which *= -1; - if(sndhandle) - { + if(sndhandle) { chan[channel] = sf::Sound(*sndhandle); chan[channel].play(); @@ -228,22 +227,19 @@ void play_sound(short which, short how_many_times) { // if < 0, play asynch for(i = 0; i < NUM_SOUNDS; i++) if((load_when_play[which]) && (sound_handles[which] != NULL) - && (a_sound_did_get_played) && (i != which)) - { + && (a_sound_did_get_played) && (i != which)) { sound_handles[i] = NULL; } #endif } #ifdef WIN32 -void kill_sound() -{ +void kill_sound() { sndPlaySound(NULL,0); } #endif -void one_sound(short which) -{ +void one_sound(short which) { if(which == last_played) return; play_sound(which); @@ -254,8 +250,7 @@ void clear_sound_memory(){ last_played = 100; } -void flip_sound() -{ +void flip_sound() { play_sounds = (play_sounds) ? false : true; } @@ -271,8 +266,7 @@ void sound_pause(long len) { } } -void load_sounds(HMODULE handle) -{ +void load_sounds(HMODULE handle) { short i,t,err; HRSRC h; char snd_name[20];