public void SetMoveButton( PBS.Battle.View.WifiFriendly.Pokemon pokemon, PBS.Battle.View.Events.CommandAgent.Moveslot moveslot, Panels.FightButton moveBtn, bool choosingZMove = false, bool choosingMaxMove = false) { MoveData moveData = MoveDatabase.instance.GetMoveData(moveslot.moveID); moveBtn.moveslot = moveslot; if (!moveslot.hide) { TypeData typeData = TypeDatabase.instance.GetTypeData(moveData.moveType); Color typeColor = Color.clear; ColorUtility.TryParseHtmlString(typeData.typeColor, out typeColor); moveBtn.moveTxt.text = moveData.moveName; moveBtn.ppTxt.text = moveslot.PP + "/" + moveslot.maxPP; moveBtn.typeTxt.text = typeData.typeName; moveBtn.typeTxt.color = typeColor; moveBtn.moveID = moveData.ID; moveBtn.colorSel = new Color(typeColor.r, typeColor.g, typeColor.b, 0.75f); } else { moveBtn.moveTxt.text = ""; moveBtn.ppTxt.text = ""; moveBtn.typeTxt.text = ""; moveBtn.moveID = ""; } moveBtn.UnselectSelf(); }
// Fight Panel public void SetMoves( PBS.Battle.View.WifiFriendly.Pokemon pokemon, List <PBS.Battle.View.Events.CommandAgent.Moveslot> moveslots, bool canMegaEvolve, bool canZMove = false, bool canDynamax = false, bool choosingZMove = false, bool choosingMaxMove = false) { List <PBS.Battle.View.Events.CommandAgent.Moveslot> filteredMoveslots = new List <PBS.Battle.View.Events.CommandAgent.Moveslot>(moveslots); for (int i = 0; i < filteredMoveslots.Count; i++) { PBS.Battle.View.Events.CommandAgent.Moveslot moveslot = filteredMoveslots[i]; if (moveslot == null) { filteredMoveslots.RemoveAt(i); i--; } } fightPanel.SetMoves( pokemon: pokemon, moveList: filteredMoveslots, canMegaEvolve: canMegaEvolve, canZMove: canZMove, canDynamax: canDynamax, choosingZMove: choosingZMove, choosingMaxMove: choosingMaxMove); }
public void SetMoves( PBS.Battle.View.WifiFriendly.Pokemon pokemon, List <PBS.Battle.View.Events.CommandAgent.Moveslot> moveList, bool canMegaEvolve, bool canZMove = false, bool canDynamax = false, bool choosingZMove = false, bool choosingMaxMove = false) { // Set each move button for (int i = 0; i < moveList.Count; i++) { PBS.Battle.View.Events.CommandAgent.Moveslot moveslot = moveList[i]; Panels.FightButton curBtn = (i == 0) ? move1Btn : (i == 1) ? move2Btn : (i == 2) ? move3Btn : (i == 3) ? move4Btn : null; if (curBtn != null) { SetMoveButton( pokemon: pokemon, moveslot: moveslot, choosingZMove: choosingZMove, choosingMaxMove: choosingMaxMove, moveBtn: curBtn); } } // Remove unnecessary buttons if (moveList.Count < 4) { move4Btn.gameObject.SetActive(false); } if (moveList.Count < 3) { move3Btn.gameObject.SetActive(false); } if (moveList.Count < 2) { move2Btn.gameObject.SetActive(false); } if (moveList.Count < 1) { move1Btn.gameObject.SetActive(false); } // Enable Special Button if (canMegaEvolve || canZMove || canDynamax) { specialBtn.gameObject.SetActive(true); specialIcon.gameObject.SetActive(true); if (canMegaEvolve) { specialBtn.colorSel = new Color(0.5f, 1f, 1f, 0.75f); specialBtn.txt.text = "Z - Mega Evolution"; specialIcon.sprite = fightMegaIcon; } else if (canZMove) { specialBtn.colorSel = new Color(0.75f, 1f, 0.5f, 0.75f); specialBtn.txt.text = "Z - Z-Move"; specialIcon.sprite = fightZMoveIcon; } else if (canDynamax) { specialBtn.colorSel = new Color(1f, 0.5f, 0.5f, 0.75f); specialBtn.txt.text = "Z - Dynamax"; specialIcon.sprite = fightDynamaxIcon; } } else { specialBtn.gameObject.SetActive(false); specialIcon.gameObject.SetActive(false); } }
public static void WriteBattleViewEventCommandAgentMoveslot(this NetworkWriter writer, PBS.Battle.View.Events.CommandAgent.Moveslot obj) { writer.WriteString(obj.moveID); writer.WriteInt32(obj.PP); writer.WriteInt32(obj.maxPP); writer.WriteInt32(obj.basePower); writer.WriteDouble((double)obj.accuracy); writer.WriteBoolean(obj.hide); writer.WriteBoolean(obj.useable); writer.WriteString(obj.failMessageCode); writer.WriteList <List <BattlePosition> >(obj.possibleTargets); }