From 02deaccfca8772d67418eb79ff860619db8391db Mon Sep 17 00:00:00 2001 From: Nelsonh <81228864+OH296@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:19:14 +0000 Subject: [PATCH] fix: Artifact continuity issue (#348) - solves various issues with artifact continuity. - artifacts were not being destroyed when not being recovered off of killed marines leaving them in limbo - occasionally the artifact in question being de-equipped due to being gifted or some other actor was not equipped to the array loc of the stated unit - to solve this the de-equip function now searches for amarine with the artifact equipped and manually de-equips it from them ## Summary by Sourcery Fix artifact continuity issues by ensuring artifacts are correctly de-equipped from units and destroyed when no longer recoverable. Bug Fixes: - Resolved issues with artifacts not being destroyed when not recovered from killed marines. - Fixed a bug where de-equipping an artifact due to gifting or other actions did not correctly remove it from the unit\'s inventory. --- ChapterMaster.yyp | 8 +- fonts/fnt_menu/fnt_menu.old.png | Bin 28184 -> 28184 bytes fonts/fnt_menu/fnt_menu.png | Bin 28184 -> 28184 bytes scripts/scr_add_artifact/scr_add_artifact.gml | 72 ++++++++++++++-- .../scr_distribute_experience.yy | 2 +- .../scr_unit_equip_functions.gml | 80 ++++++++++++------ 6 files changed, 125 insertions(+), 37 deletions(-) diff --git a/ChapterMaster.yyp b/ChapterMaster.yyp index 9002b0ca6..df610492f 100644 --- a/ChapterMaster.yyp +++ b/ChapterMaster.yyp @@ -173,6 +173,7 @@ {"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",}, @@ -183,7 +184,6 @@ {"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.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":"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":"ork.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",}, @@ -1443,6 +1443,6 @@ ], "templateType": null, "TextureGroups": [ - {"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,}, + {"resourceType":"GMTextureGroup","resourceVersion":"1.3","name":"Default","autocrop":true,"border":2,"compressFormat":"bz2","directory":"","groupParent":null,"isScaled":false,"loadType":"default","mipsToGenerate":0,"targets":-1,}, ], } \ No newline at end of file diff --git a/fonts/fnt_menu/fnt_menu.old.png b/fonts/fnt_menu/fnt_menu.old.png index 3cc6558281afbb1035bfb7a4f713fbe8484814f8..db3534a56946f2342c1bba402bfca34c2b2bdef9 100644 GIT binary patch delta 122 zcmbPnhjGRo#tjp4J&be>%tH)~tPCuzOf9qx46FYjGVPIfTEpd$~Nl7e8waU#; s$xN$cFfuSQ(KW=PVLS8oipe)}WtFkWJrJ9=9B3GWr>mdKI;Vst0JM@K@c;k- delta 122 zcmbPnhjGRo#tjp4Jq&e?OhSwdtPBjT3@o(`fDD7m#)>x#3=FCzt`Q|Ei6yC4x%nxX rX_X8{21X{jhFCOk+&K_1`9`j+G8Vb`lMnlWhB0`$`njxgN@xNA)PEzJ diff --git a/fonts/fnt_menu/fnt_menu.png b/fonts/fnt_menu/fnt_menu.png index db3534a56946f2342c1bba402bfca34c2b2bdef9..f437462ffa9e834ef06da964f7e2ab59ebb4077d 100644 GIT binary patch delta 118 zcmbPnhjGRo#toBl-Ha?k3@xk-O|4ALv<(cb3=DLmZt*ZMFsPQeMwFx^mZVzc=BH$) rRWcYE7@6oA8tGzah+$9KF!@HVyds7Sw~%u_&?p8^S3j3^P6~|mC delta 118 zcmbPnhjGRo#toBl-3-h_42`S|EUio}v<(cb3=EFN@gHGeU{Eb_jVMV;EJ?M>%}>cp st7I@TFf!3KG}6V;u$_5(#pD~g@`@NT55%S|2O7oT>FVdQ&MBb@070W7GXMYp diff --git a/scripts/scr_add_artifact/scr_add_artifact.gml b/scripts/scr_add_artifact/scr_add_artifact.gml index 97f49910b..17b8db9b1 100644 --- a/scripts/scr_add_artifact/scr_add_artifact.gml +++ b/scripts/scr_add_artifact/scr_add_artifact.gml @@ -339,25 +339,85 @@ function ArtifactStruct(Index) constructor{ }; static unequip_from_unit = function(){ + try{ if (equipped() && is_array(bearer)){ - var b_type = determine_base_type(); + var _b_type = determine_base_type(); var unit = fetch_unit(bearer); - if (b_type=="weapon"){ + if (_b_type=="weapon"){ if (unit.weapon_one(true) == index){ unit.update_weapon_one("", false, false); } else if (unit.weapon_two(true) == index){ unit.update_weapon_two("", false, false); } - } else if (b_type=="gear"){ + } else if (_b_type=="gear"){ unit.update_gear("", false, false); - } else if (b_type=="armour"){ + } else if (_b_type=="armour"){ unit.update_armour("", false, false); - } else if (b_type=="mobility"){ + } else if (_b_type=="mobility"){ unit.update_mobility_item("", false, false); } - bearer =false; + bearer = false; obj_ini.artifact_equipped[index] = false; + } else if (equipped()){ + var _b_type = determine_base_type(); + var _bearer = false; + var _bearer_found = false; + var _unit; + if (_b_type=="weapon"){ + for (var co=0;co