1
2
Feb 25 2012, 5:15 am
|
|
You would need to add another if() statement, except using the experience variables instead of health.
|
i dont understand what you mean example please,
why would i need another if statement for? |
this is what i have
var hp=10 maxhp=10 mp=10 maxmp=10 str=5 def=2 attackspeed=100 dead=0 level=1 exp=0 max_exp=10 mob/proc LevelCheck() if(usr.exp>=usr.max_exp) usr.exp=0 usr.max_exp=usr.max_exp*2 usr.level+=1 src<<"Level Up!" mob/Stat() if(previousxp != usr.exp) // disables constant winset() updates previousxp = usr.exp winset(src, "ExpBar", "value = [round((usr.exp / usr.max_exp) * 100)]") ..() |
I know more because you are not trying to learn more, add the if() to the mob/Stat() proc just as I did for health, except use experience.
|
omg now my bug doesnt die lol everytime something good happens to me there's always something bad
|
any ideas why this wouldnt work?
mob var bug_def=0 bugdead=FALSE BBhp=35 mob verb Attack(mob/M as mob in oview(1)) flick("regA",usr) var/damage = usr.str - bug_def if(damage <=0) usr << "[M] easily dodges your attack!" M << "You easily dodge [usr]'s attack." else if(damage>=1) M.hp -= damage M.deathcheck() view() << "[usr] attacks [M] for [damage] HP!" mob proc deathcheck() if(usr.hp <= 0) dead=1 view() << "[usr] dies!" sleep(2) usr.icon_state="spr_dead" sleep(10) usr.loc=locate(1,1,1) usr.hp=usr.maxhp usr.mp=usr.maxmp usr.exp=0 usr.icon_state="normal" sleep(1) usr.hp=usr.maxhp var/mob/BB BB = new/mob/bug() if(istype(BB) && src.hp<=0) //this will be true usr << "[M] is ugly!" exp+=50 winset(src, "ExpBar", "value = [round((usr.exp / usr.max_exp) * 100)]") LevelCheck() src.icon_state="dead" src.density=0 bugdead=TRUE del(src) |
is there a way i can make a private var so that there is no duplicate definitions?
|
k i figured it out it works but now my experience bar doesnt move at all because i get the error i posted up there when i use
winset(src, "ExpBar", "value = [round((usr.exp / usr.max_exp) * 100)]") help? |
1
2