public override void PerformAction() { //If it's flipped, don't do anything if (duplighost.FlippableBehavior != null && duplighost.FlippableBehavior.Flipped == true) { duplighost.StartAction(new NoAction(), true, null); return; } if (duplighost.PartnerTypeDisguise == PartnerTypes.None) { //For testing, say that it's a 50% chance of disguising and headbutting int randVal = GeneralGlobals.Randomizer.Next(0, 2); //Ensure there's a Partner to copy bool partnerExists = (BattleManager.Instance.GetPartner() != null); if (randVal == 0 && partnerExists == true) { duplighost.StartAction(new DisguiseAction(), false, BattleManager.Instance.GetPartner().GetTrueTarget()); } else { duplighost.StartAction(new HeadbuttAction(), false, BattleManager.Instance.GetFrontPlayer().GetTrueTarget()); } } else { if (duplighost.PartnerTypeDisguise == PartnerTypes.Goombario) { int rand = GeneralGlobals.Randomizer.Next(0, 2); if (rand == 0) { duplighost.StartAction(new Bonk(), false, BattleManager.Instance.GetFrontPlayer().GetTrueTarget()); } else { duplighost.StartAction(new Tattle(false), false, BattleManager.Instance.GetMario()); } } else if (duplighost.PartnerTypeDisguise == PartnerTypes.Kooper) { duplighost.StartAction(new ShellToss(), false, BattleManager.Instance.GetFrontPlayer().GetTrueTarget()); } else if (duplighost.PartnerTypeDisguise == PartnerTypes.Watt) { duplighost.StartAction(new ElectroDashAction(), false, BattleManager.Instance.GetFrontPlayer().GetTrueTarget()); } else { duplighost.StartAction(new HeadbuttAction(), false, BattleManager.Instance.GetFrontPlayer().GetTrueTarget()); } } //Duplighosts Auto-complete Action Commands if (duplighost.PreviousAction != null && duplighost.PreviousAction.HasActionCommand == true) { duplighost.PreviousAction.DrawActionCommandInfo = false; duplighost.PreviousAction.EnableActionCommand = true; duplighost.PreviousAction.actionCommand.AutoComplete = true; } }
public override void PerformAction() { //If it's flipped, don't do anything if (duplighost.FlippableBehavior != null && duplighost.FlippableBehavior.Flipped == true) { duplighost.StartAction(new NoAction(duplighost), true, null); return; } //Try to use an item; if so, return if (TryUseItem() == true) { return; } if (duplighost.PartnerTypeDisguise == PartnerTypes.None) { //For testing, say that it's a 50% chance of disguising and headbutting int randVal = RandomGlobals.Randomizer.Next(0, 2); //Ensure there's a Partner to copy bool partnerExists = (Enemy.BManager.Partner != null); if (randVal == 0 && partnerExists == true) { duplighost.StartAction(new DisguiseAction(duplighost), false, Enemy.BManager.Partner.GetTrueTarget()); } else { duplighost.StartAction(new HeadbuttAction(duplighost), false, Enemy.BManager.FrontPlayer.GetTrueTarget()); } } else { if (duplighost.PartnerTypeDisguise == PartnerTypes.Goombario) { int rand = RandomGlobals.Randomizer.Next(0, 2); if (rand == 0) { duplighost.StartAction(new BonkAction(duplighost), false, Enemy.BManager.FrontPlayer.GetTrueTarget()); } else { duplighost.StartAction(new TattleAction(duplighost, false), false, Enemy.BManager.Mario); } } else if (duplighost.PartnerTypeDisguise == PartnerTypes.Kooper) { duplighost.StartAction(new ShellTossAction(duplighost), false, Enemy.BManager.FrontPlayer.GetTrueTarget()); } else if (duplighost.PartnerTypeDisguise == PartnerTypes.Watt) { duplighost.StartAction(new ElectroDashAction(duplighost), false, Enemy.BManager.FrontPlayer.GetTrueTarget()); } else { duplighost.StartAction(new HeadbuttAction(duplighost), false, Enemy.BManager.FrontPlayer.GetTrueTarget()); } } //Duplighosts Auto-complete Action Commands if (duplighost.LastAction != null && duplighost.LastAction.HasActionCommand == true) { duplighost.LastAction.DrawActionCommandInfo = false; duplighost.LastAction.EnableActionCommand = true; duplighost.LastAction.actionCommand.AutoComplete = true; } }