コード例 #1
0
ファイル: Stat.cs プロジェクト: zrcoutur/topdown
	/**
	 * 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;
	}
コード例 #2
0
ファイル: StatScript.cs プロジェクト: kpboyle1/devtreksapi2
        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);
        }
コード例 #3
0
    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;
            }
        }
    }
コード例 #4
0
ファイル: Stats.cs プロジェクト: NotYours180/unity-scripts
    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);
    }
コード例 #5
0
ファイル: Stats.cs プロジェクト: NotYours180/unity-scripts
    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;
        }
    }
コード例 #6
0
        // 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));
        }
コード例 #7
0
    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;
        }
    }
コード例 #8
0
 public float GetStatAmount(STAT_TYPE type)
 {
     return(curStat[(int)type]);
 }
コード例 #9
0
    public float GetStatPercentage(STAT_TYPE type)
    {
        int index = (int)type;

        return(curStat[index] / maxStat[index]);
    }
コード例 #10
0
ファイル: WeaponStats.cs プロジェクト: zrcoutur/topdown
	/* 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;
		}
	}
コード例 #11
0
ファイル: Stats.cs プロジェクト: NotYours180/unity-scripts
 public StatPair(STAT_TYPE type, int amount)
 {
     statType   = type;
     statAmount = amount;
 }
コード例 #12
0
ファイル: Stats.cs プロジェクト: NotYours180/unity-scripts
 private void RemoveStat(STAT_TYPE statType)
 {
     internalList = FilterStat(internalList, statType);
 }
コード例 #13
0
 public EntityStatModifier(STAT_TYPE targetStat, Modifier modifier, float value)
 {
     this.targetStat = targetStat;
     this.modifier   = modifier;
     this.value      = value;
 }
コード例 #14
0
ファイル: Stat.cs プロジェクト: zrcoutur/topdown
	/**
	 * 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;
	}