/** * Creates a stat of the given type with the given costs; * The sc array should have one less value than the vals array! */ public Stat (STAT_TYPE t, int[] vals, Stat_Cost[] sc) { type = t; values = new float[vals.Length]; for (int idx = 0; idx < vals.Length; ++idx) { values[idx] = vals[idx]; } pointer = 0; costs = sc; }
public static STAT_TYPE GetStatType(string executablepath) { STAT_TYPE eStatType = STAT_TYPE.none; if (executablepath.Contains("python")) { eStatType = STAT_TYPE.py; } else if (executablepath.Contains("julia")) { eStatType = STAT_TYPE.julia; } else { eStatType = STAT_TYPE.r; } //aml addressed when subalgo 4 is debugged return(eStatType); }
public void DecreaseStat(STAT_TYPE type, int amt) { if (eventMan.isEvent) { return; } if (curEnergy < maxEnergy - stressAmt) { ++curEnergy; if (isPassive) { --passiveStatDelta[(int)type]; } else { curStat[(int)type] -= amt; } } }
public int GetModifier(STAT_TYPE statType) { int baseStat = GetStat(statType); int nearestEven = GetEvenFloor(baseStat); int remainder; if (nearestEven <= 0) { Debug.Log("less than zero: " + nearestEven); remainder = 0; } else { //Debug.Log (nearestEven); remainder = nearestEven / 2; } int modifer = remainder - 5; return(modifer); }
public void Set(STAT_TYPE statType, int amount) { switch (statType) { case STAT_TYPE.CHARISMA: charisma = amount; break; case STAT_TYPE.STRENGTH: strength = amount; break; case STAT_TYPE.WISDOM: wisdom = amount; break; case STAT_TYPE.MOVEMENT_SPEED: movementSpeed = amount; break; } }
// Humanize Methods public string Humanize(float value, STAT_TYPE statType, out HumanizeEnum humanizeEnum) { for (int i = 0; i < GoodBadHumanizeType.Count; i++) { if (statType == GoodBadHumanizeType[i]) { humanizeEnum = HumanizeEnum.GoodBad; return(HumanizeGoodBad(value)); } } for (int i = 0; i < NewPhraseHumanizeType.Count; i++) { if (statType == NewPhraseHumanizeType[i]) { humanizeEnum = HumanizeEnum.NewPhrase; return(HumanizeNewPhrase(value, statType)); } } humanizeEnum = HumanizeEnum.LowHigh; return(HumanizeLowHigh(value)); }
public void IncreaseStat(STAT_TYPE type, int amt) { if (eventMan.isEvent) { return; } if (curEnergy > 0) { if (isPassive) { ++passiveStatDelta[(int)type]; } else { if (curStat[(int)type] + amt < maxStat[(int)type]) { curStat[(int)type] += amt; } } --curEnergy; } }
public float GetStatAmount(STAT_TYPE type) { return(curStat[(int)type]); }
public float GetStatPercentage(STAT_TYPE type) { int index = (int)type; return(curStat[index] / maxStat[index]); }
/* Returns the weapon stat corresponding to the given type. * See Enumerations class for valid values for parameter t. */ public Stat weapon_stat(STAT_TYPE t) { switch (t) { case STAT_TYPE.damage: return stats[0]; case STAT_TYPE.rate_of_fire: return stats[1]; case STAT_TYPE.ammo: return stats[2]; default: return null; } }
public StatPair(STAT_TYPE type, int amount) { statType = type; statAmount = amount; }
private void RemoveStat(STAT_TYPE statType) { internalList = FilterStat(internalList, statType); }
public EntityStatModifier(STAT_TYPE targetStat, Modifier modifier, float value) { this.targetStat = targetStat; this.modifier = modifier; this.value = value; }
/** * Creates a stat of the given type with the given costs; * The sc array should have one less value than the vals array! */ public Stat (STAT_TYPE t, float[] vals, Stat_Cost[] sc) { type = t; values = vals; pointer = 0; costs = sc; }