Ejemplo n.º 1
0
    public void RemoveProfessional()
    {
        if (_hasAProfessional && !_myTargetLocation.Locked)
        {
            if (CurrentProfesional.ProfessionalCount == 0)
            {
                CurrentProfesional.ButtonMask.SetActive(false);
            }

            CurrentProfesional.ProfessionalCount++;
            _myTargetLocation.TheProfMenu.RetrieveProfessional(_myTargetLocation.name, CurrentProfesional.MyProfessionalType);
            ProfessionalType removedProfType = CurrentProfesional.MyProfessionalType;
            CurrentProfesional      = null;
            _hasAProfessional       = false;
            PortraitRenderer.sprite = null;
            _theGSB.BudgetBarChange(_myTargetLocation, removedProfType, false);
            _audioManager.PlaySound("Professional Removed");
        }
    }
Ejemplo n.º 2
0
    public void RetrieveProfessional(string targetLoc, ProfessionalType profType)
    {
        switch (profType)
        {
        case ProfessionalType.Doctor:
            if (DocLoc5.enabled && DocLoc5.text == targetLoc)
            {
                DocLoc5.text  = "Unassigned";
                DocLoc5.color = Color.gray;
            }
            else if (DocLoc4.enabled && DocLoc4.text == targetLoc)
            {
                DocLoc4.text  = "Unassigned";
                DocLoc4.color = Color.gray;
            }    //Finish the enabled bit
            else if (DocLoc3.text == targetLoc)
            {
                DocLoc3.text  = "Unassigned";
                DocLoc3.color = Color.gray;
            }
            else if (DocLoc2.text == targetLoc)
            {
                DocLoc2.text  = "Unassigned";
                DocLoc2.color = Color.gray;
            }
            else if (DocLoc1.text == targetLoc)
            {
                DocLoc1.text  = "Unassigned";
                DocLoc1.color = Color.gray;
            }
            break;

        case ProfessionalType.Nurse:
            if (NurseLoc5.text == targetLoc)
            {
                NurseLoc5.text  = "Unassigned";
                NurseLoc5.color = Color.gray;
            }
            else if (NurseLoc4.text == targetLoc)
            {
                NurseLoc4.text  = "Unassigned";
                NurseLoc4.color = Color.gray;
            }
            else if (NurseLoc3.text == targetLoc)
            {
                NurseLoc3.text  = "Unassigned";
                NurseLoc3.color = Color.gray;
            }
            else if (NurseLoc2.text == targetLoc)
            {
                NurseLoc2.text  = "Unassigned";
                NurseLoc2.color = Color.gray;
            }
            else if (NurseLoc1.text == targetLoc)
            {
                NurseLoc1.text  = "Unassigned";
                NurseLoc1.color = Color.gray;
            }
            break;

        case ProfessionalType.CommOrg:
            if (COLoc5.text == targetLoc)
            {
                COLoc5.text  = "Unassigned";
                COLoc5.color = Color.gray;
            }
            else if (COLoc4.text == targetLoc)
            {
                COLoc4.text  = "Unassigned";
                COLoc4.color = Color.gray;
            }
            else if (COLoc3.text == targetLoc)
            {
                COLoc3.text  = "Unassigned";
                COLoc3.color = Color.gray;
            }
            else if (COLoc2.text == targetLoc)
            {
                COLoc2.text  = "Unassigned";
                COLoc2.color = Color.gray;
            }
            else if (COLoc1.text == targetLoc)
            {
                COLoc1.text  = "Unassigned";
                COLoc1.color = Color.gray;
            }
            break;

        case ProfessionalType.Politician:
            if (PolLoc5.text == targetLoc)
            {
                PolLoc5.text  = "Unassigned";
                PolLoc5.color = Color.gray;
            }
            else if (PolLoc4.text == targetLoc)
            {
                PolLoc4.text  = "Unassigned";
                PolLoc4.color = Color.gray;
            }
            else if (PolLoc3.text == targetLoc)
            {
                PolLoc3.text  = "Unassigned";
                PolLoc3.color = Color.gray;
            }
            else if (PolLoc2.text == targetLoc)
            {
                PolLoc2.text  = "Unassigned";
                PolLoc2.color = Color.gray;
            }
            else if (PolLoc1.text == targetLoc)
            {
                PolLoc1.text  = "Unassigned";
                PolLoc1.color = Color.gray;
            }
            break;

        case ProfessionalType.SocialWorker:
            if (AdvLoc5.text == targetLoc)
            {
                AdvLoc5.text  = "Unassigned";
                AdvLoc5.color = Color.gray;
            }
            else if (AdvLoc4.text == targetLoc)
            {
                AdvLoc4.text  = "Unassigned";
                AdvLoc4.color = Color.gray;
            }
            else if (AdvLoc3.text == targetLoc)
            {
                AdvLoc3.text  = "Unassigned";
                AdvLoc3.color = Color.gray;
            }
            else if (AdvLoc2.text == targetLoc)
            {
                AdvLoc2.text  = "Unassigned";
                AdvLoc2.color = Color.gray;
            }
            else if (AdvLoc1.text == targetLoc)
            {
                AdvLoc1.text  = "Unassigned";
                AdvLoc1.color = Color.gray;
            }
            break;

        default:
            Debug.Log("??????");
            break;
        }
    }
Ejemplo n.º 3
0
    public void PlaceAProfessional(string targetLoc, ProfessionalType profType)
    {
        switch (profType)
        {
        case ProfessionalType.Doctor:
            if (DocLoc1.text == "Unassigned")
            {
                DocLoc1.text  = targetLoc;
                DocLoc1.color = Color.white;
            }
            else if (DocLoc2.text == "Unassigned")
            {
                DocLoc2.text  = targetLoc;
                DocLoc2.color = Color.white;
            }
            else if (DocLoc3.text == "Unassigned")
            {
                DocLoc3.text  = targetLoc;
                DocLoc3.color = Color.white;
            }
            else if (DocLoc4.text == "Unassigned")
            {
                DocLoc4.text  = targetLoc;
                DocLoc4.color = Color.white;
            }
            else if (DocLoc5.text == "Unassigned")
            {
                DocLoc5.text  = targetLoc;
                DocLoc5.color = Color.white;
            }
            break;

        case ProfessionalType.Nurse:
            if (NurseLoc1.text == "Unassigned")
            {
                NurseLoc1.text  = targetLoc;
                NurseLoc1.color = Color.white;
            }
            else if (NurseLoc2.text == "Unassigned")
            {
                NurseLoc2.text  = targetLoc;
                NurseLoc2.color = Color.white;
            }
            else if (NurseLoc3.text == "Unassigned")
            {
                NurseLoc3.text  = targetLoc;
                NurseLoc3.color = Color.white;
            }
            else if (NurseLoc4.text == "Unassigned")
            {
                NurseLoc4.text  = targetLoc;
                NurseLoc4.color = Color.white;
            }
            else if (NurseLoc5.text == "Unassigned")
            {
                NurseLoc5.text  = targetLoc;
                NurseLoc5.color = Color.white;
            }
            break;

        case ProfessionalType.CommOrg:
            if (COLoc1.text == "Unassigned")
            {
                COLoc1.text  = targetLoc;
                COLoc1.color = Color.white;
            }
            else if (COLoc2.text == "Unassigned")
            {
                COLoc2.text  = targetLoc;
                COLoc2.color = Color.white;
            }
            else if (COLoc3.text == "Unassigned")
            {
                COLoc3.text  = targetLoc;
                COLoc3.color = Color.white;
            }
            else if (COLoc4.text == "Unassigned")
            {
                COLoc4.text  = targetLoc;
                COLoc4.color = Color.white;
            }
            else if (COLoc5.text == "Unassigned")
            {
                COLoc5.text  = targetLoc;
                COLoc5.color = Color.white;
            }
            break;

        case ProfessionalType.Politician:
            if (PolLoc1.text == "Unassigned")
            {
                PolLoc1.text  = targetLoc;
                PolLoc1.color = Color.white;
            }
            else if (PolLoc2.text == "Unassigned")
            {
                PolLoc2.text  = targetLoc;
                PolLoc2.color = Color.white;
            }
            else if (PolLoc3.text == "Unassigned")
            {
                PolLoc3.text  = targetLoc;
                PolLoc3.color = Color.white;
            }
            else if (PolLoc4.text == "Unassigned")
            {
                PolLoc4.text  = targetLoc;
                PolLoc4.color = Color.white;
            }
            else if (PolLoc5.text == "Unassigned")
            {
                PolLoc5.text  = targetLoc;
                PolLoc5.color = Color.white;
            }
            break;

        case ProfessionalType.SocialWorker:
            if (AdvLoc1.text == "Unassigned")
            {
                AdvLoc1.text  = targetLoc;
                AdvLoc1.color = Color.white;
            }
            else if (AdvLoc2.text == "Unassigned")
            {
                AdvLoc2.text  = targetLoc;
                AdvLoc2.color = Color.white;
            }
            else if (AdvLoc3.text == "Unassigned")
            {
                AdvLoc3.text  = targetLoc;
                AdvLoc3.color = Color.white;
            }
            else if (AdvLoc4.text == "Unassigned")
            {
                AdvLoc4.text  = targetLoc;
                AdvLoc4.color = Color.white;
            }
            else if (AdvLoc5.text == "Unassigned")
            {
                AdvLoc5.text  = targetLoc;
                AdvLoc5.color = Color.white;
            }
            break;

        default:
            Debug.Log("??????");
            break;
        }
    }
Ejemplo n.º 4
0
    public bool BudgetBarChange(TargetLocation tl, ProfessionalType profType, bool addingProf)
    {
        if (addingProf)
        {
            float lastBudget = potentialBudget;

            if (profType == ProfessionalType.Politician)
            {
                int polCount = 0;

                for (int i = 0; i < tl.ProSlots.Length; i++)
                {
                    if (tl.ProSlots[i].CurrentProfesional != null)
                    {
                        if (tl.ProSlots[i].CurrentProfesional.MyProfessionalType == ProfessionalType.Politician)
                        {
                            polCount++;
                        }
                    }
                }

                if (polCount == 0)
                {
                    potentialBudget += 5;
                }
                else if (polCount == 1)
                {
                    potentialBudget += 15;
                }
                else if (polCount == 2)
                {
                    potentialBudget += 30;
                }
            }
            else
            {
                if (profType == ProfessionalType.Doctor)
                {
                    potentialBudget -= 6;
                }
                else
                {
                    potentialBudget -= 3;
                }

                if (potentialBudget < 0)
                {
                    potentialBudget = lastBudget;
                    return(false);
                }
            }
        }
        else
        {
            if (profType == ProfessionalType.Politician)
            {
                int polCount = 0;

                for (int i = 0; i < tl.ProSlots.Length; i++)
                {
                    if (tl.ProSlots[i].CurrentProfesional != null)
                    {
                        if (tl.ProSlots[i].CurrentProfesional.MyProfessionalType == ProfessionalType.Politician)
                        {
                            polCount++;
                        }
                    }
                }

                if (polCount == 0)
                {
                    potentialBudget -= 5;
                }
                else if (polCount == 1)
                {
                    potentialBudget -= 15;
                }
                else if (polCount == 2)
                {
                    potentialBudget -= 30;
                }
            }
            else
            {
                if (profType == ProfessionalType.Doctor)
                {
                    potentialBudget += 6;
                }
                else
                {
                    potentialBudget += 3;
                }
            }
        }

        if (potentialBudget > gameManager.Budget)
        {
            BudgetBarFront.fillAmount = gameManager.Budget / 100;
            BudgetBarBack.fillAmount  = potentialBudget / 100;
        }
        else
        {
            BudgetBarFront.fillAmount = potentialBudget / 100;
            BudgetBarBack.fillAmount  = gameManager.Budget / 100;
        }

        return(true);
    }
Ejemplo n.º 5
0
Archivo: Suit.cs Proyecto: qq21/2019Bag
 public Suit(int id, string name, Quality quality, string description, string sprite, ProfessionalType professionalType, Sex sex, SuitType suitType) : base(id, name, quality, description, sprite, professionalType, sex)
 {
     this.suitType = suitType;
     this.ItemType = ItemType.Suit;
 }
Ejemplo n.º 6
0
Archivo: Skin.cs Proyecto: qq21/2019Bag
 public Skin(int id, string name, Quality quality, string description, string sprite, ProfessionalType professionalType, Sex sex) : base(id, name, quality, description, sprite)
 {
     this.professionalType = professionalType;
     this.sex      = sex;
     this.ItemType = ItemType.Skin;
 }