public void ShowRelationship(UnitID current, UnitID other)
    {
        UpdateButtons();

        relationship = RelationshipManager.GetRelationshipBetween(current, other);
        otherUnit    = GameInformation.instance.GetPlayerInfo(other);
        currentUnit  = current;

        unitSprite.sprite = otherUnit.unitSprite;
        nameText.text     = otherUnit.name;

        curr = -1;
        switch (relationship.GetRank())
        {
        case RelationshipRank.CRUDE:
            curr = 0;
            break;

        case RelationshipRank.BLAND:
            curr = 1;
            break;

        case RelationshipRank.APPETIZING:
            curr = 2;
            break;

        case RelationshipRank.SPICY:
            curr = 3;
            break;
        }

        UpdateRelationships();
    }
Exemplo n.º 2
0
 public void Start()
 {
     enemyUnit  = GameObject.FindGameObjectWithTag("EnemyManager").GetComponent <EnemyUnitInfo>();
     playerUnit = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerUnitInfo>();
     playerUnit.currentConfidence = playerUnit.maxConfidence;
     enemyUnit.currentLove        = playerUnit.attraction;
     animator = GetComponent <Animator>();
 }
    public void Show(PlayerUnitInfo unit)
    {
        this.unit = unit;

        DestroyChildren();
        InitWeaponInventory();

        gameObject.SetActive(true);
    }
    public void Show(PlayerUnitInfo info)
    {
        gameObject.SetActive(true);

        this.info = info;
        SetItems();

        SelectItem();
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        if (go_selectedUnit != null)
        {
            if (go_selectedUnit.tag == "PlayerUnit")
            {
                PlayerUnitInfo plrUnit = go_selectedUnit.GetComponent <PlayerUnitInfo>();
                //PlayerUnitBehaviour plrUnit = go_selectedUnit.GetComponent<PlayerUnitBehaviour>();
                //go_unitInfo.GetComponentInChildren<Text>().text = "HP:" + plrUnit.f_HealthPoint + "\nSPD:" + plrUnit.f_speed + "\nRANGE:" + plrUnit.f_range;
                go_unitInfo.transform.GetChild(1).GetChild(0).GetComponent <Text>().text = "" + plrUnit.GetUnitAttackDmg();
                go_unitInfo.transform.GetChild(1).GetChild(1).GetComponent <Text>().text = "" + plrUnit.GetUnitHealth();
                go_unitInfo.transform.GetChild(2).GetChild(0).GetComponent <Text>().text = plrUnit.transform.name;
                UnitCamera.position = go_selectedUnit.transform.position + (go_selectedUnit.transform.forward * 0.04f);
                UnitCamera.LookAt(go_selectedUnit.transform);
                UnitCamera.position += new Vector3(0, 0.03f, 0);
            }
            else if (go_selectedUnit.tag == "SelectableBuilding")
            {
                BuildingInfo building = go_selectedUnit.GetComponent <BuildingInfo>();
                //go_unitInfo.GetComponentInChildren<Text>().text = building.GetUnitsInfo();
                if (building.transform.GetComponent <TowerBehaviour>() != null)
                {
                    go_unitInfo.transform.GetChild(1).GetChild(0).GetComponent <Text>().text = "" + building.transform.GetComponent <TowerBehaviour>().f_damage;
                }
                else
                {
                    go_unitInfo.transform.GetChild(1).GetChild(0).GetComponent <Text>().text = "-";
                }
                go_unitInfo.transform.GetChild(1).GetChild(1).GetComponent <Text>().text = "" + building.f_health;
                go_unitInfo.transform.GetChild(2).GetChild(0).GetComponent <Text>().text = building.GetUnitsInfo();
                Vector3 cameraPoint = new Vector3(0, 0, 0);
                foreach (Transform child in go_selectedUnit.transform)
                {
                    if (child.name == "CameraPoint")
                    {
                        cameraPoint = child.position;
                    }
                }
                UnitCamera.position = cameraPoint;
                UnitCamera.LookAt(go_selectedUnit.transform);
            }
        }

        //if (GameObject.FindGameObjectWithTag("MainCamera").GetComponent<TouchInput>().enabled)
        //{
        //    if (GameObject.FindGameObjectWithTag("MainCamera").GetComponent<TouchInput>().go_SelectedUnit == null)
        //    {
        //        gameObject.SetActive(false);
        //    }
        //}
        //else if (GameObject.FindGameObjectWithTag("ControlButton").GetComponent<ButtonControl>().go_SelectUnit() == null)
        //{
        //    GameObject.FindGameObjectWithTag("ControlButton").GetComponent<ButtonControl>().Setfalse(false);
        //    gameObject.SetActive(false);
        //}
    }
    public void Show(PlayerUnitInfo info)
    {
        Show();

        this.info       = info;
        healthText.text = "Health: " + info.maxHealth;
        moveText.text   = "Move: " + info.baseMove;

        ShowRelationships();
    }
Exemplo n.º 7
0
    // add in an experience slider

    public void Setup(PlayerUnitInfo playerUnitInfo)
    {
        unitName.text = playerUnitInfo.unitName;
        unitLvl.text  = "lvl: " + playerUnitInfo.unitLvl.ToString();

        confidenceSlider.maxValue = playerUnitInfo.maxConfidence;
        confidenceSlider.value    = playerUnitInfo.currentConfidence;

        // set experience slider
    }
    public void Set(PlayerUnitInfo info)
    {
        if (nameText == null || panel == null)
        {
            nameText = GetComponentInChildren <Text>();
            panel    = GetComponent <Image>();
        }

        nameText.text = info.name;
    }
    public void SetPlayerInfo(PlayerUnitInfo playerInfo)
    {
        _playerInfo = playerInfo;
        SetInfo(_playerInfo);

        List <ItemData> combos = GameInformation.instance.GetComboInfo(playerInfo.id);

        foreach (ItemData combo in combos)
        {
            MovementAndAttackMapping.SetAttack(combo, gameObject);
        }
    }
Exemplo n.º 10
0
    private void Start()
    {
        RestController controller = GetComponent <RestController>();

        minkee = GameInformation.instance.GetPlayerInfo(UnitID.MINKEE);
        phynne = GameInformation.instance.GetPlayerInfo(UnitID.PHYNNE);
        vhall  = GameInformation.instance.GetPlayerInfo(UnitID.VHALL);

        InitMinkeePhynneDialogue();
        InitPhynneVhallDialogue();
        InitVhallMinkeeDialogue();
    }
Exemplo n.º 11
0
    public void ShowPortrait(PlayerUnitInfo unit)
    {
        GameObject unitObj = null;

        foreach (PlayerUnit script in controller.playerUnits)
        {
            if (script.gameObject.GetComponent <UnitStats>().ID == unit.id)
            {
                unitObj = script.gameObject;
                break;
            }
        }

        unitPortraitUI.Show(unitObj, unit);
    }
Exemplo n.º 12
0
    IEnumerator SetupBattle()
    {
        playerUnit = GameObject.FindGameObjectWithTag("PlayerManager").GetComponent <PlayerUnitInfo>();

        enemyUnit = GameObject.FindGameObjectWithTag("EnemyManager").GetComponent <EnemyUnitInfo>();

        battleText.text = enemyUnit.enemyName + " looks uninterested...";

        playerHUD.Setup(playerUnit);
        enemyHUD.Setup(enemyUnit);

        yield return(new WaitForSeconds(2f));

        state = BattleState.PLAYERTURN;
        playerImage.sprite = playerSprites[1];
        PlayerTurn();
    }
    public void Show(GameObject unitObj, PlayerUnitInfo unit)
    {
        controller = GetComponentInParent <BattleController>();

        gameObject.SetActive(true);
        bust.gameObject.SetActive(true);

        bust.sprite = unit.defaultBust;
        name.text   = unit.name;


        if (unit.WeaponMain != null)
        {
            mainWeaponUI.gameObject.SetActive(true);
            mainWeaponUI.Set(unitObj, unit.WeaponMain);
        }
        else
        {
            mainWeaponUI.gameObject.SetActive(false);
        }

        if (unit.WeaponSecondary != null)
        {
            secondaryWeaponUI.gameObject.SetActive(true);
            secondaryWeaponUI.Set(unitObj, unit.WeaponSecondary);
        }
        else
        {
            secondaryWeaponUI.gameObject.SetActive(false);
        }

        talkButton.gameObject.SetActive(false);
        currentUnit = unit.id;

        comboUI.SetObj(unitObj);
        comboUI.gameObject.SetActive(false);
    }
Exemplo n.º 14
0
 public void Die(PlayerUnitInfo unit)
 {
     unitListUI.Die(unit.id);
 }
Exemplo n.º 15
0
 public void FinishTurn(PlayerUnitInfo unit)
 {
     unitListUI.FinishTurn(unit.id);
     HidePortrait();
 }
Exemplo n.º 16
0
 public void Deselect(PlayerUnitInfo unit)
 {
     unitListUI.Deselect(unit.id);
     HidePortrait();
 }
Exemplo n.º 17
0
 public void Select(PlayerUnitInfo unit)
 {
     unitListUI.Select(unit.id);
     ShowPortrait(unit);
 }
Exemplo n.º 18
0
 public DialogueLine(PlayerUnitInfo info, string sentence)
 {
     this.info     = info;
     this.sentence = sentence;
 }
Exemplo n.º 19
0
 public DialogueLine(PlayerUnitInfo info, DialoguePortrait portrait, string sentence) : this(info, sentence)
 {
     this.portrait = portrait;
 }
Exemplo n.º 20
0
 public void LevelUp(PlayerUnitInfo playerUnitInfo)
 {
     unitLvl.text = "lvl: " + playerUnitInfo.unitLvl.ToString();
 }