Skip to content

Commit

Permalink
Merge pull request #43 from azabicki/v1.0.1
Browse files Browse the repository at this point in the history
V1.0.1
  • Loading branch information
azabicki authored Feb 22, 2024
2 parents 14a145f + 288f125 commit 91ac449
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 28 deletions.
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[![azabicki - DoomPy](https://img.shields.io/static/v1?label=azabicki&message=DoomPy&color=blue&logo=github)](https://github.com/azabicki/DoomPy "Go to GitHub repo")
[![Made with Python](https://img.shields.io/badge/Python->=3.10-blue?logo=python&logoColor=white)](https://python.org "Go to Python homepage")
[![License](https://img.shields.io/badge/License-GPLv3-blue)](#license)
<!--- [![stars - DoomPy](https://img.shields.io/github/stars/azabicki/DoomPy?style=social)](https://github.com/azabicki/DoomPy)
[![issues - DoomPy](https://img.shields.io/github/issues/azabicki/DoomPy)](https://github.com/azabicki/DoomPy/issues)
[![stars - DoomPy](https://img.shields.io/github/stars/azabicki/DoomPy?style=social)](https://github.com/azabicki/DoomPy)
[![forks - DoomPy](https://img.shields.io/github/forks/azabicki/DoomPy?style=social)](https://github.com/azabicki/DoomPy)
[![issues - DoomPy](https://img.shields.io/github/issues/azabicki/DoomPy)](https://github.com/azabicki/DoomPy/issues) --->

_Disclaimer: This is a private project and I took the liberty of borrowing the official icons from the Doomlings website. I hope that's ok with you guy's from Doomlings :) - and of course: go buy the game, it's super fun!_

Expand Down Expand Up @@ -45,7 +45,7 @@ I think (hope) it should be possible for anyone with the provided [requirements.

#### 1. getting the repo

[Download the repository][release] and unzip it. Or if you prefer to use the terminal, run
Download the [latest release][release] (or the [current repository][zip]) and unzip it. Or if you prefer to use the terminal, run

```terminal
wget https://github.com/azabicki/DoomPy/archive/refs/heads/main.zip
Expand Down Expand Up @@ -104,6 +104,8 @@ The GUI consist of mainly two parts:

I hope that the handling is self-explanatory. Especially if you've already played a round or two of [**Doomlings**](https://doomlings.com/). But just in case, you can find more detailed explanations here.

(see short [demo video](#demo) at the bottom)

![GUI_with_Controls](misc/how_to.jpg)

### How to: Controls
Expand All @@ -129,15 +131,15 @@ I hope that the handling is self-explanatory. Especially if you've already playe
- Every time a catastrophe is turned, select it from the dropdown box.
- _First player_ is automatically changed.
- Since `Prepper` is able to choose the `World's End` effect, you may need to change it manually.
- As soon as every _trait's world's end effects_ are resolved, click on th `GO!` button to activate the actual `World's E` effect.
- As soon as every _trait's world's end effects_ are resolved, click on th `GO!` button to activate the actual `World's End` effect.
- **Settings:**
- As a joke, we thought it could be funny to record our own little `Sound-Bites` of all the "_quotes_" on top of every trait. But until now, we only added some generic mp3's. Turn it on and be surprised :smile: (or annoyed :roll_eyes:)
- <img src="./doompy/images/note_off.png" width="18"> `Music Off`
- <img src="./doompy/images/note_on.png" width="18"> `Music On`
- You can change which `Trait Property` icons will be shown in the trait pile:
- <img src="./doompy/images/icons_on.png" width="18"> `Default`: basic properties about the trait + effects
- <img src="./doompy/images/icons_off.png" width="18"> `None`: only effects
- <img src="./doompy/images/icons_full.png" width="18"> `Full`: all properties (needs a wide screen!)
- <img src="./doompy/images/icons_full.png" width="18"> `Full`: all properties (requires a wider screen!)
- Select 'Scoring Mode', i.e. how the current scores are shown:
- <img src="./doompy/images/points_123.png" width="18"> `Points`: show all the points
- <img src="./doompy/images/rank.png" width="18"> `Rank`: show only the rank of the players
Expand Down Expand Up @@ -231,7 +233,14 @@ _And that's it. Have fun using it!_
> [!IMPORTANT]
> Discard **Dominants** and **Attachments**!
Of course, there is a little back-door for you to remove dominant traits and attachment from your trait pile, in case you played them by mistake. Just click on the `vertical line`separating the traits basic properties from effects.
Of course, there is a little back-door for you to remove dominant traits and attachment from your trait pile, in case you played them by mistake. Just click on the `vertical line` separating the traits basic properties from effects.

> [!TIP]
> Individual standard game settings!
You are always playing 4 catastrophes? With the same people? Two mols? **Don't worry!** You don't have to change the settings again and again. Just open the `doompy/config.json` file and edit the defaults according to your playing style.



> [!TIP]
> Use **keyboard** shortcuts!
Expand Down Expand Up @@ -269,6 +278,9 @@ I have tested DoomPy quite intensively and we have also used it in several real

Do you have any suggestions for improvement? Have I forgotten to add a trait? Or any other ideas or criticism? Just create an [issue](https://github.com/azabicki/DoomPy/issues) and I'll get back to you :)

## Demo

https://github.com/azabicki/DoomPy/assets/33624433/6150a4ed-c103-44a8-9356-c429407ac2dc

[zip]: https://github.com/azabicki/DoomPy/archive/refs/heads/main.zip
[release]: https://github.com/azabicki/DoomPy/releases
[release]: https://github.com/azabicki/DoomPy/releases/latest
6 changes: 3 additions & 3 deletions doompy/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"names": ["Lisa", "Julia", "Anton", "Adam", "Ben", "Franzi"],
"n_player": 4,
"n_genes": 6,
"n_catastrophes": 4,
"n_MOLs": 2,
"n_genes": 5,
"n_catastrophes": 3,
"n_MOLs": 1,

"img_colors_set": "circle",
"img_trait_properties_set": "official_setA"
Expand Down
72 changes: 72 additions & 0 deletions doompy/logs/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
>>> initialize <<< new game: 20240221-212520
>>> initialize <<< reset variables
>>> name of player #1 = 'Lisa'
>>> name of player #2 = 'Julia'
>>> name of player #3 = 'Anton'
>>> name of player #4 = 'Adam'
>>> first player is 'Lisa'
>>> initialize <<< create menu
>>> initialize <<< create playground
>>> select trait <<< in DECK -> selected trait = 'Spicy' (id:304)
>>> play <<< 'Lisa' is playing 'Spicy' (id:304)
>>> dominants <<< in trait piles: Lisa = 0 / Julia = 0 / Anton = 0 / Adam = 0
>>> scoring <<< 'Lisa's current points: face=1 | drops=1 | WE=0 | MOL=0 | total=2
>>> scoring <<< 'Julia's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Anton's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Adam's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> select trait <<< in DECK -> selected trait = 'Fey' (id:113)
>>> play <<< 'Lisa' is playing 'Fey' (id:113)
>>> dominants <<< in trait piles: Lisa = 0 / Julia = 0 / Anton = 0 / Adam = 0
>>> genes <<< 'Lisa's 'Fey' (id:113) has gene effect off '1' on 'all' -> current effect: [1, 1, 1, 1]
>>> total gene effect: [1, 1, 1, 1] -> current gene pools are [7, 7, 7, 7]
>>> scoring <<< 'Lisa's current points: face=2 | drops=1 | WE=0 | MOL=0 | total=3
>>> scoring <<< 'Julia's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Anton's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Adam's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> select trait <<< in DECK -> selected trait = 'Fey' (id:114)
>>> play <<< 'Lisa' is playing 'Fey' (id:114)
>>> dominants <<< in trait piles: Lisa = 0 / Julia = 0 / Anton = 0 / Adam = 0
>>> genes <<< 'Lisa's 'Fey' (id:113) has gene effect off '1' on 'all' -> current effect: [1, 1, 1, 1]
>>> genes <<< 'Lisa's 'Fey' (id:114) has gene effect off '1' on 'all' -> current effect: [2, 2, 2, 2]
>>> total gene effect: [2, 2, 2, 2] -> current gene pools are [8, 8, 8, 8]
>>> scoring <<< 'Lisa's current points: face=3 | drops=1 | WE=0 | MOL=0 | total=4
>>> scoring <<< 'Julia's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Anton's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Adam's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> select trait <<< in DECK -> selected trait = 'Acrobatic' (id:0)
>>> select trait <<< in DECK -> selected trait = 'Adorable' (id:1)
>>> select trait <<< in DECK -> selected trait = 'Adrenalized' (id:2)
>>> select trait <<< in DECK -> selected trait = 'Agile' (id:3)
>>> play <<< 'Lisa' is playing 'Agile' (id:3)
>>> dominants <<< in trait piles: Lisa = 0 / Julia = 0 / Anton = 0 / Adam = 0
>>> genes <<< 'Lisa's 'Fey' (id:113) has gene effect off '1' on 'all' -> current effect: [1, 1, 1, 1]
>>> genes <<< 'Lisa's 'Fey' (id:114) has gene effect off '1' on 'all' -> current effect: [2, 2, 2, 2]
>>> total gene effect: [2, 2, 2, 2] -> current gene pools are [8, 8, 8, 8]
>>> scoring <<< 'Lisa's current points: face=3 | drops=2 | WE=0 | MOL=0 | total=5
>>> scoring <<< 'Julia's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Anton's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Adam's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> select trait <<< in DECK -> selected trait = 'Acrobatic' (id:0)
>>> select trait <<< in DECK -> selected trait = 'Amatoxins' (id:5)
>>> select trait <<< in DECK -> selected trait = 'Ancient' (id:6)
>>> select trait <<< in DECK -> selected trait = 'Ancient' (id:7)
>>> play <<< 'Lisa' is playing 'Ancient' (id:7)
>>> dominants <<< in trait piles: Lisa = 0 / Julia = 0 / Anton = 0 / Adam = 0
>>> genes <<< 'Lisa's 'Fey' (id:113) has gene effect off '1' on 'all' -> current effect: [1, 1, 1, 1]
>>> genes <<< 'Lisa's 'Fey' (id:114) has gene effect off '1' on 'all' -> current effect: [2, 2, 2, 2]
>>> total gene effect: [2, 2, 2, 2] -> current gene pools are [8, 8, 8, 8]
>>> scoring <<< 'Lisa's current points: face=5 | drops=3 | WE=0 | MOL=0 | total=8
>>> scoring <<< 'Julia's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Anton's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Adam's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> select trait <<< in DECK -> selected trait = 'Acrobatic' (id:0)
>>> select trait <<< in DECK -> selected trait = 'Antlers' (id:9)
>>> play <<< 'Lisa' is playing 'Antlers' (id:9)
>>> dominants <<< in trait piles: Lisa = 0 / Julia = 0 / Anton = 0 / Adam = 0
>>> genes <<< 'Lisa's 'Fey' (id:113) has gene effect off '1' on 'all' -> current effect: [1, 1, 1, 1]
>>> genes <<< 'Lisa's 'Fey' (id:114) has gene effect off '1' on 'all' -> current effect: [2, 2, 2, 2]
>>> total gene effect: [2, 2, 2, 2] -> current gene pools are [8, 8, 8, 8]
>>> scoring <<< 'Lisa's current points: face=8 | drops=3 | WE=0 | MOL=0 | total=11
>>> scoring <<< 'Julia's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Anton's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
>>> scoring <<< 'Adam's current points: face=0 | drops=0 | WE=0 | MOL=0 | total=0
42 changes: 24 additions & 18 deletions doompy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,12 +912,12 @@ def update_manual_we(cur_value: int, p: int, change: str) -> None:
create_trait_pile(frame_trait_pile[p], p)


def update_manual_drops(cur_value: str, trait: int, change: str) -> None:
def update_manual_drops(cur_value: int, trait: int, change: str) -> None:
# change value according to button
if change == '+':
value = int(cur_value) + 1
value = cur_value + 1
else:
value = int(cur_value) - 1
value = cur_value - 1

# save value in status_df
status_df.loc[trait, 'drops'] = value
Expand Down Expand Up @@ -1362,15 +1362,15 @@ def create_trait_pile(frame_trait_overview: tk.Frame, p: int) -> None:
irow += 1
ypad = (3, 0) if irow == 0 else 0

# ----- radiobutton / label if attachment --------------------------------------------------
# ----- radiobutton / label if attachment or dominant --------------------------------------
if traits_df.loc[trait_idx].attachment == 1:
lbl = tk.Label(frame_trait_overview,
text=" " + trait,
image=images["attachment"],
compound=tk.LEFT)
lbl.grid(row=irow, column=0, padx=2, pady=ypad, sticky='nsw')

# it also could be a DOMINANT
# it attachment is also could be a DOMINANT
if traits_df.loc[trait_idx].dominant == 1:
lbl.config(fg=cfg["font_color_dominant"], font="'' 14 bold")
elif traits_df.loc[trait_idx].dominant == 1:
Expand All @@ -1382,10 +1382,15 @@ def create_trait_pile(frame_trait_overview: tk.Frame, p: int) -> None:
font="'' 14 bold"
).grid(row=irow, column=0, padx=2, pady=ypad, sticky='nsw')
else:
# check if trait has 'noRemove' status
rb_state = 'disabled' if status_df.loc[trait_idx].no_remove else 'normal'

# create radiobutton
tk.Radiobutton(frame_trait_overview,
text=" " + trait,
variable=plr['trait_selected'][p],
value=trait_idx,
state=rb_state,
command=lambda t_idx=trait_idx: write_log(['select', 'trait_pile'],
plr['name'][p].get(),
traits_df.loc[t_idx].trait,
Expand Down Expand Up @@ -1686,8 +1691,8 @@ def create_trait_pile(frame_trait_overview: tk.Frame, p: int) -> None:
width=3,
wrap=False)
drop_sbox.grid(row=irow, column=1, sticky='w')
drop_sbox.bind("<<Increment>>", lambda e, t=trait_idx: update_manual_drops(e.widget.get(), t, '+'))
drop_sbox.bind("<<Decrement>>", lambda e, t=trait_idx: update_manual_drops(e.widget.get(), t, '-'))
drop_sbox.bind("<<Increment>>", lambda e, t=trait_idx: update_manual_drops(int(e.widget.get()), t, '+'))
drop_sbox.bind("<<Decrement>>", lambda e, t=trait_idx: update_manual_drops(int(e.widget.get()), t, '-'))

# fill spinbox, depending on drops_status
if not np.isnan(status_df.loc[trait_idx].drops):
Expand Down Expand Up @@ -1992,19 +1997,16 @@ def create_name_entries(frame_menu_names: tk.Frame) -> None:
ttk.Label(frame_menu_names, text="keep order", style="menu_h2.TLabel"
).grid(row=0, column=1, columnspan=2, pady=(0, 5), sticky='w')

# fix 1st player radiobutton if outside
if options['first_player'].get() > (options['n_player'].get()-1):
options['first_player'].set(options['n_player'].get()-1)

# name entries ---
for i in range(options['n_player'].get()):
# name entries --- at least as much as current players, or more for next game
for i in range(max([game['n_player'], options['n_player'].get()])):
ttk.Label(frame_menu_names, text="player {}: ".format(i+1)
).grid(row=i+1, column=0, sticky='e')
ttk.Entry(frame_menu_names, textvariable=options['names'][i], width=5
).grid(row=i+1, column=1, sticky='we')
tk.Radiobutton(frame_menu_names,
variable=options['first_player'],
value=i,
state='normal' if i+1 <= game['n_player'] else 'disabled',
command=lambda: update_first_player()
).grid(row=i+1, column=2, sticky='e')

Expand Down Expand Up @@ -2283,6 +2285,10 @@ def reset_variables() -> None:
game['n_catastrophes'] = options['n_catastrophes'].get()
game['n_MOLs'] = options['n_MOLs'].get()

# update first player if not playing anymore
if options['first_player'].get()+1 > game['n_player']:
options['first_player'].set(game['n_player']-1)

# reset _player_ variables
plr['name'].clear()
plr['genes'].clear()
Expand Down Expand Up @@ -2482,14 +2488,14 @@ def start_game() -> None:

# tk_inter_variables -------------------------------------------------------------------------------
options = {}
options['n_player'] = tk.IntVar(value=cfg["n_player"]) # OPTIONS: number of players
options['n_genes'] = tk.IntVar(value=cfg["n_genes"]) # OPTIONS: gene pool at beginning
options['n_player'] = tk.IntVar(value=cfg["n_player"]) # OPTIONS: number of players
options['n_genes'] = tk.IntVar(value=cfg["n_genes"]) # OPTIONS: gene pool at beginning
options['n_catastrophes'] = tk.IntVar(value=cfg["n_catastrophes"]) # OPTIONS: number of catastrophes
options['n_MOLs'] = tk.IntVar(value=cfg["n_MOLs"]) # OPTIONS: number of MOLs
options['n_MOLs'] = tk.IntVar(value=cfg["n_MOLs"]) # OPTIONS: number of MOLs
options['names'] = []
for i in range(len(cfg["names"])):
options['names'].append(tk.StringVar(value=cfg["names"][i])) # OPTIONS: name of players
options['first_player'] = tk.IntVar(value=0) # OPTIONS: set current first player
options['names'].append(tk.StringVar(value=cfg["names"][i])) # OPTIONS: name of players
options['first_player'] = tk.IntVar(value=0) # OPTIONS: RADIOBUTTON - first player

str_trait_search = tk.StringVar(value="") # string searching for traits in DECK
deck_filtered_str = tk.Variable(value="") # _filtered_ deck of traits_strings in listbox after searching -> str
Expand Down

0 comments on commit 91ac449

Please sign in to comment.