Code:
Mastery_Gain()
if(src.Mastery<100)
if(src.power_use==1)
switch(rand(0,10))
if(5)
src.Mastery += 1
ID:2119555
Jul 21 2016, 1:52 pm
|
|
How would I go about coding someone gaining their abilities. I have a Mastery gain and once you gain a certain number you will unlock a new skill. Should I make a variable for each skill you earn and then once you learn it I do "blank_skill=1" so that it doesn't give the message again? Or would that be too much code?
Code: Mastery_Gain() |
This has the added benefit of being able to have different mastery levels for each skill.
Disclaimer: Don't expect this to be plug&play. It's off the top of my head, written on my phone. //list(current mastery, max_mastery) |
Using if(var==1) is not a good way to check for a true value. Use if(var) instead.
|
@GreatPirateEra I love the help, but I meant like the message you get in games when you learn a skill like "You just learned fire breath!" or something. The mastery proc I should does not show the mastery of skills someone has, but the Mastery of your overall power like Telekinesis. Once you get about 25 percent mastery you earn a new ability. I just do not know how to make the message without having to have a var so that the proc doesn't repeat it if your mastery is still the same.
|
In response to Dayvon64
|
|
Not the best way, but it is one way:
var/old_mastery = src.telekenesis_mastery You could remove the else-if chain to allow each message to show in the case of a player jumping significantly in a stat. It's up to you. |
And