Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Could I...
#26
I think the calculation for Max HP is (STR + DEF) / 2

Do note that if you wish to make STR or DEF beyond 255, you'll have to change the variables to Integers instead of Bytes
Reply
#27
So how would it be set up in the code? I'm still confused on that part...I understand why the below code works, but how would I set up the MaxHP with the STR and DEF / 2?

Code:
Call SetPlayerVital(Index, Vitals.HP, GetPlayerMaxVital(Index, Vitals.HP) + 5000)
Reply
#28
Go look at the function for GetPlayerMaxVital. It shows you how the MaxHP is calculated in the function. Sonire is just saying you need to take note of that because if you are going to change the players MaxHP to something else temporarily then you would have to change it back after wards, thus needing the calculation.

There are a couple ways you could do it. I think the easiest way (maybe not the best?) would just be to add a check in the function underneath Case HP.

So say,

Code:
Case HP
     If Whatever Then
          GetPlayerMaxVital = Int(GetPlayerStat(Index, Stats.Strength) / 2) + (Player(Index).Char(CharNum).OrigStrength) * 2 + 5000
     Else
          GetPlayerMaxVital = Int(GetPlayerStat(Index, Stats.Strength) / 2) + (Player(Index).Char(CharNum).OrigStrength) * 2
     End If

Maybe create a temporary variable which you can just clear after?
Reply
#29
Ok, thank you very much. I'll start messing around with this later when I get on my Windows PC. I think I might not need anymore help now. Though I might run into some kind of trouble...

Thank you all for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)