mob
verb
Fight()
if(usr.fightin==1)
usr << "You are already in a fight"
else
usr.fightin=1
usr.monster = input("Choose a monster to fight.","Monsters",usr.class) in list("Muffin - Lv1","Cancel")
usr.com()
mob
proc
com()
if(usr.monster=="Muffin - Lv1")
usr.fightin=1
usr.monhp=10
usr.monstr=5
usr.mondef=2
usr.monagility=3
usr.monexp=5
usr.mongg=10
monname="Muffin"
usr << "You attack a wild muffin!"
usr.monsterone()
if(usr.monster=="Cancel")
usr.fightin=0
return
mob
proc
monsterone()
if(usr.won==1)
usr.won=0
return
else
usr.action = input("What type of action do you want to take?.","Battle",usr.action) in list("Attack","Defend","Run")
if(usr.action=="Attack")
usr.monsteronex()
if(usr.action== "Defend")
usr.monsteronez()
if(usr.action=="Run")
usr.monsterrun()
proc
monsteronex()
var/humandamage
humandamage=usr.strength-usr.mondef
if(humandamage<=0)
usr << "You missed!"
if(humandamage>0)
if(usr.won==1)
return
else
usr.monhp-=humandamage
usr << "You have attacked the [usr.monname] for [humandamage]"
sleep(4)
deathcheck()
usr.monsteronew()
proc
monsteronew()
var/npcdamage
npcdamage=usr.monstr-usr.defense
if(npcdamage<=0)
if(usr.won==1)
return
else
usr << "[usr.monname] missed!"
if(npcdamage>0)
if(usr.won==1)
return
else
usr.hp-=npcdamage
usr << "The [usr.monname] has attacked you for [npcdamage]"
sleep(4)
deathcheck()
usr.monsterone()
proc
monsteronez()
var/npcdamage
var/defendamount
usr.miss = rand(1,2)
defendamount=usr.defense + usr.strength
npcdamage=usr.monstr-defendamount
if(npcdamage<=0)
if(usr.miss==1)
usr << "[usr.monname] missed!"
usr.monsterone()
if(usr.miss==2)
usr.hp-=usr.monstr
usr << "Your defend fails!"
usr << "The [usr.monname] attacks you for [usr.monstr]"
sleep(15)
usr.monsterone()
else
usr << "Bugged; Please contact inutracy immediatly and she will solve this problem"
else
usr.hp-=npcdamage
usr << "The [usr.monname] attacks you for [npcdamage]"
usr << "You defended for [defendamount]"
sleep(15)
usr.monsterone()
proc
monsterrun()
usr.run = rand(1,3)
if(usr.agility<=usr.monagility)
usr << "The [usr.monname] has blocked your path!"
sleep(10)
usr.monsterone()
if(usr.agility>usr.monagility)
if(usr.run==1)
usr << "You successfully ran away from the [usr.monname]"
return
if(usr.run==2)
var/npcdamage
usr << "The [usr.monname] has blocked your path!"
sleep(6)
npcdamage=usr.monstr-usr.defense
usr.hp-=npcdamage
usr << "The [usr.monname] has attacked you for [npcdamage]"
sleep(10)
usr.monsterone()
if(usr.run==3)
var/npcdamage
usr << "The [usr.monname] has blocked your path!"
sleep(6)
npcdamage=usr.monstr-usr.defense
usr.hp-=npcdamage
usr << "The [usr.monname] has attacked you for [npcdamage]"
sleep(10)
usr.monsterone()
else
usr << "Bugged Run; Please report this form to an admin<br><hr>"
usr << "<font color=red>usr.run: [usr.run]<br>usr.agility: [usr.agility]<br>usr.monagility: [usr.monagility]<br><hr>"
else
usr << "Neither more or less! (Debug)"
mob
proc
deathcheck()
if(usr.hp<=0)
usr << "<font color=blue>You have been defeated by [usr.monname]</font>"
usr.fightin=0
usr.monhp=0
usr.monstr=0
usr.mondef=0
usr.monagility=0
usr.monexp=0
usr.mongg=0
monname=""
usr.hp=usr.maxhp
return
if(usr.monhp<=0)
usr << "You have killed the [usr.monname]"
usr << "<font color=blue>You recieve [usr.monexp] exp!</font>"
usr << "<font color=blue>You recieve [usr.mongg] gold!</font>"
usr.exp += usr.monexp
usr.gold += usr.mongg
usr.fightin=0
usr.monhp=0
usr.monstr=0
usr.mondef=0
usr.monagility=0
usr.monexp=0
usr.mongg=0
monname=""
usr.levelup()
else
return
proc
levelup()
if(usr.exp>=usr.expneed)
usr << "<h3> <font color=red>Level Up! </font></h3>"
usr.level+=1
usr.strength+=3
usr.defense+=4
usr.expneed+=20
usr.exp=0
usr.maxhp+=6
usr.agility+=3
else
return
Problem description:ok this is it, i fight this monster THE only monster called Muffin and this is what the battle is like:
You attack a wild muffin!
You have attacked the Muffin for 4
The Muffin has attacked you for 3
You have attacked the Muffin for 4
The Muffin has attacked you for 3
You have attacked the Muffin for 4
You have killed the Muffin
You recieve 5 exp!
You recieve 10 gold!
missed!
the problem is i cant explain why missed! is there, i edited the coding a little. i took usr.won=1 from the monster end of the deathcheck cause it was causing this: when you fight a monster and kill it yur win = 1 and if your win = 1 then you cant fight again you could chose a monster but you couldent fight it.
please help me,
again id apreciate a little help on this one.