toolbase.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. //! If used to un/lock doors, which does it open. Bitwise.
  9. int GetKeyCompatibilityType()
  10. {
  11. //you can combine the bit values like so:
  12. //return (1 << EBuildingLockType.LOCKPICK) | (1 << EBuildingLockType.SHIP_CONTAINER_1);
  13. return EBuildingLockType.NONE; //pure '0'
  14. }
  15. int GetDisarmRate()
  16. {
  17. return m_MineDisarmRate;
  18. }
  19. override void OnRPC(PlayerIdentity sender, int rpc_type,ParamsReadContext ctx)
  20. {
  21. super.OnRPC(sender, rpc_type,ctx);
  22. switch(rpc_type)
  23. {
  24. case PlantType.TREE_HARD:
  25. SoundHardTreeFallingPlay();
  26. break;
  27. case PlantType.TREE_SOFT:
  28. SoundSoftTreeFallingPlay();
  29. break;
  30. case PlantType.BUSH_HARD:
  31. SoundHardBushFallingPlay();
  32. break;
  33. case PlantType.BUSH_SOFT:
  34. SoundSoftBushFallingPlay();
  35. break;
  36. }
  37. }
  38. }