DevotedMC / Citadel

A Minecraft plugin to protect your chests and builds using in-game materials. Requires an attacker to break each block a certain number of times. Built for Spigot 1.14.4
https://www.devotedmc.com/citadel.html
BSD 3-Clause "New" or "Revised" License
2 stars 20 forks source link

Show maturity level #15

Open ProgrammerDan opened 8 years ago

ProgrammerDan commented 8 years ago

Optionally show # of breaks to destroyed? Not sure how much is too much. To start with just a text label. -- "Immature, Very Little Maturation, Some Maturation, Decent Maturation, Largely Matured, Fully Matured" -- corresponding to 0%, 10%, 25%, 50%, 75%, 100%"

Alternatively, time to maturity in minutes.

Alternatively, get rid of all these "intermediate" labels and construct a single "Current Strength: %" where we compute the effective strength of a reinforcement against max and project it.

How? Compute # of breaks needed to destroy the reinforcement. That divided by max health = current strength %.

So if we had a reinforcement that has a raw health of 1900 of 2000, and has a maturity of 10 minutes out of 100, w/ no decay, then we can compute that each hit causes 5 damage meaning 1900/5 breaks out of 2000 ideal breaks; (1900/5) / 2000 becomes our effective strength.

Diet-Cola commented 8 years ago

Are you looking to replace the % health with durability? I can probably do that unless you want to tie it in with the maturation display changes

ProgrammerDan commented 8 years ago

You largely did this one by adding the percentage; iirc the idea was to pull together the 3/4 statuses now into one "percentage" of health left.

Diet-Cola commented 8 years ago

I also wanted to fix the part where a percentage can sometimes be like "97.00000001%".

Would it be as simple as adding a .ToShort() on the end of getHealthText() here?

ProgrammerDan commented 8 years ago

Nah, use String.format("%4.1f" ) or equivalent here: https://github.com/DevotedMC/Citadel/blob/master/src/vg/civcraft/mc/citadel/reinforcement/PlayerReinforcement.java#L136