-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBattleTextScript.cs
More file actions
92 lines (77 loc) · 2.75 KB
/
BattleTextScript.cs
File metadata and controls
92 lines (77 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class BattleTextScript : MonoBehaviour
{
public GameObject playerText;
public GameObject enemyText;
public GameObject errorText;
public PlayerObject player;
public EnemyObject enemy;
string playerTextString()
{
string txt = "";
txt += player.PlayerRank + "\n";
txt += player.PWR + "\n";
txt += player.SPD + "\n";
txt += player.TGH + "\n\n";
txt += player.HP + "/" + player.MaxHP + "\n";
txt += player.SP + "/" + player.MaxSP + "\n";
/*
string txt = "HP: " + player.HP + "/" + player.MaxHP + "\n";
txt += "SP: " + player.SP + "/" + player.MaxSP + "\n";
txt += "DMG%: " + player.PWR * 10 + "\n";
txt += "DEF%: " + (int)(player.DEF * 100.0) + "\n";
txt += "EVA%: " + (int)(player.EVA * 100.0) + "\n";
txt += "REC%: " + (int)(player.REC * 100.0) + "\n";
txt += "LCK%: " + (int)(player.LCK * 100.0) + "\n";
txt += "PLAYER VALUES: \n";
txt += "PWR: " + player.PWR + "\n";
txt += "SPD: " + player.SPD + "\n";
txt += "TGH: " + player.TGH + "\n";
txt += "GUARDING: " + player.Guard + "\n";
*/
return txt;
}
string enemyTextString()
{
string txt = "";
if (player.PlayerRank == 1)
{
txt += "C\n";
}
else
{
txt += (player.PlayerRank - 1).ToString() + "\n";
}
txt += enemy.PWR + "\n";
txt += enemy.SPD + "\n";
txt += enemy.TGH + "\n";
/*
* string txt = "ENEMY VALUES: \n";
txt += "HP: " + enemy.HP + "/" + enemy.MaxHP + "\n";
txt += "SP: " + enemy.SP + "/" + enemy.MaxSP + "\n";
txt += "PWR: " + enemy.PWR + "\n";
txt += "SPD: " + enemy.SPD + "\n";
txt += "TGH: " + enemy.TGH + "\n";
txt += "DMG%: " + enemy.PWR * 10 + "\n";
txt += "DEF%: " + (int)(enemy.DEF * 100) + "\n";
txt += "EVA%: " + (int)(enemy.EVA * 100) + "\n";
txt += "LCK%: " + (int)(enemy.LCK * 100) + "\n";
txt += "REC%: " + (int)(enemy.REC * 100) + "\n";
txt += "GUARDING: " + enemy.Guard + "\n";
*/
return txt;
}
public void updateErrorText(string s)
{
errorText.GetComponent<Text>().text = s;
}
// Update is called once per frame
void Update()
{
playerText.GetComponent<Text>().text = playerTextString();
enemyText.GetComponent<Text>().text = enemyTextString();
}
}