Skip to content

Commit

Permalink
Added stats_system.gif
Browse files Browse the repository at this point in the history
  • Loading branch information
Sweattypalms committed Aug 31, 2024
1 parent 723a40a commit 7d3abc5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@

## Why This Project Exists

I am a high school student deeply passionate about programming. Two years ago, I embarked on the journey of developing an early version of this plugin, which became instrumental in sharpening my programming skills. By open-sourcing this project, I aim to give back to the community. I believe that aspiring developers, just like I once was, can utilize this material as a valuable resource for learning and experimentation.
I'm a high school kid, and I really enjoy programming, like you can make anything you want.
I got a taste of that when I started developing this plugin two years ago. It was pretty basic back then,
but man, did it help me get good at programming, design patterns, efficient code, maths, everything.
I feel like it would've helped me a lot if there were projects that I could've taken inspiration from,
so I'm putting this out there so someone on the same path can benefit a lot from this.
This is my way of paying it back, y'know. Enjoy!

## Features

<details>
<details open>
<summary>Click to expand</summary>

### Player Features

- **Stats System:** Complete stat system.
![Stats System](/README/assets/gameplay/stats_system.gif)
- **Slayers (W.I.P):** Start quests and defeat bosses.
- **Skills (W.I.P):** Progress and develop your player skills.
- **Items System:** Dynamic system for in-game items.
- **Regions:** Explore different areas and regions.
- **Scoreboard (W.I.P):** See objectives, your balance and quests.
- **Scoreboard:** See objectives, your balance and quests.
- **Mobs System:** Engage with various in-game creatures.
- **Ender Dragon Fight:** Battle the mighty Ender Dragon! Altar system with Custom Dragon Pathfinding + Dragon egg animation.

Expand Down
Binary file added README/assets/gameplay/stats_system.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README/assets/gameplay/stats_system.mp4
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.ChatColor;

import static com.sweattypalms.skyblock.core.helpers.PlaceholderFormatter.formatDecimalCSV;
import static com.sweattypalms.skyblock.core.helpers.PlaceholderFormatter.formatDouble;

public class ActionBarManager extends PlayerManager {
Expand All @@ -34,10 +35,10 @@ private String getHealthComponent() {
StatsManager statsManager = this.skyblockPlayer.getStatsManager();
double absorption = statsManager.getMaxStat(Stats.ABSORPTION);
double maxHealth = statsManager.getMaxStat(Stats.HEALTH);
String healthString = formatDouble(maxHealth);
String healthString = formatDecimalCSV(maxHealth);
double currentHealth = this.skyblockPlayer.getPlayer().getHealth();
if (currentHealth > maxHealth) currentHealth = maxHealth;
String currentHealthString = formatDouble(currentHealth + absorption);
String currentHealthString = formatDecimalCSV(currentHealth + absorption);

ChatColor color = absorption > 0 ? ChatColor.GOLD : ChatColor.RED;
return color + Stats.HEALTH.getSymbol() + " " + currentHealthString + " / " + healthString;
Expand All @@ -46,16 +47,16 @@ private String getHealthComponent() {
private String getDefenceComponent() {
double maxDefence = this.skyblockPlayer.getStatsManager().getMaxStats().get(Stats.DEFENSE);
if (maxDefence == 0) return "";
String defenceString = formatDouble(maxDefence);
String defenceString = formatDecimalCSV(maxDefence);
return ChatColor.GREEN + Stats.DEFENSE.getSymbol() + " " + defenceString;
}

private String getIntelligenceComponent() {
double maxIntelligence = this.skyblockPlayer.getStatsManager().getMaxStats().get(Stats.INTELLIGENCE);
String intelligenceString = formatDouble(maxIntelligence);
String intelligenceString = formatDecimalCSV(maxIntelligence);
double currentIntelligence = this.skyblockPlayer.getStatsManager().getLiveStats().get(Stats.INTELLIGENCE);
if (currentIntelligence > maxIntelligence) currentIntelligence = maxIntelligence;
String currentIntelligenceString = formatDouble(currentIntelligence);
String currentIntelligenceString = formatDecimalCSV(currentIntelligence);

return ChatColor.AQUA + Stats.INTELLIGENCE.getSymbol() + " " + currentIntelligenceString + " / " + intelligenceString;
}
Expand Down

0 comments on commit 7d3abc5

Please sign in to comment.