Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class battle : MonoBehaviour {
  6. public static float STAB;
  7. public static float resweak_to_user;
  8. public static float resweak_to_enemy;
  9. public static string enemy_atak_chosen_type;
  10. public static int enemy_atak_chosen_type_int;
  11. public static int j, k,m;
  12. // Use this for initialization
  13. void Start() {
  14. print(current.typ1 + current.typ2);
  15. TextAsset typy = Resources.Load<TextAsset>("types");
  16. string[] data = typy.text.Split(new char[] { '\n' });
  17. print(current.typ1 + current.typ2);
  18. if (current.typ1.Equals("Normal")) { j = 0; }
  19. if (current.typ1.Equals("Fire")) { j = 18; }
  20. if (current.typ1.Equals("Water")) { j = 36; }
  21. if (current.typ1.Equals("Electric")) { j = 54; }
  22. if (current.typ1.Equals("Grass")) { j = 72; }
  23. if (current.typ1.Equals("Ice")) { j = 90; }
  24. if (current.typ1.Equals("Fighting")) { j = 108; }
  25. if (current.typ1.Equals("Poison")) { j = 126; }
  26. if (current.typ1.Equals("Ground")) { j = 144; }
  27. if (current.typ1.Equals("Flying")) { j = 162; }
  28. if (current.typ1.Equals("Psychic")) { j = 180; }
  29. if (current.typ1.Equals("Bug")) { j = 198; }
  30. if (current.typ1.Equals("Rock")) { j = 216; }
  31. if (current.typ1.Equals("Ghost")) { j = 234; }
  32. if (current.typ1.Equals("Dragon")) { j = 252; }
  33. if (current.typ1.Equals("Dark")) { j = 272; }
  34. if (current.typ1.Equals("Steel")) { j = 288; }
  35.  
  36. if (current.typ2.Equals("None")) { current.typ2 = current.typ1; }
  37. if (current.typ2.Equals("Normal")) { k = 1; }
  38. if (current.typ2.Equals("Fire")) { k = 2; }
  39. if (current.typ2.Equals("Water")) { k = 3; }
  40. if (current.typ2.Equals("Electric")) { k = 4; }
  41. if (current.typ2.Equals("Grass")) { k = 5; }
  42. if (current.typ2.Equals("Ice")) { k = 6; }
  43. if (current.typ2.Equals("Fighting")) { k = 7; }
  44. if (current.typ2.Equals("Poison")) { k = 8; }
  45. if (current.typ2.Equals("Ground")) { k = 9; }
  46. if (current.typ2.Equals("Flying")) { k = 10; }
  47. if (current.typ2.Equals("Psychic")) { k = 11; }
  48. if (current.typ2.Equals("Bug")) { k = 12; }
  49. if (current.typ2.Equals("Rock")) { k = 13; }
  50. if (current.typ2.Equals("Ghost")) { k = 14; }
  51. if (current.typ2.Equals("Dragon")) { k = 15; }
  52. if (current.typ2.Equals("Dark")) { k = 16; }
  53. if (current.typ2.Equals("Steel")) { k = 17; }
  54. print("j: " + j + "k: " + k);
  55.  
  56. for (int i = j + k; i <= j + k; i++)
  57. {
  58. enemy_atak_chosen_type = "Water";
  59.  
  60. string[] row = data[i].Split(new char[] { ';' });
  61. m = 0;
  62. if (enemy_atak_chosen_type.Equals("Normal"))
  63. { m = 1; }
  64.  
  65. if (enemy_atak_chosen_type.Equals("Fire")) { m = 2; }
  66. if (enemy_atak_chosen_type.Equals("Water")) { m = 3; }
  67. if (enemy_atak_chosen_type.Equals("Electric")) { m = 4; }
  68. if (enemy_atak_chosen_type.Equals("Grass")) { m = 5; }
  69. if (enemy_atak_chosen_type.Equals("Ice")) { m = 6; }
  70. if (enemy_atak_chosen_type.Equals("Fighting")) { m = 7; }
  71. if (enemy_atak_chosen_type.Equals("Poison")) { m = 8; }
  72. if (enemy_atak_chosen_type.Equals("Ground")) { m = 9; }
  73. if (enemy_atak_chosen_type.Equals("Flying")) { m = 10; }
  74. if (enemy_atak_chosen_type.Equals("Psychic")) { m = 11; }
  75. if (enemy_atak_chosen_type.Equals("Bug")) { m = 12; }
  76. if (enemy_atak_chosen_type.Equals("Rock")) { m = 13; }
  77. if (enemy_atak_chosen_type.Equals("Ghost")) { m = 14; }
  78. if (enemy_atak_chosen_type.Equals("Dragon")) { m = 15; }
  79. if (enemy_atak_chosen_type.Equals("Dark")) { m = 16; }
  80. if (enemy_atak_chosen_type.Equals("Steel")) { m = 17; }
  81.  
  82. print(m);
  83. enemy_atak_chosen_type = row[m];
  84. float enemy_atak_chosen_type_float = float.Parse(enemy_atak_chosen_type);
  85. print(resweak_to_user);
  86. }
  87.  
  88.  
  89.  
  90. }
  91. // Update is called once per frame
  92. void Update() {
  93.  
  94. }
  95.  
  96.  
  97. void typecheckuser()
  98. {
  99.  
  100. }
  101.  
  102. /*
  103. void damagetoenemy ()
  104. {
  105. if (current.atak_type_chosen == current.typ1 && current.atak_type_chosen == current.typ2)
  106. {
  107. STAB = 1.5;
  108. } }
  109. else
  110. {
  111. STAB = 1;
  112. }
  113.  
  114. damage = ((((2 * current.poziom / 5 + 2) * current.atak * current.atak_power_chosen / DefenseStat) / 50) + 2) * STAB * Weakness / Resistance * Random.Range(85, 100) / 100;
  115.  
  116.  
  117.  
  118.  
  119. }*/
  120.  
  121.  
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement