Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. Game.GetPlayer().RemovePerk(perkWaterRepeat)
  2. Utility.Wait(10)
  3. int iWater = Game.GetPlayer().GetValue(avWater) as int
  4. int iFirstAid = Game.GetPlayer().GetValue(avFirstAid) as int
  5. if (iWater == 1 || iFirstAid == 1)
  6. int iWaterThirst = Game.GetPlayer().GetValue(avWaterThirst) as int
  7. int iRads = Game.GetPlayer().GetValue(avRads) as int
  8. Game.GetPlayer().SetValue(avWaterThirst, (iWaterThirst+1))
  9. if (iRads > 0 && iFirstAid == 1 )
  10. if (iWaterThirst == 30 || iWaterThirst == 60 || iWaterThirst == 90 || iWaterThirst == 120 || iWaterThirst == 150 || iWaterThirst == 180)
  11. Debug.Trace(iRads + " - Old Value")
  12. Game.GetPlayer().RestoreValue(avRads, 10)
  13. iRads = Game.GetPlayer().GetValue(avRads) as int
  14. Debug.Trace(iRads + " - New Value Restored 5")
  15. endif
  16. endif
  17. if (iWaterThirst >= 180)
  18. int iThirst = Game.GetPlayer().GetValue(avThirst) as int
  19. iRads = Game.GetPlayer().GetValue(avRads) as int
  20. Debug.Trace(iThirst + " - Thirst")
  21. Debug.Trace(iRads + " - Rads")
  22. Utility.Wait(2)
  23. if (iThirst > 0 && iRads > 0 && iWater == 1 && iFirstAid == 1)
  24. Game.GetPlayer().SetValue(avWaterThirst, 0)
  25. Game.GetPlayer().RestoreValue(avRads, 20)
  26. Game.GetPlayer().SetValue(avThirst, (iThirst-1))
  27. Game.GetPlayer().RestoreValue(avHealth, 20)
  28. sndDrink.Play(Game.GetPlayer())
  29. msgWater.Show()
  30. elseif (iRads > 0 && iWater == 0 && iFirstAid == 1)
  31. Game.GetPlayer().SetValue(avWaterThirst, 0)
  32. Debug.Trace(iRads + " - Old Value")
  33. Game.GetPlayer().RestoreValue(avRads, 10)
  34. iRads = Game.GetPlayer().GetValue(avRads) as int
  35. Debug.Trace(iRads + " - New Value")
  36. elseif (iThirst > 0 && iWater == 1 && iFirstAid == 0)
  37. sndDrink.Play(Game.GetPlayer())
  38. msgWater.Show()
  39. Game.GetPlayer().SetValue(avThirst, (iThirst-1))
  40. Game.GetPlayer().RestoreValue(avHealth, 20)
  41. Game.GetPlayer().SetValue(avWaterThirst, 0)
  42. elseif (iThirst > 0 && iRads == 0 && iWater == 1 && iFirstAid == 1)
  43. sndDrink.Play(Game.GetPlayer())
  44. msgWater.Show()
  45. Game.GetPlayer().SetValue(avThirst, (iThirst-1))
  46. Game.GetPlayer().RestoreValue(avHealth, 20)
  47. Game.GetPlayer().SetValue(avWaterThirst, 0)
  48. else
  49. Debug.Trace("0 Rads and 0 Thirst. Set timer to -5.")
  50. Game.GetPlayer().SetValue(avWaterThirst, (iWaterThirst-5))
  51. endif
  52. endIf
  53. Debug.Trace(iWaterThirst)
  54. endif
  55. Game.GetPlayer().AddPerk(perkWaterRepeat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement