ID:180447
 
In the game im making,when you fight, you fight by using one button The battle system determines if you win or lose automatically based on stats. What im trying to do is make it where you cant fight twice ina row. If you win you have to heal, if you lose you have to heal. Also, the player doesnt lose health after fights. I know this is sounding kinda weird right now, but trust me it makes sense if you play it. Anyway I tried adding a proc that gives you a tag when you clik fight,and takes it off when you heal.But all I've gotten is errors. If someone knows a way I could set this up then please help, it would be vey helpful to me.Thanks for your time.
On 6/12/01 10:31 pm SkullMan wrote:
In the game im making,when you fight, you fight by using one button The battle system determines if you win or lose automatically based on stats. What im trying to do is make it where you cant fight twice ina row. If you win you have to heal, if you lose you have to heal. Also, the player doesnt lose health after fights. I know this is sounding kinda weird right now, but trust me it makes sense if you play it. Anyway I tried adding a proc that gives you a tag when you clik fight,and takes it off when you heal.But all I've gotten is errors. If someone knows a way I could set this up then please help, it would be vey helpful to me.Thanks for your time.

I'm not certain I completely understand the situation. The player doesn't lose health after a fight, but he has to go heal?

In a typical game, you could just test to see if they have less than full health before allowing them to fight.

If I understand what you are doing you could use a flag variable on the mob, set it when they fight, and reset it when they heal.

mob
var
healed = 1
verb
fight()
if ((src.healed != 1) || (usr.healed != 1)) return 0 // can't fight if not healed
src.healed = 0 // src is the target mob
usr.healed = 0 // usr is the attacking mob
// ... your fight proc here
heal()
usr.healed = 1



You could add a variable to your mobs called last_fight that stores the world time to both sides of the fight right after it is over. The next time you try to fight, compare this value with the current time to make sure enough time has passed.

On 6/12/01 10:31 pm SkullMan wrote:
In the game im making,when you fight, you fight by using one button The battle system determines if you win or lose automatically based on stats. What im trying to do is make it where you cant fight twice ina row. If you win you have to heal, if you lose you have to heal. Also, the player doesnt lose health after fights. I know this is sounding kinda weird right now, but trust me it makes sense if you play it. Anyway I tried adding a proc that gives you a tag when you clik fight,and takes it off when you heal.But all I've gotten is errors. If someone knows a way I could set this up then please help, it would be vey helpful to me.Thanks for your time.
On 6/12/01 10:31 pm SkullMan wrote:
In the game im making,when you fight, you fight by using one button The battle system determines if you win or lose automatically based on stats. What im trying to do is make it where you cant fight twice ina row. If you win you have to heal, if you lose you have to heal. Also, the player doesnt lose health after fights. I know this is sounding kinda weird right now, but trust me it makes sense if you play it. Anyway I tried adding a proc that gives you a tag when you clik fight,and takes it off when you heal.But all I've gotten is errors. If someone knows a way I could set this up then please help, it would be vey helpful to me.Thanks for your time.

Ok, I'll try to explain it better. There are no graphics, just text. You click Attack and a menu of monsters pop up. You choose a monster and a fight takes place and then you recieve experience. Im trying to add something that would make you have to heal, click something else besides attack, or wait. I'm doing this to prevent people from just clicking attack over and over again. In other words, making them play the game and not just macro the whole thing.
In response to SkullMan
On 6/13/01 1:30 pm SkullMan wrote:
Ok, I'll try to explain it better. There are no graphics, just text. You click Attack and a menu of monsters pop up. You choose a monster and a fight takes place and then you recieve experience. Im trying to add something that would make you have to heal, click something else besides attack, or wait. I'm doing this to prevent people from just clicking attack over and over again. In other words, making them play the game and not just macro the whole thing.

mob
var
last_action = ""
verb
fight()
if (usr.last_action == "fight") // can't fight twice in a row
usr << "You must rest."
return 0
usr.last_action = "fight"
// ... your fight proc here


Other verbs should reset usr.last_action to some other value.
In response to Shadowdarke
Thank you very much Shadowdarke. If you will remind me of this later, when I release this game, I will give you some kind of bonus for helping me.
In response to SkullMan
On 6/13/01 6:57 pm SkullMan wrote:
Thank you very much Shadowdarke. If you will remind me of this later, when I release this game, I will give you some kind of bonus for helping me.

No need for special treatment, just pass a little kindness on to another newcomer when they need it if you want to thank me :)