mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 05:05:53 +12:00
Add Horse Pawneer
and Pawneer Orders.
This commit is contained in:
parent
2345b302fc
commit
d9cdd05acb
12 changed files with 653 additions and 263 deletions
57
Horse Isle Server/HorseIsleServer/Game/Services/Pawneer.cs
Normal file
57
Horse Isle Server/HorseIsleServer/Game/Services/Pawneer.cs
Normal file
|
@ -0,0 +1,57 @@
|
|||
using HISP.Game.Horse;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
public class Pawneer
|
||||
{
|
||||
public Pawneer(int breedId, int basePrice)
|
||||
{
|
||||
BreedId = breedId;
|
||||
BasePrice = basePrice;
|
||||
}
|
||||
public static List<Pawneer> PawneerPriceModels = new List<Pawneer>();
|
||||
public int BreedId;
|
||||
public int BasePrice;
|
||||
|
||||
|
||||
public static int GetPawneerBasePriceForHorse(HorseInfo.Breed breed)
|
||||
{
|
||||
foreach (Pawneer ppm in PawneerPriceModels)
|
||||
{
|
||||
if (ppm.BreedId == breed.Id)
|
||||
{
|
||||
return ppm.BasePrice;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception("No pawneeer base price found >_> for breed #" + breed.Id + " " + breed.Name);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue