/* party info at top of screen */ void printparty(void) { Creature *party[6]={NULL,NULL,NULL,NULL,NULL,NULL}; if(activesquad!=NULL) { for(int p=0;p<6;p++)party[p]=activesquad->squad[p]; } set_color(COLOR_WHITE,COLOR_BLACK,0); for(int i=2;i<8;i++) { move(i,0); addstr(" "); } if(party_status!=-1&&party[party_status]==NULL)party_status=-1; if(party_status!=-1) { printcreatureinfo(party[party_status]); char num[20]; set_color(COLOR_WHITE,COLOR_BLACK,1); itoa(party_status+1,num,10); move(1,0); addstr(num); } else { char str[200]; char num[20]; move(1,0); addstr("#-CODE NAME------------SKILL---WEAPON---------ARMOR----------HEALTH---TRANSPORT-"); for(int p=0;p<6;p++) { set_color(COLOR_WHITE,COLOR_BLACK,0); move(p+2,0); addstr(" "); move(p+2,0); addch('1'+p); if(party[p]!=NULL) { if(party[p]->prisoner!=NULL)set_color(COLOR_MAGENTA,COLOR_BLACK,1); else set_color(COLOR_WHITE,COLOR_BLACK,0); move(p+2,2); addstr(party[p]->name); if(party[p]->prisoner!=NULL)addstr("+H"); int skill=0; char bright=0; for(int sk=0;sk<SKILLNUM;sk++) { skill+=(int)party[p]->get_skill(sk); if(party[p]->get_skill_ip(sk)>=100+(10*party[p]->get_skill(sk))&& party[p]->get_skill(sk)<party[p]->skill_cap(sk,true))bright=1; } set_color(COLOR_WHITE,COLOR_BLACK,bright); move(p+2,23); itoa(skill,num,10); addstr(num); addstr("/"); int wsk = SKILL_HANDTOHAND; if(party[p]->get_weapon().has_musical_attack()) wsk=SKILL_MUSIC; else if (party[p]->has_thrown_weapon && !party[p]->extra_throwing_weapons.empty()) wsk=party[p]->extra_throwing_weapons[0]->get_attack(false,false,false)->skill; else wsk=party[p]->get_weapon().get_attack(false,false,false)->skill; itoa(party[p]->get_skill(wsk),num,10); addstr(num); move(p+2,31); if(mode!=GAMEMODE_SITE)set_color(COLOR_WHITE,COLOR_BLACK,0); else switch(weaponcheck(*party[p])) { case -1: case 0:set_color(COLOR_GREEN,COLOR_BLACK,1);break; case 1:set_color(COLOR_YELLOW,COLOR_BLACK,1);break; case 2:set_color(COLOR_RED,COLOR_BLACK,1);break; } if(party[p]->has_thrown_weapon && !party[p]->extra_throwing_weapons.empty()) addstr(party[p]->extra_throwing_weapons[0]->get_shortname(0).c_str()); else addstr(party[p]->get_weapon().get_shortname(0).c_str()); //set_color(COLOR_WHITE,COLOR_BLACK,0); if(party[p]->get_weapon().get_ammoamount()>0) { //set_color(COLOR_WHITE,COLOR_BLACK,0); char num[20]; itoa(party[p]->get_weapon().get_ammoamount(),num,10); addstr(" ("); addstr(num); addstr(")"); } else if(party[p]->get_weapon().uses_ammo()) { set_color(COLOR_BLACK,COLOR_BLACK,1); if(!party[p]->clips.empty()) { char num[20]; itoa(party[p]->count_clips(),num,10); addstr(" ("); addstr(num); addstr(")"); } else { addstr(" (XX)"); } } else if(party[p]->get_weapon().is_throwable() && !party[p]->has_thrown_weapon) { addstr(" (1)"); } else if(party[p]->has_thrown_weapon && !party[p]->extra_throwing_weapons.empty()) { set_color(COLOR_BLACK,COLOR_BLACK,1); int no_weapons = party[p]->count_weapons() - party[p]->is_armed(); char num[20]; itoa(no_weapons,num,10); addstr(" ("); addstr(num); addstr(")"); } if(mode!=GAMEMODE_SITE)set_color(COLOR_WHITE,COLOR_BLACK,0); else { switch(hasdisguise(*party[p])) { case 1:set_color(COLOR_GREEN,COLOR_BLACK,1);break; case 2:set_color(COLOR_YELLOW,COLOR_BLACK,1);break; default: if(party[p]->get_armor().get_stealth_value() > 1) set_color(COLOR_BLACK,COLOR_BLACK,1); else set_color(COLOR_RED,COLOR_BLACK,1); break; } if(sitealarmtimer>=0 || sitealarm==1) if(party[p]->get_armor().get_stealth_value() > 1) set_color(COLOR_BLACK,COLOR_BLACK,1); } move(p+2,46); addstr(party[p]->get_armor().get_shortname().c_str()); printhealthstat(*party[p],p+2,61,TRUE); set_color(COLOR_WHITE,COLOR_BLACK,0); move(p+2,70); long v=-1; if(showcarprefs==1)v=id_getcar(party[p]->pref_carid); else v=id_getcar(party[p]->carid); if(v!=-1&&showcarprefs!=-1) { strcpy(str,vehicle[v]->shortname().c_str()); char d; if(showcarprefs==1)d=party[p]->pref_is_driver; else d=party[p]->is_driver; if(d)strcat(str,"-D"); } else { int legok=2; if((party[p]->wound[BODYPART_LEG_RIGHT] & WOUND_NASTYOFF)|| (party[p]->wound[BODYPART_LEG_RIGHT] & WOUND_CLEANOFF))legok--; if((party[p]->wound[BODYPART_LEG_LEFT] & WOUND_NASTYOFF)|| (party[p]->wound[BODYPART_LEG_LEFT] & WOUND_CLEANOFF))legok--; if(party[p]->flag & CREATUREFLAG_WHEELCHAIR)strcpy(str,"Wheelchair"); else if(legok>=1)strcpy(str,"On Foot"); else strcpy(str,"On \"Foot\""); } addstr(str); } } } makedelimiter(8,0); }
/* character info at top of screen */ void printcreatureinfo(Creature *cr, unsigned char knowledge) { char num[20],str[200]; makedelimiter(1,0); set_color(COLOR_WHITE,COLOR_BLACK,0); move(1,2); addstr(cr->name); addstr(", "); gettitle(str,*cr); addstr(str); if(cr->prisoner!=NULL) { addstr(", holding "); switch(cr->prisoner->type) { case CREATURE_CORPORATE_CEO:addstr("a squirming CEO");break; case CREATURE_RADIOPERSONALITY:addstr("a crying Radio Personality");break; case CREATURE_NEWSANCHOR:addstr("smarmy News Anchor");break; case CREATURE_SCIENTIST_EMINENT:addstr("a frightened Eminent Scientist");break; case CREATURE_JUDGE_CONSERVATIVE:addstr("an angry Hangin' Judge");break; default: addstr(cr->prisoner->name); break; } } move(2,0);addstr("Hrt: "); if(knowledge>0) { itoa(cr->get_attribute(ATTRIBUTE_HEART,true),num,10); addstr(num); } else addstr("?"); move(3,0);addstr("Int: "); if(knowledge>0) { itoa(cr->get_attribute(ATTRIBUTE_INTELLIGENCE,true),num,10); addstr(num); } else addstr("?"); move(4,0);addstr("Wis: "); if(knowledge>0) { itoa(cr->get_attribute(ATTRIBUTE_WISDOM,true),num,10); addstr(num); } else addstr("?"); move(5,0);addstr("Hlth: "); if(knowledge>1) { itoa(cr->get_attribute(ATTRIBUTE_HEALTH,true),num,10); addstr(num); } else addstr("?"); move(2,11);addstr("Agi: "); if(knowledge>1) { itoa(cr->get_attribute(ATTRIBUTE_AGILITY,true),num,10); addstr(num); } else addstr("?"); move(3,11);addstr("Str: "); if(knowledge>1) { itoa(cr->get_attribute(ATTRIBUTE_STRENGTH,true),num,10); addstr(num); } else addstr("?"); move(4,11);addstr("Char: "); if(knowledge>0) { itoa(cr->get_attribute(ATTRIBUTE_CHARISMA,true),num,10); addstr(num); } else addstr("?"); move(5,11); addstr("Trans: "); long v=-1; if(showcarprefs==1)v=id_getcar(cr->pref_carid); else v=id_getcar(cr->carid); if(v!=-1&&showcarprefs!=-1) { strcpy(str,vehicle[v]->shortname().c_str()); char d; if(showcarprefs==1)d=cr->pref_is_driver; else d=cr->is_driver; if(d)strcat(str,"-D"); } else { int legok=2; if((cr->wound[BODYPART_LEG_RIGHT] & WOUND_NASTYOFF)|| (cr->wound[BODYPART_LEG_RIGHT] & WOUND_CLEANOFF))legok--; if((cr->wound[BODYPART_LEG_LEFT] & WOUND_NASTYOFF)|| (cr->wound[BODYPART_LEG_LEFT] & WOUND_CLEANOFF))legok--; if(cr->flag & CREATUREFLAG_WHEELCHAIR)strcpy(str,"Wheelchair"); else if(legok>=1)strcpy(str,"On Foot"); else strcpy(str,"On \"Foot\""); } addstr(str); move(6,0); if(mode!=GAMEMODE_SITE)set_color(COLOR_WHITE,COLOR_BLACK,0); else switch(weaponcheck(*cr)) { case -1: case 0:set_color(COLOR_GREEN,COLOR_BLACK,1);break; case 1:set_color(COLOR_YELLOW,COLOR_BLACK,1);break; case 2:set_color(COLOR_RED,COLOR_BLACK,1);break; } addstr("Weapon: "); addstr(cr->get_weapon_string(1).c_str()); if(mode!=GAMEMODE_SITE)set_color(COLOR_WHITE,COLOR_BLACK,0); else { switch(hasdisguise(*cr)) { case 1:set_color(COLOR_GREEN,COLOR_BLACK,1);break; case 2:set_color(COLOR_YELLOW,COLOR_BLACK,1);break; default: if(cr->get_armor().get_stealth_value() > 1) set_color(COLOR_BLACK,COLOR_BLACK,1); else set_color(COLOR_RED,COLOR_BLACK,1); } if(sitealarmtimer>=0 || sitealarm==1) if(cr->get_armor().get_stealth_value() > 1) set_color(COLOR_BLACK,COLOR_BLACK,1); } move(7,0); addstr("Clothes: "); addstr(cr->get_armor_string(false).c_str()); set_color(COLOR_WHITE,COLOR_BLACK,0); char used[SKILLNUM]; memset(used,0,sizeof(char)*SKILLNUM); int snum=5; char printed=1; while(snum>0&&printed) { printed=0; int max=0; long maxs=-1; for(int s=0;s<SKILLNUM;s++) { if(cr->get_skill(s)>max && !used[s]) { max=cr->get_skill(s); maxs=s; } } if(maxs!=-1) { used[maxs]=1; printed=1; if(cr->get_skill_ip(maxs)>=100+(10*cr->get_skill(maxs))&& cr->get_skill(maxs)<cr->skill_cap(maxs,true))set_color(COLOR_WHITE,COLOR_BLACK,1); else set_color(COLOR_WHITE,COLOR_BLACK,0); move(3+5-snum,31); if(knowledge>5-snum) strcpy(str,Skill::get_name(maxs).c_str()); else strcpy(str,"???????"); strcat(str,": "); if(knowledge>7-snum) itoa(cr->get_skill(maxs),num,10); else strcpy(num,"?"); strcat(str,num); addstr(str); if(snum==5&&printed) { set_color(COLOR_WHITE,COLOR_BLACK,0); move(2,31); addstr("Top Skills:"); } } snum--; } int woundsum=0; for(int w=0;w<BODYPARTNUM;w++) { if(cr->wound[w]!=0)woundsum++; } printhealthstat(*cr,1,49,FALSE); if(woundsum>0) { for(int w=0;w<BODYPARTNUM;w++) { if(cr->wound[w] & WOUND_BLEEDING)set_color(COLOR_RED,COLOR_BLACK,1); else set_color(COLOR_WHITE,COLOR_BLACK,0); move(2+w,49); switch(w) { case BODYPART_HEAD:addstr("Head:");break; case BODYPART_BODY:addstr("Body:");break; case BODYPART_ARM_RIGHT:addstr("Right Arm:");break; case BODYPART_ARM_LEFT:addstr("Left Arm:");break; case BODYPART_LEG_RIGHT:addstr("Right Leg:");break; case BODYPART_LEG_LEFT:addstr("Left Leg:");break; } move(2+w,61); if(cr->wound[w] & WOUND_NASTYOFF)addstr("Ripped off"); else if(cr->wound[w] & WOUND_CLEANOFF)addstr("Clean sever"); else { int sum=0; if(cr->wound[w] & WOUND_SHOT)sum++; if(cr->wound[w] & WOUND_CUT)sum++; if(cr->wound[w] & WOUND_BRUISED)sum++; if(cr->wound[w] & WOUND_BURNED)sum++; if(cr->wound[w] & WOUND_TORN)sum++; if(sum==0) { set_color(COLOR_GREEN,COLOR_BLACK,1); if(cr->animalgloss==ANIMALGLOSS_ANIMAL) addstr("Animal"); else addstr("Liberal"); } if(cr->wound[w] & WOUND_SHOT){addstr("Sht");sum--;if(sum>0)addstr(",");} if(cr->wound[w] & WOUND_BRUISED){addstr("Brs");sum--;if(sum>0)addstr(",");} if(cr->wound[w] & WOUND_CUT){addstr("Cut");sum--;if(sum>0)addstr(",");} if(cr->wound[w] & WOUND_TORN){addstr("Trn");sum--;if(sum>0)addstr(",");} if(cr->wound[w] & WOUND_BURNED){addstr("Brn");sum--;if(sum>0)addstr(",");} } } set_color(COLOR_WHITE,COLOR_BLACK,0); } }
/* checks if conservatives see through your disguise */ void disguisecheck(int timer) { int weapon=0; int squadsize=0; bool forcecheck=false; int weaponar[6]= {0}; bool spotted = false; int blew_it = -1; // Only start to penalize the player's disguise/stealth checks after the first turn. timer--; for(int i=0; i<6; i++) { if(activesquad->squad[i]==NULL)break; squadsize++; if(activesquad->squad[i]->is_naked() && activesquad->squad[i]->animalgloss!=ANIMALGLOSS_ANIMAL)forcecheck=true; int thisweapon=weaponcheck(*activesquad->squad[i]); if(thisweapon>weapon)weapon=thisweapon; if(thisweapon==2)weaponar[i]=1; } // Nothing suspicious going on here if(sitealarmtimer==-1 && weapon<1 && !forcecheck) { if(!disguisesite(location[cursite]->type)&& !(levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED))return; } char noticed=0; vector<int> noticer; for(int e=0; e<ENCMAX; e++) { if(encounter[e].type==CREATURE_PRISONER)continue; if(encounter[e].exists&&encounter[e].alive&& encounter[e].enemy()) { noticer.push_back(e); } } if(noticer.size()>0) { int n,an; do { an=LCSrandom(noticer.size()); n=noticer[an]; noticer.erase(noticer.begin() + an); int difficulty; // Determine difficulty based on enemy type switch(encounter[n].type) { default: difficulty = DIFFICULTY_VERYEASY; break; case CREATURE_SWAT: case CREATURE_COP: case CREATURE_GANGUNIT: case CREATURE_DEATHSQUAD: difficulty = DIFFICULTY_EASY; break; case CREATURE_PRISONGUARD: case CREATURE_BOUNCER: case CREATURE_AGENT: case CREATURE_SECURITYGUARD: difficulty = DIFFICULTY_AVERAGE; break; case CREATURE_CORPORATE_CEO: case CREATURE_JUDGE_CONSERVATIVE: case CREATURE_CCS_ARCHCONSERVATIVE: case CREATURE_SCIENTIST_EMINENT: difficulty = DIFFICULTY_HARD; break; case CREATURE_GUARDDOG: difficulty = DIFFICULTY_HEROIC; break; } // Increase difficulty if Conservatives suspicious... if(sitealarmtimer==1) difficulty += 3; // Make the attempt! for(int i=0; i<6; i++) { if(activesquad->squad[i]==NULL)break; // Try to sneak. if(!spotted) { int result = activesquad->squad[i]->skill_roll(SKILL_STEALTH); result -= timer; // Sneaking with a party is hard if(result < (difficulty + squadsize - 1)) spotted = true; } // Spotted! Act casual. if(spotted) { // Guns of death and doom are not very casual. if(weaponcheck(*activesquad->squad[i]) == 2) { noticed = true; break; } else { int result = activesquad->squad[i]->skill_roll(SKILL_DISGUISE); result -= timer; if(result<difficulty) { // That was not very casual, dude. if(result<0)blew_it=i; noticed = true; break; } } } } if(noticed)break; } while(noticer.size()>0); // Give feedback on the Liberal Performance if(!spotted) { for(int i=0; i<6; i++) { if(activesquad->squad[i] == NULL) break; activesquad->squad[i]->train(SKILL_STEALTH, 10); } if(timer == 0) { set_color(COLOR_CYAN,COLOR_BLACK,1); move(16,1); if(squadsize > 1) addstr("The squad "); else addstr(activesquad->squad[0]->name); addstr(" fades into the shadows."); getch(); } } else { if(blew_it == -1) { int i; for(i=0; i<6; i++) { if(activesquad->squad[i] == NULL) break; if(hasdisguise(*(activesquad->squad[i]))) activesquad->squad[i]->train(SKILL_DISGUISE, 10); } } if(blew_it != -1 && LCSrandom(2)) { set_color(COLOR_YELLOW,COLOR_BLACK,1); move(16,1); addstr(activesquad->squad[blew_it]->name); switch(LCSrandom(5)) { case 0: addstr(" coughs."); break; case 1: addstr(" accidentally mumbles the slogan."); break; case 2: addstr(" paces uneasily."); break; case 3: addstr(" stares at the Conservatives."); break; case 4: addstr(" laughs nervously."); break; } getch(); } else if(!noticed) { set_color(COLOR_CYAN,COLOR_BLACK,1); move(16,1); if(squadsize > 1) addstr("The squad"); else addstr(activesquad->squad[0]->name); addstr(" acts natural."); getch(); } } if(!noticed)return; clearmessagearea(); set_color(COLOR_RED,COLOR_BLACK,1); move(16,1); addstr(encounter[n].name); if(sitealarmtimer!=0 && weapon<1 && encounter[n].type!=CREATURE_GUARDDOG) { if((sitetype==SITE_RESIDENTIAL_TENEMENT|| sitetype==SITE_RESIDENTIAL_APARTMENT|| sitetype==SITE_RESIDENTIAL_APARTMENT_UPSCALE)&& levelmap[locx][locy][locz].flag & SITEBLOCK_RESTRICTED) { sitealarm=1; addstr(" shouts in alarm at the squad's Liberal Trespassing!"); } else { addstr(" looks at the Squad suspiciously."); int time; time = 20 + LCSrandom(10) - encounter[n].get_attribute(ATTRIBUTE_INTELLIGENCE,true) - encounter[n].get_attribute(ATTRIBUTE_WISDOM,true); if(time<1)time=1; if(sitealarmtimer>time||sitealarmtimer==-1)sitealarmtimer=time; else { if(sitealarmtimer>5) sitealarmtimer-= 5; if(sitealarmtimer<=5)sitealarmtimer = 0; } } } else { if(weapon&&encounter[n].type!=CREATURE_GUARDDOG) { addstr(" sees the Squad's Liberal Weapons"); move(17,1); if(encounter[n].align==ALIGN_CONSERVATIVE) addstr("and lets forth a piercing Conservative alarm cry!"); else addstr("and shouts for help!"); for(int i=0; i<6; i++) { if(activesquad->squad[i]==NULL)break; //if(weaponar[i]) //{ // Illegal weapon crimes disabled //criminalize(*activesquad->squad[i],LAWFLAG_GUNCARRY); //} } } else { addstr(" looks at the Squad with Intolerance"); move(17,1); if(encounter[n].align==ALIGN_CONSERVATIVE) { if(encounter[n].type==CREATURE_GUARDDOG) addstr("and launches into angry Conservative barking!"); else addstr("and lets forth a piercing Conservative alarm cry!"); } else addstr("and shouts for help!"); } sitealarm=1; } refresh(); getch(); } }