Skip to content
Permalink
5a1d10e567
Go to file
 
 
Cannot retrieve contributors at this time
92 lines (77 sloc) 2.28 KB
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class numGen : MonoBehaviour {
//
public string Name = "Yohan Von Spoot";
public float Hp;
public float Dmg;
public int Str;
public int Dex;
public int Con;
public int Intel;
public int Wis;
public int Chr;
public Text Hpstat;
public Text Dmgstat;
public Text Strstat;
public Text Dexstat;
public Text Constat;
public Text Intelstat;
public Text Wisstat;
public Text Chrstat;
public string HpString;
public string DmgString;
public string StrString;
public string DexString;
public string ConString;
public string IntelString;
public string WisString;
public string ChrString;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void ClickTest(string text){
//stat generaltion roll 3d6
Str = (Random.Range (1, 6)) + (Random.Range (1, 6)) + (Random.Range (1, 6));
Dex = (Random.Range (1, 6)) + (Random.Range (1, 6)) + (Random.Range (1, 6));
Con = (Random.Range (1, 6)) + (Random.Range (1, 6)) + (Random.Range (1, 6));
Intel = (Random.Range (1, 6)) + (Random.Range (1, 6)) + (Random.Range (1, 6));
Wis = (Random.Range (1, 6)) + (Random.Range (1, 6)) + (Random.Range (1, 6));
Chr = (Random.Range (1, 6)) + (Random.Range (1, 6)) + (Random.Range (1, 6));
//Console check
//Debug.Log (Str);
//Debug.Log (Dex);
//Debug.Log (Con);
//Debug.Log (Intel);
//Debug.Log (Wis);
//Debug.Log (Chr);
//HP generation roll 1d8 + 10% Con bonus
Hp = (Random.Range (1, 8)) + (Con * 0.10f);
Debug.Log (Hp);
//Damage Modifier
Debug.Log (Str * 0.20f);
Dmg = (Random.Range (1, 6)) + (Str * 0.20f);
//Converts stat int to string
HpString = Hp.ToString ();
DmgString = Dmg.ToString ();
StrString = Str.ToString ();
DexString = Dex.ToString ();
ConString = Con.ToString ();
IntelString = Intel.ToString ();
WisString = Wis.ToString ();
ChrString = Chr.ToString ();
//Display these dope stats
Hpstat.text = "Hp = " + HpString;
Dmgstat.text = "Dmg = " + DmgString;
Strstat.text = "Str = " + StrString;
Dexstat.text = "Dex = " + DexString;
Constat.text = "Con = " + ConString;
Intelstat.text = "Intel = " + IntelString;
Wisstat.text = "Wis = " + WisString;
Chrstat.text = "Chr = " + ChrString;
}
}
You can’t perform that action at this time.