# temp.rpy
default playername = "BadMustard"
define X = Character("X")
define K = Character("K")
define E = Character("X")
define V = Character("V")
define T = Character("T")
define A = Character("A")
define S = Character("S")
define N = Character("N")
default player_max_hp = 100
default player_hp = player_max_hp
default enemy_max_hp = 80
default enemy_hp = enemy_max_hp
init python:
class fighter:
def __init__(self, name, level = 1, max_hp = 10, hp = 10, max_mp = 4, mp = 4, initiative = 0, element = "None", element_attack = "Sword", attack = 0):
self.name = name
self.level = 1
self.max_hp = max_hp
self.hp = hp
self.max_mp = max_mp
self.mp = mp
self.initiative = initiative
self.element = element
self.element_attack = element_attack
self.attack = attack
screen hp_bars:
vbox:
spacing 20
xalign 0.1
yalign 0.0
xmaximum 600
text "{color=FC0FD8}[playername]{/color=FC0FD8}"
bar value player_hp range player_max_hp
vbox:
spacing 20
xalign 0.9
yalign 0.0
xmaximum 600
text "Xiuhcoatl"
bar value enemy_hp range enemy_max_hp
label dice_roll:
$ d4 = renpy.random.randint(1, 4)
$ d6 = renpy.random.randint(1, 6)
$ d10 = renpy.random.randint(1, 10)
$ d20 = renpy.random.randint(1, 20)
return
label tutorial_fight:
show screen hp_bars
scene bg tut combat with fade
X "It's time to fight!"
#label tutorial fight
#player turn
call dice_roll
menu:
"Basic attack.(Low Dmg. More accurate.)":
if d10 >= 8: # 30%
$ player_attack_value = d4 + d6
$ enemy_hp -= player_attack_value
"Critical Hit! [player_attack_value] damage!" # 70%
else:
$ enemy_hp -= d4
"[d4] damage!"
"Heavy slash. (High Dmg. Less accurate)":
if d10 >= 9: # 20%
$ player_attack_value = (d6 + d4)*2
$ enemy_hp -= player_attack_value
"Critical Hit! You hit for [player_attack_value] damage!"
elif d10 >= 5: # 40%
$ player_attack_value = d6 + 2
$ enemy_hp -= player_attack_value
"That's a strong hit! Xiuhcoatl takes [player_attack_value] damage!"
else: # 40%
"You miss!"
"Special attack: Yeet! (High Dmg. Low accuracy.)":
if d20 >=19:
$ player_attack_value = (d10 + d6)*2
$ enemy_hp -= player_attack_value
"Wow, you actually landed that! That did [player_attack_value] damage!"
if enemy_hp <= 0:
N "You win the combat encounter!"
jump combat_tutorial_done
call dice_roll
if d20 >= 19: # 20%
$ player_hp -= d10
"Xiuhcoatl makes a wild attack for [d10] damage!"
else: # 60%
$ player_hp -= d4
"Xiuhcoatl attacks for [d4] damage!"
jump tutorial_fight
label combat_tutorial_done:
scene bg tutorial done with fade
X "A splendid show of skill… for an abecedarian."
K "I don’t know what that means, but I can tell you were holding back."
X "Well, of course I was. But, the fact that you held your own is a sign you’re ready for a real fight."
V "You did better than me, when we dueled for the first time, she almost took my head off."
X "And I apologized profusely for that, I thought you’d be faster than that."
V "So did I!"
E "I remember thinking ‘this is how I die.’ during our duel."
T "I still think about how she grabbed my wings and slammed me down."
A "She yanked my tail and put her foot on my chest."
S "Yes yes, Xiuhcoatl humbled us all during our initiation duel and she can kill us all at any time."
S "In any case, this means you’re officially a Riptide now. You can get our tattoo to show the world you’re among the toughest there are."
return
#from here it will execute the game over label but why ??
label game_over:
scene bg defeated with fade
N "The Cistern of Souls is calling you, [playername]."
return
label start:
call tutorial_fight
e "back at start"
return