mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
clang
This commit is contained in:
parent
fe6270b3c1
commit
2c95403c0f
2 changed files with 25 additions and 19 deletions
|
@ -210,20 +210,23 @@ bool Here(const RandomizerRegion region, ConditionFn condition) {
|
|||
return areaTable[region].Here(condition);
|
||||
}
|
||||
|
||||
bool SpiritExplosiveLogic(){
|
||||
bool SpiritExplosiveLogic() {
|
||||
return logic->HasExplosives() ? 1 : ctx->GetOption(RSK_BOMBCHU_BAG) && logic->BombchuRefill() ? 2 : 3;
|
||||
}
|
||||
|
||||
bool SpiritSharedStatueRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge) {
|
||||
return areaTable[region].SpiritShared(condition, []{return logic->HasExplosives();}, []{return true;}, 5, 3, SpiritExplosiveLogic(), anyAge);
|
||||
return areaTable[region].SpiritShared(
|
||||
condition, [] { return logic->HasExplosives(); }, [] { return true; }, 5, 3, SpiritExplosiveLogic(), anyAge);
|
||||
}
|
||||
|
||||
bool MQSpiritSharedStatueRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge) {
|
||||
return areaTable[region].SpiritShared(condition, []{return true;}, []{return true;}, 7, 0, 0, anyAge);
|
||||
return areaTable[region].SpiritShared(
|
||||
condition, [] { return true; }, [] { return true; }, 7, 0, 0, anyAge);
|
||||
}
|
||||
|
||||
bool MQSpiritSharedBrokenWallRoom(const RandomizerRegion region, ConditionFn condition, bool anyAge) {
|
||||
return areaTable[region].SpiritShared(condition, []{return true;}, []{return true;}, 7, 7, 6, anyAge);
|
||||
return areaTable[region].SpiritShared(
|
||||
condition, [] { return true; }, [] { return true; }, 7, 7, 6, anyAge);
|
||||
}
|
||||
|
||||
bool BeanPlanted(const RandomizerRegion region) {
|
||||
|
|
|
@ -234,7 +234,8 @@ class Region {
|
|||
|
||||
/*
|
||||
* This logic covers checks that exist in the shared areas of Spirit from a glitchless standpoint.
|
||||
* This code will fail if any glitch allows Adult to go in the Child spirit door first or vice versa as it relies on specific ages
|
||||
* This code will fail if any glitch allows Adult to go in the Child spirit door first or vice versa as it relies on
|
||||
specific ages
|
||||
|
||||
* There are 4 possibilities for passing a check, but first I have to talk about parallel universes.
|
||||
|
||||
|
@ -254,9 +255,11 @@ class Region {
|
|||
* technical reasons as otherwise the code will never run
|
||||
*/
|
||||
|
||||
bool SpiritShared(ConditionFn condition, ConditionFn childAccess, ConditionFn adultAccess, uint8_t adultKeys, uint8_t childKeys, uint8_t eitherKeys, bool anyAge = false){
|
||||
//If we have all of the keys, we know that access is Certain Access
|
||||
if (ctx->GetDungeon(Rando::SPIRIT_TEMPLE)->IsMQ() ? logic->SmallKeys(RR_SPIRIT_TEMPLE, 7) : logic->SmallKeys(RR_SPIRIT_TEMPLE, 5)) {
|
||||
bool SpiritShared(ConditionFn condition, ConditionFn childAccess, ConditionFn adultAccess, uint8_t adultKeys,
|
||||
uint8_t childKeys, uint8_t eitherKeys, bool anyAge = false) {
|
||||
// If we have all of the keys, we know that access is Certain Access
|
||||
if (ctx->GetDungeon(Rando::SPIRIT_TEMPLE)->IsMQ() ? logic->SmallKeys(RR_SPIRIT_TEMPLE, 7)
|
||||
: logic->SmallKeys(RR_SPIRIT_TEMPLE, 5)) {
|
||||
if (anyAge) {
|
||||
return Here(condition);
|
||||
}
|
||||
|
@ -264,10 +267,10 @@ class Region {
|
|||
// otherwise, we have to check the current age and...
|
||||
} else if (Child() && logic->IsChild) {
|
||||
bool result = condition();
|
||||
//if we have enough keys to have Certain Access, we just run the condition
|
||||
if (logic->SmallKeys(RR_SPIRIT_TEMPLE, childKeys)){
|
||||
// if we have enough keys to have Certain Access, we just run the condition
|
||||
if (logic->SmallKeys(RR_SPIRIT_TEMPLE, childKeys)) {
|
||||
return result;
|
||||
//otherwise we need to check both ages if we have enough keys that either can get there
|
||||
// otherwise we need to check both ages if we have enough keys that either can get there
|
||||
} else if (result && logic->SmallKeys(RR_SPIRIT_TEMPLE, eitherKeys) && adultAccess) {
|
||||
// store current age variables
|
||||
bool pastAdult = logic->IsAdult;
|
||||
|
@ -285,10 +288,10 @@ class Region {
|
|||
}
|
||||
} else if (Adult() && logic->IsAdult) {
|
||||
bool result = condition();
|
||||
//if we have enough keys to have Certain Access, we just run the condition
|
||||
if (logic->SmallKeys(RR_SPIRIT_TEMPLE, adultKeys)){
|
||||
// if we have enough keys to have Certain Access, we just run the condition
|
||||
if (logic->SmallKeys(RR_SPIRIT_TEMPLE, adultKeys)) {
|
||||
return result;
|
||||
//otherwise we need to check both ages
|
||||
// otherwise we need to check both ages
|
||||
} else if (result && logic->SmallKeys(RR_SPIRIT_TEMPLE, eitherKeys) && childAccess) {
|
||||
// store current age variables
|
||||
bool pastAdult = logic->IsAdult;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue