catchyielditembase.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. class YieldItemBase
  2. {
  3. protected string m_Type;
  4. protected int m_RegistrationIdx = -1; //mostly for sync purposes
  5. protected int m_BaseWeight; //occurence ratio in the enviroment
  6. protected float m_QualityBase = AnimalCatchingConstants.QUALITY_GENERIC_BASE;
  7. protected int m_EnviroMask; //which enviroment it is relevant for
  8. protected int m_MethodMask; //which catching method are we using
  9. //protected ref m_BaitCompatibilityMask; //which baits are relevant for me
  10. void YieldItemBase(int baseWeight)
  11. {
  12. m_BaseWeight = baseWeight;
  13. Init();
  14. }
  15. void Init();
  16. string GetType()
  17. {
  18. return m_Type;
  19. }
  20. int GetRegistrationIdx()
  21. {
  22. return m_RegistrationIdx;
  23. }
  24. void SetRegistrationIdx(int idx)
  25. {
  26. if (m_RegistrationIdx == -1)
  27. m_RegistrationIdx = idx;
  28. else
  29. ErrorEx("m_RegistrationIdx already set for " + this);
  30. }
  31. int GetYieldWeight(CatchingContextBase ctx)
  32. {
  33. return m_BaseWeight;
  34. }
  35. int GetEnviroMask()
  36. {
  37. return m_EnviroMask;
  38. }
  39. int GetMethodMask()
  40. {
  41. return m_MethodMask;
  42. }
  43. float GetBaitTypeSensitivity(ECatchingBaitCategories type)
  44. {
  45. return 1.0;
  46. }
  47. float GetQualityForYieldItem(CatchingContextBase ctx)
  48. {
  49. float res = m_QualityBase;
  50. res += ctx.GetQualityModifier();
  51. return res;
  52. }
  53. float GetChanceForYieldItem(CatchingContextBase ctx)
  54. {
  55. float ret = 1.0;
  56. //ctx.UpdateBaseProbability(this);
  57. ctx.ModifySignalProbability(ret);
  58. return ret;
  59. }
  60. ////////////////
  61. //effects info
  62. //////////////
  63. string GetCatchDeathSoundset()
  64. {
  65. return "";
  66. }
  67. string GetCatchAINoise()
  68. {
  69. return "";
  70. }
  71. float GetCatchAINoiseBaseStrength()
  72. {
  73. return 1.0;
  74. }
  75. int GetCatchParticleID()
  76. {
  77. return ParticleList.INVALID;
  78. }
  79. }