public Resources_Shopkeeper(string id,
                             string name,
                             string image,
                             Enums.Gender gender,
                             Resources_Building home,
                             int money,
                             int income,
                             int expenses,
                             int strength,
                             int respect,
                             int fear,
                             int greed,
                             int integrity,
                             int stubbornness,
                             Enums.Personality personality,
                             Resources_Inventory inventory)
     : base(id,
            name,
            image,
            gender,
            home,
            money,
            income,
            expenses,
            strength,
            respect,
            fear,
            greed,
            integrity,
            stubbornness,
            personality,
            inventory)
 {
     Manager_Resources.NewShopkeeper(this);
 }
Exemple #2
0
    public Resources_Player(ProfileSettings profile,
                            Resources_Building home,
                            int money,
                            int income,
                            int expenses,
                            int strength,
                            int presence,
                            int opinion,
                            Resources_Inventory inventory)
        : base(profile.id,
               profile.name,
               profile.image,
               profile.gender,
               home,
               money,
               income,
               expenses,
               strength,
               inventory)
    {
        _presence = presence;
        _opinion  = opinion;
        instance  = this;

        Manager_Resources.NewPlayer(this);
    }
    public Resources_Player(ProfileSettings profile,
	                         Resources_Building home,
	                         int money,
	                         int income,
	                         int expenses,
	                         int strength,
	                         int presence,
	                         int opinion,
	                         Resources_Inventory inventory)
        : base(profile.id,
		        profile.name,
		        profile.image,
		        profile.gender,
		        home,
		        money,
		        income,
		        expenses,
		        strength,
		        inventory)
    {
        _presence = presence;
        _opinion = opinion;
        instance = this;

        Manager_Resources.NewPlayer(this);
    }
    static public Dialogue_Prompt DefaultAmount(Resources_Player player, Resources_Shopkeeper shopkeeper, int askingPrice)
    {
        Resources_Building shop = shopkeeper.home;
        float profit            = shop.income - shop.expenses;

        if (profit == 0)
        {
            profit = 0.0001f;
        }

        float affordValue   = 2 * ((1 - askingPrice / profit * shopkeeper.greed) * (shopkeeper.fear / shopkeeper.greed) - 50);
        float strengthValue = (Utilities.difficultyHandicap / 5 + player.strength) * player.presence - (shopkeeper.strength * 100 / shopkeeper.fear);
        float moralValue    = Utilities.difficultyHandicap * shopkeeper.fear / 10 - shopkeeper.integrity / shopkeeper.respect;

        Debug.Log("Afford Value: " + affordValue + ". Strength Value: " + strengthValue + ". Moral Value: " + moralValue + ". Total: " + (affordValue + strengthValue + moralValue) + ".");

        if ((affordValue + strengthValue + moralValue) >= 0)
        {
            Dialogue_Prompt_Logic.OfferAccepted();
            return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_offerAccepted"));
        }
        else
        {
            Dialogue_Prompt_Logic.OfferRefused();
            return(Dialogue_Prompt.GetPromptByName("dialogue_prompt_offerRefused"));
        }
    }
 static public void NewBuilding(Resources_Building value)
 {
     if (IDIsUnique(value.id))
     {
         _buildings.Add(value);
         _referenceIDs.Add(value);
     }
     else
     {
         Debug.LogError("Attempted to create a building with the existing ID '" + value.id + "'.");
     }
 }
Exemple #6
0
 public Resources_Character(string id,
                            string name,
                            string image,
                            Enums.Gender gender,
                            Resources_Building home,
                            int money,
                            int income,
                            int expenses,
                            int strength,
                            Resources_Inventory inventory)
     : base(id,
            name,
            image,
            money,
            income,
            expenses)
 {
     _gender    = gender;
     _home      = home;
     _strength  = strength;
     _inventory = inventory;
 }
    public Resources_NPC(string id,
	                      string name,
	                      string image,
	                      Enums.Gender gender,
	                      Resources_Building home,
	                      int money,
	                      int income,
	                      int expenses,
	                      int strength,
	                      int respect,
	                      int fear,
	                      int greed,
	                      int integrity,
	                      int stubbornness,
	                      Enums.Personality personality,
	                      Resources_Inventory inventory)
        : base(id,
		        name,
	            image,
		        gender,
		        home,
	            money,
	            income,
		        expenses,
	            strength,
	            inventory)
    {
        _respect = respect;
        _fear = fear;
        _greed = greed;
        _integrity = integrity;
        _stubbornness = stubbornness;
        _personality = personality;

        UpdateAttitude();
    }
    public Resources_NPC(string id,
                         string name,
                         string image,
                         Enums.Gender gender,
                         Resources_Building home,
                         int money,
                         int income,
                         int expenses,
                         int strength,
                         int respect,
                         int fear,
                         int greed,
                         int integrity,
                         int stubbornness,
                         Enums.Personality personality,
                         Resources_Inventory inventory)
        : base(id,
               name,
               image,
               gender,
               home,
               money,
               income,
               expenses,
               strength,
               inventory)
    {
        _respect      = respect;
        _fear         = fear;
        _greed        = greed;
        _integrity    = integrity;
        _stubbornness = stubbornness;
        _personality  = personality;

        UpdateAttitude();
    }
 public static void NewBuilding(Resources_Building value)
 {
     if (IDIsUnique (value.id)) {
         _buildings.Add (value);
         _referenceIDs.Add (value);
     } else {
         Debug.LogError ("Attempted to create a building with the existing ID '" + value.id + "'."); }
 }