playereffects.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. playereffects.register_effect_type("slow_dig", "Slow dig", "physio_stress_exhaust_16", {"dig"},
  2. function(player)
  3. physio_stress.exhausted_dig[player:get_player_name()]=3
  4. end,
  5. function(effect, player)
  6. physio_stress.exhausted_dig[player:get_player_name()]=nil
  7. end
  8. )
  9. playereffects.register_effect_type("slow_build", "Slow build", "physio_stress_exhaust_16", {"build"},
  10. function(player)
  11. physio_stress.exhausted_build[player:get_player_name()]=3
  12. end,
  13. function(effect, player)
  14. physio_stress.exhausted_build[player:get_player_name()]=nil
  15. end
  16. )
  17. playereffects.register_effect_type("exhausted", "Exhausted", "physio_stress_exhaust_16.png", {"exhaust"},
  18. function(player)
  19. physio_stress.exhausted_build[player:get_player_name()]=3
  20. physio_stress.exhausted_dig[player:get_player_name()]=3
  21. player:set_physics_override(0.5,nil,nil)
  22. end,
  23. function(effect, player)
  24. physio_stress.exhausted_build[player:get_player_name()]=nil
  25. physio_stress.exhausted_dig[player:get_player_name()]=nil
  26. player:set_physics_override(1,nil,nil)
  27. end
  28. )
  29. -- based on examples.lua out of playereffects mod
  30. -- Slows the user down
  31. playereffects.register_effect_type("low_speed", "Low speed", "physio_stress_exhaust_16.png", {"speed"},
  32. function(player)
  33. player:set_physics_override(0.25,nil,nil)
  34. end,
  35. function(effect, player)
  36. player:set_physics_override(1,nil,nil)
  37. end
  38. )
  39. -- Repeating effect type: Adds 1 HP per second
  40. playereffects.register_effect_type("regen", "Regeneration", "heart.png", {"health"},
  41. function(player)
  42. player:set_hp(player:get_hp()+1)
  43. end,
  44. nil, nil, nil, 1
  45. )