OK, here's some pieces of my battle system:
attack()
src << "It is your turn to attack."
src.dueling_partner << "It is your opponent's turn to attack."
if(src.client)
src.dattack = input("Choose an attack.","Attack","Thrust") in list("Thrust","Strike","Lash")
if(!src.client)
src.dattack = pick("Thrust","Strike","Lash")
src.dueling_partner.defend()
defend()
src << "Your opponent chose an attack."
if(src.client)
src.ddefend = input("Choose a defense.","Defend","Parry") in list("Parry","Block","Dodge")
if(!src.client)
src.ddefend = pick("Parry","Block","Dodge")
src.dodamage()
if(src.HP <= 0)
src.endduel()
return
src.attack()
Well, I think that's where the problem is. Anyways, battle against an NPC works peachy, but battle against another person doesn't work at all...
When a person goes up to another person, they can use the "Duel" verb to begin a fight. The one attacking first chooses his move first. After an attack and defense is chosen, they switch positions (defender attacks). So it works out to be a loop until one wins. Like I said, it works fine when playing against an NPC.
But when fighting another person, the person that initiated the fight gets all of the popups for some reason. He continuosly chooses attacks and defenses alone, while the other player just sits and twidles his thumbs. The other player still gets the battle messages he should get, but doesn't get to choose any attacks or defenses.
So, what's going on here? Thank you for your help.
Almost forgot to say, those pieces of code are both procs under mob, in case you didn't expect that.
ID:180523
May 24 2001, 2:29 pm
|
|
In response to Deadron
|
|
On 5/24/01 5:35 pm Deadron wrote:
On 5/24/01 5:29 pm Cinnom wrote: In the Duel verb. I'll show that, too: Duel(mob/M in oview(1)) set category = "Duel" set desc = "Stand next to the person you want to Duel, and Duel away!" if(M.dueling == 1) src << "That player is already fighting somebody." else var/duelornot = input("Are you sure you want to duel?","Duel","Yes") in list("Yes","No") if(duelornot == "No") return if(duelornot == "Yes") if(src.spd > M.spd) src << "You go first." src.dueling_partner = M M.dueling_partner = src src.dueling = 1 M.dueling = 1 src.attack() if(src.spd < M.spd) src << "Opponent goes first." src.dueling_partner = M M.dueling_partner = src src.dueling = 1 M.dueling = 1 M.attack() if(src.spd == M.spd) src << "You go first." src.dueling_partner = M M.dueling_partner = src src.dueling = 1 M.dueling = 1 src.attack() And that's the Duel verb. That reminds me, I need to make it so that you can't Duel if you're already dueling. Wouldn't that be interesting? =) |
In response to Cinnom
|
|
And that's the Duel verb. That reminds me, I need to make it so that you can't Duel if you're already dueling. Wouldn't that be interesting? =) NB: The input command has an optional argument for determining who to output the prompt to. See the reference for more info. |
Where are you specifying who the dueling partner is?