Example #1
0
        public override bool Assert()
        {
            switch (LogicMethodType)
            {
            case LOGIC_METHOD_TYPE.BOOL_TRUE:
                return(LogicHelpers.BoolTrue(Value, Expected));

            case LOGIC_METHOD_TYPE.BOOL_FALSE:
                return(LogicHelpers.BoolFalse(Value, Expected));

            default:
                return(false);
            }
        }
Example #2
0
        public override bool Assert()
        {
            switch (LogicMethodType)
            {
            case LOGIC_METHOD_TYPE.FLOAT_EQUAL:
                return(LogicHelpers.FloatEqual(Value, Expected));

            case LOGIC_METHOD_TYPE.FLOAT_GREATER_THAN:
                return(LogicHelpers.FloatGreaterThan(Value, Expected));

            case LOGIC_METHOD_TYPE.FLOAT_LESS_THAN:
                return(LogicHelpers.FloatLessThan(Value, Expected));

            default:
                return(false);
            }
        }
Example #3
0
        public static void ReverseEffect(Actor a, StatModifier mod)
        {
            int modValue = mod.Modifier;

            //Finds the percentage value if necessary
            if (mod.Percentage == true)
            {
                modValue = LogicHelpers.CalculatePercentage(a.GetStatValue(mod.Stat), mod.Modifier);
            }
            //MUST find the percentage value before converting it to a nerf
            //Will Create a nerf if necessary
            if (mod.Buff == true)
            {
                modValue = modValue * (-1);
            }

            a.ApplyStatChange(mod.Stat, modValue);
        }
Example #4
0
        }//EvalCondition

        private static int GetComparisonValue(Actor actor, StatCondition condition)
        {
            int compareValue;

            //Checking for percent value
            if (condition.Percetage)
            {
                //A switch statement is needed in order to properly compare MaxHp to HP or MaxMana to Mana
                switch (condition.Stat)
                {
                case ActorStats.MaxHealthPoints:
                    //TODO if any abilitites decrease MaxHP value then this formula might not work anymore
                    compareValue = LogicHelpers.CalculatePercentage(actor.MaxManaPoints, condition.ComparisonValue);
                    break;

                case ActorStats.HealthPoints:
                    compareValue = LogicHelpers.CalculatePercentage(actor.MaxHealthPoints, condition.ComparisonValue);
                    break;

                case ActorStats.MaxManaPoints:
                    compareValue = LogicHelpers.CalculatePercentage(actor.MaxManaPoints, condition.ComparisonValue);
                    break;

                case ActorStats.ManaPoints:
                    compareValue = LogicHelpers.CalculatePercentage(actor.MaxManaPoints, condition.ComparisonValue);
                    break;

                default:
                    compareValue = LogicHelpers.CalculatePercentage(actor.GetStatValue(condition.Stat), condition.ComparisonValue);
                    break;
                } //end switch
            }     //if
            else
            {
                compareValue = condition.ComparisonValue;
            } //else
            return(compareValue);
        }     //GetCompareValue