/// <summary>
/// BaseStat.cs
/// High Sword
/// July 27, 2012
///
/// This is the base class for a stats in game
/// </summary>
public class BaseStat {
public const int STARTING_EXP_COST = 100; // publicly accessable value for all base stats to start at
private int _baseValue; // the base value of this stat(base ability for character)
private int _buffValue; // range of adjust base value
private int _expToLevel; // the total amount of experience needed to raise this skill
private float _levelModifier; // the modifier applied to the experience to raise the skill
/// <summary>
/// Initializes a new instance of the <see cref="BaseStat"/> class.
/// </summary>
public BaseStat () {
_baseValue = 0;
_buffValue = 0;
_levelModifier = 1.1f;
_expToLevel = STARTING_EXP_COST;
}
#region Basic Setters and Getters
/// <summary>
/// Gets or sets the _baseValue.
/// </summary>
/// <value>
/// The _baseValue.
/// </value>
public int BaseValue {
get{ return _baseValue; }
set{ _baseValue = value; }
}
/// <summary>
/// Gets or sets the _buffValue.
/// </summary>
/// <value>
/// The _buffValue.
/// </value>
public int BuffValue {
get{ return _buffValue; }
set{ _buffValue = value; }
}
/// <summary>
/// Gets or sets the _expToLevel.
/// </summary>
/// <value>
/// The _expToLevel.
/// </value>
public int ExpToLevel {
get{ return _expToLevel; }
set{ _expToLevel = value; }
}
/// <summary>
/// Gets or sets the _levelModifier.
/// </summary>
/// <value>
/// The _levelModifier.
/// </value>
public float LevelModifier {
get{ return _levelModifier; }
set{ _levelModifier = value; }
}
#endregion
// Calculate experience needed for the next level
/// <summary>
/// Calculates the exp to level.
/// </summary>
/// <returns>
/// The exp to level.
/// </returns>
private int CalculateExpToLevel () {
return (int)(_expToLevel * _levelModifier);
}
/// <summary>
/// Assign the new value to _expToLevel and then increase the _baseValue by one
/// </summary>
public void LevelUp () {
_expToLevel = CalculateExpToLevel();
_baseValue++;
}
/// <summary>
/// Recalculate the adjuste base value and return it
/// </summary>
/// <value>
/// The adjusted base value.
/// </value>
public int AdjustedBaseValue {
get{return _baseValue + _buffValue;}
}
}
分享到:
相关推荐
包括AccessHelper.cs、DataAccess.cs、FormatStr.cs、MessageBox.cs、SaveViewState.cs、SqlHelper.cs
BarCodeToHTML.cs CacheHelper.cs Captcha.cs CNDate.cs ConvertJson.cs CsvHelper.cs EcanConvertToCh.cs Encrypt.cs ExcelHelper.cs FileDown.cs FileManager.cs FileUp.cs FTPClient.cs FTPHelper....
C#自动生成.cs文件
edu.umd.cs.findbugs.plugin.eclipse_1.3.9.20090821.rar
edu.stanford.cs106_2.0.1.201603271702.jar stanford公开课使用eclipse需要的插件
DataHelper.cs 完全 DataHelper.cs 完全 DataHelper.cs 完全 DataHelper.cs 完全 DataHelper.cs 完全 DataHelper.cs 完全
SqlHelper.cs 微软官方版本 ===========================================================================
.NET 中 JavaScript 帮助类
asp.net
有很多sqlHelper.cs版本的文件,但是不全。其中会用到systemError.cs,现在在将两者的完整内容上传,以便共享!
mssqlhelper.cs和jshelper.cs 的mssqlhelper.cs
mssqlhelper.cs和jshelper.cs的jshelper.cs
Properties.Resources.Designer.cs.dll
包含两个mssql数据库操作类文件DBOperate.csDBsql.cs
photoshop.cs5..cs5.5汉化包
作C#桌面程序时,有时我们会遇到很复杂的功能,如果所有功能的实现都写在一个.cs文件中,会让这个.cs文件显得很臃肿,而且不便于以后管理。本程序提供一种方法,可以将不同功能分写在不同的.cs文件文件中。即能将很...
xna VideoPlayer.cs xna VideoPlayer.cs xna VideoPlayer.cs
PS.CS4汉化包+PS.CS4汉化+PS.CS4汉化+PS.CS4汉化+PS.CS4汉化+PS.CS4汉化
公共类文件,分别是DataOperate.cs、CommClass.cs、GlobalProperty.cs、MD5Encrypt.cs和ReadFile.cs。
把DLL反编译为.cs类代码,方便使用,不用再愁用别人写的DLL不知道其内部结构了