private void PopulatePacket()//uses the references to beings aquired in startup to fill in the necessary details { ATK_Attack = Attacker.Stats.ATK; ATK_Accuracy = Attacker.Stats.ACC; if (Attacker.CurrentAction == 3)//is a regular attack... { ATK_DamageType = string.Empty; IsRegularMove = true; IsHeavyAttk = false; } else if (Attacker.CurrentAction == 4)//is a regular (heavy) attack... { ATK_DamageType = string.Empty; IsRegularMove = true; IsHeavyAttk = true; } else//is a special move... { IsRegularMove = false; SpecialMoveIfAny = Attacker.Abilities[Attacker.CurrentAction - 10]; ATK_DamageType = SpecialMoveIfAny.DamageType; ATK_Attack = (ATK_Attack * SpecialMoveIfAny.AttackModifier) / 100; ATK_Attack += SpecialMoveIfAny.ExtraAttack; } ATK_IsHidden = CalculateStealth(Attacker, Target); TAR_Defense = Target.Stats.DEF; TAR_BlockStatus = Target.BlockStatus; TAR_Evasion = Target.Stats.EVA; InvolvesPlayer = PlayerIsAttackingEnemy = false; if (Attacker.GetType() == typeof(Player) || Target.GetType() == typeof(Player)) { if (!ATK_IsHidden)//unless it is a stealth attack, it is classed as a loud attack against the player, which will create a suspicious noise. { InvolvesPlayer = true; } if (Attacker.GetType() == typeof(Player) && Target.GetType() != typeof(Player))// a player is attacking non-player { PlayerIsAttackingEnemy = true; } } /* **Still Missing** * double TAR_DamageTypeModifier;//the modifier, if any, the target has against the damage type of the attack. Default is 1, less than 1 is worse. */ }
public bool CalculateStealth(Being Atacker, Being Target) { if (Attacker.GetType() == typeof(Player))//if the user is the attacker { if (Target.GetType() == typeof(Enemy)) { if ((Target as Enemy).AlertLevel < 2) { return(true); } } } return(false); }
private bool Equals(Being other) => GetType() == other.GetType();