public AttackMoveActivity(Actor self, Func <Activity> getInner, bool assaultMoving = false) { this.getInner = getInner; autoTarget = self.TraitOrDefault <AutoTarget>(); conditionManager = self.TraitOrDefault <ConditionManager>(); attackMove = self.TraitOrDefault <AttackMove>(); isAssaultMove = assaultMoving; }
public AttackMoveActivity(Actor self, Func <Activity> getMove, bool assaultMoving = false) { this.getMove = getMove; autoTarget = self.TraitOrDefault <AutoTarget>(); attackMove = self.TraitOrDefault <AttackMove>(); isAssaultMove = assaultMoving; ChildHasPriority = false; }
private void ExcuteMoveLAN(Form form) { if (form.InvokeRequired) { // this is worker thread updateExcuteLANDelegate del = new updateExcuteLANDelegate(ExcuteMoveLAN); form.Invoke(del, new object[] { form }); } else { // this is UI thread Point position = Mode1AndMode2.moveLAN; // x la diem dau- y la diem den ChessPieces piece = (ChessPieces)this.boardGui.boardLogic.GetCell(position.X).GetChessPieces().Clone(); // MessageBox.Show(piece.chessPieceType.chessPieceName); Cell cell = this.boardGui.boardLogic.GetCell(position.Y); Move move; if (cell.Occupied()) { move = new AttackMove(piece, position.Y, cell.GetChessPieces()); } else { move = new NormalMove(piece, position.Y); } CellGui cellG = this.boardGui.GetCellGui(position.X); // khong can thiet, cainay chi cap nhat game thoi ma, chi can hien ben nguoi choi duoc roi if (move.IsPromote()) { cellG.SetPromote(move); //set lai icon cho ben nay-ban chat la phia ben nay board logic khong co con nay //nhung chi co ben kia duoc di nen khong sao het- danh lua nguoi choi. } this.boardGui.boardLogic = move.ExcuteMove(this.boardGui.boardLogic); BoardGui.moveHistory.ListMoveHistory.Add(move); BoardGui.moveHistory.listRedo.Clear(); if (move.TheKingDie(this.boardGui.boardLogic)) { Mode1AndMode2.status_game = statusGame.EndGame; } //set lai icon tren ban co cho nguoi xem biet duoc da di.-> thay doi board gui this.boardGui.GetCellGui(position.X).SetImageIcon(); this.boardGui.GetCellGui(position.Y).SetImageIcon(); //reset thanh chua chon nuoc co nao va set nguoi choi tiep theo vi da danh xong nuoc co nay. this.boardGui.CellSelectedFirst = this.boardGui.CellSelectedSecond = null; this.boardGui.boardLogic.SetNextPlayer(); } }
public static AttackMove getMove(string inputName) { AttackMove atkmv = new AttackMove (); switch (inputName) { case "Tackle": atkmv.moveName = "Tackle"; atkmv.pwr = 35; atkmv.acurcy = 95; atkmv.totPp = 35; atkmv.curPp = 35; atkmv.type = pkmnType.normal; break; case "Scratch": atkmv.moveName = "Scratch"; atkmv.pwr = 40; atkmv.acurcy = 100; atkmv.totPp = 35; atkmv.curPp = 35; atkmv.type = pkmnType.normal; break; case "Thunder Shock": atkmv.moveName = "Thunder Shock"; atkmv.pwr = 40; atkmv.acurcy = 100; atkmv.totPp = 30; atkmv.curPp = 30; atkmv.type = pkmnType.electric; break; case "Bug Bite": atkmv.moveName = "Bug Bite"; atkmv.pwr = 60; atkmv.acurcy = 100; atkmv.totPp = 20; atkmv.curPp = 20; atkmv.type = pkmnType.bug; break; case "Gust": atkmv.moveName = "Gust"; atkmv.pwr = 40; atkmv.acurcy = 100; atkmv.totPp = 20; atkmv.curPp = 20; atkmv.type = pkmnType.flying; break; default: atkmv.moveName = "None"; atkmv.pwr = 0; atkmv.acurcy = 0; atkmv.totPp = 0; atkmv.curPp = 0; atkmv.type = pkmnType.none; break; } return atkmv; }
private void DamageFromConfusion() { float damage = AttackMove.DamageFormula( Pokemon.Level, Pokemon.Attack, Pokemon.Defense, 40f, 1f, 1f); Pokemon.Damage(damage); }
private void SpawnEnemies() { CastSpell(); enemiesBeingSpawned.Clear(); foreach (var spawner in enemySpawners) { var en = new Frog(spawner.DrawRectangle.X, spawner.DrawRectangle.Y); GameWorld.Entities.Add(en); enemiesBeingSpawned.Add(en); } attackTimer.ResetAndWaitFor(10000); CurrentAttackMove = AttackMove.ToTheSky; isSpawningEnemies = true; }
/// <summary> /// Equal override /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (this == obj) { return(true); } if (!(obj.GetType() == typeof(AttackMove))) { return(false); } AttackMove otherAttackMove = (AttackMove)obj; return(base.Equals(otherAttackMove) && getAttackedPiece().Equals(otherAttackMove.getAttackedPiece())); }
public void Attack(AttackMove move) { if (photonView.IsMine && !isBusy && !isAttacking && stamina > 0f) { isBlocking = false; isEvading = false; ToggleCombat(); lastAttackTimer = 0.5f; lastAttackMove = move; photonView.RPC("PlayState", RpcTarget.All, move.stateName, 0.2f); } }
/// <summary> /// Get all possible ways the given move can be played out /// </summary> /// <param name="turn">turn which the move is part of</param> /// <param name="lastMove">move to get all possible sequences for</param> /// <param name="doneMoves">done moves in the sequence</param> /// <returns></returns> private List <MoveSequence> GetPossibleMoveSequences(Turn turn, AttackMove lastMove, List <Move> doneMoves) { var sequences = new List <MoveSequence>(); //FIXME: Sometimes if theres a posibility for a doublejump it only returns a single jump, and forgets the second jump. why does this happen? fix this. This is the reason the AIBase code crashes in the while(!Game.Taketurn(...)) doneMoves.Add(lastMove); foreach (var move in lastMove.FurtherMoves) { sequences.AddRange(GetPossibleMoveSequences(turn, move, new List <Move>(doneMoves))); } if (lastMove.FurtherMoves.Count == 0) { sequences.Add(new MoveSequence(turn, doneMoves)); } return(sequences); }
public override void InitWeapon() { TransformDelta swordAttack = new TransformDelta { pose1 = new Vector3(-0.25f, 1.75f, -0.1f), pose2 = new Vector3(0.296f, 0.94f, 0.149f), rot1 = Quaternion.Euler(-58.6f, -26.7f, 43.7f), rot2 = Quaternion.Euler(146.696f, -36.06f, -62.05f), toRearUpTime = 0.41f, toStrikeTime = 0.2f, toReleaseTime = 0.7f, toRearUp = toRearUp, toStrike = toStrike, toRelease = toRelease, rotInclude = true }; TransformDelta chestMove = new TransformDelta() { pose1 = new Vector3(0.0f, 2.1f, 0.8f), pose2 = new Vector3(0.0f, 0.6f, 1.0f), toRearUpTime = 0.4f, toStrikeTime = 0.2f, toReleaseTime = 0.7f, toRearUp = toRearUp, toStrike = toStrike, toRelease = toRelease, rotInclude = false }; mainAttack = new AttackMove { moveDeltaWeapon = swordAttack, moveDeltaChest = chestMove }; }
/// <summary> /// This method generates all possible moves for a given location. It will call itself recursively until the endlocation has no further moves left. /// </summary> /// <param name="checker"></param> /// <param name="startLocation"></param> /// <param name="originalStartLocation">This parameter is needed because otherwise the game thinks this tile is occupied, when in reality it isnt. defaults to checker.Coordinate</param> /// <param name="doneTiles"></param> /// <returns></returns> public IEnumerable <AttackMove> GetMovesForLocation(IGame game, IChecker checker, TileCoordinate startLocation, IPlayer currentPlayer, IPlayer enemyPlayer, TileCoordinate?originalStartLocation, List <TileCoordinate> doneMoves = null) { List <AttackMove> moves = new List <AttackMove>(); //get targets for attackmoves var potentionalMoves = checker.GetPotentionalMoveCoordinates(game, this, enemyPlayer: enemyPlayer, startingCoordinate: startLocation, movementType: MovementType.Attack); var attmoves = potentionalMoves[MovementType.Attack].Where(m => GetPlayerOwnedTiles(enemyPlayer.PlayerNumber).Select(t => t.Coordinate).Contains(m)).Except(doneMoves); foreach (var attmove in attmoves) { var direction = TileCoordinate.GetStepDirection(startLocation, attmove); var targetCoordinate = attmove; var locationsAfterJunp = GetPossibleMovesInDirectionAfterAttack(checker, targetCoordinate, direction); locationsAfterJunp = locationsAfterJunp.Where(l => l.IsValid()); //for each possible location after the jump, this contains all moves afterattackmove foreach (var locationAfterJunp in locationsAfterJunp) { var tile = this.FirstOrDefault(t => t.Coordinate == locationAfterJunp); bool locationAfterJunpFree = (tile.Coordinate == originalStartLocation || //original location is always free, since the attacking checker started there tile.Checker == null); if (!locationAfterJunpFree) //if theres a checker on the final tile, go onto next potentional move { continue; } var targetChecker = this.FirstOrDefault(t => t.Coordinate == targetCoordinate).Checker; doneMoves.Add(targetCoordinate); //add to donetiles, so the game knows it cant jump on it again this turn IEnumerable <AttackMove> movesAfterJump = GetMovesForLocation(game, checker: checker, startLocation: locationAfterJunp, currentPlayer: currentPlayer, enemyPlayer: enemyPlayer, originalStartLocation: originalStartLocation, doneMoves: doneMoves); movesAfterJump = movesAfterJump.GetOnlyHighestPriorityMoves(); AttackMove move = new AttackMove(checker, targetChecker, startLocation, locationAfterJunp, targetCoordinate, movesAfterJump.ToList()); moves.Add(move); } } return(moves); }
/// <summary> /// Create a button for a attack move. /// </summary> /// <param name="move">The attack move to create a button to trigger.</param> private void GenerateAttackButton(AttackMove move) { int xPixels = move.def.px + Game.instance.xScroll; int yPixels = move.def.py + Game.instance.yScroll; if (CanMove(move.cost)) { Button select = new Button(new Rectangle(xPixels, yPixels, Tile.TILE_WIDTH, Tile.TILE_HEIGHT), Assets.yellowHighlight); select.RightClick += () => { move.Execute(true); SubtractMove(move.cost); foreach (Button b in movementButtons) { b.Delete(); } }; Game.instance.selectionButtons.Add(select); movementButtons.Add(select); } }
private void HandleReceivedInput(InputEventArg <BossInput> input) { switch (input._command) { case BossInput.Slash: _animator.SetToggle(BossFSMData.Stat.Slash, true); _currentMove = _slashMove; SetBlockInput(true); SetFrozen(true); break; case BossInput.DashAttack: UpdateFacingDirection(_input.GetAimingDirection()); _animator.SetToggle(BossFSMData.Stat.Thrust, true); _currentMove = _thrustMove; SetBlockInput(true); SetFrozen(true); break; case BossInput.Dodge: _animator.SetBool(BossFSMData.Stat.Retreat, true); var aim = _input.GetAimingDirection(); var moveDirection = NormalizeHorizonalDirection(aim); UpdateFacingDirection(aim); _mover.InvokeConstantMovement(-moveDirection, _retreatSpeed, _retreatTime); SetBlockInput(true); SetFrozen(true); break; case BossInput.JumpAttack: _animator.SetToggle(BossFSMData.Stat.Combo2, true); _currentMove = _crushMove; SetBlockInput(true); SetFrozen(true); break; } }
public void Attack(AttackType type) { if (photonView.IsMine && !isBusy && !isAttacking && stamina > 0f) { isBlocking = false; isEvading = false; ToggleCombat(); AttackMove move = type == AttackType.Light ? AttackMoves.slashR : AttackMoves.slashHeavy; if (lastAttackMove != null && lastAttackMove.nextAttack != null && lastAttackTimer > 0f) { move = lastAttackMove.nextAttack; } lastAttackTimer = 0.5f; lastAttackMove = move; photonView.RPC("PlayState", RpcTarget.All, move.stateName, 0.2f); } }
void Barrage() { AttackMove barrage = new AttackMove("Barrage", "NORMAL", "physical", 15, 85, 20, 20); }
private async void pictureBox1_MouseClick_1(object sender, MouseEventArgs e) { int x = e.Y / 64, y = e.X / 64; if (twoPlayers) { if (player.getPlayerColor() == playerColor.White) { if (mouseClickCounter == 0 && !board.isEmptyCell(x, y) && board.getBoardPieces()[x, y].getPieceColor() == pieceColor.BLack) { ; } else if (!board.isEmptyCell(x, y) && mouseClickCounter == 0 && e.Button == MouseButtons.Left) { ++mouseClickCounter; tmp = board.getBoardPieces()[x, y].getLegalMovesWithCheck(board); originalPiecePosition = Tuple.Create(x, y); hightlightLegalMoves(tmp); } else if (mouseClickCounter == 1 && e.Button == MouseButtons.Left) { foreach (Move m in tmp) { if (m.getMovePosition().Item1 == x && m.getMovePosition().Item2 == y) { Piece tmpPiece = board.getBoardPieces()[originalPiecePosition.Item1, originalPiecePosition.Item2]; if (m.isAttackMove()) { KilledFromBlack(board.getBoardPieces()[x, y].getPieceType()); } if (tmpPiece.getPieceType() == (int)pieceType.whitePawn) { Utility.handleWhitePawnMove(board, tmpPiece, m); } else { if (tmpPiece.getPieceType() == (int)pieceType.whiteKing) { if (Utility.isCastlingMove(tmpPiece, m)) { Utility.handleWhiteKingCastling(board, tmpPiece, m); } else { Utility.handlePieceMove(board, tmpPiece, m); } } else { Utility.handlePieceMove(board, tmpPiece, m); } } whiteMoveOccurred = true; break; } } updateBoard(board); if (whiteMoveOccurred) { Utility.checkBlackKingStatus(board, player, whitePlayerActivePieces, whitePlayerLegalMoves, blackPlayerActivePieces, blackPlayerLegalMoves); player = new BlackPlayer(); whiteMoveOccurred = false; } mouseClickCounter = 0; } } else { if (mouseClickCounter == 0 && !board.isEmptyCell(x, y) && board.getBoardPieces()[x, y].getPieceColor() == pieceColor.White) { ; } else if (!board.isEmptyCell(x, y) && mouseClickCounter == 0 && e.Button == MouseButtons.Left) { ++mouseClickCounter; tmp = board.getBoardPieces()[x, y].getLegalMovesWithCheck(board); originalPiecePosition = Tuple.Create(x, y); hightlightLegalMoves(tmp); } else if (mouseClickCounter == 1 && e.Button == MouseButtons.Left) { foreach (Move m in tmp) { if (m.getMovePosition().Item1 == x && m.getMovePosition().Item2 == y) { Piece tmpPiece = board.getBoardPieces()[originalPiecePosition.Item1, originalPiecePosition.Item2]; if (m.isAttackMove()) { KilledFromWhite(board.getBoardPieces()[x, y].getPieceType()); } if (tmpPiece.getPieceType() == (int)pieceType.blackPawn) { Utility.handleBlackPawnMove(board, tmpPiece, m); } else { if (tmpPiece.getPieceType() == (int)pieceType.blackKing) { if (Utility.isCastlingMove(tmpPiece, m)) { Utility.handleblackKingCastling(board, tmpPiece, m); } else { Utility.handlePieceMove(board, tmpPiece, m); } } else { Utility.handlePieceMove(board, tmpPiece, m); } } blackMoveOccurred = true; break; } } updateBoard(board); if (blackMoveOccurred) { Utility.checkWhiteKingStatus(board, player, blackPlayerActivePieces, blackPlayerLegalMoves, whitePlayerActivePieces, whitePlayerLegalMoves); player = new WhitePlayer(); blackMoveOccurred = false; } mouseClickCounter = 0; } } } else if (!twoPlayers) { if (player.getPlayerColor() == playerColor.White) { if (mouseClickCounter == 0 && !board.isEmptyCell(x, y) && board.getBoardPieces()[x, y].getPieceColor() == pieceColor.BLack) { ; } else if (!board.isEmptyCell(x, y) && mouseClickCounter == 0 && e.Button == MouseButtons.Left) { ++mouseClickCounter; tmp = board.getBoardPieces()[x, y].getLegalMovesWithCheck(board); originalPiecePosition = Tuple.Create(x, y); hightlightLegalMoves(tmp); // if (nextMove.Item1 != -1) // highlightComputerLastMove(Tuple.Create(nextMove.Item1, nextMove.Item2), Tuple.Create(nextMove.Item3, nextMove.Item4)); } else if (mouseClickCounter == 1 && e.Button == MouseButtons.Left) { foreach (Move m in tmp) { if (m.getMovePosition().Item1 == x && m.getMovePosition().Item2 == y) { Piece tmpPiece = board.getBoardPieces()[originalPiecePosition.Item1, originalPiecePosition.Item2]; if (m.isAttackMove()) { KilledFromBlack(board.getBoardPieces()[x, y].getPieceType()); } if (tmpPiece.getPieceType() == (int)pieceType.whitePawn) { Utility.handleWhitePawnMove(board, tmpPiece, m); } else { if (tmpPiece.getPieceType() == (int)pieceType.whiteKing) { if (Utility.isCastlingMove(tmpPiece, m)) { Utility.handleWhiteKingCastling(board, tmpPiece, m); } else { Utility.handlePieceMove(board, tmpPiece, m); } } else { Utility.handlePieceMove(board, tmpPiece, m); } } whiteMoveOccurred = true; break; } } updateBoard(board); if (whiteMoveOccurred) { Utility.checkBlackKingStatus(board, player, whitePlayerActivePieces, whitePlayerLegalMoves, blackPlayerActivePieces, blackPlayerLegalMoves); player = new BlackPlayer(); whiteMoveOccurred = false; await Task.Delay(100); // computer move DisableProcessWindowsGhosting(); nextMove = Computer.getBestMove(board, gameDifficulty); if (nextMove.Item1 == -1) { MessageBox.Show("THE GAME IS OVER YOU WIN"); return; } Move computerMove; if (board.isEmptyCell(nextMove.Item3, nextMove.Item4)) { computerMove = new NormalMove(Tuple.Create(nextMove.Item3, nextMove.Item4)); } else { computerMove = new AttackMove(Tuple.Create(nextMove.Item3, nextMove.Item4)); } Piece tmpPiece1 = board.getBoardPieces()[nextMove.Item1, nextMove.Item2]; if (computerMove.isAttackMove()) { KilledFromWhite(board.getBoardPieces()[nextMove.Item3, nextMove.Item4].getPieceType()); } if (tmpPiece1.getPieceType() == (int)pieceType.blackPawn) { Utility.handleBlackPawnMove(board, tmpPiece1, computerMove); } else { if (tmpPiece1.getPieceType() == (int)pieceType.blackKing) { if (Utility.isCastlingMove(tmpPiece1, computerMove)) { Utility.handleblackKingCastling(board, tmpPiece1, computerMove); } else { Utility.handlePieceMove(board, tmpPiece1, computerMove); } } else { Utility.handlePieceMove(board, tmpPiece1, computerMove); } } updateBoard(board); highlightComputerLastMove(Tuple.Create(nextMove.Item1, nextMove.Item2), Tuple.Create(nextMove.Item3, nextMove.Item4)); Utility.checkWhiteKingStatus(board, player, blackPlayerActivePieces, blackPlayerLegalMoves, whitePlayerActivePieces, whitePlayerLegalMoves); player = new WhitePlayer(); } else if (nextMove.Item1 != -1) { highlightComputerLastMove(Tuple.Create(nextMove.Item1, nextMove.Item2), Tuple.Create(nextMove.Item3, nextMove.Item4)); } mouseClickCounter = 0; } } } }
public void takeHit(AttackMove atkMove, PokemonObject attacker, bool isPlayer) { if (atkMove.moveName == "None") return; TurnActionViewer.S.diffmod = 1; double modifier1 = modifierTable[type1][atkMove.type]; double modifier2 = modifierTable[type2][atkMove.type]; double totmod = modifier1 * modifier2; Debug.Log ("total mod : " + totmod.ToString ()); if (totmod != 1) TurnActionViewer.S.diffmod = totmod; if (!isPlayer) TurnActionViewer.S.diffmod += 10; --atkMove.curPp; int dmg = (int)Math.Floor ((((2.0 * ((double)attacker.level+10.0)/250.0) * (double)attacker.atk/(double)def * (double)atkMove.pwr) + 2) * totmod); if ((curHp - dmg) < 0) curHp = 0; else curHp -= dmg; if (curHp <= 0 && isPlayer) { stat = pkmnStatus.FAINTED; int i; TurnActionViewer.S.activeDied = pkmnName; for (i = 0; i < 6; ++i) { if (Player.S.pokemon_list [i].curHp > 0) { BattleScreen.updatePokemon (true, Player.S.pokemon_list [i]); break; } } if (i == 6) { TurnActionViewer.S.allDied = true; Vector3 pos; pos.x = 21; pos.y = 52; pos.z = -0.01f; Player.S.inScene0 = true; Player.S.MoveThroughDoor (pos); for (int j = 0; j < 6; ++j) { Player.S.pokemon_list [j].curHp = Player.S.pokemon_list [j].totHp; Player.S.pokemon_list [j].move1.curPp = Player.S.pokemon_list [j].move1.totPp; Player.S.pokemon_list [j].move2.curPp = Player.S.pokemon_list [j].move2.totPp; Player.S.pokemon_list [j].move3.curPp = Player.S.pokemon_list [j].move3.totPp; Player.S.pokemon_list [j].move4.curPp = Player.S.pokemon_list [j].move4.totPp; Player.S.pokemon_list [j].stat = pkmnStatus.OK; } } } }
void Barrier() { AttackMove barrier = new AttackMove("Barrier", "PSYCHIC", "status", 0, 1000, 20, 20); }
/// <summary> /// Get all possible ways the given move can be played out /// </summary> /// <param name="turn">turn which the move is part of</param> /// <param name="lastMove">move to get all possible sequences for</param> private List <MoveSequence> GetPossibleMoveSequences(Turn turn, AttackMove lastMove) => GetPossibleMoveSequences(turn, lastMove, new List <Move>());
void BodySlam() { AttackMove bodyslam = new AttackMove("Body Slam", "NORMAL", "physical", 85, 100, 15, 15); }
void Agility() { AttackMove agility = new AttackMove("Agility", "PSYCHIC", "status", 0, 1000, 30, 30); //attackName.Add(agility); }
void AuroraBeam() { AttackMove aurorabeam = new AttackMove("Aurora Beam", "ICE", "special", 65, 100, 20, 20); //attackName.add(aurorabeam); }
private FactionArmies CalculateAttackingForces(AttackMove move, int attacksByFaction, GameState state) { // TODO: Calculate war forces using these factors return(new FactionArmies(move.Faction, new Army[0])); }
void AcidArmor() { AttackMove acidarmor = new AttackMove("Acid Armor", "POISON", "status", 0, 1000, 20, 20); //attackName.Add(acidarmor); }
void Bind() { AttackMove bind = new AttackMove("Bind", "NORMAL", "physical", 15, 85, 20, 20); }
void Bite() { AttackMove bite = new AttackMove("Bite", "DARK", "physical", 60, 100, 25, 25); }
void BoneClub() { AttackMove boneclub = new AttackMove("Bone Club", "GROUND", "physical", 65, 100, 20, 20); }
public FactionArmies GetForcesFor(AttackMove attackMove) { return(_attackerForces[attackMove]); }
void Bide() { AttackMove bide = new AttackMove("Bide", "NORMAL", "physical", 0, 0, 10, 10); }
void Amnesia() { AttackMove amnesia = new AttackMove("Amnesia", "PSYCHIC", "status", 0, 1000, 20, 20); //attackName.Add(amnesia); }
public void overFunction() { AttackMove attackMove = ms.alliance.Forces[ms.curTeam].getMember(ms.curChar).getAttackMove(int.Parse(transform.name)); if (attackMove.getName() != "") { int position = ms.alliance.Forces[ms.curTeam].getMember(ms.curChar).getIndex(); yourPanels[attackMove.getPosition()].transform.GetChild(0).GetComponent <Renderer>().material.color = gold; int adjustAmount = 0; bool offensive = attackMove.isOffensive(); string SpecialSprite = ""; string attackOffensive = ""; switch (attackMove.getSpecial()) { case Special.AttackBuff: SpecialSprite = "<sprite=1>"; break; case Special.DefenseBuff: SpecialSprite = "<sprite=0>"; break; case Special.Pull: SpecialSprite = "<sprite=3>"; break; case Special.Poison: SpecialSprite = "<sprite=2>"; break; } transform.parent.Find("Description").Find("NA").GetComponent <Image>().enabled = false; if (offensive) { adjustAmount = attackMove.getPosition() - position; attackOffensive = "Offensive"; } else { adjustAmount = position - attackMove.getPosition(); if ((attackMove.getSpecial() == Special.None || attackMove.getSpecial() == Special.Clean) && ms.alliance.Forces[ms.curTeam].getMember(ms.curChar).healCooldown) { transform.parent.Find("Description").Find("NA").GetComponent <Image>().enabled = true; } attackOffensive = "Defensive"; } transform.parent.Find("Description").Find("Text").GetComponent <TextMeshProUGUI>().text = attackMove.getName() + ": " + attackMove.getDescription() + " \n" + attackOffensive + "\tBase power: " + attackMove.getPower() + " " + SpecialSprite; if (attackMove.getSpecialPower() != 0) { transform.parent.Find("Description").Find("Text").GetComponent <TextMeshProUGUI>().text += "x" + attackMove.getSpecialPower(); } for (int i = 0; i < 4; i++) { int attackIndex = i + adjustAmount; if (attackMove.getSpaces()[i] == true) { if (offensive) { enemyPanels[i].transform.GetChild(0).GetComponent <Renderer>().material.color = gold; } else { yourPanels[i].transform.GetChild(0).GetComponent <Renderer>().material.color = gold; } } if (attackIndex < 0) { continue; } if (attackIndex > 3) { continue; } if (attackMove.getSpaces()[i] == true) { if (offensive) { enemyPanels[attackIndex].GetComponent <Renderer>().material.color = red; } else { yourPanels[attackIndex].GetComponent <Renderer>().material.color = green; } } else { enemyPanels[i].GetComponent <Renderer>().material.color = grey; } } } }
public void takeHit(AttackMove atkMove, PokemonObject attacker) { double modifier1 = 1; double modifier2 = 1; /*Dictionary<pkmnType, double> result; if (modifierTable.TryGetValue (atkMove.type, out result)) { result.TryGetValue (type1, out modifier1); result.TryGetValue (type2, out modifier2); }*/ curHp -= (int)Math.Floor((((2.0 * (attacker.level + 10.0) / 250.0) * (attacker.atk / def) * atkMove.pwr) + 2.0) * modifier1 * modifier2); }
void Blizzard() { AttackMove blizzard = new AttackMove("Blizzard", "ICE", "special", 110, 70, 5, 5); }