Commit
…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
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file was deleted.