Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
DnDCharacterStatGenerator/Assets/numGen.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
92 lines (77 sloc)
2.28 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |