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

Up-to-date #3

Merged
merged 12 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/python-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 28 additions & 0 deletions .github/workflows/src-test.yml
Original file line number Diff line number Diff line change
@@ -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
16 changes: 9 additions & 7 deletions base.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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":
Expand All @@ -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
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -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))
1 change: 1 addition & 0 deletions savedata.pk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

11 changes: 10 additions & 1 deletion typeChart.py
Original file line number Diff line number Diff line change
@@ -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
Loading