diff --git a/objects/obj_fleet_select/Draw_0.gml b/objects/obj_fleet_select/Draw_0.gml index c3128a8f45..4a7dcbe9d6 100644 --- a/objects/obj_fleet_select/Draw_0.gml +++ b/objects/obj_fleet_select/Draw_0.gml @@ -84,30 +84,8 @@ if (owner == eFACTION.Player) and (player_fleet.action==""){ if (sys_dist<32) and (sys.id!=mine.id){ - var has_capitals = false; - var has_frigates = false; - var has_escorts = false; - with (player_fleet){ - for (i=0; i1) then txt1+="s"; txt1+=" unload"; if (ships_selected=1) then txt1+="s"; - txt1+= $" annihilation upon {star_system.name} {scr_roman_numerals()[planet_number-1]}. Even from space the explosions can be seen, clapping across the planet's surface."; + txt1+= $" annihilation upon {planet_numeral_name(planet_number, star_system)}. Even from space the explosions can be seen, clapping across the planet's surface."; if (star_system.p_large[planet_number]=0){ kill=bombard_ment_power*15000000;// Population if normal diff --git a/scripts/scr_fleet_functions/scr_fleet_functions.gml b/scripts/scr_fleet_functions/scr_fleet_functions.gml index ecce065d7c..d1113c634f 100644 --- a/scripts/scr_fleet_functions/scr_fleet_functions.gml +++ b/scripts/scr_fleet_functions/scr_fleet_functions.gml @@ -225,19 +225,41 @@ function calculate_fleet_eta(xx,yy,xxx,yyy, fleet_speed,star1=true, star2=true,w } - - -function calculate_action_speed(capitals=true, frigates=true, escorts=true){ - var fleet_speed=128; - if (capitals>0){ - fleet_speed=100; - } else if (frigates>0){ - fleet_speed=128; - }else if (escorts>0){ - fleet_speed=174; +function calculate_action_speed(fleet="none", selected=false){ + if (fleet=="none"){ + var capitals=0,frigates=0,escorts=0,i; + var _is_player_fleet = object_index==obj_p_fleet; + if (_is_player_fleet){ + if (!selected){ + player_fleet_ship_count(); + capitals=capital_number; + frigates=frigate_number; + escorts=escort_number; + } else{ + //TODO extract to a fleet selected function + var types = selected_ship_types(); + capitals=types[0]; + frigates=types[1]; + escorts=types[2]; + } + } + var fleet_speed=128; + if (capitals>0){ + fleet_speed=100; + } else if (frigates>0){ + fleet_speed=128; + }else if (escorts>0){ + fleet_speed=174; + } + if (_is_player_fleet){ + if (obj_controller.stc_ships>=6) and (fleet_speed>=100) then fleet_speed*=1.2; + } + return fleet_speed; + } else { + with (fleet){ + return calculate_action_speed(,selected); + } } - if (obj_controller.stc_ships>=6) and (fleet_speed>=100) then fleet_speed*=1.2; - return fleet_speed; } function scr_efleet_arrive_at_trade_loc(){ diff --git a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml index ddedf1d1d8..9d51e3bf90 100644 --- a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml +++ b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml @@ -166,21 +166,21 @@ function fleet_full_ship_array(fleet="none", exclude_capitals=false, exclude_fri var i; if (fleet=="none"){ if (!exclude_capitals){ - for (i=1; i<=capital_number;i++){ + for (i=0; i<=capital_number;i++){ if (i>=0 && i < array_length(capital_num)){ array_push(all_ships, capital_num[i]); } } } if (!exclude_frigates){ - for (i=1; i<=frigate_number;i++){ + for (i=0; i<=frigate_number;i++){ if (i>=0 && i < array_length(frigate_num)){ array_push(all_ships, frigate_num[i]); } } } if (!exclude_escorts){ - for (i=1; i<=escort_number;i++){ + for (i=0; i<=escort_number;i++){ if (i>=0 && i < array_length(escort_num)){ array_push(all_ships, escort_num[i]); } @@ -203,6 +203,29 @@ function set_fleet_location(location){ } } } + +function selected_ship_types(){ + var capitals=0,frigates=0,escorts=0,i; + for (i=0; i