protected override void OnTakeDamage(InteractionHolder damageInfo) { base.OnTakeDamage(damageInfo); //When taking explosive damage, the bombs explode //If they're already in the process of exploding, don't do anything if (damageInfo.DamageElement == Elements.Explosion) { TintColor = Color.Black; //Detonate if the bomb hasn't upon taking explosive damage if (Detonated == false) { //Explode with a battle event and do nothing on this turn DetonateBobberyBombBattleEvent detonateEvent = new DetonateBobberyBombBattleEvent(this, GetDamageData(), GetHitbox, HeightStates.Grounded, HeightStates.Hovering, HeightStates.Airborne); //Queue the event BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.BobberyBomb, new BattleManager.BattleState[] { BattleManager.BattleState.Turn, BattleManager.BattleState.TurnEnd }, detonateEvent); Detonated = true; } } }
public override void OnTurnStart() { base.OnTurnStart(); //This is handled for turns instead of Phase Cycles in the event that the bomb's turn count is modified //This way, if it is somehow inflicted with Fast, it will blow up in one turn instead of two TurnsTaken++; //Blink faster on the first turn if (TurnsTaken <= 1) { StartAction(new BlinkFasterAction(AnimationGlobals.IdleName, 1.6f), true, null); } //Explode on the second turn else { //Explode with a battle event and do nothing on this turn DetonateBobberyBombBattleEvent detonateEvent = new DetonateBobberyBombBattleEvent(this, GetDamageData(), GetHitbox, HeightStates.Grounded, HeightStates.Hovering, HeightStates.Airborne); //Queue the event BattleManager.Instance.battleEventManager.QueueBattleEvent((int)BattleGlobals.BattleEventPriorities.BobberyBomb, new BattleManager.BattleState[] { BattleManager.BattleState.TurnEnd }, detonateEvent); Detonated = true; StartAction(new NoAction(), true, null); } }