示例#1
0
 private WeaponDamageType GenerateDamageType(PetParameters parameters, PetDropSettings settings)
 {
     if (Rand.Int() % 2 == 0)
     {
         return(WeaponDamageType.damage);
     }
     else
     {
         return(WeaponDamageType.heal);
     }
 }
示例#2
0
 private WeaponDamageType GetDamageType(PetParameters parameters, PetDropSettings settings)
 {
     if (settings.generateDamageType)
     {
         return(GenerateDamageType(parameters, settings));
     }
     else
     {
         return(settings.overwriteDamageType);
     }
 }
示例#3
0
 private int GetMastery(PetParameters parameters, PetDropSettings settings)
 {
     if (settings.setManualMastery)
     {
         return(settings.overwriteMastery);
     }
     else
     {
         return(GenerateMastery());
     }
 }
示例#4
0
 private int GetPassiveSkill(PetParameters parameters, PetDropSettings settings, PetPassiveBonusCollection passiveBonuses)
 {
     if (settings.generatePassiveSkill)
     {
         return(GeneratePassiveSkill(parameters, passiveBonuses));
     }
     else
     {
         return(settings.overwritePassiveSkill);
     }
 }
示例#5
0
 private string GetType(PetParameters parameters, PetDropSettings settings)
 {
     if (settings.generateModel)
     {
         return(GenerateModel(parameters, settings));
     }
     else
     {
         return(settings.overwriteModel);
     }
 }
示例#6
0
 private PetColor GetColor(PetParameters parameters, PetDropSettings settings)
 {
     if (settings.generateColor)
     {
         return(GenerateColor(parameters));
     }
     else
     {
         return(settings.overwriteColor);
     }
 }
示例#7
0
 private string GenerateModel(PetParameters parameters, PetDropSettings settings)
 {
     if (settings.generateRaceForModel)
     {
         return(parameters.typeTable.GetRandomType());
     }
     else
     {
         var ids = parameters.typeTable.GetTypes(settings.overwriteRace);
         return(ids[Rand.Int(0, ids.Count - 1)]);
     }
 }
示例#8
0
        public PetInfo Drop(PetParameters parameters, PetDropSettings settings, PetSkillCollection skills, PetPassiveBonusCollection passiveBonuses)
        {
            PetInfo pet = new PetInfo();

            pet.SetId(Guid.NewGuid().ToString());
            pet.SetExp(0);

            pet.SetColor(GetColor(parameters, settings));
            pet.SetType(GetType(parameters, settings));
            pet.SetPassiveSkill(GetPassiveSkill(parameters, settings, passiveBonuses));
            pet.SetActiveSkills(GetActiveSkills(pet.color, parameters, settings, skills));
            pet.SetActive(false);


            float attackBaseAdd  = Rand.Float(parameters.damage.BaseMin(), parameters.damage.BaseMax());
            float attackColorAdd = Rand.Float(parameters.damage.ColorMin(), parameters.damage.ColorMax());
            float attackLevelAdd = Rand.Float(parameters.damage.LevelMin(), parameters.damage.LevelMax());

            pet.SetAttackParameters(attackBaseAdd, attackColorAdd, attackLevelAdd);

            float hpBaseAdd  = Rand.Float(parameters.hp.BaseMin(), parameters.hp.BaseMax());
            float hpColorAdd = Rand.Float(parameters.hp.ColorMin(), parameters.hp.ColorMax());
            float hpLevelAdd = Rand.Float(parameters.hp.LevelMin(), parameters.hp.LevelMax());

            pet.SetHpParameters(hpBaseAdd, hpColorAdd, hpLevelAdd);

            float odBaseAdd  = Rand.Float(parameters.od.BaseMin(), parameters.od.BaseMax());
            float odColorAdd = Rand.Float(parameters.od.ColorMin(), parameters.od.ColorMax());
            float odLevelAdd = Rand.Float(parameters.od.LevelMin(), parameters.od.LevelMax());

            pet.SetOptimalDistanceParameters(odBaseAdd, odColorAdd, odLevelAdd);

            pet.SetDamageType(GetDamageType(parameters, settings));
            pet.SetMastery(GetMastery(parameters, settings));
            return(pet);
        }
示例#9
0
 private List <PetActiveSkill> GetActiveSkills(PetColor color, PetParameters parameters, PetDropSettings settings, PetSkillCollection skills)
 {
     if (settings.generateActiveSkills)
     {
         return(GenerateActiveSkills(color, parameters, skills));
     }
     else
     {
         return(settings.overwriteActiveSkills.Take(parameters.activeSkillCountTable[color]).ToList());
     }
 }