Esempio n. 1
0
    public void SetUpProfile(ProfileSO profile)
    {
        this.profile = profile;
        dialogueBox.ShowKeepCrewDialogue(profile.PrettyText());

        this.gameObject.SetActive(true);
    }
Esempio n. 2
0
 public void AddCrew(int pos)
 {
     ship.BootCrew(pos);
     ship.AdoptCrew(crewCandidate, pos);
     fishPool.CatchItem();
     crewCandidate = null;
     fishingPaused = false;
 }
Esempio n. 3
0
 public void AdoptCrew(ProfileSO newMember, int crewSlot)
 {
     crewList[crewSlot].profile = newMember;
     crewList[crewSlot].Reset();
     if (crewList[crewSlot].GetSkillLevel() > 0)
     {
         crewSkills[crewList[crewSlot].GetSkillType()] += crewList[crewSlot].GetSkillLevel();
     }
     crewList[crewSlot].gameObject.SetActive(true);
 }
Esempio n. 4
0
 void HandleFishing()
 {
     ++fishClock;
     if (fishClock >= fishTime) {
         fishingPaused = true;
         ItemSO item = fishPool.FishItem();
         if (item.category.Equals(ItemSO.ItemCategory.Crew)) {
             crewCandidate = crewGenerator.GenerateCrewProfile(item);
             decisionUI.SetUpProfile(crewCandidate);
         } else {
             decisionUI.SetUpItem(item);
         }
         fishClock = 0;
     }
 }
Esempio n. 5
0
    public ProfileSO GenerateCrewProfile(ItemSO crewItem)
    {
        if (!crewItem.category.Equals(ItemSO.ItemCategory.Crew))
        {
            return(null);
        }
        float     rarity  = crewItem.rarity;
        ProfileSO profile = ScriptableObject.CreateInstance <ProfileSO>();

        profile.weight     = this.generateWeight(rarity);
        profile.tolerance  = this.generateTolerance(rarity);
        profile.temperment = this.generateTemperance(rarity);
        profile.skillType  = this.generateSkillType(rarity);
        profile.skillLevel = this.generateSkillLevel(rarity);
        this.setText(profile, this.crewText, rarity);
        Debug.Log("=== Generating Crew Profile ===\n\tFrom item: " + crewItem + "\n\tCreated: " + profile);
        return(profile);
    }
Esempio n. 6
0
    private void setText(ProfileSO profile, RarityText text, float rarity)
    {
        bool male   = Random.value > 0.5f;
        int  bucket = male ? 0 : 1;
        int  choice = 0;

        // choose item name
        choice = (int)((text.names[bucket].choices.Length + text.universalNames.Length) * rarity);
        if (choice < text.names[bucket].choices.Length)
        {
            profile.crewName = text.names[bucket].choices[choice];
        }
        else
        {
            profile.crewName = text.universalNames[choice - text.names[bucket].choices.Length];
        }
        // Decide temperment text
        string temperment;

        if (profile.temperment < this.maxTempRate * 0.3)
        {
            temperment = string.Format("Looks like {0}'s about to cry.", myPronouns(male));
        }
        else if (profile.temperment < this.maxTempRate * 0.75)
        {
            temperment = string.Format("Looks like {0} could easily complete a days work.", myPronouns(male));
        }
        else
        {
            temperment = string.Format("{0} looks quite cheery.", myPronouns(male));
        }
        // Decide tolerence text
        string tolerance;

        if (profile.tolerance < this.maxTol * 0.3)
        {
            tolerance = string.Format("A drink or two and this crewmate is high as the crow's nest!", myPronouns(male));
        }
        else if (profile.tolerance < this.maxTol * 0.75)
        {
            tolerance = string.Format("", myPronouns(male));
        }
        else
        {
            tolerance = string.Format("Don't get in a drinking bout with this fellow!", myPronouns(male));
        }
        // Decide weight text
        string weight;

        if (profile.weight < this.maxTempRate * 0.3)
        {
            weight = string.Format("{0} has worked {1} to the bone.", myPronouns(male), male ? "himself" : "herself");
        }
        else if (profile.weight < this.maxTempRate * 0.75)
        {
            weight = "";
        }
        else
        {
            weight = string.Format("Remember, don't assign them to climb the rigging.", myPronouns(male));
        }

        profile.flavorText = string.Format("An {4} {3}. {0} {1} {2}", temperment, weight, tolerance, profile.skillType, profile.skillLevel);

        // choose item flavor text
        // choice = (int)((text.flavors[bucket].choices.Length + text.universalFlavors.Length) * rarity);
        // if (choice < text.flavors[bucket].choices.Length)
        // {
        //     item.flavorText = text.flavors[bucket].choices[choice];
        // }
        // else
        // {
        //     item.flavorText = text.universalFlavors[choice - text.flavors[bucket].choices.Length];
        // }
    }
Esempio n. 7
0
 public void Refuse()
 {
     crewCandidate = null;
     fishPool.ReleaseItem();
     fishingPaused = false;
 }