Skip to content

Commit

Permalink
Merge pull request #83 from gymnast86/main
Browse files Browse the repository at this point in the history
A few more touchups
  • Loading branch information
gymnast86 authored Jun 17, 2024
2 parents c161a99 + 17950dc commit 649f6e9
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 56 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ jobs:
mkdir dmg_contents
cp ../gui/mac_user_instructions.txt ./dmg_contents/READ_THIS_FIRST.txt
cp -R wwhd_rando.app ./dmg_contents/wwhd_rando.app
echo killing...; sudo pkill -9 XProtect >/dev/null || true;
echo waiting...; while pgrep XProtect; do sleep 3; done;
hdiutil create -srcfolder ./dmg_contents wwhd_rando
- name: Get Version
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Download Windows Artifact
# Will make the later gh release command work
- name: Checkout Repository
uses: actions/checkout@v4

- name: Create Folder for Windows Files
run: mkdir wwhd_rando_${{ github.event.release.tag_name }}_windows

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/wwhd_rando_${{ github.event.release.tag_name }}_windows
name: wwhd_rando_${{ github.event.release.tag_name }}_windows # pass name so it doesn't get put in a folder

- name: Download Wii U Artifact
Expand All @@ -50,7 +58,16 @@ jobs:
with:
name: wwhd_rando_${{ github.event.release.tag_name }}_mac.dmg # pass name so it doesn't get put in a folder

- name: Zip windows file
uses: montudor/action-zip@v1
with:
args: zip -qq -r wwhd_rando_${{ github.event.release.tag_name }}_windows.zip wwhd_rando_${{ github.event.release.tag_name }}_windows

- name: Attach Files
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} wwhd_rando_${{ github.event.release.tag_name }}_windows.zip wwhd_rando_${{ github.event.release.tag_name }}.wuhb
run: |
ls -R
mv wwhd_rando.wuhb wwhd_rando_${{ github.event.release.tag_name }}.wuhb
mv wwhd_rando.dmg wwhd_rando_${{ github.event.release.tag_name }}_mac.dmg
gh release upload ${{ github.event.release.tag_name }} wwhd_rando_${{ github.event.release.tag_name }}_windows.zip wwhd_rando_${{ github.event.release.tag_name }}.wuhb wwhd_rando_${{ github.event.release.tag_name }}_mac.dmg
1 change: 1 addition & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Run Logic Tests

on:
- push
- pull_request

jobs:
Expand Down
2 changes: 1 addition & 1 deletion command/WriteLocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ ModificationError ModifyChest::writeLocation(const Item& item) {
}

ModificationError ModifyChest::setCTMCType(ACTR& chest, const Item& item) {
if(item.anyInstancesAreMajor()) {
if(item.anyInstancesAreMajor() && !gameItemToName(item.getGameItemId()).ends_with("Key")) {
LOG_AND_RETURN_IF_ERR(setParam(chest, 0x00F00000, uint8_t(2))) // Metal chests for progress items (excluding keys)
return ModificationError::NONE;
}
Expand Down
43 changes: 20 additions & 23 deletions logic/Plandomizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,29 @@ PlandomizerError loadPlandomizer(std::string& plandoFilepath, std::vector<Plando
YAML::Node randomStartingItemPool;
std::string plandoStartingIsland = "";
std::string worldName = "World " + std::to_string(i + 1);
// Grab the YAML object which holds the locations for this world.
for (const auto& ref : plandoTree)
// Grab the YAML object which holds the plando info for this world.
if (plandoTree[worldName] && plandoTree[worldName].IsMap())
{
if (ref[worldName] && ref[worldName].IsMap())
if (plandoTree[worldName]["locations"] && plandoTree[worldName]["locations"].IsMap())
{
if (ref[worldName]["locations"] && ref[worldName]["locations"].IsMap())
{
plandoLocations = ref[worldName]["locations"];
}
plandoLocations = plandoTree[worldName]["locations"];
}

if (ref[worldName]["entrances"] && ref[worldName]["entrances"].IsMap())
{
plandoEntrances = ref[worldName]["entrances"];
}
if (ref[worldName]["starting island"] && ref[worldName]["starting island"].IsScalar())
{
plandoStartingIsland = ref[worldName]["starting island"].as<std::string>();
}
if (ref[worldName]["extra progression locations"] && ref[worldName]["extra progression locations"].IsSequence())
{
extraProgressionLocations = ref[worldName]["extra progression locations"];
}
if (ref[worldName]["random starting item pool"] && ref[worldName]["random starting item pool"].IsSequence())
{
randomStartingItemPool = ref[worldName]["random starting item pool"];
}
if (plandoTree[worldName]["entrances"] && plandoTree[worldName]["entrances"].IsMap())
{
plandoEntrances = plandoTree[worldName]["entrances"];
}
if (plandoTree[worldName]["starting island"] && plandoTree[worldName]["starting island"].IsScalar())
{
plandoStartingIsland = plandoTree[worldName]["starting island"].as<std::string>();
}
if (plandoTree[worldName]["extra progression locations"] && plandoTree[worldName]["extra progression locations"].IsSequence())
{
extraProgressionLocations = plandoTree[worldName]["extra progression locations"];
}
if (plandoTree[worldName]["random starting item pool"] && plandoTree[worldName]["random starting item pool"].IsSequence())
{
randomStartingItemPool = plandoTree[worldName]["random starting item pool"];
}
}

Expand Down
62 changes: 32 additions & 30 deletions logic/data/plandomizer_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@

# All plandomized elements must be under a "World 1" element at the start of the
# plandomizer file like this
- World 1:
# ...everything else...
World 1:
# ...everything else...

# LOCATIONS
# All plandomized locations are defined under a "locations" element and consist
# of the location name followed by a colon(:) and the item name you want placed
# at that location. The following example places Bombs at Windfall Island - Maggie Free Item
# and Power Bracelets at Wind Temple - Wizzrobe Mini Boss.
- World 1:
locations:
Windfall Island - Maggie Free Item: Bombs
Wind Temple - Wizzrobe Mini Boss: Power Bracelets
World 1:
locations:
Windfall Island - Maggie Free Item: Bombs
Wind Temple - Wizzrobe Mini Boss: Power Bracelets

# NAMES
# As a general rule, capitalize the first letter of all item names except for
Expand All @@ -37,7 +37,7 @@
# if you have race mode enabled and have the number of race mode dungeons set to 2,
# then placing a Progressive Bow at Earth Temple - Stalfos Mini Boss will automatically
# make Earth Temple one of the two race mode dungeons:
Earth Temple - Stalfos Mini Boss: Progressive Bow
Earth Temple - Stalfos Mini Boss: Progressive Bow
# If you place major items in more dungeons than you have set as the number of
# dungeons for race mode, you'll get a Plandomizer Error and the seed won't generate.
#
Expand All @@ -56,10 +56,10 @@
# switches the entrances between Link and Orca's houses on Outset Island. Note that
# when plandomizing entrances, the entrance randomizer setting for the entrances you're
# attempting to plandomize must be turned on.
- World 1:
entrances:
Outset Island -> Outset Link's House: Outset Orca's House from Outset Island
Outset Island -> Outset Orca's House: Outset Link's House from Outset Island
World 1:
entrances:
Outset Island -> Outset Link's House: Outset Orca's House from Outset Island
Outset Island -> Outset Orca's House: Outset Link's House from Outset Island
# The original entrance must be in the format "<first area> -> <second area>", and
# the replacement entrance must be in the format "<second area> from <first area>".
# The spaces around the arrow and the word "from" are important to include. These
Expand All @@ -71,26 +71,28 @@
# STARTING ISLAND
# You can also set the starting island if you want to. For a list of island names, see
# https://github.com/SuperDude88/TWWHD-Randomizer/blob/d76d357e37fabc5369779d54ef479f1c52c8a95a/logic/Area.cpp#L217
- World 1:
starting island: Five Eye Reef
World 1:
starting island: Five Eye Reef

# EXTRA PROGRESSION LOCATIONS
# For more fine-tuned control over which locations are in logic, you can specify extra
# locations whose categories are not selected by listing them under an "extra progression locations"
# element. For example, if we don't have spoils trading or long sidequests enabled
# but we still want to have the Windfall potion sellers checks as potential
# progression locations, we can type:
- World 1:
extra progression locations:
World 1:
extra progression locations:
- Windfall Island - Potion Shop 15 Blue Chu
- Windfall Island - Potion Shop 15 Green Chu

# Alternatively, to disable specific locations, you can plandomizer junk on them

# RANDOM STARTING ITEMS
# If "Start With Random Item" is enabled, you can override the pool it picks from.
# By default, the pool includes the Bait Bag, Bombs, Boomerang, Bow, Deku Leaf,
# Delivery Bag, Grappling Hook, Hookshot, Picto Box, Power Bracelets, and Skull Hammer.
# If instead we only want to start with a random bag, we can type:
- World 1:
World 1:
random starting item pool:
- Delivery Bag
- Bait Bag
Expand All @@ -104,22 +106,22 @@
# the locations will be for. For example, if we want place the Telescope at
# Outset Island - Under Link's House in World 1 and the Bait Bag at
# Gale Isle - Sunken Treasure in World 2, then we'd type
- World 1:
locations:
Outset Island - Under Link's House: Telescope
World 2:
locations:
Gale Isle - Sunken Treasure: Bait Bag
World 1:
locations:
Outset Island - Under Link's House: Telescope
World 2:
locations:
Gale Isle - Sunken Treasure: Bait Bag
# Using this format, the item being plandomized will be for the world that the
# location is currently under. If we want to specify the item for a different
# world we can use the "item" and "world" elements to do so. For example, if we want
# to place Bombs for World 1 at World 2's Hyrule Castle - Sword Chamber Chest
# and the Hero's Charm for World 1 at World 2's Ganon's Tower - Maze Chest we would type:
- World 2:
locations:
Hyrule Castle - Sword Chamber Chest:
item: Bombs
world: 1
Ganon's Tower - Maze Chest:
item: Hero's Charm
world: 1
World 2:
locations:
Hyrule Castle - Sword Chamber Chest:
item: Bombs
world: 1
Ganon's Tower - Maze Chest:
item: Hero's Charm
world: 1

0 comments on commit 649f6e9

Please sign in to comment.