Yiga Clan member spawns: Difference between revisions
→Condition 3: AutoPlacementMgr
imported>Leoetlino |
imported>Leoetlino |
||
Line 43: | Line 43: | ||
Note: if Electric_Relic_GetBack is set, [[AIDef:Action/CreateAndReplaceAssassin]] will create Yiga enemy actors with the DropTable parameter set to "HighRank". This causes them to drop better items upon defeat. | Note: if Electric_Relic_GetBack is set, [[AIDef:Action/CreateAndReplaceAssassin]] will create Yiga enemy actors with the DropTable parameter set to "HighRank". This causes them to drop better items upon defeat. | ||
Source: (with the code cleaned up) | |||
<source lang="c++"> | |||
// This is at 0x710073D7FC in Switch 1.5.0 | |||
bool yigaWeaponStuff(sead::SafeString& enemyName, sead::SafeString& weaponName, bool wantFootsoldier, | |||
const sead::SafeString& disguisedActorName) | |||
{ | |||
const bool isFootsoldier = wantFootsoldier || enemyName == "Enemy_Assassin_Junior"; | |||
const bool isShooterJunior = enemyName == "Enemy_Assassin_Shooter_Junior"; | |||
weaponName = ""; | |||
if ( !wantFootsoldier && isFootsoldier ) // well, this is a bug! | |||
{ | |||
enemyName = ""; | |||
return false; | |||
} | |||
if ( wantFootsoldier ) | |||
{ | |||
if ( disguisedActorName == "Npc_Assassin_001" ) | |||
enemyName = "Enemy_Assassin_Junior_Npc_001"; | |||
else if (disguisedActorName == "Npc_Assassin_002") | |||
enemyName = "Enemy_Assassin_Junior_Npc_002"; | |||
else | |||
enemyName = "Enemy_Assassin_Junior"; | |||
} | |||
// If the player has opened the Thunder Helm chest | |||
// (more precisely: basic signal was emitted by the chest) | |||
if ( getFlag_ElectricRelic_GetBack() ) | |||
{ | |||
// Footsoldier | |||
if (isFootsoldier) | |||
{ | |||
if ( random() < 0.75 ) | |||
weaponName = "Weapon_Sword_073"; // Demon Carver | |||
else | |||
weaponName = "Weapon_Sword_053"; // Vicious Sickle | |||
} | |||
// Archer | |||
else if (isShooterJunior) | |||
{ | |||
weaponName = "Weapon_Bow_040"; // Duplex Bow | |||
} | |||
// Blademaster | |||
else | |||
{ | |||
weaponName = "Weapon_Lsword_074"; // Windcleaver | |||
} | |||
return !enemyName.empty(); | |||
} | |||
// Otherwise, if the player has NOT opened the chest: | |||
// Only footsoldiers are allowed to spawn dynamically | |||
// And *only if* [the player has talked to Impa or Electric_Relic_AssassinFirst is set] | |||
if (isFootsoldier && (getFlag_Npc_Kakariko001_TalkEnd() || getFlag_Electric_Relic_AssassinFirst())) | |||
{ | |||
weaponName = "Weapon_Sword_053"; // Vicious Sickle | |||
return true; | |||
} | |||
// In any other case, blank out the enemy name and prevent it from spawning. | |||
enemyName = ""; | |||
return false; | |||
} | |||
</source> | |||
[[Category:Internals]] | [[Category:Internals]] | ||
[[Category:Game mechanics]] | [[Category:Game mechanics]] |