diff --git a/objects/obj_bomb_select/Alarm_1.gml b/objects/obj_bomb_select/Alarm_1.gml index ee926880b..b3d421e8c 100644 --- a/objects/obj_bomb_select/Alarm_1.gml +++ b/objects/obj_bomb_select/Alarm_1.gml @@ -1,43 +1,24 @@ // Sets which target is in planet and its strenght -for(var i=0; i<31; i++){ - ship[i]=""; - ship_all[i]=0; - ship_use[i]=0; - ship_max[i]=0; - ship_ide[i]=-1; -} - -max_ships=sh_target.capital_number+sh_target.frigate_number+sh_target.escort_number; +ship=[]; +ship_all=[]; +ship_use=[]; +ship_max=[]; +ship_ide=[]; -var tump=0; +var _ships = fleet_full_ship_array(sh_target); +max_ships = array_length(_ships); +bomb_a = calculate_fleet_bombard_score(_ships); +var _total_fleet_loaded = calculate_fleet_content_size(_ships); +bomb_b = _total_fleet_loaded; +bomb_c = _total_fleet_loaded; -var i=-1; -for(var b=0; b 0){ + array_push(ship_ide, _ships[i]); + array_push(ship_max, obj_ini.ship_carrying[_ships[i]]); + array_push(ship, obj_ini.ship[_ships[i]]); + array_push(ship_use, 0); + array_push(ship_all, 0); } } @@ -52,23 +33,24 @@ traitors=p_target.p_traitors[obj_controller.selecting_planet]; necrons=p_target.p_necrons[obj_controller.selecting_planet]; var onceh=0; -imp=p_target.p_guardsmen[obj_controller.selecting_planet]; -if (onceh == 0) { - if (imp >= 50000000) { - imp = 6; - } else if (imp >= 15000000) { - imp = 5; - } else if (imp >= 6000000) { - imp = 4; - } else if (imp >= 1000000) { - imp = 3; - } else if (imp >= 100000) { - imp = 2; - } else if (imp >= 2000) { - imp = 1; - } - onceh = 1; +if (p_data.guardsmen>0){ + imp=p_data.guard_score_calc(); } +var _pdf_count=p_data.pdf; +if (_pdf_count >= 50000000) { + pdf = 6; +} else if (_pdf_count >= 15000000) { + pdf = 5; +} else if (_pdf_count >= 6000000) { + pdf = 4; +} else if (_pdf_count >= 1000000) { + pdf = 3; +} else if (_pdf_count >= 100000) { + pdf = 2; +} else if (_pdf_count >= 2000) { + pdf = 1; +} + onceh=0; pdf=p_target.p_pdf[obj_controller.selecting_planet]; 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 9776792e3..a45bc3a60 100644 --- a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml +++ b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml @@ -599,7 +599,26 @@ function get_nearest_player_fleet(nearest_x, nearest_y, is_static=false, is_movi return chosen_fleet; } +function calculate_fleet_content_size(ship_array){ + var total_content = 0; + for (var i=0;i