views:

124

answers:

1

Not really a c/c++ person so I was hoping someone could direct me to the files that contain the main calculations of the game?

I am specifically interested in how things are calculated when deciding if the person 'wins' or 'loses' (generally speaking) during events like running/standing/etc.

In other words, winning/losing will be based on many factors: what are they? What are the formulae?

+1  A: 

You didn't reference the source, so I Googled DopeWars and found this: http://dopewars.sourceforge.net/

Looking into the source, serverside.h/c seems to be what you are looking for. But keep in mind a lot of the limits are already predefined in dopewars.c. Take a look at the drug prices in this struct:

struct DRUG DefaultDrug[] = {
  /* The names of the default drugs, and the messages displayed when they
   * are specially cheap or expensive */
  {N_("Acid"), 1000, 4400, TRUE, FALSE,
   N_("The market is flooded with cheap home-made acid!")},
  {N_("Cocaine"), 15000, 29000, FALSE, TRUE, ""},
}

Note: sample struct is not complete. Please review the source to see the full listing.

The actual functionality that validates the actions chosen by the player exists in serverside.c.

It is up to the "server" (game engine) to validate the players choice and next step to be taken and communicate it back to the client. The client in this case can be a GUI or Curses (command line) driven client. It is the clients responsibility to update the screen, get new input from the server (be it typing characters for input or mouse clicks).

Mark