public ArtAttack() { Name = "Art Attack"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(202, 987, 39, 36)), "Draw around the enemy as many times as you can!", Enumerations.MoveResourceTypes.SSSP, 400, Enumerations.CostDisplayTypes.Shown, Enumerations.MoveAffectionTypes.Other, TargetSelectionMenu.EntitySelectionType.All, false, null, Enumerations.EntityTypes.Enemy); DamageInfo = new DamageData(1, Enumerations.Elements.Star, true, Enumerations.ContactTypes.None, Enumerations.ContactProperties.Ranged, null, true, false, Enumerations.DefensiveActionTypes.None, Enumerations.DamageEffects.None); StartingDrawLoc = SpriteRenderer.Instance.WindowCenter; SetMoveSequence(new ArtAttackSequence(this)); actionCommand = new ArtAttackCommand(MoveSequence, StartingDrawLoc, StartingDrawTime); }
public Gulp() { Name = "Gulp"; MoveInfo = new MoveActionData(null, string.Empty, Enumerations.MoveResourceTypes.FP, 4, Enumerations.CostDisplayTypes.Shown, Enumerations.MoveAffectionTypes.Enemy, TargetSelectionMenu.EntitySelectionType.First, true, new Enumerations.HeightStates[] { Enumerations.HeightStates.Grounded, Enumerations.HeightStates.Hovering }); DamageInfo = new DamageData(4, Enumerations.Elements.Normal, true, Enumerations.ContactTypes.Approach, null, Enumerations.DamageEffects.None); GulpSequence gulpSequence = new GulpSequence(this); SetMoveSequence(gulpSequence); actionCommand = new GulpCommand(MoveSequence, gulpSequence.WalkDuration / 2f, 500f, 1f); }
public ArtAttack() { Name = "Art Attack"; SPCost = 400; MoveInfo = new MoveActionData(null, "Draw around the enemy as many times as you can!", Enumerations.MoveResourceTypes.SP, 0, Enumerations.CostDisplayTypes.Shown, Enumerations.MoveAffectionTypes.Enemy, TargetSelectionMenu.EntitySelectionType.All, false, null); DamageInfo = new DamageData(1, Enumerations.Elements.Star, true, Enumerations.ContactTypes.None, null, true, false, Enumerations.DefensiveMoveOverrides.None, Enumerations.DamageEffects.None); StartingDrawLoc = SpriteRenderer.Instance.WindowCenter; SetMoveSequence(new ArtAttackSequence(this)); actionCommand = new ArtAttackCommand(MoveSequence, StartingDrawLoc, StartingDrawTime); }
public Gulp() { Name = "Gulp"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(874, 14, 22, 22)), string.Empty, Enumerations.MoveResourceTypes.FP, 4, Enumerations.CostDisplayTypes.Shown, Enumerations.MoveAffectionTypes.Other, TargetSelectionMenu.EntitySelectionType.First, true, new Enumerations.HeightStates[] { Enumerations.HeightStates.Grounded, Enumerations.HeightStates.Hovering }, User.GetOpposingEntityType()); DamageInfo = new DamageData(4, Enumerations.Elements.Normal, true, Enumerations.ContactTypes.SideDirect, Enumerations.ContactProperties.WeaponDirect, null, Enumerations.DamageEffects.None); GulpSequence gulpSequence = new GulpSequence(this); SetMoveSequence(gulpSequence); actionCommand = new GulpCommand(MoveSequence, gulpSequence.WalkDuration / 2f, 500f, 1f, Microsoft.Xna.Framework.Input.Keys.R); }
public QuakeHammerAction(int numBadges) { Name = "Quake Hammer"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(907, 102, 23, 24)), "Slightly damage all ground\nenemies.", MoveResourceTypes.FP, 3 /*2 FP in PM*/, CostDisplayTypes.Shown, MoveAffectionTypes.Other, TargetSelectionMenu.EntitySelectionType.All, true, new HeightStates[] { HeightStates.Grounded, HeightStates.Ceiling }, User.GetOpposingEntityType()); //Scale by the number of badges the move has int damage = BaseDamage + (DamageScalePerBadge * (numBadges - 1)); DamageInfo = new DamageData(damage, Elements.Normal, true, ContactTypes.None, ContactProperties.Ranged, null, DamageEffects.FlipsShelled | DamageEffects.FlipsClefts); SetMoveSequence(new QuakeHammerSequence(this)); actionCommand = new HammerCommand(MoveSequence, 4, 500d); }
public RallyWinkAction() { Name = "Rally Wink"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(874, 75, 22, 22)), "Wink at Mario to give him the\ncourage for an extra attack.", MoveResourceTypes.FP, 4, CostDisplayTypes.Shown, MoveAffectionTypes.Ally, TargetSelectionMenu.EntitySelectionType.Single, false, null, null); //Rally Wink has damage data for a failed Action Command //It's used to show the move is ineffective DamageInfo = new DamageData(0, Elements.Normal, false, ContactTypes.None, ContactProperties.Ranged, null, true, false, DefensiveActionTypes.Guard | DefensiveActionTypes.Superguard, DamageEffects.None); SetMoveSequence(new RallyWinkSequence(this)); actionCommand = new RallyWinkCommand(MoveSequence, new Keys[] { Keys.Z, Keys.X }, 100d, 4000d, 1000d, 10d, .2d, new Vector2(200f, 1f), new ActionCommandGlobals.BarRangeData(66f, 101f, 1, ActionCommand.CommandRank.Nice, Color.AliceBlue)); }
public BombSquadAction(BattleEntity user, int bombCount, int bombDamage) : base(user) { Name = "Bomb Squad"; BombCount = bombCount; BombDamage = bombDamage; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(874, 14, 22, 22)), "Throw three bombs that\nwill explode one turn later.", MoveResourceTypes.FP, 3, CostDisplayTypes.Shown, MoveAffectionTypes.Other, Enumerations.EntitySelectionType.All, false, new HeightStates[] { HeightStates.Grounded, HeightStates.Hovering, HeightStates.Airborne }, User.GetOpposingEntityType()); DamageInfo = new DamageData(BombDamage, Elements.Explosion, false, ContactTypes.None, ContactProperties.Ranged, null, DamageEffects.None); SetMoveSequence(new BombSquadSequence(this, BombCount)); actionCommand = new BombSquadCommand(MoveSequence, BombCount); }
/// <summary> /// Sets the ItemAction's properties based on the item it has. /// </summary> protected void SetActionProperties() { Name = ItemUsed.Name; //NOTE: Refactor and make cleaner in some way IHPHealingItem hpHealing = ItemUsed as IHPHealingItem; IFPHealingItem fpHealing = ItemUsed as IFPHealingItem; IDamagingItem damageItem = ItemUsed as IDamagingItem; IStatusHealingItem statusHealing = ItemUsed as IStatusHealingItem; IStatusInflictingItem statusInflicting = ItemUsed as IStatusInflictingItem; IDamageEffectItem damageEffectItem = ItemUsed as IDamageEffectItem; MoveAffectionTypes moveAffectionType = ItemUsed.EntityType == User.EntityType ? MoveAffectionTypes.Ally : MoveAffectionTypes.Enemy; if (ItemUsed.TargetsSelf == true) { moveAffectionType = MoveAffectionTypes.Self; } MoveInfo = new MoveActionData(null, ItemUsed.Description, MoveResourceTypes.FP, 0, CostDisplayTypes.Hidden, moveAffectionType, ItemUsed.SelectionType, false, ItemUsed.HeightsAffected); //Set the damage data if (damageItem != null || statusInflicting != null) { int damage = damageItem != null ? damageItem.Damage : 0; Elements element = damageItem != null ? damageItem.Element : Elements.Normal; StatusChanceHolder[] statuses = statusInflicting != null ? statusInflicting.StatusesInflicted : null; DamageEffects damageEffects = damageEffectItem != null ? damageEffectItem.InducedDamageEffects : DamageEffects.None; DamageInfo = new DamageData(damage, element, true, ContactTypes.None, statuses, damageEffects); } //Set the healing data if (hpHealing != null || fpHealing != null || statusHealing != null) { int hpHealed = hpHealing != null ? hpHealing.HPRestored : 0; int fpHealed = fpHealing != null ? fpHealing.FPRestored : 0; StatusTypes[] statusesHealed = statusHealing != null ? statusHealing.StatusesHealed : null; HealingInfo = new HealingData(hpHealed, fpHealed, statusesHealed); } }
public ShellTossAction(BattleEntity user) : base(user) { Name = "Shell Toss"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(216, 845, 22, 22)), "Shoot yourself at an enemy.", MoveResourceTypes.FP, 0, CostDisplayTypes.Shown, MoveAffectionTypes.Other, Enumerations.EntitySelectionType.First, true, new HeightStates[] { HeightStates.Grounded, HeightStates.Hovering }, User.GetOpposingEntityType(), EntityTypes.Neutral); DamageInfo = new DamageData(1, Elements.Normal, false, ContactTypes.SideDirect, ContactProperties.Protected, null, DamageEffects.RemovesSegment); //If a partner (Kooper or Koops) is using this move, the base damage is the Partner rank PartnerStats partnerStats = User.BattleStats as PartnerStats; if (partnerStats != null) { DamageInfo.Damage = (int)partnerStats.PartnerRank; } SetMoveSequence(new ShellTossSequence(this)); actionCommand = new HammerCommand(MoveSequence, 4, 500d); }
protected override void SequenceStartBranch() { switch (SequenceStep) { case 0: //Move to the opponent CurSequenceAction = new MoveToSeqAction(BattleManager.Instance.GetPositionInFront(EntitiesAffected[0], User.EntityType != Enumerations.EntityTypes.Enemy), MoveTime); break; case 1: //Jump up to their height CurSequenceAction = new MoveToSeqAction(EntitiesAffected[0].BattlePosition + new Vector2(0f, 10f), JumpTime); break; case 2: //Fall down and latch CurSequenceAction = new MoveAmountSeqAction(new Vector2(0f, -10f), JumpTime); break; case 3: //Override defensive actions as the latching shouldn't be guardable DamageData damageData = Action.DamageProperties; damageData.ContactType = Enumerations.ContactTypes.Latch; damageData.Damage = 0; damageData.DefensiveOverride = Enumerations.DefensiveActionTypes.Guard | Enumerations.DefensiveActionTypes.Superguard; //Deal 0 damage //If we go to the Main branch, then we can start the action command //Otherwise an interruption or miss occurred, so handle that in those branches AttemptDamage(0, EntitiesAffected[0], damageData, true); ChangeSequenceBranch(SequenceBranch.Main); break; default: PrintInvalidSequence(); break; } }
public TornadoJumpAction(BattleEntity user) : base(user) { Name = "Tornado Jump"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(939, 390, 38, 34)), "Execute superbly to damage\nall midair enemies.", MoveResourceTypes.FP, 3, CostDisplayTypes.Shown, MoveAffectionTypes.Other, Enumerations.EntitySelectionType.Single, false, new HeightStates[] { HeightStates.Grounded, HeightStates.Hovering, HeightStates.Airborne }, User.GetOpposingEntityType(), EntityTypes.Neutral); //The base damage is Mario's current Boot level //If Mario isn't the one using this move, it defaults to 1 int baseDamage = 1; MarioStats marioStats = User.BattleStats as MarioStats; if (marioStats != null) { baseDamage = (int)marioStats.BootLevel; } DamageInfo = new DamageData(baseDamage, Elements.Normal, false, ContactTypes.TopDirect, ContactProperties.None, null, DamageEffects.FlipsShelled | DamageEffects.RemovesWings); //Second part //The second part's damage is Piercing, starts as 2, and cannot be increased with Power Plus, All Or Nothing, or P-Up, D-Down //Equipping a 2nd badge increases the FP cost from 3 to 6 and increases the damage of the Jump by 1 and the air attack by 2 TornadoJumpSecondPart = new MoveAction(User, string.Empty, new MoveActionData(null, string.Empty, MoveResourceTypes.FP, 0f, CostDisplayTypes.Shown, MoveAffectionTypes.Other, Enumerations.EntitySelectionType.All, false, new HeightStates[] { HeightStates.Hovering, HeightStates.Airborne }, new EntityTypes[] { EntityTypes.Enemy }), new NoSequence(TornadoJumpSecondPart), new DamageData(2, Elements.Normal, true, ContactTypes.None, ContactProperties.Ranged, null, DamageEffects.None)); TornadoJumpSequence tornadoJumpSequence = new TornadoJumpSequence(this, TornadoJumpSecondPart); SetMoveSequence(tornadoJumpSequence); actionCommand = new TornadoJumpCommand(MoveSequence, tornadoJumpSequence.JumpDuration, (int)(tornadoJumpSequence.JumpDuration / 2f), 10000d); }
public ElectroDashAction(BattleEntity user) : base(user) { Name = "Electro Dash"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(216, 845, 22, 22)), "Pierce enemy defense, dealing 5 damage.", MoveResourceTypes.FP, 0, CostDisplayTypes.Shown, MoveAffectionTypes.Other, Enumerations.EntitySelectionType.Single, true, null, new EntityTypes[] { User.GetOpposingEntityType() }); DamageInfo = new DamageData(3, Elements.Electric, true, ContactTypes.SideDirect, ContactProperties.None, null, DamageEffects.None); //If a Partner (Watt) is using this move, the base damage is increased by 1 per Partner rank above Normal PartnerStats partnerStats = User.BattleStats as PartnerStats; if (partnerStats != null) { DamageInfo.Damage += ((int)partnerStats.PartnerRank - 1); } ElectroDashSequence electroDashSequence = new ElectroDashSequence(this); SetMoveSequence(electroDashSequence); actionCommand = new GulpCommand(MoveSequence, electroDashSequence.CommandDur, 500d, 1d, Microsoft.Xna.Framework.Input.Keys.Z); }
public Hammer() { Name = "Hammer"; MoveInfo = new MoveActionData(null, "Whack an enemy with your Hammer.", MoveResourceTypes.FP, 0, CostDisplayTypes.Shown, MoveAffectionTypes.Enemy, TargetSelectionMenu.EntitySelectionType.First, true, new HeightStates[] { HeightStates.Grounded, HeightStates.Hovering }); //The base damage for Hammer is Mario's current Hammer level //If Mario isn't the one using this move, it defaults to 1 int baseDamage = 1; MarioStats marioStats = User.BattleStats as MarioStats; if (marioStats != null) { baseDamage = (int)marioStats.HammerLevel; } DamageInfo = new DamageData(baseDamage, Elements.Normal, false, ContactTypes.Approach, null, DamageEffects.None); SetMoveSequence(new HammerSequence(this)); actionCommand = new HammerCommand(MoveSequence, 4, 500d); }
public Hammer() { Name = "Hammer"; MoveInfo = new MoveActionData(new CroppedTexture2D(AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.BattleGFX}.png"), new Rectangle(216, 845, 22, 22)), "Whack an enemy with your Hammer.", MoveResourceTypes.FP, 0, CostDisplayTypes.Shown, MoveAffectionTypes.Other, TargetSelectionMenu.EntitySelectionType.First, true, new HeightStates[] { HeightStates.Grounded, HeightStates.Hovering }, User.GetOpposingEntityType(), EntityTypes.Neutral); //The base damage for Hammer is Mario's current Hammer level //If Mario isn't the one using this move, it defaults to 1 int baseDamage = 1; MarioStats marioStats = User.BattleStats as MarioStats; if (marioStats != null) { baseDamage = (int)marioStats.HammerLevel; } DamageInfo = new DamageData(baseDamage, Elements.Normal, false, ContactTypes.SideDirect, ContactProperties.WeaponDirect, null, DamageEffects.None); SetMoveSequence(new HammerSequence(this, 0)); actionCommand = new HammerCommand(MoveSequence, 4, 500d); }
public MoveAction(string name, MoveActionData moveProperties, Sequence moveSequence, DamageData damageInfo) : this(name, moveProperties, moveSequence) { DamageInfo = damageInfo; }
public SpecialMoveAction(string name, MoveActionData moveProperties, Sequence moveSequence, ActionCommand actionCommand, DamageData damageInfo, StarPowerTypes spType, float spCost) : base(name, moveProperties, moveSequence, actionCommand, damageInfo) { SPType = spType; SPCost = spCost; }
/// <summary> /// Convenience function for attempting damage with only one entity. /// </summary> /// <param name="damage">The damage the BattleAction deals to the entity if the attempt was successful</param> /// <param name="entity">The BattleEntity to attempt to inflict damage on</param> /// <param name="damageInfo">The damage information to use.</param> /// <param name="isTotalDamage">Whether the damage passed in is the total damage or not. /// If false, the total damage will be calculated</param> protected int[] AttemptDamage(int damage, BattleEntity entity, DamageData damageInfo, bool isTotalDamage) { return(AttemptDamage(damage, new BattleEntity[] { entity }, damageInfo, isTotalDamage)); }
///<summary> ///Have an attacker attempt to deal damage to a set of victims. ///<para>Based on the ContactType of this BattleAction, this can fail, resulting in an interruption. ///In the event of an interruption, no further entities are tested.</para> ///</summary> ///<param name="attacker">The BattleEntity dealing the damage.</param> ///<param name="victims">The BattleEntities to attempt to inflict damage on.</param> ///<param name="damageInfo">The damage information to use.</param> ///<param name="onVictimMiss">A delegate invoked when the attacker misses a victim.</param> ///<returns>An array of InteractionResults containing all the interactions. ///Some entries of the array will have null values if the attacker misses or is interrupted.</returns> public static InteractionResult[] AttemptDamageEntities(BattleEntity attacker, IList <BattleEntity> victims, DamageData damageInfo, VictimMissInteraction onVictimMiss) { //No damage can be dealt if either of these are null, so return if (attacker == null || victims == null) { Debug.LogError($"{nameof(attacker)} and/or {nameof(victims)} is/are null in {nameof(AttemptDamageEntities)}, so no damage can be dealt!"); return(new InteractionResult[0]); } //The final interactions between entities InteractionResult[] finalInteractions = new InteractionResult[victims.Count]; //Go through all the entities and attempt damage for (int i = 0; i < victims.Count; i++) { InteractionResult finalResult = GetDamageInteraction(new InteractionParamHolder(attacker, victims[i], damageInfo.Damage, damageInfo.DamagingElement, damageInfo.Piercing, damageInfo.ContactType, damageInfo.ContactProperty, damageInfo.Statuses, damageInfo.DamageEffect, damageInfo.CantMiss, damageInfo.DefensiveOverride)); //Store the interaction result finalInteractions[i] = finalResult; //Make the victim take damage upon a PartialSuccess or a Success if (finalResult.VictimResult.DontDamageEntity == false) { //Check if the attacker hit if (finalResult.VictimResult.Hit == true) { finalResult.AttackerResult.Entity.DamageEntity(finalResult.VictimResult); } //Handle a miss otherwise else { if (onVictimMiss != null) { //Break if the method returns false bool continueVal = onVictimMiss(); if (continueVal == false) { break; } } } } //Make the attacker take damage upon a PartialSuccess or a Failure //Break out of the loop when the attacker takes damage if (finalResult.AttackerResult.DontDamageEntity == false) { finalResult.VictimResult.Entity.DamageEntity(finalResult.AttackerResult); break; } } return(finalInteractions); }
public SpecialMoveAction(BattleEntity user, string name, MoveActionData moveProperties, Sequence moveSequence, DamageData damageInfo) : base(user, name, moveProperties, moveSequence, damageInfo) { }
/// <summary> /// Attempt to deal damage to a set of entities with this BattleAction. /// <para>Based on the ContactType of this BattleAction, this can fail, resulting in an interruption. /// In the event of an interruption, no further entities are tested, the ActionCommand is ended, and /// we go into the Interruption branch</para> /// </summary> /// <param name="damage">The damage the BattleAction deals to the entity if the attempt was successful</param> /// <param name="entities">The BattleEntities to attempt to inflict damage on</param> /// <param name="damageInfo">The damage information to use.</param> /// <param name="isTotalDamage">Whether the damage passed in is the total damage or not. /// If false, the total damage will be calculated</param> /// <returns>An int array containing the damage dealt to each BattleEntity targeted, in order</returns> protected int[] AttemptDamage(int damage, BattleEntity[] entities, DamageData damageInfo, bool isTotalDamage) { if (entities == null || entities.Length == 0) { Debug.LogWarning($"{nameof(entities)} is null or empty in {nameof(AttemptDamage)} for Action {Name}!"); return(new int[0]); } //Ensure the MoveAction associated with this sequence supports damage if (Action.DealsDamage == false) { Debug.LogError($"Attempting to deal damage when {Action.Name} does not support it, as {nameof(Action.DamageProperties)} is null"); return(new int[0]); } int totalDamage = isTotalDamage == true ? damage : GetTotalDamage(damage); //Check for the All or Nothing Badge if the move is affected by it //We check for it here since the CommandResult is fully determined by this point if (damageInfo.AllOrNothingAffected == true) { //If it's equipped, add the number to the damage if the Action Command succeeded, otherwise set the damage to the minimum value int allOrNothingCount = User.GetEquippedBadgeCount(BadgeGlobals.BadgeTypes.AllOrNothing); if (allOrNothingCount > 0) { if (CommandResult == ActionCommand.CommandResults.Success) { totalDamage += allOrNothingCount; } else if (CommandResult == ActionCommand.CommandResults.Failure) { totalDamage = int.MinValue; } } } //The damage dealt to each BattleEntity int[] damageValues = new int[entities.Length]; //Go through all the entities and attempt damage for (int i = 0; i < entities.Length; i++) { BattleEntity victim = entities[i]; InteractionResult finalResult = Interactions.GetDamageInteraction(new InteractionParamHolder(User, victim, totalDamage, damageInfo.DamagingElement, damageInfo.Piercing, damageInfo.ContactType, damageInfo.Statuses, damageInfo.DamageEffect, damageInfo.CantMiss, damageInfo.DefensiveOverride)); //Set the total damage dealt to the victim damageValues[i] = finalResult.VictimResult.TotalDamage; //Make the victim take damage upon a PartialSuccess or a Success if (finalResult.VictimResult.HasValue == true) { //Check if the attacker hit if (finalResult.VictimResult.Hit == true) { finalResult.VictimResult.Entity.TakeDamage(finalResult.VictimResult); } //Handle a miss otherwise else { OnMiss(); } } //Make the attacker take damage upon a PartialSuccess or a Failure //Break out of the loop when the attacker takes damage if (finalResult.AttackerResult.HasValue == true) { finalResult.AttackerResult.Entity.TakeDamage(finalResult.AttackerResult); break; } } return(damageValues); }
public MoveAction(BattleEntity user, string name, MoveActionData moveProperties, Sequence moveSequence, ActionCommand actioncommand, DamageData damageInfo) : this(user, name, moveProperties, moveSequence, actioncommand) { DamageInfo = damageInfo; }
public SpecialMoveAction(string name, MoveActionData moveProperties, Sequence moveSequence, ActionCommand actionCommand, DamageData damageInfo) : base(name, moveProperties, moveSequence, actionCommand, damageInfo) { }