Learning000001

Untitled

Apr 29th, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using UnityEngine;
  4.  
  5. public enum FactionTrustLevel
  6. {
  7. NoContact, // No interaction prompt shown - level isn't high enough
  8. NoContactIKnowYou, // No interaction prompt shown - level isn't high enough but vouched for
  9. DontKnowYou, // Can press E, but NPC says "I don't know you" LEVEL is high enough no one vouched
  10. SkepticalBuyer, // Will reluctantly buy one small item (entry trust)
  11. ReliableContact,// Will regularly buy (medium trust)
  12. VouchedFor // Will vouch for you to other factions (high trust)
  13. }
  14.  
  15. [CreateAssetMenu(fileName = "NewFaction", menuName = "Buyer/Faction")]
  16. public class BuyerFaction : ScriptableObject
  17. {
  18. public string factionName;
  19. public string description;
  20. //public ReputationRank reputationLevel; // Optional: minimum rep level needed
  21. public BuyerProfile buyerProfile;
  22. public FactionTrustLevel currentTrustLevel = FactionTrustLevel.NoContact; // default
  23.  
  24. [Header("Trust Progression Settings")]
  25. public int trustPointsToReliableContact = 30; // Points needed to upgrade SkepticalBuyer → ReliableContact
  26. public int trustPointsToVouchedFor = 70; // Points needed to upgrade ReliableContact → VouchedFor
  27. public int vouchesRequiredToReachSkepticalBuyer = 10;
  28. public int currentVouches = 0;
  29. public List<BuyerFaction> factionsTheyWillVouchTo;
  30. [HideInInspector]
  31. public int currentTrustPoints; // Ongoing trust points earned
  32.  
  33. [Header("Sales Tracking")]
  34. [HideInInspector]
  35. public int totalGunsPurchased; // How many guns this faction has bought
  36.  
  37.  
  38. // ******************* proposed changes
  39. private static List<BuyerFaction> allFactions;
  40.  
  41. public static List<BuyerFaction> GetAll()
  42. {
  43. Init();
  44. return allFactions;
  45. }
  46.  
  47. private static void Init()
  48. {
  49. if (allFactions!=null)
  50. {
  51. return;
  52. }
  53.  
  54. allFactions = Resources.LoadAll<BuyerFaction>("BuyerProfiles").ToList();
  55. }
  56.  
  57. // ******************
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment