diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 663a90f39..d97e3200e 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -173,7 +173,6 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"daemon9.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy10.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy11.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy12.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, @@ -184,6 +183,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy6.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy7.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy8.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"diplomacy_icons.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"instructions.txt","CopyToMask":9223372036854775807,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"symbol1.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"symbol2.png","CopyToMask":-1,"filePath":"datafiles/images/diplomacy",}, @@ -397,10 +397,10 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"eldar.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"genestealercult.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"hulk.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"imperial_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ork_ship.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"sector.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"space_marine.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"star.json","CopyToMask":-1,"filePath":"datafiles/main/names",}, @@ -1439,6 +1439,6 @@ ], "templateType": null, "TextureGroups": [ - {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,}, + {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","customOptions":"","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,}, ], } \ No newline at end of file diff --git a/objects/obj_creation_popup/Draw_0.gml b/objects/obj_creation_popup/Draw_0.gml index 4b8499961..3be5c4243 100644 --- a/objects/obj_creation_popup/Draw_0.gml +++ b/objects/obj_creation_popup/Draw_0.gml @@ -182,6 +182,44 @@ if (col_shift){ confirm_gear_button.alpha = target_gear > 0 ? 0.5 : 1; confirm_gear_button.rects = draw_unit_buttons([614,716], "CONFIRM",[1,1], 38144,, fnt_40k_14b, confirm_gear_button.alpha); if (point_and_click(confirm_gear_button.rects) and (target_gear = 0)) { + var possible_custom_roles = [ + ["chapter_master", eROLE.ChapterMaster], + ["honour_guard",eROLE.HonourGuard], + ["veteran",eROLE.Veteran], + ["terminator",eROLE.Terminator], + ["captain",eROLE.Captain], + ["dreadnought",eROLE.Dreadnought], + ["champion",eROLE.Champion], + ["tactical",eROLE.Tactical], + ["devastator",eROLE.Devastator], + ["assault",eROLE.Assault], + ["ancient",eROLE.Ancient], + ["scout",eROLE.Scout], + ["chaplain",eROLE.Chaplain], + ["apothecary",eROLE.Apothecary], + ["techmarine",eROLE.Techmarine], + ["librarian",eROLE.Librarian], + ["sergeant",eROLE.Sergeant], + ["veteran_sergeant",eROLE.VeteranSergeant], + ]; + + var _role_id = ide; + for(var i = 0; i < array_length(possible_custom_roles); i++){ + if(possible_custom_roles[i][1] == _role_id){ + var c_role = { + name: obj_creation.role[100][_role_id], + wep1: obj_creation.wep1[100][_role_id], + wep2: obj_creation.wep2[100][_role_id], + gear: obj_creation.gear[100][_role_id], + mobi: obj_creation.mobi[100][_role_id], + armour: obj_creation.armour[100][_role_id] + } + show_debug_message($"Updating role {_role_id} from {obj_creation.custom_roles}"); + variable_struct_set(obj_creation.custom_roles, possible_custom_roles[i][0], c_role); + } + } + show_debug_message($"New obj_creation.custom_roles {obj_creation.custom_roles}"); + obj_creation.cooldown = 8000; instance_destroy(); } diff --git a/scripts/scr_chapter_new/scr_chapter_new.gml b/scripts/scr_chapter_new/scr_chapter_new.gml index 6c10050f8..90032a0bc 100644 --- a/scripts/scr_chapter_new/scr_chapter_new.gml +++ b/scripts/scr_chapter_new/scr_chapter_new.gml @@ -438,6 +438,9 @@ function scr_chapter_new(argument0) { if(struct_exists(chapter_object, "custom_squads")){ obj_creation.custom_squads = chapter_object.custom_squads; } + + + points = chapter_object.points; maxpoints=chapter_object.points; diff --git a/scripts/scr_chapter_random/scr_chapter_random.gml b/scripts/scr_chapter_random/scr_chapter_random.gml index 14bb01507..15dfdd585 100644 --- a/scripts/scr_chapter_random/scr_chapter_random.gml +++ b/scripts/scr_chapter_random/scr_chapter_random.gml @@ -73,7 +73,7 @@ function scr_chapter_random(argument0) { chapter_master_specialty=choose(1,1,1,1,1,2,2,2,2,2,3); - + custom_roles = {}; diff --git a/scripts/scr_save_chapter/scr_save_chapter.gml b/scripts/scr_save_chapter/scr_save_chapter.gml index c47f34fba..11a8ec9b0 100644 --- a/scripts/scr_save_chapter/scr_save_chapter.gml +++ b/scripts/scr_save_chapter/scr_save_chapter.gml @@ -91,6 +91,9 @@ function scr_save_chapter(chapter_id){ traits: [], } + chap.custom_roles = custom_roles; + + global.chapter_creation_object = chap; var data_json = json_stringify({chapter: global.chapter_creation_object}, true);