コード例 #1
0
        public static int CalculateTotalPrice(HorseInstance horse)
        {
            HorseInfo.StatCalculator speedStat        = new HorseInfo.StatCalculator(horse, HorseInfo.StatType.SPEED);
            HorseInfo.StatCalculator strengthStat     = new HorseInfo.StatCalculator(horse, HorseInfo.StatType.STRENGTH);
            HorseInfo.StatCalculator conformationStat = new HorseInfo.StatCalculator(horse, HorseInfo.StatType.CONFORMATION);
            HorseInfo.StatCalculator agilityStat      = new HorseInfo.StatCalculator(horse, HorseInfo.StatType.AGILITY);
            HorseInfo.StatCalculator enduranceStat    = new HorseInfo.StatCalculator(horse, HorseInfo.StatType.ENDURANCE);

            int basePrice = GetPawneerBasePriceForHorse(horse.Breed);

            int additionalPrice = speedStat.BreedOffset * 350;

            additionalPrice += strengthStat.BreedOffset * 350;
            additionalPrice += conformationStat.BreedOffset * 350;
            additionalPrice += agilityStat.BreedOffset * 350;
            additionalPrice += enduranceStat.BreedOffset * 350;

            additionalPrice += horse.BasicStats.Health * 40;
            additionalPrice += horse.BasicStats.Shoes * 20;

            int price = basePrice + additionalPrice;

            return(price);
        }
コード例 #2
0
ファイル: Arena.cs プロジェクト: KuromeSan/HISP
        private string getSwf(ArenaEntry entry)
        {
            HorseInfo.StatCalculator speedCalculator        = new HorseInfo.StatCalculator(entry.EnteredHorse, HorseInfo.StatType.SPEED, entry.EnteredUser);
            HorseInfo.StatCalculator strengthCalculator     = new HorseInfo.StatCalculator(entry.EnteredHorse, HorseInfo.StatType.STRENGTH, entry.EnteredUser);
            HorseInfo.StatCalculator enduranceCalculator    = new HorseInfo.StatCalculator(entry.EnteredHorse, HorseInfo.StatType.ENDURANCE, entry.EnteredUser);
            HorseInfo.StatCalculator conformationCalculator = new HorseInfo.StatCalculator(entry.EnteredHorse, HorseInfo.StatType.CONFORMATION, entry.EnteredUser);

            switch (Type)
            {
            case "BEGINNERJUMPING":
                int bigJumps = Convert.ToInt32(Math.Round((double)strengthCalculator.Total / 100.0)) + 1;
                return("jumpingarena1.swf?BIGJUMPS=" + bigJumps + "&SPEEEDMAX=" + speedCalculator.Total + "&JUNK=");

            case "JUMPING":
                int bonus = entry.EnteredHorse.BasicStats.Health + entry.EnteredHorse.BasicStats.Hunger + entry.EnteredHorse.BasicStats.Thirst + entry.EnteredHorse.BasicStats.Shoes;
                return("jumpingarena2.swf?BONUS=" + bonus + "&STRENGTH=" + strengthCalculator.Total + "&SPEED=" + speedCalculator.Total + "&ENDURANCE=" + enduranceCalculator.Total + "&JUNK=");

            case "CONFORMATION":
                int    baseScore = conformationCalculator.Total + ((entry.EnteredHorse.BasicStats.Groom > 750) ? 1000 : 500);
                string swf       = "dressagearena.swf?BASESCORE=" + baseScore;
                int    i         = 1;
                foreach (ArenaEntry ent in Entries.ToArray())
                {
                    swf += "&HN" + i.ToString() + "=" + ent.EnteredUser.Username;
                    if (ent.EnteredUser.Id == entry.EnteredUser.Id)
                    {
                        swf += "&POS=" + i.ToString();
                    }
                    i++;
                }
                swf += "&JUNK=";
                return(swf);

            case "DRAFT":
                int draftAbility = Convert.ToInt32(Math.Round((((double)entry.EnteredHorse.BasicStats.Health * 2.0 + (double)entry.EnteredHorse.BasicStats.Shoes * 2.0) + (double)entry.EnteredHorse.BasicStats.Hunger + (double)entry.EnteredHorse.BasicStats.Thirst) / 6.0 + (double)strengthCalculator.Total + ((double)enduranceCalculator.Total / 2.0)));
                swf = "draftarena.swf?DRAFTABILITY=" + draftAbility;
                i   = 1;
                foreach (ArenaEntry ent in Entries.ToArray())
                {
                    swf += "&HN" + i.ToString() + "=" + ent.EnteredUser.Username;
                    if (ent.EnteredUser.Id == entry.EnteredUser.Id)
                    {
                        swf += "&POS=" + i.ToString();
                    }
                    i++;
                }
                swf += "&J=";
                return(swf);

            case "RACING":
                int baseSpeed = Convert.ToInt32(Math.Round((((double)entry.EnteredHorse.BasicStats.Health * 2.0 + (double)entry.EnteredHorse.BasicStats.Shoes * 2.0) + (double)entry.EnteredHorse.BasicStats.Hunger + (double)entry.EnteredHorse.BasicStats.Thirst) / 6.0 + (double)speedCalculator.Total));
                swf = "racingarena.swf?BASESPEED=" + baseSpeed + "&ENDURANCE=" + enduranceCalculator.Total;
                i   = 1;
                foreach (ArenaEntry ent in Entries.ToArray())
                {
                    swf += "&HN" + i.ToString() + "=" + ent.EnteredUser.Username;
                    if (ent.EnteredUser.Id == entry.EnteredUser.Id)
                    {
                        swf += "&POS=" + i.ToString();
                    }
                    i++;
                }
                swf += "&JUNK=";
                return(swf);

            default:
                return("test.swf");
            }
        }