Searched the whole Ren'py site for lifebars and/or other similar related stuff but almost always come up empty handed... so I'm going to ask questions regarding this mysterious ren'py function involving bars...
Question
Let's say there are two guys (B1 and B2) arguing who gets to eat the cream pie lying on the floor...
Note: POV is B1
Then, a fierce arguement started leading into...B1 "Whoa!... a Cream Pie!..."
B2 "It's delicious Cream Pie, I must eat it!..."
B1 "FUCK YOU!... I saw it first... therefore it's mine!"
B2 "NO U... I saw it first... so I say mine!"
After this point there will be a scene change. From this point, it will be a turn-based slapfest...B1 "FUCK this civilized arguement!... I say we use brute force!
B1 "That delicious CREAM PIE WILL BE MINE Dickhead!"
B2 "Oh yeah!?... Over my Dead Body..."
Then a life bar (an image whose size is 10px tall 50px wide will appear on both side of the screen each bar is 20px away from upper and left side of the screen on the B1 side and 20px away from upper and right side of the screen on the B2 side).
Each side will initially be given 50 points of Life...
Then it will be B1's turn to slap... you are currently on "Label Offence"
He will have two choices...
Let's say B1 chooses Slap and ren'py will generate random number (1 to 10) and if Ren'py generates...- Slap
- Wait
after that ren'py will again generate random number (this time 1 to 5)5 or lower
Slap will miss
6 or higher
Slap will hit
and the number generated will be deducted to B2's life points
and the graphical lifebar will be shortened (Lets say the Hitpoint generated is 5, then the bar will be reduced by 5px horizontally... sorry, the way that lifebar works is still a bit of a mystery for me)
then ren'py will check B2's life points and if B2's life point is depleted (or zero) then you will go to "label Winner" or else go to "label Defence"
Let's say B2 is still alive and you will go to the "Label Defence"
You (B1) will have two choices...
Let's say you choose Dodge. Ren'py will generate (again) random number (this time 1 to 4)- Dodge
- Block
and if the number is...
- 2 or lower
You will be hit. Renpy will generate random number (1 to 5) and the number generated will be deducted to your (B1's) life and then ren'py will check your (B1's) lifepoint and if B1's life point is depleted (or zero) then you will go to "label Loser" or else go to "label Offence"
- 3 or higher
you will successfully dodge the attack and get to choose how you will taunt B2 and a menu will pop up...
You may choose whatever but after the colorful dialogue you will go to "label Offence"- "Hah! Try again!... Slowpoke!"
- "Thats it!?... that Creampie is as good as mine!"
- "Haha!... you missed!..."
now lets go back to the menu earlier...
Let's say you choose Block this time. Ren'py will generate (again) random number (this time 1 and 2)- Dodge
- Block
and if the number is
- 1
You will block the hit and renpy will generate random number (1 to 2) and the number generated will be deducted to your (B1's) life and then ren'py will check your (B1's) lifepoint and if B1's life point is depleted (or zero) then you will go to "label Loser" or else go to "label Offence"
- 2
You will block the hit and have a chance to counter attack and renpy will generate random number (1 to 2) and the number generated will be deducted to your (B1's) life and then ren'py will check your (B1's) lifepoint and if B1's life point is depleted (or zero) then you will go to "label Loser" but if you (B1) still have life points left, you will go to "Label Counter" and there... a menu will pop-up
You will have 2 choices
If you choose Counterattack:- Counterattack
- Taunt
Ren'py will generate random number (1 to 10) and if Ren'py generates...
after that ren'py will again generate random number (this time 1 to 5)5 or lower
Slap will miss
6 or higher
Slap will hit
and the number generated will be deducted to B2's life points
then ren'py will check B2's life points and if B2's life point is depleted (or zero) then you will go to "label Winner" or else go to "label Offence"... and from there the vicious cycle repeats once again.
If you choose Taunt:
a menu will pop up...
You may choose whatever but after the colorful dialogue you will go to "label Offence"- "Lame!..."
- "Is that it?... "
- "You limp dick!"
OK, what I written above is a glimpse on how my supposedly fighting engine works... it's inneficient and very much hard to track (and debug...) but this is the only way I know it (a very buggy version already exist). I can expand it to accomodate other things but for now I'll keep it simple since I still have to figure out how that "Lifebar" works... also if there is a much more efficient way to reproduce the above behaviour please point it out.
Thanks in advance.
"POOF" (Nope!... not going to dissapear, will wait...)