Permalink
Cannot retrieve contributors at this time
using UnityEngine; | |
using System.Collections; | |
using UnityEngine.UI; | |
public class RNG_HP : MonoBehaviour { | |
//HP Base Values | |
public int HPValue = 0; | |
public int HPValue1 = 0; | |
public int HPValue2 = 0; | |
public int HPValue3 = 0; | |
private string HPString; | |
public int conHpMod = 0; | |
//Con base Values | |
public int ConValue = 0; | |
public int ConValue1 = 0; | |
public int ConValue2 = 0; | |
public int ConValue3 = 0; | |
public int conPercent = 0; | |
private string ConString; | |
Text updates; | |
void Awake() | |
{ | |
updates = GetComponent<Text>(); | |
HPString = "HP:"; | |
} | |
// Use this for initialization | |
public void Roll() | |
{ | |
//HP Rolls | |
HPValue1 = Random.Range(1, 8); | |
HPValue2 = Random.Range(1, 8); | |
HPValue3 = Random.Range(1, 8); | |
HPValue = HPValue1 + HPValue2 + HPValue3 + conHpMod; | |
//Constituion Rolls | |
ConValue1 = Random.Range(1, 6); | |
ConValue2 = Random.Range(1, 6); | |
ConValue3 = Random.Range(1, 6); | |
ConValue = ConValue1 + ConValue2 + ConValue3; | |
//String Value | |
HPString = HPValue.ToString(); | |
ConString = ConValue.ToString(); | |
//ConHPModifiers | |
conHpMod = ConValue / 10; | |
Debug.Log(HPString); | |
Debug.Log(ConValue); | |
} | |
// Update is called once per frame | |
void Update() | |
{ | |
updates.text = "HP: " + HPString; | |
} | |
} |