Advertisement
CREAMPAN0408

Untitled

Apr 19th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. on rightclick on anvil:
  2. block under the event-block is obsidian block
  3. cancel event
  4. if player's tool is sword:
  5. if {tool.%player%} is set:
  6. message "<pink>既に剣がセットされています"
  7. stop
  8. set {tool.%player%} to player's tool
  9. delete player's tool
  10. else if player's tool is a charcoal or a coal item:
  11. if {tool.%player%} is not set:
  12. message "<pink>剣がセットされていません"
  13. stop
  14. if lore of {tool.%player%} doesn't contain "-AttackBonus:":
  15. if lore of {tool.%player%} is "":
  16. set lore of {tool.%player%} to "-AttackBonus:0%%"
  17. else:
  18. set lore of {tool.%player%} to "%lore of {tool.%player%}%||-AttackBonus:0%%"
  19. if player's tool is a charcoal:
  20. set {_up} to 3
  21. else if player's tool is a coal item:
  22. set {_up} to 5
  23. remove 1 of player's tool from player
  24. while true:
  25. add 1 to {_line}
  26. set {_lore} to line {_line} of lore of {tool.%player%}
  27. if {_lore} is not set:
  28. exit 2 sections
  29. add {_lore} to {_lore::*}
  30. delete {_lore}
  31. loop {_lore::*}:
  32. add 1 to {_inx}
  33. if the first index of "-AttackBonus:" in loop-value is not -1:
  34. set {_number} to (subtext of loop-value from 14 to length of loop-value) parsed as number
  35. add {_up} to {_number}
  36. set line {_inx} of lore of {tool.%player%} to "-AttackBonus:%{_number}%"
  37. message "<red>強化後→-AttackBonus:%{_number}%"
  38. else if player's tool is air block:
  39. give {tool.%player%} to player
  40. delete {tool.%player%}
  41. else:
  42. if {tool.%player%} is set:
  43. message "<pink>既に剣がセットされています"
  44. stop
  45. message "<pink>剣以外は強化できません"
  46.  
  47. on damage:
  48. {AttackBonus.%attacker%} is set
  49. set damage to damage * (100+{AttackBonus.%attacker%})/100
  50.  
  51. on tool change:
  52. delete {AttackBonus.%player%}
  53. lore of player's tool is set
  54. while true:
  55. add 1 to {_line}
  56. set {_lore} to line {_line} of lore of player's tool
  57. if {_lore} is not set:
  58. exit 2 sections
  59. add {_lore} to {_lore::*}
  60. delete {_lore}
  61. loop {_lore::*}:
  62. add 1 to {_inx}
  63. if the first index of "-AttackBonus:" in loop-value is not -1:
  64. set {_number} to (subtext of loop-value from 14 to length of loop-value) parsed as number
  65. set {AttackBonus.%player%} to {_number}
  66. if {AttackBonus.%player%} is set:
  67. message "<lime>攻撃力ボーナス:%{AttackBonus.%player%}%%%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement