-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.pl
51 lines (46 loc) · 1.21 KB
/
main.pl
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
:- include('print.pl').
:- include('map.pl').
:- include('character.pl').
:- include('battle.pl').
:- include('Generate.pl').
:- include('savegame.pl').
:- include('loadgame.pl').
/*Untuk menunjukkan apakah pemain pernah menekan command [1]*/
:-dynamic(startStatus/1).
start :-
print_Title,sleep(0.5),
print_Story,sleep(1),
help,
init,
init_database,
init_Player,
enemyGenerator,
map,
repeat,
generate_Akatsuki_Enemy,
write('Your command: '),
read(Input),
print_InvalidCommand(Input),
(Input==w;Input==a;Input==s;Input==d;Input==status;Input==map;Input==help;Input==exit;Input==save;Input==load;Input==heal;Input==drop),
nl,
call(Input),nl,
(Input==exit; endGame).
endGame :-
inventory([]),
print_Lose,!.
endGame :-
winCondition,
print_Win,!.
help :- print_Help.
exit :-
retractall(playerLoc(_,_)),
retractall(player(_,_,_,_,_,_,_)),
retractall(enemy(_,_,_,_,_,_,_)),
retractall(enemyName(_)),
retractall(enemyLocX(_)),
retractall(enemyLocY(_)),
retractall(enemy_appear(_)),
retractall(twoAkatsuki(_)),
retractall(nbAkatsuki(_)),
retractall(akatsuki_Appear(_)),
print_Lose.