diff options
| author | aMannus <mannusmenting@gmail.com> | 2023-03-11 18:47:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-11 09:47:56 -0800 |
| commit | 095066ffcddab40bee2c4f77cc9cd7a5104cfdc7 (patch) | |
| tree | d7ed8b663d219364dacdc7f99e0a537e92f1e74e | |
| parent | 1c00d56053199814551cf37daff3e5359a783b70 (diff) | |
Enemy Rando - Arwing range check (Khan Edition) (#2613)
* Arwing range check
* Small code cleanup
| -rw-r--r-- | soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index a095ae500..62e991d38 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -475,9 +475,13 @@ void EnClearTag_Update(Actor* thisx, PlayState* play2) { Math_ApproachS(&this->actor.world.rot.z, 0, 15, this->targetDirection.z); Math_ApproachF(&this->targetDirection.z, 0x500, 1.0f, 0x100); + // Introduce a range requirement in Enemy Rando so Arwings don't shoot the player from + // across the map. Especially noticeable in big maps like Lake Hylia and Hyrule Field. + uint8_t enemyRandoShootLaser = !CVarGetInteger("gRandomizedEnemies", 0) || this->actor.xzDistToPlayer < 1000.0f; + // Check if the Arwing should fire its laser. if ((this->frameCounter % 4) == 0 && (Rand_ZeroOne() < 0.75f) && - (this->state == CLEAR_TAG_STATE_TARGET_LOCKED)) { + (this->state == CLEAR_TAG_STATE_TARGET_LOCKED) && enemyRandoShootLaser) { this->shouldShootLaser = true; } } else { |
