Sign in to follow this  
Zekezor

Artifact power messages

Recommended Posts

I suggest the artifact recharge messages are tweaked acording to the new max recharge limit ingame to allow kingdoms to get a better grasp at how urgently they need to recharge.

Currently the game only has 3 states for artifacts.

Lets change that into all 6. One message per 5 charge intervall.

 

Current code:

>100 charge = It emits a huge sense of power.

>70 = It emits a strong sense of power.

>40 = It emits a fair sense of power.

>20 = It emits some sense of power. It will need to be recharged at the huge altar eventually.

>10 = It emits a weak sense of power. It will need to be recharged at the huge altar soon.

<=10 = It emits almost no sense of power. It will need to be recharged at the huge altar immediately or it will disappear.

 

HOWEVER

We can only charge to 30 now.

 

Sooooo, lets adjust this.

 

>=25 = It emits a huge sense of power.

>=20 = It emits a strong sense of power.

>=15 = It emits a fair sense of power.

>=10 = It emits some sense of power. It will need to be recharged at the huge altar eventually.

>=5 = It emits a weak sense of power. It will need to be recharged at the huge altar soon.

<5 = It emits almost no sense of power. It will need to be recharged at the huge altar immediately or it will disappear.

 

TLDR:

One message for every 5-charge intervall for artifacts.

 

 

 

For devs:

Line 9064 to 9093 of Item.class

 

 if (ArtifactBehaviour.mayUseItem(this, null))
      {
        if (this.auxbyte >= 25) {
          toReturn = toReturn + " It emits a huge sense of power.";
        } else if (this.auxbyte >= 20) {
          toReturn = toReturn + " It emits a strong sense of power.";
        } else if (this.auxbyte >= 15) {
          toReturn = toReturn + " It emits a fair sense of power.";
        } else if (this.auxbyte >= 10) {
          toReturn = toReturn + " It emits some sense of power. It will need to be recharged at the huge altar eventually.";
        } else if (this.auxbyte >= 5) {
          toReturn = toReturn + " It emits a weak sense of power. It will need to be recharged at the huge altar soon.";
        } else {
          toReturn = toReturn + " It emits almost no sense of power. It will need to be recharged at the huge altar immediately or it will disappear.";
        }
      }
      else
      {
        toReturn = toReturn + " It seems dormant";
        if (this.auxbyte >= 25) {
          toReturn = toReturn + " but emits a huge sense of power.";
        } else if (this.auxbyte >= 20) {
          toReturn = toReturn + " but emits a strong sense of power.";
        } else if (this.auxbyte >= 15) {
          toReturn = toReturn + " and emits a fair sense of power.";
        } else if (this.auxbyte >= 10) {
          toReturn = toReturn + " and emits some sense of power. It will need to be recharged at the huge altar eventually.";
        } else if (this.auxbyte >= 5) {
          toReturn = toReturn + " and emits a weak sense of power. It will need to be recharged at the huge altar soon.";
        } else {
          toReturn = toReturn + " and emits almost no sense of power. It will need to be recharged at the huge altar immediately or it will disappear.";
        }

  • Like 3

Share this post


Link to post
Share on other sites

+1, honestly should've been implemented when the changes to artifacts were made.


Share this post


Link to post
Share on other sites

I dunno,  looks hard to do, especially with the code given and all. 

 

+1

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the tip :)

 

Instead of basing it on 30, I'm going to pull from the constant that controls maxCharges and use that to create a percentage. In this way, the existing code will still work as it starts at 100, but it will now use all of the messages and will do so regardless of what charges are set to in the future.

 

Something like

final int powerPercent = (int)((auxbyte / HugeAltarBehaviour.maxCharges) * 100);

 

I just need to test to make sure this works as expected.

 

Also, something to keep in mind when you're trying to point out a specific spot in code - variable names and strings help more than line numbers. Decompilers don't always arrange code in the same order as the source. They also don't show constants that are being used (for example, the hard-coded numbers above are actually a constant). 

Share this post


Link to post
Share on other sites
1 hour ago, Keenan said:

Also, something to keep in mind when you're trying to point out a specific spot in code - variable names and strings help more than line numbers. Decompilers don't always arrange code in the same order as the source. They also don't show constants that are being used (for example, the hard-coded numbers above are actually a constant). 

 

Why would it matter?

it's been over a month. they got no plan to change anything.

Wouldn't be supprised if they havn't even read the thread.

And it's even sader if they did, becouse that would show they truly dont care.

 

This is a 5 min fix and all the code was supplied...

Edited by Zekezor

Share this post


Link to post
Share on other sites
Just now, Zekezor said:

 

Why would it matter?

it's been over a month. they got no plan to change anything.

Wouldn't be supprised if they havn't even read the thread.

And it's even sader if they did, becouse that would show they truly dont care.

 

I read it, doesn't that count?

 

I'll be testing the change after Thanksgiving stuff and see about pushing it for the next update. :)

Share this post


Link to post
Share on other sites

Keenan has done more work fixing bugs and stuff this month than anyone else has done in the last year, props to him! and he listens!

Edited by PassiveMiniroll

Share this post


Link to post
Share on other sites

The "power" message is now based on a percentage of remaining charges. So this will change when used and on decay ticks. Keep in mind that the range is rather small since they have a max of 30 charges.

I added one message, the top one, which you'll only ever see right after a recharge. Basically did this to achieve what was originally suggested, which would be a new message after every ~5 charges. It works out to be every 17%, which is pretty close. :)To get a better idea of the charges left, simply move the decimal to in front of the percentage and times the max charges by that.

Example: 32% = .32, 30 * .32 = 9.6. so ~ 10 charges.

 

"It emits an enormous sense of power." 100%
"It emits a huge sense of power." 83% - 99%
"It emits a strong sense of power." 66% - 82%
"It emits a fair sense of power." 49% - 65%
"It emits some sense of power." 32% - 48%
"It emits a weak sense of power." 15% - 31%
"It emits almost no sense of power." 0% - 14%
 

Recharge messages are now based on the number of decay ticks remaining.
"It will need to be recharged at the huge altar eventually." - 2 more decay ticks until 0.
"It will need to be recharged at the huge altar soon." - 1 more tick until 0.
"It will need to be recharged at the huge altar immediately or it will disappear." - Charges are now 0 (or less than 0) so the next decay tick will make the item disappear.

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this