-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_turn
More file actions
60 lines (54 loc) · 1.1 KB
/
Copy pathuser_turn
File metadata and controls
60 lines (54 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
bool select = false;
bool repick = false;
currentpoke = null;
def user_turn(status) {
if (curr == null && remPoke == 0){
print "You lost";
status = false;
disp "return to main"-> on click = return to main page
}
if (other's remPoke == 0 && other's curr == null){
print "you win"
status = false;
disp "return to main"-> on click = return to main page
}
return choosePoke();
}
def choosePoke(){
if(!select){ //need to select a pokemon
if(remPoke == 0){
print "No other pokemon not fainted"
select = true;
return choose_play();
}
else {
select = true;
disp avail pokemon
user select pokemon
select = true;
return null;
}
}
else{
select = true;
return choose_play();
}
}
def choose_play() {
disp "Use", "Select other", "run"
option = user select
switch option
1 -> return select_move();
2 -> select = false; return choosePoke();
3 -> print = "no running away from a trainer battle"; return select_play();
}
def select_move() {
if(no moves with > 0 pp){
return struggle;
}
else {
disp moves with > 0 pp
user_select move = moves();
return move;
}
}