toolbase.c 774 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //TODO trees are static objects, there is no script event for playing sounds on clients when they are chopped down.
  2. class ToolBase extends ItemBase
  3. {
  4. protected int m_MineDisarmRate = 60; //Success rate when disarming with this tool
  5. void ToolBase()
  6. {
  7. }
  8. int GetDisarmRate()
  9. {
  10. return m_MineDisarmRate;
  11. }
  12. override void OnRPC(PlayerIdentity sender, int rpc_type,ParamsReadContext ctx)
  13. {
  14. super.OnRPC(sender, rpc_type,ctx);
  15. switch(rpc_type)
  16. {
  17. case PlantType.TREE_HARD:
  18. SoundHardTreeFallingPlay();
  19. break;
  20. case PlantType.TREE_SOFT:
  21. SoundSoftTreeFallingPlay();
  22. break;
  23. case PlantType.BUSH_HARD:
  24. SoundHardBushFallingPlay();
  25. break;
  26. case PlantType.BUSH_SOFT:
  27. SoundSoftBushFallingPlay();
  28. break;
  29. }
  30. }
  31. }