The DOS game from the 80s re-written in Python from Scratch!

Overview



Drugwars

The DOS game from the 80s re-written in Python from Scratch!

Play in your browser Here

Installation

Recommended: Using pip

pip3 install drugwars

# To Update
pip3 install --upgrade drugwars

Installing from source

git clone https://github.com/M4cs/drugwars
cd drugwars
python3 setup.py install
drugwars

How to Play

Gameplay

The game is played inside of your terminal and uses letters and numbers to select things and take part actions.

You start with 2000 dollars and 5500 dollars in debt to the loan shark. The goal of the game is to pay off the loan shark and get as much money as possible while avoiding cops or getting mugged.

Cops can shoot at you and you have 20 hit points until you die and the game ends. You are able to purchase guns occasionally which will give you a chance to kill the cops.

You have 30 days to buy and sell as many drugs as possible to make a profit. Prices are randomly generated so it's all dependent on the market in the area you're at.

There are events that can happen inbetween moving areas. These can either be good for you or bad, it's all random.

You have access to a bank and stash in the Bronx which allows you to store money and drugs to keep them safe while getting mugged or caught by the cops.

Rules

  • You cannot go back to a location if you have chosen jet, you must travel somewhere else.
  • You can only go to the loan shark, bank, and stash in the Bronx.
  • You only have 30 days to make your money and pay back the loan shark.
  • Your debt increases each day with interest so pay it back ASAP
  • Your savings will increase each day with interest as well.

Controls

When asked yes or no questions: Respond with y or n

When asked to (B)uy, (S)ell, or (J)et: Respond with b to buy, s to sell, or j to jet

When asked to (R)un or (F)ight: Respond with r to run, or f to fight

When asked where to go: Respond with a number 1-6, these correspond to a location on the table

Troubleshooting

I pressed buy or sell and I didn't mean to!

Simply choose a drug and set 0 as the quantity.

I jetted but want to go back.

You can't this is a game mechanic. Be careful with your choices!

Why did I make this?

Drugwars is a game I've been playing for a long time, well before I learned how to program. Now that I'm apt in Python I thought what the hell, why not rewrite a game I love in Python and release it. Well that's what I'm doing and here it is. Enjoy :)

Changelog

v1.3 (by aconamos)

- Added "a"/"all", "h"/"half", and percent values to selling/buying drugs
- Added amount of days option
- Fixed score going into negative

v1.2.1

- Fix End Game
- Add Endgame
- Change Coat Probability

v1.2.0

- Optimized Drug Stashes
- Optimized Stash Menu
- Optimized Classes
- Optimized Helpers
- Bug Fixes
- Added Withdraw to Stash (it was missing lol)

v1.1.10

- Adds "a"/"all" and "h"/"half" features in Loan Shark and Bank

v1.1.9

- Fix infinite loop in Issue #2

v1.1.8

- Added difficulty screen

v1.1.7

- Fix loan shark balance
- Fix input bugs

v1.1.6:

- Fix borrowing

v1.1.5:

- Fix actions breaking

v1.1.4:

- Remove Auto update

v1.1.3:

- Fix logic around pricing events

v1.1.2:

- Disable Actions from occuring first round

v1.1.1:

- Adds auto update check (Set DO_NOT_UPDATE to 1 to skip)

v1.1.0:

- Adds upgrade trench coat
- Changes chances of getting away from Headass
- Fixes crashing bugs
Comments
  • Blank input when selecting drug causes crash

    Blank input when selecting drug causes crash

    Steps to Reproduce

    1. Launch
    2. Enter to play
    3. B to buy
    4. Hit enter without entering anything
    Traceback (most recent call last):
      File "/home/nick/.pipx/bin/drugwars", line 8, in <module>
        sys.exit(main())
      File "/home/nick/.pipx/venv/venvs/drugwars/lib/python3.8/site-packages/drugwars/__main__.py", line 32, in main
        display_pricing_screen(p)
      File "/home/nick/.pipx/venv/venvs/drugwars/lib/python3.8/site-packages/drugwars/events.py", line 423, in display_pricing_screen
        if not check_drug_inp(buy):
      File "/home/nick/.pipx/venv/venvs/drugwars/lib/python3.8/site-packages/drugwars/helpers.py", line 12, in check_drug_inp
        if a[0].lower() == "c":
    IndexError: string index out of range
    

    Most other prompts tolerate missing input

    opened by nicktimko 2
  • Variable 'p' not defined in cops_chase

    Variable 'p' not defined in cops_chase

    events.py Lines: 25, 39 Variable 'p' is not defined in cops_chase Variable 'player' is passed in, p should be replaced with player

    Traceback Traceback (most recent call last): File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main return run_code(code, main_globals, None, File "c:\program files\python38\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Program Files\Python38\Scripts\drugwars.exe_main.py", line 7, in File "c:\program files\python38\lib\site-packages\drugwars_main.py", line 39, in main main_screen(p) File "c:\program files\python38\lib\site-packages\drugwars\events.py", line 597, in main_screen main_screen(p) File "c:\program files\python38\lib\site-packages\drugwars\events.py", line 597, in main_screen main_screen(p) File "c:\program files\python38\lib\site-packages\drugwars\events.py", line 597, in main_screen main_screen(p) [Previous line repeated 6 more times] File "c:\program files\python38\lib\site-packages\drugwars\events.py", line 549, in main_screen achoice(p) File "c:\program files\python38\lib\site-packages\drugwars\events.py", line 548, in achoice = choice([lambda p: cops_chase(p), lambda p: buy_gun(p), lambda p: get_mugged(p), lambda p: find_drugs(p)]) File "c:\program files\python38\lib\site-packages\drugwars\events.py", line 79, in cops_chase pdrug = p.get_amt(drug) NameError: name 'p' is not defined

    bug 
    opened by aconamos 1
  • Infinite loop on cops chase

    Infinite loop on cops chase

    events.py Wrong variable in if statement Lines 22 and 46

    currently: if a == 1: # run sequence elif a == 2: # fight sequence

    fix: if aout == 1: # run sequence elif aout == 2: # fight sequence

    opened by aconamos 1
  • Made some changes I was interested in, fixed a bug

    Made some changes I was interested in, fixed a bug

    Made it so you can select amount of days, use "a"/"all", "h"/"half", and percent values in sell and buy menus, fixed a bug

    opened by aconamos 0
  • Suggestion: ability to type 'a' or 'all' during loan shark, bank, and more

    Suggestion: ability to type 'a' or 'all' during loan shark, bank, and more

    During the banking and especially the loan shark sequence after jetting to Bronx, typing in the exact number to repay your debt is a little tedious. It's not that big of a deal, but I think it would be cool to be able to type in 'a', 'all', 'half', or a percent value to select exactly how much you want. This could also be applied to buying drugs in amounts depending on how many you can potentially buy.

    Loving the game btw

    enhancement in progress 
    opened by aconamos 2
Owner
Max Bridgland
QA Engineer @ Reggora | Multi-Language Developer | FOSS Advocate
Max Bridgland
Blender Game Engine Game Type Templates Logic Bricks (and Python script) based Game Templates for Blender

Blender-Game-Engine-Templates Blender Game Engine Game Type Templates Logic Bric

null 3 Oct 25, 2022
Mandaw 2 Mar 1, 2022
Average Clicker Game (AVG) is a Python made game using tkinter

Average-Clicker-Game Average Clicker Game (AVG) is a Python clicker game not made with pygame but with tkinter, it has worker, worker upgrades, times

Zacky2613 1 Dec 21, 2021
Ice-Walker-Game - This repository is about the Ice Walker game made in Python.

Ice-Walker-Game Ce dépot contient le jeu Ice Walker programmé en Python. Les différentes grilles du jeu sont contenues dans le sous-dossier datas. Vou

Mohamed Amine SABIL 1 Jan 2, 2022
Adventure-Game - Adventure Game which is created using Python

Adventure Game ?? This is a Adventure Game which is created using Python. Featur

ArinjoyTheDev 1 Mar 19, 2022
Game-of-life - A simple python program to simulate and visualise the Conway's Game of life

Conway's game of life A simple python program to simulate and visualise the Conw

Dhravya Shah 3 Feb 20, 2022
Snake game mixed with Conway's Game of Life

SnakeOfLife Snake game mixed with Conway's Game of Life The rules are the same than a normal snake game but you have to avoid cells created by Conway'

Aidan 5 May 26, 2022
Lint game data metafiles against GTA5.xsd for Rockstar's game engine (RAGE)

rage-lint Lint RAGE (only GTA5 at the moment) meta/XML files for validity based off of the GTA5.xsd generated from game code. This script accepts a se

GoatGeek 11 Sep 18, 2022
HTTP API for FGO game data. Transform the raw game data into something a bit more manageable.

FGO game data API HTTP API for FGO game data. Transform the raw game data into something a bit more manageable. View the API documentation here: https

Atlas Academy 51 Dec 26, 2022
A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras.

dinoGame A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras. Installation Download

null 1 Oct 26, 2021
Quantum version of the classical Nim game. An automatic opponent allows to game to not be as easy as it seems.

Nim game Running the game To run the program just launch : python3 game.py Rules This game is inspiring from the Nim game. You are 2 players face to f

Michaël 1 Jan 8, 2022
Deal Or No Deal was a very popular game show. Even now, for a family party, it's a fun game to pass time

Deal Or No Deal was a very popular game show. Even now, for a family party, it's a fun game to pass time. I made a code to play the game right in your terminal/console. This isn't made to be a game which can be installed by everyone and played, I just made it as a fun project as I just started out with python. So if you have python installed and wanna have some fun, or just curious to see how I did this, feel free to check the code out!

null 1 Feb 15, 2022
Mastermind-Game - A game to test programming and logical skills

Bem vindo ao jogo Mastermind! O jogo consiste em adivinhar uma senha que será ge

Marcelo Daros 0 Jan 27, 2022
Quiz Game: answering questions naturally with a friendly UI to enjoy the game

About Quiz Game : The Game is about answering questions naturally with a friendl

null 4 Jan 19, 2022
This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle

Pyal Telegram Bot This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle. How does it work? Differently from the ori

Rafael Omiya 4 Oct 6, 2022
A terminal-based number guessing game written in python

A terminal-based number guessing game written in python

Akshay Vs 15 Sep 22, 2022
This Country Hangman game written in Python.

country-name-guess-hangman-game This Country Hangman game written in Python. Visit https://example.com to play the game. Description How to play this

Aytaç Kaşoğlu 1 Oct 30, 2021
Arcade-like space shooter game written entirely in python

E.T.-Attack Arcade-like space shooter game written entirely in python Project description A space shooter game - inspired by the legendary game Space

Sven Eschlbeck 2 Dec 17, 2022
Among Us Editor written in Python, for newer versions of the game

Among Us Editor Remake Among Us Editor written in Python, for newer versions of the game. Credits GUI Code by Vresod Data dumping and some GUI code by

Vresod 7 Nov 18, 2022