Skip to content

Commit

Permalink
removed test, moved items to pokete_data, added items to wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgr-linux committed May 30, 2021
1 parent 3a8a784 commit 379e007
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 12 deletions.
27 changes: 26 additions & 1 deletion gen-wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pokete_data.poketes import *
from pokete_data.attacks import *
from pokete_data.types import *
from pokete_data.items import *

md_str = """# Pokete wiki
This wiki/documentation is a compilation of all Poketes/attacks/types present in the Pokete game.
Expand All @@ -12,6 +13,7 @@
1. [Poketes](#poketes)
"""


# Table of contents
for j, poke in enumerate(sorted([i for i in pokes][1:])):
md_str += f""" {j+1}. [{pokes[poke]["name"]}](#{poke})\n"""
Expand All @@ -21,9 +23,16 @@
for j, atc in enumerate(sorted(attacs)):
md_str += f""" {j+1}. [{attacs[atc]["name"]}](#{atc.replace("_", "-")})\n"""

# Poketes
md_str += """3. [Types](#types)
4. [Items](#items)
"""

for j, item in enumerate(sorted(items)):
md_str += f""" {j+1}. [{items[item]["pretty_name"]}](#{item.replace("_", "-")})\n"""


# Poketes
md_str += """
## Poketes
In the following all Poketes with their attributes are displayed.
"""
Expand Down Expand Up @@ -52,6 +61,7 @@
{evolve_txt}
"""


# Attacks
md_str += """
## Attacks
Expand All @@ -69,6 +79,7 @@
- Attack points: {attacs[atc]["ap"]}
"""


# Types
md_str += """
## Types
Expand All @@ -88,6 +99,20 @@
md_str += f"{type.capitalize()}|{effective}|{ineffective}\n"


# Items
md_str += """
## Items
Those are all items present in the game, that can be traded or found.
"""

for item in sorted(items):
md_str += f"""
### {items[item]["pretty_name"]}
{items[item]["desc"]}
- Price: {items[item]["price"]}
"""


# writing to file
with open("wiki.md", "w+") as file:
file.write(md_str)
16 changes: 5 additions & 11 deletions pokete.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
import random, time, os, sys, threading, math
import scrap_engine as se
from pathlib import Path
from pokete_data.poketes import *
from pokete_data.attacks import *
from pokete_data.maps import *
from pokete_data.classes import *
from pokete_data.types import *
from pokete_data import *

# Class definition
##################
Expand Down Expand Up @@ -803,7 +799,7 @@ def buy():
ev = ""
buybox.add(movemap, movemap.width-35, 0)
buybox2.add(movemap, buybox.x-19, 3)
items = [invbox.poketeball, invbox.superball, invbox.test, invbox.heal_potion, invbox.super_potion]
items = [invbox.poketeball, invbox.superball, invbox.healing_potion, invbox.super_potion]
obs = [se.Text(ob.pretty_name+" : "+str(ob.price)+"$") for ob in items]
for i, ob in enumerate(obs):
buybox.add_ob(ob, 4, 1+i)
Expand Down Expand Up @@ -1629,11 +1625,9 @@ def recogniser():
# adding
invbox2.add_ob(invbox2.desc_label, 1, 1)
# every possible item for the inv has to have such an onbject
invbox.poketeball = InvItem("poketeball", "Poketeball", "A ball you can use to catch Poketes", 2, fight_poketeball)
invbox.superball = InvItem("superball", "Superball", "A ball you can use to catch Poketes with an increased chance", 10, fight_superball)
invbox.test = InvItem("test", "Test", "A fucking test, a test, a test bla bla bla. test test 123", 10)
invbox.heal_potion = InvItem("heal_potion", "Healing potion", "Heals a Pokete with 5 HP", 15, fight_heal_potion)
invbox.super_potion = InvItem("super_potion", "Super potion", "Heals a Pokete with 15 HP", 25, fight_super_potion)
# invbox.poketeball = InvItem("poketeball", "Poketeball", "A ball you can use to catch Poketes", 2, fight_poketeball)
for name in items:
exec(f'invbox.{name} = InvItem(name, items[name]["pretty_name"], items[name]["desc"], items[name]["price"], {items[name]["fn"]})')

# buybox
buybox = ChooseBox(height-3, 35, "Shop")
Expand Down
10 changes: 10 additions & 0 deletions pokete_data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pokete_data.poketes import *
from pokete_data.attacks import *
from pokete_data.maps import *
from pokete_data.classes import *
from pokete_data.types import *
from pokete_data.items import *


if __name__ == "__main__":
print("\033[31;1mDo not execute this!\033[0m")
30 changes: 30 additions & 0 deletions pokete_data/items.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
items = {
"poketeball": {
"pretty_name": "Poketeball",
"desc": "A ball you can use to catch Poketes",
"price": 2,
"fn": "fight_poketeball"
},
"superball": {
"pretty_name": "Superball",
"desc": "A ball you can use to catch Poketes with an increased chance",
"price": 10,
"fn": "fight_superball"
},
"healing_potion": {
"pretty_name": "Healing potion",
"desc": "Heals a Pokete with 5 HP",
"price": 15,
"fn": "fight_heal_potion"
},
"super_potion": {
"pretty_name": "Super potion",
"desc": "Heals a Pokete with 15 HP",
"price": 25,
"fn": "fight_super_potion"
},
}


if __name__ == "__main__":
print("\033[31;1mDo not execute this!\033[0m")
24 changes: 24 additions & 0 deletions wiki.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ This wiki can be generated using ```$ gen-wiki.py```.
24. [Tail wipe](#tail-wipe)
25. [Wing hit](#wing-hit)
3. [Types](#types)
4. [Items](#items)
1. [Healing potion](#healing-potion)
2. [Poketeball](#poketeball)
3. [Super potion](#super-potion)
4. [Superball](#superball)

## Poketes
In the following all Poketes with their attributes are displayed.
Expand Down Expand Up @@ -724,3 +729,22 @@ Fire|Flying, Plant|Stone, Water
Ground|Normal|Flying
Electro|Stone, Flying|Ground
Flying|Plant|Stone

## Items
Those are all items present in the game, that can be traded or found.

### Healing potion
Heals a Pokete with 5 HP
- Price: 15

### Poketeball
A ball you can use to catch Poketes
- Price: 2

### Super potion
Heals a Pokete with 15 HP
- Price: 25

### Superball
A ball you can use to catch Poketes with an increased chance
- Price: 10

0 comments on commit 379e007

Please sign in to comment.