player.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. core.register_item(':', {
  2. type = 'none',
  3. wield_image = 'wieldhand.png',
  4. wield_scale = {x=1,y=1,z=2.5},
  5. range = 15,
  6. tool_capabilities = {
  7. full_punch_interval = 0.9,
  8. max_drop_level = 0,
  9. groupcaps = {
  10. oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
  11. },
  12. damage_groups = {fleshy=1},
  13. }
  14. })
  15. core.register_on_newplayer(function(player)
  16. local player_inv = player:get_inventory()
  17. local player_name = player:get_player_name()
  18. local resources = {}
  19. player_inv:add_item('main', {name='kobo:base'})
  20. resources.food = 100
  21. resources.lumber = 100
  22. resources.stone = 10
  23. resources.metal = 10
  24. resources.xp = 0
  25. resources.research = 100
  26. resources.last_stone = {}
  27. resources.last_metal = {}
  28. kobo.resources[player_name] = resources
  29. end)
  30. core.register_on_joinplayer(function(player)
  31. player:set_properties({
  32. eye_height = 5.5,
  33. collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.75, 0.3},
  34. stepheight = 1.01,
  35. })
  36. local player_inv = player:get_inventory()
  37. player_inv:set_size('hand', 1)
  38. player_inv:set_size('main', 8)
  39. core.chat_send_player(player:get_player_name(), 'Turn on the minimap. Square mode recommended.')
  40. end)