private void OnDestroy() { List <EnumItemType> drops = new List <EnumItemType>(); for (int i = 0; i < Loot.Count; i++) { for (int j = 0; j < Loot[i].countMin; j++) { drops.Add(Loot[i].item); } for (int j = 0; j < Loot[i].countMax - Loot[i].countMin; j++) { if (Random.value < Loot[i].dropChance) { drops.Add(Loot[i].item); } } } if (drops.Count == 0) { drops.Add(EnumItemType.POINT); } foreach (EnumItemType item in drops) { StageController.DropItem(item, transform.position); } }
public virtual void OnDefeat(bool isSpell) { List <EnumItemType> dpool = new List <EnumItemType>(); if (StageController.Player.GetComponent <PlayerController>().GetPercentMaxPower() != 1.0f) { for (int i = 0; i < 8; i++) { dpool.Add(EnumItemType.POWER); } dpool.Add(EnumItemType.BIGPOWER); } else { for (int i = 0; i < 14; i++) { dpool.Add(EnumItemType.POINT); } if (Random.Range(0, 6) == 1) { dpool.Add(EnumItemType.BOMB); } } foreach (EnumItemType item in dpool) { StageController.DropItem(item, transform.position, true); } }
public void Die(bool fullKill = false) { SpellCard.Interrupt(); StageController.Stage.KillAllEnemyBullets(); SetDefenseMod(1); if (onSpell || fullKill) { Lives--; Health = StartingHealth; SpellCard.cardAlive = false; Destroy(Card); onSpell = false; if (fullKill) { Lives = 0; } if (Lives <= 0) { // Explode StageController.AudioManager.StopBGM(); StageController.AudioManager.PlaySFX("bossdeath", 0.2f); StageController.DropItem(EnumItemType.BOMB, transform.position); Destroy(gameObject); return; } // If we get here, that means the next spell should start activeSpell++; StartSpell(); return; } onSpell = true; SetDefenseMod(SpellCard.DefenseMod); if (SpellCard.GetResetOverride() != null) { GoToWaypoint(SpellCard.GetResetOverride(), 2, true); } else { GoToWaypoint(StageController.Stage.Waypoints.TOP_CENTER, 2, true); } }