Beispiel #1
0
    //-----------------------------------------------------------------------------------------------------------
    //-------------------------------------          ATTACKS             ----------------------------------------
    //-----------------------------------------------------------------------------------------------------------
    void InitAttacks(PokemonDatabase.PokemonItem pokemonDb)
    {
        List <PokemonDatabase.PokemonAttack> pokeAttacks = pokemonDb.m_attacksByLvl;

        // Get Moveset && attacks info
        int i = 0;

        while (i < pokeAttacks.Count && pokeAttacks[i].m_level <= m_level)
        {
            i++;
        }

        for (int j = 0; j < 4; j++)
        {
            if (i > 0)
            {
                // Fill attack id
                m_moveSet[j] = pokeAttacks[j].m_attackId;

                // Get attack's info
                AttackDatabase.AttackItem attack = AttackDatabase.GetAttackById(pokeAttacks[j].m_attackId);
                m_ppMax[j]     = attack.m_pp;
                m_ppCurrent[j] = attack.m_pp;

                i--;
            }
            else
            {
                m_moveSet [j] = -1;
            }
        }
    }
Beispiel #2
0
    //----------------------------------------------------------------------------
    protected override void DrawElement(Rect rect, int index, bool selected, bool focused)
    {
        AttackDatabase.AttackItem item = AttackDatabase.GetAttackById(index);

        if (item != null)
        {
            if (!string.IsNullOrEmpty(item.m_name))
            {
                GUI.Label(rect, item.m_index.ToString() + ": " + item.m_name);
            }
            else
            {
                GUI.Label(rect, "Un-named!");
            }

            if (selected)
            {
                if (m_currentlySelected != index)
                {
                    m_currentlySelected = index;
                    this.Repaint();
                }
            }
        }
    }
Beispiel #3
0
    //----------------------------------------------------------------------------
    void InitBattlePokemons(Pokemon player, Pokemon opponent)
    {
        // Sprites
        m_spritePlayer.sprite   = player.m_sprite_fight_back;
        m_spriteOpponent.sprite = opponent.m_sprite_fight_face;

        // Pokemons Info
        m_nameOpponent.text  = opponent.m_name;
        m_namePlayer.text    = player.m_name;
        m_levelOpponent.text = opponent.m_level.ToString();
        m_levelPlayer.text   = player.m_level.ToString();

        // Pokemons Life
        //m_remainingLife.text = player.m_currentPV.ToString ();
        //m_maxLife.text = player.m_pv[(int)EStatType.Current].ToString ();

        // Fight Menu Info
        m_currentPP.text = player.m_ppCurrent[0].ToString();
        m_maxPP.text     = player.m_ppMax[0].ToString();
        //public Text m_typeAtk;

        // Fight Menu moves
        m_move1.text = player.m_moveSet[0] != -1 ? AttackDatabase.GetAttackById(player.m_moveSet[0]).m_name : "-";
        m_move2.text = player.m_moveSet[1] != -1 ? AttackDatabase.GetAttackById(player.m_moveSet[1]).m_name : "-";
        m_move3.text = player.m_moveSet[2] != -1 ? AttackDatabase.GetAttackById(player.m_moveSet[2]).m_name : "-";
        m_move4.text = player.m_moveSet[3] != -1 ? AttackDatabase.GetAttackById(player.m_moveSet[3]).m_name : "-";

        //m_typeAtk = player.m_moveSet[0] != -1 ? AttackDatabase.GetAttackById (player.m_moveSet[0]).m_name : "-";

        //Pokemon in battle
        m_opponentPokemon = opponent;
        m_playerPokemon   = player;
    }
Beispiel #4
0
    //----------------------------------------------------------------------------
    private void CreateAttackNamesList()
    {
        List <AttackDatabase.AttackItem> attackList = AttackDatabase.GetAttackList();

        m_attackNames = new string[attackList.Count];

        foreach (AttackDatabase.AttackItem attack in attackList)
        {
            m_attackNames [attack.m_index] = attack.m_name;
        }
    }
	// Use this for initialization
	void Start () {
	
		database = GameObject.FindGameObjectWithTag ("Database");
		displays = GameObject.FindGameObjectWithTag ("Background").GetComponent<UIScripts> ();
		spec = GameObject.FindGameObjectWithTag ("Background").GetComponent<Specials> ();
		specIt = GameObject.FindGameObjectWithTag ("Background").GetComponent<SpecialItems> ();
		player = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> ();
		itemData = database.GetComponent<ItemData> ();
		attData = database.GetComponent<AttackDatabase> ();

	
	}
Beispiel #6
0
    // -----------------------------------------------------------------------------
    void SelectOrderOfActions()
    {
        m_isPlayerInPhase1 = false;

        // TODO - if a wild pokemon can flee the fight without attacking (Safari Park for example), add the condition here;

        // Running from a fight is resolve before any other action in the turn.
        // If a player plays an object, it will be done before any action from the AI
        if (m_playerAction.GetActionType() == ECombatActionType.Run || m_playerAction.GetActionType() == ECombatActionType.Object)
        {
            m_isPlayerInPhase1 = true;
        }
        // A switch from the player will also be done before any action from the AI, but can be done after some special attacks
        else if (m_AiAction.GetActionType() == ECombatActionType.Switch)
        {
            // For now true. Cannot always be true with some attack like "Pursuit"
            m_isPlayerInPhase1 = true;
        }
        else if (m_AiAction.GetActionType() == ECombatActionType.Attack)           // if both pokemon attacks, select the fastest attack
        {
            CAttackAction playerAttackAction = (CAttackAction)m_playerAction;
            CAttackAction aiAttackAction     = (CAttackAction)m_AiAction;
            int           playerPriority     = AttackDatabase.GetAttackById(playerAttackAction.attackId).m_priorite;
            int           aiPriority         = AttackDatabase.GetAttackById(aiAttackAction.attackId).m_priorite;

            // if higher attack priority for the player's pokemon
            if (playerPriority > aiPriority)
            {
                m_isPlayerInPhase1 = true;
            }
            else if (playerPriority == aiPriority)
            {
                int playerPokemonSpeed = GetPokemonSpeed(m_playerPokemon, true);
                int aiPokemonSpeed     = GetPokemonSpeed(m_opponentPokemon, false);

                // If player's pokemon is faster
                if (playerPokemonSpeed > aiPokemonSpeed)
                {
                    m_isPlayerInPhase1 = true;
                }
                else if (playerPokemonSpeed == aiPokemonSpeed)                  // if both pokemon goes to the same speed, then select one at random to attack first
                {
                    if (Random.Range(0, 2) == 0)
                    {
                        m_isPlayerInPhase1 = true;
                    }
                }
            }
        }
    }
Beispiel #7
0
    //----------------------------------------------------------------------------
    protected override void OnInternalInspectorGUI()
    {
        AttackDatabase.AttackItem item = AttackDatabase.GetAttackById(m_currentlySelected);

        if (item != null)
        {
            GUILayout.BeginHorizontal();
            {
                GUILayout.BeginVertical();
                {
                    EditorGUILayout.LabelField("Attack Index", item.m_index.ToString());
                    item.m_name = EditorGUILayout.TextField("Attack Name", item.m_name);

                    item.m_description = EditorGUILayout.TextField("Attack description", item.m_description);

                    GUILayout.BeginHorizontal();
                    {
                        item.m_attackType = (EAttackType)EditorGUILayout.EnumPopup("Nature of attack", item.m_attackType);
                        item.m_type       = (EPokemonType)EditorGUILayout.EnumPopup("Type of attack", item.m_type);
                    }
                    GUILayout.EndHorizontal();

                    item.m_puissance = EditorGUILayout.IntField("Puissance", item.m_puissance);
                    item.m_precision = EditorGUILayout.IntField("Precision", item.m_precision);
                    item.m_priorite  = EditorGUILayout.IntField("Priorite", item.m_priorite);
                    item.m_pp        = EditorGUILayout.IntField("PP", item.m_pp);
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndHorizontal();
        }

        if (GUI.changed)
        {
            EditorUtility.SetDirty(target);
        }
    }
Beispiel #8
0
        private void buildAttackDBToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AttackDatabase attackDB = new AttackDatabase(new Thinking());

            attackDB.BuildAttackboard();
        }
Beispiel #9
0
 //----------------------------------------------------------------------------
 protected override void AddToList(ReorderableList list)
 {
     AttackDatabase.CreateNewAttack();
     base.AddToList(list);
 }
Beispiel #10
0
	// Use this for initialization
	void Start () {
	
		database = GameObject.FindGameObjectWithTag ("Database");
		player = GameObject.FindGameObjectWithTag("Player").GetComponent<Player>();
		foeBoss = GameObject.FindGameObjectWithTag ("Boss").GetComponent<Boss> ();

		attData = database.GetComponent<AttackDatabase> ();
		itemData = database.GetComponent<ItemData> ();

		sack.SetActive (sackactivity);

		for (int i = 0; i < 5; i++) {
			Image newIcon = Instantiate (permIcon);
			newIcon.transform.SetParent (sack.transform);
			newIcon.transform.localPosition = new Vector3 (-40, 50 - (i * 25), 0);
			newIcon.sprite = transparent;
			icons.Add (newIcon);
		}

		SackUpdate ();

		attackButton = attackStatusArea.transform.GetChild(2).gameObject;
		heartButton = heartStatusArea.transform.GetChild(2).gameObject;
		skillButton = skillStatusArea.transform.GetChild(2).gameObject;
		speedButton = speedStatusArea.transform.GetChild(2).gameObject;

		currRegSkill = attData.attacks [0];
		regSkill.sprite = currRegSkill.attIcon;

		currSpecSkill = attData.attacks [5];
		specSkill.sprite = currSpecSkill.attIcon;

		itemData.item [12].openIt = true;
		itemData.item [15].openIt = true;

		/*
		viewportPoint = Camera.main.WorldToViewportPoint(playerPos.transform.position);
		healthBarPos = new Vector2 (
			((viewportPoint.x * canvasRect.sizeDelta.x) - (canvasRect.sizeDelta.x * 0.5f)),
			((viewportPoint.y * canvasRect.sizeDelta.y) - (canvasRect.sizeDelta.y * 0.5f)));
		playerHealth.anchoredPosition = healthBarPos;
*/
		pause = false;
		pauseButton.SetActive (true);
		pauseUI.SetActive (false);
	}