diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 6fd18c028e..5ca74e6db3 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -579,7 +579,7 @@ "isEcma":false, "LibraryEmitters":[], "MetaData":{ - "IDEVersion":"2024.1400.0.901", + "IDEVersion":"2024.1400.0.904", }, "name":"ChapterMaster", "resources":[ @@ -728,6 +728,7 @@ {"id":{"name":"DiploCommonComponents","path":"scripts/DiploCommonComponents/DiploCommonComponents.yy",},}, {"id":{"name":"draw_line_dashed","path":"scripts/draw_line_dashed/draw_line_dashed.yy",},}, {"id":{"name":"draw_set_blend_mode","path":"scripts/draw_set_blend_mode/draw_set_blend_mode.yy",},}, + {"id":{"name":"ds_map_helpers","path":"scripts/ds_map_helpers/ds_map_helpers.yy",},}, {"id":{"name":"exp_and_exp_growth","path":"scripts/exp_and_exp_growth/exp_and_exp_growth.yy",},}, {"id":{"name":"explode_script","path":"scripts/explode_script/explode_script.yy",},}, {"id":{"name":"instance_create","path":"scripts/instance_create/instance_create.yy",},}, @@ -819,6 +820,7 @@ {"id":{"name":"scr_flavor","path":"scripts/scr_flavor/scr_flavor.yy",},}, {"id":{"name":"scr_flavor2","path":"scripts/scr_flavor2/scr_flavor2.yy",},}, {"id":{"name":"scr_fleet_advisor","path":"scripts/scr_fleet_advisor/scr_fleet_advisor.yy",},}, + {"id":{"name":"scr_fleet_events","path":"scripts/scr_fleet_events/scr_fleet_events.yy",},}, {"id":{"name":"scr_fleet_functions","path":"scripts/scr_fleet_functions/scr_fleet_functions.yy",},}, {"id":{"name":"scr_forge_world_functions","path":"scripts/scr_forge_world_functions/scr_forge_world_functions.yy",},}, {"id":{"name":"scr_garrison","path":"scripts/scr_garrison/scr_garrison.yy",},}, @@ -828,6 +830,7 @@ {"id":{"name":"scr_get_item_names","path":"scripts/scr_get_item_names/scr_get_item_names.yy",},}, {"id":{"name":"scr_gift_items","path":"scripts/scr_gift_items/scr_gift_items.yy",},}, {"id":{"name":"scr_gov_disp","path":"scripts/scr_gov_disp/scr_gov_disp.yy",},}, + {"id":{"name":"scr_governors","path":"scripts/scr_governors/scr_governors.yy",},}, {"id":{"name":"scr_ground_ai_helpers","path":"scripts/scr_ground_ai_helpers/scr_ground_ai_helpers.yy",},}, {"id":{"name":"scr_has_adv","path":"scripts/scr_has_adv/scr_has_adv.yy",},}, {"id":{"name":"scr_has_disadv","path":"scripts/scr_has_disadv/scr_has_disadv.yy",},}, @@ -864,6 +867,7 @@ {"id":{"name":"scr_marine_struct","path":"scripts/scr_marine_struct/scr_marine_struct.yy",},}, {"id":{"name":"scr_master_loc","path":"scripts/scr_master_loc/scr_master_loc.yy",},}, {"id":{"name":"scr_max_marine","path":"scripts/scr_max_marine/scr_max_marine.yy",},}, + {"id":{"name":"scr_mechanicus_fleet_functions","path":"scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.yy",},}, {"id":{"name":"scr_mechanicus_missions","path":"scripts/scr_mechanicus_missions/scr_mechanicus_missions.yy",},}, {"id":{"name":"scr_mission_eta","path":"scripts/scr_mission_eta/scr_mission_eta.yy",},}, {"id":{"name":"scr_mission_functions","path":"scripts/scr_mission_functions/scr_mission_functions.yy",},}, @@ -933,6 +937,7 @@ {"id":{"name":"scr_system_spawn_functions","path":"scripts/scr_system_spawn_functions/scr_system_spawn_functions.yy",},}, {"id":{"name":"scr_Table","path":"scripts/scr_Table/scr_Table.yy",},}, {"id":{"name":"scr_target","path":"scripts/scr_target/scr_target.yy",},}, + {"id":{"name":"scr_tau_fleet_functions","path":"scripts/scr_tau_fleet_functions/scr_tau_fleet_functions.yy",},}, {"id":{"name":"scr_text_hit","path":"scripts/scr_text_hit/scr_text_hit.yy",},}, {"id":{"name":"scr_thought","path":"scripts/scr_thought/scr_thought.yy",},}, {"id":{"name":"scr_tooltip_draw","path":"scripts/scr_tooltip_draw/scr_tooltip_draw.yy",},}, @@ -954,6 +959,7 @@ {"id":{"name":"scr_unit_size","path":"scripts/scr_unit_size/scr_unit_size.yy",},}, {"id":{"name":"scr_unit_spawn_functions","path":"scripts/scr_unit_spawn_functions/scr_unit_spawn_functions.yy",},}, {"id":{"name":"scr_unit_traits","path":"scripts/scr_unit_traits/scr_unit_traits.yy",},}, + {"id":{"name":"scr_UnitGroup_and_group_selection","path":"scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.yy",},}, {"id":{"name":"scr_uuid_generate","path":"scripts/scr_uuid_generate/scr_uuid_generate.yy",},}, {"id":{"name":"scr_vehicle_count","path":"scripts/scr_vehicle_count/scr_vehicle_count.yy",},}, {"id":{"name":"scr_vehicle_helpers","path":"scripts/scr_vehicle_helpers/scr_vehicle_helpers.yy",},}, diff --git a/objects/obj_controller/Alarm_5.gml b/objects/obj_controller/Alarm_5.gml index 2dc4e54fd1..e387384e6f 100644 --- a/objects/obj_controller/Alarm_5.gml +++ b/objects/obj_controller/Alarm_5.gml @@ -15,6 +15,7 @@ var spikky=0; var roll=0; var novice_type=""; var unit; +var _roles = active_roles(); try_and_report_loop("chaos_spread", function(){ @@ -82,7 +83,7 @@ while (i1){ - scr_alert("green","recruitment",$"{recruits_finished}x {obj_ini.role[100][12]} have joined X Company.",0,0); + scr_alert("green","recruitment",$"{recruits_finished}x {_roles[12]} have joined X Company.",0,0); } @@ -135,7 +136,12 @@ if (scr_has_adv("Tech-Scavengers")){ scr_alert("","loot",tix,0,0); } } -imperial_navy_fleet_construction(); + +try{ + imperial_navy_fleet_construction(); +}catch(_exception){ + handle_exception(_exception); +} // ** Adeptus Mechanicus Geneseed Tithe ** if (gene_tithe==0) and (faction_status[eFACTION.Imperium]!="War"){ @@ -409,10 +415,10 @@ if (disposition[eFACTION.Ork]>=60) then scr_loyalty("Xeno Associate","+"); if (disposition[eFACTION.Tau]>=60) then scr_loyalty("Xeno Associate","+"); var loyalty_counter=0; -loyalty_counter=scr_role_count(obj_ini.role[100][15],""); +loyalty_counter=scr_role_count(_roles[15],""); if (loyalty_counter==0) then scr_loyalty("Lack of Apothecary","+"); -loyalty_counter=scr_role_count(obj_ini.role[100][14],""); +loyalty_counter=scr_role_count(_roles[14],""); if (loyalty_counter==0) then scr_loyalty("Undevout","+"); // TODO in another PR rework how Non-Codex Size is determined, perhaps the inquisition needs to pass some checks or do an investigation event // which you could eventually interrupt (kill the team) and cover it up? @@ -549,12 +555,20 @@ location_viewer.update_mission_log(); init_ork_waagh(); return_lost_ships_chance(); //complex route plotting for player fleets + +with (obj_en_fleet){ + if (array_length(events)){ + check_events(); + } +} + with (obj_p_fleet){ if (array_length(complex_route)>0 && action == ""){ set_new_player_fleet_course(complex_route); } } + }); if (helpful_places != false){ diff --git a/objects/obj_controller/Alarm_6.gml b/objects/obj_controller/Alarm_6.gml index 039a9cc5e3..171a033801 100644 --- a/objects/obj_controller/Alarm_6.gml +++ b/objects/obj_controller/Alarm_6.gml @@ -10,6 +10,7 @@ if (menu==1) and (managing>0){ var manz=0,vanz=0,stahp=0; sel_promoting=1; + var _roles = active_roles(); for(var f=0; f0){ // sets up count for the marines if (man[f]=="man"){ manz+=1; - if (unit.role()==obj_ini.role[100][5]) { cap+=1;} - else if (unit.role()==obj_ini.role[100][15]) { apo+=1;} - else if (unit.role()==obj_ini.role[100][14]) { chap+=1;} - else if (unit.role()==obj_ini.role[100][17]) { lib+=1;} - else if (unit.role()==obj_ini.role[100][16]) { tech+=1;} - else if (unit.role()==obj_ini.role[100][6]) { drea+=1;} - else if (unit.role()==$"Venerable {obj_ini.role[100][6]}"){ vdrea+=1;} - else if (unit.role()==obj_ini.role[100][11]) { bear+=1;} - else if (unit.role()==obj_ini.role[100][8]) { tct+=1;} - else if (unit.role()==obj_ini.role[100][10]) { assa+=1;} - else if (unit.role()==obj_ini.role[100][9]) { dev+=1;} - else if (unit.role()==obj_ini.role[100][12]) { sco+=1;} - else if (unit.role()==obj_ini.role[100][2]) { hon+=1;} - else if (unit.role()==obj_ini.role[100][3]) { ve+=1;} - else if (unit.role()==obj_ini.role[100][4]) { ter+=1;} - else if (unit.role()==obj_ini.role[100][18]) { sgt++;} - else if (unit.role()==obj_ini.role[100][19]) { vet_sgt++;} + if (unit.role()==_roles[5]) { cap+=1;} + else if (unit.role()==_roles[15]) { apo+=1;} + else if (unit.role()==_roles[14]) { chap+=1;} + else if (unit.role()==_roles[17]) { lib+=1;} + else if (unit.role()==_roles[16]) { tech+=1;} + else if (unit.role()==_roles[6]) { drea+=1;} + else if (unit.role()==$"Venerable {_roles[6]}"){ vdrea+=1;} + else if (unit.role()==_roles[11]) { bear+=1;} + else if (unit.role()==_roles[8]) { tct+=1;} + else if (unit.role()==_roles[10]) { assa+=1;} + else if (unit.role()==_roles[9]) { dev+=1;} + else if (unit.role()==_roles[12]) { sco+=1;} + else if (unit.role()==_roles[2]) { hon+=1;} + else if (unit.role()==_roles[3]) { ve+=1;} + else if (unit.role()==_roles[4]) { ter+=1;} + else if (unit.role()==_roles[18]) { sgt++;} + else if (unit.role()==_roles[19]) { vet_sgt++;} else if (unit.role()=="Codiciery") { codi+=1;} else if (unit.role()=="Lexicanum") { lexi+=1;} - else if (unit.role()==obj_ini.role[100][eROLE.Ancient]) { champ+=1;} + else if (unit.role()==_roles[eROLE.Ancient]) { champ+=1;} } // sets up count for the vehicles // TODO This needs to be extended to accomodate the selection text like the man ones @@ -62,22 +63,22 @@ if (menu==1) and (managing>0){ selecting_dudes=""; // Infantry text if (cap>0){ - selecting_dudes+=string(cap)+" "+string(obj_ini.role[100][5]); + selecting_dudes+=string(cap)+" "+string(_roles[5]); if (cap>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (chap>0){ - selecting_dudes+=string(chap)+" "+string(obj_ini.role[100][14]); + selecting_dudes+=string(chap)+" "+string(_roles[14]); if (chap>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (champ>0){ - selecting_dudes+=$"{champ} {obj_ini.role[100][eROLE.Ancient]}"; + selecting_dudes+=$"{champ} {_roles[eROLE.Ancient]}"; if (chap>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (apo>0){ - selecting_dudes+=string(apo)+" "+string(obj_ini.role[100][15]); + selecting_dudes+=string(apo)+" "+string(_roles[15]); if (apo>1) then selecting_dudes+="s"; selecting_dudes+=", "; } @@ -97,17 +98,17 @@ if (menu==1) and (managing>0){ selecting_dudes+=", "; } if (bear>0){ - selecting_dudes+=string(bear)+" "+string(obj_ini.role[100][11]); + selecting_dudes+=string(bear)+" "+string(_roles[11]); if (bear>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (hon>0){ - selecting_dudes+=string(hon)+" "+string(obj_ini.role[100][2]); + selecting_dudes+=string(hon)+" "+string(_roles[2]); if (hon>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (tech>0){ - selecting_dudes+=string(tech)+" "+string(obj_ini.role[100][16]); + selecting_dudes+=string(tech)+" "+string(_roles[16]); if (tech>1) then selecting_dudes+="s"; selecting_dudes+=", "; } @@ -117,42 +118,42 @@ if (menu==1) and (managing>0){ selecting_dudes+=", "; } if (ve>0){ - selecting_dudes+=string(ve)+" "+string(obj_ini.role[100][3]); + selecting_dudes+=string(ve)+" "+string(_roles[3]); if (ve>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (tct>0){ - selecting_dudes+=string(tct)+" "+string(obj_ini.role[100][8]); + selecting_dudes+=string(tct)+" "+string(_roles[8]); if (tct>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (dev>0){ - selecting_dudes+=string(dev)+" "+string(obj_ini.role[100][9]); + selecting_dudes+=string(dev)+" "+string(_roles[9]); if (dev>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (assa>0){ - selecting_dudes+=string(assa)+" "+string(obj_ini.role[100][eROLE.Assault]); + selecting_dudes+=string(assa)+" "+string(_roles[eROLE.Assault]); if (sgt>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (sco>0){ - selecting_dudes+=string(sco)+" "+string(obj_ini.role[100][12]); + selecting_dudes+=string(sco)+" "+string(_roles[12]); if (sco>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (drea>0){ - selecting_dudes+=string(drea)+" "+string(obj_ini.role[100][6]); + selecting_dudes+=string(drea)+" "+string(_roles[6]); if (drea>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (sgt>0){ - selecting_dudes+=string(sgt)+" "+string(obj_ini.role[100][18]); + selecting_dudes+=string(sgt)+" "+string(_roles[18]); if (sgt>1) then selecting_dudes+="s"; selecting_dudes+=", "; } if (vet_sgt>0){ - selecting_dudes+=string(vet_sgt)+" "+string(obj_ini.role[100][19]); + selecting_dudes+=string(vet_sgt)+" "+string(_roles[19]); if (vet_sgt>1) then selecting_dudes+="s"; selecting_dudes+=", "; } diff --git a/objects/obj_controller/CleanUp_0.gml b/objects/obj_controller/CleanUp_0.gml index e43d58b1e2..7e592e24d0 100644 --- a/objects/obj_controller/CleanUp_0.gml +++ b/objects/obj_controller/CleanUp_0.gml @@ -1,12 +1,6 @@ global.name_generator = new NameGenerator(); -var _star_arrays = []; -ds_map_values_to_array(global.star_sprites,_star_arrays); -for (var i=0;i5 && owner==eFACTION.Ork){ + if (turns_static>5 && owner == eFACTION.Ork){ if (!irandom(7)){ ork_fleet_move(); _is_orbiting=false; @@ -329,7 +329,7 @@ else if (action=="" && _is_orbiting){ new_fleet.image_index=1; /*with(new_fleet){ - var ii;ii=0;ii+=capital_number;ii+=round((frigate_number/2));ii+=round((escort_number/4)); + var ii=floor(standard_fleet_strength_calc()); if (ii<=1) then ii=1;image_index=ii; }*/ @@ -346,7 +346,9 @@ else if (action=="" && _is_orbiting){ action_x=plin.x; action_y=plin.y; set_fleet_movement(); - if (n!=5) then good=5; + if (n!=5){ + good=5; + } } } } diff --git a/objects/obj_en_fleet/Create_0.gml b/objects/obj_en_fleet/Create_0.gml index 9d4dedc716..5582811a5c 100644 --- a/objects/obj_en_fleet/Create_0.gml +++ b/objects/obj_en_fleet/Create_0.gml @@ -4,8 +4,8 @@ capital_number=0; frigate_number=0; escort_number=0; guardsmen=0; -home_x=0; -home_y=0; +home_x=x; +home_y=y; selected=0; ret=0; hurt=0; @@ -18,13 +18,48 @@ guardsmen_ratio=0; guardsmen_unloaded=0; complex_route = []; warp_able = false; -ii_check=floor(random(5))+1; +ii_check = floor(random(5))+1; etah=0; safe=0; last_turn_check = 0; +uid = scr_uuid_generate(); + +events = []; + +add_event = function(event){ + event.fleet_uid = uid; + array_push(events, event); +} + +check_events = function(){ + for (var i=array_length(events)-1;i>=0;i--){ + var _event = events[i]; + + _event.turn_sequence(); + + if (_event.state == "destroy"){ + array_delete(events,i,1); + } + + } +} + +check_events_destructions = function(){ + for (var i=array_length(events)-1;i>=0;i--){ + var _event = events[i]; + + _event.destroy_sequence(); + + array_delete(events,i,1); + } +} +last_turn_check = 0 +last_turn_image_check = -1; //TODO set up special save method for faction specific fleet variables inquisitor=-1; +set_movement = method(self,set_fleet_movement); + cargo_data = {}; image_xscale=1.25; @@ -102,7 +137,7 @@ serialize = function(){ return save_data; } deserialize = function(save_data){ - var exclusions = ["id","cargo_data"]; // skip automatic setting of certain vars, handle explicitly later + var exclusions = ["id","cargo_data","events"]; // skip automatic setting of certain vars, handle explicitly later // Automatic var setting var all_names = struct_get_names(save_data); @@ -131,6 +166,17 @@ deserialize = function(save_data){ } } + if (struct_exists(save_data, "events")){ + for (var i=0;iroom_width) or (y<0) or (y>room_height) then exit; -if (image_alpha=0) then exit; +if (!point_in_rectangle(x, y, 0, 0, room_width, room_height) || !image_alpha){ + exit; +} var coords = [0,0]; var near_star = instance_nearest(x,y, obj_star); @@ -15,59 +24,103 @@ if (x==near_star.x && y==near_star.y){ var coords = fleet_star_draw_offsets(); } +image_index = min(image_index,9) -if (image_index>9) then image_index=9; +var _scale_x_pos = x+(coords[0]*scale); +var _scale_y_pos = y+(coords[1]*scale); +var _m_dist=point_distance(mouse_x,mouse_y,_scale_x_pos,(_scale_y_pos)); -var m_dist=point_distance(mouse_x,mouse_y,x+(coords[0]*scale),y+((coords[1])*scale+(12*scale))); -var within=false; -if (!obj_controller.zoomed){ - if (m_dist<=16*scale) and (!instance_exists(obj_ingame_menu)) then within=1; -} -if (obj_controller.zoomed=1){ +var _is_zoom = obj_controller.zoomed; + +var _within = _m_dist<=16*scale && !_is_zoom && !instance_exists(obj_ingame_menu); + + +add_draw_return_values(); +if (_is_zoom){ var faction_colour = global.star_name_colors[owner]; draw_set_color(faction_colour); if (owner == eFACTION.Imperium) and (navy=0) then draw_set_alpha(0.5); draw_circle(x,y,12,0); draw_set_alpha(1); - if (m_dist<=16) and (!instance_exists(obj_ingame_menu)) then within=1; + if (_m_dist<=16) and (!instance_exists(obj_ingame_menu)) then _within=1; } -// if (obj_controller.selected!=0) and (selected=1) then within=1; +// if (obj_controller.selected!=0) and (selected=1) then _within=1; -if (obj_controller.selecting_planet>0){ - if (mouse_x>=__view_get( e__VW.XView, 0 )+529) and (mouse_y>=__view_get( e__VW.YView, 0 )+234) and (mouse_x<__view_get( e__VW.XView, 0 )+611) and (mouse_y<__view_get( e__VW.YView, 0 )+249){ - if (instance_exists(obj_star_select)){if (obj_star_select.button1!="") then within=0;} - } - if (mouse_x>=__view_get( e__VW.XView, 0 )+529) and (mouse_y>=__view_get( e__VW.YView, 0 )+234+16) and (mouse_x<__view_get( e__VW.XView, 0 )+611) and (mouse_y<__view_get( e__VW.YView, 0 )+249+16){ - if (instance_exists(obj_star_select)){if (obj_star_select.button2!="") then within=0;} - } - if (mouse_x>=__view_get( e__VW.XView, 0 )+529) and (mouse_y>=__view_get( e__VW.YView, 0 )+234+32) and (mouse_x<__view_get( e__VW.XView, 0 )+611) and (mouse_y<__view_get( e__VW.YView, 0 )+249+32){ - if (instance_exists(obj_star_select)){if (obj_star_select.button3!="") then within=0;} - } +if (obj_controller.selecting_planet>0 && _within){ + _within = scr_void_click(); } - -if (action!=""){ - draw_set_halign(fa_left);draw_set_alpha(1); +if (action != ""){ + draw_set_halign(fa_left); + draw_set_alpha(1); draw_set_color(c_white); draw_line_width(x,y,action_x,action_y,1); // draw_set_font(fnt_40k_14b); - if (obj_controller.zoomed=0) then draw_text_transformed(x+12,y,string_hash_to_newline("ETA "+string(action_eta)),1,1,0); - if (obj_controller.zoomed=1) then draw_text_transformed(x+24,y,string_hash_to_newline("ETA "+string(action_eta)),2,2,0);// was 1.4 + var _tex_scale = obj_controller.zoomed ?2:1; + draw_text_transformed(x+12,y,$"ETA {action_eta}",_tex_scale,_tex_scale,0); } + + switch(owner){ case eFACTION.Ork: - var _has_warboss =false; + var _has_warboss =false; if (fleet_has_cargo("ork_warboss")){ draw_icon = true; _has_warboss = true; } + break; +} +var _reset = false; + +if (last_turn_image_check != obj_controller.turn){ + _reset = true; + +} + +if (ds_map_exists(global.en_fleet_sprites, uid)){ + if (_reset){ + ds_map_delete_sprite(global.en_fleet_sprites, uid); + } +} else { + _reset = true; +} + +if (_reset){ + add_draw_return_values(); + var _fleet_image_surface = surface_create(128, 64); + surface_set_target(_fleet_image_surface); + var faction_colour = global.star_name_colors[owner]; + var _xx = 24; + var _yy = 24; + draw_set_color(faction_colour); + draw_set_alpha(0.5); + draw_circle(_xx,_yy,12,0); + draw_set_alpha(1); + if (navy && owner == eFACTION.Imperium){ + draw_set_color(global.star_name_colors[eFACTION.Mechanicus]); + draw_circle_with_outline_width(_xx,_yy,12,0.3); + } + + if (draw_icon){ + draw_sprite_ext(spr_faction_icons, owner,_xx-32,_yy-32,1,1,0,c_white,1) + } + draw_sprite_ext(sprite_index,image_index,_xx,_yy,1,1,0,c_white,1); + + surface_reset_target(); + + var _new_sprite = sprite_create_from_surface(_fleet_image_surface, 0, 0, surface_get_width(_fleet_image_surface), surface_get_height(_fleet_image_surface), false, false, 0, 0); + + ds_map_set(global.en_fleet_sprites, uid, _new_sprite); + surface_clear_and_free(_fleet_image_surface); + last_turn_image_check = obj_controller.turn; + pop_draw_return_values(); } var fleet_descript=""; -if (within=1) or (selected>0){ +if (_within || selected>0){ draw_set_color(CM_GREEN_COLOR); draw_set_font(fnt_40k_14b); draw_set_halign(fa_center); @@ -129,7 +182,7 @@ if (within=1) or (selected>0){ // if (owner = eFACTION.Imperium) and (navy=1){fleet_descript=string(capital_max_imp[1]+frigate_max_imp[1]+escort_max_imp[1]);} if (global.cheat_debug=true){ - fleet_descript+="C"+string(capital_number)+"|F"+string(frigate_number)+"|E"+string(escort_number); + fleet_descript+=$"C{capital_number}|F{frigate_number}|E{escort_number}"; } // fleet_descript=string(capital_number)+"|"+string(frigate_number)+"|"+string(escort_number); @@ -138,34 +191,13 @@ if (within=1) or (selected>0){ draw_set_halign(fa_left); } -if (fleet_descript!="" && within){ - tooltip_draw(fleet_descript); - draw_circle(x+(coords[0]*scale),y+(coords[1])*scale,12*scale,0); -} else { - var faction_colour = global.star_name_colors[owner]; - draw_set_color(faction_colour); - draw_set_alpha(0.5); - draw_circle(x+(coords[0]*scale),y+(coords[1])*scale,12*scale,0); - draw_set_alpha(1); - if (navy && owner == eFACTION.Imperium){ - draw_set_color(global.star_name_colors[eFACTION.Mechanicus]); - draw_circle(x+(coords[0]*scale),y+(coords[1])*scale,12*scale,1); - draw_circle(x+(coords[0]*scale),y+(coords[1])*scale,12.1*scale,1); - draw_circle(x+(coords[0]*scale),y+(coords[1])*scale,12.2*scale,1); - } -} -if (draw_icon){ - draw_sprite_ext(spr_faction_icons, owner,x+(coords[0]*scale)-(32*scale),y+(coords[1]*scale)-(32*scale),1*scale,1*scale,0,c_white,1) -} -draw_sprite_ext(sprite_index,image_index,x+(coords[0]*scale),y+(coords[1]*scale),1*scale,1*scale,0,c_white,1); - +var _sprite = ds_map_find_value(global.en_fleet_sprites, uid) +draw_sprite_ext(_sprite, 0, _scale_x_pos-(24*scale) , _scale_y_pos-(24*scale), scale, scale, 1, c_white, 1); -/*if (owner = eFACTION.Ork){ - draw_set_font(fnt_small); - draw_set_halign(fa_center); - draw_set_color(c_white); - draw_text(x,y+32,string(escort_number)+"/"+string(frigate_number)+"/"+string(capital_number)); -}*/ +if (fleet_descript!="" && _within){ + tooltip_draw(fleet_descript); + draw_circle(_scale_x_pos,_scale_y_pos,12*scale,0); +} if (instance_exists(target)){ @@ -175,5 +207,7 @@ if (instance_exists(target)){ draw_set_alpha(1); } +pop_draw_return_values(); + /* */ /* */ diff --git a/objects/obj_en_fleet/Step_0.gml b/objects/obj_en_fleet/Step_0.gml index 00144c38dc..32da6fd92f 100644 --- a/objects/obj_en_fleet/Step_0.gml +++ b/objects/obj_en_fleet/Step_0.gml @@ -31,16 +31,13 @@ if (ii_check=0){ ii_check=10; if (owner != eFACTION.Eldar) and (owner != eFACTION.Inquisition){ - var ii=0; - ii+=capital_number; - ii+=round((frigate_number/2)); - ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()); if (ii<=1) then ii=1; image_index=ii; image_index=min(image_index,9); } if (owner = eFACTION.Eldar){ - var ii;ii=0;ii+=capital_number;ii+=round((frigate_number/2));ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()); if (ii<=1) then ii=1;image_index=ii; image_index=min(image_index,5); } @@ -118,14 +115,7 @@ if (owner = eFACTION.Tyranids) and (trade_goods=""){ } if (global.load>=0){ - if (owner = eFACTION.Imperium) then sprite_index=spr_fleet_imperial; - if (owner = eFACTION.Mechanicus) then sprite_index=spr_fleet_mechanicus; - if (owner = eFACTION.Inquisition) then sprite_index=spr_fleet_inquisition; - if (owner = eFACTION.Eldar) then sprite_index=spr_fleet_eldar; - if (owner = eFACTION.Ork) then sprite_index=spr_fleet_ork; - if (owner = eFACTION.Tau) then sprite_index=spr_fleet_tau; - if (owner = eFACTION.Tyranids) then sprite_index=spr_fleet_tyranid; - if (owner = eFACTION.Chaos) then sprite_index=spr_fleet_chaos; + choose_fleet_sprite_image(); } if (image_index=0) then image_index=1; diff --git a/objects/obj_ncombat/Alarm_1.gml b/objects/obj_ncombat/Alarm_1.gml index 53186af849..d467834988 100644 --- a/objects/obj_ncombat/Alarm_1.gml +++ b/objects/obj_ncombat/Alarm_1.gml @@ -1,5 +1,7 @@ var a1;a1=""; +var _roles = active_roles(); + if (ally>0) and (ally_forces>0){ if (ally=3){ @@ -133,24 +135,24 @@ if (string_count("_attack",battle_special)>0){ if (tacticals>0) and (veterans>0){ - p2=string(tacticals+veterans)+" "+string(obj_ini.role[100][8])+"s, "; + p2=string(tacticals+veterans)+" "+string(_roles[8])+"s, "; } if (tacticals>0) and (veterans=0){ - if (tacticals=1) then p2=string(tacticals)+" "+string(obj_ini.role[100][8])+", "; - if (tacticals>1) then p2=string(tacticals)+" "+string(obj_ini.role[100][8])+"s, "; + if (tacticals=1) then p2=string(tacticals)+" "+string(_roles[8])+", "; + if (tacticals>1) then p2=string(tacticals)+" "+string(_roles[8])+"s, "; } if (tacticals=0) and (veterans>0){ - if (veterans=1) then p2=string(veterans)+" "+string(obj_ini.role[100][3])+", "; - if (veterans>1) then p2=string(veterans)+" "+string(obj_ini.role[100][3])+"s, "; + if (veterans=1) then p2=string(veterans)+" "+string(_roles[3])+", "; + if (veterans>1) then p2=string(veterans)+" "+string(_roles[3])+"s, "; } if (assaults>0){ - if (assaults=1) then p2+=string(assaults)+" "+string(obj_ini.role[100][10])+", "; - if (assaults>1) then p2+=string(assaults)+" "+string(obj_ini.role[100][10])+"s, "; + if (assaults=1) then p2+=string(assaults)+" "+string(_roles[10])+", "; + if (assaults>1) then p2+=string(assaults)+" "+string(_roles[10])+"s, "; } if (devastators>0){ - if (devastators=1) then p2+=string(devastators)+" "+string(obj_ini.role[100][9])+", "; - if (devastators>1) then p2+=string(devastators)+" "+string(obj_ini.role[100][9])+"s, "; + if (devastators=1) then p2+=string(devastators)+" "+string(_roles[9])+", "; + if (devastators>1) then p2+=string(devastators)+" "+string(_roles[9])+"s, "; } if (temp<200) and (terminators>0){ @@ -159,37 +161,37 @@ if (temp<200) and (terminators>0){ } if (temp<200) and (chaplains>0){ - if (chaplains=1) then p2+=string(chaplains)+" "+string(obj_ini.role[100][14])+", "; - if (chaplains>1) then p2+=string(chaplains)+" "+string(obj_ini.role[100][14])+", "; + if (chaplains=1) then p2+=string(chaplains)+" "+string(_roles[14])+", "; + if (chaplains>1) then p2+=string(chaplains)+" "+string(_roles[14])+", "; } if (temp<200) and (apothecaries>0){ - if (apothecaries=1) then p2+=string(apothecaries)+" "+string(obj_ini.role[100][15])+", "; - if (apothecaries>1) then p2+=string(apothecaries)+" "+string(obj_ini.role[100][15])+", "; + if (apothecaries=1) then p2+=string(apothecaries)+" "+string(_roles[15])+", "; + if (apothecaries>1) then p2+=string(apothecaries)+" "+string(_roles[15])+", "; } if (temp<200) and (librarians>0){ - if (librarians=1) then p2+=string(librarians)+" "+string(obj_ini.role[100,17])+", "; - if (librarians>1) then p2+=string(librarians)+" "+string(obj_ini.role[100,17])+", "; + if (librarians=1) then p2+=string(librarians)+" "+string(_roles[17])+", "; + if (librarians>1) then p2+=string(librarians)+" "+string(_roles[17])+", "; } if (temp<200) and (techmarines>0){ - if (techmarines=1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][16])+", "; - if (techmarines>1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][16])+", "; + if (techmarines=1) then p2+=string(techmarines)+" "+string(_roles[16])+", "; + if (techmarines>1) then p2+=string(techmarines)+" "+string(_roles[16])+", "; } if (temp<200) and (sgts>0){ - if (techmarines=1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][18])+", "; - if (techmarines>1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][18])+", "; + if (techmarines=1) then p2+=string(techmarines)+" "+string(_roles[18])+", "; + if (techmarines>1) then p2+=string(techmarines)+" "+string(_roles[18])+", "; } if (temp<200) and (vet_sgts>0){ - if (techmarines=1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][19])+", "; - if (techmarines>1) then p2+=string(techmarines)+" "+string(obj_ini.role[100][19])+", "; + if (techmarines=1) then p2+=string(techmarines)+" "+string(_roles[19])+", "; + if (techmarines>1) then p2+=string(techmarines)+" "+string(_roles[19])+", "; } if (scouts>0){ - if (scouts=1) then p2+=string(scouts)+" "+string(obj_ini.role[100][12])+", "; - if (scouts>1) then p2+=string(scouts)+" "+string(obj_ini.role[100][12])+"s, "; + if (scouts=1) then p2+=string(scouts)+" "+string(_roles[12])+", "; + if (scouts>1) then p2+=string(scouts)+" "+string(_roles[12])+"s, "; } @@ -226,8 +228,8 @@ if (standard_bearers>1) and (dropping=0) then p5=" Chapter Ancients hold your C if (dreadnoughts+predators+land_raiders>3){ p6=" Forming up the armoured division is "; - if (dreadnoughts=1) then p6+=string(dreadnoughts)+" "+string(obj_ini.role[100][6])+", "; - if (dreadnoughts>1) then p6+=string(dreadnoughts)+" "+string(obj_ini.role[100][6])+"s, "; + if (dreadnoughts=1) then p6+=string(dreadnoughts)+" "+string(_roles[6])+", "; + if (dreadnoughts>1) then p6+=string(dreadnoughts)+" "+string(_roles[6])+"s, "; if (rhinos=1) then p6+=string(rhinos)+" Rhino, "; if (rhinos>1) then p6+=string(rhinos)+" Rhinos, "; diff --git a/objects/obj_star/Create_0.gml b/objects/obj_star/Create_0.gml index a3200bd6ad..23f59b6afe 100644 --- a/objects/obj_star/Create_0.gml +++ b/objects/obj_star/Create_0.gml @@ -69,6 +69,21 @@ p_influence = array_create_advanced(_planet_array_size, array_create(15, 0)); p_problem = array_create_advanced(_planet_array_size, array_create(8, "")); p_problem_other_data = array_create_advanced(_planet_array_size, array_create_advanced(8, {})); p_timer = array_create_advanced(_planet_array_size, array_create(8, -1)); +p_governor = []; + +for (var i=1;i<8;i++){ + array_push(p_governor, new GovernorProfile()); +} + + +system_datas = array_create(8, 0); +system_garrison = array_create(8, 0); + +system_sabatours = array_create(8, 0) + +add_feature = function(planet, feature){ + array_push(p_feature[planet], feature); +} system_player_ground_forces = 0; garrison = false; diff --git a/objects/obj_star/Draw_0.gml b/objects/obj_star/Draw_0.gml index cf103abbff..edaa1c6a88 100644 --- a/objects/obj_star/Draw_0.gml +++ b/objects/obj_star/Draw_0.gml @@ -1,24 +1,43 @@ // Draws the system name and color codes it based on ownership +add_draw_return_values(); if (p_type[1]="Craftworld") and (obj_controller.known[eFACTION.Eldar]=0){ draw_set_alpha(0); draw_set_color(255); draw_circle(old_x,old_y,5,0); draw_set_alpha(1); + pop_draw_return_values(); exit; } var show=name; -if (global.cheat_debug=true) then show=string(name)+"#"+string(p_problem[1,1])+":"+string(p_timer[1,1])+"#"+string(p_problem[1,2])+":"+string(p_timer[1,2])+"#"+string(p_problem[1,3])+":"+string(p_timer[1,3]); +if (global.cheat_debug){ + show = $"{name}"; + for (var i=1;i<=planets;i++){ + for (p=0;p0) then draw_sprite_ext(spr_warp_storm,storm_image,x,y,0.75*scale,0.75*scale,0,c_white,1); +if (storm>0){ + draw_sprite_ext(spr_warp_storm,storm_image,x,y,0.75*scale,0.75*scale,0,c_white,1); +} //ad hoc way of determining whether stuff is in view or not...needs work @@ -44,38 +63,39 @@ if (global.load == -1 && (obj_controller.zoomed || in_camera_view(star_box_shape } if (ds_map_exists(global.star_sprites, name)){ - var _old_sprite = ds_map_find_value(global.star_sprites, name); - if (sprite_exists(_old_sprite)){ - if (_reset){ - sprite_delete(_old_sprite); - } - } else { - _reset = true; - } if (_reset){ - ds_map_delete(global.star_sprites, name); + ds_map_delete_sprite(global.star_sprites, name); } } else { _reset = true; } + if (_reset){ - star_tag_surface = surface_create(256, 128); + var star_tag_surface = surface_create(256, 128); var xx=64; var yy=0; surface_set_target(star_tag_surface); - var panel_width = string_width(name) + 60; + + var _name_width = string_width(name); + + var _panel_width = _name_width + 60; + + var _panel_center = xx-(_panel_width/2); + + var _panel_y = yy + 30; + if (owner != eFACTION.Player ){ var _faction_index = owner; var faction_colour = global.star_name_colors[_faction_index]; - draw_sprite_general(spr_p_name_bg, 0, 0, 0, string_width(name) + 60, 32, xx-(panel_width/2), yy+30, 1, 1, 0, faction_colour, faction_colour, faction_colour, faction_colour, 1); - draw_sprite_ext(spr_faction_icons,_faction_index,xx+(panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1); + draw_sprite_general(spr_p_name_bg, 0, 0, 0, _panel_width, 32, _panel_center, _panel_y, 1, 1, 0, faction_colour, faction_colour, faction_colour, faction_colour, 1); + draw_sprite_ext(spr_faction_icons,_faction_index,xx+(_panel_width/2)-30,yy+25, 0.60, 0.60, 0, c_white, 1); } else { scr_shader_initialize(); var main_color = make_colour_from_array(obj_controller.body_colour_replace); var right_pauldron = make_colour_from_array(obj_controller.pauldron_colour_replace); - draw_sprite_general(spr_p_name_bg, 0, 0, 0, string_width(name) + 60, 32, xx-(panel_width/2), yy+30, 1, 1, 0, main_color, main_color, right_pauldron, right_pauldron, 1); + draw_sprite_general(spr_p_name_bg, 0, 0, 0, _panel_width, 32, _panel_center, _panel_y, 1, 1, 0, main_color, main_color, right_pauldron, right_pauldron, 1); var faction_sprite = global.chapter_icon.sprite; - draw_sprite_ext(faction_sprite,0,xx+(panel_width/2)-30,yy+30, 0.2, 0.2, 0, c_white, 1); + draw_sprite_ext(faction_sprite,0,_panel_center-30,_panel_y, 0.2, 0.2, 0, c_white, 1); //context.set_vertical_gradient(main_color, right_pauldron); //draw_text_ext_transformed_color(gx + xoffset,gy + yoffset,text,sep,owner.width,xscale,yscale,angle ,col1, col2, col3, col4, alpha); } @@ -90,6 +110,8 @@ if (global.load == -1 && (obj_controller.zoomed || in_camera_view(star_box_shape var _sprite = ds_map_find_value(global.star_sprites, name) draw_sprite_ext(_sprite, 0, x-(64*scale), y, scale, scale, 1, c_white, 1); } -draw_set_valign(fa_top) +draw_set_valign(fa_top); + +pop_draw_return_values(); diff --git a/objects/obj_star_select/Draw_64.gml b/objects/obj_star_select/Draw_64.gml index 0ee09b3011..b8dd549b8b 100644 --- a/objects/obj_star_select/Draw_64.gml +++ b/objects/obj_star_select/Draw_64.gml @@ -15,9 +15,11 @@ draw_set_halign(fa_center); draw_set_valign(fa_top); draw_set_color(0); + +try{ var temp1=0; -var xx=__view_get( e__VW.XView, 0 )+0; -var yy=__view_get( e__VW.YView, 0 )+0; +var xx = 0; +var yy = 0; if (loading=1){ xx=xx; yy=yy; @@ -92,26 +94,31 @@ if (click_accepted && (!debug || !debug_slate.entered())) { } } -if (target.craftworld=0) and (target.space_hulk=0) then draw_sprite(spr_star_screen,target.planets,27,165); -if (target.craftworld=1) then draw_sprite(spr_star_screen,5,27,165); -if (target.space_hulk=1) then draw_sprite(spr_star_screen,6,27,165); -if (target.craftworld=0) and (target.space_hulk=0) then draw_sprite_ext(target.sprite_index,target.image_index,77,287,1.25,1.25,0,c_white,1); +var _standard_star = !target.craftworld && !target.space_hulk; + +if (_standard_star){ + draw_sprite(spr_star_screen,target.planets,27,165); + draw_sprite_ext(target.sprite_index,target.image_index,77,287,1.25,1.25,0,c_white,1); +}else if (target.craftworld){ + draw_sprite(spr_star_screen,5,27,165); +} else if(target.space_hulk){ + draw_sprite_ext(target.sprite_index,target.image_index,77,287,1.25,1.25,0,c_white,1); +} var _screen_height = sprite_get_height(spr_star_screen); var _screen_width = sprite_get_width(spr_star_screen); +//TODO bottle these into a constructor for re-use draw_sprite_ext(spr_servo_left_arm, 0,27+_screen_width,165+_screen_height/3, 2, 2, 0, c_white, 1); draw_sprite_ext(spr_servo_right_arm, 0,27,165+_screen_height/3, 2, 2, 0, c_white, 1); draw_sprite_ext(spr_servo_skull_head, 0,27+_screen_width/2,165, 2, 2, 0, c_white, 1); -var system_string = target.name+" System"; -if (target.owner!=1) then draw_set_color(0); -if (target.owner = eFACTION.Player) then draw_set_color(c_blue); -if (target.craftworld=0) and (target.space_hulk=0){ - draw_text_transformed(184,180,system_string,1,1,0); -} +var system_string = $"{target.name} System"; + +draw_set_color(target.owner == eFACTION.Player ? c_blue : 0); -if (target.craftworld=0) and (target.space_hulk=0){ +if (_standard_star){ + draw_text_transformed(184,180,system_string,1,1,0); draw_set_color(global.star_name_colors[target.owner]); draw_text_transformed(184,180,system_string,1,1,0); } @@ -150,7 +157,7 @@ if (loading!=0){ draw_set_font(fnt_40k_14); draw_set_color(CM_GREEN_COLOR); draw_text(184,202, - string_hash_to_newline("Select Destination")); + "Select Destination"); } @@ -163,8 +170,8 @@ draw_set_font(fnt_40k_14b); if (obj_controller.selecting_planet!=0){ if (p_data.planet != obj_controller.selecting_planet){ - delete p_data; p_data = new PlanetData(obj_controller.selecting_planet, target); + target.system_datas[obj_controller.selecting_planet] = p_data; } // Buttons that are available if (!buttons_selected){ @@ -179,7 +186,9 @@ if (obj_controller.selecting_planet!=0){ if (p_data.player_forces>0){ if (is_enemy){ button1="Attack"; - button2="Purge"; + if (p_data.population){ + button2="Purge"; + } } } } @@ -192,7 +201,9 @@ if (obj_controller.selecting_planet!=0){ else { button1="Attack"; button2="Raid"; - button3="Purge"; + if (p_data.population){ + button2="Purge"; + } } if (torpedo>0){ @@ -262,7 +273,7 @@ if (obj_controller.selecting_planet!=0){ } } }else if (garrison!="" && !population){ - if (garrison.garrison_force ){ + if (garrison.garrison_force){ draw_set_font(fnt_40k_14); if (!garrison.garrison_leader){ garrison.find_leader() @@ -301,66 +312,7 @@ if (obj_controller.selecting_planet!=0){ } else if (population){ garrison_data_slate.title = "Population Report"; garrison_data_slate.inside_method = function(){ - draw_set_color(c_gray); - var xx = garrison_data_slate.XX; - var yy = garrison_data_slate.YY; - var cur_planet = obj_controller.selecting_planet; - var half_way = garrison_data_slate.height/2; - var spacing_x = 100 - var spacing_y = 65 - draw_set_halign(fa_left); - if (!target.space_hulk) { - if (obj_controller.faction_status[eFACTION.Imperium] != "War" && p_data.current_owner <= 5) || (obj_controller.faction_status[eFACTION.Imperium] == "War") { - colonist_button.update({ - x1:xx+35, - y1:half_way, - allow_click : array_length(potential_doners), - }); - colonist_button.draw(); - - recruiting_button.update({ - x1:xx+(spacing_x*2)+15, - y1:half_way, - allow_click : true, - }); - recruiting_button.draw(); - if (p_data.has_feature(P_features.Recruiting_World)) { - var _recruit_world = p_data.get_features(P_features.Recruiting_World)[0]; - if (_recruit_world.recruit_type == 0) && (obj_controller.faction_status[p_data.current_owner] != "War" && obj_controller.faction_status[p_data.current_owner] != "Antagonism" || p_data.player_disposition >= 50) { - draw_text(xx+(spacing_x*3)+35, half_way-20, "Open: Voluntery"); - } else if (_recruit_world.recruit_type == 0 && p_data.player_disposition <= 50) { - draw_text(xx+(spacing_x*3)+35, half_way-20, "Covert: Voluntery"); - } else { - draw_text(xx+(spacing_x*3)+35, half_way-20, "Abduct"); - } - recruitment_type_button.update({ - x1:xx+(spacing_x*3)+35, - y1:half_way, - allow_click : true, - }); - recruitment_type_button.draw(); - - draw_text(xx+(spacing_x*3)-15, half_way+(spacing_y)-20, $"Req:{_recruit_world.recruit_cost * 2}"); - if (_recruit_world.recruit_cost > 0) { - recruitment_costdown_button.update({ - x1:xx+(spacing_x*2)+35, - y1:half_way+(spacing_y), - allow_click : true, - }); - recruitment_costdown_button.draw(); - } - if (_recruit_world.recruit_cost < 5) { - recruitment_costup_button.update({ - x1:xx+(spacing_x*3)+35, - y1:half_way+(spacing_y), - allow_click : true, - }); - recruitment_costup_button.draw(); - } - } - } - } - + p_data.draw_planet_population_controls(); } garrison_data_slate.draw(344+main_data_slate.width-4, 160, 0.6, 0.6); } @@ -381,7 +333,7 @@ if (obj_controller.selecting_planet!=0){ var building=instance_create(x,y,obj_temp_build); building.target=target; building.planet=obj_controller.selecting_planet; - if (p_data.has_upgrade(P_features.Secret_Base)) then building.lair=1; + building.lair = p_data.has_upgrade(P_features.Secret_Base); if (p_data.has_upgrade(P_features.Arsenal)) then building.arsenal=1; if (p_data.has_upgrade(P_features.Gene_Vault)) then building.gene_vault=1; obj_controller.temp[104]=string(scr_master_loc()); @@ -498,23 +450,24 @@ if (target!=0){ draw_set_font(fnt_40k_14b); draw_text(37.5,413.5,"Select Fleet Combat"); - var i,x3,y3;i=0; // x3=46;y3=252; - x3=49;y3=441; + var x3=49,y3=441; - repeat(7){i+=1; + for (var i=1;i<=7;i++){ if (en_fleet[i]>0){ // draw_sprite_ext(spr_force_icon,en_fleet[i],x3,y3,0.5,0.5,0,c_white,1); scr_image("ui/force",en_fleet[i],x3-16,y3-16,32,32); x3+=64; } } - - } } pop_draw_return_values(); +}catch(_exception){ + handle_exception(_exception); + instance_destroy(); +} /* */ diff --git a/objects/obj_timer/Create_0.gml b/objects/obj_timer/Create_0.gml index c7bccb95c0..82763a34d9 100644 --- a/objects/obj_timer/Create_0.gml +++ b/objects/obj_timer/Create_0.gml @@ -5,9 +5,7 @@ end_function_args = []; execute_end_function = function() { if (is_method(end_function)) { - // show_debug_message("Executing Method!"); method_call(end_function, end_function_args); } - // show_debug_message("Killing Myself!"); instance_destroy(self); } diff --git a/objects/obj_turn_end/Alarm_1.gml b/objects/obj_turn_end/Alarm_1.gml index e8d9b3a34e..d0e3f25d14 100644 --- a/objects/obj_turn_end/Alarm_1.gml +++ b/objects/obj_turn_end/Alarm_1.gml @@ -13,7 +13,6 @@ if (_is_audience){ } } - show_debug_message(current_audience); if (obj_controller.menu != MENU.Diplomacy){ scr_toggle_diplomacy(); @@ -35,7 +34,6 @@ if (_is_audience){ } if (obj_controller.diplomacy!=6){ - //show_debug_message("new_intro"); scr_dialogue("intro"); } diff --git a/scripts/__init_global/__init_global.gml b/scripts/__init_global/__init_global.gml index 5ffa35cd09..927f1913bb 100644 --- a/scripts/__init_global/__init_global.gml +++ b/scripts/__init_global/__init_global.gml @@ -42,5 +42,6 @@ function __init_global() { global.ui_click_lock = false; global.name_generator = new NameGenerator(); global.star_sprites = ds_map_create(); + global.en_fleet_sprites = ds_map_create(); global.base_component_surface = -1; } diff --git a/scripts/action_draw_ellipse/action_draw_ellipse.gml b/scripts/action_draw_ellipse/action_draw_ellipse.gml index 97ccdf0dc5..6475d0e821 100644 --- a/scripts/action_draw_ellipse/action_draw_ellipse.gml +++ b/scripts/action_draw_ellipse/action_draw_ellipse.gml @@ -22,3 +22,11 @@ function action_draw_ellipse(argument0, argument1, argument2, argument3, argumen } + + +function draw_circle_with_outline_width(xx,yy,r,w){ + for (var i=0.0;i,,] -// if opposite is true then then the roles defined in the group argument are ignored and all others collected -// search conditions - // companies, takes either an int or an arrat to define which companies to search in - // any stat allowed by the stat_valuator basically allows you to look for marines whith certain stat lines - // job allows you to find marines forfuling certain tasks like garrison or forge etc - -function collect_role_group(group=SPECIALISTS_STANDARD, location="", opposite=false, search_conditions = {companies:"all"}){ - var _units = [], unit, count=0, _add=false, _is_special_group; - var _max_count = 0; - var _total_count = 0; - if (struct_exists(search_conditions, "max")){ - _max_count = search_conditions.max; - } - if (!struct_exists(search_conditions, "companies")){ - search_conditions.companies = "all"; - } - for (var com=0;com<=10;com++){ - if (_max_count>0){ - if (array_length(_units)>=_max_count){ - break; - } - } - var _wanted_companies = search_conditions.companies; - if (_wanted_companies!="all"){ - if (is_array(_wanted_companies)){ - if (!array_contains(_wanted_companies, com)) then continue; - } else { - if (_wanted_companies != com) then continue; - } - } - for (var i=0;i0){ - if (array_length(_units)>=_max_count){ - break; - } - } - if array_length(_units) - _add=false; - unit=fetch_unit([com,i]); - if (unit.name()=="") then continue; - if (group!="all"){ - if (is_array(group)){ - if (array_length(group) == 3) { - _is_special_group = unit.IsSpecialist(group[0], group[1], group[2]); - } else { - _is_special_group = unit.IsSpecialist(group[0], group[1]); - } - } else { - _is_special_group = unit.IsSpecialist(group); - } - } else { - _is_special_group = true; - } - if ((_is_special_group && !opposite) || (!_is_special_group && opposite)){ - if (location==""){ - _add=true; - } else if (!is_array(location)){ - _add=unit.is_at_location(location); - } else { - _add=unit.is_at_location(location[0], location[1], location[2]); - } - } - if (_add){ - if (struct_exists(search_conditions, "stat")){ - _add = stat_valuator(search_conditions.stat, unit); - } - if (struct_exists(search_conditions,"job")){ - _add = (unit.assignment() == search_conditions.job); - } - } - if (_add) then array_push(_units, obj_ini.TTRPG[com][i]); - } - } - return _units; -} - -function stat_valuator(search_params, unit){ - match = true; - for (var stat = 0;stat _stat_val[1]){ - match = false; - break; - } - break; - - case "exless": - if (unit[$ _stat_val[0]] >= _stat_val[1]){ - match = false; - break; - } - break; - } - } - return match; -} - -function collect_by_religeon(religion, sub_cult="", location=""){ - var _units = [], unit, count=0, _add=false; - for (var com=0;com<=10;com++){ - for (var i=1;i 0) { - for (var veh = 0; veh < array_length(vehicles); veh++) { - unit = vehicles[veh]; - add_vehicle_to_manage_arrays(unit); - } - } - other_manage_data(); - man_current = 0; - man_max = MANAGE_MAN_MAX; - - if (selection_data.select_type == MissionSelectType.Squads){ - new_company_struct(); - company_data.has_squads = true; - company_data.squad_location = selection_data.system.name; - company_data.squad_search(); - managing = -1; - } - } - show_debug_message($"manage_success {obj_controller.menu}"); - } catch (_exception) { - //handle and send player back to map - handle_exception(_exception); - scr_toggle_manage(); - } -} diff --git a/scripts/scr_ChapterTraits/scr_ChapterTraits.gml b/scripts/scr_ChapterTraits/scr_ChapterTraits.gml index 2e6e435f4d..b2bc7b9ca9 100644 --- a/scripts/scr_ChapterTraits/scr_ChapterTraits.gml +++ b/scripts/scr_ChapterTraits/scr_ChapterTraits.gml @@ -41,14 +41,12 @@ function ChapterTrait(_id, _name, _description, _points_cost, _meta = []) constr function Advantage(_id, _name, _description, _points_cost) : ChapterTrait(_id, _name, _description, _points_cost) constructor { static add = function(slot){ - show_debug_message($"Adding adv {name} to slot {slot} for points {points}"); obj_creation.adv[slot] = name; obj_creation.adv_num[slot] = id; obj_creation.points+=points; add_meta(); } static remove = function(slot){ - show_debug_message($"removing adv {name} from slot {slot} for points {points}"); obj_creation.adv[slot] = ""; obj_creation.points-=points; obj_creation.adv_num[slot]=0; @@ -72,7 +70,6 @@ function Advantage(_id, _name, _description, _points_cost) : ChapterTrait(_id, _ function Disadvantage(_id, _name, _description, _points_cost) : ChapterTrait(_id, _name, _description, _points_cost) constructor { static add = function(slot){ - show_debug_message($"Adding disadv {name} to slot {slot} for points {points}"); obj_creation.dis[slot] = name; obj_creation.dis_num[slot] = id; obj_creation.points-=points; @@ -80,7 +77,6 @@ function Disadvantage(_id, _name, _description, _points_cost) : ChapterTrait(_id } static remove = function(slot){ - show_debug_message($"Removing disadv {name} from slot {slot} for points {points}"); obj_creation.dis[slot] = ""; obj_creation.points+=points; obj_creation.dis_num[slot]=0; diff --git a/scripts/scr_PlanetData/scr_PlanetData.gml b/scripts/scr_PlanetData/scr_PlanetData.gml index 96dc83e039..b5bf5d223f 100644 --- a/scripts/scr_PlanetData/scr_PlanetData.gml +++ b/scripts/scr_PlanetData/scr_PlanetData.gml @@ -4,43 +4,126 @@ #macro ARR_strength_descriptions ["none", "Minimal", "Sparse", "Moderate", "Numerous", "Very Numerous", "Overwhelming"]; function PlanetData(planet, system) constructor{ -//safeguards // TODO LOW DEBUG_LOGGING // Log when tripped somewhere - //disposition - if (system.dispo[planet] < -100 && system.dispo[planet] > -1000 && system.p_owner[planet] != eFACTION.Player ) { // Personal Rule code be doing some interesting things - system.dispo[planet] = -100; // TODO LOW DISPOSITION_REVAMP // Consider revamping the disposition system - } else if (system.dispo[planet] > 100) { - system.dispo[planet] = 100; - } // static large_pop_conversion = 1000000000; - self.planet = planet; self.system = system; - x = system.x; - y = system.y; - player_disposition = system.dispo[planet]; - planet_type = system.p_type[planet]; - operatives = system.p_operatives[planet]; + + + static refresh_data = function(){ + features = system.p_feature[planet]; + current_owner = system.p_owner[planet]; + origional_owner = system.p_first[planet]; + population = system.p_population[planet]; + max_population = system.p_max_population[planet]; + large_population = system.p_large[planet]; + secondary_population = system.p_pop[planet]; + is_craftworld = system.craftworld; + is_hulk = system.space_hulk; + x = system.x; + y = system.y; + player_disposition = system.dispo[planet]; + planet_type = system.p_type[planet]; + operatives = system.p_operatives[planet]; + pdf = system.p_pdf[planet]; + fortification_level = system.p_fortified[planet]; + star_station = system.p_station[planet]; + pdf_loss_reduction = 0; + + // Whether or not player forces are on the planet + player_forces = system.p_player[planet]; + + defence_lasers = system.p_lasers[planet]; + defence_silos = system.p_silo[planet]; + ground_defences = system.p_defenses[planet]; + upgrades = system.p_upgrades[planet]; + // v how much of a problem they are from 1-5 + planet_forces = array_create(14, 0); + guardsmen = system.p_guardsmen[planet]; + pdf = system.p_pdf[planet]; + + try{ + planet_forces[eFACTION.Player] = player_forces; + + planet_forces[eFACTION.Imperium] = guardsmen; + + planet_forces[eFACTION.Ecclesiarchy] = system.p_sisters[planet]; + planet_forces[eFACTION.Eldar] = system.p_eldar[planet]; + planet_forces[eFACTION.Ork] = system.p_orks[planet]; + planet_forces[eFACTION.Tau] = system.p_tau[planet]; + planet_forces[eFACTION.Tyranids] = system.p_tyranids[planet]; + planet_forces[eFACTION.Chaos] = system.p_chaos[planet]+ system.p_demons[planet]; + planet_forces[eFACTION.Heretics] = system.p_traitors[planet]; + + planet_forces[eFACTION.Necrons] = system.p_necrons[planet]; + }catch(_exception){ + handle_exception(_exception); + } + + fortification_level = system.p_fortified[planet]; + + is_heretic = system.p_hurssy[planet]; + + heretic_timer = system.p_hurssy_time[planet]; + + secret_corruption = system.p_heresy_secret[planet]; + + corruption = system.p_heresy[planet]; + + population_influences = system.p_influence[planet]; + + raided_this_turn = system.p_raided[planet]; + // + governor = system.p_governor[planet]; + + problems = system.p_problem[planet]; + problems_data = system.p_problem_other_data[planet]; + problem_timers = system.p_timer[planet]; + + deamons = system.p_demons[planet]; + chaos_forces = system.p_chaos[planet]; + + requests_help = system.p_halp[planet]; + + //safeguards // TODO LOW DEBUG_LOGGING // Log when tripped somewhere + //disposition + if (system.dispo[planet] < -100 && system.dispo[planet] > -1000 && system.p_owner[planet] != eFACTION.Player ) { // Personal Rule code be doing some interesting things + system.dispo[planet] = -100; // TODO LOW DISPOSITION_REVAMP // Consider revamping the disposition system + } else if (system.dispo[planet] > 100) { + system.dispo[planet] = 100; + } + + garrisons = system.system_garrison[planet]; + sabatours = system.system_sabatours[planet]; + system.system_datas[planet] = self; + } + + refresh_data(); + + static total_corruption(){ + return secret_corruption + corruption; + } + + static edit_player_forces = function(val){ + system.p_player[planet]+=val; + player_forces = system.p_player[planet]; + } function add_operatives(new_ops){ array_push(system.p_operatives[planet], new_ops); operatives = system.p_operatives[planet]; } - features = system.p_feature[planet]; - current_owner = system.p_owner[planet]; - origional_owner = system.p_first[planet]; - population = system.p_population[planet]; - max_population = system.p_max_population[planet]; - large_population = system.p_large[planet]; - secondary_population = system.p_pop[planet]; - is_craftworld = system.craftworld; - is_hulk = system.space_hulk; + static set_player_disposition = function(new_dispo){ player_disposition = new_dispo; system.dispo[planet] = player_disposition; } + static collect_planet_group = function(group=SPECIALISTS_STANDARD,opposite=false,search_conditions = {companies:"all"}){ + return(collect_role_group(group,[system.name,planet],opposite,search_conditions)) + } + static owner_faction_disposition = function(){ return obj_controller.disposition[current_owner]; } @@ -69,6 +152,21 @@ function PlanetData(planet, system) constructor{ return pop_value; } + static end_turn_population_growth = function(){ + if ((population < max_population) && (planet_type != "Dead") && (planet_type != "Craftworld") && (current_owner <= 5) && (planet_forces[eFACTION.Heretics] == 0) && (planet_forces[eFACTION.Tau] == 0) && (planet_forces[eFACTION.Ork] == 0) && (planet_forces[eFACTION.Necrons] == 0) && (planet_forces[eFACTION.Tyranids] == 0)) { + if (!large_population) { + set_population(round(population * 1.0008)); + } else if (large_population == 1) { + edit_population(choose(0, 0.01)); + } + } + } + + static alter_influence = function(faction,value){ + adjust_influence(eFACTION.Tyranids, -1, planet,system); + population_influences = system.p_influence[planet]; + } + static send_colony_ship = function(target, targ_planet, type){ new_colony_fleet(system, planet, target, targ_planet, type); } @@ -120,15 +218,16 @@ function PlanetData(planet, system) constructor{ return _at_war; } - guardsmen = system.p_guardsmen[planet]; - static edit_guardsmen = function(edit_val){ system.p_guardsmen[planet] = max(0, system.p_guardsmen[planet] + edit_val); guardsmen = system.p_guardsmen[planet]; } - pdf = system.p_pdf[planet]; - fortification_level = system.p_fortified[planet]; + static edit_pdf = function(edit_val){ + system.p_pdf[planet] = max(0, system.p_pdf[planet] + edit_val); + pdf = system.p_pdf[planet]; + } + static alter_fortification = function(alteration){ system.p_fortified[planet] += alteration; fortification_level = system.p_fortified[planet]; @@ -144,40 +243,6 @@ function PlanetData(planet, system) constructor{ system.p_pdf[planet] = pdf; return new_pdf; } - star_station = system.p_station[planet]; - pdf_loss_reduction = 0; - - // Whether or not player forces are on the planet - player_forces = system.p_player[planet]; - - static edit_player_forces = function(val){ - system.p_player[planet]+=val; - player_forces = system.p_player[planet]; - } - defence_lasers = system.p_lasers[planet]; - defence_silos = system.p_silo[planet]; - ground_defences = system.p_defenses[planet]; - upgrades = system.p_upgrades[planet]; - // v how much of a problem they are from 1-5 - planet_forces = array_create(14, 0); - - try{ - planet_forces[1] = player_forces; - - planet_forces[2] = guardsmen; - - planet_forces[5] = system.p_sisters[planet]; - planet_forces[6] = system.p_eldar[planet]; - planet_forces[7] = system.p_orks[planet]; - planet_forces[8] = system.p_tau[planet]; - planet_forces[9] = system.p_tyranids[planet]; - planet_forces[10] = system.p_traitors[planet]; - planet_forces[11] = system.p_chaos[planet]+ system.p_demons[planet]; - - planet_forces[13] = system.p_necrons[planet]; - }catch(_exception){ - handle_exception(_exception); - } static add_forces = function(faction, val){ var _new_val = planet_forces[faction]+val; @@ -257,9 +322,9 @@ function PlanetData(planet, system) constructor{ return _text; } static grow_ork_forces = function(){ - var contin=0; - var rando=roll_dice(1,100);// This part handles the spreading - // if (rando<30){ + var contin = 0; + var _rando = roll_dice(1,100);// This part handles the spreading + // if (_rando<30){ var _non_deads = planets_without_type("dead", system); var _has_warboss = has_feature(P_features.OrkWarboss); @@ -273,7 +338,35 @@ function PlanetData(planet, system) constructor{ var _warboss = get_features(P_features.OrkWarboss)[0]; _warboss.turns_static++; } - if (array_length(_non_deads)>0 && rando>40){ + var _roll_num = 100; + if (_has_stronghold){ + _roll_num -= (_has_stronghold + 1) * 3; + } + var _ork_growth = roll_dice_chapter(1, 100, "high"); + success = false; // This part handles the increasing in numbers + + var _ork_growth_threshold = 13; + + if (_has_warboss){ + _ork_growth_threshold *= 2; + } + + var _orks = planet_forces[eFACTION.Ork]; + if ((current_owner == eFACTION.Ork) && (_orks < 5) && (planet_forces[eFACTION.Heretics] == 0) && (player_forces <= 0 || !is_garrison_force)) { + if ((_orks> 0) && (_ork_growth <= _ork_growth_threshold)) { + if (sabotage_force) { + if (irandom(3) < 2) { + scr_event_log("green", $"sabotage force on {name()} disrupts ork forces", name); + } else { + add_forces(eFACTION.Ork,1); + } + } else { + add_forces(eFACTION.Ork,1); + } + } + } + + if (array_length(_non_deads)>0 && _rando>40){ var _ork_spread_planet = array_random_element(_non_deads); var _orks = planet_forces[eFACTION.Ork] var _ork_target = system.p_orks[_ork_spread_planet]; @@ -294,7 +387,7 @@ function PlanetData(planet, system) constructor{ } } contin=0; - rando=roll_dice(1,100);// This part handles the ship building + _rando=roll_dice(1,100);// This part handles the ship building if (population>0 && pdf==0 && guardsmen==0 && planet_forces[10]==0) and (planet_forces[eFACTION.Tau]==0){ if (!large_population){ set_population(population*0.97); @@ -316,8 +409,8 @@ function PlanetData(planet, system) constructor{ } if (_has_warboss && !_has_stronghold){ - rando=roll_dice_chapter(1,100, "low"); - if (rando<30){ + _rando=roll_dice_chapter(1,100, "low"); + if (_rando<30){ add_feature(P_features.OrkStronghold); } } else { @@ -333,14 +426,14 @@ function PlanetData(planet, system) constructor{ } if (!enemies_present){ - rando=roll_dice_chapter(1,150, "low"); + _rando=roll_dice_chapter(1,150, "low"); if (_has_warboss){ - rando -= 20; + _rando -= 20; } if (_has_stronghold){ - rando -= _stronghold.tier*5; + _rando -= _stronghold.tier*5; } - if (obj_controller.known[eFACTION.Ork]>0) then rando-=10;// Empire bonus, was 15 before + if (obj_controller.known[eFACTION.Ork]>0) then _rando-=10;// Empire bonus, was 15 before // Check for industrial facilities var fleet_buildable = ((planet_type!="Dead" && planet_type!="Lava") || _has_warboss || _has_stronghold); @@ -353,15 +446,15 @@ function PlanetData(planet, system) constructor{ }; } if (planet_type == "Forge"){ - rando-=80; + _rando-=80; } else if (planet_type == "Hive" || planet_type == "Temperate"){ - rando-=30; + _rando-=30; }else if (planet_type == "Agri"){ - rando-=10; + _rando-=10; } var _ork_fleet = scr_orbiting_fleet(eFACTION.Ork, system); if (_ork_fleet=="none"){ - if (rando<=20){ + if (_rando<=20){ new_ork_fleet(x,y); } } else { @@ -375,18 +468,18 @@ function PlanetData(planet, system) constructor{ var _pdata = self; with (_ork_fleet){ // Increase ship number for this object? - var rando=irandom(101); - if (obj_controller.known[eFACTION.Ork]>0) then rando-=10; + var _rando=irandom(101); + if (obj_controller.known[eFACTION.Ork]>0) then _rando-=10; var _planet_type = _pdata.planet_type; if (_planet_type=="Forge"){ - rando-=20; + _rando-=20; } else if (_planet_type=="Hive"){ - rando-=10; + _rando-=10; }else if (_planet_type=="Shrine" || _planet_type=="Temperate"){ - rando-=5; + _rando-=5; } - if (rando<=15){// was 25 - rando=choose(1,1,1,1,1,1,1,2,2,2); + if (_rando<=15){// was 25 + _rando=choose(1,1,1,1,1,1,1,2,2,2); var _big_stronghold = false if (_has_stronghold){ if (_stronghold.tier>=2){ @@ -395,17 +488,17 @@ function PlanetData(planet, system) constructor{ } if (_planet_type=="Forge" || _big_stronghold || _has_warboss){ if (!irandom(10)){ - rando = 3; + _rando = 3; } }else if (_has_stronghold || _planet_type=="Hive"){ if (!irandom(30)){ - rando = 3; + _rando = 3; } } if (capital_number<=0){ - rando = 3; + _rando = 3; } - switch(rando){ + switch(_rando){ case 3: capital_number+=1; break; @@ -418,10 +511,7 @@ function PlanetData(planet, system) constructor{ } } - var ii=0; - ii+=capital_number; - ii+=round((frigate_number/2)); - ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()); if (ii<=1) then ii=1; image_index=ii; //if big enough flee bugger off to new star @@ -449,9 +539,9 @@ function PlanetData(planet, system) constructor{ } } if (_has_warboss){ - rando=roll_dice(1,100)+10; + _rando=roll_dice(1,100)+10; var _ork_fleet = scr_orbiting_fleet(eFACTION.Ork, system); - if (_ork_fleet!="none" && rando < _warboss.turns_static){ + if (_ork_fleet!="none" && _rando < _warboss.turns_static){ _warboss.turns_static = 0; _ork_fleet.cargo_data.ork_warboss = _warboss; delete_feature(P_features.OrkWarboss); @@ -463,11 +553,6 @@ function PlanetData(planet, system) constructor{ } - deamons = system.p_demons[planet]; - chaos_forces = system.p_chaos[planet]; - - requests_help = system.p_halp[planet]; - // current planet heresy if (population == 0) { system.p_heresy[planet] = 0; @@ -477,29 +562,15 @@ function PlanetData(planet, system) constructor{ } } - - corruption = system.p_heresy[planet]; - static alter_corruption = function(value){ alter_planet_corruption(value, planet, system); corruption = system.p_heresy[planet]; } - - is_heretic = system.p_hurssy[planet]; - - heretic_timer = system.p_hurssy_time[planet]; - secret_corruption = system.p_heresy_secret[planet]; - - population_influences = system.p_influence[planet]; - - raided_this_turn = system.p_raided[planet]; - // - governor = system.p_governor[planet]; - - problems = system.p_problem[planet]; - problems_data = system.p_problem_other_data[planet]; - problem_timers = system.p_timer[planet]; + static set_corruption = function(value){ + system.p_heresy[planet] = value; + corruption = system.p_heresy[planet]; + } static has_problem = function(problem){ has_problem_planet(planet, problem, system); @@ -540,6 +611,7 @@ function PlanetData(planet, system) constructor{ static add_feature = function(feature_type){ var new_feature = new NewPlanetFeature(feature_type); array_push(system.p_feature[planet], new_feature); + features = system.p_feature[planet]; return new_feature; } @@ -558,6 +630,7 @@ function PlanetData(planet, system) constructor{ static delete_feature = function(feature){ delete_features(system.p_feature[planet], feature); + features = system.p_feature[planet]; } static bombard = scr_bomb_world; @@ -593,6 +666,50 @@ function PlanetData(planet, system) constructor{ return _training_happend; }; + static search_old_battle_grounds = function(units = []){ + if (!has_feature(P_features.OldBattleGround) || !array_length(units)){ + exit; + } + + + + var _marines = []; + for (var i=0;i 0){ + if (_priests.number == _techmarines.number){ + text = "Without any technical staff wholly loyal to the chapter the TechPriests Quickly set too Work sequestering any valuable resources for the Omnissiah"; + text += + scr_popup("Mars Control"); + } else { + text = "After Unloading Marines too site it becomes clear there is discontent among the group.\n"; + text = "A contingent of the force comprised of Techpriests are unhappy with the decision.\n"; + scr_popup("Conflict of Interest",) + } + } + } + + + } + + static recover_starship = function(techs){ try { var engineer_count = array_length(techs); @@ -616,7 +733,7 @@ function PlanetData(planet, system) constructor{ _starship.funds_spent+=_requisition_spend; if (_requisition_spend>0 && _starship.funds_spent<_target_spend){ - scr_alert("green","owner",$"{_requisition_spend} Requision spent on Ancient Ship repairs in materials and outfitting (outfitting {(_starship.funds_spent/_target_spend)*100}%)",system.x,system.y); + scr_alert("green","owner",$"{_requisition_spend} Requisition spent on Ancient Ship repairs in materials and outfitting (outfitting {(_starship.funds_spent/_target_spend)*100}%)",system.x,system.y); } if (_starship.funds_spent>=_target_spend && _starship.engineer_score>=2000){// u2=tar; //TODO refactor into general new ship logic @@ -803,13 +920,13 @@ function PlanetData(planet, system) constructor{ static pdf_loss_reduction_calc = function(){ pdf_loss_reduction = fortification_level*0.001; if (pdf_will_support_player()){ - pdf_loss_reduction+=garrison.viable_garrison*0.0005; + pdf_loss_reduction+=garrisons.viable_garrison*0.0005; } return pdf_loss_reduction; } static pdf_defence_loss_to_orks = function(){ - var active_garrison = pdf_will_support_player() && garrison.viable_garrison>0; + var active_garrison = pdf_will_support_player() && garrisons.viable_garrison>0; if (planet_forces[eFACTION.Ork]>=4) and (pdf>=30000){ pdf=floor(pdf*(min(0.95, 0.55+pdf_loss_reduction))); } @@ -837,7 +954,7 @@ function PlanetData(planet, system) constructor{ var xx=15; var yy=25; var current_planet=planet; - var nm=scr_roman(current_planet), temp1=0; + var temp1=0; draw_set_halign(fa_center); draw_set_valign(fa_top); draw_set_font(fnt_40k_14); @@ -887,15 +1004,15 @@ function PlanetData(planet, system) constructor{ var bar_start_point = xx+349; var bar_percent_length = (bar_width/100); var current_bar_percent = 0; - var hidden_cult = false; + var _hidden_cult = false; if (has_feature(P_features.Gene_Stealer_Cult)){ - hidden_cult = get_features(P_features.Gene_Stealer_Cult)[0].hiding; + _hidden_cult = get_features(P_features.Gene_Stealer_Cult)[0].hiding; } for (var i=1;i<13;i++){ if (population_influences[i]>0){ draw_set_color(global.star_name_colors[i]); - if (hidden_cult){ + if (_hidden_cult && i == eFACTION.Tyranids){ draw_set_color(global.star_name_colors[eFACTION.Imperium]); } var current_start = bar_start_point+(current_bar_percent*bar_percent_length) @@ -910,11 +1027,16 @@ function PlanetData(planet, system) constructor{ yy+=20; draw_set_font(fnt_40k_14b); draw_set_halign(fa_left); - if (!is_craftworld && !is_hulk) then draw_text(xx+480,yy+196,$"{system.name} {nm} ({planet_type})"); - if (is_craftworld) then draw_text(xx+480,yy+196,string(system.name)+" (Craftworld)"); + if (!is_craftworld && !is_hulk){ + draw_text(xx+480,yy+196,$"{name()} ({planet_type})"); + } + else if (is_craftworld){ + draw_text(xx+480,yy+196,$"{system.name} (Craftworld)"); + } else if (is_hulk){ + draw_text(xx+480,yy+196,"Space Hulk"); + } // if (is_craftworld=0) and (is_hulk=0) then draw_text(xx+534,yy+214,string(planet_type)+" World"); // if (is_craftworld=1) then draw_text(xx+594,yy+214,"Craftworld"); - if (is_hulk) then draw_text(xx+480,yy+196,"Space Hulk"); // draw_sprite(spr_planet_splash,temp1,xx+349,yy+194); scr_image("ui/planet",scr_planet_image_numbers(planet_type),xx+349,yy+194,128,128); @@ -944,17 +1066,17 @@ function PlanetData(planet, system) constructor{ if (is_craftworld=0) and (is_hulk=0){ - var y7=240,temp3=string(scr_display_number(guardsmen)); + var y7=240,_guard_force=string(scr_display_number(guardsmen)); if (guardsmen>0){ - draw_text(xx+480,yy+y7,$"Imperial Guard: {temp3}"); + draw_text(xx+480,yy+y7,$"Imperial Guard: {_guard_force}"); y7+=20; } - var temp4=string(scr_display_number(pdf)); + var _pdf_force =string(scr_display_number(pdf)); if (current_owner!=8){ - draw_text(xx+480,yy+y7,$"Defense Force: {temp4}"); + draw_text(xx+480,yy+y7,$"Defense Force: {_pdf_force}"); } if (current_owner=8){ - draw_text(xx+480,yy+y7,$"Gue'Vesa Force: {temp4}"); + draw_text(xx+480,yy+y7,$"Gue'Vesa Force: {_pdf_force}"); } } @@ -962,7 +1084,7 @@ function PlanetData(planet, system) constructor{ if (!is_hulk){ - if (improve=1){ + if (improve){ draw_set_color(c_green); draw_rectangle(xx+481,yy+280,xx+716,yy+298,0); draw_sprite(spr_requisition,0,xx+657,yy+283); @@ -980,7 +1102,7 @@ function PlanetData(planet, system) constructor{ draw_set_color(0); draw_set_alpha(0.2); draw_rectangle(xx+481,yy+280,xx+716,yy+298,0); - if (scr_click_left()) and (obj_controller.requisition>=improve_cost){ + if (scr_click_left() && obj_controller.requisition >= improve_cost){ obj_controller.requisition-=improve_cost; alter_fortification(1); @@ -1070,6 +1192,8 @@ function PlanetData(planet, system) constructor{ var to_show=0,temp9="";t=-1; + + //TODO makeeverything below calculated once and OOP var fit = array_create(11, ""); var planet_displays = [], i; var feat_count, _cur_feature; @@ -1078,7 +1202,7 @@ function PlanetData(planet, system) constructor{ var size = ["", "Small", "", "Large"]; if ( feat_count > 0){ for (i =0; i < feat_count ;i++){ - cur_feature= features[i] + cur_feature = features[i] if (cur_feature.planet_display != 0){ if (cur_feature.f_type == P_features.Gene_Stealer_Cult){ if (!cur_feature.hiding){ @@ -1170,6 +1294,68 @@ function PlanetData(planet, system) constructor{ } } + static draw_planet_population_controls = function(){ + draw_set_color(c_gray); + var _gar_slate = obj_star_select.garrison_data_slate; + var xx = _gar_slate.XX; + var yy = _gar_slate.YY; + var _half_way = _gar_slate.height/2; + var spacing_x = 100 + var spacing_y = 65 + draw_set_halign(fa_left); + if (!target.space_hulk) { + if (obj_controller.faction_status[eFACTION.Imperium] != "War" && current_owner <= 5) || (obj_controller.faction_status[eFACTION.Imperium] == "War") { + colonist_button.update({ + x1:xx+35, + y1:_half_way, + allow_click : array_length(potential_doners), + }); + colonist_button.draw(); + + recruiting_button.update({ + x1:xx+(spacing_x*2)+15, + y1:_half_way, + allow_click : true, + }); + recruiting_button.draw(); + if (has_feature(P_features.Recruiting_World)) { + var _recruit_world = get_features(P_features.Recruiting_World)[0]; + if (_recruit_world.recruit_type == 0) && (obj_controller.faction_status[current_owner] != "War" && obj_controller.faction_status[p_data.current_owner] != "Antagonism" || p_data.player_disposition >= 50) { + draw_text(xx+(spacing_x*3)+35, _half_way-20, "Open: Voluntery"); + } else if (_recruit_world.recruit_type == 0 && player_disposition <= 50) { + draw_text(xx+(spacing_x*3)+35, _half_way-20, "Covert: Voluntery"); + } else { + draw_text(xx+(spacing_x*3)+35, _half_way-20, "Abduct"); + } + recruitment_type_button.update({ + x1:xx+(spacing_x*3)+35, + y1:_half_way, + allow_click : true, + }); + recruitment_type_button.draw(); + + draw_text(xx+(spacing_x*3)-15, _half_way+(spacing_y)-20, $"Req:{_recruit_world.recruit_cost * 2}"); + if (_recruit_world.recruit_cost > 0) { + recruitment_costdown_button.update({ + x1:xx+(spacing_x*2)+35, + y1:_half_way+(spacing_y), + allow_click : true, + }); + recruitment_costdown_button.draw(); + } + if (_recruit_world.recruit_cost < 5) { + recruitment_costup_button.update({ + x1:xx+(spacing_x*3)+35, + y1:_half_way+(spacing_y), + allow_click : true, + }); + recruitment_costup_button.draw(); + } + } + } + } + } + static suffer_navy_bombard = function(strength){ @@ -1180,7 +1366,8 @@ function PlanetData(planet, system) constructor{ system.p_tyranids[planet]-=2; } else if (planet_forces[eFACTION.Ork]>0){ - if (strength>2) then strength=2;if (strength<1) then strength=0; + if (strength>2) then strength=2; + if (strength<1) then strength=0; system.p_orks[planet]-=2; } else if (current_owner=eFACTION.Tau) and (planet_forces[eFACTION.Tau]>0){ @@ -1191,10 +1378,7 @@ function PlanetData(planet, system) constructor{ } else if (current_owner=8) and (pdf>0){ - system.p_pdf[planet]-= strength*(irandom_range(49, 51) * 100000); - if (pdf<0){ - system.p_pdf[planet]=0; - } + edit_pdf(-strength*(irandom_range(49, 51) * 100000)); kill = large_population ? strength*0.15 : strength*15000000 } @@ -1214,10 +1398,10 @@ function PlanetData(planet, system) constructor{ var _pop_percentage_kill = population > 0 ? (kill / population) * 100 : 0; edit_population(kill*-1); - if (system.p_pdf[planet]<0) then system.p_pdf[planet]=0; + if (population_influences[eFACTION.Tyranids] > 3){ var _max_influence_reduction = min(_pop_percentage_kill,population_influences[eFACTION.Tyranids]-3); - adjust_influence(eFACTION.Tyranids,-_max_influence_reduction,planet,system); + alter_influence(eFACTION.Tyranids,-_max_influence_reduction); if (has_feature(P_features.Gene_Stealer_Cult)){ if (population_influences[eFACTION.Tyranids]<20){ delete_feature(P_features.Gene_Stealer_Cult); @@ -1225,9 +1409,9 @@ function PlanetData(planet, system) constructor{ } } - if (population+pdf<=0) and (current_owner=1) and (obj_controller.faction_status[eFACTION.Imperium]="War"){ + if (population + pdf<=0) and (current_owner=1) and (obj_controller.faction_status[eFACTION.Imperium]="War"){ if (!has_feature(P_features.Monastery)){ - current_owner=2; + set_new_owner(eFACTION.Imperium); add_disposition(-50); } } @@ -1250,10 +1434,10 @@ function PlanetData(planet, system) constructor{ job:_mission, task_time : 0 }; - add_operatives(operation_data) - system.garrison = true; + add_operatives(operation_data); + system.garrisons = true; - //if there was an outstanding mission to provide the given garrison + //if there was an outstanding mission to provide the given garrisons var garrison_request = find_problem("provide_garrison"); if (garrison_request>-1){ init_garrison_mission(planet, system, garrison_request); @@ -1269,19 +1453,19 @@ function PlanetData(planet, system) constructor{ var _loading = obj_star_select.loading; var garrison_assignment = obj_controller.view_squad && _loading; - if (garrison_assignment && (garrison_issue && _mission=="garrison")){ + if (garrison_assignment && (garrison_issue && _mission=="garrisons")){ planet_draw = c_red; - tooltip_draw("Can't garrison on non-friendly planet or planet with no friendly PDF", 150); + tooltip_draw("Can't garrisons on non-friendly planet or planet with no friendly PDF", 150); } if (mouse_check_button_pressed(mb_left)){ if (garrison_assignment){ - if (!(garrison_issue && _mission=="garrison")){ + if (!(garrison_issue && _mission=="garrisons")){ create_planet_garrison(); exit; } } else if (!_loading){ - garrison = new GarrisonForce(operatives); - system.garrison = garrison.garrison_force; + garrisons = new GarrisonForce(operatives); + system.garrisons = garrisons.garrison_force; feature=""; buttons_selected=false; } else if (_loading && planet >0){ @@ -1310,14 +1494,9 @@ function PlanetData(planet, system) constructor{ } if (!instance_exists(obj_ground_mission)){ check_for_artifact_grab_mission(); - } - if (!instance_exists(obj_ground_mission)){ check_for_stc_grab_mission(); - } - // Ancient Ruins - if (!instance_exists(obj_ground_mission)){ scr_check_for_ruins_exploration(); - } + } instance_destroy(obj_star_select); exit; } @@ -1325,8 +1504,522 @@ function PlanetData(planet, system) constructor{ } } + static end_of_turn_population_influence_and_enemy_growth = function(){ + + sabotage_force = sabatours.garrison_force; + total_garrison = garrisons.total_garrison; + is_garrison_force = garrisons.garrison_force; + + // Orks grow in number + + end_turn_population_growth(); + + // increasing necrons + if (array_length(features) != 0) { + var has_awake_tomb = false, + nfleet = 0; + if (awake_tomb_world(features) == 1) { + has_awake_tomb = true; + } + if (has_awake_tomb) { + if (planet_forces[eFACTION.Necrons] < 3) { + planet_forces[eFACTION.Necrons] += 2; + } else if (planet_forces[eFACTION.Necrons] < 6) { + planet_forces[eFACTION.Necrons] += 1; + } + } + if (sabotage_force && irandom(2) < 2) { + planet_forces[eFACTION.Necrons]--; + scr_event_log("green", $"sabotage force on {name()} disrupts necron forces", name); + } + + if (has_awake_tomb) { + // Necron fleets, woooo + //necrons kill populatin + if ((population > 0) && (player_forces + pdf + guardsmen + planet_forces[eFACTION.Tyranids] == 0)) { + population = population * 0.75; + if ((large_population == 0) && (population <= 5000)) { + population = 0; + } + } + + var fleet_spawn_chance = roll_dice_chapter(1, 100, "high"); + onceh = 0; + + if (fleet_spawn_chance <= 15) { + if (system.present_fleet[eFACTION.Necrons] > 0) { + //if necron fleet + necron_fleet = instance_nearest(x, y, obj_en_fleet); + + if (necron_fleet.owner == eFACTION.Necrons) { + if (necron_fleet.escort_number < necron_fleet.capital_number * 1.5) { + necron_fleet.escort_number += 2; + } else if (necron_fleet.frigate_number < necron_fleet.capital_number * 3) { + necron_fleet.frigate_number += 1; + } else { + necron_fleet.capital_number += 1; + } + } + } else if (system.present_fleet[eFACTION.Necrons] == 0) { + necron_fleet = instance_create(x, y, obj_en_fleet); + necron_fleet.owner = eFACTION.Necrons; + necron_fleet.capital_number = 1; + necron_fleet.sprite_index = spr_fleet_necron; + necron_fleet.image_speed = 0; + necron_fleet.image_index = 1; + system.present_fleet[eFACTION.Necrons] += 1; + } + var enemy_fleets = 0; + with(necron_fleet) { + if (owner == eFACTION.Necrons) { + var ii = 0; + ii += capital_number; + ii += round((frigate_number / 2)); + ii += round((escort_number / 4)); + if (ii <= 1) { + ii = 1; + } // image_index=max(8,round(ii)); + + if ((ii >= 7) && (capital_number > 1)) { + for (var fleet_n = 1; fleet_n <= 10; fleet_n++) { + if (orbiting.present_fleet[fleet_n] > 0) { + enemy_fleets++; + } + } + } + } + } + if (enemy_fleets > 0) { + var necron_fleet2; + necron_fleet2 = instance_create(x, y, obj_en_fleet); + necron_fleet2.owner = eFACTION.Necrons; + necron_fleet2.sprite_index = spr_fleet_necron; + // necron_fleet2.image_index=0; + necron_fleet.image_speed = 0; + necron_fleet2.capital_number = 1; + necron_fleet2.frigate_number = round(necron_fleet.frigate_number / 2); + necron_fleet2.escort_number = round(necron_fleet.escort_number / 2); + system.present_fleet[eFACTION.Necrons] += 1; + + necron_fleet.capital_number -= 1; + necron_fleet.frigate_number -= necron_fleet2.frigate_number; + necron_fleet.escort_number -= necron_fleet2.escort_number; + var nearest_planet_coords = [0, 0]; + var found_near_planet = false; + with(obj_star) { + if (present_fleet[eFACTION.Necrons] == 0) { + if (!array_contains(p_type, "Dead")) { + for (var plan = 1; plan <= planets; plan++) { + if (p_owner[plan] <= 5) { + found_near_planet = true; + nearest_planet_coords = [x, y]; + break; + } + } + } + } + } + + if (found_near_planet) { + var tgt1, tgt2; + + necron_fleet2.action_x = nearest_planet_coords[0]; + necron_fleet2.action_y = nearest_planet_coords[1]; + with (necron_fleet2){ + set_fleet_movement(); + } + } + } + } + } + } + + end_turn_heretics_and_corruption_growth(); + + end_turn_genestealer_cults(); + + + // Spread influence on controlled sector + if ((planet_type != "Space Hulk") && (planet_type != "Dead")) { + if ((corruption < 70 && current_owner == 10)) { + if (current_owner == 10){ + alter_corruption(2); + } + + } + if (current_owner == eFACTION.Tau && population_influences[eFACTION.Tyranids]<70){ + var _influ_chance = roll_dice(1,100); + if (_influ_chance <= 5 && population_influences[eFACTION.Tyranids]>=20){ + alter_influence(eFACTION.Tau, 1); + } + } + + if (planet_type == "Daemon"){ + if (pdf > 0) { + pdf = 0; + } + if (guardsmen > 0) { + guardsmen = 0; + } + } + + } + + } + + + static end_turn_genestealer_cults = function(){ + // Genestealer cults grow in number + if (has_feature(P_features.Gene_Stealer_Cult)) { + var cult = get_features(P_features.Gene_Stealer_Cult)[0]; + cult.cult_age++; + alter_influence(eFACTION.Tyranids, cult.cult_age / 100); + var planet_garrison = garrisons; + if (cult.hiding) { + var find_nid_chance = 50 - planet_garrison.total_garrison; + if (population_influences[eFACTION.Tyranids] > 50) { + var find_cult_chance = irandom(50); + var alert_text = $"A hidden Genestealer Cult on {name()} Has suddenly burst forth from hiding!"; + if (planet_garrison.garrison_force) { + var alert_text = $"A hidden Genestealer Cult on {name()} Has been discovered by marine garrisons!"; + find_cult_chance -= 25; + } + if (find_cult_chance < 1) { + cult.hiding = false; + scr_popup("System Lost", alert_text, "Genestealer Cult", ""); + set_new_owner(eFACTION.Tyranids); + scr_event_log("red", $"A hidden Genestealer Cult on {name()} has Started a revolt.", system.name); + edit_forces(eFACTION.Tyranids,1); + } + } + } + var _nids = planet_forces[eFACTION.Tyranids]; + if ((!cult.hiding) && (_nids <= 3) && (planet_type != "Space Hulk") && (population_influences[eFACTION.Tyranids] > 10)) { + var spread = 0; + var _rando = irandom(150); + _rando -= population_influences[eFACTION.Tyranids]; + if (_rando <= 15) { + spread = 1; + } + + if ((planet_type == "Lava") && (_nids >= 2)) { + spread = 0; + } + if (((planet_type == "Ice") || (planet_type == "Desert")) && (_nids >= 3)) { + spread = 0; + } + + if (spread == 1) { + add_forces(eFACTION.Tyranids, 1); + } + } + if (population_influences[eFACTION.Tyranids] > 55) { + set_new_owner(eFACTION.Tyranids); + } + } else if (population_influences[eFACTION.Tyranids] > 5) { + alter_influence(eFACTION.Tyranids, -1); + if ((irandom(200) + (population_influences[eFACTION.Tyranids] / 10)) > 195) { + add_feature(P_features.Gene_Stealer_Cult); + } + } + } + + static end_turn_heretics_and_corruption_growth = function(){ + // traitors cults + var notixt; + var is_ork; + notixt = false; + + var _rando = roll_dice(1,100); + + if ((current_owner == eFACTION.Chaos) && (corruption < 80)) { + alter_corruption(1); + } + + if ((current_owner != eFACTION.Chaos) && (current_owner != eFACTION.Heretics) && (current_owner != eFACTION.Eldar) && (planet_type != "Dead") && (planet_type != "Craftworld")) { + success = false; + is_ork = current_owner == eFACTION.Ork; + + if (!is_ork) { + //made a linear function for this while here...now the minimum for the roll is a bit higher, but + var score_to_beat = (3 / 4) * (corruption + secret_corruption) - 27.5; + + //if (corruption+secret_corruption>=25) and (_rando<=3) then success=true; + //if (corruption+secret_corruption>=50) and (_rando<=10) then success=true; + //if (corruption+secret_corruption>=70) and (_rando<=25) then success=true; + //if (corruption+secret_corruption>=90) and (_rando<=40) then success=true; + if (_rando < score_to_beat) { + success = true; + } + } + + if (success && (pdf == 0) && (guardsmen == 0) && (planet_forces[eFACTION.Tau] == 0) && (planet_forces[eFACTION.Ork] == 0)) { + current_owner = 10; + scr_alert("red", "owner", $"{name()} has fallen to heretics!", x, y); + + if (system.visited == 1) { + //visited variable check whether the star has been visited or not 1 for true 0 for false + if (planet_type == "Forge") { + add_disposition(-10); + // 10 disposition decreases for the respective planet + obj_controller.disposition[3] -= 3; // 10 disposition decrease for the toaster Fetishest since they aren't that numerous + } else if (has_feature(P_features.Sororitas_Cathedral) || (planet_type == "Shrine")) { + add_disposition(-4); // similarly 10 disposition decrease, note those nurses are a bit pissy and + // and you can't easily gain their favor because you cannot ask them to "step down" from office. + obj_controller.disposition[5] -= 5; + } else { + // the missus diplomacy 0 is when they cringe when you enter the office and cannot ask them for a date. + } + } + } + + if (success && (planet_type != "Space Hulk")) { + _rando = roll_dice(1,100); + // // // obj_controller.x=self.x;obj_controller.y=self.y; + if (is_garrison_force) { + _rando -= total_garrison; + } + + var tixt = ""; + + // controls losing pdf due to heretic cults + var traitor_mod = 0; + + if (_rando <= 40) { + notixt = true; + var garrison_mod = choose(0.05, 0.1, 0.15, 0.2); + + if (is_garrison_force) { + garrison_mod -= 0.01 * total_garrison; + } + + if (garrison_mod > 0) { + var lost = floor(pdf * garrison_mod); + + if (pdf <= 500) { + lost = pdf ; + edit_forces(eFACTION.Heretics, 1); + } + + edit_pdf(-lost); + + if (planet_forces[eFACTION.Heretics] == 0) { + if (pdf > 0) { + tixt = $"{scr_display_number(lost)} PDF killed in a rebellion on {name()}."; + } else if (pdf == 0) { + tixt = $"Heretic cults have appeared in {name()}."; + } + + scr_alert("purple", "owner", tixt, x, y); + scr_event_log("purple", tixt, system.name); + } + } else { + tixt = $"Marine garrisons prevents rebellion on {name()}"; + scr_alert("green", "owner", tixt, x, y); + scr_event_log("green", tixt, system.name); + corruption -= irandom(5); + } + // Cult crushed; don't bother showing if there's already fighting going on over there + } else if ((_rando >= 41) && (_rando < 81) && (planet_forces[eFACTION.Heretics] < 2)) { + if (is_garrison_force) { + traitor_mod = choose(1, 2); + } else { + traitor_mod = 2; + } + + planet_forces[eFACTION.Heretics] = traitor_mod; + tixt = $"Heretic cults have appeared in {name()}."; + } else if ((_rando >= 81) && (_rando < 91) && (planet_forces[eFACTION.Heretics] < 3)) { + // Minor uprising + if (is_garrison_force) { + traitor_mod = choose(2, 3); + } else { + traitor_mod = 3; + } + edit_forces(eFACTION.Heretics,traitor_mod); + tixt = $"Heretic cults have spread around {name()}."; + } // Major uprising + + // major and huge uprisings are impossible as long as a garrisons of at least 10 marines is present + if ((_rando >= 91) && (_rando < 100) && (planet_forces[eFACTION.Heretics] < 4)) { + notixt = true; + edit_forces(eFACTION.Heretics,4); + + if ((obj_controller.faction_defeated[10] == 0) && (obj_controller.faction_gender[10] == 1)) { + edit_forces(eFACTION.Heretics,5); + } + + var n_name = name(); + scr_popup("Heretic Revolt", $"A massive heretic uprising on {n_name} threatens to plunge the star system into chaos.", "chaos_cultist", ""); + scr_alert("red", "owner", $"Massive heretic uprising on {n_name}.", x, y); + scr_event_log("purple", $"Massive heretic uprising on {n_name}.", system.name); + } // Huge uprising + + if ((_rando >= 100) && (planet_forces[eFACTION.Heretics] < 5)) { + edit_forces(eFACTION.Heretics,6); + set_new_owner(eFACTION.Heretics) + add_feature(P_features.Daemonic_Incursion); + + set_corruption(corruption < 80 ? 80 : 95) + + tixt = $"Daemonic incursion on {name()}!"; + } // Oh god what + + if ((_rando >= 41) && (!notixt) && tixt != "") { + scr_alert("red", "owner", tixt, x, y); + scr_event_log("purple", tixt, system.name); + } + // if (planet_forces[eFACTION.Heretics]>2){obj_controller.x=self.x;obj_controller.y=self.y;} + } // End traitors cult + } + + } + + static check_old_battles_feature = function(){ + if (has_feature(P_features.OldBattleGround)){ + var _feats = get_features(P_features.OldBattleGround); + + for (var i=0;i 5) && (action_score <= 10)) { siz_penalty = 5; } + // if ((action_score > 10) && (action_score <= 20)) { siz_penalty = 20; } + // if ((action_score > 20) && (action_score <= 50)) { siz_penalty = 30; } + // if ((action_score > 50) && (action_score <= 100)) { siz_penalty = 50; } + // if ((action_score > 100) && (action_score <= 200)) { siz_penalty = 75; } + // if (action_score > 200) { siz_penalty = 125; } + + var spec1=0,spec2=0,txt=""; // TODO consider making it a battle with Planetary governor's guards + txt="Your Astartes descend upon the surface of {name()} and plot the movements and schedule of the governor. "; + txt+="Once the time is right their target is ambushed " + txt+="choose("in their home","in the streets","while driving","taking a piss")+" and tranquilized. "; + + if(scr_has_disadv("Never Forgive")) then spec1=1; + if (global.chapter_name="Space Wolves" || obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) { + spec1=3; + } + else if (global.chapter_name="Iron Hands" || obj_ini.progenitor == ePROGENITOR.IRON_HANDS) { + spec1=6; + } + if (obj_ini.omophagea=1){ + spec1=choose(spec1,20); + } + + if (spec1=1) then txt+="They are brought to the already-prepared facilities for Fallen, tortured to make "+string(choose("him","him","her"))+" appear a heretic, and then incinerated. "; + if (spec1=3) then txt+=string(choose("He","He","She"))+" is tossed to the Fenrisian Wolves and viciously mauled, torn apart, and eaten. The beasts leave nothing but bloody scraps. "; + if (spec1=6) then txt+=string(choose("He","He","She"))+" is stuck in with the other criminals, and scum, to be turned into a servitor. Soon nothing remains that could be likened to the former Governor. "; + if (spec1=20){ + if (action_score>1) then txt+="Things get out of hand, and the Governor is torn limb from limb and consumed. "+string(choose("His","His","Her"))+" flesh is torn off and eaten, bone pulverized, and marrow sucked free. "; + if (action_score=1) then txt+="Your battle brother chops apart the Governor and eats a sizeable portion of "+string(choose("his","his","her"))+" flesh, focusing upon the eyes, teeth, and fingers. Once full the rest is disposed of. "; + } + + if (spec1=0){ + spec2=choose(1,2,3,4,5,5,5); + if (spec2=1) then txt+="Their still-living body is disintegrated by acid. "; + if (spec2=2) then txt+="The Governor is jettisoned into the local star at the first opportunity. "; + if (spec2=3) then txt+=string(choose("He","He","She"))+" is burned as fuel for one of your vessels. "; + if (spec2=4) then txt+="A few grenades is all it takes to blow "+string(choose("his","his","her"))+" body to smithereens. "; + if (spec2=5) then txt+=string(choose("He","He","She"))+" is executed in a mundane fashion and buried. "; + } + + txt+="What is thy will?"; + + var pip=instance_create(0,0,obj_popup); + pip.title="Planetary Governor Assassinated"; + pip.text=txt; + pip.planet=planet; + pip.p_data = new PlanetData(planet,star); + var options = [ + { + str1 : "Allow the official successor to become Planetary Governor.", + choice_func : allow_governor_successor, + }, + { + str1 : "Ensure that a sympathetic successor will be the one to rule.", + choice_func : install_sympathetic_successor, + }, + { + str1 : "Remove all successors and install a loyal Chapter Serf.", + choice_func : install_chapter_surf, + }, + ] + pip.add_option(options); + pip.cooldown=20; + + // Result- this is the multiplier for the chance of discovery with the inquisition, can also be used to determine + // the new Governor disposition if they are the official successor + if (aroll < chance){// Discovered + pip.estimate=2; + } else if (aroll >= chance){// Success + pip.estimate=1; + } + // If there are enemy non-chaos forces then they may be used as a cover + // Does not work with chaos because if the governor dies, with chaos present, the new governor would possibly be investigated + if (planet_forces[eFACTION.Ork]>=4) or (planet_forces[eFACTION.Necrons]>=3) or (planet_forces[eFACTION.Tyranids]>=5){ + pip.estimate=pip.estimate*0.5; + } + } + + } + diff --git a/scripts/scr_Table/scr_Table.gml b/scripts/scr_Table/scr_Table.gml index 9bf8884c25..d8a755ffb0 100644 --- a/scripts/scr_Table/scr_Table.gml +++ b/scripts/scr_Table/scr_Table.gml @@ -18,9 +18,7 @@ function Table(data) constructor{ move_data_to_current_scope(data); - update(); - - static update = function(data){ + static update = function(data={}){ move_data_to_current_scope(data); w = 0; column_widths = []; @@ -60,7 +58,7 @@ function Table(data) constructor{ w += column_widths[i] + col_spacing; } } - + update(); static draw = function(){ add_draw_return_values(); @@ -99,9 +97,20 @@ function Table(data) constructor{ //show_debug_message($"click : {struct_exists(_row,"click_left")}"); _row.hover(); } - if (_row_entered && struct_exists(_row,"click_left")){ - if (scr_click_left()){ - _row.click_left(); + if (_row_entered){ + if (struct_exists(_row,"hover")){ + //show_debug_message($"click : {struct_exists(_row,"click_left")}"); + _row.hover(); + } + if (struct_exists(_row,"click_left")){ + if (scr_click_left()){ + _row.click_left(); + } + } + if (struct_exists(_row,"click_right")){ + if (scr_click_right()){ + _row.click_right(); + } } } } diff --git a/scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.gml b/scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.gml new file mode 100644 index 0000000000..9276fc9794 --- /dev/null +++ b/scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.gml @@ -0,0 +1,402 @@ +//TODO write this out with proper formatting when i can be assed +//Used to quikcly collect groups of marines with given parameters +// group takes a string relating to options in the role_groups function, to ignore filtering by group use "all" + // can also pass an array to filter for mutiple groups +// location takes wther a string with a system name or an array with 3 parameters [,,] +// if opposite is true then then the roles defined in the group argument are ignored and all others collected +// search conditions + // companies, takes either an int or an arrat to define which companies to search in + // any stat allowed by the stat_valuator basically allows you to look for marines whith certain stat lines + // job allows you to find marines forfuling certain tasks like garrison or forge etc + +function collect_role_group(group=SPECIALISTS_STANDARD, location="", opposite=false, search_conditions = {companies:"all"}){ + var _units = [], unit, count=0, _add=false, _is_special_group; + var _max_count = 0; + var _total_count = 0; + if (struct_exists(search_conditions, "max")){ + _max_count = search_conditions.max; + search_conditions.max_wanted = search_conditions.max; + } + search_conditions.group = group; + search_conditions.location = location; + search_conditions.opposite = opposite; + + var _conditions = new SearchConditions(search_conditions); + for (var com=0;com<=10;com++){ + if (_max_count>0){ + if (array_length(_units)>=_max_count){ + break; + } + } + var _wanted_companies = search_conditions.companies; + if (_wanted_companies!="all"){ + if (is_array(_wanted_companies)){ + if (!array_contains(_wanted_companies, com)){ + continue; + } + } else { + if (_wanted_companies != com){ + continue; + } + } + } + for (var i=0;i 0){ + found = 0; + } + + end_loop = false; + } + + update_constants(data); + + static oposite_switch = function(val){ + return opposite ? !val : val; + } + + static company_evaluate = function(){ + var _add = true; + if (search_companies){ + if (search_multiple_companies){ + if (!array_contains(_wanted_companies, unit.company)){ + _add = false; + } + } else { + if (_wanted_companies != unit.company){ + _add = false; + } + } + _add = oposite_switch(_add); + } + + return _add; + } + + static group_evaluate = function(){ + + var _add = true; + if (group!="all"){ + var _group = group; + if (group_is_array){ + if (group_search_heads) { + _add = unit.IsSpecialist(_group[0], _group[1], _group[2]); + } else { + _add = unit.IsSpecialist(_group[0], _group[1]); + } + } else { + _add = unit.IsSpecialist(_group); + } + _add = oposite_switch(_add); + } + return _add; + } + + static location_evaluate = function(){ + var _add = true; + if (location!=""){ + if (!complex_location){ + _add=unit.is_at_location(location); + } else { + _add=unit.is_at_location(location[0], location[1], location[2]); + } + _add = oposite_switch(_add); + } + + return _add; + } + + static checks_order = [ + company_evaluate, + group_evaluate, + location_evaluate + ]; + + + static evaluate = function(unit){ + self.unit = unit; + if (unit.name()==""){ + return false; + } + + var _add = true; + for (var i=0;i 0 && _add){ + found++; + if (found > max_wanted){ + _add = false; + end_loop = true; + } + } + + + return _add; + } + +} + + +function UnitGroup(units) constructor{ + self.units = units; + + static number = function(){ + return array_length(units); + } + + static has_role = function(role){ + for (var i=0;i _stat_val[1]){ + match = false; + break; + } + break; + + case "exless": + if (unit[$ _stat_val[0]] >= _stat_val[1]){ + match = false; + break; + } + break; + } + } + return match; +} + +function collect_by_religeon(religion, sub_cult="", location=""){ + var _units = [], unit, count=0, _add=false; + for (var com=0;com<=10;com++){ + for (var i=1;i 0) { + for (var veh = 0; veh < array_length(vehicles); veh++) { + unit = vehicles[veh]; + add_vehicle_to_manage_arrays(unit); + } + } + other_manage_data(); + man_current = 0; + man_max = MANAGE_MAN_MAX; + + if (selection_data.select_type == MissionSelectType.Squads){ + new_company_struct(); + company_data.has_squads = true; + company_data.squad_location = selection_data.system.name; + company_data.squad_search(); + managing = -1; + } + } + } catch (_exception) { + //handle and send player back to map + handle_exception(_exception); + scr_toggle_manage(); + } +} \ No newline at end of file diff --git a/scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.yy b/scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.yy new file mode 100644 index 0000000000..2d2594c762 --- /dev/null +++ b/scripts/scr_UnitGroup_and_group_selection/scr_UnitGroup_and_group_selection.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_UnitGroup_and_group_selection", + "isCompatibility":false, + "isDnD":false, + "name":"scr_UnitGroup_and_group_selection", + "parent":{ + "name":"marines_and_profiles", + "path":"folders/Scripts/marines_and_profiles.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml index 50df4e8392..aac5ea0e3b 100644 --- a/scripts/scr_apothecary_ground/scr_apothecary_ground.gml +++ b/scripts/scr_apothecary_ground/scr_apothecary_ground.gml @@ -194,18 +194,23 @@ function apothecary_simple(){ cur_units = _unit_spread[$_cur_loc][p]; cur_apoths = _apoth_spread[$_cur_loc][p]; cur_techs = _tech_spread[$_cur_loc][p]; + + var _cur_tech_count = array_length(cur_techs); + var _cur_unit_count = array_length(cur_units); + var _cur_apoth_count = array_length(cur_apoths); + for (var a=0;a0){ @@ -286,7 +291,14 @@ function apothecary_simple(){ with (cur_system){ if (array_length(p_feature[p])!=0){ var _planet_data = new PlanetData(p, self); - _planet_data.recover_starship(cur_techs); + if (_cur_unit_count){ + _planet_data.search_old_battle_grounds(cur_units); + } + + if (_cur_tech_count){ + _planet_data.recover_starship(cur_techs); + } + if (_planet_data.planet_training(_loc_heal_points)){ } diff --git a/scripts/scr_buttons/scr_buttons.gml b/scripts/scr_buttons/scr_buttons.gml index 357b0afc34..0c8d2f7a6d 100644 --- a/scripts/scr_buttons/scr_buttons.gml +++ b/scripts/scr_buttons/scr_buttons.gml @@ -54,23 +54,22 @@ function pop_draw_return_values() { /// @example /// var rs = new ReactiveString("Hello", 100, 200); /// rs.draw(); -function ReactiveString(text, x1 = 0, y1 = 0, data = false) constructor { +function ReactiveString(text, x1 = 0, y1 = 0, data = false) constructor{ + standard_loc_data(); + self.x1 = x1; self.y1 = y1; - x2 = 0; - y2 = 0; + self.text = text; + halign = fa_left; valign = fa_top; - - self.text = text; text_max_width = -1; font = fnt_40k_14; colour = CM_GREEN_COLOR; tooltip = ""; max_width = -1; - h = 0; - w = 0; scale_text=false; + scale = 1; move_data_to_current_scope(data); @@ -93,7 +92,8 @@ function ReactiveString(text, x1 = 0, y1 = 0, data = false) constructor { h = string_height(text) * scale; } } else { - w = string_width(text); + w = string_width(text) * scale; + h = string_height(text) * scale; } pop_draw_return_values(); @@ -139,11 +139,9 @@ function ReactiveString(text, x1 = 0, y1 = 0, data = false) constructor { /// @param {struct|bool} [data=false] Optional struct of properties to apply. /// @returns {LabeledIcon} function LabeledIcon(icon, text, x1 = 0, y1 = 0, data = false) constructor { + standard_loc_data(); self.x1 = x1; self.y1 = y1; - x2 = 0; - y2 = 0; - self.text = text; text_max_width = -1; font = fnt_40k_14; @@ -281,8 +279,7 @@ function standard_loc_data(){ /// @param {struct|bool} [data=false] Initial property overrides. /// @returns {UnitButtonObject} function UnitButtonObject(data = false) constructor { - x1 = 0; - y1 = 0; + standard_loc_data(); w = 102; h = 30; h_gap = 4; @@ -433,10 +430,11 @@ function PurchaseButton(req) : UnitButtonObject() constructor { static draw = function(allow_click = true) { add_draw_return_values(); - var _but = draw_unit_buttons([x1, y1, x2, y2], label, [1, 1], color,,, alpha); + draw_sprite_ext(spr_requisition, 0, x1, y1, scale, scale, 0, c_white, 1); + var _but = draw_unit_buttons([x1 + (get_sprite_width(spr_requisition) * scale), y1, x2, y2], label, [1, 1], color,,, alpha); var _sh = sprite_get_height(spr_requisition); var _scale = (y2 - y1) / _sh; - draw_sprite_ext(spr_requisition, 0, x1, y2, _scale, _scale, 0, c_white, 1); + var _allow_click = obj_controller.requisition >= req_value; if (scr_hit(x1, y1, x2, y2) && tooltip != "") { tooltip_draw(tooltip); @@ -460,8 +458,7 @@ function PurchaseButton(req) : UnitButtonObject() constructor { } function slider_bar() constructor { - x1 = 0; - y1 = 0; + standard_loc_data(); w = 102; h = 15; value_limits = [0, 0]; @@ -657,10 +654,7 @@ function MultiSelect(options_array, title, data = {}) constructor { self.title = title; x_gap = 10; y_gap = 5; - x1 = 0; - y1 = 0; - x2 = 0; - y2 = 0; + standard_loc_data(); on_change = false; active_col = CM_GREEN_COLOR; inactive_col = c_gray; @@ -672,6 +666,7 @@ function MultiSelect(options_array, title, data = {}) constructor { _next_tog.active = false; array_push(toggles, _next_tog); } + static update = item_data_updater; update(data); @@ -771,8 +766,7 @@ function RadioSet(options_array, title = "", data = {}) constructor { allow_changes = true; x_gap = 10; y_gap = 5; - x1 = 0; - y1 = 0; + standard_loc_data(); title_font = fnt_40k_14b; draw_title = true; space_evenly = false; @@ -905,10 +899,7 @@ function RadioSet(options_array, title = "", data = {}) constructor { /// @param {struct} [data={}] Initial properties. /// @returns {ToggleButton} function ToggleButton(data = {}) constructor { - x1 = 0; - y1 = 0; - x2 = 0; - y2 = 0; + standard_loc_data(); tooltip = ""; str1 = ""; width = 0; @@ -1036,10 +1027,7 @@ function ToggleButton(data = {}) constructor { /// @param {struct} [data={}] Initial properties. /// @returns {InteractiveButton} function InteractiveButton(data = {}) constructor { - x1 = 0; - y1 = 0; - x2 = 0; - y2 = 0; + standard_loc_data(); str1 = ""; inactive_tooltip = ""; tooltip = ""; diff --git a/scripts/scr_chapter_managent_events/scr_chapter_managent_events.gml b/scripts/scr_chapter_managent_events/scr_chapter_managent_events.gml index 48ca6fb654..d3a03fdf7e 100644 --- a/scripts/scr_chapter_managent_events/scr_chapter_managent_events.gml +++ b/scripts/scr_chapter_managent_events/scr_chapter_managent_events.gml @@ -285,4 +285,181 @@ function new_forge_master_chosen(pick){ scr_move_unit_info(pick.company, 0, pick.marine_number, i); } } -} \ No newline at end of file +} + + + +function strange_build_event(){ + log_message("RE: Fey Mood"); + var _search_params = {trait : ["crafter","tinkerer"], trait_any : true} + var marine_and_company = scr_random_marine("",0, _search_params); + if (marine_and_company == "none"){ + marine_and_company = scr_random_marine("",0, "none"); + } + if(marine_and_company != "none"){ + var marine = marine_and_company[0]; + var company = marine_and_company[1]; + var text=""; + var _unit = fetch_unit(marine_and_company); + var role = _unit.role(); + text = _unit.name_role(); + text+=" is taken by a strange mood and starts building!"; + + + var crafted_object; + var craft_roll=roll_dice_chapter(1, 100, "low"); + var heritical_item = false; + + //this bit should be improved, idk what duke was checking for here + //TODO make craft chance reflective of crafters skill, rewards players for having skilled tech area + if (scr_has_disadv("Tech-Heresy")) { + craft_roll+=20; + } + if (_unit.has_trait("tech_heretic")){ + craft_roll+=60; + } + if (scr_has_adv("Crafter")) { + if (craft_roll>80) { + craft_roll-=10; + } + if (craft_roll<60) { + craft_roll+=10; + } + } + + if (craft_roll<=50){ + crafted_object=choose("Icon","Icon","Statue"); + } + else if ((craft_roll>50) && (craft_roll<=60)) { + crafted_object=choose("Bike","Rhino"); + } + else if ((craft_roll>60) && (craft_roll<=80)) { + crafted_object="Artifact"; + } + else { + crafted_object=choose("baby","robot","demon","fusion"); + heritical_item=1; + } + + + add_event({ + e_id : "strange_building", + duration : 1, + name : _unit.name(), + company : company, + marine : marine, + crafted : crafted_object, + }) + + scr_popup("Can He Build marine?!?",text,"tech_build",""); + + var marine_is_planetside = _unit.planet_location>0; + if (marine_is_planetside && heritical_item) { + var _system = star_by_name(_unit.location_string); + var _planet = _unit.planet_location; + if (_system!="none"){ + with (_system){ + p_hurssy[_planet]+=6; + p_hurssy_time[_planet]=2; + } + } + } + else if (!marine_is_planetside and heritical_item){ + var _fleet = find_ships_fleet(_unit.ship_location); + if (_fleet!="none"){ + //the intended code for here was to add some sort of chaos event on the ship stashed up ready to fire in a few turns + } + } + return true; + } + return false; +} + +function init_mutated_gene_random_event(){ + //TODO make reprocussions to ignoring this + log_message("RE: Gene-Seed Mutation"); + var text = "The Chapter's gene-seed has mutated! Apothecaries are scrambling to control the damage and prevent further contamination. What is thy will?"; + var _opt1 = "Dispose of "; + var _percent_remove = 0; + if (obj_controller.gene_seed <= 30) { + _opt1 += "100% of the gene-seed."; + _percent_remove = 100; + } + if ((obj_controller.gene_seed > 30) && (obj_controller.gene_seed < 60)) { + _opt1 += "50% of all gene-seed."; + _percent_remove = 50; + } + if (obj_controller.gene_seed >= 60) { + _opt1 += "33% of all gene-seed."; + _percent_remove = 33; + } + + var _opt2 = "Tell the apothecaries to let it be."; + + + var _pop_data = { + percent_remove : _percent_remove, + options : [ + { + str1:_opt1, + choice_func : event_dispose_of_mutated_gene, + }, + { + str1:_opt2, + choice_func : function(){ + scr_loyalty("Mutant Gene-Seed", "+"); + popup_default_close(); + } + }, + ] + } + + scr_popup("Gene-Seed Mutated!",text,"gene_bad",_pop_data); + scr_event_log("red","The Chapter Gene-Seed has mutated."); + + return true; +} + + +function event_dispose_of_mutated_gene(){ + if (pop_data.percent_remove > 0){ + obj_controller.gene_seed -= (obj_controller.gene_seed * (pop_data.percent_remove/100)) + } + popup_default_close(); +} + + +function init_marine_distinguishment_event(){ + log_message("RE: Promotion"); + var marine_and_company = scr_random_marine([obj_ini.role[100][8],obj_ini.role[100][12],obj_ini.role[100][9],obj_ini.role[100][10]],0); + if(marine_and_company == "none") + { + log_error("RE: Promotion, couldn't pick a space marine"); + return false; + } + var marine=marine_and_company[1]; + var company=marine_and_company[0]; + var _unit = fetch_unit(marine_and_company); + var role=_unit.role(); + var text = _unit.name_role(); + var company_text = scr_convert_company_to_string(company); + //var company_text = scr_company_string(company); + if(company_text != ""){ + company_text = $"({company_text})"; + } + text += company_text; + text += " has distinguished himself.\n\nHe is up for review to be promoted."; + + if (company != 10){ + _unit.add_exp(10); + } + else { + _unit.add_exp(max(20, _unit.experience)); + } + + scr_popup("Promotions!",text,"distinguished",""); + scr_event_log("green",text); + return true; +} + + diff --git a/scripts/scr_cheatcode/scr_cheatcode.gml b/scripts/scr_cheatcode/scr_cheatcode.gml index ac2319de16..9ca7c0f482 100644 --- a/scripts/scr_cheatcode/scr_cheatcode.gml +++ b/scripts/scr_cheatcode/scr_cheatcode.gml @@ -384,7 +384,6 @@ function scr_cheatcode(argument0) { case "forgemastermeet": var _forge_master = scr_role_count("Forge Master", "", "units"); if (array_length(_forge_master)>0){ - show_debug_message("meet forge master"); obj_controller.menu_lock = false; instance_destroy(obj_popup_dialogue); scr_toggle_diplomacy(); @@ -392,7 +391,6 @@ function scr_cheatcode(argument0) { obj_controller.character_diplomacy = _forge_master[0]; diplo_txt="Greetings chapter master"; } else { - show_debug_message("no forge master"); } break; } @@ -471,6 +469,10 @@ function draw_planet_debug_features(){ e_num : P_features.Starship, name : "Ancient Starship" }, + { + e_num : P_features.OldBattleGround, + name : "Old Battle Ground" + }, ] @@ -484,7 +486,9 @@ function draw_planet_debug_features(){ draw_text(38, _y, _feat.name); if (point_and_click([38, _y, 337,_y+20])){ var _new_feat = new NewPlanetFeature(_feat.e_num); - array_push(target.p_feature[obj_controller.selecting_planet], _new_feat); + _new_feat.imperium_known = true; + _new_feat.player_hidden = false; + target.add_feature(obj_controller.selecting_planet,_new_feat) } } } @@ -515,7 +519,32 @@ function draw_planet_debug_problems(){ case "mech_bionics": spawn_mechanicus_mission("mech_bionics"); break; - + case "hunt_beast": + with (target){ + scr_new_governor_mission(obj_controller.selecting_planet,"hunt_beast"); + } + break; + case "deliver_trophy": + var _unit = fetch_unit(scr_random_marine("",0)); + var _navy_fleets = get_imperial_navy_fleets(); + var _plan_type = target.p_type[obj_controller.selecting_planet]; + var _pop_data = { + trophy_owner : _unit, + system: target.name, + planet : obj_controller.selecting_planet, + target_fleet : array_random_element(_navy_fleets), + beast : get_beast_name_by_planet_type(_plan_type) , + planet_type :_plan_type , + } + + var _pop = instance_create(0,0,obj_popup); + + _pop.pop_data = _pop_data; + + with (_pop){ + init_deliver_trophy_mission(); + } + break; default: scr_popup("error","no specific debug action created please consider helping to make one",""); break; diff --git a/scripts/scr_draw_planet_features/scr_draw_planet_features.gml b/scripts/scr_draw_planet_features/scr_draw_planet_features.gml index 32ea1b2f2d..5712419cbf 100644 --- a/scripts/scr_draw_planet_features/scr_draw_planet_features.gml +++ b/scripts/scr_draw_planet_features/scr_draw_planet_features.gml @@ -7,11 +7,11 @@ function FeatureSelected(Feature, system, planet) constructor{ feature = Feature; main_slate = new DataSlateMKTwo(); exit_sequence = false; - entrance_sequence=true; - remove=false; - destroy=false; + entrance_sequence = true; + remove = false; + destroy = false; exit_count = 0; - enter_count=18; + enter_count = 18; planet_data = new PlanetData(planet,system); if (feature.f_type == P_features.Forge){ @@ -28,17 +28,50 @@ function FeatureSelected(Feature, system, planet) constructor{ } } } + forge_assign_button = new UnitButtonObject({ + label:"Assign To Forge", + color:CM_RED_COLOR, + bind_method :function(){ + obj_controller.unit_profile = false; + obj_controller.view_squad = false; + group_selection(techs,{ + purpose:"Forge Assignment", + purpose_code : "forge_assignment", + number:worker_capacity, + system:planet_data.system, + feature:feature, + planet : planet_data.planet, + selections : [] + }); + destroy=true; + }, + bind_scope :self, + }); + + forge_upgrade_button = new UnitButtonObject({ + color:CM_RED_COLOR, + bind_scope :self, + bind_method :function(){ + obj_controller.requisition -= upgrade_cost; + feature.size++; + worker_capacity*=2; + } + }) } + exit_button = new UnitButtonObject({label:"<---",color:CM_RED_COLOR}); + draw_planet_features = function(xx,yy){ + add_draw_return_values(); draw_set_halign(fa_center); + draw_set_valign(fa_top); draw_set_font(fnt_40k_14); - //draw_sprite(spr_planet_screen,0,xx,yy); + //draw_sprite(spr_planset_screen,0,xx,yy); if (exit_sequence){ xx-=(25*exit_count); main_slate.draw(xx,yy, 1.38,1.38); exit_count++; - if (xx-25<=obj_star_select.main_data_slate.XX) then remove=true; + remove = (xx-25<=obj_star_select.main_data_slate.XX); } else if (entrance_sequence){ enter_count--; xx-=(25*enter_count); @@ -47,56 +80,47 @@ function FeatureSelected(Feature, system, planet) constructor{ }else { main_slate.draw(xx,yy, 1.4,1.4); } - var area_width = main_slate.width; - var area_height = main_slate.height; - var generic = false; - var title="", body=""; - var _button_tooltip = ""; + w = main_slate.width; + h = main_slate.height; + generic = false; + title=""; + body=""; + button_tooltip = ""; //draw_glow_dot(xx+150, yy+150); //rack_and_pinion(xx+230, yy+170); var rectangle = []; draw_set_color(c_green); - if (point_and_click(draw_unit_buttons([xx+12, yy+20], "<---",[1,1],c_red))){ + exit_button.update({x1:xx+12,y1:yy+20}); + if (exit_button.draw()){ exit_sequence=true; }; draw_set_halign(fa_center); switch (feature.f_type){ case P_features.Forge: - draw_text_transformed(xx+(area_width/2), yy +10, "Chapter Forge", 2, 2, 0); + draw_text_transformed(xx+(w/2), yy +10, "Chapter Forge", 2, 2, 0); draw_set_halign(fa_left); draw_set_color(c_gray); draw_text(xx+10, yy+50, $"Working Techs : {feature.techs_working}/{worker_capacity}"); - if (point_and_click(draw_unit_buttons([xx+10, yy+70], "Assign To Forge",[1,1],c_red))){ - obj_controller.unit_profile = false; - obj_controller.view_squad = false; - group_selection(techs,{ - purpose:"Forge Assignment", - purpose_code : "forge_assignment", - number:worker_capacity, - system:planet_data.system, - feature:feature, - planet : planet_data.planet, - selections : [] - }); - destroy=true; - - } + forge_assign_button.update({x1:xx+10,y1 : yy+70}); + forge_assign_button.draw(); //TODO move over to using the draw button object ot streamline this - var next_position = [xx+10, yy+95]; + var _next_position = {x1:xx+10, y1: yy+95}; if (feature.size<3){ var upgrade_cost = 2000 * feature.size; - var last_button = draw_unit_buttons(next_position, $"Upgrade Forge ({upgrade_cost} req)",[1,1],c_red); - next_position = [last_button[0], last_button[3]]; - if (point_and_click(last_button) && obj_controller.requisition>=upgrade_cost){ - obj_controller.requisition -= upgrade_cost; - feature.size++; - worker_capacity*=2; + forge_upgrade_button.update(_next_position); + forge_upgrade_button.update({ + label:$"Upgrade Forge ({upgrade_cost} req)", + }); + forge_upgrade_button.draw(); + _next_position={ + x1:forge_upgrade_button.x1, + y1:forge_upgrade_button.y2, } } if (feature.size>1 && !feature.vehicle_hanger){ var upgrade_cost = 3000; - var build_coords = draw_unit_buttons(next_position, $"Build Vehicle Hanger({upgrade_cost} req)",[1,1],c_red); + var build_coords = draw_unit_buttons(_next_position, $"Build Vehicle Hanger({upgrade_cost} req)",[1,1],c_red); if (scr_hit(build_coords)){ tooltip_draw("Required to Build Vehicles in the Forge") } @@ -106,7 +130,7 @@ function FeatureSelected(Feature, system, planet) constructor{ array_push(obj_controller.player_forge_data.vehicle_hanger,[obj_controller.selected.name,planet_data.planet]); } } else if(feature.vehicle_hanger){ - draw_text(next_position[0], next_position[1], "Forge has a vehicle hanger") + draw_text(_next_position[0], _next_position[1], "Forge has a vehicle hanger Allowing vehicles to be coonstructed behavior"); //TODO somthing if the forge has a hanger } break; @@ -134,6 +158,11 @@ function FeatureSelected(Feature, system, planet) constructor{ title = "Ancinet Ruins"; body = "Unload Marines onto the planet to explore the ruins"; break; + case P_features.OldBattleGround: + generic=true; + title = "Old Battlefield"; + body = $"The site of a previously unrecorded battle between {feature.faction1} and {feature.faction2} forces long forgotten\nUnload Marines to search Techmarines are advisable to help, it would be best any tech priests not be aware of such an operation it may create a conflict of interest"; + break; case P_features.STC_Fragment: generic=true; title = "STC Fragment"; @@ -156,7 +185,7 @@ function FeatureSelected(Feature, system, planet) constructor{ body = $"The Cult of {feature.name} {control_string}"; break; case P_features.Victory_Shrine: - draw_text_transformed(xx+(area_width/2), yy +10, "Victory Shrine", 2, 2, 0); + draw_text_transformed(xx+(w/2), yy +10, "Victory Shrine", 2, 2, 0); draw_set_halign(fa_left); draw_set_color(c_gray); /*if (!feature.parade){ @@ -168,7 +197,7 @@ function FeatureSelected(Feature, system, planet) constructor{ }*/ break; case P_features.Monastery: - draw_text_transformed(xx+(area_width/2), yy +10, feature.name, 2, 2, 0); + draw_text_transformed(xx+(w/2), yy +10, feature.name, 2, 2, 0); if (feature.forge==0){ draw_text_transformed(xx+80, yy +50, "Forge", 1, 1, 0); if (draw_building_builder(xx+40, yy+70,500,spr_forge_holo)){ @@ -265,7 +294,7 @@ function FeatureSelected(Feature, system, planet) constructor{ mission_description=$"The governor of {planet_name} has sent many requests to the sector commander for help with defending against xenos raids on the populace of the planet, the reports seem to suggest the xenos in question are in fact dark eldar."; help = "Set a squad to ambush"; button_text = "Send Squad"; - _button_tooltip = "milage may vary on playability of this mission progress at your own risk"; + button_tooltip = "milage may vary on playability of this mission progress at your own risk"; button_function = function(){ var dudes = collect_role_group("all", obj_star_select.target.name); group_selection(dudes,{ @@ -305,20 +334,20 @@ function FeatureSelected(Feature, system, planet) constructor{ mission_description=$"The governor of {planet_name} has expressed his distaste of the neighboring governance of {target.name} {feature.target} he has expressed his views that they engage in heretical ways and harbor xenos enemies though in truth it is more likely that he simply wishes his political enemies disposed of, whatever the case his planet has great economic means and he has made bare his plans to compensate the emperors angels for their aid"; break; } - draw_text_transformed(xx+(area_width/2), yy +5, mission_name_key(feature.problem), 2, 2, 0); + draw_text_transformed(xx+(w/2), yy +5, mission_name_key(feature.problem), 2, 2, 0); draw_set_halign(fa_left); draw_set_color(c_gray); - draw_text_ext(xx+10, yy+40,mission_description,-1,area_width-20); - var text_body_height = string_height_ext(string_hash_to_newline(mission_description),-1,area_width-20); + draw_text_ext(xx+10, yy+40,mission_description,-1,w-20); + var text_body_height = string_height_ext(string_hash_to_newline(mission_description),-1,w-20); if (help!="none"){ - draw_text_ext(xx+10, yy+40+text_body_height+10,help,-1,area_width-20); - text_body_height+=string_height_ext(string_hash_to_newline(mission_description),-1,area_width-20)+10; + draw_text_ext(xx+10, yy+40+text_body_height+10,help,-1,w-20); + text_body_height += string_height_ext(string_hash_to_newline(mission_description),-1,w-20)+10; } if (button_text!="none"){ - var _button = draw_unit_buttons([xx+((area_width/2)-(string_width(button_text)/2)), yy+40+text_body_height+10], button_text); - if (_button_tooltip != "" && scr_hit(_button)){ - tooltip_draw(_button_tooltip); + var _button = draw_unit_buttons([xx+((w/2)-(string_width(button_text)/2)), yy+40+text_body_height+10], button_text); + if (button_tooltip != "" && scr_hit(_button)){ + tooltip_draw(button_tooltip); } if (point_and_click(_button)){ if (is_callable(button_function)){ @@ -332,12 +361,13 @@ function FeatureSelected(Feature, system, planet) constructor{ break; } if (generic){ - draw_text_ext_transformed(xx+(area_width/2), yy +5, title, -1, area_width-20, 2, 2, 0) + draw_text_ext_transformed(xx+(w/2), yy +5, title, -1, w-20, 2, 2, 0) draw_set_halign(fa_left); draw_set_color(c_gray); - draw_text_ext(xx+10, yy+40,body,-1,area_width-20); + draw_text_ext(xx+10, yy+45,body,-1,w-20); } + pop_draw_return_values(); return "done"; } } diff --git a/scripts/scr_draw_text/scr_draw_text.gml b/scripts/scr_draw_text/scr_draw_text.gml index a1a3fdae9b..d74566b1ce 100644 --- a/scripts/scr_draw_text/scr_draw_text.gml +++ b/scripts/scr_draw_text/scr_draw_text.gml @@ -62,16 +62,20 @@ function draw_text_glow_transformed(_x, _y, _text, _text_scale = [1,1], _angle = /// @function draw_text_outline /// @description This function will draw text in a similar way to draw_text(), only now the text will have an outline that may improve readability. -function draw_text_outline(_x, _y, _text, _outl_col=c_black, _text_col=-1){ +function draw_text_outline(_x, _y, _text, _outl_col=c_black, _text_col=-1,scale =1){ var _cur_color = draw_get_color(); draw_set_color(_outl_col); - draw_text(_x-1.5, _y, _text); - draw_text(_x+1.5, _y, _text); - draw_text(_x, _y-1.5, _text); - draw_text(_x, _y+1.5, _text); - if (_text_col != -1) draw_set_color(_text_col); - else draw_set_color(_cur_color); - draw_text(_x, _y, _text); + draw_text_transformed(_x-1.5, _y, _text, scale, scale, 0); + draw_text_transformed(_x+1.5, _y, _text, scale, scale, 0); + draw_text_transformed(_x, _y-1.5, _text, scale, scale, 0); + draw_text_transformed(_x, _y+1.5, _text, scale, scale, 0); + if (_text_col != -1){ + draw_set_color(_text_col); + } + else{ + draw_set_color(_cur_color); + } + draw_text_transformed(_x, _y, _text,scale, scale, 0); draw_set_color(_cur_color); } diff --git a/scripts/scr_drop_select_function/scr_drop_select_function.gml b/scripts/scr_drop_select_function/scr_drop_select_function.gml index 574867809f..268a2ad58a 100644 --- a/scripts/scr_drop_select_function/scr_drop_select_function.gml +++ b/scripts/scr_drop_select_function/scr_drop_select_function.gml @@ -392,7 +392,11 @@ function drop_select_draw() { _purge_score = array_length(roster.selected_units); } - scr_purge_world(p_target, planet_number, purge, _purge_score); + var _p_data = p_target.system_data[planet_number]; + + _p_data.refresh_data(); + + _p_data.purge(); } } } diff --git a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml index 1a05acc620..1dae443719 100644 --- a/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml +++ b/scripts/scr_enemy_ai_a/scr_enemy_ai_a.gml @@ -1,16 +1,19 @@ function scr_enemy_ai_a() { - system_garrison = []; - system_sabatours = []; + system_garrison = [0]; + system_sabatours = [0]; system_datas = [0]; for (var i=1;i<=planets;i++){ + var garrison = new GarrisonForce(p_operatives[i], true); + var sabatours = new GarrisonForce(p_operatives[i], true, "sabotage"); + array_push(system_garrison, garrison); + array_push(system_sabatours, sabatours); array_push(system_datas,new PlanetData(i, self)); } // guardsmen hop from planet to planet //not sure we really need this as it's handled with tht navy fleet functions but fuck it updated it and leaving it fot the sec if (system_guard_total()>0 && present_fleet[eFACTION.Imperium]){ - show_debug_message($"system_has_guard {p_guardsmen}"); var cur_planet=0,most_enemies_found=0,current_guard_planet=0,most_enemies_planet=0; var _guard_planets = guard_find_planet_with_most_enemy_forces(self); @@ -22,7 +25,6 @@ function scr_enemy_ai_a() { p_guardsmen[_current] = 0; } - show_debug_message($"system_has_guard {p_guardsmen}"); } if (obj_controller.faction_defeated[10]>0) and (obj_controller.faction_gender[10]=2){ @@ -48,15 +50,10 @@ function scr_enemy_ai_a() { var _planet_data; for (var _run =1;_run<=planets;_run++){ _planet_data = system_datas[_run]; - garrison_force=false; - var garrison = new GarrisonForce(p_operatives[_run], true); - var sabatours = new GarrisonForce(p_operatives[_run], true, "sabotage"); - _planet_data.garrison = garrison; - _planet_data.sabatours = sabatours; + garrison = _planet_data.garrisons; + sabatours = _planet_data.sabatours; garrison_force = garrison.garrison_force; - array_push(system_garrison, garrison); - array_push(system_sabatours, sabatours); stop=0; ensure_no_planet_negatives(_run); @@ -288,7 +285,6 @@ function scr_enemy_ai_a() { var _active_garrison = pdf_with_player && garrison.viable_garrison>0; // Guard attack if (guard_score>0) and (guard_attack!="") and (guard_score>0.5){ - show_debug_message($"{name}:{guard_attack}") if (guard_attack="ork") then tempor=choose(1,2,3,4,5,6)*planet_forces[eFACTION.Ork]; if (guard_attack="tau") then tempor=choose(1,2,3,4,5,6)*planet_forces[eFACTION.Tau]; if (guard_attack="traitors") then tempor=choose(1,2,3,4,5,6)*traitors_score; @@ -311,7 +307,6 @@ function scr_enemy_ai_a() { } rand1=(choose(3,4,5,6)*guard_score)*choose(1,1.25,1.25); rand2=(pdf_mod*pdf_score)*choose(1,1.25); - show_debug_message($"{name} guard attack guard_Win:{rand1>rand2}"); if (rand1>rand2){ var _pdf_before = p_pdf[_run]; if (guard_score<=3) then p_pdf[_run]=floor(p_pdf[_run]*(min(0.95, 0.7+pdf_loss_reduction))); @@ -379,7 +374,6 @@ function scr_enemy_ai_a() { if (pdf_attack=="guard"){ rand2=(choose(1,2,3,4,5,6)*guard_score)*choose(1,1.25,2); - show_debug_message($"{name} : pdf attack ,pdf win {rand1>rand2}"); if (rand1>rand2){ if (pdf_score<=3) then p_guardsmen[_run]=floor(p_guardsmen[_run]*0.7); if (pdf_score>=4) then p_guardsmen[_run]=floor(p_guardsmen[_run]*0.6); diff --git a/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml b/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml index 3ee0b01044..7922c04042 100644 --- a/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml +++ b/scripts/scr_enemy_ai_b/scr_enemy_ai_b.gml @@ -11,379 +11,8 @@ function scr_enemy_ai_b() { i = 0; for (i = 1; i <= planets; i++) { - var cur_garrison = system_garrison[i - 1]; - var cur_sabatours = system_sabatours[i - 1]; - - sabotage_force = cur_sabatours.garrison_force; - total_garrison = cur_garrison.total_garrison; - is_garrison_force = cur_garrison.garrison_force; - - var planet_string = $"{string(name)} {scr_roman_numerals()[i - 1]}"; - // Orks grow in number - var ork_growth = floor(random(100)) + 1; - success = false; // This part handles the increasing in numbers - if ((p_owner[i] == 7) && (p_orks[i] < 5) && (p_traitors[i] == 0) && (p_player[i] <= 0 || !is_garrison_force)) { - if ((p_orks[i] > 0) && (p_orks[i] < 5) && (ork_growth <= 15)) { - if (sabotage_force) { - if (irandom(3) < 2) { - scr_event_log("green", $"sabotage force on {planet_string} disrupts ork forces", name); - } else { - p_orks[i] += 1; - } - } else { - p_orks[i] += 1; - } - } - } - if ((p_population[i] < p_max_population[i]) && (p_type[i] != "Dead") && (p_type[i] != "Craftworld") && (p_owner[i] <= 5) && (p_traitors[i] == 0) && (p_tau[i] == 0) && (p_orks[i] == 0) && (p_necrons[i] == 0) && (p_tyranids[i] == 0)) { - if (p_large[i] == 0) { - p_population[i] = round(p_population[i] * 1.0008); - } else if (p_large[i] == 1) { - p_population[i] += choose(0, 0.01); - } - } - - // increasing necrons - if (array_length(p_feature[i]) != 0) { - var has_awake_tomb = false, - nfleet = 0; - if (awake_tomb_world(p_feature[i]) == 1) { - has_awake_tomb = true; - } - if (has_awake_tomb) { - if (p_necrons[i] < 3) { - p_necrons[i] += 2; - } else if (p_necrons[i] < 6) { - p_necrons[i] += 1; - } - } - if (sabotage_force && irandom(2) < 2) { - p_necrons[i]--; - scr_event_log("green", $"sabotage force on {planet_string} disrupts necron forces", name); - } - - if (has_awake_tomb) { - // Necron fleets, woooo - //necrons kill populatin - if ((p_population[i] > 0) && (p_player[i] + p_pdf[i] + p_guardsmen[i] + p_tyranids[i] == 0)) { - p_population[i] = p_population[i] * 0.75; - if ((p_large[i] == 0) && (p_population[i] <= 5000)) { - p_population[i] = 0; - } - } - - var fleet_spawn_chance = roll_dice_chapter(1, 100, "high"); - onceh = 0; - - if (fleet_spawn_chance <= 15) { - if (present_fleet[eFACTION.Necrons] > 0) { - //if necron fleet - necron_fleet = instance_nearest(x, y, obj_en_fleet); - - if (necron_fleet.owner == eFACTION.Necrons) { - if (necron_fleet.escort_number < necron_fleet.capital_number * 1.5) { - necron_fleet.escort_number += 2; - } else if (necron_fleet.frigate_number < necron_fleet.capital_number * 3) { - necron_fleet.frigate_number += 1; - } else { - necron_fleet.capital_number += 1; - } - } - } else if (present_fleet[eFACTION.Necrons] == 0) { - necron_fleet = instance_create(x, y, obj_en_fleet); - necron_fleet.owner = eFACTION.Necrons; - necron_fleet.capital_number = 1; - necron_fleet.sprite_index = spr_fleet_necron; - necron_fleet.image_speed = 0; - necron_fleet.image_index = 1; - present_fleet[eFACTION.Necrons] += 1; - } - var enemy_fleets = 0; - with(necron_fleet) { - if (owner == eFACTION.Necrons) { - var ii = 0; - ii += capital_number; - ii += round((frigate_number / 2)); - ii += round((escort_number / 4)); - if (ii <= 1) { - ii = 1; - } // image_index=max(8,round(ii)); - - if ((ii >= 7) && (capital_number > 1)) { - for (var fleet_n = 1; fleet_n <= 10; fleet_n++) { - if (orbiting.present_fleet[fleet_n] > 0) { - enemy_fleets++; - } - } - } - } - } - if (enemy_fleets > 0) { - var necron_fleet2; - necron_fleet2 = instance_create(x, y, obj_en_fleet); - necron_fleet2.owner = eFACTION.Necrons; - necron_fleet2.sprite_index = spr_fleet_necron; - // necron_fleet2.image_index=0; - necron_fleet.image_speed = 0; - necron_fleet2.capital_number = 1; - necron_fleet2.frigate_number = round(necron_fleet.frigate_number / 2); - necron_fleet2.escort_number = round(necron_fleet.escort_number / 2); - present_fleet[eFACTION.Necrons] += 1; - - necron_fleet.capital_number -= 1; - necron_fleet.frigate_number -= necron_fleet2.frigate_number; - necron_fleet.escort_number -= necron_fleet2.escort_number; - var nearest_planet_coords = [0, 0]; - var found_near_planet = false; - with(obj_star) { - if (present_fleet[eFACTION.Necrons] == 0) { - if (!array_contains(p_type, "Dead")) { - for (var plan = 1; plan <= planets; plan++) { - if (p_owner[plan] <= 5) { - found_near_planet = true; - nearest_planet_coords = [x, y]; - break; - } - } - } - } - } - - if (found_near_planet) { - var tgt1, tgt2; - - necron_fleet2.action_x = nearest_planet_coords[0]; - necron_fleet2.action_y = nearest_planet_coords[1]; - necron_fleet2.alarm[4] = 1; - } - } - } - } - } - // traitors cults - var notixt; - var is_ork; - notixt = false; - - rando = irandom(99) + 1; - - if ((p_owner[i] == eFACTION.Chaos) && (p_heresy[i] < 80)) { - p_heresy[i] += 1; - } - - if ((p_owner[i] != eFACTION.Chaos) && (p_owner[i] != eFACTION.Heretics) && (p_owner[i] != eFACTION.Eldar) && (planets >= i) && (p_type[i] != "Dead") && (p_type[i] != "Craftworld")) { - success = false; - is_ork = p_owner[i] == eFACTION.Ork; - - if (!is_ork) { - //made a linear function for this while here...now the minimum for the roll is a bit higher, but - var score_to_beat = (3 / 4) * (p_heresy[i] + p_heresy_secret[i]) - 27.5; - - //if (p_heresy[i]+p_heresy_secret[i]>=25) and (rando<=3) then success=true; - //if (p_heresy[i]+p_heresy_secret[i]>=50) and (rando<=10) then success=true; - //if (p_heresy[i]+p_heresy_secret[i]>=70) and (rando<=25) then success=true; - //if (p_heresy[i]+p_heresy_secret[i]>=90) and (rando<=40) then success=true; - if (rando < score_to_beat) { - success = true; - } - } - - if (success && (p_pdf[i] == 0) && (p_guardsmen[i] == 0) && (p_tau[i] == 0) && (p_orks[i] == 0)) { - p_owner[i] = 10; - scr_alert("red", "owner", string(name) + " " + string(i) + " has fallen to heretics!", x, y); - - if (visited == 1) { - //visited variable check whether the star has been visited or not 1 for true 0 for false - if (p_type[i] == "Forge") { - dispo[i] -= 10; // 10 disposition decreases for the respective planet - obj_controller.disposition[3] -= 3; // 10 disposition decrease for the toaster Fetishest since they aren't that numerous - } else if (planet_feature_bool(p_feature[i], P_features.Sororitas_Cathedral) || (p_type[i] == "Shrine")) { - dispo[i] -= 4; // similarly 10 disposition decrease, note those nurses are a bit pissy and - // and you can't easily gain their favor because you cannot ask them to "step down" from office. - obj_controller.disposition[5] -= 5; - } else { - // the missus diplomacy 0 is when they cringe when you enter the office and cannot ask them for a date. - } - } - } - - if (success && (p_type[i] != "Space Hulk")) { - rando = floor(random(100)) + 1; - // // // obj_controller.x=self.x;obj_controller.y=self.y; - if (is_garrison_force) { - rando -= total_garrison; - } - - var tixt = ""; - - // controls losing pdf due to heretic cults - var traitor_mod = 0; - - if (rando <= 40) { - notixt = true; - var garrison_mod = choose(0.05, 0.1, 0.15, 0.2); - - if (is_garrison_force) { - garrison_mod -= 0.01 * total_garrison; - } - - if (garrison_mod > 0) { - var lost = floor(p_pdf[i] * garrison_mod); - - if (p_pdf[i] <= 500) { - lost = p_pdf[i]; - p_traitors[i] = 1; - } - - p_pdf[i] -= lost; - - if (p_traitors[i] == 0) { - if (p_pdf[i] > 0) { - tixt = $"{scr_display_number(lost)} PDF killed in a rebellion on {planet_string}."; - } else if (p_pdf[i] == 0) { - tixt = $"Heretic cults have appeared in {planet_string}."; - } - - scr_alert("purple", "owner", tixt, x, y); - scr_event_log("purple", tixt, name); - } - } else { - tixt = $"Marine garrison prevents rebellion on {planet_string}"; - scr_alert("green", "owner", tixt, x, y); - scr_event_log("green", tixt, name); - p_heresy[i] -= irandom(5); - } - // Cult crushed; don't bother showing if there's already fighting going on over there - } else if ((rando >= 41) && (rando < 81) && (p_traitors[i] < 2)) { - if (is_garrison_force) { - traitor_mod = choose(1, 2); - } else { - traitor_mod = 2; - } - - p_traitors[i] = traitor_mod; - tixt = $"Heretic cults have appeared in {planet_string}."; - } else if ((rando >= 81) && (rando < 91) && (p_traitors[i] < 3)) { - // Minor uprising - if (is_garrison_force) { - traitor_mod = choose(2, 3); - } else { - traitor_mod = 3; - } - p_traitors[i] = traitor_mod; - tixt = $"Heretic cults have spread around {planet_string}."; - } // Major uprising - - // major and huge uprisings are impossible as long as a garrison of at least 10 marines is present - if ((rando >= 91) && (rando < 100) && (p_traitors[i] < 4)) { - notixt = true; - p_traitors[i] = 4; - - if ((obj_controller.faction_defeated[10] == 0) && (obj_controller.faction_gender[10] == 1)) { - p_traitors[i] = 5; - } - - var n_name = planet_numeral_name(i); - scr_popup("Heretic Revolt", $"A massive heretic uprising on {n_name} threatens to plunge the star system into chaos.", "chaos_cultist", ""); - scr_alert("red", "owner", $"Massive heretic uprising on {n_name}.", x, y); - scr_event_log("purple", $"Massive heretic uprising on {n_name}.", name); - } // Huge uprising - - if ((rando >= 100) && (p_traitors[i] < 5)) { - p_traitors[i] = 6; - p_owner[i] = 10; - array_push(p_feature[i], new NewPlanetFeature(P_features.Daemonic_Incursion)); - - if (p_heresy[i] >= 80) { - p_heresy[i] = 95; - } else if (p_heresy[i] < 80) { - p_heresy[i] = 80; - } - - tixt = $"Daemonic incursion on {planet_numeral_name(i)}!"; - } // Oh god what - - if ((rando >= 41) && (!notixt) && tixt != "") { - scr_alert("red", "owner", tixt, x, y); - scr_event_log("purple", tixt, name); - } - // if (p_traitors[i]>2){obj_controller.x=self.x;obj_controller.y=self.y;} - } // End traitors cult - } - // Genestealer cults grow in number - if (planet_feature_bool(p_feature[i], P_features.Gene_Stealer_Cult)) { - var cult = return_planet_features(p_feature[i], P_features.Gene_Stealer_Cult)[0]; - cult.cult_age++; - adjust_influence(eFACTION.Tyranids, cult.cult_age / 100, i); - var planet_garrison = system_garrison[i - 1]; - if (cult.hiding) { - var find_nid_chance = 50 - planet_garrison.total_garrison; - if (p_influence[i][eFACTION.Tyranids] > 50) { - var find_cult_chance = irandom(50); - var alert_text = $"A hidden Genestealer Cult in {name} Has suddenly burst forth from hiding!"; - if (planet_garrison.garrison_force) { - var alert_text = $"A hidden Genestealer Cult in {name} Has been discovered by marine garrison!"; - find_cult_chance -= 25; - } - if (find_cult_chance < 1) { - cult.hiding = false; - scr_popup("System Lost", alert_text, "Genestealer Cult", ""); - owner = eFACTION.Tyranids; - scr_event_log("red", $"A hidden Genestealer Cult in {name} {i} has Started a revolt.", name); - p_tyranids[i] += 1; - } - } - } - if ((!cult.hiding) && (p_tyranids[i] <= 3) && (p_type[i] != "Space Hulk") && (p_influence[i][eFACTION.Tyranids] > 10)) { - var spread = 0; - rando = irandom(150); - rando -= p_influence[i][eFACTION.Tyranids]; - if (rando <= 15) { - spread = 1; - } - - if ((p_type[i] == "Lava") && (p_tyranids[i] == 2)) { - spread = 0; - } - if (((p_type[i] == "Ice") || (p_type[i] == "Desert")) && (p_tyranids[i] == 3)) { - spread = 0; - } - - if (spread == 1) { - p_tyranids[i] += 1; - } - } - if (p_influence[i][eFACTION.Tyranids] > 55) { - p_owner[i] = eFACTION.Tyranids; - } - } else if (p_influence[i][eFACTION.Tyranids] > 5) { - adjust_influence(eFACTION.Tyranids, -1, i); - if ((irandom(200) + (p_influence[i][eFACTION.Tyranids] / 10)) > 195) { - array_push(p_feature[i], new NewPlanetFeature(P_features.Gene_Stealer_Cult)); - } - } - - // Spread influence on controlled sector - if ((p_type[i] != "Space Hulk") && (p_type[i] != "Dead")) { - if ((p_heresy[i] < 70) && (owner == 10)) { - p_heresy[i] += 2; - } - if ((p_heresy[i] < 70) && (owner == 8)) { - var doggy = floor(random(100)) + 1; - if ((doggy <= 5) && (p_heresy[i] >= 20)) { - p_heresy[i] += 1; - } - } - } - - if ((p_type[i] == "Daemon") && (p_type[i] != "Space Hulk")) { - if (p_pdf[i] > 0) { - p_pdf[i] = 0; - } - if (p_guardsmen[i] > 0) { - p_guardsmen[i] = 0; - } - } + system_datas[i].refresh_data(); + system_datas[i].end_of_turn_population_influence_and_enemy_growth(); // if (p_heresy[i]>0) and (owner != eFACTION.Chaos) then p_heresy[i]-=2; } // Tau rebellions @@ -464,7 +93,7 @@ function scr_enemy_ai_b() { } if (badd == 1) { - scr_alert("red", "owner", "Planet " + planet_string + " has succeeded to the Tau Empire!", x, y); + scr_alert("red", "owner", "Planet {planet_numeral_name(i)} has succeed ed to the Tau Empire!", x, y); if (visited == 1) { //visited variable checks whether the star has been visited by the chapter or not 1 for true 0 for false if (p_type[i] == "Forge") { diff --git a/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml b/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml index 33b4d73bf4..373a02512e 100644 --- a/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml +++ b/scripts/scr_enemy_ai_c/scr_enemy_ai_c.gml @@ -117,7 +117,7 @@ function scr_enemy_ai_c() { } /*if (fleet!=0){ if (instance_exists(fleet)) then with(fleet){ - var ii;ii=0;ii+=capital_number;ii+=round((frigate_number/2));ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()); if (ii<=1) then ii=1;image_index=ii; } }*/ @@ -319,7 +319,7 @@ function scr_enemy_ai_c() { } /*if (fleet!=0){ if (instance_exists(fleet)) then with(fleet){ - var ii;ii=0;ii+=capital_number;ii+=round((frigate_number/2));ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()); if (ii<=1) then ii=1;image_index=ii; } }*/ @@ -343,7 +343,7 @@ function scr_enemy_ai_c() { if (p_type[i]="Death") or (p_type[i]="Hive") then ship.capital_number+=choose(0,1,1); ship.capital_number+=1; ship.escort_number+=3; - ship.image_index=floor((ship.capital_number)+(ship.frigate_number/2)+(ship.escort_number/4)); + ship.image_index=round(standard_fleet_strength_calc()); p_type[i]="Dead"; delete_features(p_feature[i], P_features.Reclamation_pools);// show_message("D"); if (planets=1) and (p_type[1]="Dead") then image_alpha=0.33; diff --git a/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml b/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml index 974fb2790c..2cf611dfe3 100644 --- a/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml +++ b/scripts/scr_enemy_ai_d/scr_enemy_ai_d.gml @@ -52,6 +52,7 @@ function scr_enemy_ai_d() { } } } + for (var i=1;i<=planets;i++){ problem_count_down(i); if (planet_problemless(i)) then continue; @@ -283,7 +284,7 @@ function scr_enemy_ai_d() { fleet.frigate_number=round(random_range(4,8)); fleet.escort_number=round(random_range(8,18));*/ - fleet.image_index=floor((fleet.capital_number)+(fleet.frigate_number/2)+(fleet.escort_number/4)); + fleet.image_index=round(standard_fleet_strength_calc()); fleet.image_alpha=0; fleet.action_x=x; @@ -445,10 +446,9 @@ function scr_enemy_ai_d() { // Local problems will go here var planet; - for (var i=0;i<=planets;i++){ - planet=i+1; + for (var planet=1;i<=planets;i++){ if (i < array_length(system_garrison)){ - var garrison = system_garrison[i]; + var garrison = system_garrison[planet]; if (garrison.garrison_force){ if (garrison.garrison_disposition_change(self,planet)!="none"){ dispo[planet]+=garrison.dispo_change; diff --git a/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml b/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml index 7764e2e567..dfd8ff2246 100644 --- a/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml +++ b/scripts/scr_enemy_ai_e/scr_enemy_ai_e.gml @@ -603,7 +603,8 @@ function scr_enemy_ai_e() { halfpop = p_max_population[run] / 2; if (array_length(p_feature[run])) { - var planet_data = new PlanetData(run, self); + var _planet_data = new PlanetData(run, self); + _planet_data = system_datas[run]; // Transforming billions pop number to a real number so the code can handle it // Otherwise, 3 and a half billions get translated as 3,50 instead of 3500000000 @@ -644,7 +645,9 @@ function scr_enemy_ai_e() { } } } - } + } + _planet_data.refresh_data(); + _planet_data.check_old_battles_feature(); } // End p_feature!="" diff --git a/scripts/scr_event_code/scr_event_code.gml b/scripts/scr_event_code/scr_event_code.gml index 35bf476edc..e71fd4f1f7 100644 --- a/scripts/scr_event_code/scr_event_code.gml +++ b/scripts/scr_event_code/scr_event_code.gml @@ -92,7 +92,7 @@ function event_end_turn_action(){ // Starts chaos invasion if (_event.e_id=="chaos_invasion"){ var xx=0,yy=0,flee=0,dirr=0; - var star_id = scr_random_find(1,true,"",""); + var star_id = scr_random_find(0,true,"",""); if(star_id != undefined){ scr_event_log("purple",$"Chaos Fleets exit the warp near the {star_id.name} system.", star_id.name); for(var j=0; j<4; j++){ @@ -103,9 +103,9 @@ function event_end_turn_action(){ flee.owner=eFACTION.Chaos; flee.sprite_index=spr_fleet_chaos; flee.image_index=4; - flee.capital_number=choose(0,1); - flee.frigate_number=choose(2,3); - flee.escort_number=choose(4,5,6); + flee.capital_number=choose(0,0,0,1); + flee.frigate_number=choose(2,2,,3); + flee.escort_number=choose(4,4,4,5,6); flee.cargo_data.csm = true; obj_controller.chaos_fleets+=1; flee.action_x=star_id.x; @@ -301,91 +301,6 @@ function handle_discovered_governor_assasinations(){ } } -function strange_build_event(){ - log_message("RE: Fey Mood"); - var _search_params = {trait : ["crafter","tinkerer"], trait_any : true} - var marine_and_company = scr_random_marine("",0, _search_params); - if (marine_and_company == "none"){ - marine_and_company = scr_random_marine("",0, "none"); - } - if(marine_and_company != "none"){ - var marine = marine_and_company[0]; - var company = marine_and_company[1]; - var text=""; - var _unit = fetch_unit(marine_and_company); - var role = _unit.role(); - text = _unit.name_role(); - text+=" is taken by a strange mood and starts building!"; - - - var crafted_object; - var craft_roll=roll_dice_chapter(1, 100, "low"); - var heritical_item = false; - - //this bit should be improved, idk what duke was checking for here - //TODO make craft chance reflective of crafters skill, rewards players for having skilled tech area - if (scr_has_disadv("Tech-Heresy")) { - craft_roll+=20; - } - if (_unit.has_trait("tech_heretic")){ - craft_roll+=60; - } - if (scr_has_adv("Crafter")) { - if (craft_roll>80) { - craft_roll-=10; - } - if (craft_roll<60) { - craft_roll+=10; - } - } - - if (craft_roll<=50){ - crafted_object=choose("Icon","Icon","Statue"); - } - else if ((craft_roll>50) && (craft_roll<=60)) { - crafted_object=choose("Bike","Rhino"); - } - else if ((craft_roll>60) && (craft_roll<=80)) { - crafted_object="Artifact"; - } - else { - crafted_object=choose("baby","robot","demon","fusion"); - heritical_item=1; - } - - - add_event({ - e_id : "strange_building", - duration : 1, - name : _unit.name(), - company : company, - marine : marine, - crafted : crafted_object, - }) - - scr_popup("Can He Build marine?!?",text,"tech_build",""); - - var marine_is_planetside = _unit.planet_location>0; - if (marine_is_planetside && heritical_item) { - var _system = star_by_name(_unit.location_string); - var _planet = _unit.planet_location; - if (_system!="none"){ - with (_system){ - p_hurssy[_planet]+=6; - p_hurssy_time[_planet]=2; - } - } - } - else if (!marine_is_planetside and heritical_item){ - var _fleet = find_ships_fleet(_unit.ship_location); - if (_fleet!="none"){ - //the intended code for here was to add some sort of chaos event on the ship stashed up ready to fire in a few turns - } - } - return true; - } - return false; -} function make_faction_enemy_event(){ log_message("RE: Enemy"); @@ -405,7 +320,7 @@ function make_faction_enemy_event(){ if(array_length(factions) == 0){ log_error("RE: Enemy, no faction could be chosen"); - exit; + return false; } var chosen_faction = array_random_element(factions); @@ -449,12 +364,4 @@ function make_faction_enemy_event(){ return true; } return false; -} - - -function event_dispose_of_mutated_gene(){ - if (pop_data.percent_remove > 0){ - obj_controller.gene_seed -= (obj_controller.gene_seed * (pop_data.percent_remove/100)) - } - popup_default_close(); } \ No newline at end of file diff --git a/scripts/scr_fleet_events/scr_fleet_events.gml b/scripts/scr_fleet_events/scr_fleet_events.gml new file mode 100644 index 0000000000..9e7b1b1b5d --- /dev/null +++ b/scripts/scr_fleet_events/scr_fleet_events.gml @@ -0,0 +1,60 @@ +function add_event_to_fleet(event , fleet){ + event.fleet_uid = fleet.uid; + array_push(fleet.events, event); +} + + + +function FleetEvent(_event_data) constructor{ + + self.fleetevent_data = _event_data; + + static load_json_data = function(data){ + var names = variable_struct_get_names(data); + for (var i = 0; i < array_length(names); i++) { + variable_struct_set(self, names[i], variable_struct_get(data, names[i])) + } + } + + timer = -1; + + state = "increment"; + + static turn_sequence = function(){ + if (struct_exists(self , "turn_end")){ + call_fleet_event_function(turn_end); + } + + if (struct_exists(self , "timer") && timer > 0){ + timer--; + + if (timer == 0 ){ + if (struct_exists(self,"timer_end")){ + call_fleet_event_function(timer_end); + } + state = "destroy"; + } + } + } + + static destroy_sequence = function(){ + if (struct_exists(self , "destroy")){ + call_fleet_event_function(destroy); + } + } + + static call_fleet_event_function = function(_func_name){ + if (struct_exists(fleet_event_functions,_func_name)){ + fleet_event_functions[$ _func_name](); + } + } + + static fleet_event_functions = { + "deliver_trophy_mission_timed_out" : deliver_trophy_mission_timed_out, + "deliver_trophy_mission_fleet_destroyed" : deliver_trophy_mission_fleet_destroyed, + "deliver_trophy_end_turn_check" :deliver_trophy_end_turn_check, + "mech_fleet_explore_battle_grounds":mech_fleet_explore_battle_grounds + } + + +} \ No newline at end of file diff --git a/scripts/scr_fleet_events/scr_fleet_events.yy b/scripts/scr_fleet_events/scr_fleet_events.yy new file mode 100644 index 0000000000..9ab241e722 --- /dev/null +++ b/scripts/scr_fleet_events/scr_fleet_events.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_fleet_events", + "isCompatibility":false, + "isDnD":false, + "name":"scr_fleet_events", + "parent":{ + "name":"fleet", + "path":"folders/Scripts/fleet.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_fleet_functions/scr_fleet_functions.gml b/scripts/scr_fleet_functions/scr_fleet_functions.gml index 6c284fd4cb..63c37a78ba 100644 --- a/scripts/scr_fleet_functions/scr_fleet_functions.gml +++ b/scripts/scr_fleet_functions/scr_fleet_functions.gml @@ -14,12 +14,24 @@ function distribute_strength_to_fleet(strength, fleet){ } } + +function standard_fleet_strength_calc(fleet = "none"){ + if (fleet == "none"){ + return capital_number + (frigate_number/2) + (escort_number/4); + } else { + with (fleet){ + return standard_fleet_strength_calc(); + } + } +} + //to be run within with scope +//@mixin obj_en_fleet function set_fleet_target(targ_x, targ_y, final_target){ action_x = targ_x; action_y = targ_y; target = final_target; - action_eta=floor(point_distance(x,y,targ_x,targ_y)/128)+1; + action_eta = floor(point_distance(x,y,targ_x,targ_y)/128)+1; } function scr_valid_fleet_target(target) { @@ -37,6 +49,18 @@ function scr_valid_fleet_target(target) { return valid; } +function get_fleet_uid(search_uid){ + var _fleet = -1; + with (obj_en_fleet){ + if (uid == search_uid){ + _fleet = id; + break; + } + } + + return _fleet; +} + function fleets_next_location(fleet = "none", visited = []) { var targ_location = "none"; @@ -49,11 +73,11 @@ function fleets_next_location(fleet = "none", visited = []) { array_push(visited, fleet.id); // Check if the fleet has a 'target' variable - if (variable_instance_exists(fleet, "target")) { + if (fleet.action != "" && variable_instance_exists(fleet, "target")) { // If the target is valid and not already in the visited list, proceed recursively var fleet_target_valid = scr_valid_fleet_target(fleet.target); if (!fleet_target_valid) { - fleet.target = 0; + fleet.target = noone; } if (fleet_target_valid && !array_contains(visited, fleet.target.id)) { // Recursive call with the target and the updated visited list @@ -621,7 +645,11 @@ function fleet_arrival_logic(){ x = cur_star.x; y = cur_star.y; sta=instance_nearest(action_x,action_y,obj_star); + action_x=0; + action_y=0; is_orbiting(); + + arrival_logic_finished = false; // cur_star.present_fleets+=1;if (owner = eFACTION.Tau) then cur_star.tau_fleets+=1; @@ -736,43 +764,6 @@ function fleet_arrival_logic(){ } } - - /*if (owner = eFACTION.Imperium) and (guardsmen>0){// 135 ; guardsmen onto planet - var en_p,en_planets,land,i; - i=0;en_planets=0;land=0; - - if (sta.x=home_x) and (sta.y=home_y){ - repeat(4){i+=1; - en_p[i]=0; - if (sta.p_owner[i]<=5){en_p[i]=1;en_planets+=1;} - } - - if (guardsmen>0) and (en_planets>0){ - land=floor(guardsmen/en_planets); - i=0; - repeat(4){i+=1; - if (en_p[i]=1){guardsmen-=land;sta.p_guardsmen[i]+=land;} - } - if (guardsmen<5) then guardsmen=0; - } - } - if (sta.owner>5) or ((sta.owner = eFACTION.Player) and (obj_controller.faction_status[eFACTION.Imperium]="War")){ - repeat(4){i+=1; - en_p[i]=0; - if (sta.p_player[i]>0) and (obj_controller.faction_status[eFACTION.Imperium]="War"){en_p[i]=1;en_planets+=1;} - } - - if (guardsmen>0) and (en_planets>0){ - land=floor(guardsmen/en_planets); - i=0; - repeat(4){i+=1; - if (en_p[i]=1){guardsmen-=land;sta.p_guardsmen[i]+=land;} - } - if (guardsmen<5) then guardsmen=0; - } - } - }*/ - if (owner= eFACTION.Inquisition){ @@ -785,7 +776,9 @@ function fleet_arrival_logic(){ if (instance_exists(obj_p_ship)){ var p_ship=instance_nearest(x,y,obj_p_ship); if (p_ship.action="") and (point_distance(x,y,p_ship.x,p_ship.y)<80){ - if (obj_controller.p_known[8]=0) then obj_controller.p_known[8]=1; + if (obj_controller.p_known[8]=0){ + obj_controller.p_known[8]=1; + } } } } @@ -797,16 +790,10 @@ function fleet_arrival_logic(){ if (point_distance(plap.x,plap.y,action_x,action_y)<80) then mess=0; } - if (mess=1) and (sta.vision!=0){ - scr_alert("red","owner",$"Contact has been lost with {sta.name}!",sta.x,sta.y); - scr_event_log("red",$"Contact has been lost with {sta.name}.");sta.vision=0;} + if (mess=1) and (orbiting.vision!=0){ + scr_alert("red","owner",$"Contact has been lost with {orbiting.name}!",orbiting.x,orbiting.y); + scr_event_log("red",$"Contact has been lost with {orbiting.name}.");orbiting.vision=0;} } - action_x=0; - action_y=0; - - - - // 135 ; fleet chase @@ -815,159 +802,132 @@ function fleet_arrival_logic(){ } - old_x=x;old_y=y; - x=-100;y=-100; - - cur_star=instance_nearest(old_x,old_y,obj_en_fleet); - var mergus=false; - - mergus=cur_star.image_index; - if (mergus<3) then mergus=0; - if (mergus>=3) then mergus=10; - if (owner = eFACTION.Tau) and (mergus>=3) then mergus=0; - if (string_count("_her",trade_goods)=0) then mergus=99;// was 999 - - // Think this might be causing the crash - if (owner=eFACTION.Tau) and (sta.present_fleet[eFACTION.Imperium]+sta.present_fleet[eFACTION.Player]>=1) - and (sta.present_fleet[eFACTION.Tau]=1) and (image_index=1) and (ret=0) then mergus=15; - if (cur_star.owner=eFACTION.Tau) and (owner=eFACTION.Tau) and (ret=1) then mergus=0; - - - - - if (owner=eFACTION.Tau) and (image_index=1){ - // show_message("Tau||| Other Owner: "+string(cur_star.owner)+" ret: "+string(ret)+" mergus: "+string(mergus)); + //interactions and merging with other already present fleets + + var old_x=x,old_y=y; + var _other_orbiting = []; + var _id = id; + with (obj_en_fleet){ + if (x!=old_x || y!=old_y){ + continue; + } + if (_id==id ){ + continue; + } + + array_push(_other_orbiting,id); + } - - if (owner=eFACTION.Chaos) and (fleet_has_cargo("csm")) or ( fleet_has_cargo("warband")){ - mergus=0; + + var _fleet_strength = standard_fleet_strength_calc(); + for (var i=0;i0){ + _attempt_merge=true; + } + + } + + if (!string_count("_her",trade_goods)){ + _attempt_merge = false; + } + + if (owner=eFACTION.Chaos) and (fleet_has_cargo("csm")) or ( fleet_has_cargo("warband")){ + var _csm = fleet_has_cargo("warband"); + _attempt_merge = false; + } + + // if (cur_star.owner!=owner) then _other_fleet_strength=0; + + + + + //This will never trigger at the moment + if (_attempt_merge){// Merge the fleets + merge_fleets(id,_other_fleet) + + }// End merge fleets + + + //if fleet is damaged but existing fleet is too large to merge feck off elsewhere preferably somewhere friendly + else if (_same_owner && (owner == eFACTION.Tau || (owner = eFACTION.Chaos && !csm))){// Move somewhere new + + if (standard_fleet_strength_calc()<3){ + + var _chosen =false; + var _chosen_id = nearest_star_with_ownership(x,y,owner,orbiting,true,true); + while (_chosen_id != "none"){ + if (scr_orbiting_fleet(eFACTION.Imperium) != "none"){ + _chosen_id = nearest_star_with_ownership(x,y,owner,orbiting,true,true); + } else { + break; + } + } + + instance_activate_object(obj_star); + if (_chosen_id !="none"){ + action_x=_chosen_id.x; + action_y=_chosen_id.y; + set_fleet_movement(); + arrival_logic_finished = true; + } + + //TODO somelogc to go find somewhere else if there are no avialable rebuild planets + } else { + + _chosen_id = nearest_star_with_ownership(x,y,[2,3,4,5,7],orbiting); + } + } } - // if (cur_star.owner!=owner) then mergus=0; - - - - - if (cur_star.x=old_x) and (cur_star.y=old_y) and (cur_star.owner=self.owner) and (cur_star.action="") and (mergus=1999){// Merge the fleets - cur_star.escort_number+=self.escort_number; - cur_star.frigate_number+=self.frigate_number;// show_message("Tau fleet merging"); - cur_star.capital_number+=self.capital_number; - cur_star.guardsmen+=self.guardsmen; - - - - cur_star=instance_nearest(old_x,old_y,obj_star); - // if (cur_star.present_fleets>=1) then cur_star.present_fleets-=1; - if (owner = eFACTION.Tau){obj_controller.tau_fleets-=1;cur_star.tau_fleets-=1;} - if (owner = eFACTION.Chaos) then obj_controller.chaos_fleets-=1; - - instance_destroy(); - }// End merge fleets - - - - if (owner=eFACTION.Tau) and (mergus=15){ // Get the fuck out - var new_star, stue;new_star=0;stue=0;ret=1; - - - instance_activate_object(obj_star);// new_star - stue=instance_nearest(x,y,obj_star); - + + if (owner=eFACTION.Tau && !arrival_logic_finished) { + + //so i'mjust sort of crudely interpreting things how i think duke meant to make it + //basically if the tau fleet is weakened or small instead of trying a hostile takeover + //they instrsd instigste a tau propaganda campaign and get the fuck out the system - if (image_index=1){// Start influence thing - var tau_influence; - var tau_influence_chance=irandom(100)+1; - var tau_influence_planet=irandom(stue.planets)+1; + //if tau fleet is too weak then flee + if (standard_fleet_strength_calc()<3){// Start influence thing - with (stue){ - if (p_type[tau_influence_planet]!="Dead"){ - - scr_alert("green","owner",$"Tau ship broadcasts subversive messages to {planet_numeral_name(tau_influence_planet)}.",sta.x,sta.y); - tau_influence = p_influence[tau_influence_planet][eFACTION.Tau] - - if (tau_influence_chance<=70) and (tau_influence<70){ - adjust_influence[tau_influence_planet](eFACTION.Tau, 10, tau_influence_planet); - if (p_type[tau_influence_planet]=="Forge") then adjust_influence(eFACTION.Tau, -5, tau_influence_planet); - } - - if (tau_influence_chance<=3) and (tau_influence<70){ - adjust_influence(eFACTION.Tau, 30, tau_influence_planet); - if (p_type[tau_influence_planet]=="Forge") then adjust_influence(eFACTION.Tau, -25, tau_influence_planet); - } - } - } - } - - - - instance_deactivate_object(stue); - - with(obj_star){ - if (owner != eFACTION.Tau) then instance_deactivate_object(instance_id); - } - - var good;good=0; - - repeat(100){ - var xx, yy; - if (good=0){ - xx=x+choose(random(300),random(300)*-1); - yy=y+choose(random(300),random(300)*-1); - new_star=instance_nearest(xx,yy,obj_star); - if (new_star.owner!=eFACTION.Tau) then with(new_star){instance_deactivate_object(id);} - if (new_star.owner=eFACTION.Tau) then good=1; + with (orbiting){ + tau_broadcast_propaganda_to_planet(); } + var _chosen =false; + var _chosen_id = nearest_star_with_ownership(x,y,owner,orbiting,true,true); + while (_chosen_id != "none"){ + if (scr_orbiting_fleet(eFACTION.Imperium) != "none"){ + _chosen_id = nearest_star_with_ownership(x,y,owner,orbiting,true,true); + } else { + break; + } + } + + instance_activate_object(obj_star); + if (_chosen_id !="none"){ + action_x=_chosen_id.x; + action_y=_chosen_id.y; + set_fleet_movement(); + arrival_logic_finished = true; + } } - // show_message("Get the fuck out working?: "+string(good)); - - if (new_star.owner=eFACTION.Tau){ - // show_message("Tau fleet actually fleeing"); - action_x=new_star.x; - action_y=new_star.y; - set_fleet_movement(); - } - - instance_activate_object(obj_star); - // This appears bugged + } - - - - - - - x=old_x; - y=old_y; - - var _csm = fleet_has_cargo("warband"); - if (cur_star.x=old_x) and (cur_star.y=old_y) and (cur_star.owner=self.owner) and (cur_star.action="") and ((owner = eFACTION.Tau) or (owner = eFACTION.Chaos)) and (mergus=10) and (!_csm){// Move somewhere new - var stue, stue2;stue=0;stue2=0; - var goood=0; - - with(obj_star){ - if (is_dead_star()){ - instance_deactivate_object(id); - } - } - stue=instance_nearest(x,y,obj_star); - instance_deactivate_object(stue); - repeat(10){ - if (goood=0){ - stue2=instance_nearest(x+choose(random(400),random(400)*-1),y+choose(random(400),random(400)*-1),obj_star); - if (owner = eFACTION.Tau) and (stue2.owner = eFACTION.Tau) then goood=1; - if (owner = eFACTION.Chaos) and (stue2.owner != eFACTION.Chaos) then goood=1; - if (stue2.planets=0) then goood=0; - if (stue.present_fleet[eFACTION.Imperium]>0) or (stue.present_fleet[eFACTION.Player]>0) then goood=0; - if (stue2.planets=1) and (stue2.p_type[1]="Dead") then goood=0; - } - } - action_x=stue2.x; - action_y=stue2.y; - set_fleet_movement();// stue.present_fleets-=1; - instance_activate_object(obj_star); - } + + // ORKS @@ -977,7 +937,7 @@ function fleet_arrival_logic(){ // If the connected planet is owned by orks then choose a random one within 400 not owned by orks - if (owner == eFACTION.Ork){ + else if (owner == eFACTION.Ork){ if (is_orbiting()){ with (orbiting){ ork_fleet_arrive_target(); @@ -1032,7 +992,6 @@ function fleet_arrival_logic(){ } - exit;// end of eta=0 } function choose_fleet_sprite_image(){ @@ -1068,6 +1027,22 @@ function merge_fleets(main_fleet, merge_fleet){ main_fleet.cargo_data[$ _merge_cargo[i]] = merge_fleet.cargo_data[$ _merge_cargo[i]]; } } + main_fleet.guardsmen += merge_fleet.guardsmen; + + //This bit allseems a bit superfluouse but keepingjust in case it breaks something] + var _is_orbiting = is_orbiting(merge_fleet); + switch(merge_fleet.owner){ + case eFACTION.Tau: + obj_controller.tau_fleets--; + if (_is_orbiting){ + merge_fleet.orbiting.tau_fleets--; + } + break; + case eFACTION.Chaos: + obj_controller.chaos_fleets--; + break; + + } instance_destroy(merge_fleet.id); } diff --git a/scripts/scr_forge_world_functions/scr_forge_world_functions.gml b/scripts/scr_forge_world_functions/scr_forge_world_functions.gml index cb8caf3b9e..92aa8e4532 100644 --- a/scripts/scr_forge_world_functions/scr_forge_world_functions.gml +++ b/scripts/scr_forge_world_functions/scr_forge_world_functions.gml @@ -3,12 +3,7 @@ function imperial_navy_fleet_construction(){ // ** Check number of navy fleets ** - var new_navy_fleets = []; - with(obj_en_fleet){ - if (owner==eFACTION.Imperium) and (navy==1) { - array_push(new_navy_fleets, id); - } - } + var new_navy_fleets = get_imperial_navy_fleets(); //delete navy fleets if more than required var navy_fleet_count = array_length(new_navy_fleets); var cur_fleet; @@ -22,57 +17,91 @@ function imperial_navy_fleet_construction(){ navy_fleet_count--; array_delete(new_navy_fleets, i, 1); i--; - if (navy_fleet_count<=target_navy_number) then break; + if (navy_fleet_count<=target_navy_number){ + break; + } } } //if system needs more navy fleets get forge world to make some } else if (navy_fleet_count=0;i--){ + var _sys = _forge_systems[i]; + var good=true; + for(var o=1; o<=_sys.planets; o++) { + + if (_sys[p_type] == "Forge"){ + var _nearest = instance_nearest(x,y,obj_en_fleet) + if (_nearest.x ==x && _nearest.y==y && _nearest.navy){ + good=false; + break; + } + } + } + + if (!good){ + array_delete(_forge_systems,i,1); + } + } // After initial navy fleet construction fleet growth is handled in obj_en_fleet.alarm_5 - if (array_length(forge_systems)){ - var construction_forge,new_navy_fleet; - construction_forge=choose_array(forge_systems); + if (array_length(_forge_systems)){ + var construction_forge; + construction_forge = array_random_element(_forge_systems); build_new_navy_fleet(construction_forge) } } } +function get_imperium_forge_systems(){ + var _forge_systems = []; + with(obj_star){ + var good=false; + for(var o=1; o<=planets; o++) { + if (p_type[o]=="Forge") + and (p_owner[o]==eFACTION.Mechanicus) + and (p_orks[o]+p_tau[o]+p_tyranids[o]+p_chaos[o]+p_traitors[o]+p_necrons[o]==0) { + + var enemy_fleets = [ + eFACTION.Ork, + eFACTION.Tau, + eFACTION.Tyranids, + eFACTION.Chaos, + eFACTION.Necrons + ] + + var enemy_fleet_count = array_reduce(enemy_fleets, function(prev, curr) { + return prev + present_fleet[curr] + }, 0); + + good = enemy_fleet_count<=0; + } + if (good){ + break; + } + } + if (good){ + good = x<=room_width && y<=room_height; + } + if (good){ + array_push(_forge_systems, id); + } + } + return _forge_systems; +} + function build_planet_defence_fleets(){ imp_ships=0; var _defence_fleet_log = {}; with(obj_en_fleet){ if (owner==eFACTION.Imperium){ - var _imperial_fleet_defence_score = capital_number + (frigate_number/2) + (escort_number/4); + var _imperial_fleet_defence_score = round(standard_fleet_strength_calc()); obj_controller.imp_ships += _imperial_fleet_defence_score; //log this to prevent double work later figuring out if a planet has an orbiting defence fleet if (!navy && action=="" && is_orbiting()){ diff --git a/scripts/scr_garrison/scr_garrison.gml b/scripts/scr_garrison/scr_garrison.gml index 36010cffda..7b18680380 100644 --- a/scripts/scr_garrison/scr_garrison.gml +++ b/scripts/scr_garrison/scr_garrison.gml @@ -147,19 +147,20 @@ function GarrisonForce(planet_operatives, turn_end=false, type="garrison") const } static garrison_report = function(){ - var system = obj_star_select.target; - var planet = obj_controller.selecting_planet; + var _system = obj_star_select.target; + var _p = obj_controller.selecting_planet; + var _planet = _system.system_datas[_p]; var report_string = "Hail My lord.##"; - report_string+=$"Report for garrison on {system.name} {scr_roman_numerals()[planet-1]} is as follows#"; + report_string+=$"Report for garrison on {_planet.name()} is as follows#"; if ((array_length(garrison_squads)) > 1){ report_string+= $"The garrison is comprised of {array_length(garrison_squads)} squads," } else {report_string+="The garrison is comprised of a single _squad,"} report_string+= $" with a total man count of {total_garrison}.#" - if (system.p_owner[planet] != eFACTION.Player && system.dispo[planet] >=-100) { - var disposition = disposition_description_chart(system.dispo[planet]); + if (_planet.current_owner!= eFACTION.Player && _planet.disposition >=-100) { + var disposition = disposition_description_chart(_planet.disposition); report_string += $"Our Relationship with the Rulers of the planet is {disposition}#"; - } else if (system.dispo[planet] < -1000) { + } else if (_planet.disposition < -1000) { if (system.p_owner[planet] == eFACTION.Player){ report_string += $"Rule of the planet is going well"; } else { diff --git a/scripts/scr_governors/scr_governors.gml b/scripts/scr_governors/scr_governors.gml new file mode 100644 index 0000000000..d705fa05ff --- /dev/null +++ b/scripts/scr_governors/scr_governors.gml @@ -0,0 +1,38 @@ +function GovernorProfile(){ + born = obj_controlller.turn - irandom_range(240,4800); + + uid = scr_uuid_generate(); + + static age = function(){ + var _age = born - obj_controlller.turn; + if (_age < 0){ + _age = (born * -1) + obj_controlller.turn; + } + + _age/=12; + + return age; + } + + gender = set_gender(); + + name = global.name_generator.generate_imperial_name(); + + astartes_view = irandom(4);//0 hates astartes 4 likes astartes + + sector_commander_view = irandom(4); + + personal_security = irandom(4); + + constitution = 10; + strength = 10; + luck = 10; + dexterity = 10; + wisdom = irandom_range(25, 50); + piety = irandom_range(25, 60); + charisma = irandom_range(25, 60); + technology = irandom_range(10, 40); + intelligence = irandom_range(25, 50); + weapon_skill = 5; + ballistic_skill = 5; +} \ No newline at end of file diff --git a/scripts/scr_governors/scr_governors.yy b/scripts/scr_governors/scr_governors.yy new file mode 100644 index 0000000000..99d71d1e81 --- /dev/null +++ b/scripts/scr_governors/scr_governors.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_governors", + "isCompatibility":false, + "isDnD":false, + "name":"scr_governors", + "parent":{ + "name":"marines_and_profiles", + "path":"folders/Scripts/marines_and_profiles.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_hit/scr_hit.gml b/scripts/scr_hit/scr_hit.gml index b1c4ea0724..57a708c558 100644 --- a/scripts/scr_hit/scr_hit.gml +++ b/scripts/scr_hit/scr_hit.gml @@ -100,11 +100,21 @@ function point_and_click_sprite(x1, y1, sprite, x_scale = 1, y_scale = 1){ } function scr_click_left(cooldown = 60, lock_bypass = false){ + + return click_controller(cooldown,lock_bypass); +} + +function scr_click_right(cooldown = 60, lock_bypass = false){ + + return click_controller(cooldown,lock_bypass ,mb_right); +} + +function click_controller(cooldown = 60, lock_bypass = false, mouse_button_lr=mb_left){ if (lock_bypass == false && global.ui_click_lock == true) { return false; } - var mouse_clicked = event_number==ev_gui ? device_mouse_check_button_pressed(0,mb_left) : mouse_check_button_pressed(mb_left); + var mouse_clicked = event_number==ev_gui ? device_mouse_check_button_pressed(0,mouse_button_lr) : mouse_check_button_pressed(mouse_button_lr); if (!mouse_clicked) { return false; } @@ -153,7 +163,7 @@ function scr_click_left(cooldown = 60, lock_bypass = false){ show_debug_message($"Mouse Clicked! {array_to_string_list(debug_get_callstack(), true)}"); } - return mouse_clicked; + return mouse_clicked; } function mouse_button_held(_button = mb_left) { diff --git a/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml b/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml index 0fa27ee7f9..6d54f3aed4 100644 --- a/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml +++ b/scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.gml @@ -127,9 +127,7 @@ function build_new_navy_fleet(construction_forge){ navy=1; var total_ships=0; - total_ships+=capital_number-1; - total_ships+=round((frigate_number/2)); - total_ships+=round((escort_number/4)); + total_ships+=round(standard_fleet_strength_calc()); if (total_ships<=1 && capital_number+frigate_number+escort_number>0) then total_ships=1; choose_fleet_sprite_image() image_index=total_ships; @@ -178,10 +176,7 @@ function new_navy_ships_forge(){ if (capital_number>1) then capital_number=1; } if (onceh=1){ - var ii=0; - ii+=capital_number; - ii+=round((frigate_number/2)); - ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()); image_index=ii<=1?1:ii; } @@ -1047,10 +1042,8 @@ function setup_start_imperial_navy_fleet(system){ warp_able=true; image_speed=0; - ii+=capital_number-1; - ii+=round((frigate_number/2)); - ii+=round((escort_number/4)); - if (ii<=1) and (capital_number+frigate_number+escort_number>0){ + ii+=round(standard_fleet_strength_calc()); + if (ii<=1) and (ii>0){ ii=1; } image_index=ii; @@ -1066,4 +1059,18 @@ function setup_start_imperial_navy_fleet(system){ } } +function get_imperial_navy_fleets(){ + var _fleets = []; + + with (obj_en_fleet){ + if (owner != eFACTION.Imperium || !navy){ + continue; + } else if (owner == eFACTION.Imperium && navy){ + array_push(_fleets, id); + } + } + + return _fleets; +} + diff --git a/scripts/scr_inquisition_mission/scr_inquisition_mission.gml b/scripts/scr_inquisition_mission/scr_inquisition_mission.gml index b333eba560..5c203eff9c 100644 --- a/scripts/scr_inquisition_mission/scr_inquisition_mission.gml +++ b/scripts/scr_inquisition_mission/scr_inquisition_mission.gml @@ -526,7 +526,6 @@ function mission_hunt_inquisitor_show_mercy(){ function mission_hunt_inquisitor_destroy_inquisitor_ship(){ - show_debug_message("mission_hunt_inquisitor_destroy_inquisitor_ship"); var _final_disp_mod = 0; if (obj_controller.demanding == 0) { diff --git a/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml b/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml index f0f032b0a2..6f506a190b 100644 --- a/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml +++ b/scripts/scr_khornate_fleet_functions/scr_khornate_fleet_functions.gml @@ -272,19 +272,14 @@ function spawn_chaos_warlord(){ array_push(candidate_systems, self) } - var fleet_target = array_reduce(candidate_systems, method({nfleet}, function(prev, curr) { - if !prev - return curr - var prev_dist = point_distance(prev.x, prev.y, nfleet.x, nfleet.y) - var curr_dist = point_distance(curr.x, curr.y, nfleet.x, nfleet.y) - - return (prev_dist > curr_dist) ? curr : prev; - }),noone); + if (array_length(candidate_systems)){ + var fleet_target = nearest_instance(candidate_systems,nfleet); - with (nfleet){ - nfleet.action_x=fleet_target.x; - nfleet.action_y=fleet_target.y; - set_fleet_movement() + with (nfleet){ + nfleet.action_x=fleet_target.x; + nfleet.action_y=fleet_target.y; + set_fleet_movement() + } } var tix=$"Chaos Lord {faction_leader[eFACTION.Chaos]} continues his Black Crusade into Sector {obj_ini.sector_name}."; @@ -298,7 +293,7 @@ function spawn_chaos_warlord(){ function destroy_khorne_fleet(){ var chaos_lord_killed=false; with(instance_nearest(x, y, obj_star)){ - if system_feature_bool(p_feature, P_features.ChaosWarband == 1) then chaos_lord_killed=true; + if system_feature_bool(p_feature, P_features.ChaosWarband) then chaos_lord_killed=true; } if (chaos_lord_killed){ obj_controller.faction_defeated[10]=1; diff --git a/scripts/scr_load_controller/scr_load_controller.gml b/scripts/scr_load_controller/scr_load_controller.gml index f20fc9877e..bbfaa523cf 100644 --- a/scripts/scr_load_controller/scr_load_controller.gml +++ b/scripts/scr_load_controller/scr_load_controller.gml @@ -325,13 +325,6 @@ function scr_load_controller(save_id){ obj_controller.turns_ignored[g]=ini_read_real("Factions","turns_ignored"+string(g),0); } // - var g;g=0; - repeat(50){g+=1; - obj_controller.quest[g]=ini_read_string("Ongoing","quest"+string(g),""); - obj_controller.quest_faction[g]=ini_read_real("Ongoing","quest_faction"+string(g),0); - obj_controller.quest_end[g]=ini_read_real("Ongoing","quest_end"+string(g),0); - } - // obj_controller.justmet=0; obj_controller.check_number=ini_read_real("Controller","check_number",0); obj_controller.year_fraction=ini_read_real("Controller","year_fraction",0); diff --git a/scripts/scr_marine_struct/scr_marine_struct.gml b/scripts/scr_marine_struct/scr_marine_struct.gml index 18dacac89b..89f005640e 100644 --- a/scripts/scr_marine_struct/scr_marine_struct.gml +++ b/scripts/scr_marine_struct/scr_marine_struct.gml @@ -478,6 +478,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} religion_sub_cult = "none"; base_group = "none"; role_history = []; + epithets = []; enum eROLE_TAG { Techmarine = 0, Librarian = 1, @@ -785,17 +786,50 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} }; //adds a trait to a marines trait list - static add_trait = function(trait) { - var balance_value; + static add_trait = function(trait,return_stat_diff = false, return_description = false) { + + if (return_stat_diff){ + var _start_stats = get_stat_line(); + } if (struct_exists(global.trait_list, trait)) { if (!array_contains(traits, trait)) { + + var _return_string = ""; var selec_trait = global.trait_list[$ trait]; stat_boosts(selec_trait); array_push(traits, trait); + + if (return_stat_diff){ + var _end_stats = get_stat_line(); + + var _stat_diff = compare_stats(_end_stats,_start_stats); + } + + if (return_description){ + _return_string += $"{name_role()} Has gained the trait {selec_trait.display_name}"; + } + + if (return_stat_diff){ + _return_string +=$", {(print_stat_diffs(_stat_diff))}" + } + + return _return_string } } + + return ""; }; + static add_epithet = function(epithet){ + if (is_string(epithet)){ + epithet = { + title : epithet, + story : "", + } + } + array_push(epithets,epithet); + } + static has_trait = marine_has_trait; static add_feat = function(feat) { @@ -1976,7 +2010,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} } //quick way of getting name and role combined in string - static name_role = function() { + static name_role = function(include_epithet = true) { var temp_role = role(); if (squad != "none") { if (struct_exists(obj_ini.squad_types[$ obj_ini.squads[squad].type], temp_role)) { @@ -1986,6 +2020,13 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} } } } + + var _name = "{temp_role} {name()}"; + if (include_epithet){ + if (array_length(epithets)){ + _name += $" {epithets[0].title}"; + } + } return string("{0} {1}", temp_role, name()); }; @@ -2233,7 +2274,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} }; static get_stat_line = function() { - return { + return variable_clone({ "constitution": constitution, "strength": strength, "luck": luck, @@ -2245,7 +2286,7 @@ function TTRPG_stats(faction, comp, mar, class = "marine", other_spawn_data = {} "intelligence": intelligence, "weapon_skill": weapon_skill, "ballistic_skill": ballistic_skill - }; + }); }; //TODO: Make this into a universal stat gathering function from all gear, for any stat; diff --git a/scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.gml b/scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.gml new file mode 100644 index 0000000000..5f0dd00cc5 --- /dev/null +++ b/scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.gml @@ -0,0 +1,55 @@ +function spawn_mechanicus_explore_fleet(){ + + var _forges = get_imperium_forge_systems(); + if (!array_length(_forges)){ + return -1; + } + + var _forge = array_random_element(_forges); + var _fleet = instance_create(_forge.x, _forge.y, obj_en_fleet); + + with (_fleet){ + owner = eFACTION.Mechanicus; + warp_able = true; + capital_number = 2; + frigate_number = 5; + escort_number = 20; + navy = 0; + choose_fleet_sprite_image(); + } + + return _fleet; +} + +///@mixin FleetEvent +function mech_fleet_explore_battle_grounds(){ + var _navy_fleet = get_fleet_uid(fleet_uid); + + if (!is_orbiting(_navy_fleet)){ + return; + } + + var _has_battle = system_feature_bool(orbiting.p_feature,P_features.OldBattleGround); + if (_has_battle){ + var _p_data = orbiting.system_datas[_has_battle]; + _p_data.refresh_data(); + } else{ + return; + } + + var _battle_ground = _p_data.get_features(P_features.OldBattleGround)[0]; + + if (_battle_ground.explored == 0){ + var _text = $"The Mechanicus have arrived on {_p_data.name()} It will now be impossible to access the site without Mechanicus surveillance any potential rescources will now be fully put towards their aimsin service of the Ommnissiah"; + scr_popup($"Mechanicus Scavange {_p_data.name()}", _text, "mech"); + } else { + var _marines = _p_data.collect_planet_group("all"); + if (array_length(_marines)){ + var _heritecs = obj_controller.tech_status == "heretics"; + if (_heritecs){ + _text = "The Rumours of the heretical practices of your marines have not gone un-noticed your presence is thusly even more enraging to mechanicus"; + } + + } + } +} \ No newline at end of file diff --git a/scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.yy b/scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.yy new file mode 100644 index 0000000000..da0672f643 --- /dev/null +++ b/scripts/scr_mechanicus_fleet_functions/scr_mechanicus_fleet_functions.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_mechanicus_fleet_functions", + "isCompatibility":false, + "isDnD":false, + "name":"scr_mechanicus_fleet_functions", + "parent":{ + "name":"fleet", + "path":"folders/Scripts/fleet.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml b/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml index 1ab242d254..79cd0b6c24 100644 --- a/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml +++ b/scripts/scr_mechanicus_missions/scr_mechanicus_missions.gml @@ -8,7 +8,7 @@ function mechanicus_missions_end_turn(planet){ var percent_complete = increment_mission_completion(_prob_data); scr_alert("",$"mission",$"Mechanicus Mission on {planet_numeral_name(planet)} is {floor(percent_complete)}% complete.",0,0); if (percent_complete>=100){ - remove_planet_problem(planet,"mech_raider") + remove_planet_problem(planet,"mech_raider"); scr_mission_reward("mech_raider",id,planet); } } diff --git a/scripts/scr_mission_functions/scr_mission_functions.gml b/scripts/scr_mission_functions/scr_mission_functions.gml index ecd0676530..936408fe45 100644 --- a/scripts/scr_mission_functions/scr_mission_functions.gml +++ b/scripts/scr_mission_functions/scr_mission_functions.gml @@ -12,7 +12,7 @@ function location_out_of_player_control(unit_loc){ return (array_contains(_locs,unit_loc )); } -#macro planet_problem_keys ["meeting_trap","meeting","succession","mech_raider","mech_bionics","mech_mars","mech_tomb1","fallen","great_crusade","harlequins","fund_elder","provide_garrison","hunt_beast","protect_raiders","join_communion","join_parade","recover_artifacts","train_forces","spyrer","inquisitor","recon","cleanse","purge","tyranid_org","artifact_loan","necron","ethereal","demon_world"] +#macro planet_problem_keys ["meeting_trap","meeting","succession","mech_raider","mech_bionics","mech_mars","mech_tomb1","fallen","great_crusade","harlequins","fund_elder","provide_garrison","hunt_beast","protect_raiders","join_communion","join_parade","recover_artifacts","train_forces","spyrer","inquisitor","recon","cleanse","purge","tyranid_org","artifact_loan","necron","ethereal","demon_world","deliver_trophy"] function mission_name_key(mission){ var mission_key = { @@ -86,13 +86,15 @@ function scr_new_governor_mission(planet, problem = ""){ }; if (problem != ""){ if (problem == "provide_garrison"){ - if (system_garrison[planet-1].garrison_force) then exit; + if (system_garrison[planet].garrison_force){ + exit; + } mission_data.reason = choose("stability", "importance"); } else if (problem=="purge_enemies"){ var enemy = 0; if (planets>1){ for (var i=1;i<=planets;i++){ - if(i=planet) then continue; + if (i=planet) then continue; if (p_owner[i]==eFACTION.Imperium){ enemy=i; break; @@ -128,53 +130,6 @@ function init_marine_acting_strange(){ scr_event_log("color",text); } -function init_garrison_mission(planet, star, mission_slot){ - var problems_data = star.p_problem_other_data[planet] - var mission_data = problems_data[mission_slot]; - if (mission_data.stage == "preliminary"){ - var numeral_name = planet_numeral_name(planet, star); - mission_data.stage = "active"; - var garrison_length=(10+irandom(6)); - star.p_timer[planet][mission_slot] = garrison_length; - //pop.image="ancient_ruins"; - var gar_pop=instance_create(0,0,obj_popup); - //TODO some new universal methods for popups - gar_pop.title=$"Requested Garrison Provided to {numeral_name}"; - gar_pop.text=$"The governor of {numeral_name} Thanks you for considering his request for a garrison, you agree that the garrison will remain for at least {garrison_length} months."; - //pip.image="event_march" - gar_pop.add_option("Commence Garrison"); - gar_pop.image=""; - gar_pop.cooldown=8; - obj_controller.cooldown=8; - scr_event_log("",$"Garrison committed to {numeral_name} for {garrison_length} months.", star.name ); - } -} - - - - -function init_beast_hunt_mission(planet, star, mission_slot){ - var problems_data = star.p_problem_other_data[planet] - var mission_data = problems_data[mission_slot]; - if (mission_data.stage == "preliminary"){ - var numeral_name = planet_numeral_name(planet, star); - mission_data.stage = "active"; - var _mission_length=(irandom_range(2,5)); - star.p_timer[planet][mission_slot] = _mission_length; - //pop.image="ancient_ruins"; - var gar_pop=instance_create(0,0,obj_popup); - //TODO some new universal methods for popups - gar_pop.title=$"Marines assigned to hunt beasts around {numeral_name}"; - gar_pop.text=$"The govornor of {numeral_name} Thanks you for the participation of your elite warriors in your execution of such a menial task."; - //pip.image="event_march" - gar_pop.add_option("Happy Hunting"); - gar_pop.image=""; - gar_pop.cooldown=8; - obj_controller.cooldown=20; - scr_event_log("",$"Beast hunters deployed to {numeral_name} for {_mission_length} months.", star.name); - } -} - function role_compare(unit, role){ return unit.role() == obj_ini.role[100][role]; } @@ -296,32 +251,25 @@ function protect_raiders_hold_memorial(){ text = $"You prepare to have a large public memorial for your fallen marines on the planet surface as a show of defiance. The chapter are pleased by such an act and the population of the planet are mesmerized by the spectacle. The governor is furious not only has his incompetence to deal with the planets xenos issue been made public in such a way that the sector commander has now heard about it but he perceives his failures are being paraded in font of him\n nGovernor Disposition : -30"; } -function init_train_forces_mission(planet, star, mission_slot, marine){ - var _pdata = new PlanetData(planet, star); - var mission_data = _pdata.problems_data[mission_slot]; +function init_garrison_mission(planet, star, mission_slot){ + var problems_data = star.p_problem_other_data[planet] + var mission_data = problems_data[mission_slot]; if (mission_data.stage == "preliminary"){ - var numeral_name = _pdata.name(); + var numeral_name = planet_numeral_name(planet, star); mission_data.stage = "active"; - var _mission_length=(irandom_range(3,12)); - star.p_timer[planet][mission_slot] = _mission_length; + var garrison_length=(10+irandom(6)); + star.p_timer[planet][mission_slot] = garrison_length; //pop.image="ancient_ruins"; var gar_pop=instance_create(0,0,obj_popup); //TODO some new universal methods for popups - gar_pop.title=$"Training forces on {numeral_name} begins"; - gar_pop.text=$"{marine.name_role()} Has taken leave of his current post in order to aid the governor of {numeral_name} and his pdf commanders with training local forces and bolstering defences."; - var _is_cap = role_compare(marine, eROLE.Captain); - - if (_is_cap){ - gar_pop.text += "the governor seems to be impressed that such a high ranking officer has been assigned to his request (disp +3)"; - _pdata.add_disposition(3); - } - + gar_pop.title=$"Requested Garrison Provided to {numeral_name}"; + gar_pop.text=$"The governor of {numeral_name} Thanks you for considering his request for a garrison, you agree that the garrison will remain for at least {garrison_length} months."; //pip.image="event_march" - gar_pop.add_option($"Good luck {marine.name()}"); + gar_pop.add_option("Commence Garrison"); gar_pop.image=""; - gar_pop.cooldown=500; - obj_controller.cooldown=500; - scr_event_log("",$"{marine.name_role()} deployed to {numeral_name} for {_mission_length} months.", star.name); + gar_pop.cooldown=8; + obj_controller.cooldown=8; + scr_event_log("",$"Garrison committed to {numeral_name} for {garrison_length} months.", star.name ); } } @@ -330,9 +278,9 @@ function init_train_forces_mission(planet, star, mission_slot, marine){ function complete_garrison_mission(targ_planet, problem_index){ var planet = new PlanetData(targ_planet, self); if (problem_has_key_and_value(targ_planet,problem_index,"stage", "active")){ - if (planet.current_owner == eFACTION.Imperium && system_garrison[targ_planet-1].garrison_force){ + if (planet.current_owner == eFACTION.Imperium && system_garrison[targ_planet].garrison_force){ var _mission_string = $"The garrison on {planet_numeral_name(targ_planet)} has finished the period of garrison support agreed with the planetary governor."; - var p_garrison = system_garrison[targ_planet-1]; + var p_garrison = system_garrison[targ_planet]; var result = p_garrison.garrison_disposition_change(id, targ_planet); if (!p_garrison.garrison_leader){ p_garrison.find_leader(); @@ -375,6 +323,39 @@ function complete_garrison_mission(targ_planet, problem_index){ remove_planet_problem(targ_planet, "provide_garrison"); } } + + + +function init_train_forces_mission(planet, star, mission_slot, marine){ + var _pdata = new PlanetData(planet, star); + var mission_data = _pdata.problems_data[mission_slot]; + if (mission_data.stage == "preliminary"){ + var numeral_name = _pdata.name(); + mission_data.stage = "active"; + var _mission_length=(irandom_range(3,12)); + star.p_timer[planet][mission_slot] = _mission_length; + //pop.image="ancient_ruins"; + var gar_pop=instance_create(0,0,obj_popup); + //TODO some new universal methods for popups + gar_pop.title=$"Training forces on {numeral_name} begins"; + gar_pop.text=$"{marine.name_role()} Has taken leave of his current post in order to aid the governor of {numeral_name} and his pdf commanders with training local forces and bolstering defences."; + var _is_cap = role_compare(marine, eROLE.Captain); + + if (_is_cap){ + gar_pop.text += "the governor seems to be impressed that such a high ranking officer has been assigned to his request (disp +3)"; + _pdata.add_disposition(3); + } + + //pip.image="event_march" + gar_pop.add_option($"Good luck {marine.name()}"); + gar_pop.image=""; + gar_pop.cooldown=500; + obj_controller.cooldown=500; + scr_event_log("",$"{marine.name_role()} deployed to {numeral_name} for {_mission_length} months.", star.name); + } +} + + function complete_train_forces_mission(targ_planet, problem_index){ var planet = new PlanetData(targ_planet, self); if (problem_has_key_and_value(targ_planet,problem_index,"stage","active")){ @@ -442,7 +423,7 @@ function complete_train_forces_mission(targ_planet, problem_index){ disp_loss = -5; _mission_string += "The orgional training mission was a failiure" if (_brute){ - _mission_string += "in no short part due to his brutish nature"; + _mission_string += "in no short part due to his brutish nature (Trait : Brute)"; } _mission_string += "."; @@ -471,9 +452,116 @@ function complete_train_forces_mission(targ_planet, problem_index){ } } } + +function get_beast_rumor(_planet_type, _beast_name){ + switch (_planet_type){ + case "Feudal": + return choose( + $"Peasants whisper prayers at night, for {_beast_name} walks the old forest paths.", + $"Knights of the realm have failed to slay {_beast_name}, their banners now hang in tatters.", + $"Church bells toll whenever {_beast_name} is sighted." + ); + + case "Ice": + return choose( + $"The ice cracks when {_beast_name} hunts.", + $"Entire hab-blocks were found frozen solid in the wake of {_beast_name}.", + $"The wind carries the howls of {_beast_name} across the tundra." + ); + + case "Death": + return choose( + $"Nothing lives long where {_beast_name} roams.", + $"Scavenger clans refuse entire regions claimed by {_beast_name}.", + $"Even apex predators flee the shadow of {_beast_name}." + ); + } + + return $"{_beast_name} is the most fesarsome fauna in the entire segment according to locals"; +} + + +function get_beast_name_by_planet_type(_planet_type){ + switch (_planet_type){ + case "Feudal": + return choose( + "The Thorn-King", + "Blackwood Stalker", + "Crowned Razorback", + "Cathedral Stag", + "Old Bloodfather", + "The Green Tyrant" + ); + + case "Ice": + return choose( + "The Frostwyrm", + "Glacial Leviathan", + "The Howling Pale", + "Rimehorn Colossus", + "White Death Ursid", + "Icebound Devourer" + ); + + case "Death": + return choose( + "The Charnel Leviathan", + "God-Eater Beast", + "Void-Spined Terror", + "Apex Predatrix", + "Emperor’s Bane", + "The Unending Maw" + ); + } + + return "Glistening Horror"; +} + + +function format_beast_trophy(_beast_name){ + return choose( + $"The Severed Crown of {_beast_name}", + $"The Fanged Skull of {_beast_name}", + $"The Head of {_beast_name}", + $"The Blackened Remains of {_beast_name}" + ); +} + + +function init_beast_hunt_mission(planet, star, mission_slot){ + var _problems_data = star.p_problem_other_data[planet]; + var mission_data = _problems_data[mission_slot]; + if (mission_data.stage == "preliminary"){ + var numeral_name = planet_numeral_name(planet, star); + mission_data.stage = "active"; + var _mission_length=(irandom_range(2,5)); + star.p_timer[planet][mission_slot] = _mission_length; + //pop.image="ancient_ruins"; + var gar_pop=instance_create(0,0,obj_popup); + //TODO some new universal methods for popups + + var _beast_name = get_beast_name_by_planet_type(star.p_type[planet]); + gar_pop.title=$"Hunt {_beast_name} beasts around {numeral_name}"; + gar_pop.text=$"The governor thanks you for lending your warriors to a task beneath their station — yet one whose outcome will be remembered. And that your marines shall find the {_beast_name} a suitable challenge. As things stand rumours say {get_beast_rumor(star.p_type[planet])}"; + //pip.image="event_march" + gar_pop.add_option({ + str1: "Happy Hunting" + }); + gar_pop.image=""; + gar_pop.cooldown=8; + gar_pop.pop_data.beast_name = _beast_name; + mission_data.beast_name = _beast_name; + obj_controller.cooldown=20; + scr_event_log("",$"Beast hunters deployed to {numeral_name} for {_mission_length} months.", star.name); + } +} + + +///@mixin obj_star function complete_beast_hunt_mission(targ_planet, problem_index){ - var planet = new PlanetData(targ_planet, self); + var _planet = new PlanetData(targ_planet, self); if (problem_has_key_and_value(targ_planet,problem_index,"stage","active")){ + var _problem_data = _planet.problems_data[problem_index]; _mission_string = ""; var man_conditions = { "job": "hunt_beast", @@ -490,18 +578,19 @@ function complete_beast_hunt_mission(targ_planet, problem_index){ remove_planet_problem(targ_planet, "hunt_beast"); return; } + var _successful_hunters = []; + var _largest_pass= 0; for (var i=0;i 20 && array_length(_navy_fleets)){ + _pop_data = { + trophy_owner : array_random_element(_successful_hunters), + system: self.name, + planet : targ_planet, + target_fleet : array_random_element(_navy_fleets), + beast :_problem_data.beast_name, + planet_type : _planet.planet_type, + }; + + var _options = { + choice_func : init_deliver_trophy_mission, + str1 : "Continue", + } + + _pop_data.options = _options; + } if (_success){ _mission_string = $"The mission was a success and a great number of beasts rounded up and slain, your marines were able to gain great skills and the prestige of your chapter has increased greatly across the planets populace." if (_deaths){ @@ -532,12 +641,159 @@ function complete_beast_hunt_mission(targ_planet, problem_index){ _mission_string = $"The mission was a failiure. The governor is disapointed and the legend of your chapter has undoubtedly been diminished"; _mission_string += $"\n{_unit_report_string}"; } - scr_popup($"Beast Hunt on {planet_numeral_name(i)}",_mission_string,"",""); + scr_popup($"Beast Hunt on {planet_numeral_name(i)}",_mission_string,"",_pop_data); remove_planet_problem(targ_planet, "hunt_beast"); + } else { remove_planet_problem(targ_planet, "hunt_beast"); } } +function init_deliver_trophy_mission(){ + pop_data.trophy_name = format_beast_trophy(pop_data.beast); + text = $"Much fanfare is made of the great trophy {pop_data.trophy_owner.name_role()} bears: {pop_data.trophy_name}."; + text += $" The governor proclaims it proof that {pop_data.beast} was the most fearsome predator in the sector."; + + + text += $"\n\nAn astropathic message is later recieved from the Commander of an Imperial Navy fleet explaining that his fleet is currrently home to the {irandom_numeral(100)},{irandom_numeral(100)} and {irandom_numeral(100)} {pop_data.system} Regiments and pleads that the trophy be handed over to his fleet in order to boost the moral of the regiments and fleet in general"; + + replace_options([ + { + str1 : "Refuse and place the trophy into the Librarium", + choice_func : function(){ + scr_add_artifact(); + } + + }, + { + str1 : "Accept", + choice_func : accept_deliver_trophy_mission + } + ]); + +} + + + +function accept_deliver_trophy_mission(){ + text = $"You Send a reply to tell the commander you accept and will ensure the trophy is delivered in person by the marine that slew the beast"; + var _targ_fleet = pop_data.target_fleet; + + var _targ_fleet_intercept = fleets_next_location(_targ_fleet); + if (_targ_fleet.action == ""){ + text += $"\n\n the fleet in question is currently active around the {_targ_fleet_intercept.name} system"; + } else { + text += $"\n\n the fleet will next be accessible around the {_targ_fleet_intercept.name} system"; + } + + pop_data.target_fleet = _targ_fleet.uid; + + pop_data.delivering_marine = pop_data.trophy_owner.name_role(); + var _t_owner = pop_data.trophy_owner; + pop_data.trophy_owner = _t_owner.uid; + + var _fleet_event = new FleetEvent(pop_data); + + _fleet_event.turn_end = "deliver_trophy_end_turn_check"; + _fleet_event.destroy = "deliver_trophy_mission_fleet_destroyed"; + _fleet_event.timer_end = "deliver_trophy_mission_timed_out"; + + _fleet_event.timer = 120; + + _targ_fleet.add_event(_fleet_event); + + reset_popup_options(); +} + + +///@mixin FleetEvent +function deliver_trophy_mission_timed_out(){ + scr_popup( + "Objective Forgotten", + $"It has been so long in the life of a mortal that the commanders that once saught your delivery of the trophy from the hunt on {fleetevent_data.system} have now all either died or moved to greener pastures. The trophy will instead remain in the chapters possession", + ); +} + +///@mixin FleetEvent +function deliver_trophy_mission_fleet_destroyed(){ + scr_popup( + "Fleet Destroyed", + $"With the Imperial Navy fleet containing the regiments from {fleetevent_data.system} destroyed there is no reason to now deliver the trophy from the hunt to them The trophy will instead remain in the chapters possession", + ); +} + +function get_beast_epithet(_planet_type){ + switch (_planet_type){ + case "Feudal": return "The King-Slayer"; + case "Ice": return "The Pale Reaper"; + case "Death": return "The Emperor’s Fang"; + } + return ""; +} + + + +///@mixin FleetEvent +function deliver_trophy_end_turn_check(){ + var _navy_fleet = get_fleet_uid(fleet_uid); + if (!instance_exists(_navy_fleet)){ + deliver_trophy_mission_fleet_destroyed(); + return; + } + + var _ratio =0; + with (_navy_fleet){ + _ratio = fleet_remaining_guard_ratio(); + } + + if (_ratio<=0){ + scr_popup( + "Regiments Destroyed ", + $"The guard Regiments from {fleetevent_data.system} serving in the imperial navy fleet have been annihilated wholesale there is no reason to now deliver the trophy from the hunt to them The trophy will instead remain in the chapters possession", + ); + return; + } + + if (is_orbiting(_navy_fleet)){ + var _nearest_player = instance_at_location(_navy_fleet.x,_navy_fleet.y,obj_p_fleet); + if (instance_exists(_nearest_player)){ + var _ships = fleet_full_ship_array(_nearest_player); + var _marine = fetch_unit_uid(fleetevent_data.trophy_owner); + var _present = _marine.is_at_location("", 0, _ships); + var _meet_point = _navy_fleet.orbiting; + if (_present){ + var _text = "{_marine.role(name)} is able to rendevous with the imperial navy at {_meet_point.name}." + _text += $" The guard regiments of {fleetevent_data.system} are overjoyed at the delivery of the trophy and find the beast that the head came from adorns many of the regiments banners."; + var _marine_epithet = get_beast_epithet(fleetevent_data.planet_type); + _text += $" While The task is for the most part thankless your chapters esteem has risen greatly with the exploits of {_marine.name_role()} spreading far and wide amoung guard regiments and has garnered the epithet {_marine_epithet}."; + var _roll = roll_dice_chapter(1, 100, "high"); + if (_roll>30 && _roll<70){ + //TODO would be cool to have this changed to be a guard specific piece of equipment + _text += "In return for your labour and in honour of your chapter the commander of the guard division has a brand new Rhino destined for the army diverted to your chapter"; + scr_add_vehicle("Rhino"); + } else if (_roll>=70 ){ + var _wanted_types = ["Ice","Desert","Agri","Lava","Death"]; + var _star = scr_get_stars(true,[],_wanted_types)[0]; + _text += "During the concourse that follows with the fleet command your marines learn of a old battle ground discovered on {_star.name}."; + _text += "According too intel it appeared to be an old astartes battle ground from an unknown age, communications have been passed onto the adeptus mechanicus who will no doubt pick the site clean should they reach it before you do"; + + var _planet = scr_get_planet_with_type(_wanted_types); + var _battle_ground = new NewPlanetFeature(P_features.OldBattleGround); + + _battle_ground.player_hidden = false; + + _battle_ground.imperium_known = true; + + _star.add_feature(_planet,_battle_ground); + } + scr_popup( + "Trophy Delivered ", + _text, + ); + } + } + } +} + //TODO allow most of these functions to be condensed and allow arrays of problems or planets and maybe increase filtering options //filtering options could be done via universal methods that all the filters to be passed to many other game systems @@ -672,7 +928,7 @@ function remove_planet_problem(planet, problem, star="none"){ if (star=="none"){ for (var i = 0;i0){ - p_tyranids[ork_attack_planet] -= floor(_ork_fleet.capital_number+(_ork_fleet.frigate_number/2)); + p_tyranids[ork_attack_planet] -= round(standard_fleet_strength_calc(_ork_fleet)); var _pdata = new PlanetData(ork_attack_planet, self); diff --git a/scripts/scr_planetary_feature/scr_planetary_feature.gml b/scripts/scr_planetary_feature/scr_planetary_feature.gml index a793501f93..9893ffe50b 100644 --- a/scripts/scr_planetary_feature/scr_planetary_feature.gml +++ b/scripts/scr_planetary_feature/scr_planetary_feature.gml @@ -26,7 +26,8 @@ enum P_features { Forge, Gene_Stealer_Cult, Mission, - OrkStronghold + OrkStronghold, + OldBattleGround }; @@ -60,16 +61,25 @@ function NewPlanetFeature(feature_type, other_data={}) constructor{ hiding=true; name = global.name_generator.generate_genestealer_cult_name(); break; - case P_features.Necron_Tomb: + case P_features.Necron_Tomb: awake = 0; sealed = 0; - player_hidden = 1 + player_hidden = 1; planet_display = "Dormant Necron Tomb"; break; - + case P_features.OldBattleGround: + player_hidden = true; + imperium_known = false; + //This is janky but we have no way of defining non player astartes + faction1 = "astartes"; + faction2 = "imperium"; + explore_size = irandom_range(1000, 10000); + explored = 0; + planet_display = "Old Battle Ground"; + break; case P_features.Secret_Base: base_type = base_types.Lair; - inquis_hidden =1; + inquis_hidden = 1; planet_display = "Hidden Secret Base"; player_hidden = 0; style = "UTL"; @@ -227,7 +237,9 @@ function system_feature_bool(system, search_feature){ for (var sys =1; sys<5; sys++){ sys_bool = planet_feature_bool(system[sys], search_feature) if (sys_bool==1){ - break;} + sys_bool = sys; + break; + } } return sys_bool; } @@ -372,6 +384,11 @@ function scr_planetary_feature(planet_num) { case P_features.OrkWarboss: var lop=$"Ork Warboss discovered on {numeral_n}."; scr_alert("red","feature",lop,x,y); + scr_event_log("red",lop); + break; + case P_features.OldBattleGround: + var lop=$"Old Battle Ground discovered on {numeral_n}."; + scr_alert("green","feature",lop,x,y); scr_event_log("red",lop); break; } 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 47c4b41318..234a77c5e2 100644 --- a/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml +++ b/scripts/scr_player_fleet_functions/scr_player_fleet_functions.gml @@ -31,6 +31,14 @@ function init_player_fleet_arrays(){ ship_turrets=[]; ship_lost = []; } + +function get_player_fleet_intercept_time(star,time_abundance){ + var _travel = -1 + var _nearest_player_fleet = instance_nearest(star.x, star.y, obj_p_fleet); + if (instance_exists(_nearest_player_fleet)){ + _travel = get_viable_travel_time(time_abundance, _nearest_player_fleet.x, _nearest_player_fleet.y, star.x, star.y, _nearest_player_fleet, false); + } +} function fleet_has_roles(fleet="none", roles){ var all_ships = fleet_full_ship_array(fleet); var unit; @@ -40,7 +48,6 @@ function fleet_has_roles(fleet="none", roles){ if (unit.planet_location<1){ if (array_contains(all_ships,unit.ship_location)){ if (array_contains(roles, unit.role())){ - return true; } } @@ -239,10 +246,7 @@ function delete_ship_from_fleet(index, fleet){ } } function set_player_fleet_image(){ - var ii=0; - ii+=capital_number; - ii+=round((frigate_number/2)); - ii+=round((escort_number/4)); + var ii=round(standard_fleet_strength_calc()) if (ii<=1) then ii=1; image_index=min(ii,9); } diff --git a/scripts/scr_purge_world/scr_purge_world.gml b/scripts/scr_purge_world/scr_purge_world.gml index b81a2eae37..c624797d0d 100644 --- a/scripts/scr_purge_world/scr_purge_world.gml +++ b/scripts/scr_purge_world/scr_purge_world.gml @@ -1,109 +1,127 @@ -function scr_purge_world(star, planet, action_type, action_score) { - - var pop_before,pop_after,sci1,sci2,txt1,txt2, max_kill, overkill, heres_before, heres_after, kill; - var isquest,thequest,questnum;isquest=0;thequest="";questnum=0;pop_after=0;txt1="";txt2="";overkill=0; +function scr_purge_world(action_type, action_score) { + + var population_reduction_percentage,influence_reduction, max_kill, heres_before, heres_after, kill; + var isquest=0,thequest="",questnum=0,pop_after=0,txt1="",txt2="",overkill=0; + + + var _pop_before = population; + var _no_chaos = (planet_forces[eFACTION.Heretics] + planet_forces[eFACTION.Chaos])==0 + if ((action_type==DropType.PurgeFire || action_type==DropType.PurgeSelective) && _no_chaos && obj_controller.turn>=obj_controller.chaos_turn){ + if (has_feature(P_features.Warlord10) && obj_controller.known[10]=0 && obj_controller.faction_gender[10]=1){ + with(obj_drop_select){ + var pop=instance_create(0,0,obj_popup); + pop.image="chaos_symbol"; + pop.title="Concealed Heresy"; + pop.text=$"Your astartes set out and begin to cleanse {planet_numeral_name(planet, star)} of possible heresy. The general populace appears to be devout in their faith, but a disturbing trend appears- the odd citizen cursing your forces, frothing at the mouth, and screaming out heresy most foul. One week into the cleansing a large hostile force is detected approaching and encircling your forces."; + exit; + } + } + if (has_feature(P_features.Warlord10) && obj_controller.known[10]>=2 && obj_controller.faction_gender[10]=1){ + with(obj_drop_select){ + + attacking=10; + obj_controller.cooldown=30; + combating=1;// Start battle here + + instance_deactivate_all(true); + instance_activate_object(obj_controller); + instance_activate_object(obj_ini); + instance_activate_object(obj_drop_select); + + instance_create(0,0,obj_ncombat); + obj_ncombat.battle_object=p_target; + obj_ncombat.battle_loc=p_target.name; + obj_ncombat.battle_id=obj_controller.selecting_planet; + obj_ncombat.dropping=0; + obj_ncombat.attacking=10; + obj_ncombat.enemy=10; + obj_ncombat.formation_set=1; + + obj_ncombat.leader=1; + obj_ncombat.threat=5; + obj_ncombat.battle_special="WL10_later"; + scr_battle_allies(); + setup_battle_formations(); + roster.add_to_battle(); + } + } + } + var heres_before = max(total_corruption(),population_influences[eFACTION.Tau],population_influences[eFACTION.Tyranids]);// Starting heresy + var heres_target = "corruption"; - if ((action_type==DropType.PurgeFire) or (action_type==DropType.PurgeSelective)) and (star.p_traitors[planet]=0) and (star.p_chaos[planet]=0) and (obj_controller.turn>=obj_controller.chaos_turn){ - if (planet_feature_bool(star.p_feature[planet],P_features.Warlord10) == 1) and (obj_controller.known[10]=0) and (obj_controller.faction_gender[10]=1) then with(obj_drop_select){ - var pop=instance_create(0,0,obj_popup); - pop.image="chaos_symbol"; - pop.title="Concealed Heresy"; - pop.text=$"Your astartes set out and begin to cleanse {planet_numeral_name(planet, star)} of possible heresy. The general populace appears to be devout in their faith, but a disturbing trend appears- the odd citizen cursing your forces, frothing at the mouth, and screaming out heresy most foul. One week into the cleansing a large hostile force is detected approaching and encircling your forces."; - exit; - } - if (planet_feature_bool(star.p_feature[planet],P_features.Warlord10) == 1) and (obj_controller.known[10]>=2) and (obj_controller.faction_gender[10]=1) then with(obj_drop_select){ - - attacking=10; - obj_controller.cooldown=30;combating=1;// Start battle here - - instance_deactivate_all(true); - instance_activate_object(obj_controller); - instance_activate_object(obj_ini); - instance_activate_object(obj_drop_select); - - instance_create(0,0,obj_ncombat); - obj_ncombat.battle_object=p_target; - obj_ncombat.battle_loc=p_target.name; - obj_ncombat.battle_id=obj_controller.selecting_planet; - obj_ncombat.dropping=0; - obj_ncombat.attacking=10; - obj_ncombat.enemy=10; - obj_ncombat.formation_set=1; - - /* - obj_ncombat.battle_object=p_target; - obj_ncombat.battle_loc=p_target.name; - obj_ncombat.battle_id=obj_controller.selecting_planet; - obj_ncombat.dropping=1-attack; - obj_ncombat.attacking=attack; - obj_ncombat.enemy=attacking; - obj_ncombat.formation_set=formation_possible[formation_current]; - */ - - obj_ncombat.leader=1; - obj_ncombat.threat=5; - obj_ncombat.battle_special="WL10_later"; - scr_battle_allies(); - setup_battle_formations(); - roster.add_to_battle(); - } + if (max(population_influences[eFACTION.Tau],population_influences[eFACTION.Tyranids]) > total_corruption()){ + if (population_influences[eFACTION.Tau]>population_influences[eFACTION.Tyranids]){ + heres_target = "tau"; + } else{ + heres_target = "genestealers"; + } + } // TODO - while I don't expect Surface to Orbit weapons retaliating against player's purge bombardment, it might still be worthwhile to consider possible situations if (action_type=DropType.PurgeBombard){// Bombardment - txt1=choose("Your cruiser and larger ship", "The heavens rumble and thunder as your ship"); - if (ships_selected>1) then txt1+="s"; + var _ship = string_plural("ship",ships_selected); + txt1=choose($"Your cruiser and larger {_ship}", $"The heavens rumble and thunder as your {_ship}"); txt1+=choose(" position themselves over the target in close orbit, and unleash", " unload"); - if (ships_selected=1) then txt1+="s"; - txt1+= $" annihilation upon {planet_numeral_name(planet, star)}. Even from space the explosions can be seen, {choose("tearing ground", "hammering", "battering", "thundering")} across the planet's surface."; - - if (star.p_large[planet]=0) then max_kill=action_score*15000000; - if (star.p_large[planet]=1) then max_kill=action_score*0.015;// Population if large - - pop_before=star.p_population[planet]; - - heres_before=max(star.p_heresy[planet]+star.p_heresy_secret[planet],star.p_influence[planet][eFACTION.Tau]);// Starting heresy + var _adjective = choose("tearing ground", "hammering", "battering", "thundering"); + txt1+= $" annihilation upon {name()}. Even from space the explosions can be seen, {_adjective} across the planet's surface."; + + max_kill = population_small_conversion(0.015) * max_kill; // Minimum kills - if (pop_before>0) then overkill=max(pop_before*0.1,((heres_before/200)*pop_before)); - if (pop_before=0) then overkill=0; + overkill=max(_pop_before*0.1,((heres_before/200)*_pop_before)); + - kill=min(max_kill,overkill,pop_before);// How many people ARE going to be killed + kill=min(max_kill,overkill,_pop_before);// How many people ARE going to be killed - pop_after=pop_before-kill; - sci1=0;sci2=0; + pop_after=max(_pop_before-kill,0); + population_reduction_percentage=0; + influence_reduction=0; - if (pop_before>0) then sci1=(pop_after/pop_before)*100;// Relative % of people murderized - if (sci1>0) then sci2=min((sci1*2),action_score*2);// How much hurresy to get rid of - heres_after=heres_before-sci2; - if (pop_before>0) and (pop_after=0) then heres_after=0; + population_reduction_percentage=(pop_after/_pop_before)*100;// Relative % of people murderized + + if (population_reduction_percentage>0){ + influence_reduction=min((population_reduction_percentage*2),action_score*2);// How much hurresy to get rid of + } + heres_after=heres_before-influence_reduction; + - if (star.p_large[planet]=0) then pop_after=round(pop_after); - if (pop_after<=0) and (pop_before>0) then heres_after=0; + if (!population_large){ + pop_after=round(pop_after); + } + - var _displayed_population = star.p_large[planet] == 1 ? $"{pop_before} billion" : scr_display_number(floor(pop_before)); - var _displayed_killed = star.p_large[planet] == 1 ? $"{kill} billion" : scr_display_number(floor(kill)); - txt1 += $"##The world had {_displayed_population} Imperium subjects. {_displayed_killed} were purged over the duration of the bombardment.##Heresy has fallen down to {max(0, heres_after)}%."; + var _displayed_population = display_population(); + var _displayed_killed = large_population ? $"{kill} billion" : scr_display_number(floor(kill)); + txt1 += $"\n\nThe world had {_displayed_population} Imperium subjects. {_displayed_killed} were purged over the duration of the bombardment.\n\nHeresy has fallen down to {max(0, heres_after)}%."; if (pop_after<=0){ - if (star.p_owner[planet]=2) and (obj_controller.faction_status[2]!="War"){ - if (star.p_type[planet]="Temperate" || star.p_type[planet]="Hive" || star.p_type[planet]="Desert"){ + if (current_owner=2 && obj_controller.faction_status[2]!="War"){ + if (planet_type="Temperate" || planet_type="Hive" || planet_type="Desert"){ var _disp_hit = -10; - if (star.p_type[planet]="Temperate") then _disp_hit = -5; - if (star.p_type[planet]="Desert") then _disp_hit = -3; + if (planet_type="Temperate"){ + _disp_hit = -5; + } + if (planet_type="Desert"){ + _disp_hit = -3; + } scr_audience(eFACTION.Imperium, "bombard_angry", _disp_hit, "", 0, 0); } } } - if (star.p_owner[planet]=3) and (obj_controller.faction_status[3]!="War"){ + if (current_owner=3 && obj_controller.faction_status[3]!="War"){ - if (star.p_type[planet]="Forge") then _disp_hit =-15; - if (star.p_type[planet]="Ice") then _disp_hit =-7; + if (planet_type="Forge"){ + _disp_hit =-15; + } + if (planet_type="Ice"){ + _disp_hit =-7; + } scr_audience(eFACTION.Inquisition, "bombard_angry", _disp_hit, "", 0, 0); } @@ -114,55 +132,61 @@ function scr_purge_world(star, planet, action_type, action_score) { if (action_type=DropType.PurgeFire){// Burn baby burn var i=0; - if (has_problem_planet(planet, "cleanse", star)){ + if (has_problem("cleanse")){ isquest=1; thequest="cleanse"; questnum=i; } if (isquest=1){ - if (thequest="cleanse") and (action_score>=20){ + if (thequest="cleanse" && action_score>=20){ remove_planet_problem(planet,thequest,star); + + alter_disposition(eFACTION.Inquisition,obj_controller.demanding ? choose(0,0,1) :1); - if (obj_controller.demanding=0) then obj_controller.disposition[4]+=1; - if (obj_controller.demanding=1) then obj_controller.disposition[4]+=choose(0,0,1); - - txt1="Your marines scour the underhive of "+string(star.name)+" "+string(planet)+", spraying mutants down with promethium as they go. It takes several days but a sizeable dent is put in their numbers."; - scr_event_log("","Inquisition Mission Completed: The mutants of "+string(star.name)+" "+string(scr_roman(planet))+" have been cleansed by promethium."); - scr_gov_disp(star.name,planet,choose(1,2,3)); + txt1="Your marines scour the underhive of {name()}, spraying mutants down with promethium as they go. It takes several days but a sizeable dent is put in their numbers."; + scr_event_log("","Inquisition Mission Completed: The mutants of {name()} have been cleansed by promethium."); + add_disposition(choose(1,2,3)); } }else if (isquest=0){ // TODO add more variation, with planets, features, marine equipment perhaps? txt1=choose( - $"Timing their visits right, Your forces scour {star.name} {planet} burning down whatever the local heretic communities call their homes. Their screams were quickly extinguished by fire, turning whatever it was before, into ash.", - $"Your forces scour {star.name} {planet}, burning homes and towns that reek of heresy. The screams and wails of the damned carry through the air." - ); - - if (star.p_large[planet]=0) then max_kill=action_score*12000;// Population if normal - if (star.p_large[planet]=1) then max_kill=action_score*0.0000012;// Population if large - - pop_before=star.p_population[planet]; - - heres_before=max(star.p_heresy[planet]+star.p_heresy_secret[planet],star.p_influence[planet][eFACTION.Tau]);// Starting heresy + $"Timing their visits right, Your forces scour {name()} burning down whatever the local heretic communities call their homes. Their screams were quickly extinguished by fire, turning whatever it was before, into ash.", + $"Your forces scour {name()}, burning homes and towns that reek of heresy. The screams and wails of the damned carry through the air." + ); + + max_kill = population_large_conversion(12000) *action_score; // Minimum kills - if (pop_before>0) then overkill=min(pop_before*0.01,((heres_before/200)*pop_before)); - if (pop_before=0) then overkill=0; + overkill=min(_pop_before*0.01,((heres_before/200)*_pop_before)); - kill=min(max_kill,overkill,pop_before);// How many people ARE going to be killed + kill=min(max_kill,overkill,_pop_before);// How many people ARE going to be killed - if (star.p_large[planet]=0) then pop_after=pop_before-kill; - if (star.p_large[planet]=1) then pop_after=pop_before; + if (!population_large){ + pop_after=max(_pop_before-kill,0); + } + if (large_population){ + pop_after=_pop_before; + } - sci1=0;sci2=0; - if (pop_before>0) then sci1=(pop_after/pop_before)*100;// Relative % of people murderized - if (sci1>0) then sci2=min((sci1*2),round(action_score/25));// How much hurresy to get rid of - heres_after=heres_before-sci2; - if (pop_before>0) and (pop_after=0) then heres_after=0; - - var nid_influence = star.p_influence[planet][eFACTION.Tyranids]; - if (planet_feature_bool(star.p_feature[planet], P_features.Gene_Stealer_Cult)) { - var cult = return_planet_features(star.p_feature[planet], P_features.Gene_Stealer_Cult)[0]; - if (cult.hiding) {} + population_reduction_percentage=0; + influence_reduction=0; + if (_pop_before>0) { + population_reduction_percentage=(pop_after/_pop_before)*100;// Relative % of people murderized + } + if (population_reduction_percentage>0){ + influence_reduction=min((population_reduction_percentage*2),round(action_score/25));// How much hurresy to get rid of + } + heres_after=heres_before-influence_reduction; + if (_pop_before>0 && pop_after=0) { + heres_after=0; + } + + var nid_influence = population_influences[eFACTION.Tyranids]; + if (has_feature( P_features.Gene_Stealer_Cult)) { + var cult = get_features(P_features.Gene_Stealer_Cult)[0]; + if (cult.hiding) { + + } } else { if (nid_influence > 25) { txt1 += " Scores of mutant offspring from a genestealer infestation are burnt, while we have damaged their influence over this world, the mutants appear to lack the organisation of a true cult"; @@ -171,10 +195,15 @@ function scr_purge_world(star, planet, action_type, action_score) { txt1 += " There are signs of a genestealer infestation but the cultists are too unorganized to do any real damage to their influence on this world"; } } - if (star.p_large[planet]=0) then pop_after=round(pop_after); - if (pop_after<=0) and (pop_before>0) then heres_after=0; - if (star.p_large[planet]=0) then txt1+="##The planet had a population of "+string(scr_display_number(floor(pop_before)))+" and "+string(scr_display_number(floor(kill)))+" were purged over the duration of the cleansing.##Heresy has fallen down to "+string(max(0,heres_after))+"%."; - if (star.p_large[planet]=1) then txt1+="##The planet had a population of "+string(pop_before)+" billion and "+string(scr_display_number(action_score*12000))+" were purged over the duration of the cleansing.##Heresy has fallen down to "+string(max(0,heres_after))+"%."; + if (!population_large){ + pop_after=round(pop_after); + } + + if (!population_large){ + txt1+="\n\nThe planet had a population of "+string(scr_display_number(floor(_pop_before)))+" and "+string(scr_display_number(floor(kill)))+" were purged over the duration of the cleansing.\n\nHeresy has fallen down to "+string(max(0,heres_after))+"%."; + }else { + txt1+="\n\nThe planet had a population of "+string(_pop_before)+" billion and "+string(scr_display_number(action_score*12000))+" were purged over the duration of the cleansing.\n\nHeresy has fallen down to "+string(max(0,heres_after))+"%."; + } } } @@ -188,161 +217,88 @@ function scr_purge_world(star, planet, action_type, action_score) { } if (isquest=1){ - if (thequest="purge") and (action_score>=10){ + if (thequest="purge" && action_score>=10){ remove_planet_problem(planet, "purge", star); - if (obj_controller.demanding=0) then obj_controller.disposition[4]+=1; - if (obj_controller.demanding=1) then obj_controller.disposition[4]+=choose(0,0,1); + alter_disposition(eFACTION.Inquisition,obj_controller.demanding ? choose(0,0,1) :1); txt1="Your marines drop fast and hard, blowing through guards and mercenaries with minimal resistance. Before ten minutes have passed all your targets are executed."; - scr_event_log("","Inquisition Mission Completed: The unruly Nobles of "+string(star.name)+" "+string(scr_roman(planet))+" have been purged."); - scr_gov_disp(star.name,planet,choose(1,2,3)); + scr_event_log("","Inquisition Mission Completed: The unruly Nobles of {name()} have been purged."); + add_disposition(choose(1,2,3)); } } else if (isquest=0){ // TODO add more variation, with planets, features, possibly marine equipment txt1=choose( $"Your marines move across {star.name} {scr_roman(planet)}, searching for high profile targets. Once found, they are dragged outside from their lairs. Their execution would soon follow.", $"Your marines move across {star.name} {scr_roman(planet)}, rooting out sources of corruption. Heretics are dragged from their lairs and executed in the streets." - ); + ); - if (star.p_large[planet]=0) then max_kill=action_score*30;// Population if normal - if (star.p_large[planet]=1) then max_kill=0;// Population if large - - pop_before=star.p_population[planet]; + if (!population_large) { + max_kill=action_score*30;// Population if normal + } + if (large_population) { + max_kill=0;// Population if large + } - heres_before=max(star.p_heresy[planet]+star.p_heresy_secret[planet],star.p_influence[planet][eFACTION.Tau]);// Starting heresy + _pop_before=population; // Minimum kills - kill=min(action_score*30,pop_before);// How many people ARE going to be killed + kill=min(action_score*30,_pop_before);// How many people ARE going to be killed - if (star.p_large[planet]=0) then pop_after=pop_before-kill; - sci2=round(action_score/50); - heres_after=heres_before-sci2; - if (pop_before>0) and (pop_after=0) then heres_after=0; + if (!population_large) { + pop_after=max(_pop_before-kill,0); + } + influence_reduction=round(action_score/50); + heres_after=heres_before-influence_reduction; + if (_pop_before>0 && pop_after=0) { + heres_after=0; + } - if (star.p_large[planet]=0) then pop_after=round(pop_after); - if (pop_after<=0) and (pop_before>0) then heres_after=0; - if (star.p_large[planet]=0) then txt1+="##The planet had a population of "+string(scr_display_number(floor(pop_before)))+" and "+string(scr_display_number(floor(kill)))+" die over the duration of the search.##Heresy has fallen to "+string(max(0,heres_after))+"%."; - if (star.p_large[planet]=1) then txt1+="##The planet had a population of "+string(pop_before)+" billion and "+string(action_score*30)+" die over the duration of the search.##Heresy has fallen to "+string(max(0,heres_after))+"%."; + if (!population_large) { + pop_after=round(pop_after); + } + + if (!population_large) { + txt1+=$"\n\nThe planet had a population of "+string(scr_display_number(floor(_pop_before)))+" and "+string(scr_display_number(floor(kill)))+" die over the duration of the search.\n\nHeresy has fallen to "+string(max(0,heres_after))+"%."; + } + if (large_population) { + txt1+=$"\n\nThe planet had a population of {_pop_before} billion and {action_score*30} die over the duration of the search.\n\nHeresy has fallen to "+string(max(0,heres_after))+"%."; + } } } if (action_type=DropType.PurgeAssassinate){ - var aroll=roll_dice_chapter(1, 100, "high"); - var chance = 100; - // var siz_penalty=0; - var o=0; - var yep=0; - - // Disposition - aroll += floor(star.dispo[planet] / 10); - - // Advantages - if(scr_has_adv("Ambushers")) then aroll+=10; - if(scr_has_adv("Lightning Warriors")) then aroll+=5; - - // Size - unused - // if ((action_score > 5) && (action_score <= 10)) { siz_penalty = 5; } - // if ((action_score > 10) && (action_score <= 20)) { siz_penalty = 20; } - // if ((action_score > 20) && (action_score <= 50)) { siz_penalty = 30; } - // if ((action_score > 50) && (action_score <= 100)) { siz_penalty = 50; } - // if ((action_score > 100) && (action_score <= 200)) { siz_penalty = 75; } - // if (action_score > 200) { siz_penalty = 125; } - - var spec1=0,spec2=0,txt=""; // TODO consider making it a battle with Planetary governor's guards - txt="Your Astartes descend upon the surface of "+string(star.name)+" "+string(scr_roman(planet))+" and plot the movements and schedule of the governor. "; - txt+="Once the time is right their target is ambushed "+choose("in their home","in the streets","while driving","taking a piss")+" and tranquilized. "; - - if(scr_has_disadv("Never Forgive")) then spec1=1; - if (global.chapter_name="Space Wolves" || obj_ini.progenitor == ePROGENITOR.SPACE_WOLVES) { spec1=3; } - if (global.chapter_name="Iron Hands" || obj_ini.progenitor == ePROGENITOR.IRON_HANDS) { spec1=6; } - if (obj_ini.omophagea=1) then spec1=choose(spec1,20); - - if (spec1=1) then txt+="They are brought to the already-prepared facilities for Fallen, tortured to make "+string(choose("him","him","her"))+" appear a heretic, and then incinerated. "; - if (spec1=3) then txt+=string(choose("He","He","She"))+" is tossed to the Fenrisian Wolves and viciously mauled, torn apart, and eaten. The beasts leave nothing but bloody scraps. "; - if (spec1=6) then txt+=string(choose("He","He","She"))+" is stuck in with the other criminals, and scum, to be turned into a servitor. Soon nothing remains that could be likened to the former Governor. "; - if (spec1=20){ - if (action_score>1) then txt+="Things get out of hand, and the Governor is torn limb from limb and consumed. "+string(choose("His","His","Her"))+" flesh is torn off and eaten, bone pulverized, and marrow sucked free. "; - if (action_score=1) then txt+="Your battle brother chops apart the Governor and eats a sizeable portion of "+string(choose("his","his","her"))+" flesh, focusing upon the eyes, teeth, and fingers. Once full the rest is disposed of. "; - } - - if (spec1=0){ - spec2=choose(1,2,3,4,5,5,5); - if (spec2=1) then txt+="Their still-living body is disintegrated by acid. "; - if (spec2=2) then txt+="The Governor is jettisoned into the local star at the first opporunity. "; - if (spec2=3) then txt+=string(choose("He","He","She"))+" is burned as fuel for one of your vessels. "; - if (spec2=4) then txt+="A few grenades is all it takes to blow "+string(choose("his","his","her"))+" body to smithereens. "; - if (spec2=5) then txt+=string(choose("He","He","She"))+" is executed in a mundane fashion and buried. "; - } - - txt+="What is thy will?"; - - var pip=instance_create(0,0,obj_popup); - pip.title="Planetary Governor Assassinated"; - pip.text=txt; - pip.planet=planet; - pip.p_data = new PlanetData(planet,star); - var options = [ - { - str1 : "Allow the official successor to become Planetary Governor.", - choice_func : allow_governor_successor, - }, - { - str1 : "Ensure that a sympathetic successor will be the one to rule.", - choice_func : install_sympathetic_successor, - }, - { - str1 : "Remove all successors and install a loyal Chapter Serf.", - choice_func : install_chapter_surf, - }, - ] - pip.add_option(options); - pip.cooldown=20; - - // Result- this is the multiplier for the chance of discovery with the inquisition, can also be used to determine - // the new Governor disposition if they are the official successor - if (aroll < chance){// Discovered - pip.estimate=2; - } else if (aroll >= chance){// Success - pip.estimate=1; - } - // If there are enemy non-chaos forces then they may be used as a cover - // Does not work with chaos because if the governor dies, with chaos present, the new governor would possibly be investigated - if (star.p_orks[planet]>=4) or (star.p_necrons[planet]>=3) or (star.p_tyranids[planet]>=5){ - pip.estimate=pip.estimate*0.5; - } + assasinate_governor_setup(); } - - - - - - - - if (action_type!=DropType.PurgeAssassinate){ if (isquest=0){// DO EET txt2=txt1; - star.p_heresy[planet]-=sci2; - star.p_influence[planet][eFACTION.Tau]-=sci2; - if (action_type5) then exit;// Frequency of events if ((turn-15) 1500){ + luck_roll+=20; + } + else if (obj_controller.marines > 1000){ + luck_roll+=10; + } + else if (obj_controller.marines > 500){ + luck_roll+=5; + }else if (obj_controller.marines <500){ + luck_roll-=5; + } + if (luck_roll<=45) then player_luck=luck.good; if (luck_roll>45) and (luck_roll<55) then player_luck=luck.neutral; if (luck_roll>=55) then player_luck=luck.bad; @@ -82,11 +96,11 @@ function scr_random_event(execute_now) { [ EVENT.warp_storms, EVENT.enemy_forces, - EVENT.crusade, // Reportly breaks often because of lack of imperial fleets and eats player ships // TODO LOW CRUSADE_EVENT // fix + EVENT.crusade, EVENT.enemy, // Save-scumming event, Should probably base this on something else than tech-scavs EVENT.mutation, EVENT.ship_lost, // Another save-scumming event, mainly due to rarity of player ships - //EVENT.chaos_invasion, // Spawns Chaos fleets way too close to player owned worlds with no warning and usually lots of big ships, save-scum galore and encourages fleet-based chapters // TODO LOW INVASION_EVENT // Make them spawn way farther with more warning, make them have a different goal or remove this event entirely + EVENT.chaos_invasion, EVENT.necron_awaken, // Inquisitor check for this is inverted EVENT.fallen, // Event mission cannot be completed and never expires // TODO LOW FALLEN_EVENT // fix ]; @@ -122,7 +136,7 @@ function scr_random_event(execute_now) { } break; case EVENT.mechanicus_mission: - if (known[eFACTION.Mechanicus] == 0 || obj_controller.disposition[3] < 50 || obj_controller.faction_status[eFACTION.Mechanicus] == "War") { + if (known[eFACTION.Mechanicus] == 0 || obj_controller.disposition[3] < 40 || obj_controller.faction_status[eFACTION.Mechanicus] == "War") { events_share[i] -= 1; events_total -= 1; } @@ -132,10 +146,7 @@ function scr_random_event(execute_now) { } break; case EVENT.enemy: - if(scr_has_adv("Scavangers")){ - events_share[i] += 2; - events_total += 2; - } + break; case EVENT.mutation: if(gene_seed < 5){ @@ -275,36 +286,7 @@ function scr_random_event(execute_now) { } else if (chosen_event == EVENT.promotion){ - log_message("RE: Promotion"); - var marine_and_company = scr_random_marine([obj_ini.role[100][8],obj_ini.role[100][12],obj_ini.role[100][9],obj_ini.role[100][10]],0); - if(marine_and_company == "none") - { - log_error("RE: Promotion, couldn't pick a space marine"); - exit; - } - var marine=marine_and_company[1]; - var company=marine_and_company[0]; - var _unit = obj_ini.TTRPG[company][marine]; - var role=_unit.role(); - var text = _unit.name_role(); - var company_text = scr_convert_company_to_string(company); - //var company_text = scr_company_string(company); - if(company_text != ""){ - company_text = "("+company_text+")"; - } - text += company_text; - text += " has distinguished himself.##He åis up for review to be promoted."; - - if (company != 10){ - _unit.add_exp(10); - } - else { - _unit.add_exp(max(20, _unit.experience)); - } - - scr_popup("Promotions!",text,"distinguished",""); - scr_event_log("green",text); - _evented = true; + _evented = init_marine_distinguishment_event() } else if (chosen_event == EVENT.strange_building){ @@ -659,11 +641,11 @@ function scr_random_event(execute_now) { log_error("RE: Enemy Forces, couldn't find a planet in the " + star_id.name +" system for the enemy"); exit; } - var planet = eligible_planets[irandom(array_length(eligible_planets) - 1)]; + var planet = array_random_element(eligible_planets); //var enemy = choose(7,8,9,10,13); var enemy = choose(7,8,9); var text; - var max_enemies_on_planet = 5; // I don't know the actual value, i need to change it; + var max_enemies_on_planet = 6; // I don't know the actual value, i need to change it; switch(enemy) { case 7: @@ -681,22 +663,22 @@ function scr_random_event(execute_now) { star_id.p_tyranids[planet] += 5; star_id.p_tyranids[planet] = min(star_id.p_tyranids[planet], max_enemies_on_planet); break; - //case 10: this doesn't work - // text = "Heretics"; - // star_id.p_heretics[planet] = 4; - // star_id.p_heretics[planet] = min(star_id.p_heretics[planet], max_enemies_on_planet); - // break; - //case 13: - // text = "Necron"; // I don't know if its a good idea to spawn necrons from this event, leaving it in for now - // star_id.p_necron[planet] = 4; - // star_id.p_necron[planet] = min(star_id.p_necron[planet], max_enemies_on_planet); - // break; + case 10: + text = "Heretics"; + star_id.p_heretics[planet] = 4; + star_id.p_heretics[planet] = min(star_id.p_heretics[planet], max_enemies_on_planet); + break; + case 13: + text = "Necron"; // I don't know if its a good idea to spawn necrons from this event, leaving it in for now + star_id.p_necron[planet] = 4; + star_id.p_necron[planet] = min(star_id.p_necron[planet], max_enemies_on_planet); + break; default: log_error("RE: Enemy Forces, couldn't pick an enemy faction"); exit; } - scr_alert("red","enemy", $"{text} forces suddenly appear at {star_id.name} {planet}!",star_id.x,star_id.y); - scr_event_log("red",$"{text} forces suddenly appear at {star_id.name} {planet}!"); + scr_alert("red","enemy", $"A Space Hulk carrying {text} breaches Space and has crashed Into {star_id.name} {planet}!",star_id.x,star_id.y); + scr_event_log("red",$"A Space Hulk carrying {text} Space Hulk Crashes Into System {star_id.name} {planet}!"); _evented = true; } } @@ -711,47 +693,7 @@ function scr_random_event(execute_now) { } else if ((chosen_event == EVENT.mutation)) { - //TODO make reprocussions to ignoring this - log_message("RE: Gene-Seed Mutation"); - var text = "The Chapter's gene-seed has mutated! Apothecaries are scrambling to control the damage and prevent further contamination. What is thy will?"; - var _opt1 = "Dispose of "; - var _percent_remove = 0; - if (obj_controller.gene_seed <= 30) { - _opt1 += "100% of the gene-seed."; - _percent_remove = 100; - } - if ((obj_controller.gene_seed > 30) && (obj_controller.gene_seed < 60)) { - _opt1 += "50% of all gene-seed."; - _percent_remove = 50; - } - if (obj_controller.gene_seed >= 60) { - _opt1 += "33% of all gene-seed."; - _percent_remove = 33; - } - - var _opt2 = "Tell the apothecaries to let it be."; - - - var _pop_data = { - percent_remove : _percent_remove, - options : [ - { - str1:_opt1, - choice_func : event_dispose_of_mutated_gene, - }, - { - str1:_opt2, - choice_func : function(){ - scr_loyalty("Mutant Gene-Seed", "+"); - popup_default_close(); - } - }, - ] - } - - scr_popup("Gene-Seed Mutated!",text,"gene_bad",_pop_data); - _evented = true; - scr_event_log("red","The Chapter Gene-Seed has mutated."); + init_mutated_gene_random_event(); } else if (chosen_event == EVENT.ship_lost){ @@ -842,10 +784,13 @@ function event_fallen(){ log_error("RE: Hunt the Fallen, coulnd't assign a problem to the planet"); return; } + + var _planet = system_datas[planet]; + _planet.refresh_data(); - var text = "Sources indicate one of the Fallen may be upon "+string(star.name)+" "+string(scr_roman(planet))+". We have "+string(eta)+" months to send out a strike team and scour the planet. Any longer and any Fallen that might be there will have escaped."; + var text = $"Sources indicate one of the Fallen may be upon {_planet.name()} . We have {eta} months to send out a strike team and scour the planet. Any longer and any Fallen that might be there will have escaped."; scr_popup("Hunt the Fallen",text,"fallen",""); - scr_event_log("","Sources indicate one of the Fallen may be upon "+string(star.name)+" "+string(scr_roman(planet))+". We have "+string(eta)+" months to investigate."); + scr_event_log("",$"Sources indicate one of the Fallen may be upon {_planet.name()}. We have {eta} months to investigate."); var star_alert = instance_create(star.x+16,star.y-24,obj_star_event); star_alert.image_alpha=1; star_alert.image_speed=1; diff --git a/scripts/scr_recruit_data/scr_recruit_data.gml b/scripts/scr_recruit_data/scr_recruit_data.gml index e926978a58..c817a9dc30 100644 --- a/scripts/scr_recruit_data/scr_recruit_data.gml +++ b/scripts/scr_recruit_data/scr_recruit_data.gml @@ -192,7 +192,6 @@ function planet_training_sequence(local_apothecary_points) { var recruit_chance = 999; var aspirant = 0; var new_recruit_corruption = find_recruit_corruption(planet_type); - show_debug_message($"new_recruit_corruption: {new_recruit_corruption}"); var months_to_neo = 72; var dista = 0; var onceh = 0; diff --git a/scripts/scr_roman_numerals/scr_roman_numerals.gml b/scripts/scr_roman_numerals/scr_roman_numerals.gml index 203470c107..2850803ae0 100644 --- a/scripts/scr_roman_numerals/scr_roman_numerals.gml +++ b/scripts/scr_roman_numerals/scr_roman_numerals.gml @@ -20,7 +20,7 @@ function int_to_roman(_num) { return ""; } - var _roman_numerals = [ + static _roman_numerals = [ 100, "C", 90, "XC", 50, "L", 40, "XL", 10, "X", 9, "IX", 5, "V", 4, "IV", 1, "I" ]; @@ -39,3 +39,8 @@ function int_to_roman(_num) { return _result; } + + +function irandom_numeral(max_val){ + return int_to_roman(irandom_range(1, max_val)); +} \ No newline at end of file diff --git a/scripts/scr_save_controller/scr_save_controller.gml b/scripts/scr_save_controller/scr_save_controller.gml index 787a93951b..d843523f49 100644 --- a/scripts/scr_save_controller/scr_save_controller.gml +++ b/scripts/scr_save_controller/scr_save_controller.gml @@ -219,12 +219,6 @@ function scr_save_controller(save_id){ } // var g;g=0; - repeat(50){g+=1; - ini_write_string("Ongoing","quest"+string(g),obj_controller.quest[g]); - ini_write_real("Ongoing","quest_faction"+string(g),obj_controller.quest_faction[g]); - ini_write_real("Ongoing","quest_end"+string(g),obj_controller.quest_end[g]); - } - var g;g=0; // ini_write_real("Controller","justmet",obj_controller.faction_justmet); ini_write_real("Controller","check_number",obj_controller.check_number); diff --git a/scripts/scr_shoot/scr_shoot.gml b/scripts/scr_shoot/scr_shoot.gml index f77b7b4ab0..492cdc13a7 100644 --- a/scripts/scr_shoot/scr_shoot.gml +++ b/scripts/scr_shoot/scr_shoot.gml @@ -198,7 +198,6 @@ function scr_shoot(weapon_index_position, target_object, target_type, damage_dat } if (instance_exists(target_object) && (owner == eFACTION.Player)) { - // show_debug_message("{0}, {1}, {2}, {3}, {4}", wep_num[weapon_index_position], wep[weapon_index_position], splash[weapon_index_position], range[weapon_index_position], att[weapon_index_position]) var shots_fired = 0; var stop = 0; var damage_type = ""; diff --git a/scripts/scr_specialist_training/scr_specialist_training.gml b/scripts/scr_specialist_training/scr_specialist_training.gml index 7cf686d1fa..7b52f7363b 100644 --- a/scripts/scr_specialist_training/scr_specialist_training.gml +++ b/scripts/scr_specialist_training/scr_specialist_training.gml @@ -1,14 +1,15 @@ function specialistfunct (specialist, req_exp) { + var _roles = active_roles(); var spec_tips = [ - string("{0} Potential", obj_ini.role[100][16]), - string("{0} Potential", obj_ini.role[100][15]), - string("{0} Potential", obj_ini.role[100][14]), - string("{0} Potential", obj_ini.role[100][17]), - string("{0} Applicant", obj_ini.role[100][16]), - string("{0} Applicant", obj_ini.role[100][15]), - string("{0} Applicant", obj_ini.role[100][14]), - string("{0} Applicant", obj_ini.role[100][17]), + string("{0} Potential", _roles[16]), + string("{0} Potential", _roles[15]), + string("{0} Potential", _roles[14]), + string("{0} Potential", _roles[17]), + string("{0} Applicant", _roles[16]), + string("{0} Applicant", _roles[15]), + string("{0} Applicant", _roles[14]), + string("{0} Applicant", _roles[17]), string("Promote to Marine") ]; @@ -50,7 +51,7 @@ function specialistfunct (specialist, req_exp) { break; } - if (role() == obj_ini.role[100][12]) { + if (role() == _roles[12]) { colors[0] = c_fuchsia; } @@ -59,7 +60,7 @@ function specialistfunct (specialist, req_exp) { } if (experience >= req_exp) { - if (!(role() == obj_ini.role[100][12])) { + if (!(role() == _roles[12])) { spec_tip = tips_list[1]; } else { spec_tip = tips_list[2]; @@ -77,6 +78,7 @@ function specialistfunct (specialist, req_exp) { // specialist - Integer index (0: Techmarine, 1: Librarian, 2: Chaplain, 3: Apothecary) // Returns: Array containing company and position of selected marine, or "none" if no suitable marine found function spec_data_set(specialist) { + var _roles = active_roles(); var _data = spec_train_data[specialist]; var _search = { "stat": _data.req, @@ -89,10 +91,10 @@ function spec_data_set(specialist) { var random_marine=scr_random_marine( // TODO LOW SEARCH_OPTIONAL // Make this function handle optional search_params [ - obj_ini.role[100][8], - obj_ini.role[100][18], - obj_ini.role[100][10], - obj_ini.role[100][9] + _roles[8], + _roles[18], + _roles[10], + _roles[9] ], _data.min_exp, _search @@ -102,13 +104,14 @@ function spec_data_set(specialist) { function apothecary_training(){ + var _roles = active_roles(); // ** Training ** // * Apothecary * var recruit_count=0; var training_points_values = ARR_apothecary_training_tiers; apothecary_recruit_points += training_points_values[training_apothecary] - novice_type = string("{0} Aspirant",obj_ini.role[100][15]) + novice_type = string("{0} Aspirant",_roles[15]) if (training_apothecary>0){ recruit_count=scr_role_count(novice_type,""); @@ -123,7 +126,7 @@ function apothecary_training(){ apothecary_recruit_points-=48; unit = fetch_unit(random_marine); scr_alert("green","recruitment",unit.name_role()+" has finished training.",0,0); - unit.update_role(obj_ini.role[100][15]); + unit.update_role(_roles[15]); unit.role_tag = [0, 0, 0, 0]; unit.add_exp(10); @@ -171,7 +174,7 @@ function apothecary_training(){ } } else { training_apothecary = 0; - scr_alert("red","recruitment",$"No marines available for {obj_ini.role[100][eROLE.Apothecary]} traning",0,0); + scr_alert("red","recruitment",$"No marines available for {_roles[eROLE.Apothecary]} traning",0,0); } } } @@ -179,13 +182,14 @@ function apothecary_training(){ function chaplain_training(){ + var _roles = active_roles(); // * Chaplain training * // TODO add functionality for Space Wolves and Iron Hands var recruit_count=0; var training_points_values = ARR_chaplain_training_tiers; if (global.chapter_name!="Space Wolves") and (global.chapter_name!="Iron Hands"){ chaplain_points += training_points_values[training_chaplain]; - novice_type = string("{0} Aspirant",obj_ini.role[100][14]); + novice_type = string("{0} Aspirant",_roles[14]); if (training_chaplain>0){ recruit_count=scr_role_count(novice_type,""); @@ -197,7 +201,7 @@ function chaplain_training(){ unit = fetch_unit(random_marine); scr_alert("green","recruitment",unit.name_role()+" has finished training.",0,0); chaplain_points-=48; - unit.update_role(obj_ini.role[100][14]); + unit.update_role(_roles[14]); unit.role_tag = [0, 0, 0, 0]; unit.add_exp(10); chaplain_aspirant=0; @@ -242,7 +246,7 @@ function chaplain_training(){ } } else { training_chaplain = 0; - scr_alert("red","recruitment",$"No remaining {obj_ini.role[100][eROLE.Chaplain]} applicant marines for training",0,0); + scr_alert("red","recruitment",$"No remaining {_roles[eROLE.Chaplain]} applicant marines for training",0,0); } } } @@ -251,6 +255,7 @@ function chaplain_training(){ function librarian_training(){ + var _roles = active_roles(); var recruit_count=0; // * Psycher Training * var training_points_values = ARR_chaplain_training_tiers; @@ -309,11 +314,12 @@ function librarian_training(){ } function techmarine_training(){ + var _roles = active_roles(); var recruit_count=0; var training_points_values = [ 0, 1,2,4,6,10,14]; tech_points += training_points_values[training_techmarine]; - novice_type = string("{0} Aspirant",obj_ini.role[100][16]); + novice_type = string("{0} Aspirant",_roles[16]); if (training_techmarine>0){ recruit_count=scr_role_count(novice_type,""); @@ -330,7 +336,7 @@ function techmarine_training(){ unit = fetch_unit(random_marine) tech_points-=360; - unit.update_role(obj_ini.role[100][16]); + unit.update_role(_roles[16]); unit.role_tag = [0, 0, 0, 0]; unit.add_exp(30); @@ -418,7 +424,7 @@ function techmarine_training(){ } } else{ training_techmarine = 0; - scr_alert("red","recruitment",$"No marines with sufficient technology aptitude for {obj_ini.role[100][eROLE.Techmarine]} training",0,0); + scr_alert("red","recruitment",$"No marines with sufficient technology aptitude for {_roles[eROLE.Techmarine]} training",0,0); } } } diff --git a/scripts/scr_string_functions/scr_string_functions.gml b/scripts/scr_string_functions/scr_string_functions.gml index be4a53485c..4cb0f3584f 100644 --- a/scripts/scr_string_functions/scr_string_functions.gml +++ b/scripts/scr_string_functions/scr_string_functions.gml @@ -363,11 +363,9 @@ function string_starts_with_any(_str, _prefixes) { function string_interpolate_from_struct(interpolate_string,data){ var _names=struct_get_names(data); var _name_length = array_length(_names); - show_debug_message(_names); for (var i=0;i<_name_length;i++){ var _name=_names[i]; var _replace_string = "{" + $"{_name}" + "}"; - show_debug_message(_replace_string); interpolate_string = string_replace_all(interpolate_string, _replace_string, data[$_name]); } diff --git a/scripts/scr_struct_functions/scr_struct_functions.gml b/scripts/scr_struct_functions/scr_struct_functions.gml index fc5856cb58..9e44f3694c 100644 --- a/scripts/scr_struct_functions/scr_struct_functions.gml +++ b/scripts/scr_struct_functions/scr_struct_functions.gml @@ -10,7 +10,7 @@ function DeepCloneStruct(clone_struct) { function move_data_to_current_scope(move_struct, overide=true){ if (!is_struct(move_struct)){ - show_debug_message(move_struct); + //show_debug_message(move_struct); } else { try{ var _data_names = struct_get_names(move_struct); diff --git a/scripts/scr_system_search_helpers/scr_system_search_helpers.gml b/scripts/scr_system_search_helpers/scr_system_search_helpers.gml index c7d3ad3fee..74ad0ab0b4 100644 --- a/scripts/scr_system_search_helpers/scr_system_search_helpers.gml +++ b/scripts/scr_system_search_helpers/scr_system_search_helpers.gml @@ -102,9 +102,16 @@ function scr_is_star_owned_by_allies(star) { } function scr_get_planet_with_type(star, type){ + var _is_array = is_array(type); for (var i = 1; i <= star.planets; i++){ - if(star.p_type[i] == type){ - return i; + if (!_is_array){ + if(star.p_type[i] == type){ + return i; + } + } else{ + if (array_contains(type,star.p_type[i])){ + return i; + } } } return -1; @@ -172,14 +179,15 @@ function scr_get_stars(shuffled=false, ownership=[], types = []) { if (!_owner_sort && !_types_sort){ var _add = true; } else { - var _add = true + var _add = true; if (_owner_sort && !array_contains(ownership,owner)){ - _add = false + _add = false; } if (_add && _types_sort){ + _add = false; for (var i=1;i<=planets;i++){ - types = array_delete_value(types, p_type[i]); - if (!array_length(types)){ + if (array_contains(types,p_type[i])){ + _add = true; break; } } @@ -268,25 +276,25 @@ function shuffled_planet_array(){ /// ignoring any that are disqualified by the exclusion conditions. function distance_removed_star(origional_x,origional_y, star_offset = choose(2,3), disclude_hulk=true, disclude_elder=true, disclude_deads=true, warp_concious=true){ var from = instance_nearest(origional_x,origional_y,obj_star); - var _deactivated = []; + var deactivated = []; for(var i=0; i 0){ var _data = { - system : id, - planet : _forge, - name : planet_numeral_name(_forge), - owner_name : obj_controller.faction[p_owner[_forge]], - owner : p_owner[_forge], - owner_status : obj_controller.faction_status[p_owner[_forge]], + system : id, + planet : _forge, + name : planet_numeral_name(_forge), + owner_name : obj_controller.faction[p_owner[_forge]], + owner : p_owner[_forge], + owner_status : obj_controller.faction_status[p_owner[_forge]], }; _data.click_left = method(_data, function(){ @@ -830,48 +862,48 @@ function HelpfulPlaces()constructor{ array_push(_columns , _longest_name); forges_table = new Table({ - row_key_draw : ["name","owner_name","owner_status"], - headings : ["Name", " Owner ", " Owner\nStatus "], - row_data : _forges, - set_column_widths : _columns, + row_key_draw : ["name","owner_name","owner_status"], + headings : ["Name", " Owner ", " Owner\nStatus "], + row_data : _forges, + set_column_widths : _columns, }); places_radio = new RadioSet([ { - str1 : "Help Requests", + str1 : "Help Requests", }, { - str1 : "Navy Fleets", + str1 : "Navy Fleets", }, { - str1 :"Forge Worlds", + str1 : "Forge Worlds", } ]); main_panel.inside_method = function(){ places_radio.update({ - x1: x1 + 30, - y1: y1 + 25, + x1 : x1 + 30, + y1 : y1 + 25, }); places_radio.draw(); var _new_position = { - x1:x1+40, - y1:y1+50, - y2:y1 + main_panel.height, + x1 : x1+40, + y1 : y1+50, + y2 : y1 + main_panel.height, } switch (places_radio.current_selection){ - case 1: + case 1 : navy_table.update(_new_position); navy_table.draw(); break; - case 0: + case 0 : help_table.update(_new_position); help_table.draw(); break; - case 2: + case 2 : forges_table.update(_new_position); forges_table.draw(); break; diff --git a/sprites/spr_fleet_imperial/spr_fleet_imperial.yy b/sprites/spr_fleet_imperial/spr_fleet_imperial.yy index bd2735723c..8de0f77ce1 100644 --- a/sprites/spr_fleet_imperial/spr_fleet_imperial.yy +++ b/sprites/spr_fleet_imperial/spr_fleet_imperial.yy @@ -77,22 +77,39 @@ "timeUnits":1, "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7ed3ac9a-c1a3-4966-8c07-799101e9fca6","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"f2227933-b8bc-4bf6-9d8e-524410250dc7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdb72c37-035a-45e6-9261-6bb7235b36d0","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"1746812c-c63b-415d-b459-f12dc9208349","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"b70d4f7d-d6e5-4417-a451-df64b6cc0dfc","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"edc14729-eece-4ed2-8dfc-a5f8c7dfe38b","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7c517f52-18b0-4ce3-907a-266b27998f5e","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"da9e9585-4af5-4c8f-bf1e-b0865913f48c","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7e369ca2-e39c-4f3a-95cf-1f7ece113915","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"e924ab6f-120a-498b-80ba-78f1ec0f34fe","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"83e2105e-06f4-433a-b155-899860422247","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"6e7f9699-c511-43fb-b4aa-f01b6cb66560","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"7b33f482-c952-4a96-ae8e-fc3c743bb25f","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"8cfe88df-f523-462d-bcf6-20f2367cf625","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"948a2eb0-29bf-4b0d-8710-2641375e304c","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"e41b6128-03e4-490c-be0e-4c177c1dcfaa","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"c527feba-1ebf-430b-bcce-57c3998dd2ba","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"38bd26a6-a925-4d86-8cc1-91d1fa137e25","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"3a21b19b-398c-43ca-98e1-b7cbeafd021a","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"212d7172-82b2-47e9-95c1-fb55d943413e","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7ed3ac9a-c1a3-4966-8c07-799101e9fca6","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"f2227933-b8bc-4bf6-9d8e-524410250dc7","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdb72c37-035a-45e6-9261-6bb7235b36d0","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1746812c-c63b-415d-b459-f12dc9208349","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"b70d4f7d-d6e5-4417-a451-df64b6cc0dfc","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"edc14729-eece-4ed2-8dfc-a5f8c7dfe38b","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7c517f52-18b0-4ce3-907a-266b27998f5e","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"da9e9585-4af5-4c8f-bf1e-b0865913f48c","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7e369ca2-e39c-4f3a-95cf-1f7ece113915","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"e924ab6f-120a-498b-80ba-78f1ec0f34fe","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"83e2105e-06f4-433a-b155-899860422247","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"6e7f9699-c511-43fb-b4aa-f01b6cb66560","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"7b33f482-c952-4a96-ae8e-fc3c743bb25f","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"8cfe88df-f523-462d-bcf6-20f2367cf625","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"948a2eb0-29bf-4b0d-8710-2641375e304c","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"e41b6128-03e4-490c-be0e-4c177c1dcfaa","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"c527feba-1ebf-430b-bcce-57c3998dd2ba","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"38bd26a6-a925-4d86-8cc1-91d1fa137e25","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"3a21b19b-398c-43ca-98e1-b7cbeafd021a","path":"sprites/spr_fleet_imperial/spr_fleet_imperial.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"212d7172-82b2-47e9-95c1-fb55d943413e","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":11, "yorigin":11, diff --git a/sprites/spr_fleet_tau/spr_fleet_tau.yy b/sprites/spr_fleet_tau/spr_fleet_tau.yy index 3e3b10899a..ea24ba85e3 100644 --- a/sprites/spr_fleet_tau/spr_fleet_tau.yy +++ b/sprites/spr_fleet_tau/spr_fleet_tau.yy @@ -78,23 +78,42 @@ "timeUnits":1, "tracks":[ {"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore":"","Keyframes":[ - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdd4c365-a564-4c95-85ab-bda104c5d5e1","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"1641c7b0-ba32-46a1-bdef-7751da95e1c5","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"95d93dc5-c7db-4369-b68a-31026d5959fc","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"b1f176e9-a3cc-4a3b-94bf-ade7ddc106a3","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"617ee12d-133c-4e96-ba8d-93535804252d","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"1051b8c3-13b3-4b12-909d-886c3a09de27","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"06e6544f-caed-4f40-8705-c7108e508215","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"195aff74-b345-485c-8c41-640d808b3d87","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"3e69a52d-25e9-4c9b-89b5-80990b84fd94","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"a06bc4eb-65c2-4824-b12e-4b2594e8cdc6","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"1a9a662c-67fe-4cdf-bdbf-c87e0070a330","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"a5c0c0a4-63b3-43bc-8743-90cbd113bcb7","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"bb9a18cc-c332-4f49-86d2-1dd6b6a501ca","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"4c0c4440-a668-4464-9e1c-647382b2af86","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"a28eb7be-b330-4c6f-a971-0412e89f9546","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"21ad7732-67d7-4445-a580-dc99939fd767","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"6faa2ba4-5a83-4f02-8506-0aed83da2623","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"8c836550-2c0b-4ff6-bdf5-db3f343e1f8c","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"93464d16-aa98-4c7b-83a4-f5f56f3bf632","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"621a69a7-bcaa-4299-821f-7014d3b98d91","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, - {"$Keyframe":"","Channels":{"0":{"$SpriteFrameKeyframe":"","Id":{"name":"4f6782bd-e559-446b-9cfb-76c842cac2e6","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},},"Disabled":false,"id":"ed6f8cbd-bba9-4119-b444-6aa8e37e6443","IsCreationKey":false,"Key":10.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"cdd4c365-a564-4c95-85ab-bda104c5d5e1","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1641c7b0-ba32-46a1-bdef-7751da95e1c5","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"95d93dc5-c7db-4369-b68a-31026d5959fc","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"b1f176e9-a3cc-4a3b-94bf-ade7ddc106a3","IsCreationKey":false,"Key":1.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"617ee12d-133c-4e96-ba8d-93535804252d","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"1051b8c3-13b3-4b12-909d-886c3a09de27","IsCreationKey":false,"Key":2.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"06e6544f-caed-4f40-8705-c7108e508215","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"195aff74-b345-485c-8c41-640d808b3d87","IsCreationKey":false,"Key":3.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"3e69a52d-25e9-4c9b-89b5-80990b84fd94","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"a06bc4eb-65c2-4824-b12e-4b2594e8cdc6","IsCreationKey":false,"Key":4.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"1a9a662c-67fe-4cdf-bdbf-c87e0070a330","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"a5c0c0a4-63b3-43bc-8743-90cbd113bcb7","IsCreationKey":false,"Key":5.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"bb9a18cc-c332-4f49-86d2-1dd6b6a501ca","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"4c0c4440-a668-4464-9e1c-647382b2af86","IsCreationKey":false,"Key":6.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"a28eb7be-b330-4c6f-a971-0412e89f9546","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"21ad7732-67d7-4445-a580-dc99939fd767","IsCreationKey":false,"Key":7.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"6faa2ba4-5a83-4f02-8506-0aed83da2623","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"8c836550-2c0b-4ff6-bdf5-db3f343e1f8c","IsCreationKey":false,"Key":8.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"93464d16-aa98-4c7b-83a4-f5f56f3bf632","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"621a69a7-bcaa-4299-821f-7014d3b98d91","IsCreationKey":false,"Key":9.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, + {"$Keyframe":"","Channels":{ + "0":{"$SpriteFrameKeyframe":"","Id":{"name":"4f6782bd-e559-446b-9cfb-76c842cac2e6","path":"sprites/spr_fleet_tau/spr_fleet_tau.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",}, + },"Disabled":false,"id":"ed6f8cbd-bba9-4119-b444-6aa8e37e6443","IsCreationKey":false,"Key":10.0,"Length":1.0,"resourceType":"Keyframe","resourceVersion":"2.0","Stretch":false,}, ],"resourceType":"KeyframeStore","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,}, ], - "visibleRange":{ - "x":0.0, - "y":0.0, - }, + "visibleRange":null, "volume":1.0, "xorigin":11, "yorigin":11,