Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class battle : MonoBehaviour {
- public static float STAB;
- public static float resweak_to_user;
- public static float resweak_to_enemy;
- public static string enemy_atak_chosen_type;
- public static int enemy_atak_chosen_type_int;
- public static int j, k,m;
- // Use this for initialization
- void Start() {
- print(current.typ1 + current.typ2);
- TextAsset typy = Resources.Load<TextAsset>("types");
- string[] data = typy.text.Split(new char[] { '\n' });
- print(current.typ1 + current.typ2);
- if (current.typ1.Equals("Normal")) { j = 0; }
- if (current.typ1.Equals("Fire")) { j = 18; }
- if (current.typ1.Equals("Water")) { j = 36; }
- if (current.typ1.Equals("Electric")) { j = 54; }
- if (current.typ1.Equals("Grass")) { j = 72; }
- if (current.typ1.Equals("Ice")) { j = 90; }
- if (current.typ1.Equals("Fighting")) { j = 108; }
- if (current.typ1.Equals("Poison")) { j = 126; }
- if (current.typ1.Equals("Ground")) { j = 144; }
- if (current.typ1.Equals("Flying")) { j = 162; }
- if (current.typ1.Equals("Psychic")) { j = 180; }
- if (current.typ1.Equals("Bug")) { j = 198; }
- if (current.typ1.Equals("Rock")) { j = 216; }
- if (current.typ1.Equals("Ghost")) { j = 234; }
- if (current.typ1.Equals("Dragon")) { j = 252; }
- if (current.typ1.Equals("Dark")) { j = 272; }
- if (current.typ1.Equals("Steel")) { j = 288; }
- if (current.typ2.Equals("None")) { current.typ2 = current.typ1; }
- if (current.typ2.Equals("Normal")) { k = 1; }
- if (current.typ2.Equals("Fire")) { k = 2; }
- if (current.typ2.Equals("Water")) { k = 3; }
- if (current.typ2.Equals("Electric")) { k = 4; }
- if (current.typ2.Equals("Grass")) { k = 5; }
- if (current.typ2.Equals("Ice")) { k = 6; }
- if (current.typ2.Equals("Fighting")) { k = 7; }
- if (current.typ2.Equals("Poison")) { k = 8; }
- if (current.typ2.Equals("Ground")) { k = 9; }
- if (current.typ2.Equals("Flying")) { k = 10; }
- if (current.typ2.Equals("Psychic")) { k = 11; }
- if (current.typ2.Equals("Bug")) { k = 12; }
- if (current.typ2.Equals("Rock")) { k = 13; }
- if (current.typ2.Equals("Ghost")) { k = 14; }
- if (current.typ2.Equals("Dragon")) { k = 15; }
- if (current.typ2.Equals("Dark")) { k = 16; }
- if (current.typ2.Equals("Steel")) { k = 17; }
- print("j: " + j + "k: " + k);
- for (int i = j + k; i <= j + k; i++)
- {
- enemy_atak_chosen_type = "Water";
- string[] row = data[i].Split(new char[] { ';' });
- m = 0;
- if (enemy_atak_chosen_type.Equals("Normal"))
- { m = 1; }
- if (enemy_atak_chosen_type.Equals("Fire")) { m = 2; }
- if (enemy_atak_chosen_type.Equals("Water")) { m = 3; }
- if (enemy_atak_chosen_type.Equals("Electric")) { m = 4; }
- if (enemy_atak_chosen_type.Equals("Grass")) { m = 5; }
- if (enemy_atak_chosen_type.Equals("Ice")) { m = 6; }
- if (enemy_atak_chosen_type.Equals("Fighting")) { m = 7; }
- if (enemy_atak_chosen_type.Equals("Poison")) { m = 8; }
- if (enemy_atak_chosen_type.Equals("Ground")) { m = 9; }
- if (enemy_atak_chosen_type.Equals("Flying")) { m = 10; }
- if (enemy_atak_chosen_type.Equals("Psychic")) { m = 11; }
- if (enemy_atak_chosen_type.Equals("Bug")) { m = 12; }
- if (enemy_atak_chosen_type.Equals("Rock")) { m = 13; }
- if (enemy_atak_chosen_type.Equals("Ghost")) { m = 14; }
- if (enemy_atak_chosen_type.Equals("Dragon")) { m = 15; }
- if (enemy_atak_chosen_type.Equals("Dark")) { m = 16; }
- if (enemy_atak_chosen_type.Equals("Steel")) { m = 17; }
- print(m);
- enemy_atak_chosen_type = row[m];
- float enemy_atak_chosen_type_float = float.Parse(enemy_atak_chosen_type);
- print(resweak_to_user);
- }
- }
- // Update is called once per frame
- void Update() {
- }
- void typecheckuser()
- {
- }
- /*
- void damagetoenemy ()
- {
- if (current.atak_type_chosen == current.typ1 && current.atak_type_chosen == current.typ2)
- {
- STAB = 1.5;
- } }
- else
- {
- STAB = 1;
- }
- damage = ((((2 * current.poziom / 5 + 2) * current.atak * current.atak_power_chosen / DefenseStat) / 50) + 2) * STAB * Weakness / Resistance * Random.Range(85, 100) / 100;
- }*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement