Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
DnDStat Mob Not Working
Stat gen implemented with text fields for name and mob but fight does not work
- Loading branch information
Showing
24 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using UnityEngine.UI; | ||
|
||
public class EnemyFight : MonoBehaviour { | ||
|
||
// Use this for initialization | ||
void Start () { | ||
var input = gameObject.GetComponent <InputField>(); | ||
var se= new InputField.SubmitEvent(); | ||
se.AddListener(SubmitName); | ||
input.onEndEdit = se; | ||
} | ||
private void SubmitName(string arg0) | ||
{ | ||
Debug.Log (arg0); | ||
} | ||
// Update is called once per frame | ||
void Update () { | ||
|
||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using UnityEngine; | ||
|
||
|
||
//YOU MUST USE THIS LINE TO GET ACCESS TO UI STUFF | ||
using UnityEngine.UI; | ||
|
||
|
||
|
||
using System.Collections; | ||
|
||
public class TextBox : MonoBehaviour { | ||
|
||
public float Str; | ||
public string StrString; | ||
public Text textRef; | ||
|
||
|
||
// Use this for initialization | ||
void Start () { | ||
Str = 0; | ||
|
||
|
||
} | ||
|
||
// Update is called once per frame | ||
void Update () { | ||
|
||
} | ||
|
||
public void ClickTest(string text){ | ||
Debug.Log (text); | ||
Str = Random.Range (1, 10); | ||
StrString = Str.ToString(); | ||
textRef.text = StrString; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
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; | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
m_EditorVersion: 5.1.3f1 | ||
m_StandardAssetsVersion: 0 |
Binary file not shown.
Binary file not shown.
Binary file not shown.