label battle_game:
"START GAME. Goblin has first turn!"
scene goblin_game2:
zoom(0.67)
r "Okey...let´s play. Show me your cast!"
wg "You will lose human scum!"
# Reset of the values.
$ round_hp = 5
$ timer_range = 5
$ timer_jump = 'battle_lost_a'
# As I said, "time" SHOULDN'T be a variable name.
$ timeLeft = 5
# Start the countdown.
show screen countdown
# Will proceed the /round/ code as long as there's round to play.
while (round_hp > 0):
# One more round played
$ round_hp -= 1
# Opponent turn
# There's no need for two variables containing the same value...
# Especially when you don't use the second one.
$ spell_cast = renpy.random.randint(1, 5)
# Player choice.
menu:
"FIRE":
"Clara cast FIRE"
# This choice loose against those choices.
$ looseAgainst = [1, 2, 3]
# This choice win against those choices.
$ winAgainst = [4, 5]
"WATER":
"Clara cast WATER"
$ looseAgainst = [2,3,4]
$ winAgainst = [1,5]
"Wind":
"Clara cast WIND"
$ looseAgainst = [3,4,5]
$ winAgainst = [1,2]
"Electric":
"Clara cast ELECTRIC"
$ looseAgainst = [4,1,5]
$ winAgainst = [2,3,]
"Earth":
"Clara cast EARTH"
$ looseAgainst = [5,1,2]
$ winAgainst = [3,4]
# Display what was the opponent choice.
if spell_cast == 1:
# Give an alias name to the image, to be able to remove it easily.
show fire as casted_speel
elif spell_cast == 2:
show water as casted_speel
elif spell_cast == 3:
show wind as casted_speel
elif spell_cast == 4:
show electric as casted_speel
elif spell_cast == 5:
show earth as casted_speel
# Resolve the fight
# The opponent chose a wining move.
if spell_cast in looseAgainst:
# Do you really need to compute "value + 0" ? :/
#$ red_hood_hp = min(red_hood_hp+0, red_hood_max_hp)
$ wolf_hp = min(wolf_hp+1, wolf_max_hp)
"You loose !"
# The opponent chose a loosing move.
elif spell_cast in winAgainst:
$ red_hood_hp = min(red_hood_hp+1, red_hood_max_hp)
"You won !"
# remove the opponent hand
hide casted_speel
# Will automatically loop as long as there's still round to play.
# The battle is finished, stop the countdown.
hide screen countdown
hide screen simple_stats_screen
# As I said, totally useless.
#if round_hp <= 0:
if red_hood_hp <= wolf_hp:
"You didn´t win! :("
hide ferocity_beast_wound2
hide ferocity_beast_wound
hide clara_dress_battle_pan2
hide clara_dress_battle_pan
scene clara_ferocity_beast:
zoom(0.67)
pause
jump battle_lost_a
else:
r "Hey...it is five rounds match. I have more points already!"
r "I wiiiin!!!!! Yeee"
r "Take it, yeaahh, f#ck you little green freak!"
hide spider4
hide spider3
hide spider2
show ferocity_beast_wound3 at right
jump end_battle
screen countdown():
timer 0.01 repeat True action If( timeLeft > 0, SetVariable('timeLeft', timeLeft - 0.01), [Hide('countdown'), Jump(timer_jump)])
# "*100" because you count the time in hundredth of second, not in second.
bar value timeLeft*100 range timer_range*100 xalign 0.5 yalign 0.9 xmaximum 300 at alpha_dissolve