1
This commit is contained in:
@@ -7,15 +7,28 @@ using UnityEngine;
|
||||
/// 职业 - 数据
|
||||
/// </summary>
|
||||
public class DataProfession : DataAttribute {
|
||||
/// <summary> 绑定角色 </summary>
|
||||
public readonly DataCharacter character;
|
||||
/// <summary> 职业名称 </summary>
|
||||
public string name;
|
||||
public readonly string name;
|
||||
/// <summary> 生命骰子 </summary>
|
||||
public readonly int hitDice = 0;
|
||||
/// <summary> 职业等级 </summary>
|
||||
public int level = 0;
|
||||
/// <summary> 生命骰子 </summary>
|
||||
public int hitDice = 0;
|
||||
/// <summary> 累计生命点 </summary>
|
||||
public List<int> hitPoints = new List<int>();
|
||||
|
||||
public DataProfession(DataCharacter character, string name, int hitDice) {
|
||||
this.character = character;
|
||||
this.name = name;
|
||||
this.hitDice = hitDice;
|
||||
|
||||
character.UpdateAttribute();
|
||||
level = 1;
|
||||
hitPoints = new List<int>();
|
||||
// 初始生命 = 满生命骰子 + 体质调整值
|
||||
hitPoints.Add(hitDice + character.ConModifier);
|
||||
}
|
||||
/// <summary> 升级:骰生命骰子+体质调整值 </summary>
|
||||
public void Upgrade(int modifier) {
|
||||
level++;
|
||||
@@ -27,47 +40,38 @@ public class DataProfession : DataAttribute {
|
||||
return hitPoints.Sum();
|
||||
}
|
||||
|
||||
/// <summary> 无职业 </summary>
|
||||
public static DataProfession None() {
|
||||
return new DataProfession() { name = "无" };
|
||||
/// <summary> 无职业 1d4 </summary>
|
||||
public static DataProfession None(DataCharacter character) {
|
||||
return new DataProfession(character, "无", 4);
|
||||
}
|
||||
/// <summary> 战士职业 </summary>
|
||||
public static DataProfession Warrior(int modifier) {
|
||||
DataProfession profession = new DataProfession();
|
||||
// 战士,初始1级,1d10生命骰子,初始生命=满生命骰子+体质调整值
|
||||
profession.name = "战士";
|
||||
profession.level = 1;
|
||||
profession.hitDice = 10;
|
||||
profession.hitPoints.Add(profession.hitDice + modifier);
|
||||
// 职业属性加成
|
||||
profession.Str = 2;
|
||||
profession.Con = 1;
|
||||
return profession;
|
||||
/// <summary> 随机职业 </summary>
|
||||
public static DataProfession Random(DataCharacter character) {
|
||||
int index = Dice.Roll(5);
|
||||
if (index == 1) { return Warrior(character); }
|
||||
if (index == 2) { return Wizard(character); }
|
||||
if (index == 3) { return Cleric(character); }
|
||||
if (index == 4) { return Ranger(character); }
|
||||
if (index == 5) { return Chanter(character); }
|
||||
return None(character);
|
||||
}
|
||||
/// <summary> 法师职业 </summary>
|
||||
public static DataProfession Wizard(int modifier) {
|
||||
DataProfession profession = new DataProfession();
|
||||
// 法师,初始1级,1d6生命骰子,初始生命=满生命骰子+体质调整值
|
||||
profession.name = "法师";
|
||||
profession.level = 1;
|
||||
profession.hitDice = 6;
|
||||
profession.hitPoints.Add(profession.hitDice + modifier);
|
||||
// 职业属性加成
|
||||
profession.Int = 2;
|
||||
profession.Dex = 1;
|
||||
return profession;
|
||||
/// <summary> 战士 1d10 </summary>
|
||||
public static DataProfession Warrior(DataCharacter character) {
|
||||
return new DataProfession(character, "战士", 10);
|
||||
}
|
||||
/// <summary> 牧师职业 </summary>
|
||||
public static DataProfession Cleric(int modifier) {
|
||||
DataProfession profession = new DataProfession();
|
||||
// 牧师,初始1级,1d8生命骰子,初始生命=满生命骰子+体质调整值
|
||||
profession.name = "牧师";
|
||||
profession.level = 1;
|
||||
profession.hitDice = 8;
|
||||
profession.hitPoints.Add(profession.hitDice + modifier);
|
||||
// 职业属性加成
|
||||
profession.Wis = 2;
|
||||
profession.Con = 1;
|
||||
return profession;
|
||||
/// <summary> 法师 1d6 </summary>
|
||||
public static DataProfession Wizard(DataCharacter character) {
|
||||
return new DataProfession(character, "法师", 6);
|
||||
}
|
||||
/// <summary> 牧师 1d8 </summary>
|
||||
public static DataProfession Cleric(DataCharacter character) {
|
||||
return new DataProfession(character, "牧师", 8);
|
||||
}
|
||||
/// <summary> 游侠 1d8 </summary>
|
||||
public static DataProfession Ranger(DataCharacter character) {
|
||||
return new DataProfession(character, "游侠", 8);
|
||||
}
|
||||
/// <summary> 歌者 1d6 </summary>
|
||||
public static DataProfession Chanter(DataCharacter character) {
|
||||
return new DataProfession(character, "歌者", 6);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user