Fixed game luck crit
This commit is contained in:
@@ -20,13 +20,13 @@ namespace TOOHUCardAPI.DTO
|
|||||||
public class GameConfigResponse
|
public class GameConfigResponse
|
||||||
{
|
{
|
||||||
private static string SUCCESS_CODE = "0000";
|
private static string SUCCESS_CODE = "0000";
|
||||||
private static string DEFAULT_GAME_MESSAGE = "Welcome to english Touhou Card";
|
private static string DEFAULT_GAME_MESSAGE = "Welcome to english Touhou Card.";
|
||||||
[JsonProperty("code")] public string Code { get; set; } = SUCCESS_CODE;
|
[JsonProperty("code")] public string Code { get; set; } = SUCCESS_CODE;
|
||||||
[JsonProperty("msg")] public string Message { get; set; } = string.Empty;
|
[JsonProperty("msg")] public string Message { get; set; } = string.Empty;
|
||||||
[JsonProperty("game_code")] public string GameCode { get; set; } = string.Empty;
|
[JsonProperty("game_code")] public string GameCode { get; set; } = string.Empty;
|
||||||
[JsonProperty("game_msg")] public string GameMessage { get; set; } = DEFAULT_GAME_MESSAGE;
|
[JsonProperty("game_msg")] public string GameMessage { get; set; } = DEFAULT_GAME_MESSAGE;
|
||||||
[JsonProperty("luck_card")] public string LuckCard { get; set; } = string.Empty;
|
[JsonProperty("luck_card")] public string LuckCard { get; set; } = string.Empty;
|
||||||
[JsonProperty("luck_crit")] public float LuckCrit { get; set; } = .25f;
|
[JsonProperty("luck_crit")] public int LuckCrit { get; set; } = 250; // = crit damage, /10 = crit chance
|
||||||
[JsonProperty("new_card_list")] public string NewCardList { get; set; } = string.Empty;
|
[JsonProperty("new_card_list")] public string NewCardList { get; set; } = string.Empty;
|
||||||
[JsonProperty("open_day_list")] public string OpenDayList { get; set; } = string.Empty;
|
[JsonProperty("open_day_list")] public string OpenDayList { get; set; } = string.Empty;
|
||||||
[JsonProperty("is_open_day")] public int IsOpenDay { get; set; } = 1;
|
[JsonProperty("is_open_day")] public int IsOpenDay { get; set; } = 1;
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ namespace TOOHUCardAPI.Data.Services
|
|||||||
var enumerable = validCards as string[] ?? validCards.ToArray();
|
var enumerable = validCards as string[] ?? validCards.ToArray();
|
||||||
var index = random.Next(0, enumerable.Length);
|
var index = random.Next(0, enumerable.Length);
|
||||||
response.LuckCard = enumerable.ElementAt(index);
|
response.LuckCard = enumerable.ElementAt(index);
|
||||||
|
response.GameMessage = response.GameMessage + $" Today's lucky card is {response.LuckCard}!";
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user