Combat code problem. -.- in Developer Help
|
|
Code:
mob Bat name = "Bat" icon = 'turf/Enemies.dmi' icon_state = "bat" powerlevel = 10 str = 3 end = 2 agi = 1 exp = 5 Bumped(O) usr.lock = 1 usr.loc = src.loc usr.loc = locate(usr.x,usr.y-3,usr.z) usr.dir = NORTH usr.inbattle = 1 if(usr.agi > src.agi) usr.AttackPanel() else usr.MonsterAttack() proc Bumped(O) Bump(O) ..() if(ismob(O)) O:Bumped(src)
mob/proc AttackPanel() usr.isturn = 1
MonsterAttack(src) var/attack = rand(1,5) if(attack == 5) var/damage = str * 3 usr << "<font color=green>The [src] [pick("hit","damaged","attacked")] [usr.player] with a critcal for [damage]!</font>" usr.powerlevel -= damage usr.AttackPanel() else var/damage = str * 2 usr << "<font color=green>The [src] [pick("hit","damaged","attacked")] [usr.player] for [damage]!</font>" usr.powerlevel -= damage usr.AttackPanel()
Death() if(src.powerlevel <= 0) usr.exp += src.exp usr.gold += src.gold LevelUp() usr.lock = 0 del src
LevelUp() if(usr.exp == usr.neededexp) usr << "<font color=green>You have gained a level! Your level is now [usr.level]!</font>" usr.level += 1 usr.powerlevel += rand(50,100) usr.str += rand(1,5) usr.end += rand(1,3) usr.stmmax += rand(1,2) usr.agi += rand(1,3)
|
Problem description: Well, if you haven't heard by now, I've made it my mission to make a none ripped DBZ based game before I leave for bootcamp February 16th. For some reason this combat code I made up just doesn't seem to work. When you bump into the monster it does show text, but the src is either blank or yourself. Any ideas?
|