Created
April 7, 2019 14:14
-
-
Save leoetlino/dc4148024537eec3008f0140b544fb8e to your computer and use it in GitHub Desktop.
OhO Infinite Attack Power
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Weapon::x() | |
{ | |
... | |
float attackPower = this->getEffectiveAttackPower(nullptr); | |
if ( dlc::isOneHitObliteratorActor(this, true) ) | |
{ | |
attackPower = 99999.0; | |
... | |
} | |
... | |
} | |
// 0x7100736510 | |
bool dlc::isOneHitObliteratorBaseProcLink(BaseProcLink *baseProcLink, bool checkIsActive) | |
{ | |
ActorAccessor acc; | |
baseProcLink->getActor(&acc); | |
if (acc.getName() != "Weapon_Sword_502") | |
return false; | |
return !checkIsActive || dlc::isOneHitObliteratorActorActive(&acc); | |
} | |
// 0x7100736778 | |
bool dlc::isOneHitObliteratorActorActive(ActorAccessor *acc) | |
{ | |
if (!act::acc::Actor::isWeaponActorProfile(acc)) | |
return false; | |
if (!dlc::isPlayingOneHitObliteratorQuest()) | |
return false; | |
const bool escaped = !sIsCDungeon && dlc::hasEscapedOneHitObliteratorQuest(false); | |
// sub_71002F1000 seems to be "weapon chemical" stuff (checks the OhO has lost its power or not) | |
if (escaped || sub_71002F1000(*acc)) | |
return false; | |
return true; | |
} | |
bool isPlateauAreaNum(int areaNum) { | |
return areaNum == 46 || areaNum == 47 || areaNum == 50; | |
} | |
// 0x71006889D0 | |
// also used by the PlayerNormal code | |
bool dlc::hasEscapedOneHitObliteratorQuest(bool checkIsGround) | |
{ | |
if ( !PlayerInfo::sInstance ) | |
return false; | |
ActorAccessor acc; | |
PlayerInfo::sInstance->baseProcLink.getActor(&acc); | |
if (checkIsGround) | |
{ | |
if (!act::acc::PlayerBase::isGroundForEvent(acc) || sub_710084F2EC(acc) || sub_710084EBB8(acc)) | |
return false; | |
} | |
const Vec3* pos = getPlayerPosition(); | |
if ( isPlateauAreaNum(eco::getCurrentFieldMapAreaNum(pos->x, pos->z)) | |
|| isPlateauAreaNum(eco::getCurrentFieldMapAreaNum(pos->x + 5.0, pos->z)) | |
|| isPlateauAreaNum(eco::getCurrentFieldMapAreaNum(pos->x - 5.0, pos->z)) | |
|| isPlateauAreaNum(eco::getCurrentFieldMapAreaNum(pos->x, pos->z + 5.0)) | |
|| isPlateauAreaNum(eco::getCurrentFieldMapAreaNum(pos->x, pos->z - 5.0)) ) | |
{ | |
if ( playerPos->y > 150.0 ) | |
return false; | |
} | |
return true; | |
} | |
bool dlc::isPlayingOneHitObliteratorQuest() | |
{ | |
return gdt::getFlag_BalladOfHeroes_Step02(0) && !gdt::getFlag_BalladOfHeroes_Step03(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment