/* does end of month actions */ void passmonth(char &clearformess,char canseethings) { short oldlaw[LAWNUM]; memmove(oldlaw,law,sizeof(short)*LAWNUM); int l, v, p; //TIME ADVANCE day=1; month++; if(month==13) { month=1; year++; } switch(endgamestate) { case ENDGAME_NONE: if(publicmood(-1)>60) { endgamestate=ENDGAME_CCS_APPEARANCE; attitude[VIEW_CONSERVATIVECRIMESQUAD]=0; } break; case ENDGAME_CCS_APPEARANCE: if(publicmood(-1)>80) endgamestate=ENDGAME_CCS_ATTACKS; break; case ENDGAME_CCS_ATTACKS: if(publicmood(-1)>90) endgamestate=ENDGAME_CCS_SIEGES; break; case ENDGAME_CCS_SIEGES: case ENDGAME_CCS_DEFEATED: //if(publicmood(-1)>85&&presparty!=LIBERAL_PARTY) // endgamestate=ENDGAME_MARTIALLAW; break; } //CLEAR RENT EXEMPTIONS for(l=0;l<len(location);l++) location[l]->newrental=0; //YOUR PAPER AND PUBLIC OPINION AND STUFF vector<int> nploc; for(l=0;l<len(location);l++) { if((location[l]->compound_walls & COMPOUND_PRINTINGPRESS)&& !location[l]->siege.siege&& location[l]->renting!=RENTING_CCS) nploc.push_back(l); } // Check for game over endcheck(END_DEAD); dispersalcheck(clearformess); int guardianpower=0; if(len(nploc)&&!disbanding) { //DO SPECIAL EDITIONS int loottypeindex=choosespecialedition(clearformess); if(loottypeindex!=-1) { guardianpower+=10*len(nploc); printnews(loottypeindex,len(nploc)); if(loottype[loottypeindex]->get_idname()=="LOOT_INTHQDISK"|| //For special edition xml file? -XML loottype[loottypeindex]->get_idname()=="LOOT_SECRETDOCUMENTS") { for(int l=0;l<len(nploc);l++) criminalizepool(LAWFLAG_TREASON,-1,nploc[l]); } } } int libpower[VIEWNUM]={0}; //STORIES STALE EVEN IF NOT PRINTED for(v=0;v<VIEWNUM;v++)public_interest[v]/=2; int conspower=200-attitude[VIEW_AMRADIO]-attitude[VIEW_CABLENEWS]; //HAVING SLEEPERS for(int pl=len(pool)-1;pl>0;pl--) if(pool[pl]->alive&&(pool[pl]->flag & CREATUREFLAG_SLEEPER)) sleepereffect(*pool[pl],clearformess,canseethings,libpower); //Manage graffiti for(int l=0;l<len(location);l++) // Check each location { for(int c=len(location[l]->changes)-1;c>=0;c--) // Each change to the map { if(location[l]->changes[c].flag==SITEBLOCK_GRAFFITI|| location[l]->changes[c].flag==SITEBLOCK_GRAFFITI_CCS|| location[l]->changes[c].flag==SITEBLOCK_GRAFFITI_OTHER) // Find changes that refer specifically to graffiti { int power=0,align=0; if(location[l]->changes[c].flag==SITEBLOCK_GRAFFITI) align=1; if(location[l]->changes[c].flag==SITEBLOCK_GRAFFITI_CCS) align=-1; //Purge graffiti from more secure sites (or from non-secure //sites about once every five years), but these will //influence people more for the current month if(securityable(location[l]->type)) { location[l]->changes.erase(location[l]->changes.begin()+c); power=5; } else { if(location[l]->renting==RENTING_CCS) location[l]->changes[c].flag=SITEBLOCK_GRAFFITI_CCS; // Convert to CCS tags else if(location[l]->renting==RENTING_PERMANENT) location[l]->changes[c].flag=SITEBLOCK_GRAFFITI; // Convert to LCS tags else { power=1; if(!LCSrandom(10)) location[l]->changes[c].flag=SITEBLOCK_GRAFFITI_OTHER; // Convert to other tags if(!LCSrandom(10)&&endgamestate<ENDGAME_CCS_DEFEATED&&endgamestate>0) location[l]->changes[c].flag=SITEBLOCK_GRAFFITI_CCS; // Convert to CCS tags if(!LCSrandom(30)) location[l]->changes.erase(location[l]->changes.begin()+c); // Clean up } } if(align==1) { background_liberal_influence[VIEW_LIBERALCRIMESQUAD]+=power; background_liberal_influence[VIEW_CONSERVATIVECRIMESQUAD]+=power; } else if(align==-1) { background_liberal_influence[VIEW_LIBERALCRIMESQUAD]-=power; background_liberal_influence[VIEW_CONSERVATIVECRIMESQUAD]-=power; } } } } int mediabalance=0; int issuebalance[VIEWNUM-5]; //int stimulus=0; //double cost=0; //double tax=0; //PUBLIC OPINION NATURAL MOVES for(v=0;v<VIEWNUM;v++) { // Liberal essays add their power to the effect of sleepers libpower[v]+=background_liberal_influence[v]; background_liberal_influence[v]=static_cast<short>(background_liberal_influence[v]*0.66); if(v==VIEW_LIBERALCRIMESQUADPOS) continue; if(v==VIEW_LIBERALCRIMESQUAD) continue; //if(v==VIEW_POLITICALVIOLENCE) //{ // change_public_opinion(VIEW_POLITICALVIOLENCE,-1,0); // continue; //} if(v==VIEW_CONSERVATIVECRIMESQUAD) continue; if(v!=VIEW_AMRADIO&&v!=VIEW_CABLENEWS) { issuebalance[v] = libpower[v] - conspower; mediabalance += issuebalance[v]; // Heavy randomization -- balance of power just biases the roll int roll = issuebalance[v] + LCSrandom(400)-200; // If +/-50 to either side, that side wins the tug-of-war if(roll < -50) change_public_opinion(v,-1,0); else if(roll > 50) change_public_opinion(v,1,0); else // Else random movement change_public_opinion(v,LCSrandom(2)*2-1,0); } // AM Radio and Cable News popularity slowly shift to reflect public // opinion over time -- if left unchecked, their subtle influence // on society will become a self-perpetuating Conservative nightmare! else if(v==VIEW_AMRADIO||v==VIEW_CABLENEWS) { if(publicmood(-1)<attitude[v])change_public_opinion(v,-1); else change_public_opinion(v,1); } } // Temporary Stalinizing Code (TODO: Implement the Stalinist Comrade Squad for changing public opinion, then remove this) if(stalinmode) for(int v=0;v<VIEWNUM-3;v++) { if(stalinview(v,false)) { if((attitude[v]+=3)>100) attitude[v]=100; } else { if(--attitude[v]<0) attitude[v]=0; } } // End Temporary Stalinizing Code (TODO: Implement the Stalinist Comrade Squad for changing public opinion, then remove this) // Seduction monthly experience stipends for those liberals // who have been getting it on with their love slaves/masters // in the background for(int s=0;s<len(pool);s++) { pool[s]->train(SKILL_SEDUCTION,loveslaves(*pool[s])*5); if(pool[s]->flag & CREATUREFLAG_LOVESLAVE) pool[s]->train(SKILL_SEDUCTION,5); } /******************************************************* * INTELLIGENCE REPORT * * ONLY IF SHOWMECHANICS OR SHOWWAIT IS DEFINED * * EYES ONLY - LCS PROPERTY - TOP SECRET * *******************************************************/ #if defined(SHOWMECHANICS) || defined(SHOWWAIT) if(canseethings) { music.play(MUSIC_ELECTIONS); erase(); set_color(COLOR_WHITE,COLOR_BLACK,1); mvaddstr(0,23,"LCS MONTHLY INTELLIGENCE REPORT"); mvaddstr(2,27,"CURRENT POLITICAL TRENDS"); int numviews=(endgamestate>=ENDGAME_CCS_DEFEATED||newscherrybusted<2)?VIEWNUM-1:VIEWNUM; for(int v=-1-stalinmode,y=4,x=0,pip;v<numviews;v++) { if((y-4)*2>=numviews+1+stalinmode) y=4,x=40; for(pip=2;pip>=-2;pip--) { set_alignment_color(pip,true); if(pip==2) mvaddchar(y,x+22,'\x11'); addstr("ÄÄÄ"); if(pip==-2) addchar('\x10'); } if(v>=0) pip=14-(attitude[v]*14)/100; else pip=14-(publicmood(v)*14)/100; set_alignment_color((14-pip)/3-2,true); mvaddstr(y,x,getview(v,false)); mvaddchar(y++,x+23+pip,'O'); } set_color(COLOR_GREEN,COLOR_BLACK,1); mvaddstr(23,0,"Elite Liberal "); set_color(COLOR_WHITE,COLOR_BLACK,0); addstr("- "); set_color(COLOR_CYAN,COLOR_BLACK,1); addstr("Liberal "); set_color(COLOR_WHITE,COLOR_BLACK,0); addstr("- "); set_color(COLOR_YELLOW,COLOR_BLACK,1); addstr("moderate "); set_color(COLOR_WHITE,COLOR_BLACK,0); addstr("- "); set_color(COLOR_MAGENTA,COLOR_BLACK,1); addstr("Conservative "); set_color(COLOR_WHITE,COLOR_BLACK,0); addstr("- "); set_color(COLOR_RED,COLOR_BLACK,1); addstr("Arch-Conservative"); set_color(COLOR_WHITE,COLOR_BLACK,0); mvaddstr(24,0,"Press any key to reflect on these poll numbers."); clearformess=1; getkey(); } #endif /******************************************************* * * * END INTELLIGENCE REPORT * * * *******************************************************/ //ELECTIONS if(month==11){elections(clearformess,canseethings);clearformess=1;} //SUPREME COURT if(month==6){supremecourt(clearformess,canseethings);clearformess=1;} //CONGRESS congress(clearformess,canseethings);clearformess=1; //DID YOU WIN? if(wincheck()) { liberalagenda(1); savehighscore(END_WON); reset(savefile_name); viewhighscores(); end_game(); } //CONTROL LONG DISBANDS if(disbanding&&year-disbandtime>=50) { music.play(MUSIC_DEFEAT); set_color(COLOR_WHITE,COLOR_BLACK,1); erase(); move(12,10); addstr("The Liberal Crime Squad is now just a memory.", gamelog); gamelog.newline(); getkey(); set_color(COLOR_WHITE,COLOR_BLACK,0); erase(); move(12,12); addstr("The last LCS members have all been hunted down.", gamelog); gamelog.newline(); getkey(); set_color(COLOR_BLACK,COLOR_BLACK,1); erase(); move(12,14); addstr("They will never see the utopia they dreamed of...", gamelog); gamelog.newline(); gamelog.nextMessage(); getkey(); savehighscore(END_DISBANDLOSS); reset(savefile_name); viewhighscores(); end_game(); } //UPDATE THE WORLD IN CASE THE LAWS HAVE CHANGED updateworld_laws(law,oldlaw); //THE SYSTEM! for(p=len(pool)-1;p>=0;p--) { if(disbanding) break; if(!pool[p]->alive) continue; if(pool[p]->flag & CREATUREFLAG_SLEEPER) continue; if(pool[p]->location==-1) continue; if(location[pool[p]->location]->type==SITE_GOVERNMENT_POLICESTATION) { if(clearformess) erase(); else makedelimiter(); if(pool[p]->flag & CREATUREFLAG_MISSING) { set_color(COLOR_MAGENTA,COLOR_BLACK,1); move(8,1); addstr("Cops re-polluted ", gamelog); addstr(pool[p]->name, gamelog); addstr("'s mind with Conservatism!", gamelog); gamelog.nextMessage(); getkey(); removesquadinfo(*pool[p]); delete_and_remove(pool,p); continue; } else if(pool[p]->flag & CREATUREFLAG_ILLEGALALIEN && law[LAW_IMMIGRATION]!=2) { set_color(COLOR_MAGENTA,COLOR_BLACK,1); move(8,1); addstr(pool[p]->name, gamelog); addstr(" has been shipped out to the INS to face ", gamelog); if(law[LAW_IMMIGRATION]==-2 && law[LAW_DEATHPENALTY]==-2) addstr("execution.", gamelog); else addstr("deportation.", gamelog); gamelog.newline(); getkey(); removesquadinfo(*pool[p]); delete_and_remove(pool,p); continue; } else { //TRY TO GET RACKETEERING CHARGE int copstrength=100; if(law[LAW_POLICEBEHAVIOR]==-2) copstrength=200; if(law[LAW_POLICEBEHAVIOR]==-1) copstrength=150; if(law[LAW_POLICEBEHAVIOR]==1) copstrength=75; if(law[LAW_POLICEBEHAVIOR]==2) copstrength=50; copstrength=(copstrength*pool[p]->heat)/4; if(copstrength>200)copstrength=200; //Confession check if(LCSrandom(copstrength)>pool[p]->juice + pool[p]->get_attribute(ATTRIBUTE_HEART,true)*5 - pool[p]->get_attribute(ATTRIBUTE_WISDOM,true)*5 + pool[p]->get_skill(SKILL_PSYCHOLOGY)*5 /*+ pool[p]->get_skill(SKILL_SURVIVAL)*5*/ && pool[p]->hireid!=-1) { int nullify=0; int p2=getpoolcreature(pool[p]->hireid); if(pool[p2]->alive && (pool[p2]->location==-1 || location[pool[p2]->location]->type!=SITE_GOVERNMENT_PRISON)) { //Charge the boss with racketeering! criminalize(*pool[p2],LAWFLAG_RACKETEERING); //Rack up testimonies against the boss in court! pool[p2]->confessions++; } if(!nullify) { //Issue a raid on this guy's base! if(pool[p]->base>=0)location[pool[p]->base]->heat+=300; set_color(COLOR_WHITE,COLOR_BLACK,1); move(8,1); addstr(pool[p]->name, gamelog); addstr(" has broken under the pressure and ratted you out!", gamelog); gamelog.newline(); getkey(); set_color(COLOR_WHITE,COLOR_BLACK,1); move(9,1); addstr("The traitor will testify in court, and safehouses may be compromised.", gamelog); gamelog.nextMessage(); getkey(); removesquadinfo(*pool[p]); delete_and_remove(pool,p); continue; //no trial for this person; skip to next person } //else continue to trial } set_color(COLOR_WHITE,COLOR_BLACK,1); move(8,1); addstr(pool[p]->name, gamelog); addstr(" is moved to the courthouse for trial.", gamelog); gamelog.nextMessage(); getkey(); pool[p]->location=find_courthouse(*pool[p]); Armor prisoner(*armortype[getarmortype("ARMOR_PRISONER")]); pool[p]->give_armor(prisoner,NULL); } } else if(location[pool[p]->location]->type==SITE_GOVERNMENT_COURTHOUSE) { trial(*pool[p]); clearformess=1; } else if(location[pool[p]->location]->type==SITE_GOVERNMENT_PRISON) if(prison(*pool[p])) clearformess=1; } //NUKE EXECUTION VICTIMS for(p=len(pool)-1;p>=0;p--) { if(pool[p]->location==-1) continue; if(location[pool[p]->location]->type==SITE_GOVERNMENT_PRISON&&!pool[p]->alive) { removesquadinfo(*pool[p]); pool[p]->die(); pool[p]->location=-1; } } //MUST DO AN END OF GAME CHECK HERE BECAUSE OF EXECUTIONS endcheck(END_EXECUTED); //DISPERSAL CHECK dispersalcheck(clearformess); //FUND REPORTS if(canseethings)fundreport(clearformess); ledger.resetMonthlyAmounts(); if(clearformess) erase(); //HEAL CLINIC PEOPLE for(p=0;p<len(pool);p++) { if(disbanding) break; if(!(pool[p]->alive)) continue; if(pool[p]->clinic>0) { pool[p]->clinic--; for(int w=0;w<BODYPARTNUM;w++) { if((pool[p]->wound[w]&WOUND_NASTYOFF)||(pool[p]->wound[w]&WOUND_CLEANOFF)) pool[p]->wound[w]=(char)WOUND_CLEANOFF; else pool[p]->wound[w]=0; } int healthdamage = 0; if(pool[p]->special[SPECIALWOUND_RIGHTLUNG]!=1) { pool[p]->special[SPECIALWOUND_RIGHTLUNG]=1; if(LCSrandom(2)) healthdamage++; } if(pool[p]->special[SPECIALWOUND_LEFTLUNG]!=1) { pool[p]->special[SPECIALWOUND_LEFTLUNG]=1; if(LCSrandom(2)) healthdamage++; } if(pool[p]->special[SPECIALWOUND_HEART]!=1) { pool[p]->special[SPECIALWOUND_HEART]=1; if(LCSrandom(3)) healthdamage++; } pool[p]->special[SPECIALWOUND_LIVER]=1; pool[p]->special[SPECIALWOUND_STOMACH]=1; pool[p]->special[SPECIALWOUND_RIGHTKIDNEY]=1; pool[p]->special[SPECIALWOUND_LEFTKIDNEY]=1; pool[p]->special[SPECIALWOUND_SPLEEN]=1; pool[p]->special[SPECIALWOUND_RIBS]=RIBNUM; if(!pool[p]->special[SPECIALWOUND_NECK]) pool[p]->special[SPECIALWOUND_NECK]=2; if(!pool[p]->special[SPECIALWOUND_UPPERSPINE]) pool[p]->special[SPECIALWOUND_UPPERSPINE]=2; if(!pool[p]->special[SPECIALWOUND_LOWERSPINE]) pool[p]->special[SPECIALWOUND_LOWERSPINE]=2; // Inflict permanent health damage pool[p]->set_attribute(ATTRIBUTE_HEALTH,pool[p]->get_attribute(ATTRIBUTE_HEALTH,0)-healthdamage); if(pool[p]->get_attribute(ATTRIBUTE_HEALTH,0)<=0) pool[p]->set_attribute(ATTRIBUTE_HEALTH,1); if(pool[p]->blood<=20&&pool[p]->clinic<=2)pool[p]->blood=50; if(pool[p]->blood<=50&&pool[p]->clinic<=1)pool[p]->blood=75; // If at clinic and in critical condition, transfer to university hospital if(pool[p]->clinic > 2 && pool[p]->location > -1 && location[pool[p]->location]->type==SITE_HOSPITAL_CLINIC) { int hospital=find_hospital(*pool[p]); if(hospital!=-1) { pool[p]->location=hospital; set_color(COLOR_WHITE,COLOR_BLACK,1); move(8,1); addstr(pool[p]->name, gamelog); addstr(" has been transferred to ", gamelog); addstr(location[hospital]->name, gamelog); addstr(".", gamelog); gamelog.nextMessage(); getkey(); } } // End treatment if(pool[p]->clinic==0) { pool[p]->blood=100; if(clearformess) erase(); else makedelimiter(); set_color(COLOR_WHITE,COLOR_BLACK,1); move(8,1); addstr(pool[p]->name, gamelog); addstr(" has left ", gamelog); addstr(location[pool[p]->location]->name, gamelog); addstr(".", gamelog); gamelog.nextMessage(); int hs=find_homeless_shelter(*pool[p]); if(hs==-1) hs=0; //TODO: Error unable to find location if(location[pool[p]->base]->siege.siege|| location[pool[p]->base]->renting==RENTING_NOCONTROL) pool[p]->base=hs; pool[p]->location=pool[p]->base; getkey(); } } } }
GameBoard::GameBoard(QObject *parent) : QObject(parent) { // START PLACE std::shared_ptr<BoardPlace> start(new CornerPlace(0,QString("START"))); placesVector.push_back(start); // SALONIKI CityPlace* saloniki = new CityPlace(1,QString("SALONIKI"),100.0); saloniki->init(5, 25, 50, 100, 300, 500, 100, 100); placesVector.push_back(std::shared_ptr<BoardPlace>(saloniki)); // CHANCE placesVector.push_back(std::shared_ptr<BoardPlace>(new ChancePlace(2,QString("CHANCE1")))); // ATENY CityPlace* ateny = new CityPlace(3,QString("ATENY"),120.0); ateny->init(10, 30, 60, 150, 400, 600, 100, 100); placesVector.push_back(std::shared_ptr<BoardPlace>(ateny)); // PARKING TaxPlace* parking = new TaxPlace(4, QString("PARKING TAX")); parking->init(400.0,QString("You have to pay parking fee")); placesVector.push_back(std::shared_ptr<BoardPlace>(parking)); // SOUTH RAILWAY RailwayPlace* southRailway = new RailwayPlace(5, QString("SOUTH RAILWAY"), 400.0); southRailway->initPayments(); placesVector.push_back(std::shared_ptr<BoardPlace>(southRailway)); // NEAPOL CityPlace* neapol = new CityPlace(6,QString("NEAPOL"),200.0); neapol->init(20, 60, 100, 300, 500, 800, 100, 100); placesVector.push_back(std::shared_ptr<BoardPlace>(neapol)); // CHANCE placesVector.push_back(std::shared_ptr<BoardPlace>(new ChancePlace(7,QString("CHANCE2")))); // MEDIOLAN CityPlace* mediolan = new CityPlace(8,QString("MEDIOLAN"),250.0); mediolan->init(25, 80, 150, 300, 600, 800, 100, 100); placesVector.push_back(std::shared_ptr<BoardPlace>(mediolan)); // ROME CityPlace* rome = new CityPlace(9,QString("ROME"),290.0); rome->init(30, 100, 200, 350, 800, 1000, 100, 100); placesVector.push_back(std::shared_ptr<BoardPlace>(rome)); // VISITING PRISON std::shared_ptr<BoardPlace> visiting(new CornerPlace(10,QString("FOR VISITORS"))); placesVector.push_back(visiting); // BARCELONA CityPlace* barcelona = new CityPlace(11,QString("BARCELONA"),300.0); barcelona->init(30, 100, 250, 500, 900, 1200, 200, 200); placesVector.push_back(std::shared_ptr<BoardPlace>(barcelona)); // POWER STATION CounterPlace* electricStation = new CounterPlace(12, QString("ELECTRIC STATION"), 10, 300.0); placesVector.push_back(std::shared_ptr<BoardPlace>(electricStation)); // SEWILLA CityPlace* sewilla = new CityPlace(13, QString("SEWILLA"),320.0); sewilla->init(30, 120, 300, 700, 1000, 1300, 200, 200); placesVector.push_back(std::shared_ptr<BoardPlace>(sewilla)); // MADRYT CityPlace* madryt = new CityPlace(14, QString("MADRYT"),330.0); madryt->init(35, 125, 310, 800, 1100, 1400, 200, 200); placesVector.push_back(std::shared_ptr<BoardPlace>(madryt)); // WEST RAILWAY RailwayPlace* westRailway = new RailwayPlace(15, QString("WAST RAILWAY"), 400.0); placesVector.push_back(std::shared_ptr<BoardPlace>(westRailway)); // LIVERPOOL CityPlace* liverpool = new CityPlace(16, QString("LIVERPOOL"),370.0); liverpool->init(35, 140, 350, 1000, 1200, 1600, 200, 200); placesVector.push_back(std::shared_ptr<BoardPlace>(liverpool)); // CHANCE 3 placesVector.push_back(std::shared_ptr<BoardPlace>(new ChancePlace(17,QString("CHANCE3")))); // GLASGOW CityPlace* glasgow = new CityPlace(18, QString("GLASGOW"),380.0); glasgow->init(40, 150, 400, 1100, 1500, 1900, 200, 200); placesVector.push_back(std::shared_ptr<BoardPlace>(glasgow)); // LONDON CityPlace* london = new CityPlace(19, QString("LONDON"),400.0); london->init(45, 160, 450, 1200, 1600, 2000, 200, 200); placesVector.push_back(std::shared_ptr<BoardPlace>(london)); // FREE PARKING std::shared_ptr<BoardPlace> freeParking(new CornerPlace(20, QString("FREE PARKING"))); placesVector.push_back(freeParking); // ROTTERDAM CityPlace* rotterdam = new CityPlace(21, QString("ROTTERDAM"), 440.0); rotterdam->init(45, 180, 500, 1300, 1700, 2100, 300, 300); placesVector.push_back(std::shared_ptr<BoardPlace>(rotterdam)); // CHANCE 4 placesVector.push_back(std::shared_ptr<BoardPlace>(new ChancePlace(22,QString("CHANCE4")))); // BRUSSEL CityPlace* brussel = new CityPlace(23, QString("ROTTERDAM"), 440.0); brussel->init(45, 180, 550, 1350, 1750, 2200, 300, 300); placesVector.push_back(std::shared_ptr<BoardPlace>(brussel)); // AMSTERDAM CityPlace* amsterdam = new CityPlace(24, QString("AMSTERDAM"), 480.0); amsterdam->init(50, 200, 600, 1400, 1800, 2250, 300, 300); placesVector.push_back(std::shared_ptr<BoardPlace>(amsterdam)); // NORTH RAILWAY RailwayPlace* northRailway = new RailwayPlace(25, QString("NORTH RAILWAY"), 400.0); placesVector.push_back(std::shared_ptr<BoardPlace>(northRailway)); // MALMO CityPlace* malmo = new CityPlace(26, QString("MALMO"), 520.0); malmo->init(50, 220, 660, 1600, 1950, 2300, 300, 300); placesVector.push_back(std::shared_ptr<BoardPlace>(malmo)); // GOTEBORG CityPlace* goteborg = new CityPlace(27, QString("GOTEBORG"), 520.0); goteborg->init(50, 220, 660, 1600, 1950, 2300, 300, 300); placesVector.push_back(std::shared_ptr<BoardPlace>(goteborg)); // WATERWORKS CounterPlace* waterworks = new CounterPlace(28, QString("WATERWORKS"), 10, 300.0); placesVector.push_back(std::shared_ptr<BoardPlace>(waterworks)); // SZTOKHOLM CityPlace* sztokholm = new CityPlace(29, QString("SZTOKHOLM"), 550.0); sztokholm->init(50, 250, 700, 1800, 2000, 2400, 300, 300); placesVector.push_back(std::shared_ptr<BoardPlace>(sztokholm)); // PRISON std::shared_ptr<BoardPlace> prison(new CornerPlace(30, QString("PRISON"))); placesVector.push_back(prison); // FRANKFURT CityPlace* frankfurt = new CityPlace(31, QString("FRANKFURT"), 600.0); frankfurt->init(55, 250, 660, 1800, 2200, 2600, 400, 400); placesVector.push_back(std::shared_ptr<BoardPlace>(frankfurt)); // KOLONY CityPlace* kolony = new CityPlace(32, QString("KOLONY"), 600.0); kolony->init(55, 250, 660, 1800, 2200, 2600, 400, 400); placesVector.push_back(std::shared_ptr<BoardPlace>(kolony)); // CHANCE 5 placesVector.push_back(std::shared_ptr<BoardPlace>(new ChancePlace(33,QString("CHANCE5")))); // BONN CityPlace* bonn = new CityPlace(34, QString("BONN"), 650.0); bonn->init(60, 300, 700, 2000, 2400, 2800, 400, 400); placesVector.push_back(std::shared_ptr<BoardPlace>(bonn)); // EAST RAILWAY RailwayPlace* eastRailway = new RailwayPlace(35, QString("EAST RAILWAY"), 400.0); placesVector.push_back(std::shared_ptr<BoardPlace>(eastRailway)); // CHANCE 6 placesVector.push_back(std::shared_ptr<BoardPlace>(new ChancePlace(36,QString("CHANCE6")))); // INSBRUCK CityPlace* insbruck = new CityPlace(37, QString("INSBRUCK"), 700.0); insbruck->init(70, 350, 900, 2200, 2800, 3500, 400, 400); placesVector.push_back(std::shared_ptr<BoardPlace>(insbruck)); // INCOME TAX TaxPlace* incomeTax = new TaxPlace(38, QString("INCOME TAX")); parking->init(200.0,QString("You have to pay income tax")); placesVector.push_back(std::shared_ptr<BoardPlace>(incomeTax)); // VIENNA CityPlace* vienna = new CityPlace(39, QString("VIENNA"), 800.0); vienna->init(100, 400, 1400, 2500, 3000, 4000, 400, 400); placesVector.push_back(std::shared_ptr<BoardPlace>(vienna)); Q_ASSERT(placesVector.size() == 40); // TOKENS CONSTRUCTION QPointer<Token> token0(new Token(0, placesVector, this)); tokens.push_back(token0); QPointer<Token> token1(new Token(1, placesVector, this)); tokens.push_back(token1); QPointer<Token> token2(new Token(2, placesVector, this)); tokens.push_back(token2); QPointer<Token> token3(new Token(3, placesVector, this)); tokens.push_back(token3); QPointer<Token> token4(new Token(4, placesVector, this)); tokens.push_back(token4); // TOKENS SIGNALS AND SLOTS for (auto a : tokens) { bool result1 = QObject::connect(a, SIGNAL(startGame()), this, SLOT(startGame())); Q_ASSERT(result1); } bool res1 = QObject::connect(&playerFactory, SIGNAL(playerReady(std::shared_ptr<Player>)), this, SLOT(addPlayer(std::shared_ptr<Player>))); bool res2 = QObject::connect(&playerFactory, SIGNAL(removePlayerFromBoard(int)), this, SLOT(handleRemovePlayerRequest(int))); }