diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 6e51e85a4..96ba589cb 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -837,6 +837,7 @@ {"id":{"name":"scr_image","path":"scripts/scr_image/scr_image.yy",},}, {"id":{"name":"scr_imperial_manage_fleet_functions","path":"scripts/scr_imperial_manage_fleet_functions/scr_imperial_manage_fleet_functions.yy",},}, {"id":{"name":"scr_imperial_navy_functions","path":"scripts/scr_imperial_navy_functions/scr_imperial_navy_functions.yy",},}, + {"id":{"name":"scr_imperium_mission","path":"scripts/scr_imperium_mission/scr_imperium_mission.yy",},}, {"id":{"name":"scr_income","path":"scripts/scr_income/scr_income.yy",},}, {"id":{"name":"scr_ini_ship_cleanup","path":"scripts/scr_ini_ship_cleanup/scr_ini_ship_cleanup.yy",},}, {"id":{"name":"scr_initialize_custom","path":"scripts/scr_initialize_custom/scr_initialize_custom.yy",},}, @@ -918,6 +919,7 @@ {"id":{"name":"scr_ship_count","path":"scripts/scr_ship_count/scr_ship_count.yy",},}, {"id":{"name":"scr_ship_occupants","path":"scripts/scr_ship_occupants/scr_ship_occupants.yy",},}, {"id":{"name":"scr_shoot","path":"scripts/scr_shoot/scr_shoot.yy",},}, + {"id":{"name":"scr_sob_mission","path":"scripts/scr_sob_mission/scr_sob_mission.yy",},}, {"id":{"name":"scr_special_view","path":"scripts/scr_special_view/scr_special_view.yy",},}, {"id":{"name":"scr_specialist_point_handler","path":"scripts/scr_specialist_point_handler/scr_specialist_point_handler.yy",},}, {"id":{"name":"scr_specialist_points","path":"scripts/scr_specialist_points/scr_specialist_points.yy",},}, diff --git a/datafiles/main/version.json b/datafiles/main/version.json index 031b67240..c4a364d8c 100644 --- a/datafiles/main/version.json +++ b/datafiles/main/version.json @@ -1,5 +1,5 @@ { - "build_date": "2026-01-30", - "version": "v0.11.05.08", + "build_date": "2026-02-05", + "version": "v0.11.05.09", "commit_hash": "unknown hash" } \ No newline at end of file diff --git a/scripts/scr_imperium_mission/scr_imperium_mission.gml b/scripts/scr_imperium_mission/scr_imperium_mission.gml new file mode 100644 index 000000000..7d8d6a6ee --- /dev/null +++ b/scripts/scr_imperium_mission/scr_imperium_mission.gml @@ -0,0 +1,63 @@ +/* + Mission flow: + scr_random_event -> rolls rng for inquis mission + scr_inquisition_mission -> rolls rng and tests suitable planets for which mission + mission_inquisition_ -> logic and mechanics for spawning the mission and triggering the popup + scr_popup -> displays the panel with mission details and Accept/Refuse buttons + obj_popup.Step0 -> find `mission_is_go` section and add necessary event logic for when the player accepts + scr_mission_functions > mission_name_key -> need to update this so that missions display in the mission log + + + Helpers: + scr_mission_eta -> given the xy of a _star where the mission is, calculate how long you should have to complete the mission + Todo? maybe add a disposition influence here so that angy inquisitor gives you less spare time and vice versa + scr_star_has_planet_with_feature -> given the id of a _star and a `P_features` enum value, check if any planet on that _star has the desired feature + star_has_planet_with_forces -> given the id of a _star, and a faction, returns whether or not there are forces present there and in sufficient number +*/ + + +/// @param {Enum.EVENT} event +function scr_imperium_mission(event){ +function mission_investigate_registry(){ + var stars = scr_get_stars(); + var _valid_stars = array_filter_ext(stars, + function(_star,index){ + if (scr_star_has_planet_with_feature(_star, P_features.Ancient_Ruins)){ + var fleet = instance_nearest(_star.x,_star.y,obj_p_fleet); + if (fleet == undefined || point_distance(_star.x,_star.y,fleet.x,fleet.y)>=160){ + return true; + } + return false; + } + return false; + }); + + if (array_length(_valid_stars) == 0){ + log_error("RE: Investigate Registry, couldn't find a _star"); + exit; + } + + var _star = array_random_element(_valid_stars); + var planet = scr_get_planet_with_feature(_star, P_features.Ancient_Ruins); + if (planet == -1){ + log_error("RE: Investigate Registry, couldn't pick a planet"); + exit; + } + + + var eta = infinity; + with(obj_p_fleet){ + if (action!=""){ + continue; + } + eta = min(eta, scr_mission_eta(_star.x,_star.y,1)); + } + eta = min(max(3,eta),100); + + var text=$"You overhear the Sector Governor instructions regarding {string(_star.name)} {scr_roman(planet)}"; + text+=$" It seems there are numerous registry mismatches regarding taxes and other data. We could investigate this ourselves, by landing marines there."; + text += $" You have {string(eta)} months until Imperium completes own investigation."; + scr_popup("Registry Investigation",text,"imperium",$"recon|{string(_star.name)}|{string(planet)}|{string(eta)}|"); + +} +} \ No newline at end of file diff --git a/scripts/scr_imperium_mission/scr_imperium_mission.yy b/scripts/scr_imperium_mission/scr_imperium_mission.yy new file mode 100644 index 000000000..733fd1cfa --- /dev/null +++ b/scripts/scr_imperium_mission/scr_imperium_mission.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_imperium_mission", + "isCompatibility":false, + "isDnD":false, + "name":"scr_imperium_mission", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file diff --git a/scripts/scr_random_event/scr_random_event.gml b/scripts/scr_random_event/scr_random_event.gml index f0497400f..f5563380f 100644 --- a/scripts/scr_random_event/scr_random_event.gml +++ b/scripts/scr_random_event/scr_random_event.gml @@ -61,6 +61,8 @@ function scr_random_event(execute_now) { EVENT.strange_building, // Not sure if techmarine in the mood for building is a good thing EVENT.sororitas, // This requires checks for renegade or traitor EVENT.rogue_trader, + EVENT.imperium_mission, // Good event as it is an opportunity with no loss risk + EVENT.sisters_mission, // Same as imperium mission ]; } else if(player_luck == luck.neutral){ @@ -121,6 +123,18 @@ function scr_random_event(execute_now) { events_total -= 1; } break; + case EVENT.imperium_mission: + if (known[eFACTION.Imperium]==0 || obj_controller.disposition[1] < 0 || obj_controller.faction_status[eFACTION.Imperium] == "War") { + events_share[i] -= 1; + events_total -= 1; + } + break; + case EVENT.sob_mission: + if (known[eFACTION.Ecclesiarchy]==0 || obj_controller.disposition[5] < 0 || obj_controller.faction_status[eFACTION.Ecclesiarchy] == "War") { + events_share[i] -= 1; + events_total -= 1; + } + break; case EVENT.mechanicus_mission: if (known[eFACTION.Mechanicus] == 0 || obj_controller.disposition[3] < 50 || obj_controller.faction_status[eFACTION.Mechanicus] == "War") { events_share[i] -= 1; @@ -357,7 +371,19 @@ function scr_random_event(execute_now) { evented = spawn_mechanicus_mission(); } - + + else if (chosen_event == EVENT.imperium_mission) { + scr_imperium_mission(chosen_event); + _evented = true; + + } + + else if (chosen_event == EVENT.sisters_mission) { + scr_sob_mission(chosen_event); + _evented = true; + + } + else if (chosen_event == EVENT.inquisition_planet || chosen_event == EVENT.inquisition_mission) { scr_inquisition_mission(chosen_event); _evented = true; diff --git a/scripts/scr_sob_mission/scr_sob_mission.gml b/scripts/scr_sob_mission/scr_sob_mission.gml new file mode 100644 index 000000000..2f12d1124 --- /dev/null +++ b/scripts/scr_sob_mission/scr_sob_mission.gml @@ -0,0 +1,63 @@ +/* + Mission flow: + scr_random_event -> rolls rng for inquis mission + scr_inquisition_mission -> rolls rng and tests suitable planets for which mission + mission_inquisition_ -> logic and mechanics for spawning the mission and triggering the popup + scr_popup -> displays the panel with mission details and Accept/Refuse buttons + obj_popup.Step0 -> find `mission_is_go` section and add necessary event logic for when the player accepts + scr_mission_functions > mission_name_key -> need to update this so that missions display in the mission log + + + Helpers: + scr_mission_eta -> given the xy of a _star where the mission is, calculate how long you should have to complete the mission + Todo? maybe add a disposition influence here so that angy inquisitor gives you less spare time and vice versa + scr_star_has_planet_with_feature -> given the id of a _star and a `P_features` enum value, check if any planet on that _star has the desired feature + star_has_planet_with_forces -> given the id of a _star, and a faction, returns whether or not there are forces present there and in sufficient number +*/ + + +/// @param {Enum.EVENT} event +function scr_sob_mission(event){ +function mission_investigate_priest(){ + var stars = scr_get_stars(); + var _valid_stars = array_filter_ext(stars, + function(_star,index){ + if (scr_star_has_planet_with_feature(_star, P_features.Ancient_Ruins)){ + var fleet = instance_nearest(_star.x,_star.y,obj_p_fleet); + if (fleet == undefined || point_distance(_star.x,_star.y,fleet.x,fleet.y)>=160){ + return true; + } + return false; + } + return false; + }); + + if (array_length(_valid_stars) == 0){ + log_error("RE: Investigate Priest, couldn't find a _star"); + exit; + } + + var _star = array_random_element(_valid_stars); + var planet = scr_get_planet_with_feature(_star, P_features.Ancient_Ruins); + if (planet == -1){ + log_error("RE: Investigate Priest, couldn't pick a planet"); + exit; + } + + + var eta = infinity; + with(obj_p_fleet){ + if (action!=""){ + continue; + } + eta = min(eta, scr_mission_eta(_star.x,_star.y,1)); + } + eta = min(max(3,eta),100); + + var text=$"You overhear the Ecclesiarchy instructions regarding {string(_star.name)} {scr_roman(planet)}"; + text+=$" It seems one of the priests there is behaving strangely. We could investigate this ourselves, by landing marines there."; + text += $" You have {string(eta)} months until Ecclesiarchy completes own investigation."; + scr_popup("Priest Investigation",text,"ecclesiarchy",$"recon|{string(_star.name)}|{string(planet)}|{string(eta)}|"); + +} +} \ No newline at end of file diff --git a/scripts/scr_sob_mission/scr_sob_mission.yy b/scripts/scr_sob_mission/scr_sob_mission.yy new file mode 100644 index 000000000..a5d4a1d13 --- /dev/null +++ b/scripts/scr_sob_mission/scr_sob_mission.yy @@ -0,0 +1,13 @@ +{ + "$GMScript":"v1", + "%Name":"scr_sob_mission", + "isCompatibility":false, + "isDnD":false, + "name":"scr_sob_mission", + "parent":{ + "name":"Scripts", + "path":"folders/Scripts.yy", + }, + "resourceType":"GMScript", + "resourceVersion":"2.0", +} \ No newline at end of file