costumes.lua 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. -- Add Christmas Costumes.(Requires 3d Armor Mod by Stu)
  2. -- Mostly based on the costumes submodule in the mod "halloween" by GreenDiamond.
  3. -- Function for registering suits
  4. function christmas_holiday_pack.register(costume, nodename, def)
  5. if not def then
  6. def = {}
  7. end
  8. local gen_prev = "((([combine:16x32:-16,-12=christmas_holiday_pack_suit_" .. nodename .. ".png^[mask:mask_chest.png)^([combine:16x32:-36,-8=christmas_holiday_pack_suit_" .. nodename .. ".png^[mask:mask_head.png)^([combine:16x32:-44,-12=christmas_holiday_pack_suit_" .. nodename .. ".png^[mask:mask_arm.png^[transformFX)^([combine:16x32:-44,-12=christmas_holiday_pack_suit_" .. nodename .. ".png^[mask:mask_arm.png)^([combine:16x32:4,0=christmas_holiday_pack_suit_" .. nodename .. ".png^[mask:mask_leg.png^[transformFX)^([combine:16x32:4,0=christmas_holiday_pack_suit_" .. nodename .. ".png^[mask:mask_leg.png))^[resize:32x64)^[mask:mask_preview.png"
  9. local grouptypes = {
  10. ["suit"] = {armor_head=1, armor_torso=1, armor_legs=1, armor_feet=1, armor_use=1000},
  11. ["mask"] = {armor_head=1, armor_use=1000},
  12. ["shirt"] = {armor_torso=1, armor_use=1000},
  13. }
  14. local function is_type(key)
  15. return grouptypes[key] ~= nil
  16. end
  17. local grouptype = "suit"
  18. if def.type then
  19. if is_type(def.type) then
  20. grouptype = def.type
  21. end
  22. end
  23. local armor_groups = grouptypes[grouptype]
  24. local node_str = grouptype.."_"..nodename
  25. if def.name then
  26. node_str = def.name
  27. end
  28. armor:register_armor("christmas_holiday_pack:"..node_str, {
  29. description = costume,
  30. inventory_image = "inv_"..grouptype.."_"..nodename..".png",
  31. groups = armor_groups,
  32. on_equip = def.on_equip or nil,
  33. on_unequip = def.on_unequip or nil,
  34. on_destroy = def.on_destroy or nil,
  35. on_damage = def.on_damage or nil,
  36. on_punched = def.on_punched or nil,
  37. })
  38. local override_prev = gen_prev
  39. if def.preview then
  40. override_prev = def.preview
  41. end
  42. minetest.override_item("christmas_holiday_pack:"..node_str, {
  43. preview = override_prev
  44. })
  45. end
  46. -- Register Costumes
  47. christmas_holiday_pack.register("Orange Parka", "orange_parka")
  48. christmas_holiday_pack.register("Christmas Elf Costume", "elf")
  49. christmas_holiday_pack.register("Christmas Tree Costume", "tree")
  50. christmas_holiday_pack.register("Santa Claus Costume", "santa")
  51. -- Register Ugly Sweater
  52. christmas_holiday_pack.register("Ugly Christmas Sweater", "ugly_sweater", {
  53. type = "shirt",
  54. preview = "((([combine:16x32:-28,-12=christmas_holiday_pack_shirt_ugly_sweater.png^[mask:mask_chest.png)^([combine:16x32:-36,-8=christmas_holiday_pack_shirt_ugly_sweater.png^[mask:mask_head.png)^([combine:16x32:-52,-12=christmas_holiday_pack_shirt_ugly_sweater.png^[mask:mask_arm.png^[transformFX)^([combine:16x32:-52,-12=christmas_holiday_pack_shirt_ugly_sweater.png^[mask:mask_arm.png)^([combine:16x32:4,0=christmas_holiday_pack_shirt_ugly_sweater.png^[mask:mask_leg.png^[transformFX)^([combine:16x32:4,0=christmas_holiday_pack_shirt_ugly_sweater.png^[mask:mask_leg.png))^[resize:32x64)^[mask:mask_preview.png"
  55. })
  56. -- Register Santa Hat
  57. christmas_holiday_pack.register("Santa Hat", "santa_hat", {
  58. type = "mask",
  59. preview = "((([combine:16x32:-16,-12=christmas_holiday_pack_mask_santa_hat.png^[mask:mask_chest.png)^([combine:16x32:-36,-8=christmas_holiday_pack_mask_santa_hat.png^[mask:mask_head.png)^([combine:16x32:-44,-12=christmas_holiday_pack_mask_santa_hat.png^[mask:mask_arm.png^[transformFX)^([combine:16x32:-44,-12=christmas_holiday_pack_mask_santa_hat.png^[mask:mask_arm.png)^([combine:16x32:4,0=christmas_holiday_pack_mask_santa_hat.png^[mask:mask_leg.png^[transformFX)^([combine:16x32:4,0=christmas_holiday_pack_mask_santa_hat.png^[mask:mask_leg.png))^[resize:32x64)^[mask:mask_preview.png"
  60. })
  61. -- Register Green Santa Hat
  62. christmas_holiday_pack.register("Green Chritmas Hat", "green_santa_hat", {
  63. type = "mask",
  64. preview = "((([combine:16x32:-16,-12=christmas_holiday_pack_mask_green_santa_hat.png^[mask:mask_chest.png)^([combine:16x32:-36,-8=christmas_holiday_pack_mask_green_santa_hat.png^[mask:mask_head.png)^([combine:16x32:-44,-12=christmas_holiday_pack_mask_green_santa_hat.png^[mask:mask_arm.png^[transformFX)^([combine:16x32:-44,-12=christmas_holiday_pack_mask_green_santa_hat.png^[mask:mask_arm.png)^([combine:16x32:4,0=christmas_holiday_pack_mask_green_santa_hat.png^[mask:mask_leg.png^[transformFX)^([combine:16x32:4,0=christmas_holiday_pack_mask_green_santa_hat.png^[mask:mask_leg.png))^[resize:32x64)^[mask:mask_preview.png"
  65. })
  66. -- Register Red Poof Ball Hat
  67. christmas_holiday_pack.register("Red Poofball Hat", "red_poof_ball_hat", {
  68. type = "mask",
  69. preview = "((([combine:16x32:-16,-12=christmas_holiday_pack_mask_red_poof_ball_hat.png^[mask:mask_chest.png)^([combine:16x32:-36,-8=christmas_holiday_pack_mask_red_poof_ball_hat.png^[mask:mask_head.png)^([combine:16x32:-44,-12=christmas_holiday_pack_mask_red_poof_ball_hat.png^[mask:mask_arm.png^[transformFX)^([combine:16x32:-44,-12=christmas_holiday_pack_mask_red_poof_ball_hat.png^[mask:mask_arm.png)^([combine:16x32:4,0=christmas_holiday_pack_mask_red_poof_ball_hat.png^[mask:mask_leg.png^[transformFX)^([combine:16x32:4,0=christmas_holiday_pack_mask_red_poof_ball_hat.png^[mask:mask_leg.png))^[resize:32x64)^[mask:mask_preview.png"
  70. })