void Update() { timer += Time.deltaTime; if (timer > compute_inteval) { //得到当前帧的推力 steering_force = Vector3.zero; //遍历当前激活的移动并添加推力*权重 foreach (var v in move_dic) { MoveBase move_base = v.Value; if (move_base != null) { steering_force += move_base.Force() * move_base.weight; } } //移除完成的移动 foreach (var v in arrive_remove) { move_dic[v] = null; } arrive_remove.Clear(); //限制最大力 steering_force = Vector3.ClampMagnitude(steering_force, max_force); //加速度=推力/质量 acceleration = steering_force / mass; timer = 0; } }
public void SetDataMove(MoveBase move) { nameText.text = move.Name; typeText.text = move.Type.ToString(); categoryText.text = move.Category.ToString(); powerText.text = move.Power.ToString(); accuracyText.text = move.Accurarcy.ToString(); }
public void SetMoveData(List <MoveBase> currentMoves, MoveBase newMove) { for (int i = 0; i < currentMoves.Count; i++) { moveTexts[i].text = currentMoves[i].Name; //Set the name of the moves already known } moveTexts[currentMoves.Count].text = newMove.Name; //Set the name of the new move }
public Game(GameDto dto, IMapper mapper) : base(dto.Board) { mapper.Map(dto, this); MyOriginalTiles = (char[])MyTiles.Clone(); Move = new MoveBase(this); }
void Start() { _move = GetComponent <MoveBase>(); _speed = _move.Speed; _detect = GetComponent <DetectEnemy>(); StartCoroutine(AttackEnemy()); }
public void SetMoveData(List <MoveBase> currentMoves, MoveBase newMove) { for (int i = 0; i < currentMoves.Count; i++) { moveText[i].text = currentMoves[i].Name; } moveText[currentMoves.Count].text = newMove.Name; }
void HandleEnemyAction() { // Wait if (NetworkManager.Instance.hasMove()) { //Build Move var mMsg = NetworkManager.Instance.GetMove(); MoveBase mBase = MoveBaseList.GetMoveBase(mMsg.MoveName); Move move = new Move(mBase); StartCoroutine(PerformEnemyMove(move, mMsg.hit)); } }
IEnumerator ChooseMoveToForget(Animal animal, MoveBase newMove) { state = BattleState.Busy; yield return(dialogBox.TypeDialog($"Choose a move to forget.")); moveSelectionUI.gameObject.SetActive(true); //Set Move Names moveSelectionUI.SetMoveData(animal.Moves.Select(x => x.Base).ToList(), newMove); state = BattleState.MoveToForget; }
IEnumerator ChooseMoveToForget(Pokemon pokemon, MoveBase newMove) { state = BattleState.Busy; yield return(dialogBox.TypeDialog($"Choose a move you want to forget")); moveSelectionUI.gameObject.SetActive(true); moveSelectionUI.SetMoveData(pokemon.Moves.Select(x => x.Base).ToList(), newMove); moveToLearn = newMove; state = BattleState.MoveToForget; }
//take the list of current moves and a reference to a new move public void SetMoveData(List <MoveBase> currentMoves, MoveBase newMove) { //set the names of the current moves for (int i = 0; i < currentMoves.Count; ++i) { //set the list of the names to the current moveTexts[i].text = currentMoves[i].Name; } moveTexts[currentMoves.Count].text = newMove.Name; }
protected override void Awake() { base.Awake(); _moveBase = GetComponent <MoveBase>(); _movePositionBase = GetComponent <MovePositionBase>(); _enemyAI = GetComponent <EnemyAI>(); _enemyBattleAI = GetComponent <EnemyBattleAI>(); Stats.OnCharacterDeath += Die; }
IEnumerator ChooseMoveToForget(Pokemon pokemon, MoveBase newMove) { state = BattleState.Busy; yield return(dialogBox.TypeDialog($"Choisissez une attaque à oublier.")); moveSelectionUI.gameObject.SetActive(true); moveSelectionUI.SetMoveData(pokemon.Moves.Select(x => x.Base).ToList(), newMove); //Set the data using Select and Linq to acces base. moveToLearn = newMove; state = BattleState.MoveToForget; //Finally move to the moveToForget state }
//this is the action of choosing what move to forget IEnumerator ChooseMoveToForget(Creature creature, MoveBase newMove) { state = BattleState.Busy; yield return(dialogueBox.TypeDialog($"Choose a move you want to forget")); moveSelectionUI.gameObject.SetActive(true); //will set all the names in the move selection UI and //convert a list of move class to a list of moveBase class moveSelectionUI.SetMoveData(creature.Moves.Select(x => x.Base).ToList(), newMove); moveToLearn = newMove; state = BattleState.MoveToForget; }
protected override void Awake() { base.Awake(); _moveBase = GetComponent <MoveBase>(); _inputHandler = GetComponent <InputHandler>(); Inventory = GetComponent <Inventory>(); _enableAttack = true; _enableInput = true; _waitForNextAttack = new WaitForSeconds(_attackSpeed); Stats.SetCharacterStats(_playerSpec); Stats.OnCharacterDeath += Die; }
public void HandleUpdate() { switch (state) { case BattleState.ActionSelection: HandleActionSelection(); //Function to make the player able to choose an action break; case BattleState.MoveSelection: HandleMoveSelection(); break; case BattleState.PartyScreen: HandlePartySelection(); break; case BattleState.AboutToUse: HandleAboutSelection(); break; case BattleState.MoveToForget: Action <int> onMoveSelected = (moveIndex) => //This part is all a reference to the action used in the HandleMoveSelection { moveSelectionUI.gameObject.SetActive(false); if (moveIndex == PokemonBase.MaxNumberOfMoves) { //Don't learn the new move StartCoroutine(dialogBox.TypeDialog($"{playerUnit.Pokemon.Base.Name} n'a pas apprit {moveToLearn.Name}.")); } else { //Forget selected move and learn the new var selectedMove = playerUnit.Pokemon.Moves[moveIndex].Base; StartCoroutine(dialogBox.TypeDialog($"{playerUnit.Pokemon.Base.Name} a apprit {moveToLearn.Name} à la place de {selectedMove.Name}.")); playerUnit.Pokemon.Moves[moveIndex] = new Move(moveToLearn); } moveToLearn = null; state = BattleState.RunningTurn; }; moveSelectionUI.HandleMoveSelection(onMoveSelected); break; } }
//what to do while in the action select screen public void HandleUpdate() { if (state == BattleState.ActionSelection) { HandleActionSelection(); } else if (state == BattleState.MoveSelection) { HandleMoveSelection(); } else if (state == BattleState.BattleTeamScreen) { HandleBattleTeamSelection(); } else if (state == BattleState.AboutToUse) { HandleAboutToUse(); } else if (state == BattleState.MoveToForget) { Action <int> onMoveSelection = (moveIndex) => { moveSelectionUI.gameObject.SetActive(false); if (moveIndex == Creature.MaxNumberOfMoves) { //dont learn new move StartCoroutine(dialogueBox.TypeDialog($"{playerUnit.Creature.Base.Name} did not learn {moveToLearn}")); } else { //reference to old move var selectedMove = playerUnit.Creature.Moves[moveIndex].Base; //dialogue stating you will forget a move and learn... StartCoroutine(dialogueBox.TypeDialog($"{playerUnit.Creature.Base.Name} forgot {selectedMove.Name} and learned {moveToLearn.Name}")); //forgot old move playerUnit.Creature.Moves[moveIndex] = new Move(moveToLearn); } moveToLearn = null; state = BattleState.RunningTurn; }; moveSelectionUI.HandleMoveSelection(onMoveSelection); } }
//This handles everything that happens public void HandleUpdate() { if (state == BattleState.ActionSelection) { HandleActionSelection(); } else if (state == BattleState.MoveSelection) { HandleMoveSelection(); } else if (state == BattleState.PartyScreen) { HandlePartySelection(); } else if (state == BattleState.AboutToUse) { HandleAboutToUse(); } else if (state == BattleState.MoveToForget) { Action <int> onMoveSelected = (moveIndex) => { moveSelectionUI.gameObject.SetActive(false); if (moveIndex == PokemonBase.MaxNumOfMoves) { //Don't learn move StartCoroutine(dialogBox.TypeDialog($"{PlayerUnit.Pokemon.Base.Name} did not learn {moveToLearn.Name}!")); } else { //Forget the selected move and learn new one var selectedMove = PlayerUnit.Pokemon.Moves[moveIndex].Base; StartCoroutine(dialogBox.TypeDialog($"{PlayerUnit.Pokemon.Base.Name} forgot {selectedMove.Name} and learned {moveToLearn.Name}!")); PlayerUnit.Pokemon.Moves[moveIndex] = new Move(moveToLearn); } moveToLearn = null; state = BattleState.RunningTurn; }; moveSelectionUI.HandleMoveSelection(onMoveSelected); } }
public Move(MoveBase skeleton, int points) { Skeleton = skeleton; Points = points; }
// public int Attackpower {get; set; } public CharMove(MoveBase cBase) { Base = cBase; MOVECOST = cBase.MoveCost; }
/// <summary> /// Constructor for moves that are added when loading a saved monster. /// This allows for persisting remaining Energy levels. /// </summary> /// <param name="mBase"></param> /// <param name="mEnergy"></param> public MoveObj(MoveBase mBase, int mEnergy) { Base = mBase; Energy = mEnergy; }
public Move(MoveBase _base) { Base = _base; PP = _base.Pp; //de inicio tiene el maximo de PPs }
public Move(MoveBase pBase) { Base = pBase; Affinity = pBase.Affinity; }
protected virtual void Awake() { _moveBase = gameObject.GetAddComponent <MoveBase> (); _moveBase.m_MoveFinishCallBack = OnHandleMoveFinish; }
public Move(MoveBase mBase) { Base = mBase; MP = mBase.MP; }
public Move(MoveBase mBase) { _Base = mBase; maxTimes = mBase.getMaxTimes(); }
public MoveCommand(MoveBase target, InputBuffer buffer) { this.target = target; this.buffer = buffer; }
// private Vector2 _pointCollision = Vector2.zero; private void Awake() { _detect = GetComponent <DetectEnemy>(); _move = GetComponent <MoveBase>(); // _health.EventDie += OnDie; }
public void ProcessPlayerMove(string gameId, string player, MoveBase move) { var game = _games.First(x => x.Key.GameId == gameId); game.Value.RecordResult(player, move); }
public Move(MoveBase pMoveBase) { MoveBase = pMoveBase; }
public Move(MoveBase pBase) { Base = pBase; PP = pBase.Pp; }
public Move(MoveBase skeleton) { Skeleton = skeleton; Points = skeleton.points; }