{"id":31009378,"url":"https://github.com/robhurring/dopewars","last_synced_at":"2025-09-13T04:34:46.440Z","repository":{"id":1480004,"uuid":"1725183","full_name":"robhurring/dopewars","owner":"robhurring","description":"Generic dopewars game written in java and connected with swing","archived":false,"fork":false,"pushed_at":"2017-09-28T12:42:21.000Z","size":441,"stargazers_count":21,"open_issues_count":1,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-13T19:19:38.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robhurring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-09T22:50:38.000Z","updated_at":"2023-11-11T16:11:05.000Z","dependencies_parsed_at":"2022-07-29T17:48:55.225Z","dependency_job_id":null,"html_url":"https://github.com/robhurring/dopewars","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robhurring/dopewars","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhurring%2Fdopewars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhurring%2Fdopewars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhurring%2Fdopewars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhurring%2Fdopewars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robhurring","download_url":"https://codeload.github.com/robhurring/dopewars/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robhurring%2Fdopewars/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274919764,"owners_count":25373953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-13T04:34:40.765Z","updated_at":"2025-09-13T04:34:46.424Z","avatar_url":"https://github.com/robhurring.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Java Tradewars\n=============\n\nJava Tradewars is a generic dopewars-like engine that can be easily re-themed. There is no XML (thank god) to configure, just straight java. This project is themed\nto dopewars as an homage to one of my favorite oldschool games :)\n\nI tried to keep the tradewars package outside of swing where I could, so it can be easily adapted to a console game if you wanted. \n\nScreenshots\n-----------\n\n![Tradewars](http://0rcus.com/i/tradewars/tradewars-1.png \"TradeWars\")\n\n![Tradewars Event](http://0rcus.com/i/tradewars/tradewars-4.png \"TradeWars - Event\")\n\n![Tradewars Fight](http://0rcus.com/i/tradewars/tradewars-2.png \"TradeWars - Fight!\")\n\n![Tradewars Trade](http://0rcus.com/i/tradewars/tradewars-3.png \"TradeWars - Trade\")\n\nCustomization\n-------------\n\nCustomizing this game is done in the `tradewars.Game` file. Here is the general list of things to customize:\n\n* Events: these are things that happen while moving around\n  * Finding cash/stuff on the ground\n  * Fights\n  * Healing events\n  * Bigger coat\n  * etc.\n* NPCs: these are the bad guys you fight\n* Products: these are what can be bought/sold at the marketplace\n* Locations: where to go?\n\nCustomizing Products\n--------------------\n\nTo create a custom product you need a few things\n\n    new Product(String name, int lowPrice, int highPrice[, String lowMessage, String highMessage]);\n    \n    // Example\n    new Product(\"Product Name\", 100, 500);\n    new Product(\"Product Name\", 100, 500, \"%s prices have bottomed out!\", \"%s prices are at an all-time high!\");\n    \n    // Add a bunch to Game.java\n    final static private Product[] products = {\n      new Product(\"Product Name\", 100, 500)\n    };\n    \nand you're off the the races. The movement will randomize the prices between the high and low numbers. Randomly the prices will spike. You can adjust this in the\n`Product.EVENT_CHANCE` constant.\n\nCustomizing Locations\n---------------------\n\nThis is run almost exactly like products. You specify an array of `Locations` to the game class to use. Each location can use a customized array of products.\n  \n    new Location(String name, Product[] products_to_sell);\n    \n    // Add a bunch to Game.java\n    final static private Location[] locations = {\n        new Location(\"Coney IslaLocationnd\", products),\n        new Location(\"Manhattan\", products)\n    };\n    \nCustomizing NPCs\n----------------\n\nIf you chose to enable fights, these are the guys that randomly appear. The `Game.startFight` method will try to match levels with the player if one is given,\notherwise it is randomized.\n\n    new Npc(String name, int maxHealth, int strength, int defense, long low, long high[, int level]);\n    \n    // Example:\n    new Npc(\"Bossman\", 500, 25, 5, 1000, 3000, 5);\n    \n    // Add a bunch to Game.java\n    final static private Npc[] npcs = {\n        new Npc(\"Street Thug\", 20, 20, 5, 2000, 5000, 1)\n    };\n    \nBossman will only show up when the player is level 5+ and will reward between 1-3k cash.\n\nCustomizing Events\n------------------\n\nEvents are a bit trickier since they can encompass so many different things. A generic event will have access to the game, player and return messages. There are\n2 basic ways events are used.\n\n1. Prompt the user for an action and request a response (yes/no)\n2. Notify the user of something that happened (no response necessary)\n\n\nTo trigger an event the `inEvent()` method should return true. there is a `hit` helper to assist with this -- pass in a number and it will match a random number against\nit. For examples of events, check the `tradewars.events` package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobhurring%2Fdopewars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobhurring%2Fdopewars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobhurring%2Fdopewars/lists"}