コード例 #1
0
    public void SetStatus(PokemonStatus status, float durationTime)
    {
        Debug.Log(status + "에 걸림");

        if (status == PokemonStatus.Paralysis && HasType(PokemonType.Electric))
        {
            return;
        }

        UnsetStatus();
        currentStatus       = status;
        statusDuraitionTime = durationTime;

        switch (status)
        {
        case PokemonStatus.Sleep:
            StopAnimation();
            currentState = PokemonState.Idle;
            sleepEffect  = Instantiate(sleepEffectPrefab, uiTransform);
            break;

        case PokemonStatus.Paralysis:
            spriteRenderer.color = new Color(1f, 1f, 0f);
            animator.speed      *= 0.5f;
            StartCoroutine(ParalysisEffect());
            break;
        }
    }
コード例 #2
0
 public void TakeDamage(float d)
 {
     health -= d;
     if (health <= 0)
     {
         Debug.Log("This monster feinted");
         status = PokemonStatus.Feint;
     }
 }
コード例 #3
0
    /// <summary>
    /// New Pokemon with: random IVS, Shininess, default moveset, and EVS (0)
    /// </summary>
    /// <param name="pPokemonID"></param>
    /// <param name="pGender"></param>
    /// <param name="pLevel"></param>
    /// <param name="pCaughtBall"></param>
    /// <param name="pHeldItem"></param>
    /// <param name="pOT"></param>
    /// <param name="pAbility"></param>
    public OwnedPokemon(string pPokemonID, PokemonGender pGender, int pLevel, string pCaughtBall, string pHeldItem, string pOT, int pAbility)
        : this(pPokemonID)
    {
        // Set status.
        CurrentStatus = PokemonStatus.NONE;

        // Set level and experience.
        CurrentLevel      = pLevel;
        CurrentExperience = PokemonLevelingRateHelper.GetRequiredExperienceToTargetLevel(Species.LevelingRate, CurrentLevel);

        // Set friendship.
        CurrentFriendship = Species.BaseFriendship;

        // Set gender.
        generateGender(pGender);

        // Set rare value.
        generateRareValue();

        // Set met data.
        generateMetData(pLevel, pCaughtBall);

        // Set DO n°.
        generateDONumber();

        // Set IVs and EVs.
        generateIVsAndEVs();

        // Set nature.
        Nature = PokemonNatureHelper.GetRandomNature();

        // Set ability.
        generateAbility();

        // ToDo: Set default move set as 4 highest level learnable moves
        //Set moveset based off of the highest level moves possible.
        //_currentMoveset = thisPokemonData.GenerateMoveset(_currentLevel);
        _moveHistory = _currentMoveset;

        //set maxPP and PP to be the regular PP defined by the move in the database.
        PPups = new int[4];
        maxPP = new int[4];
        PP    = new int[4];
        for (int i = 0; i < 4; i++)
        {
            if (!string.IsNullOrEmpty(_currentMoveset[i]))
            {
                maxPP[i] = MoveDatabase.getMove(_currentMoveset[i]).getPP();
                PP[i]    = maxPP[i];
            }
        }
        packMoveset();
    }
コード例 #4
0
    public void removeHP(int pAmount)
    {
        // We use absolute value.
        pAmount = Mathf.Abs(pAmount);

        Stats[PokemonStatType.HP].LoseHP(pAmount);

        if (GetCurrentStatValue(PokemonStatType.HP) <= 0)
        {
            CurrentStatus = PokemonStatus.FAINTED;
        }
    }
コード例 #5
0
    public bool TrySetStatus(PokemonStatus pNewStatus)
    {
        if (pNewStatus == CurrentStatus)
        {
            return(true);
        }

        if (CurrentStatus == PokemonStatus.NONE ||
            pNewStatus == PokemonStatus.NONE ||
            pNewStatus == PokemonStatus.FAINTED)
        {
            _currentStatus = pNewStatus;

            return(true);
        }

        return(false);
    }
コード例 #6
0
ファイル: Token.cs プロジェクト: d13kotson/Tabletop_Unity
 public void ShowStats()
 {
     if (this.StatusPanel != null)
     {
         PokemonStatus pokeStatus = this.StatusPanel.GetComponent <PokemonStatus>();
         if (pokeStatus == null)
         {
             TrainerStatus trainerStatus = this.StatusPanel.GetComponent <TrainerStatus>();
             if (trainerStatus != null)
             {
                 trainerStatus.Enable();
             }
         }
         else
         {
             pokeStatus.Enable();
         }
     }
 }
コード例 #7
0
    public void UnsetStatus()
    {
        switch (currentStatus)
        {
        case PokemonStatus.Sleep:
            StartAnimation();
            currentState = PokemonState.Move;
            Destroy(sleepEffect);
            break;

        case PokemonStatus.Paralysis:
            spriteRenderer.color = new Color(1f, 1f, 1f);
            animator.speed      *= 2f;
            break;
        }

        currentStatus = PokemonStatus.None;
        statusTime    = 0f;
    }
コード例 #8
0
ファイル: MoveHelper.cs プロジェクト: nilllzz/pokemon-redux
        public static bool CheckPokemonStatus(BattlePokemon target, PokemonStatus status)
        {
            if (target.Pokemon.Status != PokemonStatus.OK)
            {
                if (target.Pokemon.Status != status)
                {
                    // is afflicted by status, but not the one trying to inclict
                    Battle.ActiveBattle.UI.ShowMessageAndWait("It didn^'t affect\n" + target.GetDisplayName() + "!");
                }
                else
                {
                    switch (status)
                    {
                    case PokemonStatus.PAR:
                        Battle.ActiveBattle.UI.ShowMessageAndWait(target.GetDisplayName() + "^'s\nalready paralyzed!");
                        break;

                    case PokemonStatus.SLP:
                        Battle.ActiveBattle.UI.ShowMessageAndWait(target.GetDisplayName() + "^'s\nalready asleep!");
                        break;

                    case PokemonStatus.BRN:
                        Battle.ActiveBattle.UI.ShowMessageAndWait(target.GetDisplayName() + "^'s\nalready burnt!");     // TODO: message
                        break;

                    case PokemonStatus.FRZ:
                        Battle.ActiveBattle.UI.ShowMessageAndWait(target.GetDisplayName() + "^'s\nalready frozen!");     // TODO: message
                        break;

                    case PokemonStatus.PSN:
                    case PokemonStatus.TOX:
                        Battle.ActiveBattle.UI.ShowMessageAndWait(target.GetDisplayName() + "^'s\nalready poisoned!");     // TODO: message
                        break;
                    }
                }
                return(false);
            }
            return(true);
        }
コード例 #9
0
    public void addExp(int expAdded)
    {
        if (CurrentLevel < 100)
        {
            CurrentExperience += expAdded;
            while (CurrentExperience >= NextLevelExp)
            {
                int currentBaseHP = GetCurrentLevelStatValue(PokemonStatType.HP);

                CurrentLevel += 1;

                // We heal the amount of gained HP by leveling.
                Stats[PokemonStatType.HP].LoseHP(currentBaseHP - GetCurrentLevelStatValue(PokemonStatType.HP));

                // We remove the death flag if needed.
                if (CurrentStatus == PokemonStatus.FAINTED &&
                    GetCurrentStatValue(PokemonStatType.HP) > 0)
                {
                    CurrentStatus = PokemonStatus.NONE;
                }
            }
        }
    }
コード例 #10
0
ファイル: UIItemBagMenu.cs プロジェクト: tech-ticks/RTDXTools
    private IEnumerator _processCommandBoxRenketsu(PokemonStatus status, Action <int> resultCb) => default;    // 0x00A8BFC0-0x00A8C040

    // [IteratorStateMachine] // 0x00629B00-0x00629B70
    private IEnumerator _prodessSelectWazaSlot(PokemonStatus status, Const.item.Index itemIndex, Action <int> resultCb) => default; // 0x00A8C040-0x00A8C0D0
コード例 #11
0
ファイル: UIItemBagMenu.cs プロジェクト: tech-ticks/RTDXTools
    public static IEnumerator ProcessForgetWazaSelect(PokemonStatus status, Const.waza.Index wazaIndex, bool bCancelConfirm, Action <int> cb = null) => default;    // 0x00A8BEF0-0x00A8BF90

    // [IteratorStateMachine] // 0x00629A90-0x00629B00
    private IEnumerator _processCommandBoxRenketsu(PokemonStatus status, Action <int> resultCb) => default;    // 0x00A8BFC0-0x00A8C040
コード例 #12
0
ファイル: UIItemBagMenu.cs プロジェクト: tech-ticks/RTDXTools
    private IEnumerator _processCommandLearnWaza(List <IPokemonStatus> statusList, List <IPokemonStatus> ignoreStatusList, IItem item, Action <int, PokemonStatus> resultCb) => default;  // 0x00A8BE60-0x00A8BEF0

    // [IteratorStateMachine] // 0x00629A20-0x00629A90
    public static IEnumerator ProcessForgetWazaSelect(PokemonStatus status, Const.waza.Index wazaIndex, bool bCancelConfirm, Action <int> cb = null) => default;    // 0x00A8BEF0-0x00A8BF90
コード例 #13
0
 public PokemonWarehouseId Add(Const.creature.Index pokemonIndex) => default;         // 0x009E7E40-0x009E7F40
 public PokemonWarehouseId AddFromStatus(PokemonStatus pokemonStatus) => default;     // 0x009E7F40-0x009E8080
コード例 #14
0
ファイル: PokemonStatus.cs プロジェクト: tech-ticks/RTDXTools
 public static PokemonStatus SetupRewardPokemonStatusFormFixedPokemon(FixedWarehouseId wid) => default;                                                                // 0x00C4BF10-0x00C4C010
 public static PokemonStatus SetupTemporaryNukeninStatus(PokemonStatus baseStatus) => default;                                                                         // 0x00C4C010-0x00C4C160
コード例 #15
0
ファイル: WazaDatabase.cs プロジェクト: tech-ticks/RTDXTools
    public static int GetPPLimit(Const.waza.Index index) => default;                                                                                                   // 0x00744BF0-0x00744C60

    public static Const.pokemon.Type GetType(Const.waza.Index index, PokemonStatus status = null) => default;                                                          // 0x00744C60-0x00744E60
コード例 #16
0
 public void healStatus()
 {
     CurrentStatus = PokemonStatus.NONE;
 }
コード例 #17
0
    /// <summary>
    /// Adding a caught pokemon (only a few customizable details)
    /// </summary>
    /// <param name="pPokemon"></param>
    /// <param name="pNickname"></param>
    /// <param name="pCaughtBall"></param>
    public OwnedPokemon(OwnedPokemon pPokemon, string pNickname, string pCaughtBall)
        : this(pPokemon.Species.GameId)
    {
        Nickname = pNickname;

        // Set status.
        CurrentStatus = pPokemon.CurrentStatus;

        // Set level and experience.
        CurrentLevel      = pPokemon.CurrentLevel;
        CurrentExperience = pPokemon.CurrentExperience;

        // Set friendship.
        CurrentFriendship = pPokemon.Species.BaseFriendship;

        // Set gender.
        Gender = pPokemon.Gender;

        // Set rare value.
        RareValue = pPokemon.RareValue;

        // Set met data.
        MetData = pPokemon.MetData;

        // Set DO n°.
        generateDONumber();


        // Set nature.
        Nature = pPokemon.Nature;

        // Set ability.
        CurrentAbility = pPokemon.CurrentAbility;

        Stats = pPokemon.Stats;
        //// Copy IVs.
        //Stats[PokemonStatType.HP].IV = pPokemon.GetIV(PokemonStatType.HP);
        //Stats[PokemonStatType.Attack].IV = pPokemon.GetIV(PokemonStatType.Attack);
        //Stats[PokemonStatType.Defence].IV = pPokemon.GetIV(PokemonStatType.Defence);
        //Stats[PokemonStatType.SpecialAttack].IV = pPokemon.GetIV(PokemonStatType.SpecialAttack);
        //Stats[PokemonStatType.SpecialDefence].IV = pPokemon.GetIV(PokemonStatType.SpecialDefence);
        //Stats[PokemonStatType.Speed].IV = pPokemon.GetIV(PokemonStatType.Speed);

        //// Copy EVs.
        //Stats[PokemonStatType.HP].EV = pPokemon.GetEV(PokemonStatType.HP);
        //Stats[PokemonStatType.Attack].EV = pPokemon.GetEV(PokemonStatType.Attack);
        //Stats[PokemonStatType.Defence].EV = pPokemon.GetEV(PokemonStatType.Defence);
        //Stats[PokemonStatType.SpecialAttack].EV = pPokemon.GetEV(PokemonStatType.SpecialAttack);
        //Stats[PokemonStatType.SpecialDefence].EV = pPokemon.GetEV(PokemonStatType.SpecialDefence);
        //Stats[PokemonStatType.Speed].EV = pPokemon.GetEV(PokemonStatType.Speed);

        // MoveSet.
        _currentMoveset = pPokemon._currentMoveset;
        _moveHistory    = pPokemon._moveHistory;

        PPups = pPokemon.PPups;
        //set maxPP and PP to be the regular PP defined by the move in the database.
        maxPP = new int[4];
        PP    = new int[4];
        for (int i = 0; i < 4; i++)
        {
            if (!string.IsNullOrEmpty(_currentMoveset[i]))
            {
                maxPP[i] = Mathf.FloorToInt(MoveDatabase.getMove(_currentMoveset[i]).getPP() * ((PPups[i] * 0.2f) + 1));
                PP[i]    = maxPP[i];
            }
        }
        packMoveset();
    }