Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto-Nessy committed Mar 20, 2024
2 parents 4f914f9 + 6be4ef4 commit 5b13aa0
Show file tree
Hide file tree
Showing 27 changed files with 3,821 additions and 1,921 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/create-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Last Nightly Commit and Private Key
id: nightly-version
run: |
echo "last_nightly=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
if [[ ${{ github.event.inputs.build_type == 'Nightly' }} == true ]]; then
echo "last_nightly=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
else
echo "last_nightly=$(git describe --tags --match="v[0-9]*" HEAD --abbrev=0)" >> $GITHUB_ENV
fi
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4.0.1
uses: metcalfc/changelog-generator@v4.3.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
base-ref: ${{ env.last_nightly }}
Expand All @@ -46,11 +51,20 @@ jobs:

steps:
- name: Checkout Project
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

- name: Run Build Script
- if: ${{ github.event.inputs.build_type == 'Nightly' }}
name: Run Build Script Nightly
run: |
chmod +x linux_build_rando.sh
./linux_build_rando.sh
- if: ${{ github.event.inputs.build_type == 'Release' }}
name: Run Build Script Release
env:
url_tag: v${{ github.event.inputs.version }}
run: |
chmod +x linux_build_rando.sh
./linux_build_rando.sh
Expand All @@ -61,7 +75,7 @@ jobs:

- if: ${{ github.event.inputs.build_type == 'Nightly' }}
name: Create Pre-release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "MM3D_Randomizer.cia,MM3D_Randomizer.3dsx,cia.png,3dsx.png"
Expand All @@ -84,7 +98,7 @@ jobs:
- if: ${{ github.event.inputs.build_type == 'Release' }}
name: Create Release
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@v1.14.0
with:
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "MM3D_Randomizer.cia,MM3D_Randomizer.3dsx,cia.png,3dsx.png"
Expand All @@ -93,15 +107,15 @@ jobs:
tag: "v${{ github.event.inputs.version }}"
name: "v${{ github.event.inputs.version }}"
body: |
${{ github.event.inputs.version }} Changes:
- Please check back later for a full list of changes.
${{ github.event.inputs.version }} Changes 🛠:
${{ needs.get-changelog.outputs.changelog }}
When reporting issues, please mention the six character commit listed in the randomizer menu.
You can use the FBI homebrew application to install the randomizer using either of these QR codes.
CIA QR Code:
![CIA Download](https://github.com/${{ github.repository }}/releases/download/Nightly-${{ env.sha_short }}/cia.png)
![CIA Download](https://github.com/${{ github.repository }}/releases/download/v${{ github.event.inputs.version }}/cia.png)
3DSX QR Code:
![CIA Download](https://github.com/${{ github.repository }}/releases/download/Nightly-${{ env.sha_short }}/3dsx.png)
![CIA Download](https://github.com/${{ github.repository }}/releases/download/v${{ github.event.inputs.version }}/3dsx.png)
deploy-gist:
needs: build-cia-3dsx
Expand Down
2 changes: 1 addition & 1 deletion Z3DR
Submodule Z3DR updated 55 files
+1 −1 README.md
+1 −1 code/Makefile
+25 −17 code/include/game/actor.h
+185 −0 code/include/game/actors/boss/twinmold.h
+55 −0 code/include/game/actors/chest.h
+4 −4 code/include/game/common_data.h
+9 −0 code/include/game/context.h
+2 −1 code/include/game/player.h
+39 −0 code/include/game/skelanime.h
+27 −0 code/include/game/ui.h
+69 −0 code/include/game/ui/screens/gearscreen.h
+15 −0 code/include/rnd/blastmask.h
+26 −0 code/include/rnd/boss.h
+18 −6 code/include/rnd/chest.h
+4 −1 code/include/rnd/custom_entrances.h
+26 −0 code/include/rnd/custom_screen.h
+1 −0 code/include/rnd/item_effect.h
+2 −0 code/include/rnd/item_override.h
+2 −0 code/include/rnd/item_upgrade.h
+2 −0 code/include/rnd/link.h
+65 −39 code/include/rnd/savefile.h
+5 −1 code/include/rnd/settings.h
+2 −0 code/include/rnd/spoiler_data.h
+115 −63 code/mm.ld
+23 −0 code/source/asm/boss_hooks.s
+13 −0 code/source/asm/boss_patches.s
+14 −0 code/source/asm/fairy_patches.s
+6 −0 code/source/asm/hms_patches.s
+70 −282 code/source/asm/hooks.s
+247 −0 code/source/asm/item_override_hooks.s
+110 −0 code/source/asm/item_override_patches.s
+36 −227 code/source/asm/patches.s
+29 −0 code/source/asm/save_hooks.s
+16 −0 code/source/asm/save_patches.s
+29 −0 code/source/asm/sword_hooks.s
+61 −0 code/source/asm/sword_patches.s
+74 −0 code/source/asm/trade_item_hooks.s
+46 −0 code/source/asm/trade_item_patches.s
+5 −0 code/source/game/context.cpp
+8 −0 code/source/game/ui/screens/gearscreen.cpp
+18 −3 code/source/main.cpp
+9 −0 code/source/rnd/blastmask.cpp
+100 −0 code/source/rnd/boss.cpp
+45 −0 code/source/rnd/chest.cpp
+13 −1 code/source/rnd/custom_entrances.cpp
+6 −6 code/source/rnd/custom_messages.cpp
+189 −0 code/source/rnd/custom_screen.cpp
+41 −0 code/source/rnd/item_effect.cpp
+266 −77 code/source/rnd/item_override.cpp
+68 −62 code/source/rnd/item_table.cpp
+55 −0 code/source/rnd/item_upgrade.cpp
+42 −5 code/source/rnd/link.cpp
+198 −38 code/source/rnd/savefile.cpp
+5 −5 code/source/rnd/settings.cpp
+190 −0 code/source/rnd/spoiler_data.cpp
15 changes: 10 additions & 5 deletions linux_build_rando.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ compile() {
APP_NAME=$(basename "$PWD")
BANNERTOOLAPP=bannertool
IS_GH_ACTIONS=true
if [ -n "$var" ]; then
echo "Building on Github Actions.."
if [ -n "$GITHUB_SHA" ]; then
echo "Building on Github Actions..."
else
echo "GITHUB_SHA is empty, building locally."
IS_GH_ACTIONS=false
Expand Down Expand Up @@ -36,15 +36,20 @@ compile() {

export commitHashShort=$(echo ${GITHUB_SHA::6})
sed -i "s/develop/${commitHashShort:-develop}/" ./source/include/version.hpp
make -j debug_app=1
make -j
sed -i "s/${commitHashShort}/develop/" ./source/include/version.hpp
$BANNERTOOLAPP makebanner -i ./banner.png -a ./audio.wav -o ./banner.bnr
$BANNERTOOLAPP makesmdh -s "Majora's Mask 3D Randomizer" -l "A Randomized Majoras Mask Experience" -p "Z3DR Team" -i icon.png -o ./icon.icn
3dstool -cvtf romfs ./romfs.bin --romfs-dir ./romfs
makerom -f cia -o ${APP_NAME}.cia -DAPP_ENCRYPTED=false -target t -exefslogo -elf ./${APP_NAME}.elf -icon ./icon.icn -banner ./banner.bnr -rsf ./mmrando.rsf -romfs ./romfs.bin -major 1 -minor 0 -micro 0
if $IS_GH_ACTIONS; then
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.3dsx
if [[ ${url_tag+x} ]]; then
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/$url_tag/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/$url_tag/${APP_NAME}.3dsx
else
qrencode -ocia.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.cia
qrencode -o3dsx.png https://github.com/$GITHUB_REPOSITORY/releases/download/Nightly-$commitHashShort/${APP_NAME}.3dsx
fi
fi
}

Expand Down
2 changes: 1 addition & 1 deletion source/custom_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void CreateBaselineCustomMessages() {

// Kokiri Sword
CreateMessage(0x0037, 0xFFFF, 0x3FFFFFFF, 0xFF0000,
"You got the #kokiri sword!# The trusty sword you're familiar with. A treasure from Kokiri Forest.",
"You got the #Kokiri Sword!# The trusty sword you're familiar with. A treasure from Kokiri Forest.",
{QM_GREEN, QM_RED}, {}, {}, 0x0, false, false);

// Ice Trap
Expand Down
6 changes: 3 additions & 3 deletions source/dungeon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ std::vector<LocationKey> DungeonInfo::GetEveryLocation() const {
WOODFALL_TEMPLE_MAP_CHEST,
WOODFALL_TEMPLE_COMPASS_CHEST,
WOODFALL_TEMPLE_SMALL_KEY_CHEST,
ODOLWA_HEART_CONTAINER,
WOODFALL_TEMPLE_HEROS_BOW_CHEST,
WOODFALL_TEMPLE_BOSS_KEY_CHEST,
ODOLWA_HEART_CONTAINER,
ODOLWA,
WOODFALL_TEMPLE_DEKU_PRINCESS,
},{
Expand Down Expand Up @@ -209,8 +209,8 @@ std::vector<LocationKey> DungeonInfo::GetEveryLocation() const {
GBT_SMALL_KEY_CHEST,
GBT_ICE_ARROW_CHEST,
GBT_BOSS_KEY_CHEST,
GYORG,
GYORG_HEART_CONTAINER,
GYORG,
},{
//STRAY FAIRY LOCATIONS
GBT_SF_SKULLTULA,
Expand Down Expand Up @@ -241,8 +241,8 @@ std::vector<LocationKey> DungeonInfo::GetEveryLocation() const {
STONE_TOWER_TEMPLE_UPDRAFT_ROOM_CHEST,
STONE_TOWER_TEMPLE_GIANTS_MASK_CHEST,
STONE_TOWER_TEMPLE_LIGHT_ARROW_CHEST,
TWINMOLD,
TWINMOLD_HEART_CONTAINER,
TWINMOLD,
},{
//STRAY FAIRY LOCATIONS
ST_SF_MIRROR_SUN_BLOCK,
Expand Down
87 changes: 58 additions & 29 deletions source/fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ std::vector<LocationKey> GetAccessibleLocations(const std::vector<LocationKey>&
}
return {};
}

erase_if(accessibleLocations, [&allowedLocations](LocationKey loc) {
for (LocationKey allowedLocation : allowedLocations) {
if (loc == allowedLocation || Location(loc)->GetPlacedItemKey() != NONE) {
Expand All @@ -247,6 +247,7 @@ std::vector<LocationKey> GetAccessibleLocations(const std::vector<LocationKey>&
}
return true;
});

return accessibleLocations;

}
Expand Down Expand Up @@ -344,9 +345,18 @@ static void FastFill(std::vector<ItemKey> items, std::vector<LocationKey> locati
//Loop until locations are empty, or also end if items are empty and the parameters specify to end then
while (!locations.empty() && (!endOnItemsEmpty || !items.empty())) {
LocationKey loc = RandomElement(locations, true);
ItemKey item = RandomElement(items, true);
/*if ( (Location(loc)->IsRepeatable() == false) && (ItemTable(item).IsReusable() == true) ){
//unsuccessfulPlacement = true;
CitraPrint("Attemting to place repeatable item in nonrepeatable spot in FastFill");
PlacementLog_Msg("\n Attempted to place " + ItemTable(item).GetName().GetEnglish() + " at " + Location(loc)->GetName());
items.push_back(item);
locations.push_back(loc);
}
else {*/
Location(loc)->SetAsHintable();
PlaceItemInLocation(loc, RandomElement(items, true));

PlaceItemInLocation(loc, item);
if (items.empty() && !endOnItemsEmpty) {
items.push_back(GetJunkItem());
}
Expand Down Expand Up @@ -477,7 +487,7 @@ static void AssumedFill(const std::vector<ItemKey>& items, const std::vector<Loc
LocationKey selectedLocation = RandomElement(accessibleLocations);
if ( !(Location(selectedLocation)->IsRepeatable()) && ItemTable(item).IsReusable() ){
//unsuccessfulPlacement = true;
CitraPrint("Attemting to place things where they shouldnt be");
CitraPrint("Attemting to place repeatable item in non repeatable spot in AssumedFill");
PlacementLog_Msg("\n Attempted to place " + ItemTable(item).GetName().GetEnglish() + " at " + Location(selectedLocation)->GetName());
itemsToPlace.push_back(item);
}
Expand Down Expand Up @@ -722,11 +732,14 @@ static void RandomizeLinksPocket() {

int VanillaFill() {
//Perform minimum needed initialization
AreaTable_Init();
CitraPrint("Starting VanillaFill\n");
AreaTable_Init(); //Reset the world graph to intialize the proper locations
ItemReset(); //Reset shops incase of shopsanity random
GenerateLocationPool();
GenerateItemPool();
GenerateStartingInventory();
//Place vanilla item in each location
RemoveStartingItemsFromPool();
FillExcludedLocations();
RandomizeDungeonRewards();
for (LocationKey loc : allLocations) {
Location(loc)->PlaceVanillaItem();
Expand All @@ -738,42 +751,58 @@ int VanillaFill() {
// printf("\x1b[7;32HDone");
//}
//Finish up
GeneratePlaythrough();
printf("Done");
printf("\x1b[9;10HCalculating Playthrough...");
PareDownPlaythrough();
printf("Done");
printf("\x1b[10;10HCalculating Way of the Hero...");
CalculateWotH();
printf("Done");
CitraPrint("Creating Item Overrides");
CreateItemOverrides();
//CreateEntranceOverrides();
//CreateAlwaysIncludedMessages();
// CreateEntranceOverrides();
// CreateAlwaysIncludedMessages();
if (GossipStoneHints.IsNot(rnd::GossipStoneHintsSetting::HINTS_NO_HINTS)) {
printf("\x1b[11;10HCreating Hints...");
CreateAllHints();
printf("Done");
}

return 1;
}

int NoLogicFill() {
CitraPrint("StartingNoLogicFill\n");
AreaTable_Init(); //Reset the world graph to intialize the proper locations
ItemReset(); //Reset shops incase of shopsanity random
GenerateLocationPool();
GenerateItemPool();
GenerateStartingInventory();
RemoveStartingItemsFromPool();
FillExcludedLocations();
RandomizeDungeonRewards();
std::vector<ItemKey> remainingPool = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return true;});
FastFill(remainingPool, GetAllEmptyLocations(), false);
GeneratePlaythrough();
//Successful placement, produced beatable result
//if (playthroughBeatable && !placementFailure) {
// printf("Done");
// printf("\x1b[9;10HCalculating Playthrough...");
// PareDownPlaythrough();
// CalculateWotH();
// printf("Done");
CreateItemOverrides();
// CreateEntranceOverrides();
// CreateAlwaysIncludedMessages();
/*if (GossipStoneHints.IsNot(HINTS_NO_HINTS)) {
printf("\x1b[10;10HCreating Hints...");
CreateAllHints();
printf("Done");
}
if (ShuffleMerchants.Is(SHUFFLEMERCHANTS_HINTS)) {
CreateMerchantsHints();
}*/
//}
return 1;
printf("Done");
printf("\x1b[9;10HCalculating Playthrough...");
PareDownPlaythrough();
printf("Done");
printf("\x1b[10;10HCalculating Way of the Hero...");
CalculateWotH();
printf("Done");
CitraPrint("Creating Item Overrides");
CreateItemOverrides();
// CreateEntranceOverrides();
// CreateAlwaysIncludedMessages();
if (GossipStoneHints.IsNot(rnd::GossipStoneHintsSetting::HINTS_NO_HINTS)) {
printf("\x1b[11;10HCreating Hints...");
CreateAllHints();
printf("Done");
}

return 1;
}


Expand Down Expand Up @@ -814,7 +843,7 @@ int Fill() {

//Place Main Inventory First
//So first get all items in the pool + DekuMask,
std::vector<ItemKey> mainadvancementItems = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).IsAdvancement();});//&& ItemTable(i).GetItemType() == ITEMTYPE_ITEM
std::vector<ItemKey> mainadvancementItems = FilterAndEraseFromPool(ItemPool, [](const ItemKey i) {return ItemTable(i).IsAdvancement() && ItemTable(i).GetItemType() != ITEMTYPE_QUEST;});//(ItemTable(i).GetItemType() == ITEMTYPE_ITEM || ItemTable(i).GetItemType() == ITEMTYPE_MASK || ItemTable(i).GetItemType() == ITEMTYPE_TRADE || ItemTable(i).GetItemType() == ITEMTYPE_GFAIRY)
//Then Place those to expand the amount of checks available
AssumedFill(mainadvancementItems, allLocations,true);

Expand Down
Loading

0 comments on commit 5b13aa0

Please sign in to comment.