CSSBot_Py icon indicating copy to clipboard operation
CSSBot_Py copied to clipboard

added battle-game framework (WIP)

Open cforcomputer opened this issue 1 year ago • 6 comments

Add a minigame that allows users to wage war on each other. When the user uses the command >>join_skeletons or >>join_ghouls it puts them on a side. Then they are provided a message with their new commands.

>>base = displays a list of current structures (command center, refinery, graveyard-emits ghoul tokens or skeletons depending on the side. These are used for currency to buy new buildings or units. These add to the pool of currency every hour. The watchtower adds a power multiplier to the player's army.

>>units = displays a list of units, the combined power level (each unit has a power level), ghouls, wraiths, ghosts, zombies, giant ghoul (For the ghouls side), the skeletons can only buy skeletons and "The mummy". The mummy is extremely expensive comparatively and is a "doomsday" weapon that must be bought in stage. Like the arm, the leg, a second leg, the head, etc. When all are purchased, it provides the player a complete mummy. Some users have way too much currency, so to make it fair, users have to wait for construction to finish, and must build a barracks to support more units. This is limited to one barracks per day. Costs should range from 20 to 100 ghoul tokens, and 100 to 1000 skelecoins (skelecoins given 3x cost multiplier).

>>buy unitname | structurename = Shared command to buy structures and units. Extra checks to make sure you can only buy a unit on a specific side.

>>battle @username = will initiate an attack against a user if they have a base or units. If the user wins, they get 20% of the users currency. If they lose, they lose 50% of their currency (if they are an attacker). This calculates and displays the results of the battle in a message box. It uses some RNG + the power level. It shows a result of which units died. More powerful units are less likely to die. It also describes the battle outcome from a list of text strings. like: "The skelelord valiantly destroyed the ghoul king. The skeletons were impressed and have stabbed Brandon Fraser. This is unfortunate." If a player loses a battle, some of their buildings are destroyed randomly, but only the less important ones (more likely, very low chance for a more important one to be destroyed). If a player loses their command center, they lose the game. This can only be destroyed after all the other buildings are destroyed.

>>spooky_bases = shows a list of all the available player bases to attack. This should update to show the "danger level" based on the strength of the defending army.

>>battle_history = shows a list of past 10 battles and their outcomes.

cforcomputer avatar Oct 29 '24 09:10 cforcomputer

The refinery structure should refine "Bones" gathered from the graveyard into "Bonemeal". For the ghoul side it should be "Ectoplasm" which is refined into Cursed meat.

  • Refinery output increases when there are more graveyards.

  • There can only be one refinery.

These resources are used to buy units instead of coins. The structures are bought with coins, but they take an hour to build.

cforcomputer avatar Oct 29 '24 09:10 cforcomputer

pls make work idk how to run it

cforcomputer avatar Oct 29 '24 12:10 cforcomputer

Update is called twice when initializing the spooky_state, creating a duplicate when leads to broken currency saving. Trying to find the cause.

cforcomputer avatar Oct 29 '24 15:10 cforcomputer

Ready to test for battles I think. Note: changes to async init are a requirement in newest version of discord py

NO lots of things to fix but it's getting there!

cforcomputer avatar Oct 29 '24 21:10 cforcomputer

Okay that's enough effort expended... still need to test raids and win/lose. Most things look like they are working

cforcomputer avatar Oct 30 '24 11:10 cforcomputer

Final game commands

  • expedition = can perform once per day if you have beanglove or brendan fraser, chance to find a special artifact
  • raid = less dramatic battle that doesn't destroy structures, 50% chance to steal opponent resources, failure results in unit loss.
  • build = specific command for building buildings one more multiple. Uses respective faction currency.
  • buy = command for buying units one or multiple. Uses faction resources.
  • spooky_bases = shows danger level of player bases based on power level ratio.
  • units = shows list of bought units, relevant artifacts, effects, and available units to buy
  • base = shows base buildings, relevant artifacts, effects, and available buildings to build
  • battle = significant battle with large resource gain or loss. Destroys buildings. Can destroy player command centers, triggering a game lost condition, resetting player stats and resources
  • battle_history = shows the results of the last 10 battles if no server restart

NOTES:

  • Changed def setup to async so that it works with the latest discord.py version, might need to change it back for old version.
  • Resource state updates based on unix time difference from last command interaction that required game resources.
  • I have not fully tested the raids and battles yet. Losing is probably broken... maybe not
  • Black formatter changed some things, i don't care

cforcomputer avatar Oct 30 '24 11:10 cforcomputer