public void update_gym(Gym gym, int index) { if (index != 1 && index != 2) { return; } index--; gyms[index] = gym; }
private void Gym_Click(object sender, RoutedEventArgs e) { if (WorldMap.getin_gymable() == -1) { return; } mgym = WorldMap.Gyms[WorldMap.getin_gymable() - 1]; tabControl.SelectedIndex = 4; DrawPlayerPokemonsIn(ChooseBattlePMListBox); }
public Gym_battle(Pokemon guest, Pokemon host, Gym place) { battling[0] = guest; battling[1] = host; Gym_battling = place; xp = 0; guest_skills = new int[] { ((battling[0]).Skills)[0], ((battling[0]).Skills)[1] }; host_skills = new int[] { ((battling[1]).Skills)[0], ((battling[1]).Skills)[1] }; guest_skills_type = new int[] { datalist.Skill_Type(guest_skills[0]), datalist.Skill_Type(guest_skills[1]) }; host_skills_type = new int[] { datalist.Skill_Type(host_skills[0]), datalist.Skill_Type(host_skills[1]) }; guest_type = datalist.Poke_Type((battling[0]).Poke_no); host_type = datalist.Poke_Type((battling[1]).Poke_no); this.GuestPM = Bat_Poke[0]; this.HostPM = Bat_Poke[1]; ResultStatus = Result.NoFaint; }
//temp public Map(int x, int y, int len0, int len1) { if (len0 >= 10) { this.len0 = len0; } else { this.len0 = 10; } if (len1 >= 10) { this.len1 = len1; } else { this.len1 = 10; } map = new int[len0, len1]; int[] temp_ar = Map_randomize(); map[0, 0] = 0;//0 is road/grass, 1 is poke, 2 is items, 9 is gym, 10+ is unaccessable region like river. (10 pond, 11 tree) if (map[x, y] <= 8) { if (x >= len0 - 1) { this.x = 0; } else { this.x = x; } if (y >= len1 - 1) { this.y = 0; } else { this.y = y; } } else { int min_dis = len0 * len0 + len1 * len1; int tempx = x; int tempy = y; for (int i = 0; i < len0; i++) { // in case originally in unaccessable region find the nearest save spot as a starting pt. for (int j = 0; j < len1; j++) { if (map[i, j] <= 8) { int temp = (i - x) * (i - x) + (j - y) * (j - y); if (temp < min_dis) { min_dis = temp; tempx = i; tempy = j; } } } } this.x = tempx; this.y = tempy; } gyms[0] = new Gym("Gym 1", temp_ar[0], temp_ar[1]); gyms[1] = new Gym("Gym 2", temp_ar[2], temp_ar[3]); for (int i = 0; i < 2; i++) { gyms[0].Addstrong(); gyms[1].Addstrong(); } for (int i = 0; i < 4; i++) { gyms[0].Addrandom(); gyms[1].Addrandom(); } }