STARTsystemv0.1
This commit is contained in:
parent
76088c591a
commit
f272b1b281
5 changed files with 114 additions and 0 deletions
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
#### python
|
||||
.venv
|
||||
__pycache__
|
||||
|
||||
|
||||
#### misc
|
||||
.projectile
|
25
app.py
Normal file
25
app.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
from engine import Engine
|
||||
from player import Player
|
||||
from enemy import Enemy
|
||||
|
||||
# ENGINE SECTIONS
|
||||
eng = Engine()
|
||||
|
||||
# PLAYER SECTION
|
||||
player = Player("キーウィ")
|
||||
|
||||
# DUMMY SECTION
|
||||
dummykid = Enemy()
|
||||
|
||||
|
||||
# GAME TEST
|
||||
|
||||
player.show_stats()
|
||||
print("")
|
||||
dummykid.show_dummy()
|
||||
|
||||
roll = eng.roll_d20()
|
||||
|
||||
if roll < 10:
|
||||
eng.figth_mode(player, dummykid)
|
||||
|
12
enemy.py
Normal file
12
enemy.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
class Enemy:
|
||||
|
||||
def __init__(self):
|
||||
self.name = "Dummy"
|
||||
self.hp = 10
|
||||
self.mp = 0
|
||||
|
||||
def show_dummy(self):
|
||||
print(f"Name: {self.name}")
|
||||
print(f"HP: {self.hp}")
|
39
engine.py
Normal file
39
engine.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
import random
|
||||
from player import Player
|
||||
from enemy import Enemy
|
||||
from time import sleep
|
||||
|
||||
class Engine:
|
||||
def roll_d20(self):
|
||||
return random.randint(1,20)
|
||||
|
||||
|
||||
def roll_d10(self):
|
||||
return random.randint(1,10)
|
||||
|
||||
|
||||
def roll_d6(self):
|
||||
return random.randint(1,6)
|
||||
|
||||
|
||||
def figth_mode(self, player: Player, enemy: Enemy):
|
||||
"""
|
||||
--- FIGHT MODE ___
|
||||
player: PlayerClass
|
||||
enemy: EnemyClass
|
||||
"""
|
||||
|
||||
print("--- FIGHT MODE ___")
|
||||
print(f"{player.name} vs. {enemy.name}")
|
||||
|
||||
INIT_PLAYER = self.roll_d10()
|
||||
INIT_ENEMY = self.roll_d10()
|
||||
|
||||
if INIT_PLAYER > INIT_ENEMY:
|
||||
print(f"PLAYER ROLL: {INIT_PLAYER}")
|
||||
print(f"ENEMY ROLL: {INIT_ENEMY}")
|
||||
print("FIGHT OFF, CHICKEN")
|
||||
else:
|
||||
print("YOU GOT SOME TROUBLE, MATE")
|
||||
|
||||
|
31
player.py
Normal file
31
player.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
|
||||
class Player:
|
||||
STATs = {
|
||||
"INT": 5,
|
||||
"REF": 7,
|
||||
"DEX": 7,
|
||||
"TECH": 7,
|
||||
"COOL": 7,
|
||||
"WILL": 5,
|
||||
"LUCK": 8,
|
||||
"MOVE": 6,
|
||||
"BODY": 5,
|
||||
"EMP": 5
|
||||
}
|
||||
|
||||
HP = 0
|
||||
HP_MAX = 0
|
||||
|
||||
def __init__(self, name):
|
||||
self.HP = 35
|
||||
self.HP_MAX = 35
|
||||
self.name = name
|
||||
|
||||
def show_stats(self):
|
||||
print(f"Name: {self.name}")
|
||||
print(f"HP: {self.HP}/{self.HP_MAX}")
|
||||
|
||||
for k, v in self.STATs.items():
|
||||
print(f"{k}: {v}")
|
||||
|
Loading…
Add table
Reference in a new issue