Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 45 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6bbcd6c
Setting up GitHub Classroom Feedback
github-classroom[bot] May 2, 2024
f277a46
FEAT F01, F14, F15, F16
bill2247 May 7, 2024
7f1ae13
Update monster_shop.csv
FadhilRafah May 9, 2024
41cfdd4
Add files via upload
rafiihsanalfathin123 May 12, 2024
38295ac
Add files via upload
rafiihsanalfathin123 May 12, 2024
08391de
Add files via upload
rafiihsanalfathin123 May 12, 2024
0622550
Add files via upload
RayneeSoe May 12, 2024
f2c08cc
revisi rng.py
bill2247 May 17, 2024
3889ec0
revisi rng.py
bill2247 May 17, 2024
b71add7
Add files via upload
RayneeSoe May 17, 2024
15d0781
Battle.py
RayneeSoe May 17, 2024
2d804cc
Update and rename F08 Battle.py to battle.py
RayneeSoe May 17, 2024
57ee3c2
Add files via upload
FadhilRafah May 17, 2024
b77d15f
Add files via upload
FadhilRafah May 17, 2024
654f00b
Delete laboratory.py
MAqmarFayyaz May 17, 2024
a8fa563
Add files via upload
FadhilRafah May 17, 2024
ebd82e5
revisi battle, load, save, register, rng
bill2247 May 19, 2024
4f3c57e
revisi battle
bill2247 May 19, 2024
6e725d4
Add files via upload
MAqmarFayyaz May 19, 2024
0a2b51d
Update main.py
MAqmarFayyaz May 19, 2024
34637fb
battle.py
RayneeSoe May 19, 2024
8cd5ab9
battle.py
RayneeSoe May 19, 2024
b814b39
Update inventory.py
MAqmarFayyaz May 19, 2024
8a369d3
battle.py
RayneeSoe May 19, 2024
708931c
Create shop_currency.py
bill2247 May 19, 2024
e2d1eec
Update battle.py
bill2247 May 19, 2024
1fc1f50
Add files via upload
MAqmarFayyaz May 20, 2024
25bb0dd
upload arena.py
bill2247 May 20, 2024
062b0ff
Update battle.py
MAqmarFayyaz May 20, 2024
22ce4a4
Update battle.py
bill2247 May 20, 2024
affba3f
Update arena.py
MAqmarFayyaz May 20, 2024
461bc5f
update battle.py
MAqmarFayyaz May 20, 2024
cf2b96f
Update inventory.py
MAqmarFayyaz May 20, 2024
9683ce3
Update shop_management.py final
bill2247 May 20, 2024
a9f79f5
Update laboratory.py
MAqmarFayyaz May 20, 2024
8e744c6
Update shop_currency.py final
bill2247 May 20, 2024
d16cd62
Update load.py
MAqmarFayyaz May 20, 2024
c152173
Update save.py final
bill2247 May 20, 2024
accf26d
Update login.py
MAqmarFayyaz May 20, 2024
1b83d93
Update menu_and_help.py
MAqmarFayyaz May 20, 2024
125c4bb
Update rng.py final final
bill2247 May 20, 2024
18b0db9
Update register.py final
bill2247 May 20, 2024
0e67c83
Update monster_management.py final
bill2247 May 20, 2024
66623e5
Update main.py
MAqmarFayyaz May 20, 2024
8087de9
Add files via upload
FadhilRafah May 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/07-05-2024/item_inventory.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
user_id;type;quantity


3 changes: 3 additions & 0 deletions data/07-05-2024/item_shop.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type;stock;price


3 changes: 3 additions & 0 deletions data/07-05-2024/monster.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id;type;atk_power;def_power;hp


3 changes: 3 additions & 0 deletions data/07-05-2024/monster_inventory.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
user_id;monster_id;level


4 changes: 4 additions & 0 deletions data/07-05-2024/monster_shop.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
monster_id;stock;price
1;10;500
2;5;700
3;3;1000
10 changes: 10 additions & 0 deletions data/07-05-2024/user.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
id;username;password;role;oc
1;bill_2231;fsdgdrgh;agent;0
2;bill_2232;fsgxdgb;agent;0
3;bill_2233;cvhg;agent;0
4;bill_2234;dfhg;agent;0
5;bill_2235;fsdgdfh;agent;0
6;bill_2236;dfhgyf;agent;0
7;bill_2237;dhfghg;agent;0
8;bill_2238;dgxfcgbd;agent;0
9;bill_2239;fhjchcvb;agent;0
Binary file added doc/LAPORAN TUBES DASPRO K06-H.docx.pdf
Binary file not shown.
146 changes: 146 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
import sys
sys.path.append('src')

# Melakukan import fungsi fungsi yang tidak dibuat dalam file main
from load import load
from login import login
from logout import logout
from register import register
from save import save
from exit import exit
from menu_and_help import menu_help
from laboratory import laboratory
from laboratory import monster_upgrade
from inventory import inventory
from battle import battle
from shop_currency import shop_currency
# from shop_management import shop_management
# from monster_management import monster_management
from arena import arena

# Inisialisasi seluruh variabel
is_Logged_in = False
is_Playing = True
dict = load()
user_idx = 1

def mainhelp(idx, log_status) :
global is_Logged_in, user_idx

menu_help(dict['user'], idx, dict['user'][idx][1], log_status)
cmd_help = (int(input("\n>>> Pilih fungsi : ")))

if not log_status :
if cmd_help == 1 :
is_Logged_in, user_idx = login(dict['user'])

elif cmd_help == 2 :
register(dict['user'])
save(dict)

elif dict['user'][idx][3] == "agent" and log_status:
if cmd_help == 1 :
logout(dict['user'])
is_Logged_in = False
user_idx = 1

elif cmd_help == 2 :
inventory(dict['item_inventory'], dict['monster_inventory'], dict['monster'], dict['user'][user_idx][4], dict['user'][user_idx][0])

elif cmd_help == 3 :
laboratory(dict['monster_inventory'], dict['monster'], dict['user'][idx][4], dict['user'][user_idx][0], dict['user'])
save(dict)

elif cmd_help == 4 :
battle(dict, user_idx-1)

elif cmd_help == 5 :
arena (dict, user_idx-1)

elif cmd_help == 6 :
shop_currency(dict, user_idx-1)
#==================================================================================================
else :
# Kalau role adalah admin
if cmd_help == 1 :
logout(dict['user'])
is_Logged_in = False
user_idx = 1

# elif cmd_help == 2 :
# shop_management(dict['monster_inventory'], dict['item_inventory'], dict['monster_shop'], dict['item_shop'])

# elif cmd_help == 3 :
# monster_management(dict)

while is_Playing :
if dict is not None :
if not is_Logged_in :
print("1. Login")
print("2. Register")
print("3. Help")
command = int(input((">>> Pilih command yang akan kamu pilih : ")))
# Meminta pengguna untuk memberikan input berupa nilai 1/2/3 sesuai keterangan
if command == 1 :
is_Logged_in, user_idx = login(dict['user'])

# Akan menjalankan fungsi login apabila pengguna memberikan input nilai 1

elif command == 2 :
register(dict['user'], dict['item_inventory'], dict['monster_inventory'])
save(dict)
# Akan menjalankan fungsi register apabila pengguna memberikan input nilai 2
# Selanjutnya akan menjalankan fungsi save untuk menyimpan informasi hasil register

elif command == 3 :
mainhelp(user_idx, is_Logged_in)

while command != 1 and command != 2 and command != 3 :
# Akan melakukan pengulangan ketika command tidak tersedia dalam pilihan
print ("Command tidak tersedia.")
command = int(input(">>> Pilih command yang akan kamu pilih : "))
print("1. Login")
print("2. Register")
print("3. Help")
if command == 1 :
is_Logged_in, user_idx = login(dict['user'])

elif command == 2 :
register(dict['user'], dict['item_inventory'], dict['monster_inventory'])
save(dict)

elif command == 3 :
mainhelp(user_idx, is_Logged_in)

print("\nLoading...")

print("\nMasukkan command \"Help\" untuk daftar command yang dapat kamu panggil.")
print("Masukkan command \"Exit\" untuk keluar dari program.")

cmd_main = input("\n >>> Masukkan command : ").lower()
if cmd_main == "help" :
mainhelp(user_idx, is_Logged_in)

elif cmd_main == "exit" :
print ("\nTerima kasih!")
print ("Sampai jumpa.")
print ("\n")
exit(dict)
is_Playing = False

while cmd_main != "exit" and cmd_main != "help" :
print ("Loading...")
print ("\nCommand tidak tersedia.")
print ("Masukkan command kembali.")
print("\nMasukkan command \"Help\" untuk daftar command yang dapat kamu panggil.")
print("Masukkan command \"Exit\" untuk keluar dari program.")
cmd_main = input("\n >>> Masukkan command : ").lower()
if cmd_main == "help" :
mainhelp(user_idx, is_Logged_in)
#==================================================================================================
elif cmd_main == "exit" :
print ("\nTerima kasih!")
print ("Sampai jumpa.")
print("\n")
exit(dict)
is_Playing = False
Loading