88import net .minestom .server .item .Material ;
99import net .swofty .commons .StringUtility ;
1010import net .swofty .commons .skyblock .item .ItemType ;
11+ import net .swofty .commons .skyblock .statistics .ItemStatistic ;
1112import net .swofty .type .generic .gui .inventory .ItemStackCreator ;
1213import net .swofty .type .generic .gui .inventory .HypixelInventoryGUI ;
1314import net .swofty .type .generic .gui .inventory .item .GUIClickableItem ;
15+ import net .swofty .type .skyblockgeneric .item .SkyBlockItem ;
1416import net .swofty .type .skyblockgeneric .user .SkyBlockPlayer ;
1517import net .swofty .type .generic .user .HypixelPlayer ;
1618
19+ import java .util .List ;
20+
1721public class GUISeymour extends HypixelInventoryGUI {
22+ private final List <SkyBlockItem > cheapTuxedoSet = List .of (
23+ new SkyBlockItem (ItemType .CHEAP_TUXEDO_CHESTPLATE ),
24+ new SkyBlockItem (ItemType .CHEAP_TUXEDO_LEGGINGS ),
25+ new SkyBlockItem (ItemType .CHEAP_TUXEDO_BOOTS )
26+ );
27+
28+ private final List <SkyBlockItem > fancyTuxedoSet = List .of (
29+ new SkyBlockItem (ItemType .FANCY_TUXEDO_CHESTPLATE ),
30+ new SkyBlockItem (ItemType .FANCY_TUXEDO_LEGGINGS ),
31+ new SkyBlockItem (ItemType .FANCY_TUXEDO_BOOTS )
32+ );
33+
34+ private final List <SkyBlockItem > elegantTuxedoSet = List .of (
35+ new SkyBlockItem (ItemType .ELEGANT_TUXEDO_CHESTPLATE ),
36+ new SkyBlockItem (ItemType .ELEGANT_TUXEDO_LEGGINGS ),
37+ new SkyBlockItem (ItemType .ELEGANT_TUXEDO_BOOTS )
38+ );
39+
40+ private final double cheapTuxedoPrice = 3_000_000 ;
41+ private final double fancyTuxedoPrice = 20_000_000 ;
42+ private final double elegantTuxedoPrice = 74_999_999 ;
43+
44+ private final double cheapTuxedoCritDamage = cheapTuxedoSet .stream ()
45+ .mapToDouble (item -> item .getAttributeHandler ().getStatistics ().getOverall (ItemStatistic .CRIT_DAMAGE ))
46+ .sum ();
47+ private final double fancyTuxedoCritDamage = cheapTuxedoSet .stream ()
48+ .mapToDouble (item -> item .getAttributeHandler ().getStatistics ().getOverall (ItemStatistic .CRIT_DAMAGE ))
49+ .sum ();
50+ private final double elegantTuxedoCritDamage = cheapTuxedoSet .stream ()
51+ .mapToDouble (item -> item .getAttributeHandler ().getStatistics ().getOverall (ItemStatistic .CRIT_DAMAGE ))
52+ .sum ();
53+
54+ private final double cheapTuxedoIntelligence = cheapTuxedoSet .stream ()
55+ .mapToDouble (item -> item .getAttributeHandler ().getStatistics ().getOverall (ItemStatistic .INTELLIGENCE ))
56+ .sum ();
57+ private final double fancyTuxedoIntelligence = cheapTuxedoSet .stream ()
58+ .mapToDouble (item -> item .getAttributeHandler ().getStatistics ().getOverall (ItemStatistic .INTELLIGENCE ))
59+ .sum ();
60+ private final double elegantTuxedoIntelligence = cheapTuxedoSet .stream ()
61+ .mapToDouble (item -> item .getAttributeHandler ().getStatistics ().getOverall (ItemStatistic .INTELLIGENCE ))
62+ .sum ();
63+
1864 public GUISeymour () {
1965 super ("Seymour's Fancy Suits" , InventoryType .CHEST_4_ROW );
2066 }
@@ -23,21 +69,16 @@ public void onOpen(InventoryGUIOpenEvent e) {
2369 fill (ItemStackCreator .createNamedItemStack (Material .BLACK_STAINED_GLASS_PANE ));
2470 set (GUIClickableItem .getCloseItem (31 ));
2571
26- double cheapTuxedoPrice = 3000000 ;
27- double fancyTuxedoPrice = 20000000 ;
28- double elegantTuxedoPrice = 74999999 ;
29-
3072 set (new GUIClickableItem (11 ) {
3173 @ Override
3274 public void run (InventoryPreClickEvent e , HypixelPlayer p ) {
3375 SkyBlockPlayer player = (SkyBlockPlayer ) p ;
3476 double coins = player .getCoins ();
3577 if (coins < cheapTuxedoPrice ) {
78+ player .sendMessage ("§cYou don't have enough coins!" );
3679 return ;
3780 }
38- player .addAndUpdateItem (ItemType .CHEAP_TUXEDO_CHESTPLATE );
39- player .addAndUpdateItem (ItemType .CHEAP_TUXEDO_BOOTS );
40- player .addAndUpdateItem (ItemType .CHEAP_TUXEDO_LEGGINGS );
81+ cheapTuxedoSet .forEach (player ::addAndUpdateItem );
4182 player .playSuccessSound ();
4283 player .removeCoins (cheapTuxedoPrice );
4384 }
@@ -48,8 +89,8 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
4889 ItemStack .Builder builder = ItemStackCreator .getStack ("§5Cheap Tuxedo" , Material .LEATHER_CHESTPLATE , 1 ,
4990 "" ,
5091 "§8Complete suit" ,
51- "§7Crit Damage: §c+100 %" ,
52- "§7Intelligence: §a+100" ,
92+ "§7Crit Damage: §c+" + ( int ) cheapTuxedoCritDamage + " %" ,
93+ "§7Intelligence: §a+" + ( int ) cheapTuxedoIntelligence ,
5394 "" ,
5495 "§6Full Set Bonus: Dashing §7(0/3)" ,
5596 "§7Max Health set to §c75♥§7." ,
@@ -72,11 +113,10 @@ public void run(InventoryPreClickEvent e, HypixelPlayer p) {
72113 SkyBlockPlayer player = (SkyBlockPlayer ) p ;
73114 double coins = player .getCoins ();
74115 if (coins < fancyTuxedoPrice ) {
116+ player .sendMessage ("§cYou don't have enough coins!" );
75117 return ;
76118 }
77- player .addAndUpdateItem (ItemType .FANCY_TUXEDO_CHESTPLATE );
78- player .addAndUpdateItem (ItemType .FANCY_TUXEDO_BOOTS );
79- player .addAndUpdateItem (ItemType .FANCY_TUXEDO_LEGGINGS );
119+ fancyTuxedoSet .forEach (player ::addAndUpdateItem );
80120 player .playSuccessSound ();
81121 player .removeCoins (fancyTuxedoPrice );
82122 }
@@ -87,8 +127,8 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
87127 ItemStack .Builder builder = ItemStackCreator .getStack ("§6Fancy Tuxedo" , Material .LEATHER_CHESTPLATE , 1 ,
88128 "" ,
89129 "§8Complete suit" ,
90- "§7Crit Damage: §c+150 %" ,
91- "§7Intelligence: §a+300" ,
130+ "§7Crit Damage: §c+" + ( int ) fancyTuxedoCritDamage + " %" ,
131+ "§7Intelligence: §a+" + ( int ) fancyTuxedoIntelligence ,
92132 "" ,
93133 "§6Full Set Bonus: Dashing §7(0/3)" ,
94134 "§7Max Health set to §c150♥§7." ,
@@ -112,11 +152,10 @@ public void run(InventoryPreClickEvent e, HypixelPlayer p) {
112152 SkyBlockPlayer player = (SkyBlockPlayer ) p ;
113153 double coins = player .getCoins ();
114154 if (coins < elegantTuxedoPrice ) {
155+ player .sendMessage ("§cYou don't have enough coins!" );
115156 return ;
116157 }
117- player .addAndUpdateItem (ItemType .ELEGANT_TUXEDO_CHESTPLATE );
118- player .addAndUpdateItem (ItemType .ELEGANT_TUXEDO_BOOTS );
119- player .addAndUpdateItem (ItemType .ELEGANT_TUXEDO_LEGGINGS );
158+ elegantTuxedoSet .forEach (player ::addAndUpdateItem );
120159 player .playSuccessSound ();
121160 player .removeCoins (elegantTuxedoPrice );
122161 }
@@ -127,8 +166,8 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
127166 ItemStack .Builder builder = ItemStackCreator .getStack ("§6Elegant Tuxedo" , Material .LEATHER_CHESTPLATE , 1 ,
128167 "" ,
129168 "§8Complete suit" ,
130- "§7Crit Damage: §c+200 %" ,
131- "§7Intelligence: §a+500" ,
169+ "§7Crit Damage: §c+" + ( int ) elegantTuxedoCritDamage + " %" ,
170+ "§7Intelligence: §a+" + ( int ) elegantTuxedoIntelligence ,
132171 "" ,
133172 "§6Full Set Bonus: Dashing §7(0/3)" ,
134173 "§7Max Health set to §c1250♥§7." ,
0 commit comments