Skip to content

Instantly share code, notes, and snippets.

@mlfarrell
Created December 3, 2018 19:43
Show Gist options
  • Save mlfarrell/6ab300cb78898bfb729ba91511950b10 to your computer and use it in GitHub Desktop.
Save mlfarrell/6ab300cb78898bfb729ba91511950b10 to your computer and use it in GitHub Desktop.
/* MONOPOFUCK YO MAMMA A game written by Mike Farrel for Fun *
* To Change names, and starting money, edit the initial settings *
* of the player and property structs. Just make sure to keep *
* a backup of the original source code *
*/
/* Comment made on 2/19/2002: This code is really fucking bad! *
* I'm going to try to salvage what I can and renovate what doesn't *
* work properly */
#include <allegro.h>
#include <stdio.h>
#include <string.h>
//#include <conio.h>
#include "data.h"
#define p1 1
#define p2 2
#ifdef ALLEGRO_WINDOWS
#define random() rand()
#define srandom(x) srand(x)
#endif
DATAFILE *data;
RLE_SPRITE *die_1;
RLE_SPRITE *die_2;
int num;
int num2;
int irs = TRUE;
int chance_pos;
int shit_pos;
int _select = TRUE;
int cx;
int cy;
int begin = TRUE;
int virtual = FALSE;
int game_running = TRUE;
int white;
int black;
int red;
int green;
int blue;
int yellow;
int doubles = FALSE;
int pass_fuck = FALSE;
int win = FALSE;
int mute = FALSE;
float rent_bias = 1;
float buy_bias = 1;
int bias_affected = 0;
char buf1[50] = "";
char buf2[50] = "";
int turn = 0;
BITMAP *buffer;
BITMAP *title;
typedef struct player
{
char *name;
int money;
int on;
int hell;
RLE_SPRITE *piece;
} player;
typedef struct property
{
int x;
int y;
struct player *owned_by;
int price;
int rent;
int one;
int two;
int three;
int four;
int five;
int house_cost;
char *name;
BITMAP *pic;
int houses;
int col;
} property;
player *player_1;
player *player_2;
player *who;
struct property *board[40];
//PROTOTYPES//////////////////////
void update_screen();
void _alarm(char *text, int x, int y, int wt, int ht);
void roll_die();
void move_piece(int amount);
void auction();
void do_machine_gun(int skip);
void p_buy();
void do_shitbox();
void bankrupt();
void do_chance();
void crackhouse();
void garbage_heap();
void show_shit();
void buy_houses();
void clear_keybuf2();
void end_turn();
void buy_houses()
{
char name_buf[100];
property *to_build;
int pos = 1;
int property_num;
int num_houses;
int checker = FALSE;
top:
_select = TRUE;
clear_keybuf2();
//printf("%d", _select);
//readkey();
clear_keybuf2();
while(_select == TRUE)
{
if(key[KEY_RIGHT]) pos++;
if(key[KEY_LEFT]) pos--;
if(key[KEY_ESC]) return;
if(key[KEY_ENTER]) _select = pos;
clear_keybuf2();
if(pos > 8) pos = 8;
if(pos < 0) pos = 0;
clear_to_color(buffer, makecol(0, 0, 0));
textout_centre(buffer, data[main_font].dat, "Pick one", 320, 5, makecol(255, 255, 255));
if(board[1]->owned_by == who && board[3]->owned_by == who)
checker = TRUE;
if(board[6]->owned_by == who && board[8]->owned_by == who && board[9]->owned_by == who)
checker = TRUE;
if(board[11]->owned_by == who && board[13]->owned_by == who && board[14]->owned_by == who)
checker = TRUE;
if(board[16]->owned_by == who && board[18]->owned_by == who && board[19]->owned_by == who)
checker = TRUE;
if(board[21]->owned_by == who && board[23]->owned_by == who && board[24]->owned_by == who)
checker = TRUE;
if(board[26]->owned_by == who && board[27]->owned_by == who && board[29]->owned_by == who)
checker = TRUE;
if(board[31]->owned_by == who && board[32]->owned_by == who && board[34]->owned_by == who)
checker = TRUE;
if(board[37]->owned_by == who && board[39]->owned_by == who)
checker = TRUE;
if(pos == 1)
{
if(board[1]->owned_by == who && board[3]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[3]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 2)
{
if(board[6]->owned_by == who && board[8]->owned_by == who && board[9]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[6]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 3)
{
if(board[11]->owned_by == who && board[13]->owned_by == who && board[14]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[11]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 4)
{
if(board[16]->owned_by == who && board[18]->owned_by == who && board[19]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[16]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 5)
{
if(board[21]->owned_by == who && board[23]->owned_by == who && board[24]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[21]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 6)
{
if(board[26]->owned_by == who && board[27]->owned_by == who && board[29]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[26]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 7)
{
if(board[31]->owned_by == who && board[32]->owned_by == who && board[34]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[31]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(pos == 8)
{
if(board[37]->owned_by == who && board[39]->owned_by == who)
{
sprintf(name_buf, "the %s group", board[39]->name);
textout_centre(buffer, data[main_font].dat, name_buf, 320, 240, makecol(255, 255, 255));
checker = TRUE;
}
}
if(checker == FALSE)
{
_alarm("Not gonna do it", 170, 215, 150, 25);
clear_keybuf2();
readkey();
return;
}
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
_alarm("Which property?", 170, 215, 150, 200);
textout(screen, font, "A - 1", 175, 240, makecol(255, 255, 255));
textout(screen, font, "B - 2", 175, 250, makecol(255, 255, 255));
textout(screen, font, "C - 3", 175, 260, makecol(255, 255, 255));
_select = TRUE;
clear_keybuf2();
while(_select == TRUE)
{
if(key[KEY_A]) _select = 1;
if(key[KEY_B]) _select = 2;
if(key[KEY_C]) _select = 3;
}
property_num = _select;
if(property_num == 3 && pos == 1)
{
_alarm("no 3 in this group", 170, 215, 150, 25);
clear_keybuf2();
readkey();
goto top;
}
if(property_num == 3 && pos == 8)
{
_alarm("no 3 in this group", 170, 215, 150, 25);
clear_keybuf2();
readkey();
goto top;
}
if(pos == 1)
{
if(property_num == 1) to_build = board[1];
if(property_num == 2) to_build = board[3];
}
if(pos == 2)
{
if(property_num == 1) to_build = board[6];
if(property_num == 2) to_build = board[8];
if(property_num == 3) to_build = board[9];
}
if(pos == 3)
{
if(property_num == 1) to_build = board[11];
if(property_num == 2) to_build = board[13];
if(property_num == 3) to_build = board[14];
}
if(pos == 4)
{
if(property_num == 1) to_build = board[16];
if(property_num == 2) to_build = board[18];
if(property_num == 3) to_build = board[19];
}
if(pos == 5)
{
if(property_num == 1) to_build = board[21];
if(property_num == 2) to_build = board[23];
if(property_num == 3) to_build = board[24];
}
if(pos == 6)
{
if(property_num == 1) to_build = board[26];
if(property_num == 2) to_build = board[27];
if(property_num == 3) to_build = board[29];
}
if(pos == 7)
{
if(property_num == 1) to_build = board[31];
if(property_num == 2) to_build = board[32];
if(property_num == 3) to_build = board[34];
}
if(pos == 8)
{
if(property_num == 1) to_build = board[37];
if(property_num == 2) to_build = board[39];
}
clear_keybuf2();
_alarm("How many?", 170, 215, 150, 200);
textout(screen, font, "A - 1", 175, 240, makecol(255, 255, 255));
textout(screen, font, "B - 2", 175, 250, makecol(255, 255, 255));
textout(screen, font, "C - 3", 175, 260, makecol(255, 255, 255));
textout(screen, font, "D - 4", 175, 270, makecol(255, 255, 255));
textout(screen, font, "E - 5 (hotel)", 175, 280, makecol(255, 255, 255));
_select = TRUE;
while(_select == TRUE)
{
if(key[KEY_A]) _select = 1;
if(key[KEY_B]) _select = 2;
if(key[KEY_C]) _select = 3;
if(key[KEY_D]) _select = 4;
if(key[KEY_E]) _select = 5;
}
clear_keybuf2();
num_houses = _select;
if((to_build->houses + num_houses) > 5)
{
_alarm("Too many houses", 170, 215, 150, 25);
readkey();
goto top;
}
if((who->money - (to_build->house_cost * num_houses)) < 0)
{
_alarm("Not enough moneys", 170, 215, 150, 25);
readkey();
goto top;
}
to_build->houses += num_houses;
who->money -= (to_build->house_cost * num_houses);
}
void show_shit()
{
property *owned[40];
int num_owned = 0, owned_pos = 0, i;
char *msg = "Your shit:";
player *other;
if(who == player_1)
other = player_2;
else other = player_1;
for(i = 0; i < 40; i++)
{
if(board[i]->owned_by == who)
{
owned[num_owned] = board[i];
num_owned++;
}
}
if(num_owned == 0)
{
_alarm("You don't own shit motha fucka", 170, 215, 150, 15);
clear_keybuf2();
readkey();
return;
}
while(!key[KEY_SPACE] && !key[KEY_ESC])
{
if(keypressed())
{
int k = readkey() >> 8;
if(k == KEY_LEFT)
{
owned_pos--;
if(owned_pos == -1)
owned_pos = num_owned-1;
clear_keybuf2();
}
else if(k == KEY_RIGHT)
{
owned_pos++;
if(owned_pos == num_owned)
owned_pos = 0;
clear_keybuf2();
}
else if(k == KEY_PGDN)
{
num_owned = owned_pos = 0;
for(i = 0; i < 40; i++)
{
if(board[i]->owned_by == other)
{
owned[num_owned] = board[i];
num_owned++;
}
}
msg = "Your opponent's shit: ";
}
else if(k == KEY_PGUP)
{
num_owned = owned_pos = 0;
for(i = 0; i < 40; i++)
{
if(board[i]->owned_by == who)
{
owned[num_owned] = board[i];
num_owned++;
}
}
msg = "Your shit:";
}
}
clear(buffer);
textout_centre(buffer, data[big_font].dat, msg, 320, 10, makecol(255, 255, 255));
draw_sprite(buffer, owned[owned_pos]->pic, 270, 170);
textout_centre(buffer, data[main_font].dat, "Page Up/Dn toggles players", 320, 410, makecol(255, 255, 255));
textout_centre(buffer, data[main_font].dat, "Press space or ESC to exit this screen", 320, 425, makecol(255, 255, 255));
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
clear_keybuf2();
}
void garbage_heap()
{
int money_int = 0;
char *money_buf;
money_buf = calloc(1, sizeof(char[100]));
num2 = 0;
if(board[12]->owned_by && board[12]->owned_by->name != who->name) num2+= 8;
if(board[28]->owned_by && board[28]->owned_by->name != who->name) num2+= 8;
money_int = (sizeof(who->name)) * num2;
who->money -= money_int;
board[who->on]->owned_by->money += money_int;
//if(who->name != player_1->name) player_1->money += money_int;
//else player2->money += money_int;
sprintf(money_buf, "%s paid $%u", who->name, money_int);
_alarm("", 170, 215, 150, 15);
textout(screen, font, money_buf, 175, 220, makecol(255, 255, 255));
clear_keybuf2();
readkey();
free(money_buf);
if(who->money<1)
{
bankrupt();
}
return;
}
void crackhouse()
{
int money_int = 0;
char *money_buf;
money_buf = calloc(1, sizeof(char[60]));
num2 = 0;
if(board[5]->owned_by && board[5]->owned_by->name != who->name) num2++;
if(board[15]->owned_by != NULL && board[15]->owned_by->name != who->name) num2++;
if(board[25]->owned_by != NULL && board[25]->owned_by->name != who->name) num2++;
if(board[35]->owned_by != NULL && board[35]->owned_by->name != who->name) num2++;
if(num2 == 1) money_int = 69;
if(num2 == 2) money_int = 100;
if(num2 == 3) money_int = 250;
if(num2 == 4) money_int = 1;
who->money -= money_int;
board[who->on]->owned_by->money += money_int;
sprintf(money_buf, "%s paid $%u", who->name, money_int);
_alarm("", 170, 215, 150, 15);
textout(screen, font, money_buf, 175, 220, makecol(255, 255, 255));
clear_keybuf2();
readkey();
free(money_buf);
if(who->money<1)
{
bankrupt();
}
return;
}
void do_chance()
{
BITMAP *chancecard;
if(chance_pos == 1) chancecard = data[chance_01].dat;
if(chance_pos == 2) chancecard = data[chance_02].dat;
if(chance_pos == 3) chancecard = data[chance_03].dat;
if(chance_pos == 4) chancecard = data[chance_04].dat;
if(chance_pos == 5) chancecard = data[chance_05].dat;
if(chance_pos == 6) chancecard = data[chance_06].dat;
if(chance_pos == 7) chancecard = data[chance_07].dat;
if(chance_pos == 8) chancecard = data[chance_08].dat;
if(chance_pos == 9) chancecard = data[chance_09].dat;
if(chance_pos == 10) chancecard = data[chance_10].dat;
if(chance_pos == 11) chancecard = data[chance_11].dat;
if(chance_pos == 12) chancecard = data[chance_12].dat;
if(chance_pos == 13) chancecard = data[chance_13].dat;
if(chance_pos == 14) chancecard = data[chance_14].dat;
//printf("%d\n", shit_pos);
//clear_keybuf2();
//readkey();
if(chance_pos == 1) play_sample(data[funny_05].dat, 255, 127, 1000, 0);
draw_sprite(screen, chancecard, 160, 160);
readkey();
if(chance_pos == 1) who->money = 1;
if(chance_pos == 2)
{
who->on = 39;
move_piece(1);
}
if(chance_pos == 3)
{
board[39]->owned_by = NULL;
board[39]->houses = 0;
}
if(chance_pos == 4)
{
irs = TRUE;
}
if(chance_pos == 5)
{
who->on = 10;
move_piece(1);
}
if(chance_pos == 6)
{
who->hell = TRUE;
who->on = 9;
move_piece(1);
who->hell = TRUE;
}
if(chance_pos == 7)
{
who->on = 11;
move_piece(1);
}
if(chance_pos == 8) who->money -= 50;
if(chance_pos == 9) who->money -= 200;
if(chance_pos == 10)
{
who->money -= 100;
board[20]->owned_by = who;
}
if(chance_pos == 11)
{
who->money -= 500;
if (who->name != player_1->name) player_1->money += 500;
else player_2->money += 500;
}
if(chance_pos == 12) who->money += 1;
if(chance_pos == 13)
{
who->on = 38;
move_piece(1);
buy_bias = 0.5;
rent_bias = 2;
bias_affected = (who == player_1) ? 0 : 1;
}
if(chance_pos == 14)
{
who->money -= 300;
}
if(who->money < 1)
{
bankrupt();
return;
}
chance_pos++;
if(chance_pos == 15) chance_pos = 1;
}
void bankrupt()
{
char *death_buf;
death_buf = calloc(1, sizeof(char[50]));
do_machine_gun(TRUE);
do_machine_gun(TRUE);
clear_to_color(buffer, makecol(0, 0, 0));
num2 = 0;
for(num = 0; num<41; num++)
{
clear(buffer);
draw_rle_sprite(buffer, who->piece, 295, 215);
if(num2 == 1) draw_rle_sprite(buffer, data[wound].dat, 304, 224);
if(num2 == 1) num2 = 0;
else num2 = 1;
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
sprintf(death_buf, "%s ate shit!!!!", who->name);
textout_centre(screen, data[big_font].dat, death_buf,320, 5, makecol(255, 0, 0));
clear_keybuf2();
readkey();
game_running = FALSE;
free(death_buf);
return;
}
void do_shitbox()
{
BITMAP *shitcard;
if(shit_pos == 1) shitcard = data[shitbox_01].dat;
if(shit_pos == 2) shitcard = data[shitbox_02].dat;
if(shit_pos == 3) shitcard = data[shitbox_03].dat;
if(shit_pos == 4) shitcard = data[shitbox_04].dat;
if(shit_pos == 5) shitcard = data[shitbox_05].dat;
if(shit_pos == 6) shitcard = data[shitbox_06].dat;
if(shit_pos == 7) shitcard = data[shitbox_07].dat;
//printf("%d\n", shit_pos);
//clear_keybuf2();
//readkey();
draw_sprite(screen, shitcard, 160, 160);
if(shit_pos == 1) play_sample(data[funny_04].dat, 255, 127, 1000, 0);
readkey();
if(shit_pos == 1) who->money -= 75;
if(shit_pos == 2) who->money -= 15;
if(shit_pos == 4)
{
who->on = 27;
move_piece(1);
}
if(shit_pos == 5)
{
_alarm("A - Thanks Shitman!", 150, 150, 150, 150);
textout(screen, font, "B - NAHL!", 155, 165, makecol(255, 255, 255));
_select = TRUE;
while(_select == TRUE)
{
if(key[KEY_A]) _select = 1;
if(key[KEY_B]) _select = 2;
}
if(_select == 2) who->money -= 500;
}
if(shit_pos == 6)
{
player *affected = NULL;
if(player_1->hell)
affected = player_1;
else if(player_2->hell)
affected = player_2;
if(affected)
{
affected->hell = FALSE;
rent_bias = 4.0;
bias_affected = (affected == player_1) ? 0 : 1;
}
}
if(shit_pos == 7)
{
int i;
who->money -= 100;
for(i = 5; i < 40; i += 10)
{
if(board[i]->owned_by == who)
board[i]->owned_by = NULL;
}
}
if(who->money < 1)
{
bankrupt();
return;
}
shit_pos++;
if(shit_pos == 8) shit_pos = 1;
}
void p_buy()
{
char *buy_buf;
int cost = board[who->on]->price;
if(buy_bias != 1.0)
{
float cost_float = (float)cost*buy_bias;
cost = (int)cost_float;
}
buy_buf = calloc(1, sizeof(char[100]));
//280
//112 300 property
if((who->money - cost) < 1)
{
_alarm("Not enough shit!", 170, 215, 150, 15);
readkey();
if(who->on == 30)
{
who->on = 9;
who->hell = TRUE;
move_piece(1);
}
return;
}
for(num = 480; num>281; num-=5)
{
update_screen();
draw_sprite(buffer, board[who->on]->pic, 112, 300);
draw_rle_sprite(buffer, data[hand_a].dat, 95, num);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
for(num = 280; num<481; num+=5)
{
update_screen();
draw_sprite(buffer, board[who->on]->pic, 112, num + 20);
draw_rle_sprite(buffer, data[hand_a].dat, 95, num);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
sprintf(buy_buf, "%s bought %s@for %d moneys", who->name, board[who->on]->name, cost);
_alarm(buy_buf, 50, 215, 440, 30);
who->money -= cost;
if (who->name == player_1->name) board[who->on]->owned_by = player_1;
else board[who->on]->owned_by = player_2;
clear_keybuf2();
readkey();
free(buy_buf);
return;
}
void do_machine_gun(int skip)
{
int anum1;
int anum2 = TRUE;
if(skip == TRUE) goto cap;
for(anum1 = 480; anum1>160; anum1--)
{
clear_to_color(buffer, makecol(0, 0, 0));
draw_rle_sprite(buffer, data[gun_barrell].dat, 0, anum1);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
cap:
clear_to_color(buffer, makecol(0, 0, 0));
draw_rle_sprite(buffer, data[gun_barrell].dat, 0, 160);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
play_sample(data[machine_gun].dat, 255, 127, 1000, 1);
for(anum1 = 0; anum1<20; anum1++)
{
if (anum2 == TRUE)
{
draw_rle_sprite(screen, data[blast].dat, 294, 181);
}
if (anum2 == FALSE) rectfill(screen, 294, 181, 294+140, 181+140, makecol(0, 0, 0));
if (anum2 == TRUE) anum2 = FALSE;
else anum2 = TRUE;
rest(50);
}
stop_sample(data[machine_gun].dat);
return;
}
void auction()
{
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
play_sample(data[funny_06].dat, 255, 127, 1000, 0);
rest(1500);
stop_sample(data[funny_06].dat);
play_midi(data[sniper_music].dat, 1);
do_machine_gun(0);
//the left man
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 102, 219);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 121, 271);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 102, 279);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 53, 292);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 118, 312);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 115, 245);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 102, 219);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 105, 312);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 118, 312);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 121, 271);
rest(50);
//right man
do_machine_gun(TRUE);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 586, 238);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 577, 284);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 599, 286);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 578, 388);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 590, 353);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 598, 443);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 586, 219);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 599, 286);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 586, 238);
rest(50);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
draw_rle_sprite(screen, data[wound].dat, 598, 443);
blit(data[auction_pic].dat, screen, 0, 0, 0, 0, 640, 480);
rest(1000);
_alarm("THEY DIED!", 200, 215, 120, 14);
clear_keybuf2();
readkey();
stop_midi();
return;
}
void move_piece(int amount)
{
int fuck_money;
char money_buf3[60];
char money_buf[60];
int money_int;
int move_piece_temp = who->on;
int normal = TRUE;
//int money_num = 0;
for(num = move_piece_temp; num <= move_piece_temp + amount; num++)
{
who->on = num;
if(num == 40)
{
who->on = 0;
pass_fuck = TRUE;
}
if(num == 41) who->on = 1;
if(num == 42) who->on = 2;
if(num == 43) who->on = 3;
if(num == 44) who->on = 4;
if(num == 45) who->on = 5;
if(num == 46) who->on = 6;
if(num == 47) who->on = 7;
if(num == 48) who->on = 8;
if(num == 49) who->on = 9;
if(num == 50) who->on = 10;
if(num == 51) who->on = 11;
update_screen();
draw_rle_sprite(buffer, die_1, 112, 300);
draw_rle_sprite(buffer, die_2, 140, 340);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
rest(75);
}
if(pass_fuck == TRUE)
{
_alarm("Passed fuck yo mamma", 150, 215, 170, 25);
textout(screen, font, "gain random money!", 155, 230, makecol(255, 255, 255));
fuck_money = 100+(random()%300);
who->money += fuck_money;
sprintf(money_buf3, "$%d!!!", fuck_money);
_alarm(money_buf3, 150, 230, 170, 15);
clear_keybuf2();
readkey();
if(who->money<1)
{
bankrupt();
return;
}
pass_fuck = FALSE;
}
if(who->on == 0) normal = FALSE;
if(who->on == 2) normal = FALSE;
if(who->on == 4) normal = FALSE;
if(who->on == 7) normal = FALSE;
if(who->on == 10) normal = FALSE;
if(who->on == 17) normal = FALSE;
//if(who->on == 20) normal = FALSE;
if(who->on == 22) normal = FALSE;
if(who->on == 30) normal = FALSE;
if(who->on == 33) normal = FALSE;
if(who->on == 36) normal = FALSE;
if(who->on == 38) normal = FALSE;
if(who->on == 39) play_sample(data[funny_01].dat, 255, 127, 1000, 0);
draw_sprite(buffer, board[who->on]->pic, 125, 125);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
if(normal == TRUE)
{
if(board[who->on]->owned_by == who)
{
_alarm("You own this property", 170, 215, 200, 25);
clear_keybuf2();
readkey();
end_turn();
return;
}
if(board[who->on]->owned_by != NULL)
{
if(who->on == 5)
{
crackhouse();
end_turn();
return;
}
if(who->on == 15)
{
crackhouse();
end_turn();
return;
}
if(who->on == 25)
{
crackhouse();
end_turn();
return;
}
if(who->on == 35)
{
crackhouse();
end_turn();
return;
}
if(who->on == 12)
{
garbage_heap();
end_turn();
return;
}
if(who->on == 28)
{
garbage_heap();
end_turn();
return;
}
if(who->on == 20)
{
_alarm("Nothing (you own it)", 225, 125, 170, 15);
clear_keybuf2();
readkey();
end_turn();
return;
}
if(board[who->on]->houses == 0) money_int = board[who->on]->rent;
if(board[who->on]->houses == 1) money_int = board[who->on]->one;
if(board[who->on]->houses == 2) money_int = board[who->on]->two;
if(board[who->on]->houses == 3) money_int = board[who->on]->three;
if(board[who->on]->houses == 4) money_int = board[who->on]->four;
if(board[who->on]->houses == 5) money_int = board[who->on]->five;
if(rent_bias != 1.0)
{
float money_float = (float)money_int*rent_bias;
money_int = (int)money_float;
}
who->money -= money_int;
if(who->money < 1)
{
bankrupt();
return;
}
sprintf(money_buf, "%s paid $%u", who->name, money_int);
_alarm("", 170, 215, 150, 15);
textout(screen, font, money_buf, 175, 220, makecol(255, 255, 255));
clear_keybuf2();
readkey();
board[who->on]->owned_by->money += money_int;
end_turn();
return;
}
_alarm("", 225, 125, 170, 50);
textout(screen, font, "Enter: Buy", 230, 130, makecol(255, 255, 255));
textout(screen, font, "Backspace: Auction", 230, 140, makecol(255, 255, 255));
clear_keybuf2();
readkey();
_select = TRUE;
while(_select == TRUE)
{
if(key[KEY_ENTER]) _select = 1;
if(key[KEY_BACKSPACE]) _select = 2;
}
clear_keybuf2();
if (_select == 1) p_buy();
if (_select == 2) auction();
}
clear_keybuf2();
if(who->on == 0)
{
_alarm("Fuck yo mamma", 225, 125, 170, 50);
readkey();
end_turn();
return;
}
if(who->on == 2)
{
_alarm("Shitbox!", 225, 125, 170, 50);
readkey();
do_shitbox();
end_turn();
return;
}
if(who->on == 4)
{
_alarm("", 225, 125, 300, 50);
if(irs == FALSE)
{
textout(screen, font, "Irs out of commision", 230, 130, makecol(255, 255, 255));
clear_keybuf2();
readkey();
return;
}
textout(screen, font, "Enter: Pay them money", 230, 130, makecol(255, 255, 255));
textout(screen, font, "Backspace: Take them out of commision", 230, 140, makecol(255, 255, 255));
clear_keybuf2();
_select = TRUE;
while(_select == TRUE)
{
if(key[KEY_ENTER]) _select = 1;
if(key[KEY_BACKSPACE]) _select = 2;
}
clear_keybuf2();
if(_select == 1)
{
who->money -= 200;
_alarm("Paid $200 to irs", 225, 125, 175, 15);
clear_keybuf2();
readkey();
if(who->money < 1)
{
bankrupt();
return;
}
}
if(_select == 2) irs = FALSE;
clear_keybuf2();
end_turn();
return;
}
if(who->on == 7)
{
_alarm("What the fuck is this!", 225, 125, 170, 50);
readkey();
do_chance();
end_turn();
return;
}
if(who->on == 10)
{
if(who->hell == FALSE) _alarm("Visiting Hell!", 225, 125, 170, 50);
else _alarm("You are in hell!", 225, 110, 185, 50);
readkey();
end_turn();
return;
}
if(who->on == 17)
{
_alarm("Shitbox!", 225, 125, 170, 50);
readkey();
do_shitbox();
end_turn();
return;
}
if(who->on == 20)
{
/*_alarm("", 225, 125, 170, 50);
textout(screen, font, "Enter: Buy", 230, 130, makecol(255, 255, 255));
textout(screen, font, "Backspace: Auction", 230, 140, makecol(255, 255, 255));
clear_keybuf2();
_select = TRUE;
while(_select == TRUE)
{
if (key[KEY_ENTER]) _select = 1;
if (key[KEY_BACKSPACE]) _select = 2;
}
clear_keybuf2();
if (_select == 1) p_buy();
if (_select == 2) auction();
*/
end_turn();
return;
}
if(who->on == 22)
{
_alarm("What the fuck is this!", 225, 125, 170, 50);
readkey();
do_chance();
end_turn();
return;
}
if(who->on == 33)
{
_alarm("Shitbox!", 225, 125, 170, 50);
readkey();
do_shitbox();
end_turn();
return;
}
if(who->on == 30)
{
if(board[30]->owned_by == NULL)
{
_alarm("", 225, 125, 170, 50);
textout(screen, font, "Enter: Buy", 230, 130, makecol(255, 255, 255));
textout(screen, font, "Backspace: Auction", 230, 140, makecol(255, 255, 255));
clear_keybuf2();
_select = TRUE;
while(_select == TRUE)
{
if(key[KEY_ENTER]) _select = 1;
if(key[KEY_BACKSPACE]) _select = 2;
}
clear_keybuf2();
if (_select == 1) p_buy();
if (_select == 2) auction();
end_turn();
return;
}
if(board[30]->owned_by->name == who->name)
{
_alarm("You own this one! Hahl", 225, 125, 170, 50);
clear_keybuf2();
readkey();
end_turn();
return;
}
_alarm("Goto Hell!", 225, 125, 170, 50);
clear_keybuf2();
readkey();
who->hell = TRUE;
who->on = 9;
move_piece(1);
end_turn();
return;
}
if(who->on == 36)
{
_alarm("What the fuck is this!", 225, 125, 170, 50);
readkey();
do_chance();
end_turn();
return;
}
if(who->on == 38)
{
_alarm("You've been mugged", 225, 125, 170, 50);
_alarm("Paid $100", 230, 150, 170, 25);
who->money -= 100;
if(who->money < 1)
{
bankrupt();
return;
}
readkey();
end_turn();
return;
}
if(normal == FALSE)
{
_alarm("Abnormal", 225, 125, 170, 50);
clear_keybuf2();
readkey();
}
}
void roll_die()
{
int die1;
int die2;
int amt;
die1 = (random()%(5 + 1));
die2 = (random()%(5 + 1));
die1++;
die2++;
if(turn == 0) turn = 1;
else turn = 0;
amt = die1 + die2;
if(die1 == die2) doubles = TRUE;
if (die1 == 1) die_1 = data[dice_01].dat;
if (die1 == 2) die_1 = data[dice_02].dat;
if (die1 == 3) die_1 = data[dice_03].dat;
if (die1 == 4) die_1 = data[dice_04].dat;
if (die1 == 5) die_1 = data[dice_05].dat;
if (die1 == 6) die_1 = data[dice_06].dat;
if (die2 == 1) die_2 = data[dice_01].dat;
if (die2 == 2) die_2 = data[dice_02].dat;
if (die2 == 3) die_2 = data[dice_03].dat;
if (die2 == 4) die_2 = data[dice_04].dat;
if (die2 == 5) die_2 = data[dice_05].dat;
if (die2 == 6) die_2 = data[dice_06].dat;
for(num = 480; num>280; num-=3)
{
update_screen();
draw_rle_sprite(buffer, data[hand_b].dat, 95, num);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
for(num = 280; num<481; num+=3)
{
update_screen();
draw_rle_sprite(buffer, die_1, 112, 300);
draw_rle_sprite(buffer, die_2, 140, 340);
draw_rle_sprite(buffer, data[hand_a].dat, 95, num);
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
rest(750);
//CHANGE
//amt = 1;
//CHANGE THIS NOOOOW!
if(who->hell == TRUE)
{
if(die1 == 2) if(die2 == 2) who->hell = FALSE;
if(who->hell == TRUE)
{
amt = 1;
who->on = 9;
}
}
move_piece(amt);
clear_keybuf2();
return;
}
void update_screen()
{
RLE_SPRITE *house_thingy;
char *num_buf;
int nummer;
num_buf = calloc(1, sizeof(char[60]));
clear(buffer);
blit(data[main_picture].dat, buffer, 0, 0, 0, 0, 640, 480);
for(nummer = 0; nummer<40; nummer++)
{
if(board[nummer]->houses>0)
{
sprintf(num_buf, "%d", board[nummer]->houses);
if(board[nummer]->houses<5) house_thingy = data[house].dat;
else house_thingy = data[hotel].dat;
draw_rle_sprite(buffer, house_thingy, board[nummer]->x, board[nummer]->y);
textout_centre(buffer, font, num_buf, board[nummer]->x + 12, board[nummer]->y + 12, makecol(0, 0, 0));
}
}
draw_rle_sprite(buffer, player_1->piece, board[player_1->on]->x, board[player_1->on]->y);
draw_rle_sprite(buffer, player_2->piece, board[player_2->on]->x, board[player_2->on]->y);
if (virtual == FALSE) blit(buffer, screen, 0, 0, 0, 0, 640, 480);
free(num_buf);
return;
}
void _alarm(char *text, int x, int y, int wt, int ht)
{
BITMAP *bmp;
char buf[384],
row1[128] = "",
row2[128] = "",
row3[128] = "",
*ptr = row1;
int i, j, c = 0, color_rate = 1;
if (ht<1 || ht>257)
{
allegro_exit();
printf("_alarm: invalid height (must be between 1 and 257)\n\n");
exit(1);
}
bmp = create_bitmap_ex(16, 640, 480);
clear(bmp);
if(ht<127) color_rate = 2;
if(ht<85) color_rate = 3;
if(ht<63) color_rate = 4;
if(ht<51) color_rate = 5;
if(ht<42) color_rate = 6;
if(ht<36) color_rate = 7;
if(ht<31) color_rate = 8;
if(ht<28) color_rate = 9;
if(ht<25) color_rate = 10;
strcpy(buf, text);
j = 0;
for(i = 0; i < (int)strlen(buf); i++)
{
if(buf[i] == '@')
{
ptr[i] = 0;
if(ptr == row1)
ptr = row2;
else if(ptr == row2)
ptr = row3;
else if(ptr == row3)
break;
i++;
j = 0;
}
ptr[j] = buf[i];
j++;
}
rect(bmp, x, y, x + wt, y + ht, makecol(255, 255, 255));
for (i=y+1; i<y+(ht); i++)
{
hline(bmp, x + 1, i, x+wt-1, makecol16(0, 0, c));
c += color_rate;
}
textout(bmp, font, row1, x + 5, y + 5, makecol(255, 255, 255));
textout(bmp, font, row2, x + 5, y + 13, makecol(255, 255, 255));
textout(bmp, font, row3, x + 5, y + 21, makecol(255, 255, 255));
blit(bmp, screen, x, y, x, y, wt+1, ht+1);
destroy_bitmap(bmp);
return;
}
int main(int argc, char *argv[])
{
RLE_SPRITE *pce;
int i;
for(i = 1; i < argc; i++)
{
if(strcmp(argv[i], "-win") == 0)
win = TRUE;
else if(strcmp(argv[i], "-mute") == 0)
mute = TRUE;
}
#ifdef ALLEGRO_LINUX
//Might as well make sure we are in the right directory under linux
chdir("/home/kain/ccomp/monfuck");
#endif
//INIT//////////
allegro_init();
install_timer();
install_keyboard();
#ifdef ALLEGRO_LINUX
if(install_sound(DIGI_AUTODETECT, MIDI_DIGMID, NULL) != 0)
printf("Error installing sound: %s\n", allegro_error);
#else
install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL);
#endif
set_color_depth(MAX(16, desktop_color_depth()));
if(set_gfx_mode((!win) ? GFX_AUTODETECT : GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0) != 0)
{
allegro_exit();
printf("You aren't good enough to play, bitch! Video fucked up\n\n");
exit(1);
}
printf("Video driver: %s\n", gfx_driver->desc);
srandom(time(NULL));
text_mode(-1);
printf("Loading.......\n");
data = load_datafile("data.dat");
if(!data)
{
allegro_exit();
printf("Unable to find data.dat\n");
exit(1);
}
printf("Done\n");
play_midi(data[game_music].dat, 1);
printf("Initializing......\n");
chance_pos = (random()%(14));
shit_pos = (random()%(5));
chance_pos++;
shit_pos++;
player_1 = calloc(1, sizeof(struct player));
player_2 = calloc(1, sizeof(struct player));
if(player_1 == NULL)
{
allegro_exit();
printf("out of memory");
exit(1);
}
if(player_2 == NULL)
{
allegro_exit();
printf("out of memory");
exit(1);
}
if(buf1 == NULL)
{
allegro_exit();
printf("out of memory");
exit(1);
}
if(buf2 == NULL)
{
allegro_exit();
printf("out of memory");
exit(1);
}
player_1->on = 0;
player_2->on = 0;
player_1->money = 4000;
player_2->money = 4000;
player_1->name = "gccKain";
player_2->name = "Calador";
player_1->hell = FALSE;
player_2->hell = FALSE;
for(num = 0; num<39; num++)
{
board[num] = calloc(1, sizeof(struct property));
if(board[num] == NULL)
{
allegro_exit();
printf("out of memory");
exit(1);
}
//board[40] = calloc(1, sizeof(struct property));
board[39] = calloc(1, sizeof(struct property));
}
board[0]->x = 488;
board[0]->y = 415;
board[0]->owned_by = NULL;
board[0]->name = "Fuck yo Mamma";
board[0]->col = makecol(255, 255, 255);
board[0]->houses = 0;
board[0]->pic = data[card_00].dat;
board[1]->x = 440;
board[1]->y = 425;
board[1]->price = 1;
board[1]->rent = 1;
board[1]->one = 1;
board[1]->two = 1;
board[1]->three = 1;
board[1]->four = 1;
board[1]->five = 2;
board[1]->house_cost = 1;
board[1]->name = "Motel 6";
board[1]->houses = 0;
board[1]->owned_by = NULL;
board[1]->col = makecol(135, 167, 151);
board[1]->pic = data[card_01].dat;
board[2]->x = 397;
board[2]->y = 425;
board[2]->houses = 0;
board[2]->name = "Shit box";
board[2]->col = makecol(255, 255, 255);
board[2]->owned_by = NULL;
board[2]->pic = data[card_02].dat;
board[3]->x = 352;
board[3]->y = 425;
board[3]->price = 1;
board[3]->rent = 1;
board[3]->one = 1;
board[3]->two = 1;
board[3]->three = 1;
board[3]->four = 1;
board[3]->five = 2;
board[3]->house_cost = 1;
board[3]->name = "Burnt Down Building";
board[3]->houses = 0;
board[3]->owned_by = NULL;
board[3]->col = makecol(135, 167, 151);
board[3]->pic = data[card_03].dat;
board[4]->x = 305;
board[4]->y = 425;
board[4]->houses = 0;
board[4]->name = "Irs";
board[4]->col = makecol(255, 255, 255);
board[4]->owned_by = NULL;
board[4]->pic = data[card_04].dat;
board[5]->x = 256;
board[5]->y = 425;
board[5]->price = 200;
board[5]->name = "Southern Crack House";
board[5]->owned_by = NULL;
board[5]->col = makecol(255, 255, 255);
board[5]->pic = data[card_05].dat;
board[6]->x = 212;
board[6]->y = 425;
board[6]->price = 100;
board[6]->rent = 5;
board[6]->one = 10;
board[6]->two = 20;
board[6]->three = 50;
board[6]->four = 4000;
board[6]->five = 5;
board[6]->house_cost = 300;
board[6]->name = "China Town BreakItDown";
board[6]->houses = 0;
board[6]->owned_by = NULL;
board[6]->col = makecol(54, 108, 116);
board[6]->pic = data[card_06].dat;
board[7]->x = 172;
board[7]->y = 425;
board[7]->name = "!";
board[7]->col = makecol(255, 255, 255);
board[7]->houses = 0;
board[7]->owned_by = NULL;
board[7]->pic = data[card_07].dat;
board[8]->x = 123;
board[8]->y = 425;
board[8]->price = 100;
board[8]->rent = 5;
board[8]->one = 10;
board[8]->two = 20;
board[8]->three = 50;
board[8]->four = 100;
board[8]->five = 200;
board[8]->house_cost = 50;
board[8]->name = "Some Place";
board[8]->houses = 0;
board[8]->owned_by = NULL;
board[8]->col = makecol(54, 108, 116);
board[8]->pic = data[card_08].dat;
board[9]->x = 85;
board[9]->y = 425;
board[9]->price = 100;
board[9]->rent = 5;
board[9]->one = 10;
board[9]->two = 20;
board[9]->three = 50;
board[9]->four = 100;
board[9]->five = 200;
board[9]->house_cost = 50;
board[9]->name = "Connect and Cut!";
board[9]->houses = 0;
board[9]->owned_by = NULL;
board[9]->col = makecol(54, 108, 116);
board[9]->pic = data[card_09].dat;
board[10]->x = 30;
board[10]->y = 413;
board[10]->name = "Hell";
board[10]->col = makecol(255, 255, 255);
board[10]->owned_by = NULL;
board[10]->pic = data[card_10].dat;
board[11]->x = 25;
board[11]->y = 360;
board[11]->price = 250;
board[11]->rent = 20;
board[11]->one = 50;
board[11]->two = 100;
board[11]->three = 200;
board[11]->four = 400;
board[11]->five = 600;
board[11]->house_cost = 100;
board[11]->name = "Charles in Charge";
board[11]->houses = 0;
board[11]->owned_by = NULL;
board[11]->col = makecol(255, 176, 253);
board[11]->pic = data[card_11].dat;
board[12]->x = 25;
board[12]->y = 330;
board[12]->price = 300;
board[12]->name = "Garbage Heap";
board[12]->owned_by = NULL;
board[12]->col = makecol(91, 131, 53);
board[12]->pic = data[card_12].dat;
board[13]->x = 25;
board[13]->y = 290;
board[13]->price = 250;
board[13]->rent = 20;
board[13]->one = 50;
board[13]->two = 100;
board[13]->three = 125;
board[13]->four = 130;
board[13]->five = 135;
board[13]->house_cost = 100;
board[13]->name = "A piece of shit place next to a garbage heap!";
board[13]->houses = 0;
board[13]->owned_by = NULL;
board[13]->col = makecol(255, 176, 253);
board[13]->pic = data[card_13].dat;
board[14]->x = 25;
board[14]->y = 257;
board[14]->price = 250;
board[14]->rent = 25;
board[14]->one = 75;
board[14]->two = 125;
board[14]->three = 250;
board[14]->four = 450;
board[14]->five = 700;
board[14]->house_cost = 125;
board[14]->name = "Mmmmmuuufff Town!";
board[14]->houses = 0;
board[14]->owned_by = NULL;
board[14]->col = makecol(255, 176, 253);
board[14]->pic = data[card_14].dat;
board[15]->x = 25;
board[15]->y = 223;
board[15]->price = 200;
board[15]->name = "Western Crack House";
board[15]->owned_by = NULL;
board[15]->col = makecol(255, 255, 255);
board[15]->pic = data[card_15].dat;
board[16]->x = 25;
board[16]->y = 187;
board[16]->price = 350;
board[16]->rent = 30;
board[16]->one = 100;
board[16]->two = 175;
board[16]->three = 275;
board[16]->four = 500;
board[16]->five = 750;
board[16]->house_cost = 175;
board[16]->name = "St. Jam it up your ass!!";
board[16]->houses = 0;
board[16]->owned_by = NULL;
board[16]->col = makecol(192, 163, 112);
board[16]->pic = data[card_16].dat;
board[17]->x = 25;
board[17]->y = 153;
board[17]->name = "Shit box";
board[17]->col = makecol(255, 255, 255);
board[17]->owned_by = NULL;
board[17]->pic = data[card_17].dat;
board[18]->x = 25;
board[18]->y = 118;
board[18]->price = 350;
board[18]->rent = 5;
board[18]->one = 3;
board[18]->two = 2;
board[18]->three = 1;
board[18]->four = 1;
board[18]->five = 800;
board[18]->house_cost = 175;
board[18]->name = "Chack's House";
board[18]->houses = 0;
board[18]->owned_by = NULL;
board[18]->col = makecol(192, 163, 112);
board[18]->pic = data[card_18].dat;
board[19]->x = 25;
board[19]->y = 86;
board[19]->price = 400;
board[19]->rent = 0;
board[19]->one = 0;
board[19]->two = 0;
board[19]->three = 0;
board[19]->four = 0;
board[19]->five = 0;
board[19]->house_cost = 175;
board[19]->name = "Don't buy this!!";
board[19]->houses = 0;
board[19]->owned_by = NULL;
board[19]->col = makecol(192, 163, 112);
board[19]->pic = data[card_19].dat;
board[20]->x = 30;
board[20]->y = 42;
board[20]->price = 5;
board[20]->name = "Nothing";
board[20]->owned_by = NULL;
board[20]->col = makecol(255, 255, 255);
board[20]->pic = data[card_20].dat;
board[21]->x = 84;
board[21]->y = 28;
board[21]->price = 400;
board[21]->rent = 50;
board[21]->one = 125;
board[21]->two = 200;
board[21]->three = 325;
board[21]->four = 550;
board[21]->five = 800;
board[21]->house_cost = 200;
board[21]->name = "ManFuckit!";
board[21]->houses = 0;
board[21]->owned_by = NULL;
board[21]->col = makecol(180, 82, 84);
board[21]->pic = data[card_21].dat;
board[22]->x = 127;
board[22]->y = 28;
board[22]->name = "!";
board[22]->col = makecol(255, 255, 255);
board[22]->houses = 0;
board[22]->owned_by = NULL;
board[22]->pic = data[card_22].dat;
board[23]->x = 167;
board[23]->y = 28;
board[23]->price = 400;
board[23]->rent = 50;
board[23]->one = 125;
board[23]->two = 200;
board[23]->three = 325;
board[23]->four = 550;
board[23]->five = 800;
board[23]->house_cost = 200;
board[23]->name = "It belongs in a meuseam!";
board[23]->houses = 0;
board[23]->owned_by = NULL;
board[23]->col = makecol(180, 82, 84);
board[23]->pic = data[card_23].dat;
board[24]->x = 208;
board[24]->y = 28;
board[24]->price = 400;
board[24]->rent = 50;
board[24]->one = 125;
board[24]->two = 200;
board[24]->three = 325;
board[24]->four = 550;
board[24]->five = 800;
board[24]->house_cost = 200;
board[24]->name = "Cup of noodles";
board[24]->houses = 0;
board[24]->owned_by = NULL;
board[24]->col = makecol(180, 82, 84);
board[24]->pic = data[card_24].dat;
board[25]->x = 253;
board[25]->y = 28;
board[25]->price = 200;
board[25]->name = "Northern Crack House";
board[25]->owned_by = NULL;
board[25]->col = makecol(255, 255, 255);
board[25]->pic = data[card_25].dat;
board[26]->x = 304;
board[26]->y = 28;
board[26]->price = 475;
board[26]->rent = 100;
board[26]->one = 200;
board[26]->two = 300;
board[26]->three = 475;
board[26]->four = 600;
board[26]->five = 900;
board[26]->house_cost = 250;
board[26]->name = "Shit Condo";
board[26]->houses = 0;
board[26]->owned_by = NULL;
board[26]->col = makecol(188, 192, 5);
board[26]->pic = data[card_26].dat;
board[27]->x = 348;
board[27]->y = 28;
board[27]->price = 475;
board[27]->rent = 100;
board[27]->one = 200;
board[27]->two = 300;
board[27]->three = 475;
board[27]->four = 600;
board[27]->five = 4500;
board[27]->house_cost = 250;
board[27]->name = "Land here and Eat Shit";
board[27]->houses = 0;
board[27]->owned_by = NULL;
board[27]->col = makecol(188, 192, 5);
board[27]->pic = data[card_27].dat;
board[28]->x = 390;
board[28]->y = 28;
board[28]->price = 300;
board[28]->name = "Raw Sewage Plant";
board[28]->owned_by = NULL;
board[28]->col = makecol(91, 131, 53);
board[28]->pic = data[card_28].dat;
board[29]->x = 434;
board[29]->y = 28;
board[29]->price = 475;
board[29]->rent = 100;
board[29]->one = 200;
board[29]->two = 300;
board[29]->three = 475;
board[29]->four = 600;
board[29]->five = 900;
board[29]->house_cost = 250;
board[29]->name = "Marvin Marvin Marvin";
board[29]->houses = 0;
board[29]->owned_by = NULL;
board[29]->col = makecol(188, 192, 5);
board[29]->pic = data[card_29].dat;
board[30]->x = 493;
board[30]->y = 46;
board[30]->price = 500;
board[30]->name = "Go to hell";
board[30]->owned_by = NULL;
board[30]->col = makecol(255, 255, 255);
board[30]->pic = data[card_30].dat;
board[31]->x = 500;
board[31]->y = 86;
board[31]->price = 500;
board[31]->rent = 200;
board[31]->one = 400;
board[31]->two = 600;
board[31]->three = 800;
board[31]->four = 1000;
board[31]->five = 2000;
board[31]->house_cost = 300;
board[31]->name = "Fuck Bar, Inc.";
board[31]->houses = 0;
board[31]->owned_by = NULL;
board[31]->col = makecol(163, 196, 30);
board[31]->pic = data[card_31].dat;
board[32]->x = 500;
board[32]->y = 118;
board[32]->price = 500;
board[32]->rent = 200;
board[32]->one = 400;
board[32]->two = 600;
board[32]->three = 800;
board[32]->four = 1000;
board[32]->five = 2000;
board[32]->house_cost = 300;
board[32]->name = "I fucking killed...THAT MAN!";
board[32]->houses = 0;
board[32]->owned_by = NULL;
board[32]->col = makecol(163, 196, 30);
board[32]->pic = data[card_32].dat;
board[33]->x = 500;
board[33]->y = 153;
board[33]->houses = 0;
board[33]->name = "Shit box";
board[33]->col = makecol(255, 255, 255);
board[33]->owned_by = NULL;
board[33]->pic = data[card_33].dat;
board[34]->x = 500;
board[34]->y = 187;
board[34]->price = 500;
board[34]->rent = 1;
board[34]->one = 2;
board[34]->two = 3;
board[34]->three = 4;
board[34]->four = 5;
board[34]->five = 3000;
board[34]->house_cost = 300;
board[34]->name = "Can I get a fish";
board[34]->houses = 0;
board[34]->owned_by = NULL;
board[34]->col = makecol(163, 196, 30);
board[34]->pic = data[card_34].dat;
board[35]->x = 500;
board[35]->y = 223;
board[35]->price = 200;
board[35]->name = "Eastern Crack House";
board[35]->owned_by = NULL;
board[35]->col = makecol(255, 255, 255);
board[35]->pic = data[card_35].dat;
board[36]->x = 500;
board[36]->y = 257;
board[36]->name = "!";
board[36]->col = makecol(255, 255, 255);
board[36]->houses = 0;
board[36]->owned_by = NULL;
board[36]->pic = data[card_36].dat;
board[37]->x = 500;
board[37]->y = 290;
board[37]->price = 600;
board[37]->rent = 300;
board[37]->one = 600;
board[37]->two = 1200;
board[37]->three = 2400;
board[37]->four = 4800;
board[37]->five = 9600;
board[37]->house_cost = 400;
board[37]->name = "Chinese Drug Gang";
board[37]->houses = 0;
board[37]->owned_by = NULL;
board[37]->col = makecol(126, 126, 126);
board[37]->pic = data[card_37].dat;
board[38]->x = 500;
board[38]->y = 330;
board[38]->name = "Mugger";
board[38]->col = makecol(255, 255, 255);
board[38]->owned_by = NULL;
board[38]->pic = data[card_38].dat;
board[39]->x = 500;
board[39]->y = 360;
board[39]->price = 1000;
board[39]->rent = 600;
board[39]->one = 1200;
board[39]->two = 2400;
board[39]->three = 4800;
board[39]->four = 9600;
board[39]->five = 19500;
board[39]->house_cost = 500;
board[39]->name = "ENTERPRISE!";
board[39]->houses = 0;
board[39]->owned_by = NULL;
board[39]->col = makecol(126, 126, 126);
board[39]->pic = data[card_39].dat;
printf("Done\n");
//printf("%p\n", buffer);
//printf("%p\n", board[40]);
//readkey();
title = calloc(1, sizeof(struct BITMAP));
buffer = calloc(1, sizeof(struct BITMAP));
if(buffer == NULL)
{
allegro_exit();
printf("fucked up");
exit(1);
}
buffer = create_bitmap(640, 480);
title = create_bitmap(640, 480);
if (buffer == NULL)
{
allegro_exit();
printf("hooo error");
exit(1);
}
if (title == NULL)
{
allegro_exit();
printf("hooo error");
exit(1);
}
board[39]->x = 500;
board[39]->y = 360;
board[39]->price = 1000;
board[39]->rent = 600;
board[39]->one = 1200;
board[39]->two = 2400;
board[39]->three = 4800;
board[39]->four = 9600;
board[39]->five = 19500;
board[39]->house_cost = 500;
board[39]->name = "ENTERPRISE!";
board[39]->houses = 0;
board[39]->owned_by = NULL;
board[39]->col = makecol(126, 126, 126);
board[39]->pic = data[card_39].dat;
num = 0;
num2 = 1;
while(num<481)
{
hline(title, 0, num, 640, makecol(0, num2, 0));
num++;
if(num2<254) num2++;
else num2--;
}
textout_centre(title, data[big_font].dat, "MonopoFUCK YO MAMMA!", 320, 10, makecol(255, 255, 255));
textout_centre(title, data[big_font].dat, "(Revised Edition)", 320, 50, makecol(255, 0, 0));
textout_centre(title, data[main_font].dat, "Press any fucking key", 320, 460, makecol(255, 255, 255));
for(num = 0; num<480; num+=4)
{
stretch_blit(title, screen, 0, 0, 640, 480, 0, 0, 640, num);
}
blit(title, screen, 0, 0, 0, 0, 640, 480);
readkey();
while(key[KEY_ENTER]) ;
clear(buffer);
set_trans_blender(0, 0, 0, 100);
drawing_mode(DRAW_MODE_TRANS, NULL, 0, 0);
num = 0;
cx = 200;
blit(title, buffer, 0, 0, 0, 0, 640, 480);
rectfill(buffer, 100, 100, 540, 380, makecol(0, 0, 255));
blit(buffer, title, 0, 0, 0, 0, 640, 480);
while(_select == TRUE)
{
if(key[KEY_RIGHT])
{
cx+= 150;
key[KEY_RIGHT] = 0;
}
if(key[KEY_LEFT])
{
cx -= 150;
key[KEY_LEFT] = 0;
}
if(key[KEY_ENTER])
{
if(cx == 200) pce = data[dog_piece].dat;
if(cx == 350) pce = data[gun_piece].dat;
if(cx == 500) pce = data[car_piece].dat;
if(num == 1) if (pce == player_1->piece)
{
textout_centre(screen, data[main_font].dat, "Taken!!", cx, 200, makecol(255, 0, 0));
rest(1000);
num = 0;
}
if(num == 0) player_1->piece = pce;
if(num == 1) player_2->piece = pce;
num ++;
key[KEY_ENTER] = 0;
}
if (cx > 500) cx = 500;
if (cx < 200) cx = 200;
blit(title, buffer, 0, 0, 0, 0, 640, 480);
textout_centre(buffer, data[main_font].dat, "Select your piece, honkee bitch!", 320, 105, makecol(255, 255, 255));
if(num == 0) textout_centre(buffer, data[main_font].dat, player_1->name, 320, 115, makecol(255, 255, 255));
if(num == 1) textout_centre(buffer, data[main_font].dat, player_2->name, 320, 115, makecol(255, 255, 255));
if(num == 2) _select = FALSE;
draw_rle_sprite(buffer, data[dog_piece].dat, 200, 200);
draw_rle_sprite(buffer, data[gun_piece].dat, 350, 200);
draw_rle_sprite(buffer, data[car_piece].dat, 500, 200);
rect(buffer, cx, 195, cx + 30, 225, makecol(255, 0, 0));
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
solid_mode();
blit(title, screen, 0, 0, 0, 0, 640, 480);
fade_out(5);
clear(screen);
stop_midi();
virtual = TRUE;
clear_keybuf2();
while(game_running == TRUE)
{
if(key[KEY_ESC])
{
int k;
_alarm("Really quit? Y/N", 170, 215, 150, 25);
clear_keybuf2();
k = readkey() >> 8;
if(k == KEY_Y)
game_running = FALSE;
}
if(key[KEY_SPACE]) roll_die();
if(key[KEY_HOME]) show_shit();
if(key[KEY_END]) buy_houses();
if(key_shifts & KB_ALT_FLAG && key[KEY_ENTER])
{
win = !win;
if(set_gfx_mode((!win) ? GFX_AUTODETECT : GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0) != 0)
{
allegro_exit();
printf("You aren't good enough to play, bitch! Video fucked up\n\n");
exit(1);
}
}
clear_keybuf2();
if(doubles == TRUE)
{
if(turn == 1) turn = 0;
else turn = 1;
doubles = FALSE;
}
if (turn == 0) who = player_1;
if (turn == 1) who = player_2;
update_screen();
sprintf(buf1, "$%u", who->money);
textout(buffer, data[medium_font].dat, who->name, 86, 251, makecol(0, 0, 0));
textout(buffer, data[medium_font].dat, buf1, 86, 271, makecol(0, 0, 0));
textout(buffer, data[main_font].dat, "Space - Roll", 86, 301, makecol(255, 0, 0));
textout(buffer, data[main_font].dat, "Home - See your shit", 86, 311, makecol(255, 0, 0));
textout(buffer, data[main_font].dat, "End - Buy Houses", 86, 321, makecol(255, 0, 0));
textout(buffer, data[main_font].dat, "Esc - Goodbye!", 86, 331, makecol(255, 0, 0));
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
if(begin == TRUE)
{
begin = FALSE;
_alarm("May the best man@eat shir!", 170, 215, 150, 25);
clear_keybuf2();
readkey();
clear_keybuf2();
update_screen();
sprintf(buf1, "$%u", who->money);
textout(buffer, data[medium_font].dat, who->name, 86, 251, makecol(0, 0, 0));
textout(buffer, data[medium_font].dat, buf1, 86, 271, makecol(0, 0, 0));
textout(buffer, data[main_font].dat, "Space - Roll", 86, 301, makecol(255, 0, 0));
textout(buffer, data[main_font].dat, "Home - See your shit", 86, 311, makecol(255, 0, 0));
textout(buffer, data[main_font].dat, "End - Buy Houses", 86, 321, makecol(255, 0, 0));
textout(buffer, data[main_font].dat, "Esc - Goodbye!", 86, 331, makecol(255, 0, 0));
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
}
//SHUT DOWN//////////
unload_datafile(data);
destroy_bitmap(buffer);
destroy_bitmap(title);
free(player_1);
free(player_2);
for(num = 0; num<40; num++) free(board[num]);
allegro_exit();
printf("THE EEEEEND\n\n\n");
return 0;
}
END_OF_MAIN();
void clear_keybuf2()
{
int i;
clear_keybuf();
for(i = 0; i < KEY_MAX; i++)
key[i] = 0;
}
void end_turn()
{
if(bias_affected == turn)
rent_bias = buy_bias = 1.0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment