Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ChapterMaster.yyp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,9 +1409,11 @@
{"id":{"name":"spr_pauldron_spikes_left","path":"sprites/spr_pauldron_spikes_left/spr_pauldron_spikes_left.yy",},},
{"id":{"name":"spr_pauldron_spikes_right","path":"sprites/spr_pauldron_spikes_right/spr_pauldron_spikes_right.yy",},},
{"id":{"name":"spr_penitent_ui","path":"sprites/spr_penitent_ui/spr_penitent_ui.yy",},},
{"id":{"name":"spr_pixel_book_page_highlight","path":"sprites/spr_pixel_book_page_highlight/spr_pixel_book_page_highlight.yy",},},
{"id":{"name":"spr_pixel_button_left","path":"sprites/spr_pixel_button_left/spr_pixel_button_left.yy",},},
{"id":{"name":"spr_pixel_button_middle","path":"sprites/spr_pixel_button_middle/spr_pixel_button_middle.yy",},},
{"id":{"name":"spr_pixel_button_right","path":"sprites/spr_pixel_button_right/spr_pixel_button_right.yy",},},
{"id":{"name":"spr_pixel_servo_book","path":"sprites/spr_pixel_servo_book/spr_pixel_servo_book.yy",},},
{"id":{"name":"spr_planet_screen","path":"sprites/spr_planet_screen/spr_planet_screen.yy",},},
{"id":{"name":"spr_planet_splash","path":"sprites/spr_planet_splash/spr_planet_splash.yy",},},
{"id":{"name":"spr_planets","path":"sprites/spr_planets/spr_planets.yy",},},
Expand Down
270 changes: 204 additions & 66 deletions objects/obj_controller/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -1619,16 +1619,16 @@ for(var company=0; company<10; company++){
}
}

temp[59] = $"CLASSIFICATION: SECTOR LOGISTICAE#++++++++++DATE: {temp[30]}#++++++++AUTHOR: MASTER ADEPT {temp[31]}#++++++++++++RE: INTRODUCTORY MISSIVE#+++++RECIPIENT: CHAPTER MASTER {temp[32]}##++THOUGHT: {temp[33]}++##I see you have made it unscathed, your grace. Death comes with you as it should! The enemy is on the horizon. Thy chapter is mighty and only waits for your word to wreak havoc upon our enemies.##Your chapter contains-";
temp[59] = $"CLASSIFICATION: SECTOR LOGISTICAE\n++++++++++DATE: {temp[30]}\n++++++++AUTHOR: MASTER ADEPT {temp[31]}\n++++++++++++RE: INTRODUCTORY MISSIVE\n+++++RECIPIENT: CHAPTER MASTER {temp[32]}\n\n++THOUGHT: {temp[33]}++\n\nI see you have made it unscathed, your grace. Death comes with you as it should! The enemy is on the horizon. Thy chapter is mighty and only waits for your word to wreak havoc upon our enemies.\n\nYour chapter contains-";

temp[60] = $"{temp[59]}\n\n{temp[34]}\n\n{temp[35]}##{temp[36]}##{temp[37]}##{temp[38]}##{temp[39]}##{temp[40]}##{temp[41]}##{temp[42]}##{temp[43]}##{temp[44]}##{temp[45]}";
temp[60] = $"{temp[59]}\n\n{temp[34]}\n\n{temp[35]}\n\n{temp[36]}\n\n{temp[37]}\n\n{temp[38]}\n\n{temp[39]}\n\n{temp[40]}\n\n{temp[41]}\n\n{temp[42]}\n\n{temp[43]}\n\n{temp[44]}\n\n{temp[45]}";


temp[61]="\n\nYour armamentarium contains some spare equipment- \n";
temp[61]=$"\n\nYour armamentarium contains some spare equipment- \n";
temp[61] += equipment_struct_to_string(obj_ini.equipment, true, true);


temp[62]="##Your fleet contains ";
temp[62]=$"\n\nYour fleet contains ";

var bb=0,sk=0,glad=0,hunt=0,ships=0,bb_names=[],sk_names=[],glad_names=[],hunt_names=[];

Expand Down Expand Up @@ -1682,87 +1682,225 @@ if (hunt > 0) {
}



servo_data_book = {
sprite : spr_pixel_servo_book,
x : -500,
y : 500,
scale : 0.1,
pages : [],
animate_commands : [
{
x_end : 310,
y_end : 500,
end_scale : 0.1,
move_time : 2,
},
{
x_end : 310,
y_end : 30,
end_scale : 0.25,
move_time : 2,
}
]
}
// show_message(temp[61]);
// show_message(temp[62]);
// 61 : equipment
// 62 : ships
var lol=240;
var lol=200;
draw_set_font(fnt_small);
welcome_pages=string_height(string_hash_to_newline(string(temp[60])+string(temp[61])+string(temp[62])));
welcome_pages-=260;
welcome_pages=(welcome_pages/lol)+1;

if (floor(welcome_pages)<welcome_pages){
welcome_pages+=1;
welcome_pages=floor(welcome_pages);
}

// show_message(string(welcome_pages)+" pages");
var tman=65;
temp[65]=string(temp[60])+string(temp[61])+string(temp[62]);
for(var i=0; i<welcome_pages; i++){
tman+=1;
temp[tman]=string(temp[60])+string(temp[61])+string(temp[62]);
}

var lig=0,remov=0,stahp=0;
var new_servo_pages = function(_string){
var _string_short = function(_string2){
var _bas_height = string_height(" ");
var _string_width = 680*0.6;
var _two_pages = string_height_ext(_string2, -1, _string_width);
var _lines = _two_pages/_bas_height;
return (_lines<=20);
}
if (!_string_short(_string)){
var _tally = "";
var _splits = string_split(_string, "\n");
for (var i=0;i<array_length(_splits);i++){
if (!_string_short(_tally + _splits[i])){
array_push(servo_data_book.pages, _tally);
_tally = "";
}

if (welcome_pages>=1){
for(var i=0; i<4000; i++){
if (string_height(string_hash_to_newline(temp[65]))>260){
lig=string_length(temp[65]);
temp[65]=string_delete(temp[65],lig,1);
_tally += _splits[i]+"\n";
if (i == array_length(_splits)-1){
array_push(servo_data_book.pages, _tally);
}
}
} else {
array_push(servo_data_book.pages, _string);
}
}
Comment on lines +1716 to 1741
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Text pagination servos functional but suboptimal.

The nested function pattern deviates from standard GML practices. Consider extracting _string_short as a separate script for enhanced maintainability.

🤖 Prompt for AI Agents
In objects/obj_controller/Create_0.gml around lines 1716 to 1741, the nested
function _string_short inside new_servo_pages is not following standard GML
practices. To fix this, extract the _string_short function out of
new_servo_pages and create it as a separate script. Then call this new script
from within new_servo_pages to improve code maintainability and clarity.

remov=string_length(string(temp[65]))+1;

if (welcome_pages>=2){
temp[66]=string_delete(temp[66],1,remov);
for(var i=0; i<4000; i++){
if (string_height(string_hash_to_newline(temp[66]))>lol){
lig=string_length(temp[66]);
temp[66]=string_delete(temp[66],lig,1);
}

for (var i=60;i<70;i++){
if (temp[i] == ""){
continue;
}
new_servo_pages(temp[i]);
}
remov=string_length(string(temp[65])+string(temp[66]))+1;
// show_message(remov);

if (welcome_pages>=3){
temp[67]=string_delete(temp[67],1,remov);
for(var i=0; i<4000; i++){
if (string_height(string_hash_to_newline(temp[67]))>lol){
lig=string_length(temp[67]);
temp[67]=string_delete(temp[67],lig,1);
}


with (servo_data_book){

animate_out = function(){
animate_commands = [
{
x_end : 310,
y_end : 500,
end_scale : 0.1,
move_time : 2,
},
{
x_end : -500,
y_end : 500,
end_scale : 0.1,
move_time : 2,
},
];
global.ui_click_lock = false;
obj_controller.menu = 0;
}
}
remov=string_length(string(temp[65])+string(temp[66])+string(temp[67]))+1;

if (welcome_pages<4) then temp[68]="";
if (welcome_pages>=4){
temp[68]=string_delete(temp[68],1,remov);
for(var i=0; i<4000; i++){
if (string_height(string_hash_to_newline(temp[68]))>lol){
lig=string_length(temp[68]);
temp[68]=string_delete(temp[68],lig,1);
}

for (i=0;i<array_length(pages);i++){
var new_surf = surface_create(680*0.6, 1000*0.6);
draw_set_halign(fa_left);
draw_set_color(c_white);
draw_set_font(fnt_40k_14b);
surface_set_target(new_surf);
draw_text_ext(0, 0, pages[i], -1, 680*0.6);
surface_reset_target();
pages[i] = sprite_create_from_surface(new_surf, 0, 0, 680*0.6, 1000*0.6, false, false, 0, 0);
surface_free(new_surf);
}
}
remov=string_length(string(temp[65])+string(temp[66])+string(temp[67])+string(temp[68]))+1;

if (welcome_pages<5) then temp[69]="";
if (welcome_pages>=5){
temp[69]=string_delete(temp[69],1,remov);
for(var i=0; i<4000; i++){
if (string_height(string_hash_to_newline(temp[69]))>lol){
lig=string_length(temp[69]);
temp[69]=string_delete(temp[69],lig,1);
command_count = 0;
current_command = false;
move_time = 0;
draw = function(){
if (move_time = 0 && array_length(animate_commands) > 0){
current_command = animate_commands[0];
array_delete(animate_commands, 0, 1);
move_time = current_command.move_time*room_speed;
x_turn_move = (current_command.x_end - x)/move_time;
y_turn_move = (current_command.y_end - y)/move_time;
scale_change = (current_command.end_scale - scale)/move_time;
command_count++;
} else if (array_length(animate_commands) == 0 && move_time = 0){
x_turn_move = 0;
y_turn_move = 0;
scale_change = 0;
}
draw_sprite_ext(spr_pixel_servo_book, 0, x, y, scale, scale, 0, c_white, 1);
Comment on lines +1787 to +1800
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical logic malfunction detected in animation protocols.

Machine spirits report erroneous assignment operators where comparisons are required. These heretical constructs will corrupt the animation sequences.

Apply these sanctified corrections:

-        if (move_time = 0 && array_length(animate_commands) > 0){
+        if (move_time == 0 && array_length(animate_commands) > 0){
-        } else if (array_length(animate_commands) == 0 && move_time = 0){
+        } else if (array_length(animate_commands) == 0 && move_time == 0){
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (move_time = 0 && array_length(animate_commands) > 0){
current_command = animate_commands[0];
array_delete(animate_commands, 0, 1);
move_time = current_command.move_time*room_speed;
x_turn_move = (current_command.x_end - x)/move_time;
y_turn_move = (current_command.y_end - y)/move_time;
scale_change = (current_command.end_scale - scale)/move_time;
command_count++;
} else if (array_length(animate_commands) == 0 && move_time = 0){
x_turn_move = 0;
y_turn_move = 0;
scale_change = 0;
}
draw_sprite_ext(spr_pixel_servo_book, 0, x, y, scale, scale, 0, c_white, 1);
if (move_time == 0 && array_length(animate_commands) > 0){
current_command = animate_commands[0];
array_delete(animate_commands, 0, 1);
move_time = current_command.move_time*room_speed;
x_turn_move = (current_command.x_end - x)/move_time;
y_turn_move = (current_command.y_end - y)/move_time;
scale_change = (current_command.end_scale - scale)/move_time;
command_count++;
} else if (array_length(animate_commands) == 0 && move_time == 0){
x_turn_move = 0;
y_turn_move = 0;
scale_change = 0;
}
draw_sprite_ext(spr_pixel_servo_book, 0, x, y, scale, scale, 0, c_white, 1);
🤖 Prompt for AI Agents
In objects/obj_controller/Create_0.gml around lines 1787 to 1800, the code uses
assignment operators (=) instead of comparison operators (==) in the if
conditions, causing logic errors. Replace all instances of single equals (=) in
the if and else if conditions with double equals (==) to correctly perform
comparisons and fix the animation sequence logic.


bookleft_page_loc = [(1000 * scale),1100*scale, 2000*scale, 2400*scale];
bookright_page_loc = [(2000 * scale),1100*scale, 3000*scale, 2400*scale];

var rel_locations = [coord_relevative_positions(bookleft_page_loc,x,y), coord_relevative_positions(bookright_page_loc,x,y)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Update function invocation to match corrected designation.

When correcting the function name typo in scr_hit.gml, ensure this invocation is also updated.


🏁 Script executed:

#!/bin/bash
# Description: Verify all usages of the misspelled function name
# Test: Search for all occurrences of the typo. Expect: Only these two locations.
rg "coord_relevative_positions" -A 2 -B 2

Length of output: 1306


By the Omnissiah, correct the function spelling across the codebase.

The typo coord_relevative_positions must be renamed to coord_relative_positions in all definition and invocation sites:

• scripts/scr_hit/scr_hit.gml
– Rename function definition
• scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
– Update invocation
• objects/obj_controller/Create_0.gml (line 1805)
– Update both calls in the array literal

Example diff for Create_0.gml:

- var rel_locations = [coord_relevative_positions(bookleft_page_loc,x,y), coord_relevative_positions(bookright_page_loc,x,y)];
+ var rel_locations = [coord_relative_positions(bookleft_page_loc, x, y), coord_relative_positions(bookright_page_loc, x, y)];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
var rel_locations = [coord_relevative_positions(bookleft_page_loc,x,y), coord_relevative_positions(bookright_page_loc,x,y)];
var rel_locations = [coord_relative_positions(bookleft_page_loc, x, y), coord_relative_positions(bookright_page_loc, x, y)];
🤖 Prompt for AI Agents
In objects/obj_controller/Create_0.gml at line 1805, the function name
coord_relevative_positions is misspelled and should be updated to
coord_relative_positions. Change all occurrences of coord_relevative_positions
in this line to coord_relative_positions to match the corrected function name
used throughout the codebase.

var _l_loc = rel_locations[0];
var _r_loc = rel_locations[1];

if (obj_controller.menu == 500){

if (scr_hit(_l_loc)){
draw_sprite_ext(spr_pixel_book_page_highlight, 0, x, y, scale, scale, 0, c_white, 1);

} else if (scr_hit(_r_loc)){
draw_sprite_ext(spr_pixel_book_page_highlight, 1, x, y, scale, scale, 0, c_white, 1);
}
draw_set_halign(fa_left);
draw_set_color(c_white);
draw_set_font(fnt_40k_14b);
draw_text_ext_transformed(_l_loc[0]+(280*scale), _l_loc[1] + (400*scale), "Read Chapter Breakdown",-1,680*scale, scale*4,scale*4,0);
draw_text_ext_transformed(_r_loc[0]+(280*scale), _r_loc[1] + (400*scale), "Start Commanding Chapter",-1, 680*scale, scale*4,scale*4,0);
if (point_and_click(_r_loc, , true)){
animate_out();

} else if (point_and_click(_l_loc, , true)){
show_debug_message("click l")
animate_commands = [
{
x_end : -800*0.6,
y_end : -900*0.6,
end_scale : 0.6,
move_time : 2,
},
]
obj_controller.menu++;
}


} else if (obj_controller.menu > 500 && !array_length(animate_commands) && move_time == 0){
var left_page = pages[0];
var _double = (array_length(pages) >1);
if (_double){
var right_page = pages[1];
}
var draw_coords = [_l_loc[0]+(260*scale), _l_loc[1] + (150*scale)];
var draw_coords_r = [_r_loc[0]+(150*scale), _r_loc[1] + (150*scale)];

var _final_y = 0;
var _final_i = 0;
var _final_y2 = 0;
var _final_i2 = 0;
for (var i=0;i<680*scale;i++){
if (i<(680*scale)){
if ((i*scale)<(scale*260)){
var y_change = (power(i*0.0295, 2))*0.6;
_final_y = y_change;
_final_i = i;
} else {
var y_change = ((-(power((i-_final_i)*0.045, 2)))*0.5)+_final_y;
}
draw_sprite_part(left_page, 0, i, 0, 1, 1000, draw_coords[0]+i, draw_coords[1]-y_change);
if (_double){
if ((i*scale)<(scale*170)){
var y_change = (power(i*0.045, 2)*-0.6);
_final_y2 = y_change;
_final_i2 = i;
} else {
var y_change = (-(power((i-_final_i2)*0.0295, 2))*-0.6)+_final_y2;
}
draw_sprite_part(right_page, 0, i, 0, 1, 1000, draw_coords_r[0]+i, draw_coords_r[1]-y_change);
}
}
//draw_sprite_part(left_page, subimg, left, top, width, height, x, y)()
}
/*if (obj_controller.menu = 501){
draw_text_ext(_l_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[0]), -1, 680*scale);
draw_text_ext(_r_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[1]), -1, 680*scale);
} else if (obj_controller.menu == 502){
draw_text_ext(_l_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[2]), -1, 680*scale);
draw_text_ext(_r_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[3]), -1, 680*scale);
}*/
Comment on lines +1875 to +1881
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Purge inactive code segments.

Commented code blocks violate the principle of clean cogitation chambers. Remove these dormant instructions to maintain code sanctity.

-            /*if (obj_controller.menu = 501){
-                draw_text_ext(_l_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[0]), -1, 680*scale);
-                draw_text_ext(_r_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[1]), -1, 680*scale);
-            } else if (obj_controller.menu == 502){
-                draw_text_ext(_l_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[2]), -1, 680*scale);
-                draw_text_ext(_r_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[3]), -1, 680*scale);
-            }*/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/*if (obj_controller.menu = 501){
draw_text_ext(_l_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[0]), -1, 680*scale);
draw_text_ext(_r_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[1]), -1, 680*scale);
} else if (obj_controller.menu == 502){
draw_text_ext(_l_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[2]), -1, 680*scale);
draw_text_ext(_r_loc[0]+(250*scale), _l_loc[1] + (150*scale), string_hash_to_newline(pages[3]), -1, 680*scale);
}*/
🤖 Prompt for AI Agents
In objects/obj_controller/Create_0.gml around lines 1875 to 1881, there is a
block of commented-out code that is inactive and should be removed to keep the
codebase clean. Delete the entire commented section including the if-else
statements and their contents to eliminate dead code and improve
maintainability.

if (scr_click_left(60, true)){
obj_controller.menu++;
sprite_delete(left_page);

if (_double){
sprite_delete(right_page);
}
array_delete(pages,0,_double?2:1);

if (!array_length(pages)){
animate_out();
}
}
}
x+=x_turn_move;
y+=y_turn_move;
scale+=scale_change;
if (move_time>0){
move_time--;
}
}
}
remov=string_length(string(temp[65])+string(temp[66])+string(temp[67])+string(temp[68])+string(temp[69]))+1;

instance_create(0,0,obj_tooltip );

Expand Down
26 changes: 26 additions & 0 deletions objects/obj_controller/Draw_64.gml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ if (is_test_map==true){

var xx = 0;
var yy = 0;
// ** Welcome menu **
if (menu >= 500 && menu <= 510) {
//draw_sprite(spr_welcome_bg, 0, 0, 0);
// draw_sprite(spr_advisors,0,xx+16,yy+16);
scr_image("advisor/splash", 1, 16, 16, 310, 828);

draw_set_halign(fa_left);
draw_set_color(0);
draw_set_font(fnt_40k_14);
draw_set_halign(fa_center);
draw_text(702, 695, $"{menu - 499} (Press Any Key)");
draw_set_halign(fa_left);

}
servo_data_book.draw();



// Main UI
if (!zoomed && !zui){
draw_sprite(spr_new_ui,menu==0,0,0);
Expand Down Expand Up @@ -159,6 +177,14 @@ if (global.cheat_debug == true){
draw_text(1124, 7, string_hash_to_newline("DEBUG MODE"));
}

if (menu == 20){
if (trading==true){
if ((diplomacy>1) && is_struct(trade_attempt)){
trade_attempt.draw_trade_screen();
}
}
}


function draw_line(x1, y1, y_slide, variable) {
l_hei = 37;
Expand Down
2 changes: 1 addition & 1 deletion objects/obj_garbage_collector/Step_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if (gc_timer > 0) {
} else {


gc_timer = 50; // Default is every frame, so de-facto 1;
gc_timer = 50000; // Default is every frame, so de-facto 1;
gc_collect();

wait_and_execute(0, function(){
Expand Down
3 changes: 0 additions & 3 deletions scripts/scr_complex_colour_kit/scr_complex_colour_kit.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
function coord_relevative_positions(coords, xx, yy){
return [coords[0]+xx, coords[1]+yy,coords[2]+xx, coords[3]+yy];
}

enum eMarkings {
RIGHTPAD,
Expand Down
9 changes: 1 addition & 8 deletions scripts/scr_controller_helpers/scr_controller_helpers.gml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ function scr_menu_clear_up(specific_area_function) {

if ((zoomed == 0) && (cooldown <= 0) && (menu >= 500) && (menu <= 510)) {
if (mouse_y >= __view_get(e__VW.YView, 0) + 27) {
cooldown = 8000;
if ((menu >= 500) && (temp[menu - 434] == "")) {
menu = 0;
exit;
}
if ((menu < 503) && (menu != 0)) {
menu += 1;
}
global.ui_click_lock = true;
}
}

Expand Down
Loading