Ejemplo n.º 1
0
	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;
	}
Ejemplo n.º 2
0
	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;
	}
Ejemplo n.º 3
0
	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;
	}
Ejemplo n.º 4
0
	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;
	}
Ejemplo n.º 5
0
	// 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);
	}
Ejemplo n.º 6
0
	public int GetStat(LGstatData.StatusType type) {
		int index = (int)type;
		return _StatValues[index];
	}
Ejemplo n.º 7
0
	public int GetTrait(LGstatData.TraitType type) {
		int index = (int)type;
		// Modify by Buffs here, return post buff value
		return _TraitValues[index];
	}