public FallosLanzandoHechizo get_Puede_Lanzar_hechizo(short hechizo_id) { Hechizo hechizo = cuenta.juego.personaje.get_Hechizo(hechizo_id); if (hechizo == null) { return(FallosLanzandoHechizo.DESONOCIDO); } HechizoStats datos_hechizo = hechizo.get_Stats(); if (jugador_luchador.pa < datos_hechizo.coste_pa) { return(FallosLanzandoHechizo.PUNTOS_ACCION); } if (datos_hechizo.lanzamientos_por_turno > 0 && total_hechizos_lanzados.ContainsKey(hechizo_id) && total_hechizos_lanzados[hechizo_id] >= datos_hechizo.lanzamientos_por_turno) { return(FallosLanzandoHechizo.DEMASIADOS_LANZAMIENTOS); } if (hechizos_intervalo.ContainsKey(hechizo_id)) { return(FallosLanzandoHechizo.COOLDOWN); } if (datos_hechizo.efectos_normales.Count > 0 && datos_hechizo.efectos_normales[0].id == 181 && contador_invocaciones >= cuenta.juego.personaje.caracteristicas.criaturas_invocables.total_stats) { return(FallosLanzandoHechizo.DEMASIADAS_INVOCACIONES); } return(FallosLanzandoHechizo.NINGUNO); }
public FallosLanzandoHechizo get_Puede_Lanzar_hechizo(int hechizo_id) { Hechizo hechizo = cuenta.personaje.get_Hechizo(hechizo_id); if (hechizo == null) { return(FallosLanzandoHechizo.DESONOCIDO); } HechizoStats datos_hechizo = hechizo.get_Hechizo_Stats()[hechizo.nivel]; if (jugador_luchador.pa < datos_hechizo.coste_pa) { return(FallosLanzandoHechizo.PUNTOS_ACCION); } if (datos_hechizo.lanzamientos_por_turno > 0 && total_hechizos_lanzados.ContainsKey(hechizo_id) && total_hechizos_lanzados[hechizo_id] >= datos_hechizo.lanzamientos_por_turno) { return(FallosLanzandoHechizo.DEMASIADOS_LANZAMIENTOS); } if (hechizos_intervalo.ContainsKey(hechizo_id)) { return(FallosLanzandoHechizo.COOLDOWN); } return(FallosLanzandoHechizo.NINGUNO); }
public FallosLanzandoHechizo get_Puede_Lanzar_hechizo(int hechizo_id, short celda_objetivo, Mapa mapa) { Hechizo hechizo = cuenta.personaje.hechizos.FirstOrDefault(f => f.id == hechizo_id); if (hechizo == null) { return(FallosLanzandoHechizo.DESONOCIDO); } HechizoStats datos_hechizo = hechizo.get_Hechizo_Stats()[hechizo.nivel]; if (datos_hechizo.lanzamientos_por_objetivo > 0 && total_hechizos_lanzados_en_celda.ContainsKey(hechizo_id) && total_hechizos_lanzados_en_celda[hechizo_id].ContainsKey(celda_objetivo) && total_hechizos_lanzados_en_celda[hechizo_id][celda_objetivo] >= datos_hechizo.lanzamientos_por_objetivo) { return(FallosLanzandoHechizo.DEMASIADOS_LANZAMIENTOS_POR_OBJETIVO); } if (datos_hechizo.es_celda_vacia && !es_Celda_Libre(celda_objetivo)) { return(FallosLanzandoHechizo.NECESITA_CELDA_LIBRE); } if (datos_hechizo.es_lanzado_linea && !celdas_mapa[jugador_luchador.celda_id].get_Esta_En_Linea(celda_objetivo)) { return(FallosLanzandoHechizo.NO_ESTA_EN_LINEA); } if (!get_Rango_hechizo(jugador_luchador.celda_id, datos_hechizo, mapa).Contains(celda_objetivo)) { return(FallosLanzandoHechizo.NO_ESTA_EN_RANGO); } return(FallosLanzandoHechizo.NINGUNO); }
public void actualizar_Hechizo_Exito(short celda_id, short hechizo_id) { Hechizo hechizo = cuenta.juego.personaje.get_Hechizo(hechizo_id); HechizoStats datos_hechizo = hechizo.get_Stats(); if (datos_hechizo.intervalo > 0 && !hechizos_intervalo.ContainsKey(hechizo.id)) { hechizos_intervalo.Add(hechizo.id, datos_hechizo.intervalo); } if (!total_hechizos_lanzados.ContainsKey(hechizo.id)) { total_hechizos_lanzados.Add(hechizo.id, 0); } total_hechizos_lanzados[hechizo.id]++; if (total_hechizos_lanzados_en_celda.ContainsKey(hechizo.id)) { if (!total_hechizos_lanzados_en_celda[hechizo.id].ContainsKey(celda_id)) { total_hechizos_lanzados_en_celda[hechizo.id].Add(celda_id, 0); } total_hechizos_lanzados_en_celda[hechizo.id][celda_id]++; } else { total_hechizos_lanzados_en_celda.Add(hechizo.id, new Dictionary <int, int>() { { celda_id, 1 } }); } }
public List <short> get_Rango_hechizo(Celda celda_personaje, HechizoStats datos_hechizo, Mapa mapa) { List <short> rango = new List <short>(); foreach (Celda celda in HechizoShape.Get_Lista_Celdas_Rango_Hechizo(celda_personaje, datos_hechizo, cuenta.juego.mapa, cuenta.juego.personaje.caracteristicas.alcanze.total_stats)) { if (celda == null || rango.Contains(celda.id)) { continue; } if (datos_hechizo.es_celda_vacia && get_Celdas_Ocupadas.Contains(celda.id)) { continue; } if (celda.tipo != TipoCelda.NO_CAMINABLE || celda.tipo != TipoCelda.OBJETO_INTERACTIVO) { rango.Add(celda.id); } } if (datos_hechizo.es_lanzado_con_vision) { for (int i = rango.Count - 1; i >= 0; i--) { if (get_Linea_Obstruida(mapa, celda_personaje, mapa.get_Celda_Id(rango[i]), get_Celdas_Ocupadas)) { rango.RemoveAt(i); } } } return(rango); }
private async Task <ResultadoLanzandoHechizo> lanzar_Hechizo_Celda_Vacia(PeleaHechizos hechizo_pelea) { if (pelea.get_Puede_Lanzar_hechizo(hechizo_pelea.id) != FallosLanzandoHechizo.NINGUNO) { return(ResultadoLanzandoHechizo.NO_LANZADO); } if (hechizo_pelea.focus == HechizoFocus.CELDA_VACIA && pelea.get_Cuerpo_A_Cuerpo_Enemigo().Count() == 4) { return(ResultadoLanzandoHechizo.NO_LANZADO); } Hechizo hechizo = cuenta.juego.personaje.get_Hechizo(hechizo_pelea.id); HechizoStats hechizo_stats = hechizo.get_Stats(); List <short> rangos_disponibles = pelea.get_Rango_Hechizo(pelea.jugador_luchador.celda, hechizo_stats, mapa); foreach (short rango in rangos_disponibles) { if (pelea.get_Puede_Lanzar_hechizo(hechizo_pelea.id, pelea.jugador_luchador.celda, mapa.get_Celda_Id(rango), mapa) == FallosLanzandoHechizo.NINGUNO) { if (hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.CAC || hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.AMBOS && mapa.get_Celda_Id(rango).get_Distancia(pelea.jugador_luchador.celda) != 1) { continue; } await pelea.get_Lanzar_Hechizo(hechizo_pelea.id, rango); return(ResultadoLanzandoHechizo.LANZADO); } } return(ResultadoLanzandoHechizo.NO_LANZADO); }
private async Task <ResultadoLanzandoHechizo> lanzar_Hechizo_Celda_Vacia(HechizoPelea hechizo_pelea) { if (_fight.get_Puede_Lanzar_hechizo(hechizo_pelea.id) != FallosLanzandoHechizo.NONE) { return(ResultadoLanzandoHechizo.NO_LANZADO); } if (hechizo_pelea.focus == HechizoFocus.CELDA_VACIA && _fight.get_Cuerpo_A_Cuerpo_Enemigo().Count() == 4) { return(ResultadoLanzandoHechizo.NO_LANZADO); } Hechizo hechizo = cuenta.Game.Character.get_Hechizo(hechizo_pelea.id); HechizoStats datos_hechizo = hechizo.get_Stats(); List <short> rangos_disponibles = _fight.get_Rango_hechizo(_fight.jugador_luchador.celda, datos_hechizo, _map); foreach (short rango in rangos_disponibles) { if (_fight.get_Puede_Lanzar_hechizo(hechizo_pelea.id, _fight.jugador_luchador.celda, _map.get_Celda_Id(rango), _map) == FallosLanzandoHechizo.NONE) { if (hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.CAC || hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.AMBOS && _map.get_Celda_Id(rango).get_Distancia_Entre_Dos_Casillas(_fight.jugador_luchador.celda) != 1) { continue; } await _fight.get_Lanzar_Hechizo(hechizo_pelea.id, rango); return(ResultadoLanzandoHechizo.LANZADO); } } return(ResultadoLanzandoHechizo.NO_LANZADO); }
public List <short> get_Rango_Hechizo(Celda celda_personaje, HechizoStats datos_hechizo, Mapa mapa) { List <short> rango = new List <short>(); foreach (Celda celda in HechizoShape.Get_Lista_Celdas_Rango_Hechizo(celda_personaje, datos_hechizo, mapa, cuenta.juego.personaje.caracteristicas.alcanze.total_stats)) { if (celda == null || rango.Contains(celda.id)) { continue; } if (datos_hechizo.necesita_celda_libre && get_Celdas_Ocupadas.Contains(celda.id)) { continue; } if (celda.es_Caminable() || !celda.es_Interactivo()) { rango.Add(celda.id); } } if (datos_hechizo.es_lanzado_con_vision) { for (int i = rango.Count - 1; i >= 0; --i) { if (get_Linea_Obstruida(mapa, celda_personaje, mapa.get_Celda_Id(rango[i]), get_Celdas_Ocupadas)) { rango.RemoveAt(i); } } } return(rango); }
// Token: 0x060001CD RID: 461 RVA: 0x000084D4 File Offset: 0x000068D4 public List <short> get_Rango_hechizo(Celda celda_personaje, HechizoStats datos_hechizo, Mapa mapa) { List <short> list = new List <short>(); foreach (Celda celda in HechizoShape.Get_Lista_Celdas_Rango_Hechizo(celda_personaje, datos_hechizo, this.cuenta.juego.mapa, this.cuenta.juego.personaje.caracteristicas.alcanze.total_stats)) { bool flag = celda == null || list.Contains(celda.id); if (!flag) { bool flag2 = datos_hechizo.es_celda_vacia && this.get_Celdas_Ocupadas.Contains(celda.id); if (!flag2) { bool flag3 = celda.tipo != TipoCelda.NO_CAMINABLE || celda.tipo != TipoCelda.OBJETO_INTERACTIVO; if (flag3) { list.Add(celda.id); } } } } bool es_lanzado_con_vision = datos_hechizo.es_lanzado_con_vision; if (es_lanzado_con_vision) { for (int i = list.Count - 1; i >= 0; i--) { bool flag4 = Pelea.get_Linea_Obstruida(mapa, celda_personaje, mapa.get_Celda_Id(list[i]), this.get_Celdas_Ocupadas); if (flag4) { list.RemoveAt(i); } } } return(list); }
public FallosLanzandoHechizo get_Puede_Lanzar_hechizo(short hechizo_id, Celda celda_actual, Celda celda_objetivo, Mapa mapa) { Hechizo hechizo = cuenta.juego.personaje.get_Hechizo(hechizo_id); if (hechizo == null) { return(FallosLanzandoHechizo.DESONOCIDO); } HechizoStats datos_hechizo = hechizo.get_Stats(); if (datos_hechizo.lanzamientos_por_objetivo > 0 && total_hechizos_lanzados_en_celda.ContainsKey(hechizo_id) && total_hechizos_lanzados_en_celda[hechizo_id].ContainsKey(celda_objetivo.id) && total_hechizos_lanzados_en_celda[hechizo_id][celda_objetivo.id] >= datos_hechizo.lanzamientos_por_objetivo) { return(FallosLanzandoHechizo.DEMASIADOS_LANZAMIENTOS_POR_OBJETIVO); } if (datos_hechizo.es_celda_vacia && !es_Celda_Libre(celda_objetivo)) { return(FallosLanzandoHechizo.NECESITA_CELDA_LIBRE); } if (datos_hechizo.es_lanzado_linea && !jugador_luchador.celda.get_Esta_En_Linea(celda_objetivo)) { return(FallosLanzandoHechizo.NO_ESTA_EN_LINEA); } if (!get_Rango_hechizo(celda_actual, datos_hechizo, mapa).Contains(celda_objetivo.id)) { return(FallosLanzandoHechizo.NO_ESTA_EN_RANGO); } return(FallosLanzandoHechizo.NINGUNO); }
public async Task get_Lanzar_Hechizo(int hechizo_id, int celda_id) { if (cuenta.Estado_Cuenta != EstadoCuenta.LUCHANDO) return; Hechizo hechizo = cuenta.juego.personaje.hechizos.FirstOrDefault(f => f.id == hechizo_id); HechizoStats datos_hechizo = hechizo.get_Stats(hechizo.nivel); if (datos_hechizo.intervalo > 0 && !hechizos_intervalo.ContainsKey(hechizo.id)) hechizos_intervalo.Add(hechizo.id, datos_hechizo.intervalo); if (!total_hechizos_lanzados.ContainsKey(hechizo.id)) total_hechizos_lanzados.Add(hechizo.id, 0); total_hechizos_lanzados[hechizo.id]++; if (total_hechizos_lanzados_en_celda.ContainsKey(hechizo.id)) { if (!total_hechizos_lanzados_en_celda[hechizo.id].ContainsKey(celda_id)) total_hechizos_lanzados_en_celda[hechizo.id].Add(celda_id, 0); total_hechizos_lanzados_en_celda[hechizo.id][celda_id]++; } else { total_hechizos_lanzados_en_celda.Add(hechizo.id, new Dictionary<int, int>() { { celda_id, 1 } }); } await cuenta.conexion.enviar_Paquete_Async("GA300" + hechizo.id + ';' + celda_id); }
public List <Celda> get_Zona_Hechizo(Celda celda, Celda celda_objetivo, HechizoStats hechizo_stats, Mapa _mapa) { if (hechizo_stats == null) { return(null); } return(HechizoShape.get_Celdas_Afectadas_Area(_mapa, hechizo_stats, celda, celda_objetivo)); }
// Token: 0x060001CC RID: 460 RVA: 0x000083C8 File Offset: 0x000067C8 public FallosLanzandoHechizo get_Puede_Lanzar_hechizo(short hechizo_id, Celda celda_actual, Celda celda_objetivo, Mapa mapa) { Hechizo hechizo = this.cuenta.juego.personaje.get_Hechizo(hechizo_id); bool flag = hechizo == null; FallosLanzandoHechizo result; if (flag) { result = FallosLanzandoHechizo.DESONOCIDO; } else { HechizoStats stats = hechizo.get_Stats(); bool flag2 = stats.lanzamientos_por_objetivo > 0 && this.total_hechizos_lanzados_en_celda.ContainsKey((int)hechizo_id) && this.total_hechizos_lanzados_en_celda[(int)hechizo_id].ContainsKey((int)celda_objetivo.id) && this.total_hechizos_lanzados_en_celda[(int)hechizo_id][(int)celda_objetivo.id] >= (int)stats.lanzamientos_por_objetivo; if (flag2) { result = FallosLanzandoHechizo.DEMASIADOS_LANZAMIENTOS_POR_OBJETIVO; } else { bool flag3 = stats.es_celda_vacia && !this.es_Celda_Libre(celda_objetivo); if (flag3) { result = FallosLanzandoHechizo.NECESITA_CELDA_LIBRE; } else { bool flag4 = stats.es_lanzado_linea && !this.jugador_luchador.celda.get_Esta_En_Linea(celda_objetivo); if (flag4) { result = FallosLanzandoHechizo.NO_ESTA_EN_LINEA; } else { bool flag5 = !this.get_Rango_hechizo(celda_actual, stats, mapa).Contains(celda_objetivo.id); if (flag5) { result = FallosLanzandoHechizo.NO_ESTA_EN_RANGO; } else { result = FallosLanzandoHechizo.NINGUNO; } } } } } return(result); }
// Token: 0x060001CB RID: 459 RVA: 0x000082B8 File Offset: 0x000066B8 public FallosLanzandoHechizo get_Puede_Lanzar_hechizo(short hechizo_id) { Hechizo hechizo = this.cuenta.juego.personaje.get_Hechizo(hechizo_id); bool flag = hechizo == null; FallosLanzandoHechizo result; if (flag) { result = FallosLanzandoHechizo.DESONOCIDO; } else { HechizoStats stats = hechizo.get_Stats(); bool flag2 = this.jugador_luchador.pa < stats.coste_pa; if (flag2) { result = FallosLanzandoHechizo.PUNTOS_ACCION; } else { bool flag3 = stats.lanzamientos_por_turno > 0 && this.total_hechizos_lanzados.ContainsKey((int)hechizo_id) && this.total_hechizos_lanzados[(int)hechizo_id] >= (int)stats.lanzamientos_por_turno; if (flag3) { result = FallosLanzandoHechizo.DEMASIADOS_LANZAMIENTOS; } else { bool flag4 = this.hechizos_intervalo.ContainsKey((int)hechizo_id); if (flag4) { result = FallosLanzandoHechizo.COOLDOWN; } else { bool flag5 = stats.efectos_normales.Count > 0 && stats.efectos_normales[0].id == 181 && this.contador_invocaciones >= this.cuenta.juego.personaje.caracteristicas.criaturas_invocables.total_stats; if (flag5) { result = FallosLanzandoHechizo.DEMASIADAS_INVOCACIONES; } else { result = FallosLanzandoHechizo.NINGUNO; } } } } } return(result); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Task.Run(() => { GlobalConf.cargar_Todas_Cuentas(); XElement.Parse(Properties.Resources.interactivos).Descendants("SKILL").ToList().ForEach(i => new ObjetoInteractivoModelo(i.Element("nombre").Value, i.Element("gfx").Value, bool.Parse(i.Element("caminable").Value), i.Element("habilidades").Value, bool.Parse(i.Element("recolectable").Value))); paquete_recibido = new PaqueteRecibido(); paquete_recibido.Inicializar(); }).ContinueWith(t => { XElement.Parse(Properties.Resources.hechizos).Descendants("HECHIZO").ToList().ForEach(mapa => { Hechizo hechizo = new Hechizo(short.Parse(mapa.Attribute("ID").Value), mapa.Element("NOMBRE").Value); HechizoStats hechizo_stats = new HechizoStats(); mapa.Descendants("NIVEL").ToList().ForEach(stats => { hechizo_stats.coste_pa = byte.Parse(stats.Attribute("COSTE_PA").Value); hechizo_stats.alcanze_minimo = byte.Parse(stats.Attribute("RANGO_MINIMO").Value); hechizo_stats.alcanze_maximo = byte.Parse(stats.Attribute("RANGO_MAXIMO").Value); hechizo_stats.es_lanzado_linea = bool.Parse(stats.Attribute("LANZ_EN_LINEA").Value); hechizo_stats.es_lanzado_con_vision = bool.Parse(stats.Attribute("NECESITA_VISION").Value); hechizo_stats.es_celda_vacia = bool.Parse(stats.Attribute("NECESITA_CELDA_LIBRE").Value); hechizo_stats.es_alcanze_modificable = bool.Parse(stats.Attribute("RANGO_MODIFICABLE").Value); hechizo_stats.lanzamientos_por_turno = byte.Parse(stats.Attribute("MAX_LANZ_POR_TURNO").Value); hechizo_stats.lanzamientos_por_objetivo = byte.Parse(stats.Attribute("MAX_LANZ_POR_OBJETIVO").Value); hechizo_stats.intervalo = byte.Parse(stats.Attribute("COOLDOWN").Value); stats.Descendants("EFECTO").ToList().ForEach(efecto => { hechizo_stats.agregar_efecto(new HechizoEfecto(int.Parse(efecto.Attribute("TIPO").Value), Zonas.Parse(efecto.Attribute("ZONA").Value)), bool.Parse(efecto.Attribute("ES_CRITICO").Value)); }); hechizo.get_Agregar_Hechizo_Stats(byte.Parse(stats.Attribute("ID").Value), hechizo_stats); }); }); }).Wait(); Application.Run(new Principal()); }
// Token: 0x060001BB RID: 443 RVA: 0x00007AF0 File Offset: 0x00005EF0 public void actualizar_Hechizo_Exito(short celda_id, short hechizo_id) { Hechizo hechizo = this.cuenta.juego.personaje.get_Hechizo(hechizo_id); HechizoStats stats = hechizo.get_Stats(); bool flag = stats.intervalo > 0 && !this.hechizos_intervalo.ContainsKey((int)hechizo.id); if (flag) { this.hechizos_intervalo.Add((int)hechizo.id, (int)stats.intervalo); } bool flag2 = !this.total_hechizos_lanzados.ContainsKey((int)hechizo.id); if (flag2) { this.total_hechizos_lanzados.Add((int)hechizo.id, 0); } Dictionary <int, int> dictionary = this.total_hechizos_lanzados; int num = (int)hechizo.id; int num2 = dictionary[num]; dictionary[num] = num2 + 1; bool flag3 = this.total_hechizos_lanzados_en_celda.ContainsKey((int)hechizo.id); if (flag3) { bool flag4 = !this.total_hechizos_lanzados_en_celda[(int)hechizo.id].ContainsKey((int)celda_id); if (flag4) { this.total_hechizos_lanzados_en_celda[(int)hechizo.id].Add((int)celda_id, 0); } Dictionary <int, int> dictionary2 = this.total_hechizos_lanzados_en_celda[(int)hechizo.id]; num = dictionary2[(int)celda_id]; dictionary2[(int)celda_id] = num + 1; } else { this.total_hechizos_lanzados_en_celda.Add((int)hechizo.id, new Dictionary <int, int> { { (int)celda_id, 1 } }); } }
// Token: 0x060001A0 RID: 416 RVA: 0x000075A8 File Offset: 0x000059A8 private async Task <ResultadoLanzandoHechizo> lanzar_Hechizo_Celda_Vacia(HechizoPelea hechizo_pelea) { bool flag = this.pelea.get_Puede_Lanzar_hechizo(hechizo_pelea.id) > FallosLanzandoHechizo.NINGUNO; ResultadoLanzandoHechizo result; if (flag) { result = ResultadoLanzandoHechizo.NO_LANZADO; } else { bool flag2 = hechizo_pelea.focus == HechizoFocus.CELL_VIDE && this.pelea.get_Cuerpo_A_Cuerpo_Enemigo(null).Count <Luchadores>() == 4; if (flag2) { result = ResultadoLanzandoHechizo.NO_LANZADO; } else { Hechizo hechizo = this.cuenta.juego.personaje.get_Hechizo(hechizo_pelea.id); HechizoStats datos_hechizo = hechizo.get_Stats(); List <short> rangos_disponibles = this.pelea.get_Rango_hechizo(this.pelea.jugador_luchador.celda, datos_hechizo, this.mapa); foreach (short rango in rangos_disponibles) { bool flag3 = this.pelea.get_Puede_Lanzar_hechizo(hechizo_pelea.id, this.pelea.jugador_luchador.celda, this.mapa.get_Celda_Id(rango), this.mapa) == FallosLanzandoHechizo.NINGUNO; if (flag3) { bool flag4 = hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.CAC || (hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.CAC_ET_DISTANCE && this.mapa.get_Celda_Id(rango).get_Distancia_Entre_Dos_Casillas(this.pelea.jugador_luchador.celda) != 1); if (!flag4) { await this.pelea.get_Lanzar_Hechizo(hechizo_pelea.id, rango); return(ResultadoLanzandoHechizo.LANZADO); } } } List <short> .Enumerator enumerator = default(List <short> .Enumerator); result = ResultadoLanzandoHechizo.NO_LANZADO; } } return(result); }
private NodoRango get_Nodo_Rango(Celda celda, MovimientoNodo node, PeleaHechizos hechizo_pelea, HechizoStats hechizo_stats) { Dictionary <short, byte> enemigos_golpeados = new Dictionary <short, byte>(); List <short> rango = pelea.get_Rango_Hechizo(celda, hechizo_stats, mapa); for (int i = 0; i < rango.Count; i++) { byte tec = get_Total_Enemigos_Atacados(celda, mapa.get_Celda_Id(rango[i]), hechizo_pelea, hechizo_stats); if (tec > 0) { enemigos_golpeados.Add(rango[i], tec); } } return(new NodoRango(celda, enemigos_golpeados, node)); }
private async Task <ResultadoLanzandoHechizo> lanzar_Hechizo_AOE(PeleaHechizos hechizo_pelea) { if (hechizo_pelea.focus == HechizoFocus.ALIADO || hechizo_pelea.focus == HechizoFocus.CELDA_VACIA) { return(ResultadoLanzandoHechizo.NO_LANZADO); } if (pelea.get_Puede_Lanzar_hechizo(hechizo_pelea.id) != FallosLanzandoHechizo.NINGUNO) { return(ResultadoLanzandoHechizo.NO_LANZADO); } Hechizo hechizo = cuenta.juego.personaje.get_Hechizo(hechizo_pelea.id); HechizoStats hechizo_stats = hechizo.get_Stats(); List <NodoRango> entradas = new List <NodoRango>(); NodoRango entrada; //Celda actual del jugador entrada = get_Nodo_Rango(pelea.jugador_luchador.celda, null, hechizo_pelea, hechizo_stats); if (entrada.enemigos_atacos_en_celda.Count > 0) { entradas.Add(entrada); } foreach (KeyValuePair <short, MovimientoNodo> kvp in PeleasPathfinder.get_Celdas_Accesibles(pelea, mapa, pelea.jugador_luchador.celda)) { if (!kvp.Value.alcanzable) { continue; } entrada = get_Nodo_Rango(mapa.get_Celda_Id(kvp.Key), kvp.Value, hechizo_pelea, hechizo_stats); if (entrada.enemigos_atacos_en_celda.Count > 0) { entradas.Add(entrada); } } short celda_id = -1; short desde_celda_id = -1; KeyValuePair <short, MovimientoNodo>?node = null; byte enemigos_atacados = 0; int pm_utilizados = 99; foreach (NodoRango nodo in entradas) { foreach (KeyValuePair <short, byte> kvp in nodo.enemigos_atacos_en_celda) { if (hechizo_pelea.metodo_lanzamiento == MetodoLanzamiento.CAC && !pelea.esta_Cuerpo_A_Cuerpo_Con_Enemigo(nodo.celda)) { continue; } if (pelea.get_Puede_Lanzar_hechizo(hechizo_pelea.id, nodo.celda, mapa.get_Celda_Id(kvp.Key), mapa) != FallosLanzandoHechizo.NINGUNO) { continue; } if (kvp.Value >= enemigos_atacados) { if (kvp.Value > enemigos_atacados || (kvp.Value == enemigos_atacados && nodo.pm_utilizados <= pm_utilizados)) { enemigos_atacados = kvp.Value; celda_id = kvp.Key; desde_celda_id = nodo.celda.id; pm_utilizados = nodo.pm_utilizados; if (nodo.nodo != null) { node = new KeyValuePair <short, MovimientoNodo>(desde_celda_id, nodo.nodo); } } } } } if (celda_id != -1) { if (node == null) { if (GlobalConf.mostrar_mensajes_debug) { cuenta.logger.log_informacion("DEBUG", $"Se ha lanzado el hechizo {hechizo.nombre} atacando a {enemigos_atacados} enemigos en la celda {celda_id}"); } await pelea.get_Lanzar_Hechizo(hechizo_pelea.id, celda_id); return(ResultadoLanzandoHechizo.LANZADO); } else { hechizo_para_lanzar = hechizo.id; celda_objetivo = celda_id; enemigos_tocados = enemigos_atacados; await cuenta.juego.manejador.movimientos.get_Mover_Celda_Pelea(node); return(ResultadoLanzandoHechizo.MOVIDO); } } return(ResultadoLanzandoHechizo.NO_LANZADO); }
private byte get_Total_Enemigos_Atacados(Celda celda_actual, Celda celda_objetivo, PeleaHechizos hechizo_pelea, HechizoStats hechizo_stats) { byte n = 0; List <Celda> zona = pelea.get_Zona_Hechizo(celda_actual, celda_objetivo, hechizo_stats, mapa); if (zona != null) { foreach (Celda celda in zona) { if (hechizo_pelea.auto_golpearse && celda.id == celda_actual.id) { return(0); } if (hechizo_pelea.golpear_aliados) { foreach (Luchadores aliado in pelea.get_Aliados) { if (aliado.celda.id == celda.id) { return(0); } } } foreach (Luchadores enemigo in pelea.get_Enemigos) { if (enemigo.celda.id == celda.id) { n++; } } } } return(n); }