diff --git a/ChapterMaster.resource_order b/ChapterMaster.resource_order index 58f5b2f0c0..88b459ef4e 100644 --- a/ChapterMaster.resource_order +++ b/ChapterMaster.resource_order @@ -3,15 +3,21 @@ {"name":"textures","order":1,"path":"folders/Sprites/textures.yy",}, ], "ResourceOrderSettings": [ + {"name":"spr_scout_heads","order":8,"path":"sprites/spr_scout_heads/spr_scout_heads.yy",}, {"name":"spr_generic_sgt_mk4","order":7,"path":"sprites/spr_generic_sgt_mk4/spr_generic_sgt_mk4.yy",}, + {"name":"scr_fleet_advisor","order":4,"path":"scripts/scr_fleet_advisor/scr_fleet_advisor.yy",}, {"name":"spr_generic_sgt_mk5","order":3,"path":"sprites/spr_generic_sgt_mk5/spr_generic_sgt_mk5.yy",}, {"name":"spr_generic_sgt_mk7","order":1,"path":"sprites/spr_generic_sgt_mk7/spr_generic_sgt_mk7.yy",}, {"name":"spr_generic_sgt_mk8","order":2,"path":"sprites/spr_generic_sgt_mk8/spr_generic_sgt_mk8.yy",}, {"name":"scr_ground_ai_helpers","order":3,"path":"scripts/scr_ground_ai_helpers/scr_ground_ai_helpers.yy",}, {"name":"scr_player_fleet_functions","order":1,"path":"scripts/scr_player_fleet_functions/scr_player_fleet_functions.yy",}, {"name":"light_dark_shader","order":1,"path":"shaders/light_dark_shader/light_dark_shader.yy",}, + {"name":"scr_dungeon_map","order":6,"path":"scripts/scr_dungeon_map/scr_dungeon_map.yy",}, {"name":"scr_ork_fleet_functions","order":2,"path":"scripts/scr_ork_fleet_functions/scr_ork_fleet_functions.yy",}, {"name":"spr_generic_terminator_sgt","order":5,"path":"sprites/spr_generic_terminator_sgt/spr_generic_terminator_sgt.yy",}, + {"name":"scr_unit_testing_methods","order":7,"path":"scripts/scr_unit_testing_methods/scr_unit_testing_methods.yy",}, + {"name":"scr_dungeon_obstacles","order":5,"path":"scripts/scr_dungeon_obstacles/scr_dungeon_obstacles.yy",}, + {"name":"spr_ship_back_black","order":1,"path":"sprites/spr_ship_back_black/spr_ship_back_black.yy",}, {"name":"spr_generic_sgt_mk6","order":4,"path":"sprites/spr_generic_sgt_mk6/spr_generic_sgt_mk6.yy",}, {"name":"spr_generic_sgt_mk3","order":6,"path":"sprites/spr_generic_sgt_mk3/spr_generic_sgt_mk3.yy",}, ], diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index d9b13a0ad0..c7a9b03ad8 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -330,10 +330,12 @@ {"id":{"name":"spr_icon","path":"sprites/spr_icon/spr_icon.yy",},}, {"id":{"name":"spr_icon_chapters","path":"sprites/spr_icon_chapters/spr_icon_chapters.yy",},}, {"id":{"name":"spr_creation_icon","path":"sprites/spr_creation_icon/spr_creation_icon.yy",},}, + {"id":{"name":"spr_weapon_boltstorm_gauntlet","path":"sprites/spr_weapon_boltstorm_gauntlet/spr_weapon_boltstorm_gauntlet.yy",},}, {"id":{"name":"spr_cm_specialty","path":"sprites/spr_cm_specialty/spr_cm_specialty.yy",},}, {"id":{"name":"spr_planet_splash","path":"sprites/spr_planet_splash/spr_planet_splash.yy",},}, {"id":{"name":"spr_creation_arrow","path":"sprites/spr_creation_arrow/spr_creation_arrow.yy",},}, {"id":{"name":"spr_creation_check","path":"sprites/spr_creation_check/spr_creation_check.yy",},}, + {"id":{"name":"spr_scout_heads","path":"sprites/spr_scout_heads/spr_scout_heads.yy",},}, {"id":{"name":"spr_creation_founding","path":"sprites/spr_creation_founding/spr_creation_founding.yy",},}, {"id":{"name":"spr_creation_existing","path":"sprites/spr_creation_existing/spr_creation_existing.yy",},}, {"id":{"name":"scr_draw_armentarium","path":"scripts/scr_draw_armentarium/scr_draw_armentarium.yy",},}, @@ -358,6 +360,7 @@ {"id":{"name":"spr_chaplain_skull_helm","path":"sprites/spr_chaplain_skull_helm/spr_chaplain_skull_helm.yy",},}, {"id":{"name":"spr_aquila_colors","path":"sprites/spr_aquila_colors/spr_aquila_colors.yy",},}, {"id":{"name":"spr_artificer_colors","path":"sprites/spr_artificer_colors/spr_artificer_colors.yy",},}, + {"id":{"name":"scr_fleet_advisor","path":"scripts/scr_fleet_advisor/scr_fleet_advisor.yy",},}, {"id":{"name":"spr_beakie_colors","path":"sprites/spr_beakie_colors/spr_beakie_colors.yy",},}, {"id":{"name":"spr_dread_colors","path":"sprites/spr_dread_colors/spr_dread_colors.yy",},}, {"id":{"name":"scr_draw_unit_image","path":"scripts/scr_draw_unit_image/scr_draw_unit_image.yy",},}, @@ -443,6 +446,7 @@ {"id":{"name":"spr_save_data","path":"sprites/spr_save_data/spr_save_data.yy",},}, {"id":{"name":"spr_new_mm","path":"sprites/spr_new_mm/spr_new_mm.yy",},}, {"id":{"name":"spr_rock_bg","path":"sprites/spr_rock_bg/spr_rock_bg.yy",},}, + {"id":{"name":"spr_weapon_grav_gun","path":"sprites/spr_weapon_grav_gun/spr_weapon_grav_gun.yy",},}, {"id":{"name":"spr_ingame_menu","path":"sprites/spr_ingame_menu/spr_ingame_menu.yy",},}, {"id":{"name":"spr_sal_mk5_helm","path":"sprites/spr_sal_mk5_helm/spr_sal_mk5_helm.yy",},}, {"id":{"name":"spr_loadbar","path":"sprites/spr_loadbar/spr_loadbar.yy",},}, @@ -588,6 +592,7 @@ {"id":{"name":"spr_ship_slam","path":"sprites/spr_ship_slam/spr_ship_slam.yy",},}, {"id":{"name":"spr_ship_hulk","path":"sprites/spr_ship_hulk/spr_ship_hulk.yy",},}, {"id":{"name":"spr_fighta","path":"sprites/spr_fighta/spr_fighta.yy",},}, + {"id":{"name":"spr_weapon_hand_flamer","path":"sprites/spr_weapon_hand_flamer/spr_weapon_hand_flamer.yy",},}, {"id":{"name":"spr_ship_void","path":"sprites/spr_ship_void/spr_ship_void.yy",},}, {"id":{"name":"spr_faith_icon","path":"sprites/spr_faith_icon/spr_faith_icon.yy",},}, {"id":{"name":"spr_mk7_colors","path":"sprites/spr_mk7_colors/spr_mk7_colors.yy",},}, @@ -609,6 +614,7 @@ {"id":{"name":"spr_ship_leviathan","path":"sprites/spr_ship_leviathan/spr_ship_leviathan.yy",},}, {"id":{"name":"spr_ship_razorfiend","path":"sprites/spr_ship_razorfiend/spr_ship_razorfiend.yy",},}, {"id":{"name":"spr_ship_stalker","path":"sprites/spr_ship_stalker/spr_ship_stalker.yy",},}, + {"id":{"name":"spr_weapon_plasc","path":"sprites/spr_weapon_plasc/spr_weapon_plasc.yy",},}, {"id":{"name":"spr_ba_mk5_helm","path":"sprites/spr_ba_mk5_helm/spr_ba_mk5_helm.yy",},}, {"id":{"name":"spr_ship_prowler","path":"sprites/spr_ship_prowler/spr_ship_prowler.yy",},}, {"id":{"name":"spr_techmarine_core","path":"sprites/spr_techmarine_core/spr_techmarine_core.yy",},}, @@ -734,6 +740,7 @@ {"id":{"name":"snd_vode","path":"sounds/snd_vode/snd_vode.yy",},}, {"id":{"name":"snd_battle","path":"sounds/snd_battle/snd_battle.yy",},}, {"id":{"name":"snd_postbattle","path":"sounds/snd_postbattle/snd_postbattle.yy",},}, + {"id":{"name":"scr_dungeon_map","path":"scripts/scr_dungeon_map/scr_dungeon_map.yy",},}, {"id":{"name":"snd_defeat","path":"sounds/snd_defeat/snd_defeat.yy",},}, {"id":{"name":"snd_buzz","path":"sounds/snd_buzz/snd_buzz.yy",},}, {"id":{"name":"scr_unit_quick_find_pane","path":"scripts/scr_unit_quick_find_pane/scr_unit_quick_find_pane.yy",},}, @@ -771,6 +778,7 @@ {"id":{"name":"get_diag_string","path":"scripts/get_diag_string/get_diag_string.yy",},}, {"id":{"name":"scr_hit","path":"scripts/scr_hit/scr_hit.yy",},}, {"id":{"name":"scr_cheatcode","path":"scripts/scr_cheatcode/scr_cheatcode.yy",},}, + {"id":{"name":"spr_weapon_grav_pistol","path":"sprites/spr_weapon_grav_pistol/spr_weapon_grav_pistol.yy",},}, {"id":{"name":"scr_text_hit","path":"scripts/scr_text_hit/scr_text_hit.yy",},}, {"id":{"name":"spr_shutter_button","path":"sprites/spr_shutter_button/spr_shutter_button.yy",},}, {"id":{"name":"scr_colors_initialize","path":"scripts/scr_colors_initialize/scr_colors_initialize.yy",},}, @@ -830,6 +838,7 @@ {"id":{"name":"scr_move_unit_info","path":"scripts/scr_move_unit_info/scr_move_unit_info.yy",},}, {"id":{"name":"scr_en_weapon","path":"scripts/scr_en_weapon/scr_en_weapon.yy",},}, {"id":{"name":"scr_special_weapon","path":"scripts/scr_special_weapon/scr_special_weapon.yy",},}, + {"id":{"name":"scr_dungeon","path":"scripts/scr_dungeon/scr_dungeon.yy",},}, {"id":{"name":"spr_narthecium_2","path":"sprites/spr_narthecium_2/spr_narthecium_2.yy",},}, {"id":{"name":"scr_vehicle_weapon","path":"scripts/scr_vehicle_weapon/scr_vehicle_weapon.yy",},}, {"id":{"name":"scr_wep_abbreviate","path":"scripts/scr_wep_abbreviate/scr_wep_abbreviate.yy",},}, @@ -877,6 +886,7 @@ {"id":{"name":"scr_event_newlines","path":"scripts/scr_event_newlines/scr_event_newlines.yy",},}, {"id":{"name":"spr_generic_terminator_sgt","path":"sprites/spr_generic_terminator_sgt/spr_generic_terminator_sgt.yy",},}, {"id":{"name":"scr_event_gossip","path":"scripts/scr_event_gossip/scr_event_gossip.yy",},}, + {"id":{"name":"spr_weapon_grav_cannon","path":"sprites/spr_weapon_grav_cannon/spr_weapon_grav_cannon.yy",},}, {"id":{"name":"scr_alert","path":"scripts/scr_alert/scr_alert.yy",},}, {"id":{"name":"scr_popup","path":"scripts/scr_popup/scr_popup.yy",},}, {"id":{"name":"scr_turn_first","path":"scripts/scr_turn_first/scr_turn_first.yy",},}, @@ -890,6 +900,7 @@ {"id":{"name":"spr_bionics_leg","path":"sprites/spr_bionics_leg/spr_bionics_leg.yy",},}, {"id":{"name":"spr_bionics_eye","path":"sprites/spr_bionics_eye/spr_bionics_eye.yy",},}, {"id":{"name":"spr_bionics_arm","path":"sprites/spr_bionics_arm/spr_bionics_arm.yy",},}, + {"id":{"name":"scr_unit_testing_methods","path":"scripts/scr_unit_testing_methods/scr_unit_testing_methods.yy",},}, {"id":{"name":"scr_enemy_ai_c","path":"scripts/scr_enemy_ai_c/scr_enemy_ai_c.yy",},}, {"id":{"name":"scr_enemy_ai_d","path":"scripts/scr_enemy_ai_d/scr_enemy_ai_d.yy",},}, {"id":{"name":"scr_enemy_ai_e","path":"scripts/scr_enemy_ai_e/scr_enemy_ai_e.yy",},}, @@ -897,6 +908,7 @@ {"id":{"name":"scr_convert_to_string","path":"scripts/scr_convert_to_string/scr_convert_to_string.yy",},}, {"id":{"name":"scr_income","path":"scripts/scr_income/scr_income.yy",},}, {"id":{"name":"scr_apothecary_ship","path":"scripts/scr_apothecary_ship/scr_apothecary_ship.yy",},}, + {"id":{"name":"scr_dungeon_obstacles","path":"scripts/scr_dungeon_obstacles/scr_dungeon_obstacles.yy",},}, {"id":{"name":"scr_apothecary_ground","path":"scripts/scr_apothecary_ground/scr_apothecary_ground.yy",},}, {"id":{"name":"scr_mission_eta","path":"scripts/scr_mission_eta/scr_mission_eta.yy",},}, {"id":{"name":"scr_fleet_functions","path":"scripts/scr_fleet_functions/scr_fleet_functions.yy",},}, @@ -960,6 +972,7 @@ {"id":{"name":"action_if_number","path":"scripts/action_if_number/action_if_number.yy",},}, {"id":{"name":"action_if_variable","path":"scripts/action_if_variable/action_if_variable.yy",},}, {"id":{"name":"spr_medicine_icon","path":"sprites/spr_medicine_icon/spr_medicine_icon.yy",},}, + {"id":{"name":"spr_ship_back_black","path":"sprites/spr_ship_back_black/spr_ship_back_black.yy",},}, {"id":{"name":"action_kill_object","path":"scripts/action_kill_object/action_kill_object.yy",},}, {"id":{"name":"action_restart_game","path":"scripts/action_restart_game/action_restart_game.yy",},}, {"id":{"name":"action_set_alarm","path":"scripts/action_set_alarm/action_set_alarm.yy",},}, @@ -1024,6 +1037,7 @@ {"id":{"name":"spr_sw_mk7_helm","path":"sprites/spr_sw_mk7_helm/spr_sw_mk7_helm.yy",},}, {"id":{"name":"obj_en_in","path":"objects/obj_en_in/obj_en_in.yy",},}, {"id":{"name":"obj_en_husk","path":"objects/obj_en_husk/obj_en_husk.yy",},}, + {"id":{"name":"spr_weapon_boltstorm_gauntlets","path":"sprites/spr_weapon_boltstorm_gauntlets/spr_weapon_boltstorm_gauntlets.yy",},}, {"id":{"name":"scr_draw_text_shadow","path":"scripts/scr_draw_text_shadow/scr_draw_text_shadow.yy",},}, {"id":{"name":"obj_al_ship","path":"objects/obj_al_ship/obj_al_ship.yy",},}, {"id":{"name":"obj_al_capital","path":"objects/obj_al_capital/obj_al_capital.yy",},}, diff --git a/objects/obj_controller/Create_0.gml b/objects/obj_controller/Create_0.gml index ba6e9be8e4..9ecedcf380 100644 --- a/objects/obj_controller/Create_0.gml +++ b/objects/obj_controller/Create_0.gml @@ -93,6 +93,7 @@ current_eventing=""; chaos_rating=0; chapter_made = 0; obj_cuicons.alarm[1]=1; // Clean up custom icons +dungeon=false; diplomacy_pathway = ""; option_selections=[]; @@ -1746,3 +1747,4 @@ if (vih>=5){ remov=string_length(string(temp[65])+string(temp[66])+string(temp[67])+string(temp[68])+string(temp[69]))+1; action_set_alarm(2, 0); + diff --git a/objects/obj_controller/Draw_0.gml b/objects/obj_controller/Draw_0.gml index b0ad74b5eb..07d41613bd 100644 --- a/objects/obj_controller/Draw_0.gml +++ b/objects/obj_controller/Draw_0.gml @@ -1,6 +1,5 @@ // Draws the main UI menu. The function is used to highlight if you selected something in the menu var l_hei=37,l_why=0; - if (instance_exists(obj_ncombat)) then exit; if (instance_exists(obj_fleet)) then exit; if (global.load>0) then exit; @@ -12,191 +11,17 @@ if (is_test_map==true){ draw_line_width(room_width/2,room_height/2,(room_width/2)+lengthdir_x(3000,terra_direction),(room_height/2)+lengthdir_y(3000,terra_direction),4); draw_set_alpha(1); } -// if (instance_exists(obj_turn_end)) then exit; -try{ - script_execute(scr_ui_manage,0,0,0,0,0); -} catch(_exception){ - show_debug_message(_exception.message); - manage = 0; - menu = 0; - -} -try{ - script_execute(scr_ui_advisors,0,0,0,0,0); -} catch(_exception){ - manage = 0; - menu = 0; -} -try{ - script_execute(scr_ui_diplomacy,0,0,0,0,0); -} catch(_exception){ - manage = 0; - menu = 0; -} -try{ - script_execute(scr_ui_settings,0,0,0,0,0); -} catch(_exception){ - manage = 0; - menu = 0; +if (is_struct(dungeon)){ + dungeon.draw(); +} else { + controller_standard_draw(); } +// if (instance_exists(obj_turn_end)) then exit; var xx =__view_get( e__VW.XView, 0 ); var yy =__view_get( e__VW.YView, 0 ); // Main UI -if (zoomed==0) and (zui==0){ - draw_sprite(spr_new_ui,0,xx+0,yy+0); - draw_set_color(c_white); - // Buttons here - draw_sprite(spr_ui_but_4,0,xx+1374,yy+8); - draw_sprite(spr_ui_but_4,0,xx+1484,yy+8); - - menu_buttons.chapter_manage.draw(xx+34,yy+838+y_slide, "Chapter Management",1,1,145) - menu_buttons.chapter_settings.draw(xx+179,yy+838+y_slide, "Chapter Settings",1,1,145) - menu_buttons.apoth.draw(xx+357,yy+838+y_slide, "Apothecarium") - menu_buttons.reclu.draw(xx+473,yy+838+y_slide, "Reclusium") - menu_buttons.lib.draw(xx+590,yy+838+y_slide, "Librarium") - menu_buttons.arm.draw(xx+706,yy+838+y_slide, "Armamentarium") - menu_buttons.recruit.draw(xx+822,yy+838+y_slide, "Recruitment") - menu_buttons.fleet.draw(xx+938,yy+838+y_slide, "Fleet") - menu_buttons .diplo.draw(xx+1130,yy+838+y_slide, "Diplomacy",1,1,145) - menu_buttons .event.draw(xx+1275,yy+838+y_slide, "Event Log",1,1,145) - menu_buttons .end_turn.draw(xx+1420,yy+838+y_slide, "End Turn",1,1,145); - - // Highlight here - draw_set_blend_mode(bm_add); - draw_set_alpha(h_options*2); - if (h_options>0) then draw_sprite(spr_ui_hov_4,0,xx+1374,yy+8+y_slide); - draw_set_alpha(h_menu*2); - if (h_menu>0) then draw_sprite(spr_ui_hov_4,0,xx+1484,yy+8+y_slide); - draw_set_blend_mode(bm_normal); - draw_set_alpha(1); - - // Text here - draw_set_color(c_white); - draw_set_halign(fa_center); - draw_set_font(fnt_cul_18); - - draw_text(xx+1427,yy+14,string_hash_to_newline("Help")); - draw_text(xx+1537,yy+14,string_hash_to_newline("Menu")); - - if (y_slide>0) then draw_set_alpha((100-(y_slide*2))/100); - - draw_set_alpha(1); - draw_sprite(spr_new_banner,0,xx+1439+new_banner_x,yy+62); - draw_sprite(spr_new_ui_cover,0,xx+0,yy+(900-17)); - // Handles custom chapters - if (string_count("custom",obj_ini.icon_name)>0){ - var cusl=string_replace(obj_ini.icon_name,"custom",""); - cusl=real(cusl); - if (obj_cuicons.spr_custom[cusl]>0) and (obj_cuicons.spr_custom_icon[cusl]!=-1){ - draw_sprite_stretched(obj_cuicons.spr_custom_icon[cusl],0,xx+1451+new_banner_x,yy+73,141,141); - } - } - // Handles icon for normal chapters - if (string_count("custom",obj_ini.icon_name)==0){ - var icon_sprite=spr_icon,icc=obj_ini.icon; - if (icc<=20) then scr_image("creation",icc,xx+1451+new_banner_x,yy+73,141,141); - if (icc>20){ - icon_sprite=spr_icon_chapters; - icc-=19; - draw_sprite(icon_sprite,icc,xx+1451+new_banner_x,yy+73); - } - } - - draw_set_color(38144); - draw_set_font(fnt_menu); - draw_set_halign(fa_center); - // Draws the sector name - draw_text(xx+775,yy+17,string_hash_to_newline("Sector "+string(obj_ini.sector_name))); - draw_text(xx+775.5,yy+17.5,string_hash_to_newline("Sector "+string(obj_ini.sector_name))); - - // Checks if you are penitent - if (obj_controller.faction_status[eFACTION.Imperium]!="War"){ - if (penitent_max==0){ - draw_text(xx+998,yy+17,string_hash_to_newline("Loyal")); - draw_text(xx+998,yy+17.5,string_hash_to_newline("Loyal")); - } - if (penitent_max>0){ - var endb=0,endb2=""; - endb=min(0,(((penitent_turn+1)*(penitent_turn+1))-120)*-1); - if (endb<0) then endb2=" "+string(endb); - draw_set_color(c_red); - draw_text(xx+998,yy+17,string_hash_to_newline(string(min(100,floor((penitent_current/penitent_max)*100)))+"% Penitent")); - draw_text(xx+998,yy+17.5,string_hash_to_newline(string(min(100,floor((penitent_current/penitent_max)*100)))+"% Penitent")); - draw_set_color(38144); - // TODO Need a tooltip for here to display the actual amounts - } - } - // Sets you to renegade - if (obj_controller.faction_status[eFACTION.Imperium]=="War"){ - draw_set_color(255); - draw_text(xx+998,yy+17,string_hash_to_newline("Renegade")); - draw_text(xx+998,yy+17.5,string_hash_to_newline("Renegade")); - draw_set_color(38144); - } - // Checks if the chapter name is less than 140 chars, adjusts chapter_master_name_width accordingly - var chapter_master_name_width=1; - for(var i=0; i<10; i++){ - if ((string_width(string_hash_to_newline(string(global.chapter_name)))*chapter_master_name_width)>140) then chapter_master_name_width-=0.1; - } - - draw_text_transformed(xx+1520+new_banner_x,yy+208,string_hash_to_newline(string(global.chapter_name)),chapter_master_name_width,1,0); - draw_text_transformed(xx+1520.5+new_banner_x,yy+208.5,string_hash_to_newline(string(global.chapter_name)),chapter_master_name_width,1,0); - // Shows the date to be displayed - var yf=""; - if (year_fraction<10) then yf="00"+string(year_fraction); - if (year_fraction>=10) and (year_fraction<100) then yf="0"+string(year_fraction); - if (year_fraction>=100) then yf=string(year_fraction); - draw_text(xx+1520+new_banner_x,yy+228,string_hash_to_newline(string(check_number)+" "+string(yf)+" "+string(year)+".M"+string(millenium))); - // Shows the income on the menu - var inc=""; - if (income_last>0) then inc="+"+string(round(income_last)); - if (income_last<0) then inc=string(round(income_last)); - draw_set_font(fnt_40k_14); - draw_set_halign(fa_left); - // Draws the requisition amount - draw_sprite(spr_new_resource,0,xx+14,yy+16); - draw_set_color(16291875); - draw_text(xx+36,yy+16,string_hash_to_newline(string(floor(requisition))+string(inc))); - draw_text(xx+36.5,yy+16.5,string_hash_to_newline(string(floor(requisition))+string(inc))); - // Draws forge points - draw_sprite_ext(spr_forge_points_icon, 0, xx+160, yy+15, 0.3, 0.3, 0, c_white, 1) - draw_set_color(#af5a00) - draw_text(xx+180,yy+16, string(forge_points)); - draw_text(xx+180.5,yy+16.5, string(forge_points)); - // Draws the current loyalty - draw_sprite(spr_new_resource,1,xx+267,yy+17); - draw_set_color(1164001); - draw_text(xx+290,yy+16,string_hash_to_newline(string(loyalty))); - draw_text(xx+290.5,yy+16.5,string_hash_to_newline(string(loyalty))); - // Draws the current gene seed - draw_sprite(spr_new_resource,2,xx+355,yy+17); - draw_set_color(c_red); - draw_text(xx+370,yy+16,string_hash_to_newline(string(gene_seed))); - draw_text(xx+370.5,yy+16.5,string_hash_to_newline(string(gene_seed))); - // Draws the current marines in your command - draw_sprite(spr_new_resource,3,xx+475-10,yy+17); - draw_set_color(16291875); - draw_text(xx+495-10,yy+16,string_hash_to_newline(string(marines)+"/"+string(command))); - draw_text(xx+495.5-10,yy+16.5,string_hash_to_newline(string(marines)+"/"+string(command))); - - if (menu==0){ - location_viewer.draw(); - } -} - -draw_set_font(fnt_40k_14b); -draw_set_color(c_red); -draw_set_halign(fa_left); -draw_set_alpha(1); -// Sets up debut mode -if (global.cheat_debug == true){ - draw_text((__view_get((0 << 0), 0) + 1124), (__view_get((1 << 0), 0) + 7), string_hash_to_newline("DEBUG MODE")); -} - -script_execute(scr_ui_popup,0,0,0,0,0); - function draw_line(x1, y1, y_slide, variable) { l_hei = 37; diff --git a/objects/obj_controller/Step_0.gml b/objects/obj_controller/Step_0.gml index e57eff7168..a40edf3b8c 100644 --- a/objects/obj_controller/Step_0.gml +++ b/objects/obj_controller/Step_0.gml @@ -528,7 +528,7 @@ if (menu==1 && (managing>0 || managing<0)){ if (!is_array(last_unit)){ last_unit=[0,0]; } - if (unit.base_group != "none") && (last_unit[1]!=unit.marine_number){ + if (unit.base_group != "none") && (last_unit[1]!=unit.marine_number || last_unit[0]!=unit.company){ last_unit=[unit.company,unit.marine_number] marine_armour[0]=unit.armour(); fix_right=0; diff --git a/objects/obj_credits/Draw_0.gml b/objects/obj_credits/Draw_0.gml index eb5d6e464e..f7502e6bf9 100644 --- a/objects/obj_credits/Draw_0.gml +++ b/objects/obj_credits/Draw_0.gml @@ -89,8 +89,5 @@ if (instance_exists(obj_main_menu_buttons)){ } draw_set_alpha(1); } -if (mouse_check_button(mb_right)||mouse_check_button(mb_left)){ - instance_destroy(); -} /* */ /* */ diff --git a/objects/obj_main_menu_buttons/Draw_0.gml b/objects/obj_main_menu_buttons/Draw_0.gml index 30e4fcd844..745d84aa00 100644 --- a/objects/obj_main_menu_buttons/Draw_0.gml +++ b/objects/obj_main_menu_buttons/Draw_0.gml @@ -86,18 +86,17 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i switch(i){ case 0: ini_open("saves.ini"); - var skap=0; - skap = ini_read_real("Data", "tutorial", 0); + var skip_tutorial_option=0; + skip_tutorial_option = ini_read_real("Data", "tutorial", 0); ini_close(); cooldown=9999; button=1; - if (skap=1){ + if (skip_tutorial_option){ obj_main_menu_buttons.fading=1; obj_main_menu_buttons.crap=2; obj_main_menu_buttons.cooldown=9999; - } - if (skap=0){ + }else { var pop; pop=instance_create(0,0,obj_popup); pop.size=1;pop.title="Tutorial"; @@ -114,11 +113,11 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i button=0; break; case 2: - instance_create(0,0,obj_credits); + /*instance_create(0,0,obj_credits); obj_main_menu.menu=3; fading=0; fade=0; - button=0; + button=0;*/ break; case 3: with(obj_cursor){instance_destroy();} @@ -134,15 +133,16 @@ if (instance_exists(obj_main_menu)) and (!instance_exists(obj_saveload)) and (!i if (obj_main_menu.tim4>0) and (obj_main_menu.menu!=3) then with(obj_main_menu){ draw_set_font(fnt_menu);draw_set_halign(fa_center); - var wfd,xx,yy,wad;wfd="";// xx=1138;yy=532;wad=430; - xx=room_width/2;yy=850;wad=800; + var wfd="";// xx=1138;yy=532;wad=430; + var xx=room_width/2,yy=850,wad=800; if (word_from_duke!="blank") and (word_from_duke!="") then wfd=word_from_duke; if (word_from_duke2!="blank") and (word_from_duke2!="") then wfd=word_from_duke2; if (wfd!="blank") and (wfd!="") and (obj_main_menu.tim4<400){ draw_set_alpha((tim4-20)/50); - draw_set_color(c_yellow); + + set_color(c_yellow); draw_text_ext_transformed(xx,yy,string_hash_to_newline("Server: "+string(wfd)),-1,wad,1,1,0); draw_text_ext_transformed(xx+0.5,yy+0.5,string_hash_to_newline("Server: "+string(wfd)),-1,wad,1,1,0); diff --git a/objects/obj_p_fleet/Draw_0.gml b/objects/obj_p_fleet/Draw_0.gml index 246d2e40c7..3757815bed 100644 --- a/objects/obj_p_fleet/Draw_0.gml +++ b/objects/obj_p_fleet/Draw_0.gml @@ -42,11 +42,11 @@ if (action!=""){ if (array_length(complex_route)>0){ var next_loc = instance_nearest(action_x,action_y, obj_star); for (var i=0;i search_params[stat][1]){ - match = false; - break; - } - } - } - return match; -} function collect_by_religeon(religion, sub_cult="", location=""){ var units = [], unit, count=0, add=false; diff --git a/scripts/scr_add_artifact/scr_add_artifact.gml b/scripts/scr_add_artifact/scr_add_artifact.gml index acce70b8d0..47dc722120 100644 --- a/scripts/scr_add_artifact/scr_add_artifact.gml +++ b/scripts/scr_add_artifact/scr_add_artifact.gml @@ -16,80 +16,81 @@ function scr_add_artifact(artifact_type, artifact_tags, is_identified, artifact_ last_artifact = find_open_artifact_slot(); if (last_artifact==-1) then exit; - + var tags = []; var good=true, new_tags; var rand1=floor(random(100))+1; var rand2=floor(random(100))+1; - var t1="",t2="",t3="",t4="",t5=""; + var base_type="",base_type_detail="",t3="",t4="",t5=""; if (artifact_type="random") or (artifact_type="random_nodemon"){ if (good){ - if (rand1<=45){t1="Weapon";} - else if (rand1<=80){t1="Armour";} - else if (rand1<=90){t1="Gear";} - else if (rand1<=100){t1="Device";} + if (rand1<=45){base_type="Weapon";} + else if (rand1<=80){base_type="Armour";} + else if (rand1<=90){base_type="Gear";} + else if (rand1<=100){base_type="Device";} good=false; } } - if (t1==""){ - if (array_contains(["Weapon","Armour","Gear","Device"],artifact_type)) then t1=artifact_type ; + if (base_type==""){ + if (array_contains(["Weapon","Armour","Gear","Device"],artifact_type)) then base_type=artifact_type ; if (artifact_type="Robot"){ - t1="Device";t2="Robot"; + base_type="Device"; + base_type_detail="Robot"; } else if (artifact_type="Tome"){ - t1="Device"; - t2="Tome"; + base_type="Device"; + base_type_detail="Tome"; } if (artifact_type="chaos_gift"){ - t1="Device"; - t2=choose("Casket","Chalice","Statue"); + base_type="Device"; + base_type_detail=choose("Casket","Chalice","Statue"); } } - if (t1="Weapon") and (t2==""){ + if (base_type="Weapon") and (base_type_detail==""){ if (rand2<=30){ - t2="Bolter"; + base_type_detail="Bolter"; good=false; } - else if (rand2<=40){t2="Plasma Pistol";} - else if (rand2<=50 ){t2="Plasma Gun";} - else if (rand2<=70){t2=choose("Power Sword","Power Axe","Power Spear","Lightning Claw");} - else if (rand2<=90 ){t2=choose("Power Fist","Power Fist","Lightning Claw");} - else if (rand2<=100 ){t2=choose("Relic Blade","Thunder Hammer");} + else if (rand2<=40){base_type_detail="Plasma Pistol";} + else if (rand2<=50 ){base_type_detail="Plasma Gun";} + else if (rand2<=70){base_type_detail=choose("Power Sword","Power Axe","Power Spear","Lightning Claw");} + else if (rand2<=90 ){base_type_detail=choose("Power Fist","Power Fist","Lightning Claw");} + else if (rand2<=100 ){base_type_detail=choose("Relic Blade","Thunder Hammer");} } - if (t1="Armour") and (t2=""){ + if (base_type="Armour") and (base_type_detail=""){ if (rand2<=70){ - t2=global.power_armour[irandom(array_length(global.power_armour)-1)] + base_type_detail=global.power_armour[irandom(array_length(global.power_armour)-1)] }; - else if (rand2<=80){t2=choose("Terminator Armour","Tartaros","Cataphractii Pattern Terminator",);} - else if (rand2<=90){t2="Dreadnought Armour";} - else if (rand2<=100){t2="Artificer Armour";} + else if (rand2<=80){base_type_detail=choose("Terminator Armour","Tartaros","Cataphractii Pattern Terminator",);} + else if (rand2<=90){base_type_detail="Dreadnought Armour";} + else if (rand2<=100){base_type_detail="Artificer Armour";} } - if (t1="Gear") and (t2=""){good=0; - if (rand2<=20){t2="Rosarius";} - else if (rand2<=45){t2="Psychic Hood";} - else if (rand2<=80){t2="Jump Pack";} - else if (rand2<=100){t2="Servo Arms";} + if (base_type="Gear") and (base_type_detail=""){good=0; + if (rand2<=20){base_type_detail="Rosarius";} + else if (rand2<=45){base_type_detail="Psychic Hood";} + else if (rand2<=80){base_type_detail="Jump Pack";} + else if (rand2<=100){base_type_detail="Servo Arms";} } - if (t1="Device") and (t2=""){good=0; - if (rand2<=30){t2="Casket";} - else if (rand2<=50){t2="Chalice";} - else if (rand2<=70){t2="Statue";} - else if (rand2<=90){t2="Tome";} - else if (rand2<=100){t2="Robot";} + if (base_type="Device") and (base_type_detail=""){good=0; + if (rand2<=30){base_type_detail="Casket";} + else if (rand2<=50){base_type_detail="Chalice";} + else if (rand2<=70){base_type_detail="Statue";} + else if (rand2<=90){base_type_detail="Tome";} + else if (rand2<=100){base_type_detail="Robot";} } if (artifact_type="good"){ var haha;haha=choose(1,2,3,4); - if (haha=1){t1="Weapon";t2="Relic Blade";} - else if (haha=2){t1="Weapon";t2="Plasma Gun";} - else if (haha=3){t1="Gear";t2="Rosarius";} - else if (haha=4){t1="Armour";t2="Terminator Armour";} + if (haha=1){base_type="Weapon";base_type_detail="Relic Blade";} + else if (haha=2){base_type="Weapon";base_type_detail="Plasma Gun";} + else if (haha=3){base_type="Gear";base_type_detail="Rosarius";} + else if (haha=4){base_type="Armour";base_type_detail="Terminator Armour";} } @@ -97,55 +98,80 @@ function scr_add_artifact(artifact_type, artifact_tags, is_identified, artifact_ rand2=floor(random(100))+1;good=0; if (string_count("Shit",obj_ini.strin2)>0){rand2=min(rand2+20,100);} if (rand2<=70){t3="";} - else if (rand2<=90 && artifact_type!="random_nodemon"){t3="chaos";} - else if (rand2<=100 && artifact_type!="random_nodemon"){t3="daemonic";} + else if (rand2<=90 && artifact_type!="random_nodemon"){ + array_push(tags, "chaos"); + } + else if (rand2<=100 && artifact_type!="random_nodemon"){ + array_push(tags, "daemonic"); + } - if (t1="Weapon"){ + if (base_type="Weapon"){ // gold, glowing, underslung bolter, underslung flamer t5=choose("GOLD","GLOW","UBOLT","UFL"); // Runes, scope, adamantium, void t4=choose("RUNE","SCOPE","ADAMANTINE","VOI"); - if ((t2="Power Sword") or (t2="Power Axe") or (t2="Power Spear")) and (t4="SCOPE") then t4="CHB";// chainblade - if ((t2="Power Fist") or (t2="Power Claw")) and (t4="SCOPE") then t4="DUB";// doubled up - if (t2="Thunder Hammer") and (t4="RUNE") then t4="GLOW";//glowing runed - if (t2="Relic Blade") and (t4="SCOPE") then t4="UFL";// underslung flamer - }else if (t1="Armour"){ + if ((base_type_detail="Power Sword") or (base_type_detail="Power Axe") or (base_type_detail="Power Spear")) and (t4="SCOPE") then t4="CHB";// chainblade + if ((base_type_detail="Power Fist") or (base_type_detail="Power Claw")) and (t4="SCOPE") then t4="DUB";// doubled up + if (base_type_detail="Thunder Hammer") and (t4="RUNE") then t4="GLOW";//glowing runed + if (base_type_detail="Relic Blade") and (t4="SCOPE") then t4="UFL";// underslung flamer + array_push(tags, t4); + }else if (base_type="Armour"){ // golden filigree, glowing optics, purity seals t5=choose("GOLD","GLOW","PUR"); + array_push(tags, t5); // articulated plates, spikes, runes, drake scales t4=choose("ART","SPIKES","RUNE","DRA"); - }else if (t1="Gear"){ + array_push(tags, t4); + }else if (base_type="Gear"){ // supreme construction, adamantium, gold t4=choose("SUP","ADAMANTINE","GOLD");// bur = ever burning - if (t2="Rosarius") then t5=choose("GOLD","GLOW","BIG","BUR"); - if (t2="Bionics") then t5=choose("GOLD","GLOW","RUNE","SOO");// Soothing appearance - if (t2="Psychic Hood") then t5=choose("FIN","GOLD","BUR","MASK");// fine cloth, gold, ever burning, mask - if (t2="Jump Pack") then t5=choose("SPIKES","SKRE","WHI","SILENT");// spikes, screaming, white flame, silent - if (t2="Servo Arms") then t5=choose("GOLD","TENTACLES","GOR","SOO");// gold, tentacles, gorilla build, soothing appearance - }else if (t1="Device") and (t2!="Robot"){ + if (base_type_detail="Rosarius") then t5=choose("GOLD","GLOW","BIG","BUR"); + if (base_type_detail="Bionics") then t5=choose("GOLD","GLOW","RUNE","SOO");// Soothing appearance + if (base_type_detail="Psychic Hood") then t5=choose("FIN","GOLD","BUR","MASK");// fine cloth, gold, ever burning, mask + if (base_type_detail="Jump Pack") then t5=choose("SPIKES","SKRE","WHI","SILENT");// spikes, screaming, white flame, silent + if (base_type_detail="Servo Arms") then t5=choose("GOLD","TENTACLES","GOR","SOO");// gold, tentacles, gorilla build, soothing appearance + array_push(tags, t5); + }else if (base_type="Device") and (base_type_detail!="Robot"){ t4=choose("GOLD","CRU","GLOW","ADAMANTINE");// skulls, falling angel, thin, tentacle, mindfuck - if (t2!="Statue") then t5=choose("SKU","FAL","THI","TENTACLES","MIN"); + if (base_type_detail!="Statue") then t5=choose("SKU","FAL","THI","TENTACLES","MIN"); // goat, speechless, dying angel, jumping into magma, cheshire grunx - if (t2="Statue") then t5=choose("GOAT","SPE","DYI","JUM","CHE"); + if (base_type_detail="Statue") then t5=choose("GOAT","SPE","DYI","JUM","CHE"); // Gold, glowing, preserved flesh, adamantium - if (t2="Tome") then t4=choose("GOLD","GLOW","PRE","ADAMANTINE","SAL","BUR"); + if (base_type_detail="Tome") then t4=choose("GOLD","GLOW","PRE","ADAMANTINE","SAL","BUR"); if (t4="PRE") and (t3="") then t3=choose("","chaos","daemonic"); - }else if (t1="Device") and (t2="Robot"){// human/robutt/shivarah + array_push(tags, t4); + array_push(tags, t3); + array_push(tags, t5); + }else if (base_type="Device") and (base_type_detail="Robot"){// human/robutt/shivarah t4=choose("HU","RO","SHI"); t5=choose("ADAMANTINE","JAD","BRO","RUNE"); + array_push(tags, t5); + array_push(tags, t4); } var big=choose(1,2); // if (big=1 || artifact_tags="minor") then t5=""; - if (artifact_tags="minor"){t4="";t5="";t3+="MINOR";} - if (artifact_tags="inquisition") then t3+="inq"; - if ((artifact_tags="daemonic"||artifact_tags="daemonic")) and (t2!="Tome") then t3="daemonic"+choose("1a","2a","3a","4a"); - if ((artifact_tags="daemonic" || artifact_tags="daemonic")) and (t2="Tome") then t3="daemonic"+choose("2a","3a","4a"); - if (artifact_type="chaos_gift") then t3="daemonic"; + if (artifact_tags="minor"){ + t4="";t5="";t3="MINOR"; + array_push(tags, t3); + } + if (artifact_tags="inquisition") then array_push(tags, "inq"); + if ((artifact_tags="daemonic"||artifact_tags="daemonic")) and (base_type_detail!="Tome"){ + t3="daemonic"+choose("1a","2a","3a","4a"); + array_push(tags, t3); + } + if ((artifact_tags="daemonic" || artifact_tags="daemonic")) and (base_type_detail="Tome"){ + t3="daemonic"+choose("2a","3a","4a"); + array_push(tags, t3); + } + if (artifact_type="chaos_gift"){ + array_push(tags, "daemonic"); + array_push(tags, "chaos_gift"); + } // show_message(string(t3)); - obj_ini.artifact[last_artifact]=t2; - obj_ini.artifact_tags[last_artifact]=[t4,t5,t3]; + obj_ini.artifact[last_artifact]=base_type_detail; + obj_ini.artifact_tags[last_artifact]=tags; // show_message(string(obj_ini.artifact_tags[last_artifact])); @@ -161,6 +187,7 @@ function scr_add_artifact(artifact_type, artifact_tags, is_identified, artifact_ scr_recent("artifact_acquired",string(obj_ini.artifact_tags[last_artifact]),last_artifact); + return last_artifact; } @@ -210,7 +237,11 @@ function arti_struct(Index)constructor{ static inquisition_disprove = function(){ var inquis_tags = ["daemonic","chaos_gift", "chaos"]; - if (has_tag("inq")) then return false; + if (has_tag("inq")){ + return false; + } else { + return has_tags(inquis_tags); + } } static load_json_data = function(data){ diff --git a/scripts/scr_cheatcode/scr_cheatcode.gml b/scripts/scr_cheatcode/scr_cheatcode.gml index 4c8cb03bee..41904ee41a 100644 --- a/scripts/scr_cheatcode/scr_cheatcode.gml +++ b/scripts/scr_cheatcode/scr_cheatcode.gml @@ -28,6 +28,13 @@ function scr_cheatcode(argument0) { forge_queue_logic(); } } + if (cheatcode_string=="dungeon"){ + obj_controller.dungeon = new dungeon_struct(); + squad=obj_ini.squads[5]; + for (var i =0;i0) { if (string_count("crusade", cheatcode_string) >0) { show_debug_message("crusading"); diff --git a/scripts/scr_company_order/scr_company_order.gml b/scripts/scr_company_order/scr_company_order.gml index 30e4a19ae6..4811eba065 100644 --- a/scripts/scr_company_order/scr_company_order.gml +++ b/scripts/scr_company_order/scr_company_order.gml @@ -77,8 +77,8 @@ function scr_company_order(company) { break; } } catch( _exception) { - show_debug_message("{0}",_exception) - show_debug_message("{0},{1}",squad_member,squads[unit.squad].members) + show_debug_message("{0}",_exception); + unit.squad="none"; } } if (!found){unit.squad = "none"} diff --git a/scripts/scr_distributions/scr_distributions.gml b/scripts/scr_distributions/scr_distributions.gml index 4086b6a059..9fbdb9bde9 100644 --- a/scripts/scr_distributions/scr_distributions.gml +++ b/scripts/scr_distributions/scr_distributions.gml @@ -5,13 +5,25 @@ function gauss(base, sd){ do { x1 = random(2) - 1; x2 = random(2) - 1; - w = (x1 * x1) + (x2 * x2); + w = sqr(x1)+sqr(x2); } until (0 < w and w < 1); w = sqrt(-2 * ln(w) / w); return base + sd * x1 * w; } +function gauss_positive(base, sd){ + var x1, x2, w; + do { + x1 = random_range(0, 1); + x2 = random_range(0, 1); + w = sqr(x1)+sqr(x2); + } until (0 < w and w < 1); + + w = sqrt(-2 * ln(w) / w); + return base + (sd * x1 * w); +} + function pareto(base, exponent=1){ return base * (1 - power(random(1), 1 / (1 + exponent))); } diff --git a/scripts/scr_draw_armentarium/scr_draw_armentarium.gml b/scripts/scr_draw_armentarium/scr_draw_armentarium.gml index 46693ed814..6d0f388e25 100644 --- a/scripts/scr_draw_armentarium/scr_draw_armentarium.gml +++ b/scripts/scr_draw_armentarium/scr_draw_armentarium.gml @@ -93,12 +93,14 @@ function drop_down(selection, draw_x, draw_y, options,open_marker){ function same_locations(first_loc,second_loc){ var same_loc = false; - if (first_loc[2] != "warp" && first_loc[2] != "lost"){ - if (first_loc[2] == second_loc[2]) then same_loc=true; - } else { - if (first_loc[1] == second_loc[1]) && - (first_loc[0] == second_loc[0]){ - same_loc=true; + if (is_array(first_loc)&& is_array(second_loc)){ + if (first_loc[2] != "warp" && first_loc[2] != "lost"){ + if (first_loc[2] == second_loc[2]) then same_loc=true; + } else { + if (first_loc[1] == second_loc[1]) && + (first_loc[0] == second_loc[0]){ + same_loc=true; + } } } return same_loc; @@ -114,6 +116,9 @@ function calculate_research_points(turn_end=false){ var tech_locations=[] var techs = collect_role_group("forge"); for (var i=0; i40 && techs[i].hp() >0){ research_points += techs[i].technology-40; @@ -130,9 +135,6 @@ function calculate_research_points(turn_end=false){ } } tech_locations[i] = techs[i].marine_location(); - if (techs[i].IsSpecialist("heads")){ - forge_master=i; - } } if (forge_master>-1){ obj_controller.master_of_forge = techs[forge_master]; diff --git a/scripts/scr_draw_text_bold/scr_draw_text_bold.gml b/scripts/scr_draw_text_bold/scr_draw_text_bold.gml index 5a0c7bb9b0..b94a11cf53 100644 --- a/scripts/scr_draw_text_bold/scr_draw_text_bold.gml +++ b/scripts/scr_draw_text_bold/scr_draw_text_bold.gml @@ -3,4 +3,18 @@ function draw_text_bold(_x, _y, _text){ draw_text(_x, _y, _text); draw_text(_x+0.5, _y+0.5, _text); +} + +function draw_line(x1, y1, y_slide, variable) { + l_hei = 37; + l_why = 0; + + if (variable > 0) { + if (variable > 94) { + l_hei = 134 - variable; + l_why = min(variable - 96, 11); + } + + draw_line(view_xview[0] + variable + x1, view_yview[0] + 10 + 1 + l_why, view_xview[0] + variable + x1, view_yview[0] + 10 + 37 - l_why); + } } \ No newline at end of file diff --git a/scripts/scr_draw_unit_image/scr_draw_unit_image.gml b/scripts/scr_draw_unit_image/scr_draw_unit_image.gml index 915be689f7..4872e1e423 100644 --- a/scripts/scr_draw_unit_image/scr_draw_unit_image.gml +++ b/scripts/scr_draw_unit_image/scr_draw_unit_image.gml @@ -33,6 +33,19 @@ function unit_image(unit_surface) constructor{ draw_surface_part(u_surface, left+200, top+90, width,height, xx,yy); } } + + static draw_part_ext = function(xx, yy,left,top,width,height,xscale, yscale,_background=false, alpha=1){ + if (_background){ + draw_rectangle_color_simple(xx-1+left,yy-1+top,xx+1+(width*xscale),yy+(height*yscale)+1,0,c_black); + draw_rectangle_color_simple(xx-1+left,yy-1+top,xx+(width*xscale)+1,yy+(height*yscale)+1,1,c_gray); + draw_rectangle_color_simple(xx-2+left,yy-2+top,xx+(width*xscale)+2,yy+2+(height*yscale),1,c_black); + draw_rectangle_color_simple(xx-3+left,yy-3+top,xx+(width*xscale)+3,yy+3+(height*yscale),1,c_gray); + } + if (surface_exists(u_surface)){ + draw_surface_part_ext(u_surface, left+200, top+90, width,height, xx,yy, xscale, yscale, c_white, alpha); + } + } + } //TODO this is a laxy fix and can be written better @@ -148,7 +161,7 @@ function scr_draw_unit_image(_background=false){ draw_clear_alpha(c_black, 0);//RESET surface draw_set_font(fnt_40k_14b); draw_set_color(c_gray); - var xx=__view_get( e__VW.XView, 0 )+0, yy=__view_get( e__VW.YView, 0 )+0, bb="", img=0; + var bb="", img=0; var blandify = obj_controller.blandify; var draw_sequence = []; if (name_role()!="") and (base_group=="astartes"){ @@ -180,7 +193,7 @@ function scr_draw_unit_image(_background=false){ var arm_bypass = false; var armour_draw =[]; ui_coloring=""; - var specialist_colours=obj_ini.col_special; + specialist_colours=obj_ini.col_special; var specific_armour_sprite = "none"; var unit_is_sniper = false; if (role()=="Chapter Master"){ui_specialist=111;} @@ -371,7 +384,7 @@ function scr_draw_unit_image(_background=false){ } // Techmarine - else if (ui_specialist=5){ + else if (ui_specialist=5) and (global.chapter_name!="Iron Hands"){ shader_array_set[ShaderType.Body] = Colors.Red; shader_array_set[ShaderType.Helmet] = Colors.Red; shader_array_set[ShaderType.Lens] = Colors.Lime; @@ -505,7 +518,6 @@ function scr_draw_unit_image(_background=false){ armour_sprite=spr_scout_colors2; if (squad!="none"){ if (obj_ini.squads[squad].type=="scout_sniper_squad" || weapon_one()=="Sniper Rifle" || weapon_two()=="Sniper Rifle"){ - armour_sprite=spr_scout_colors; unit_is_sniper = true; } } @@ -1225,7 +1237,7 @@ function scr_draw_unit_image(_background=false){ draw_sprite(spr_helm_decorations,1,x_surface_offset,y_surface_offset); } } - if (armour_type==ArmourType.Indomitus && !armour_bypass){ + else if (armour_type==ArmourType.Indomitus && !armour_bypass){ if (role() == obj_ini.role[100][Role.COMPANY_CHAMPION]) { draw_sprite(spr_laurel,0,x_surface_offset,y_surface_offset-8); draw_sprite(spr_helm_decorations,0,x_surface_offset,y_surface_offset-10); @@ -1236,6 +1248,13 @@ function scr_draw_unit_image(_background=false){ if (role() == obj_ini.role[100][Role.SERGEANT] || role() == obj_ini.role[100][Role.VETERAN_SERGEANT]) { draw_sprite(spr_helm_decorations,0,x_surface_offset,y_surface_offset-10); } + } else if (armour()=="Scout Armour"){ + var head_mod = body.head.variation%3; + if (head_mod == 1){ + draw_sprite(spr_scout_heads,0,x_surface_offset,y_surface_offset); + } else if (head_mod==2){ + draw_sprite(spr_scout_heads,1,x_surface_offset,y_surface_offset); + } } @@ -1380,8 +1399,13 @@ function scr_draw_unit_image(_background=false){ } else if (armour_type == ArmourType.Tartaros) { shield_offset_x = -8; } - if (gear() == "Combat Shield") then draw_sprite (spr_gear_combat_shield, 1, x_surface_offset + shield_offset_x, y_surface_offset + shield_offset_y); - + if (gear() == "Combat Shield"){ + if (role() == obj_ini.role[100][Role.COMPANY_CHAMPION]){ + draw_sprite (spr_gear_combat_shield, 1, x_surface_offset + shield_offset_x, y_surface_offset + shield_offset_y); + } else { + draw_sprite (spr_gear_combat_shield, 0, x_surface_offset + shield_offset_x, y_surface_offset + shield_offset_y); + } + } // if (braz=1) then draw_sprite(spr_pack_brazier,1,x_surface_offset,y_surface_offset); if (armour_type==ArmourType.Dreadnought){ draw_sprite(spr_dreadnought_chasis_colors,specialist_colours,x_surface_offset,y_surface_offset); @@ -1394,7 +1418,7 @@ function scr_draw_unit_image(_background=false){ } }else{ draw_set_color(c_gray); - draw_text(0,0,string_hash_to_newline("Color swap shader#did not compile")); + draw_text(0,0,"Color swap shader#did not compile"); } // if (race()!="1"){draw_set_color(38144);draw_rectangle(0,x_surface_offset,y_surface_offset+166,0+231,0);} } diff --git a/scripts/scr_draw_unit_stat_data/scr_draw_unit_stat_data.gml b/scripts/scr_draw_unit_stat_data/scr_draw_unit_stat_data.gml index d883d26432..e8afa51eb1 100644 --- a/scripts/scr_draw_unit_stat_data/scr_draw_unit_stat_data.gml +++ b/scripts/scr_draw_unit_stat_data/scr_draw_unit_stat_data.gml @@ -1,6 +1,6 @@ // Script assets have changed for v2.3.0 see // https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information -function scr_draw_unit_stat_data(manage=false){ +function scr_draw_unit_stat_data(manage=false,draw_cords = [1008,520], ){ var xx=__view_get( e__VW.XView, 0 )+0; var yy=__view_get( e__VW.YView, 0 )+0; var stat_tool_tips = []; @@ -8,8 +8,8 @@ function scr_draw_unit_stat_data(manage=false){ var unit_name = name(); var data_block = { - x1: xx + 1008, - y1: yy + 520, + x1: xx + draw_cords[0], + y1: yy + draw_cords[1], w: 569, h: 303, }; @@ -136,8 +136,8 @@ function scr_draw_unit_stat_data(manage=false){ filter_and_sort_company("stat", stat_display_list[i][6]); obj_controller.unit_bio = false; } + array_push(stat_tool_tips,[attribute_box.x1, attribute_box.y1, attribute_box.x2, attribute_box.y2,stat_display_list[i][1] + $"#Click to order by highest {stat_display_list[i][4]}", $"{stat_display_list[i][4]} ({stat_display_list[i][5]})"]); } - array_push(stat_tool_tips,[attribute_box.x1, attribute_box.y1, attribute_box.x2, attribute_box.y2,stat_display_list[i][1] + $"#Click to order by highest {stat_display_list[i][4]}", $"{stat_display_list[i][4]} ({stat_display_list[i][5]})"]); attribute_box.x1+=36; attribute_box.x2+=36; } @@ -287,4 +287,85 @@ function scr_draw_unit_stat_data(manage=false){ tooltip_draw(trait_tool_tips[i][4], 300); } } +} + +function stat_type_data(){ + return [ + [ + "Measure of how quick and nimble unit is as well as their base ability to manipulate and do tasks with their hands (improves ranged attack)", + #306535, + spr_dexterity_icon, + "dexterity"], + + [ + "How strong a unit is (can wield heavier equipment without detriment and is more deadly in close combat)", + #1A3B3B, + spr_strength_icon, + "strength"], + + [ + "Unit's general toughness and resistance to damage (increases health and damage resistance)", + #9B403E, + spr_constitution_icon, + "constitution"], + + [ + "measure of learnt knowledge and specialist skill aptitude", + #2F3B6B, + spr_intelligence_icon, + "intelligence"], + + [ + "units perception and street smarts including certain types of battlefield knowlage", + #54540B, + spr_wisdom_icon, + "wisdom"], + + [ + "units faith in their given religion (or general aptitude towards faith)", + #6A411C, + spr_faith_icon, + "piety"], + + [ + "general skill with close combat weaponry", + #87753C, + spr_weapon_skill_icon, + "weapon_skill"], + + [ + "general skill with ballistic and ranged weaponry", + #743D57, + spr_ballistic_skill_icon, + "ballistic_skill"], + + [ + "...luck...", + #05451E, + spr_luck_icon, + "luck"], + + [ + "skill and understanding of technology and various technical thingies", + #4F0105, + spr_technology_icon, + "technology"], + + [ + "general likeability and ability to interact with people", + #3A0339, + spr_charisma_icon, + "charisma"], + ]; +} +function draw_stat_icons(icon, xx,yy,scale=0.5,colour=true, rotation=0, alpha_draw = 1, number="none"){ + var stat_display_list = stat_type_data(); + var stat_data = stat_display_list[icon]; + if (!colour){ + stat_data[1]=c_white; + } + draw_sprite_ext(stat_data[2], 0, xx, yy, scale, scale, rotation, stat_data[1], alpha_draw); + if (!is_string(number)){ + draw_text(xx+(24*scale), yy+(66*scale),number); + } } \ No newline at end of file diff --git a/scripts/scr_dungeon/scr_dungeon.gml b/scripts/scr_dungeon/scr_dungeon.gml new file mode 100644 index 0000000000..7084de0ed2 --- /dev/null +++ b/scripts/scr_dungeon/scr_dungeon.gml @@ -0,0 +1,487 @@ + +function UnitMapSprite() constructor{ + is_walking = true; + walking_no=0; + walk_sprite = spr_mar_walk_body1; + walk_legs = spr_mar_walk_legs1 + current_x=0; + current_y=0; + static draw = function(draw_x, draw_y){ + var xx=draw_x+current_x; + var yy = current_y +draw_y; + draw_sprite_ext(walk_sprite, floor(walking_no), xx, yy, 2, 2, 0, c_white, 1); + draw_sprite_ext(walk_legs,floor(walking_no), xx, yy, 2, 2, 0, c_white, 1); + if (is_walking){ + walking_no +=0.25; + if (walking_no==17) then walking_no=0; + } + } + static stop_walking = function(){ + is_walking=false; + walking_no=0; + } +} + +function UnitDungeonMember(unit) constructor{ + struct = unit; + actions = 3; + action_able = true; + unit_image_ = unit.draw_unit_image(); + + static dungeon_data_panel = function(xx,yy,scale_x=(166/161), scale_y = (271/198)/2){ + draw_set_color(c_black); + var unit = struct; + draw_sprite_ext(spr_new_banner, 0, xx, yy, scale_x, scale_y, 0, c_white, 1); + draw_set_color(c_green); + health_bar = 136*(unit.hp()/unit.max_health())+15; + draw_rectangle(xx+15,yy+15, xx+health_bar, yy+23,0) + draw_set_color(c_black); + draw_rectangle(xx+15,yy+15, xx+151, yy+23,1) + draw_set_color(c_blue); + for (var a=0;a-1 && !is_string(selected_unit)){ + var test; + var mem = members[selected_unit]; + var unit = mem.struct; + var ob = dungeon.current_obstacle.base_data; + var solution = ob.solutions[dungeon.solution]; + var test_pass=true; + var test_mods=[]; + var viable = true; + var test_results=[]; + var final_flavours = ""; + for (var t = 0; t0) + if (struct_exists(solution, "requirements")){ + mem.action_able = TestUnitAgainstRequirements(solution.requirements, mem.struct); + } + } + } + static DungeonUnitOverview = function(){ + var unit, mem; + var xx =unit_data_slate.XX; + var yy =unit_data_slate.YY; + var _x_depth=0; + var _y_depth=0; + + if (unit_data_slate.individual_display>-1 && (unit_data_slate.individual_view_sequence<21 || unit_data_slate.individual_view_sequence>21)) then unit_data_slate.individual_view_sequence++; + if (unit_data_slate.individual_view_sequence<11 || unit_data_slate.individual_view_sequence>32){ + var unit_draw = [0,0]; + var banner_x_scale = (166/161); + var banner_y_scale = (271/198)/2; + for (var i=0;i-1 && selected_unit != i) + if (scr_hit(unit_draw[0], unit_draw[1]+21, unit_draw[0]+166,unit_draw[1]+271)){ + selected_unit=i; + //unit_data_slate.individual_view_sequence++; + if (mouse_check_button(mb_left) && unit_data_slate.individual_display ==-1){ + unit_data_slate.individual_display = i; + unit_data_slate.individual_view_sequence = 0; + if (dungeon.solution>-1 && mem.action_able){ + action_unit = i; + } + } + }; + _x_depth++; + if (_x_depth==4){ + _x_depth=0; + _y_depth++; + } + } + draw_set_color(c_black); + draw_rectangle(start_x,start_y,start_x+(170*4), start_y+21, 0); + _x_depth=0; + _y_depth=0; + for (var i=0;i-1){ + if(!members[i].action_able){ + draw_set_alpha(0.7) + draw_rectangle(unit_draw[0], unit_draw[1]+21, unit_draw[0]+166,unit_draw[1]+271, 0); + } + } + draw_set_alpha(1) + if (unit_data_slate.individual_display>-1 && unit_data_slate.individual_view_sequence<11){ + if (unit_data_slate.individual_display!=i){ + draw_set_color(c_black); + draw_rectangle(unit_draw[0], unit_draw[1]+21, unit_draw[0]+166,unit_draw[1]+21 + (25*unit_data_slate.individual_view_sequence), 0); + } + } else if (unit_data_slate.individual_view_sequence>32){ + if (unit_data_slate.individual_display!=i){ + draw_set_color(c_black); + draw_rectangle(unit_draw[0], unit_draw[1]+21, unit_draw[0]+166,unit_draw[1]+21 + (25*(10-(unit_data_slate.individual_view_sequence-32))), 0); + } + } + if (selected_unit == i && unit_data_slate.individual_view_sequence<11){ + draw_set_color(c_yellow); + draw_set_alpha(1); + draw_rectangle(unit_draw[0], unit_draw[1]+21, unit_draw[0]+166, unit_draw[1]+271, 1); + draw_set_alpha(0.75); + draw_rectangle(unit_draw[0]-1, unit_draw[1]+20, unit_draw[0]+167, unit_draw[1]+272, 1); + draw_set_alpha(0.5); + draw_rectangle(unit_draw[0]-2, unit_draw[1]+19, unit_draw[0]+168, unit_draw[1]+273, 1); + draw_set_alpha(0.25); + draw_rectangle(unit_draw[0]-3, unit_draw[1]+18, unit_draw[0]+169, unit_draw[1]+274, 1); + draw_set_alpha(1); + draw_set_color(c_black); + if (unit_data_slate.individual_view_sequence == 10){ + mem = members[unit_data_slate.individual_display]; + mem.current_draw_loc = [unit_draw[0]-xx,unit_draw[1]-yy]; + mem.return_point = [unit_draw[0]-xx,unit_draw[1]-yy]; + var targ_x = xx+(unit_data_slate.width/2)-133; + var targ_y = start_y+21; + var increment_x = (targ_x-unit_draw[0])/10; + var increment_y = (targ_y-unit_draw[1])/10; + mem.draw_increments = [increment_x,increment_y]; + } + } + if (unit_data_slate.individual_view_sequence==42){ + unit_data_slate.individual_view_sequence=0; + unit_data_slate.individual_display=-1; + } + } + } else if (unit_data_slate.individual_view_sequence>10 && unit_data_slate.individual_view_sequence<=20){ + var seq = (unit_data_slate.individual_view_sequence-10)/10; + var display_cur = unit_data_slate.individual_display; + with (members[display_cur]){ + unit = struct; + current_draw_loc[0] += draw_increments[0]; + current_draw_loc[1] += draw_increments[1]; + unit_image_.draw(xx+current_draw_loc[0], yy+current_draw_loc[1], true); + dungeon_data_panel(current_draw_loc[0]+xx+(166*(seq)), current_draw_loc[1]+yy+(135)); + } + }else if (unit_data_slate.individual_view_sequence>22 && unit_data_slate.individual_view_sequence<=32){ + var display_cur = unit_data_slate.individual_display; + unit = members[display_cur].struct; + mem = members[display_cur]; + mem.current_draw_loc[0] -= mem.draw_increments[0]; + mem.current_draw_loc[1] -= mem.draw_increments[1]; + mem.unit_image_.draw(xx+mem.current_draw_loc[0], yy+mem.current_draw_loc[1], true); + var seq = (10-(unit_data_slate.individual_view_sequence-22))/10; + mem.dungeon_data_panel(mem.current_draw_loc[0]+xx+(166*(seq)), mem.current_draw_loc[1]+yy+(135)); + }else { + unit = members[unit_data_slate.individual_display].struct; + mem = members[unit_data_slate.individual_display]; + draw_set_color(c_gray); + mem.unit_image_.draw(xx+mem.current_draw_loc[0], yy+mem.current_draw_loc[1], true); + mem.dungeon_data_panel(mem.current_draw_loc[0]+xx+(166), mem.current_draw_loc[1]+yy+(135)); + draw_set_color(c_gray); + draw_set_halign(fa_center); + draw_set_font(fnt_40k_14b); + draw_text_transformed(xx+mem.current_draw_loc[0]+100,mem.current_draw_loc[1]+yy-30,unit.name_role(),1.5,1.5,0); + draw_set_halign(fa_left); + if (point_and_click(draw_unit_buttons([xx+50,mem.current_draw_loc[1]+yy-30],"<----",[1.5,1.5],c_red))){ + unit_data_slate.individual_view_sequence = 22; + } + unit.stat_display(false,[130,430]); + } + } + + static DrawMissionObjectives = function(){ + var objec; + for (var i=0;i-1){ + DrawUnitSolutionAdvantages(); + } else { + DrawMiniUnits(); + } + + } + decision_data_slate.inside_method = function(){ + if (is_struct(dungeon.current_obstacle)){ + xx=decision_data_slate.XX; + yy = decision_data_slate.YY; + var ob = dungeon.current_obstacle.base_data; + if (!dungeon.current_obstacle.overcome){ + draw_set_halign(fa_center); + draw_text_ext(xx+(decision_data_slate.width/2), yy+40, ob.description, -1, decision_data_slate.width-50); + solutions_found = 0; + y_tier=0; + if (obs_calcs = false){ + for (var i=0;i-1){ + if (members[unit_data_slate.individual_display].action_able){ + var confirm_coords = draw_unit_buttons([xx+(decision_data_slate.width/2)-(string_width("Confirm Unit")*1.5), yy+150],"Confirm Unit",[1.5,1.5],c_green); + if(point_and_click(confirm_coords)){ + var solution_attempt_results = attempt_solution(); + current_view="log"; + } + } + } + } + } + } + } + static draw = function(){ + var xx =__view_get( e__VW.XView, 0 ); + var yy =__view_get( e__VW.YView, 0 ); + unit_data_slate.draw(xx,yy,1.08,1.07); + map_data_slate.draw(xx+unit_data_slate.width-12,yy,0.81, 0.63); + decision_data_slate.draw(xx+unit_data_slate.width-12, yy+map_data_slate.height-2,0.81, 0.45); + } +} diff --git a/scripts/scr_dungeon/scr_dungeon.yy b/scripts/scr_dungeon/scr_dungeon.yy new file mode 100644 index 0000000000..4dadd8d238 --- /dev/null +++ b/scripts/scr_dungeon/scr_dungeon.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "scr_dungeon", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "Scripts", + "path": "folders/Scripts.yy", + }, +} \ No newline at end of file diff --git a/scripts/scr_dungeon_map/scr_dungeon_map.gml b/scripts/scr_dungeon_map/scr_dungeon_map.gml new file mode 100644 index 0000000000..d283e90200 --- /dev/null +++ b/scripts/scr_dungeon_map/scr_dungeon_map.gml @@ -0,0 +1,132 @@ +enum eDirection{ + east, + west, + north, + south, + up, + down +} + +function dungeon_map_maker(size=10) constructor{ + + map_surface = surface_create(600, 600); + self.size = size; + static draw_map = function(){ + surface_set_target(map_surface); + draw_clear_alpha(c_black, 0);//RESET surface + for (var i=0;i0){ + var west_room = fetch_current_room_neigbour(eDirection.west); + array_push(viable_rooms, west_room); + } + if (current_room[1]>0){ + var north_room = fetch_current_room_neigbour(eDirection.north); + array_push(viable_rooms, north_room); + } + if (current_room[1]