Skip to content

Commit

Permalink
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
wik14003 committed Sep 12, 2015
1 parent ac6a2c3 commit 5a1d10e
Show file tree
Hide file tree
Showing 24 changed files with 205 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Assets/EnemyFight.cs
@@ -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 () {


}
}
12 changes: 12 additions & 0 deletions Assets/EnemyFight.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Assets/TextBox.cs
@@ -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;
}
}
12 changes: 12 additions & 0 deletions Assets/TextBox.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/WriteText.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/WriteText.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 92 additions & 0 deletions Assets/numGen.cs
@@ -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;

}
}
12 changes: 12 additions & 0 deletions Assets/numGen.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/stats.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/stats.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added ProjectSettings/AudioManager.asset
Binary file not shown.
Binary file added ProjectSettings/DynamicsManager.asset
Binary file not shown.
Binary file added ProjectSettings/EditorBuildSettings.asset
Binary file not shown.
Binary file added ProjectSettings/EditorSettings.asset
Binary file not shown.
Binary file added ProjectSettings/GraphicsSettings.asset
Binary file not shown.
Binary file added ProjectSettings/InputManager.asset
Binary file not shown.
Binary file added ProjectSettings/NavMeshAreas.asset
Binary file not shown.
Binary file added ProjectSettings/NetworkManager.asset
Binary file not shown.
Binary file added ProjectSettings/Physics2DSettings.asset
Binary file not shown.
Binary file added ProjectSettings/ProjectSettings.asset
Binary file not shown.
2 changes: 2 additions & 0 deletions ProjectSettings/ProjectVersion.txt
@@ -0,0 +1,2 @@
m_EditorVersion: 5.1.3f1
m_StandardAssetsVersion: 0
Binary file added ProjectSettings/QualitySettings.asset
Binary file not shown.
Binary file added ProjectSettings/TagManager.asset
Binary file not shown.
Binary file added ProjectSettings/TimeManager.asset
Binary file not shown.

0 comments on commit 5a1d10e

Please sign in to comment.