コード例 #1
0
 private void AddStatusImmunities()
 {
     //The Shell is immune to all Status Effects
     StatusTypes[] statuses = UtilityGlobals.GetEnumValues <StatusTypes>();
     for (int i = 0; i < statuses.Length; i++)
     {
         this.AddRemoveStatusImmunity(statuses[i], true);
     }
 }
コード例 #2
0
 /// <summary>
 /// Handles adding/removing the Yux's Status Effect immunities.
 /// </summary>
 /// <param name="immune">Whether to add or remove the immunity.
 /// This should be true when adding the shield and false when removing it.</param>
 protected void AddRemoveImmunities(bool immune)
 {
     //Yuxes become immune to all Status Effects with the shield on
     StatusTypes[] allStatusTypes = UtilityGlobals.GetEnumValues <StatusTypes>();
     for (int i = 0; i < allStatusTypes.Length; i++)
     {
         this.AddRemoveStatusImmunity(allStatusTypes[i], immune);
     }
 }
コード例 #3
0
 private void SetStatusProperties()
 {
     //Gulpits' Rocks are immune to all Status Effects
     StatusTypes[] statustypes = UtilityGlobals.GetEnumValues <StatusTypes>();
     for (int i = 0; i < statustypes.Length; i++)
     {
         EntityProperties.AddStatusProperty(statustypes[i], new StatusPropertyHolder(0d, 0, 1));
     }
 }
コード例 #4
0
        /// <summary>
        /// Handles adding/removing Allergic's Status Effect immunities.
        /// Allergic makes the entity immune to every Status Effect.
        /// </summary>
        /// <param name="immune">Whether to add or remove the immunity.</param>
        private void HandleStatusImmunities(bool immune)
        {
            //Get all statuses and add or remove the immunity
            StatusTypes[] allStatusTypes = UtilityGlobals.GetEnumValues <StatusTypes>();

            for (int i = 0; i < allStatusTypes.Length; i++)
            {
                EntityAfflicted.AddRemoveStatusImmunity(allStatusTypes[i], immune);
            }
        }
コード例 #5
0
            /// <summary>
            /// Goes down the list of all defined Partners and finds all that are in the party.
            /// If none are in the party, an empty array is returned.
            /// </summary>
            /// <returns>An array of BattlePartners in the party. An empty array if no BattlePartners exist in the party.</returns>
            public BattlePartner[] GetAllPartners()
            {
                PartnerTypes[] partnerTypes = UtilityGlobals.GetEnumValues <PartnerTypes>();

                List <BattlePartner> battlePartners = new List <BattlePartner>();

                for (int i = 0; i < partnerTypes.Length; i++)
                {
                    if (HasPartner(partnerTypes[i]) == true)
                    {
                        battlePartners.Add(GetPartner(partnerTypes[i]));
                    }
                }

                return(battlePartners.ToArray());
            }
コード例 #6
0
            protected override void OnCalculate(InteractionParamHolder damageInfo, InteractionResult curResult, ContactResultInfo curContactResult)
            {
                //If the attack didn't hit, don't factor in DamageEffects
                if (StepResult.VictimResult.Hit == false)
                {
                    StepResult.VictimResult.DamageEffect = DamageEffects.None;
                }

                //If the current result has no DamageEffects (whether the move didn't have any or a Defensive Action removed them)
                //or if the BattleEntity isn't vulnerable to any DamageEffects, then don't bother doing anything else
                if (StepResult.VictimResult.DamageEffect == DamageEffects.None ||
                    StepResult.VictimResult.Entity.EntityProperties.HasDamageEffectVulnerabilities() == false)
                {
                    return;
                }

                //The DamageEffects stored in the result
                DamageEffects resultEffects = DamageEffects.None;

                //Get all the DamageEffects
                DamageEffects[] damageEffects = UtilityGlobals.GetEnumValues <DamageEffects>();

                //Start at index 1, as 0 is the value of None indicating no DamageEffects
                for (int i = 1; i < damageEffects.Length; i++)
                {
                    DamageEffects curEffect = damageEffects[i];

                    //If the move has the DamageEffect and the entity is affected by it, add it to the result
                    //This approach is easier and more readable than removing effects
                    if (UtilityGlobals.EnumHasFlag(StepResult.VictimResult.DamageEffect, curEffect) == true &&
                        StepResult.VictimResult.Entity.EntityProperties.IsVulnerableToDamageEffect(curEffect) == true)
                    {
                        resultEffects |= curEffect;
                    }
                }

                //Set the result
                StepResult.VictimResult.DamageEffect = resultEffects;
            }