internal void DescubrirElemento(ElementosEnum elementoadescubrir) { if (Slider.value <= 0) { var mensaje = string.Format("Selecciona una cantidad correcta para descubrir un elemento."); alertSctipt.ShowAlert(mensaje); return; } var runas = this.runas[elementoadescubrir.GetOrdinal()]; Runa runa = null; for (int i = 0; i < Runa.runasporelemento && runa == null; i++) { if (!runas[i].discovered) { runa = runas[i]; } } if (runa != null) { runa.discovered = true; var mensaje = string.Format(mensaje_descubrir, Slider.value.ToString(System.Globalization.CultureInfo.InvariantCulture)); alertSctipt.ShowAlert(mensaje); } else { alertSctipt.ShowAlert(mensaje_runas_ok); } }
public static Runa[][] FactoryList() { Runa[][] runas = new Runa[ElementosEnum.elemento_1.CountElements()][]; int index = 0; foreach (var runaarray in runas) { runas[index] = new Runa[runasporelemento]; for (int i = 0; i < runasporelemento; i++) { runas[index][i] = new Runa() { Name = ("Runa [" + i + "]"), discovered = false }; } index++; } return(runas); }
public void GuardarEnLista() { Runa nuevaRuna = new Runa(); nuevaRuna.Slot = Slot + ""; nuevaRuna.Tipo = cmbTipo.Text; nuevaRuna.Principal = Principal.Text; nuevaRuna.Sub1 = Sub1.Text; nuevaRuna.Sub2 = Sub2.Text; nuevaRuna.Sub3 = Sub3.Text; nuevaRuna.Sub4 = Sub4.Text; nuevaRuna.Sub5 = Sub5.Text; nuevaRuna.StatPrincipal = txtPrincipal.Text; nuevaRuna.StatSub1 = txtSub1.Text; nuevaRuna.StatSub2 = txtSub2.Text; nuevaRuna.StatSub3 = txtSub3.Text; nuevaRuna.StatSub4 = txtSub4.Text; nuevaRuna.StatSub5 = txtSub5.Text; App.Runas.Add(nuevaRuna); Calculos(); }
public ActionResult DeleteConfirmed(int id) { Runa runa = db.Runas.Find(id); db.Runas.Remove(runa); db.SaveChanges(); return(RedirectToAction("Index")); }
public void EnableRuna(string name) { Runa r = runas.Find(x => x.name == name); r.enabled = true; if (r != null) { SetRunaState(r); } }
private bool isLastButOne(Runa runa) { if (_selectedRunas.Count >= 2 && _selectedRunas[_selectedRunas.Count - 2].GetInstanceID() == runa.GetInstanceID()) { return(true); } else { return(false); } }
void SetRunaState(Runa r) { if (r.enabled) { r.image.color = Color.white; } else { r.image.color = Color.red; } }
public ActionResult Edit([Bind(Include = "RunaId,Descriçao,Nivel,Nome,EscalaRunicaId,Alcance,Cura,Duracao,Dano,Uso")] Runa runa) { if (ModelState.IsValid) { db.Entry(runa).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EscalaRunicaId = new SelectList(db.EscalaRunicas, "EscalaRunicaId", "Nome", runa.EscalaRunicaId); return(View(runa)); }
private void setRunaPosition(Runa runa, int column, int row, bool animate) { if (animate) { StartCoroutine(runa.MoveToPostion(calculateRunaPosition(runa.gameObject, column, row))); } else { runa.gameObject.transform.position = calculateRunaPosition(runa.gameObject, column, row); } }
public void Update() { LoadContent(); bool colidiu = mColider.Intersects(Game1.Jogador.ColiderPlayer); if (colidiu == true) { Runa r = new Runa(t); Game1.Jogador.PlayerRuna = r; IsVisible = false; } }
private void changeRunaSelection(Runa runa, bool selected) { if (selected) { _selectedRunas.Add(runa); runa.GetComponent <Runa>().SetSelected(true); } else { runa.SetSelected(false); _selectedRunas.Remove(runa); } }
// GET: Runas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Runa runa = db.Runas.Find(id); if (runa == null) { return(HttpNotFound()); } return(View(runa)); }
// GET: Runas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Runa runa = db.Runas.Find(id); if (runa == null) { return(HttpNotFound()); } ViewBag.EscalaRunicaId = new SelectList(db.EscalaRunicas, "EscalaRunicaId", "Nome", runa.EscalaRunicaId); return(View(runa)); }
public Inimigo Melee2(Vector2 PosicaoIni) { Inimigo este = new Inimigo(); este.animacoes = new SpritePrimitive("P.E.MELEE-SpriteSheet", PosicaoIni, new Vector2(160, 160), 4, 12, 0); este.sombra = new SpritePrimitive("MISC-SpriteSheet", PosicaoIni, new Vector2(160, 160), 4, 8, 0); este.MaxHealth = 40; este.Health = 100; este.Attack = 20; este.eT = EnemyType.Melee; este.eF = EnemyFaction.Evil; este.Position = PosicaoIni; este.Isdead = false; Mruna = null; return(este); }
public void EnableRuna(string name) { Runa r = runas.Find(x => x.go.name == name); if (r == null) { return; } if (!r.enabled) { r.enabled = true; Debug.Log(name); PlayerPrefs.SetString(name, "done"); Events.OnRunaFound(); } }
private void slideRunasToEmptySpaces() { for (int x = 0; x < KeyboardColumns; x++) { for (int y = KeyboardRows - 1; y >= 0; y--) { if (Runas[x, y] == null) { Runa runaToExchange = getRunaToExchange(x, y); if (runaToExchange != null) { exchangeRuna(x, y, (int)runaToExchange.SpotInKeyboard.x, (int)runaToExchange.SpotInKeyboard.y); } } } } }
//======================================================================================= public Inimigo() { Random r = new Random(); int i = r.Next(2); if (i == 0) { RangedRuna = new Runa(tipo.Fire); } else if (i == 1) { RangedRuna = new Runa(tipo.Ice); } contadorSpell = 150; Atacar = false; } // esta merda secalhar tambem nao
private Runa createRuna(int column, int row) { int quantityOfAvailibleElements = Enum.GetValues(typeof(EnumElement)).Length; EnumElement element = (EnumElement)_random.Next(0, quantityOfAvailibleElements); GameObject runaPrefab = Instantiate(RunaPrefab); Runa runa = runaPrefab.GetComponent <Runa>(); runa.SetRunaElement(element); runa.SpotInKeyboard = new Vector2(column, row); setRunaPosition(runa, column, row, false); return(runa); }
private bool canSelect(Runa runa) { if (runa.Selected) { return(false); } else if (_selectedRunas.Count > 0 && !_selectedRunas.Exists(x => x.Element == runa.Element)) { return(false); } else if (_selectedRunas.Count > 0 && !isAdjacentToLastSelected(runa)) { return(false); } else { return(true); } }
private void exchangeRuna(int columnRuna1, int rowRuna1, int columnRuna2, int rowRuna2) { Runa tempRuna = Runas[columnRuna1, rowRuna1]; Runas[columnRuna1, rowRuna1] = Runas[columnRuna2, rowRuna2]; Runas[columnRuna2, rowRuna2] = tempRuna; if (Runas[columnRuna1, rowRuna1] != null) { Runas[columnRuna1, rowRuna1].SpotInKeyboard = new Vector2(columnRuna1, rowRuna1); setRunaPosition(Runas[columnRuna1, rowRuna1], columnRuna1, rowRuna1, true); } if (Runas[columnRuna2, rowRuna2] != null) { Runas[columnRuna2, rowRuna2].SpotInKeyboard = new Vector2(columnRuna2, rowRuna2); setRunaPosition(Runas[columnRuna2, rowRuna2], columnRuna2, rowRuna2, true); } }
public RunasTemplate() { //Cuadrado Runa Cuadrado1 = new Runa(); Cuadrado1.Name = "wind"; Cuadrado1.dirList = new List <Vector2>(new Vector2[] { new Vector2(0, 1), new Vector2(1, 0), new Vector2(0, -1), new Vector2(-1, 0) }); TemplateRunasList.Add(Cuadrado1); Runa Cuadrado2 = new Runa(); Cuadrado2.Name = "wind"; Cuadrado2.dirList = new List <Vector2>(new Vector2[] { new Vector2(0, 1), new Vector2(1, 1), new Vector2(0, -1), new Vector2(-1, -1) }); TemplateRunasList.Add(Cuadrado2); Runa Cuadrado3 = new Runa(); Cuadrado3.Name = "wind"; Cuadrado3.dirList = new List <Vector2>(new Vector2[] { new Vector2(0, 1), new Vector2(1, -1), new Vector2(0, -1), new Vector2(-1, 1) }); TemplateRunasList.Add(Cuadrado3); //Triangulo Runa Triangulo1 = new Runa(); Triangulo1.Name = "swirl"; Triangulo1.dirList = new List <Vector2>(new Vector2[] { new Vector2(0, 1), new Vector2(1, -1), new Vector2(-1, 0) }); TemplateRunasList.Add(Triangulo1); Runa Triangulo2 = new Runa(); Triangulo2.Name = "swirl"; Triangulo2.dirList = new List <Vector2>(new Vector2[] { new Vector2(0, 1), new Vector2(1, -1), new Vector2(-1, -1) }); TemplateRunasList.Add(Triangulo2); Runa Triangulo3 = new Runa(); Triangulo3.Name = "swirl"; Triangulo3.dirList = new List <Vector2>(new Vector2[] { new Vector2(0, 1), new Vector2(1, 0), new Vector2(-1, -1) }); TemplateRunasList.Add(Triangulo3); }
private bool isAdjacentToLastSelected(Runa runa) { if (_selectedRunas.Count == 0) { return(false); } Runa lastSelectedRuna = _selectedRunas[_selectedRunas.Count - 1]; float distanceBetweenRows = Math.Abs(lastSelectedRuna.SpotInKeyboard.y) - Math.Abs(runa.SpotInKeyboard.y); float distanceBetweenColumns = Math.Abs(lastSelectedRuna.SpotInKeyboard.x) - Math.Abs(runa.SpotInKeyboard.x); if (Math.Abs(distanceBetweenRows) <= 1 && Math.Abs(distanceBetweenColumns) <= 1) { return(true); } else { return(false); } }
void Awake() { Go_UIScript._Go_UIScript = this; runas = Runa.FactoryList(); forjas = Forja.FactoryList(); }