mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-24 04:49:38 +08:00
52 lines
1.9 KiB
C#
52 lines
1.9 KiB
C#
using Milimoe.FunGame.Core.Api.Utility;
|
|
using Milimoe.FunGame.Core.Entity;
|
|
using Milimoe.FunGame.Core.Library.Constant;
|
|
|
|
namespace Oshima.FunGame.OshimaModules.Characters
|
|
{
|
|
public class CustomCharacter : Character
|
|
{
|
|
public CustomCharacter(long user_id, string name, string firstname = "", string nickname = "") : base()
|
|
{
|
|
Id = user_id;
|
|
Name = name;
|
|
FirstName = firstname;
|
|
NickName = nickname;
|
|
PrimaryAttribute = (PrimaryAttribute)Random.Shared.Next(1, 4);
|
|
InitialATK = Random.Shared.Next(15, 26);
|
|
InitialHP = Random.Shared.Next(40, 86);
|
|
InitialMP = Random.Shared.Next(20, 56);
|
|
|
|
int value = 31;
|
|
int valueGrowth = 31;
|
|
for (int i = 0; i < 3; i++)
|
|
{
|
|
if (value == 0) break;
|
|
int attribute = i < 2 ? Random.Shared.Next(value) : (value - 1);
|
|
int growth = i < 2 ? Random.Shared.Next(0, valueGrowth) : (valueGrowth - 1);
|
|
switch (i)
|
|
{
|
|
case 1:
|
|
InitialAGI = attribute;
|
|
AGIGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
|
break;
|
|
case 2:
|
|
InitialINT = attribute;
|
|
INTGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
|
break;
|
|
case 0:
|
|
default:
|
|
InitialSTR = attribute;
|
|
STRGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
|
break;
|
|
}
|
|
value -= attribute;
|
|
valueGrowth -= growth;
|
|
}
|
|
InitialSPD = Random.Shared.Next(220, 291);
|
|
InitialHR = Random.Shared.Next(1, 6);
|
|
InitialMR = Random.Shared.Next(1, 6);
|
|
}
|
|
}
|
|
}
|