startbattle()
src.win=0
src.action = input("What type of action do you want to take?.","Battle",src.action) in list("Attack","Defend","Run","HELP!!!!!")
if(src.action=="Attack")
src.attack=1
src.str-=src.mmdef
src.mmhp-=src.str
src<<"You attack [monname] for [str] damage."
src.str=src.mstr
deathcheck()
if(src.action== "Defend")
src.attack=1
src<<"[monname] saw through your defence."
src.defend=0
deathcheck()
if(usr.action=="Run")
src.run=1
runaway()
if(usr.action=="Skill")
skill stuff here
if(usr.action=="HELP!!!!!")
src.help=1
deathcheck3()
monsterattack()
if(src.mmagi>= src.agi && src.defend==0)
src.attack=0
src.def-=src.mmstr
src.hp-=src.mmstr
src<<"You got attacked by [monname] for [str] damage."
src.mmstr=src.mmmstr
src.def=src.mdef
deathcheck2()
return
else
src<<"[monname] missed their attack."
src.attack=0
src.defend=0
startbattle()
return
ID:165673
Nov 16 2006, 3:25 pm
|
|
Ok im making this text based game (a mud) that needs skills yet whel they chose skills as their attack i cant seem to get their skills into a list that they can chose from, please help me.
|
In response to YMIHere
|
|
ok i did something like this
mob/var/list/skill = list() now how do i call that with this: startbattle() thats inutracy's smartened up battle system somewhat, it had too many bugs so i rewrote it, but there wasnt anything about skills. Someone help me, Volks. |
In response to VolksBlade
|
|
First, look up switch(), it will clean up those extended "if" checks.
Next, look up for() and in. An example: for(var/skill/s in src.skills) That will loop through everything in the var skills and display it to src. |
He also has an article on associative lists too, if you're not sure what that's all about.