Ejemplo n.º 1
0
        private StatusCondition MakeStatusCondition(MySqlDataReader reader)
        {
            StatusCondition statusCondition = null;
            String          name            = reader.GetString(3);

            double burnDamage        = reader.GetDouble(4);
            double poisonDamage      = reader.GetDouble(5);
            double poisonIncrementer = reader.GetDouble(6);
            int    stunDuration      = reader.GetInt32(7);
            double stunProbability   = reader.GetDouble(8);

            switch (name)
            {
            case "BURN":
                if (burnDamage <= 0)
                {
                    statusCondition = new Burn();
                }
                else
                {
                    statusCondition = new Burn(burnDamage);
                }
                break;

            case "POISON":
                if (poisonDamage <= 0 || poisonDamage <= 0)
                {
                    statusCondition = new Poison();
                }
                else
                {
                    statusCondition = new Poison(poisonDamage, poisonIncrementer);
                }
                break;

            case "STUN":
                if (stunDuration <= 0 || stunProbability <= 0)
                {
                    statusCondition = new Stun();
                }
                else
                {
                    statusCondition = new Stun(stunDuration, stunProbability);
                }
                break;

            case "FLINCH":
                return(new Flinch());
            }

            return(statusCondition);
        }
Ejemplo n.º 2
0
        private StatusCondition MakeStatusCondition(String statusConditionName, double burnDamage, double poisonDamage, double poisonIncrementer, int stunDuration, double stunProbability)
        {
            StatusCondition statusCondition = null;

            switch (statusConditionName)
            {
            case "BURN":
                if (burnDamage <= 0)
                {
                    statusCondition = new Burn();
                }
                else
                {
                    statusCondition = new Burn(burnDamage);
                }
                break;

            case "POISON":
                if (poisonDamage <= 0 || poisonIncrementer <= 0)
                {
                    statusCondition = new Poison();
                }
                else
                {
                    statusCondition = new Poison(poisonDamage, poisonIncrementer);
                }
                break;

            case "STUN":
                if (stunDuration <= 0 || stunProbability <= 0)
                {
                    statusCondition = new Stun();
                }
                else
                {
                    statusCondition = new Stun(stunDuration, stunProbability);
                }
                break;

            case "FLINCH":
                statusCondition = new Flinch();
                break;

            default:
                statusCondition = null;
                break;
            }
            return(statusCondition);
        }