public override float SpawnChance(NPCSpawnInfo spawnInfo) { // we want a soul demon to spawn if // 1. there isn't another soul demon in the world // 2. the soul demon hasn't been killed for that biome Element currentElement = ElementData.fromPlayerLocation(spawnInfo.player); bool alreadySpawned = IsSpawned(); int playerHealth = spawnInfo.player.statLifeMax; if (elementalType.Equals(Element.None)) { // don't spawn if it's a generic demon soul. return(0.0f); } if (elementalType != currentElement || alreadySpawned || ElementalSoulsWorld.IsSoulDemonDowned(elementalType)) { return(0.0f); } else { lifeOfPlayer = spawnInfo.player.statLifeMax; return(0.1f * (playerHealth / 50)); } }
public override void NPCLoot() { ElementalSoulsWorld.MarkSoulDemonDowned(elementalType); }