mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 12:19:15 +12:00
add groomer related strings
This commit is contained in:
parent
e8d2690d1a
commit
8a3675ec3d
4 changed files with 107 additions and 16 deletions
|
@ -328,6 +328,15 @@ namespace HISP.Game
|
|||
public static string HorseEquipFormat;
|
||||
public static string BackToHorse;
|
||||
|
||||
|
||||
// Groomer
|
||||
public static string GroomerBestToHisAbilitiesFormat;
|
||||
public static string GroomerCannotAffordMessage;
|
||||
public static string GroomerHorseCurrentlyAtFormat;
|
||||
public static string GroomerApplyServiceFormat;
|
||||
public static string GroomerApplyServiceForAllFormat;
|
||||
public static string GroomerCannotImprove;
|
||||
|
||||
// Vet
|
||||
public static string VetServiceHorseFormat;
|
||||
public static string VetSerivcesNotNeeded;
|
||||
|
@ -548,6 +557,23 @@ namespace HISP.Game
|
|||
// Click
|
||||
public static string NothingInterestingHere;
|
||||
|
||||
public static string FormatGroomerApplyAllService(int count, int price)
|
||||
{
|
||||
return GroomerApplyServiceForAllFormat.Replace("%PRICE%", price.ToString("N0")).Replace("%COUNT%", count.ToString("N0"));
|
||||
}
|
||||
public static string FormatGroomerApplyService(int price, int randomid)
|
||||
{
|
||||
return GroomerApplyServiceFormat.Replace("%PRICE%", price.ToString("N0")).Replace("%RANDOMID%", randomid.ToString());
|
||||
}
|
||||
public static string FormatHorseGroomCurrentlyAt(string horseName, int currentGroom, int maxGroom)
|
||||
{
|
||||
return GroomerHorseCurrentlyAtFormat.Replace("%HORSENAME%", horseName).Replace("%TOTAL%", currentGroom.ToString()).Replace("%MAX%", maxGroom.ToString());
|
||||
}
|
||||
public static string FormatHorseGroomedToBestAbilities(string breedName)
|
||||
{
|
||||
return GroomerBestToHisAbilitiesFormat.Replace("%HORSEBREED%", breedName);
|
||||
}
|
||||
|
||||
public static string FormatBookReadMeta(string author, string title, string bookText)
|
||||
{
|
||||
return BookReadFormat.Replace("%AUTHOR%", author).Replace("%TITLE%", title).Replace("%TEXT%", bookText);
|
||||
|
|
38
Horse Isle Server/HorseIsleServer/Game/Services/Groomer.cs
Normal file
38
Horse Isle Server/HorseIsleServer/Game/Services/Groomer.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
public class Groomer
|
||||
{
|
||||
|
||||
public static List<Groomer> Groomers = new List<Groomer>();
|
||||
|
||||
public Groomer(int id, double price, int max)
|
||||
{
|
||||
Id = id;
|
||||
PriceMultiplier = price;
|
||||
Max = max;
|
||||
Groomers.Add(this);
|
||||
}
|
||||
|
||||
public int Id;
|
||||
public double PriceMultiplier;
|
||||
public int Max;
|
||||
public int CalculatePrice(int groom)
|
||||
{
|
||||
double price = ((double)Max - (double)groom) * PriceMultiplier;
|
||||
return Convert.ToInt32(Math.Round(price));
|
||||
}
|
||||
|
||||
public static Groomer GetGroomerById(int id)
|
||||
{
|
||||
foreach (Groomer groomer in Groomers)
|
||||
{
|
||||
if (id == groomer.Id)
|
||||
return groomer;
|
||||
}
|
||||
throw new KeyNotFoundException("Groomer with id: " + id + " Not found.");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue