Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
There are currently 2 display bugs with my game (though the code itse…
…lf works.) These bugs are:

1) When rolling the dice for the first time, even though the value for Con is entered, it does show up on the screen. Any rolls after the first time however show up.
2) After the first attack by the enemy, the display for the players HP, and enemy, will go to zero (even though it is not stored as such). After the second attack, it will display the correct number and keep showing the correct number.
  • Loading branch information
maf11003 committed Sep 15, 2015
1 parent 783d642 commit 116aaf7
Show file tree
Hide file tree
Showing 16 changed files with 285 additions and 26 deletions.
Binary file added New Unity Project 1/Assets/Ankou.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions New Unity Project 1/Assets/Ankou.jpg.meta

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

Binary file modified New Unity Project 1/Assets/DnD.unity
Binary file not shown.
Binary file modified New Unity Project 1/Assets/Labyrinth Lord Character Sheet.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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

Binary file not shown.

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

Binary file not shown.

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

91 changes: 91 additions & 0 deletions New Unity Project 1/Assets/Scripts/Fight.cs
@@ -0,0 +1,91 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Fight : MonoBehaviour
{
public float NHP;
public string NHPString;
public Text textNHP;

public float NEHP;
public string NEHPString;
public Text textNEHP;

public float EnemyMainDmg;
public string EnemyDamage;
public InputField Damage;
public Text textEnemyDamage;

public float EnemySecondDmg;
public string ESD;
public InputField ESecond;
public Text textESD;

public float PlayerDamage;
public string PDmg;
public InputField PDamage;
public Text textPDMG;

public float PSecondDmg;
public string PSecDmg;
public InputField PSDmg;
public Text textPSDmg;

public float EPM;
public string EPMString;
public InputField EPMInput;
public Text textEPM;

public float Test;


void Start ()
{
}


void Update ()
{
}

public void Clicking (string text)
{
GameObject Main_Camera = GameObject.Find ("Main_Camera");
Generator Generator = Main_Camera.GetComponent <Generator> ();

EPMString = textEPM.text.ToString ();
EPM = float.Parse (EPMString);

NHPString = NHP.ToString ();
textNHP.text = NHPString;

NEHPString = NEHP.ToString ();
textNEHP.text = NEHPString;

EnemyDamage = textEnemyDamage.text.ToString ();
EnemyMainDmg = float.Parse (EnemyDamage);

ESD = textESD.text.ToString ();
EnemySecondDmg = float.Parse (ESD);

PDmg = textPDMG.text.ToString ();
PlayerDamage = float.Parse (PDmg);

PSecDmg = textPSDmg.text.ToString ();
PSecondDmg = float.Parse (PSecDmg);

if (Random.Range (0, 100) > EPM)
{
NHP = (Generator.HP - Mathf.Round (Random.Range (EnemyMainDmg, EnemySecondDmg)));
Generator.HP = NHP;
}
else
{
print ("Enemy missed their attack");
}

NEHP = Generator.EnemyHP - (Mathf.Round (Random.Range (PlayerDamage, PSecondDmg)));
Generator.EnemyHP = NEHP;
}
}

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

9 changes: 8 additions & 1 deletion New Unity Project 1/Assets/Scripts/Generator.cs
Expand Up @@ -11,6 +11,7 @@ public class Generator : MonoBehaviour
public float Wis;
public float Chr;
public float HP;
public float EnemyHP;

public string StrString;
public string DexString;
Expand All @@ -19,6 +20,7 @@ public class Generator : MonoBehaviour
public string WisString;
public string ChrString;
public string HPString;
public string EHPString;

public Text textStr;
public Text textDex;
Expand All @@ -27,6 +29,7 @@ public class Generator : MonoBehaviour
public Text textWis;
public Text textChr;
public Text textHP;
public Text textEHP;

void Start ()
{
Expand All @@ -36,12 +39,13 @@ public class Generator : MonoBehaviour
Int = 0;
Wis = 0;
Chr = 0;
HP = 0;
EnemyHP = 10;
}

// Update is called once per frame
void Update ()
{

}

public void Click (string text)
Expand All @@ -54,6 +58,9 @@ public class Generator : MonoBehaviour
Chr = (Random.Range(1, 6) + Random.Range (1,6) + Random.Range (1,6));
HP = Mathf.Round ( ( Con * 0.10f ) + ( Random.Range (1, 8) ) ) ;

EHPString = EnemyHP.ToString ();
textEHP.text = EHPString;

StrString = Str.ToString();
textStr.text = StrString;

Expand Down
23 changes: 0 additions & 23 deletions New Unity Project 1/Assets/Scripts/healthGlobal.cs

This file was deleted.

0 comments on commit 116aaf7

Please sign in to comment.