コード例 #1
0
ファイル: LGcharacter.cs プロジェクト: ryeander/LGprototype
	public bool SetStat(LGstatData.StatusType type, int val) {
		int index = (int)type;
		if ((val < 0)||(val > LGstatData.kMaxStatus)) {
			return false;
		}
		_StatValues [index] = val;
		return true;
	}
コード例 #2
0
ファイル: LGcharacter.cs プロジェクト: ryeander/LGprototype
	public bool SetTrait(LGstatData.TraitType type, int val) {
		int index = (int)type;
		if ((val < 0)||(val > LGstatData.kMaxTrait)) {
			return false;
		}
		_TraitValues[index] = val;
		return true;
	}
コード例 #3
0
ファイル: LGcharacter.cs プロジェクト: ryeander/LGprototype
	public bool AddStat(LGstatData.StatusType type, int val) {
		int index = (int)type;
		_StatValues [index] += val;
		if (_StatValues [index] < 0) {
			_StatValues [index] = 0;
			return false;
		} else if (_StatValues [index] > LGstatData.kMaxStatus) {
			_StatValues [index] = LGstatData.kMaxStatus;
			return false;
		}
		return true;
	}
コード例 #4
0
ファイル: LGcharacter.cs プロジェクト: ryeander/LGprototype
	public bool AddTrait(LGstatData.TraitType type, int val) {
		int index = (int)type;
		_TraitValues[index] += val;
		if (_TraitValues [index] < 0) {
			_TraitValues [index] = 0;
			return false;
		} else if (_TraitValues [index] > LGstatData.kMaxTrait) {
			_TraitValues [index] = LGstatData.kMaxTrait;
			return false;
		}
		return true;
	}
コード例 #5
0
ファイル: LGskill.cs プロジェクト: ryeander/LGprototype
	// Constructor
	public LGskill(uint skillID, string newName, int effortCost, LGskillData.EffectType effect, LGstatData.TraitType sourceT,
		LGstatData.TraitType targetT, LGskillData.TargetType target, LGskillData.TeamType team) {
		// For now generate skillID in order, in future skillID should 
		// be powered by config files
		if (LGskillData.Skills.ContainsKey (skillID)) {
			Debug.LogError ("SkillID already used, use unique skillIDs");
			return;
		}
		_skillID = skillID;
		_name = newName;
		_effect = effect;
		_target = target;
		_team = team;
		_effortCost = effortCost;
		_sourceTrait = sourceT;
		_targetTrait = targetT;
		LGskillData.Skills.Add (_skillID,this);
	}
コード例 #6
0
ファイル: LGcharacter.cs プロジェクト: ryeander/LGprototype
	public int GetStat(LGstatData.StatusType type) {
		int index = (int)type;
		return _StatValues[index];
	}
コード例 #7
0
ファイル: LGcharacter.cs プロジェクト: ryeander/LGprototype
	public int GetTrait(LGstatData.TraitType type) {
		int index = (int)type;
		// Modify by Buffs here, return post buff value
		return _TraitValues[index];
	}