Skip to content

Commit

Permalink
Added Hyperion with ShadowWarp. And some interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweattypalms committed Aug 27, 2024
1 parent 0b2cb03 commit 00cfdc9
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public List<String> exampleTabCompleter(Player player, String[] args) {
```java
Hologram hologram = new Hologram(
"Example Text",
new Location(Bukkit.getWorld("world"), 0, 100,0),
)
new Location(Bukkit.getWorld("world"), 0, 100,0)
);
```
- **Event-Based System:** Harness the power of events for versatile gameplay elements.
```java
Expand Down Expand Up @@ -100,7 +100,7 @@ public class LightningChestplate extends SkyblockItem implements IHasAbility, ID
- **UI System:** Robust UI system with callback features for clickable items and static GUIs.
```java
public class TestGUI extends BaseGUI {
private static final int SIZE = 6 * 9 // 6 rows of 9 slots
private static final int SIZE = 6 * 9; // 6 rows of 9 slots

public TestGUI() {
super(SIZE, "Test GUI");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ public void mobCommand(Player player, String[] args) {

player.sendMessage(ChatColor.RED + "Successfully spawned: " + skyblockMob.getNameAttribute(NameAttributes.CUSTOM_NAME));
}
@TabCompleter(command = "mob")
public List<String> mobTabCompleter(Player player, String[] args) {
if (args.length > 1) {
return List.of();
}

if (args.length == 0) {
return MobManager.MOBS_LIST.keySet().stream().toList();
}

String id = args[0].toLowerCase();
return MobManager.MOBS_LIST.keySet().stream().filter(s -> s.startsWith(id)).toList();
}

@Command(name = "sitem", description = "Item command", op = true)
public void itemCommand(Player player, String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,5 @@ public SkyblockItem getFromVanillaItem(Material material) {
}

return null;
//
// SkyblockItem skyblockItem = SimpleSkyblockItem
// .builder()
// .material(material)
// .itemType(itemType)
// .
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.sweattypalms.skyblock.core.items.builder.abilities;

import java.util.List;

public interface ModifiableAbilities {
List<Ability> getPossibleAbilities();
void addAbility(Ability ability);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.sweattypalms.skyblock.core.items.builder.dungeon

interface Dungeonizeable {
fun canBeStarred(): Boolean
fun canBeMasterStarred(): Boolean
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.sweattypalms.skyblock.core.items.types.dungeon

import com.sweattypalms.skyblock.core.events.def.SkyblockInteractEvent
import com.sweattypalms.skyblock.core.items.builder.Rarity
import com.sweattypalms.skyblock.core.items.builder.SkyblockItem
import com.sweattypalms.skyblock.core.items.builder.SkyblockItemType
import com.sweattypalms.skyblock.core.items.builder.abilities.Ability
import com.sweattypalms.skyblock.core.items.builder.abilities.AbilityManager.TELEPORT_ABILITY
import com.sweattypalms.skyblock.core.items.builder.abilities.IHasAbility
import com.sweattypalms.skyblock.core.items.builder.abilities.types.ICooldown
import com.sweattypalms.skyblock.core.items.builder.abilities.types.ITriggerableAbility
import com.sweattypalms.skyblock.core.items.builder.abilities.types.IUsageCost
import com.sweattypalms.skyblock.core.player.SkyblockPlayer
import com.sweattypalms.skyblock.core.player.sub.stats.Stats
import org.bukkit.Material
import org.bukkit.event.Event

const val ID = "hyperion"
val STATS = mapOf(
Stats.DAMAGE to 260.0,
Stats.STRENGTH to 150.0
)

class Hyperion : SkyblockItem(
ID,
"Hyperion",
Material.IRON_SWORD,
null,
STATS,
Rarity.LEGENDARY,
SkyblockItemType.SWORD
), IHasAbility {

class ShadowWarp : TELEPORT_ABILITY(10), ICooldown {
override fun getName(): String {
return "Shadow Warp"
}

override fun getDescription(): MutableList<String> {
return mutableListOf(
"$7Creates a space distortion \$e10",
"$7blocks ahead of you that sucks all",
"$7enemies around it. Use this ability",
"$7again within \$e5$7 seconds to detonate",
"$7the warp and deal damage to enemies",
"$7near it."
)
}

override fun apply(event: Event) {
if (event !is SkyblockInteractEvent) return
if (super.isOnCooldown(event.skyblockPlayer)) return

super<ICooldown>.apply(event)
super<TELEPORT_ABILITY>.apply(event)
}

override fun getCooldown(skyblockPlayer: SkyblockPlayer?): Long = 10_000

override fun getCost(): MutableMap<Stats, Double> = mutableMapOf(
Stats.INTELLIGENCE to 300.0
)
}

override fun getAbilities(): MutableList<Ability> = mutableListOf(ShadowWarp())
}
7 changes: 7 additions & 0 deletions src/main/java/com/sweattypalms/skyblock/kotlin/Extensions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package com.sweattypalms.skyblock.kotlin

import com.sweattypalms.skyblock.core.player.SkyblockPlayer
import org.bukkit.Bukkit
import org.bukkit.entity.Player
import java.util.UUID

public fun Player.getSkyblockPlayer(): SkyblockPlayer {
return SkyblockPlayer.getSkyblockPlayer(this)
}

fun something(uuid: UUID) {
val bukkitPlayer = Bukkit.getPlayer(uuid)
bukkitPlayer?.getSkyblockPlayer()
}

0 comments on commit 00cfdc9

Please sign in to comment.