diff --git a/.github/workflows/python-run.yml b/.github/workflows/python-run.yml index ae33ec0..8149a7b 100644 --- a/.github/workflows/python-run.yml +++ b/.github/workflows/python-run.yml @@ -16,10 +16,13 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Dependecacies + run: + pip3 install colorama - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: "3.10" - name: Run Python 3.10 run: - python main.py + python3 main.py diff --git a/.github/workflows/src-test.yml b/.github/workflows/src-test.yml new file mode 100644 index 0000000..c5210fb --- /dev/null +++ b/.github/workflows/src-test.yml @@ -0,0 +1,28 @@ +name: Python Host + +on: + push: + branches: [ "src" ] + pull_request: + branches: [ "src" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Install Dependecacies + run: + pip3 install colorama + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Run Python 3.10 + run: + python3 main.py diff --git a/base.py b/base.py index e8ff7cd..211b021 100644 --- a/base.py +++ b/base.py @@ -1,9 +1,8 @@ -from random import choice, randint -# from math import round, floor +from random import choice, randint, uniform import typeChart class Disk: - def __init__(self, name, type, number, bst, move, star, energy, special, mega, z, fuse): + def __init__(self, name, type, number, bst, move, star, energy , special = None, mega = None, z = None, fuse = None): self.name = name self.type = ["Normal","Fighting","Flying","Poison","Ground","Rock","Bug","Ghost","Steel","Fire","Water","Grass","Electric","Psychic","Ice","Dragon","Dark","Fairy"].index(type) self.number = number @@ -14,10 +13,13 @@ def __init__(self, name, type, number, bst, move, star, energy, special, mega, z self.special = special self.mega = mega self.level = self.energy/30 # hidden - self.z = ["Breakneck Blitz","All-Out Pummeling","Supersonic Skystrike","Acid Downpour","Tectonic Rage","Continental Crush","Savage Spin-Out","Never-Ending Nightmare","Corkscrew Crash","Inferno Overdrive","Hydro Vortex","Bloom Doom","Gigavolt Havoc","Shattered Psyche","Subzero Slammer","Devastating Drake","Black Hole Eclipse","Twinkle Tackle","Catastropika","Sinister Arrow Raid","Malicious Moonsault","Oceanic Operetta","Guardian of Alola","Soul-Stealing 7-Star Strike","Stoked Sparksurfer","Pulverizing Pancake","Extreme Evoboost","Genesis Supernova","10,000,000 Volt Thunderbolt","Light That Burns the Sky","Searing Sunraze Smash","Menacing Moonraze Maelstrom","Let's Snuggle Forever","Splintered Stormshards","Clangorous Soulblaze"].index(z) + if z != None: + self.z = ["Breakneck Blitz","All-Out Pummeling","Supersonic Skystrike","Acid Downpour","Tectonic Rage","Continental Crush","Savage Spin-Out","Never-Ending Nightmare","Corkscrew Crash","Inferno Overdrive","Hydro Vortex","Bloom Doom","Gigavolt Havoc","Shattered Psyche","Subzero Slammer","Devastating Drake","Black Hole Eclipse","Twinkle Tackle","Catastropika","Sinister Arrow Raid","Malicious Moonsault","Oceanic Operetta","Guardian of Alola","Soul-Stealing 7-Star Strike","Stoked Sparksurfer","Pulverizing Pancake","Extreme Evoboost","Genesis Supernova","10,000,000 Volt Thunderbolt","Light That Burns the Sky","Searing Sunraze Smash","Menacing Moonraze Maelstrom","Let's Snuggle Forever","Splintered Stormshards","Clangorous Soulblaze"].index(z) + else: + self.z = None self.fuse = fuse # list del name, type, number, bst, move, star, energy, special, mega, z, fuse - def Attack(self, enemy,selfch = [1,1,1,1,1],enemych = [1,1,1,1,1]): # Stat changes: [Attack, Defense, Sp. Atk, Sp. Def, Spe, Crit] + def Attack(self, enemy,selfch = [1,1,1,1,1,1],enemych = [1,1,1,1,1,1]): # Stat changes: [Attack, Defense, Sp. Atk, Sp. Def, Spe, Crit] if self.move[3] == "P": getbst = [1,2] elif self.move[3] == "S": @@ -44,11 +46,11 @@ def Attack(self, enemy,selfch = [1,1,1,1,1],enemych = [1,1,1,1,1]): # Stat chang attack = (((self.bst[getbst[0]]*2+31+252/4)*self.level)/100+5)*selfchnew defense = (((enemy.bst[getbst[1]]*2+31+252/4)*enemy.level)/100+5)*enemychnew powerBonus = choice([10,10,10,20,20,20,20,30,30,30,50]) - damage = (((2*self.level)/250)*attack/defense*(self.move[2]+powerBonus)+2)*multi + damage = round((((2*self.level)/250)*attack/defense*(self.move[2]+powerBonus)+2)*multi*uniform(0.8, 1)) else: attack = (((self.bst[getbst[0]]*2+31+252/4)*self.level)/100+5)*selfch[0] defense = (((enemy.bst[getbst[1]]*2+31+252/4)*enemy.level)/100+5)*enemych[1] powerBonus = choice([10,10,10,20,20,20,20,30,30,30,50]) - damage = (((2*self.level)/250)*attack/defense*(self.move[2]+powerBonus)+2)*multi + damage = round((((2*self.level)/250)*attack/defense*(self.move[2]+powerBonus)+2)*multi*uniform(0.8, 1)) return damage # work in progres diff --git a/main.py b/main.py index 6929462..5b67bcb 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,11 @@ +from os import system as sys +sys("pip3 install colorama") + from base import * -from colorama import Fore, Style as fore, style -testing = Disk("Pikachu") +from colorama import Fore as fore +testing = Disk("Pikachu","Electric",25,[35,55,40,50,50,90],["Thunderbolt","Electric",90,"S"],2,1500) +testing2 = Disk("Charmander","Fire",25,[35,55,40,50,50,90],["Flamethrower","Fire",90,"S"],2,1500) print(testing.name) print("Hello World") +print(testing.Attack(testing2)) diff --git a/savedata.pk b/savedata.pk new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/savedata.pk @@ -0,0 +1 @@ + diff --git a/typeChart.py b/typeChart.py index 281bd59..9af9305 100644 --- a/typeChart.py +++ b/typeChart.py @@ -1,3 +1,12 @@ -def match(): +class Type(): + def __init__(self, weak, resist, immune): + self.weak = weak + self.resist = resist + self.immune = immune + del weak, resist, immune + +# create class types later + +def match(type1,type2): # dummy return 1