void l_void_station(void) { int i,something=FALSE; if (cinema_confirm("You're about to Peter Pan into an endless void.")=='y') { if (Level->mlist == NULL) { print2("You fall forever. Eventually you die of starvation."); morewait(); while(Player.hp>0) { Time+=60; hourly_check(); usleep(250000); } } else { print1("You enter the void."); print2("You feel a sudden surge of power from five directions."); morewait(); something = (Player.packptr > 0); if (! something) for(i=0;((i<MAXITEMS)&&(!something));i++) if (Player.possessions[i] != NULL) something = TRUE; if (something) { print1("The flow of power is disrupted by something!"); print2("The power is unbalanced! You lose control!"); morewait(); print1("Each of your cells explodes with a little scream of pain."); print2("Your disrupted essence merges with the megaflow."); p_death("the Power of the Void"); } else if (! gamestatusp(PREPARED_VOID)){ print1("The hungry void swallows you whole!"); print2("Your being dissipates with a pathetic little sigh...."); p_death("the Emptyness of the Void"); } else { print1("The flow of power rages through your body,"); print2("but you manage to master the surge!"); print3("You feel adept...."); morewait();clearmsg(); print1("With a thought, you soar up through the void to the"); print2("place from whence you came."); print3("As the platform of the Challenge dwindles beneath you"); morewait(); clearmsg(); print1("You see Death raise his scythe to you in a salute."); Player.rank[ADEPT] = 1; setgamestatus(COMPLETED_CHALLENGE); FixedPoints = calc_points(); /* set so change_environment puts player in correct temple! */ Player.x = 49; Player.y = 59; print2("You find yourself back in the Temple of Destiny."); morewait(); change_environment(E_TEMPLE); } } } else print2("You back away from the edge...."); }
//------------------------------------------------------------------------ bool gamma_ctrl_impl::on_mouse_button_down(double x, double y) { inverse_transform_xy(&x, &y); calc_points(); if(calc_distance(x, y, m_xp1, m_yp1) <= m_point_size + 1) { m_mouse_point = 1; m_pdx = m_xp1 - x; m_pdy = m_yp1 - y; m_p1_active = true; return true; } if(calc_distance(x, y, m_xp2, m_yp2) <= m_point_size + 1) { m_mouse_point = 2; m_pdx = m_xp2 - x; m_pdy = m_yp2 - y; m_p1_active = false; return true; } return false; }
void display_win(void) { clear(); touchwin(stdscr); printw("\n\n\n\n"); printw(Player.name); if (Player.rank[ADEPT]) { printw(" is a total master of omega with %ld points!",FixedPoints); strcpy(Str4,"A total master of omega"); } else { strcpy(Str4,"retired a winner"); printw(" triumphed in omega with %ld points!",calc_points()); } printw("\n\n\n\n\nHit 'c' to continue."); refresh(); while (wgetch(stdscr) != 'c') ; clear(); touchwin(stdscr); refresh(); if (Player.rank[ADEPT]) extendlog(Str4,BIGWIN); else extendlog(Str4,WIN); }
static void project_object(PROJECT *Project, OBJECT *Object, int Axis, VECTOR Origin, int proj_thru, PROJECT *proj_proj) { int visible, Number; VECTOR Points[8]; /* Do not project infinite objects (always visible!) */ if (Test_Flag(Object, INFINITE_FLAG)) { Project->x1 = Project->y1 = MIN_BUFFER_ENTRY; Project->x2 = Project->y2 = MAX_BUFFER_ENTRY; return; } /* Get points to project */ calc_points(Axis, Object, &Number, Points, Origin); visible = false; Project->x1 = Project->y1 = MAX_BUFFER_ENTRY; Project->x2 = Project->y2 = MIN_BUFFER_ENTRY; if (Number == 3) { project_triangle(Project, Points[0], Points[1], Points[2], &visible); } else { project_bbox(Project, Points, &visible); } if ( visible && proj_thru ) { visible = intersect_projects( Project, proj_proj ); if ( visible ) { if (Project->x1 < proj_proj->x1 ) Project->x1 = proj_proj->x1; if (Project->x2 > proj_proj->x2 ) Project->x2 = proj_proj->x2; if (Project->y1 < proj_proj->y1 ) Project->y1 = proj_proj->y1; if (Project->y2 > proj_proj->y2 ) Project->y2 = proj_proj->y2; } } if (!visible) { /* Object is invisible */ Project->x1 = Project->y1 = MAX_BUFFER_ENTRY; Project->x2 = Project->y2 = MIN_BUFFER_ENTRY; } else { /* We don't want to miss something */ Project->x1 -= 2; Project->x2 += 2; Project->y1 -= 2; Project->y2 += 2; } }
// inserts a word and status at the back of the linked list // arg: word and status (OK or NO) // rets: true if the word was inserted and false otherwise bool BogScorer::insert(string word, string status) { WordNode* temp = new WordNode; if(temp != NULL){ if (status == "OK"){ temp->status = status; temp->score = calc_points(word); num_valid_words ++; } else{ temp->status = status; temp->score = 0; } temp->word = word; temp->next = NULL; if (!isEmpty()) tail->next = temp; else head = temp; tail = temp; num_words++; points = points + temp->score; return true; } else{ return false; } }
void init_result_dlg(Game *g) { if(g->gametype == _RAMSCH) { g->player = 0; for(int i = 1; i < 3; i++) { if(g->p[i]->cur_game_points > g->p[g->player]->cur_game_points) g->player = i; } } int points = calc_points(g); int spw = calc_spielwert(g); if(g->gametype == _RAMSCH) { for(int i = 0; i < 3; ++i) if(g->p[i]->cur_game_points == g->p[g->player]->cur_game_points) { g->p[i]->total_points += spw; } } else g->p[g->player]->total_points += spw; result_dlg[2].dp = malloc(100); result_dlg[3].dp = malloc(100); result_dlg[4].dp = malloc(100); switch(g->gametype) { case _FARBSP: case _GRAND: sprintf(result_dlg[2].dp, "%s %s das Spiel mit %i zu %i Punkten.", g->p[g->player]->name, (spw > 0 ? "gewinnt" : "verliert"), points, 120-points); break; case _RAMSCH: sprintf(result_dlg[2].dp, "%s %s den Ramsch.", g->p[g->player]->name, (spw > 0 ? "gewinnt" : "verliert")); break; case _NULL: sprintf(result_dlg[2].dp, "%s %s das Nullspiel.", g->p[g->player]->name, (spw > 0 ? "gewinnt" : "verliert")); break; } sprintf(result_dlg[3].dp, "Der Spielwert ist %i.", spw); sprintf(result_dlg[4].dp, "Punkte: %s %i, %s %i, %s %i", g->p[0]->name, g->p[0]->total_points, g->p[1]->name, g->p[1]->total_points, g->p[2]->name, g->p[2]->total_points); }
void display_quit(void) { clear(); touchwin(stdscr); printw("\n\n\n\n"); printw(Player.name); strcpy(Str4,"A quitter."); printw(" wimped out with %ld points!",calc_points()); printw("\n\n\n\n\nHit 'c' to continue."); refresh(); while (wgetch(stdscr) != 'c') ; clear(); touchwin(stdscr); refresh(); extendlog(Str4,QUIT); }
void Utc::save() { qDebug() << "begin save"; QFile outfile("save.txt"); outfile.open(QIODevice::WriteOnly); QTextStream out(&outfile); out.setCodec("UTF-8"); QString abcd = "abcd", ABCD = "ABCD"; // QMapIterator<int, Test> it(all_tests); QMap<int, Test>::iterator it; // while (it.hasNext()) for (it = all_tests.begin(); it != all_tests.end(); ++it) { // it.next(); out << "Test No. " << it.key() << endl; for (int j=0; j < num_questions; j++) { out << "q" << j + 1 << " " << endl; const Question* qq = &(it.value().q[j]); for (int k=0; k < 4; k++) { if (qq->ans_correct[k] == 1) out << ABCD[k]; else out << abcd[k]; if (qq->ans_student[k] == 1) out << " yes "; else if (qq->ans_student[k] == 2) out << " no "; if (qq->ans_student[k] == qq->ans_correct[k]) out << "+"; if (qq->ans_student[k] + qq->ans_correct[k] == 3) out << "-"; out << endl; } // current_test = it; calc_points(it); out << qq->quest << endl; } double ep = it.value().points*(ui.exam_max->value())/num_questions/4.0; if (ep < 0) ep = 0; out << "Total " << it.value().points << " ( " << qCeil(ep) << " pt )" << endl; } outfile.close(); qDebug() << "end save"; }
void display_death(char *source) { clear(); touchwin(stdscr); printw("\n\n\n\n"); printw("Requiescat In Pace, "); printw(Player.name); printw(" (%ld points)",calc_points()); strcpy(Str4,"Killed by "); strcat(Str4,source); printw("\n"); printw(Str4); printw("."); printw("\n\n\n\n\nHit 'c' to continue."); refresh(); while (wgetch(stdscr) != 'c') ; clear(); touchwin(stdscr); refresh(); extendlog(Str4,DEAD); }
void Utc::abcd() { qDebug() << "abcd begin" << current_quest; Question* qq = ¤t_test.value().q[current_quest - 1]; qq->ans_student[0] = 0; if (ui.a1->isChecked()) qq->ans_student[0] = 1; if (ui.a2->isChecked()) qq->ans_student[0] = 2; qq->ans_student[1] = 0; if (ui.b1->isChecked()) qq->ans_student[1] = 1; if (ui.b2->isChecked()) qq->ans_student[1] = 2; qq->ans_student[2] = 0; if (ui.c1->isChecked()) qq->ans_student[2] = 1; if (ui.c2->isChecked()) qq->ans_student[2] = 2; qq->ans_student[3] = 0; if (ui.d1->isChecked()) qq->ans_student[3] = 1; if (ui.d2->isChecked()) qq->ans_student[3] = 2; calc_points(current_test); const QString pmm = "0+-"; ui.aplus->setText(pmm[qq->ans_student_correct[0]]); ui.bplus->setText(pmm[qq->ans_student_correct[1]]); ui.cplus->setText(pmm[qq->ans_student_correct[2]]); ui.dplus->setText(pmm[qq->ans_student_correct[3]]); ui.quest->setNum(current_test.value().q[current_quest - 1].quest); total = current_test.value().points; ui.total->setNum(total); double ep = total*(ui.exam_max->value())/num_questions/4.0; if (ep < 0) ep = 0; ui.exam->setNum(qCeil(ep)); qDebug() << "abcd end" << current_quest << ": " << qq->ans_student[0] << qq->ans_student[1] << qq->ans_student[2] << qq->ans_student[3] << " : " << qq->ans_student_correct[0] << " " << qq->ans_student_correct[1] << " " << qq->ans_student_correct[2] << " " << qq->ans_student_correct[3]; }
//------------------------------------------------------------------------ void gamma_ctrl_impl::rewind(unsigned idx) { double kx1, ky1, kx2, ky2; char tbuf[32]; m_idx = idx; switch(idx) { default: case 0: // Background m_vertex = 0; m_vx[0] = m_x1 - m_border_extra; m_vy[0] = m_y1 - m_border_extra; m_vx[1] = m_x2 + m_border_extra; m_vy[1] = m_y1 - m_border_extra; m_vx[2] = m_x2 + m_border_extra; m_vy[2] = m_y2 + m_border_extra; m_vx[3] = m_x1 - m_border_extra; m_vy[3] = m_y2 + m_border_extra; break; case 1: // Border m_vertex = 0; m_vx[0] = m_x1; m_vy[0] = m_y1; m_vx[1] = m_x2; m_vy[1] = m_y1; m_vx[2] = m_x2; m_vy[2] = m_y2; m_vx[3] = m_x1; m_vy[3] = m_y2; m_vx[4] = m_x1 + m_border_width; m_vy[4] = m_y1 + m_border_width; m_vx[5] = m_x1 + m_border_width; m_vy[5] = m_y2 - m_border_width; m_vx[6] = m_x2 - m_border_width; m_vy[6] = m_y2 - m_border_width; m_vx[7] = m_x2 - m_border_width; m_vy[7] = m_y1 + m_border_width; m_vx[8] = m_xc1 + m_border_width; m_vy[8] = m_yc2 - m_border_width * 0.5; m_vx[9] = m_xc2 - m_border_width; m_vy[9] = m_yc2 - m_border_width * 0.5; m_vx[10] = m_xc2 - m_border_width; m_vy[10] = m_yc2 + m_border_width * 0.5; m_vx[11] = m_xc1 + m_border_width; m_vy[11] = m_yc2 + m_border_width * 0.5; break; case 2: // Curve m_gamma_spline.box(m_xs1, m_ys1, m_xs2, m_ys2); m_curve_poly.width(m_curve_width); m_curve_poly.rewind(0); break; case 3: // Grid m_vertex = 0; m_vx[0] = m_xs1; m_vy[0] = (m_ys1 + m_ys2) * 0.5 - m_grid_width * 0.5; m_vx[1] = m_xs2; m_vy[1] = (m_ys1 + m_ys2) * 0.5 - m_grid_width * 0.5; m_vx[2] = m_xs2; m_vy[2] = (m_ys1 + m_ys2) * 0.5 + m_grid_width * 0.5; m_vx[3] = m_xs1; m_vy[3] = (m_ys1 + m_ys2) * 0.5 + m_grid_width * 0.5; m_vx[4] = (m_xs1 + m_xs2) * 0.5 - m_grid_width * 0.5; m_vy[4] = m_ys1; m_vx[5] = (m_xs1 + m_xs2) * 0.5 - m_grid_width * 0.5; m_vy[5] = m_ys2; m_vx[6] = (m_xs1 + m_xs2) * 0.5 + m_grid_width * 0.5; m_vy[6] = m_ys2; m_vx[7] = (m_xs1 + m_xs2) * 0.5 + m_grid_width * 0.5; m_vy[7] = m_ys1; calc_points(); m_vx[8] = m_xs1; m_vy[8] = m_yp1 - m_grid_width * 0.5; m_vx[9] = m_xp1 - m_grid_width * 0.5; m_vy[9] = m_yp1 - m_grid_width * 0.5; m_vx[10] = m_xp1 - m_grid_width * 0.5; m_vy[10] = m_ys1; m_vx[11] = m_xp1 + m_grid_width * 0.5; m_vy[11] = m_ys1; m_vx[12] = m_xp1 + m_grid_width * 0.5; m_vy[12] = m_yp1 + m_grid_width * 0.5; m_vx[13] = m_xs1; m_vy[13] = m_yp1 + m_grid_width * 0.5; m_vx[14] = m_xs2; m_vy[14] = m_yp2 + m_grid_width * 0.5; m_vx[15] = m_xp2 + m_grid_width * 0.5; m_vy[15] = m_yp2 + m_grid_width * 0.5; m_vx[16] = m_xp2 + m_grid_width * 0.5; m_vy[16] = m_ys2; m_vx[17] = m_xp2 - m_grid_width * 0.5; m_vy[17] = m_ys2; m_vx[18] = m_xp2 - m_grid_width * 0.5; m_vy[18] = m_yp2 - m_grid_width * 0.5; m_vx[19] = m_xs2; m_vy[19] = m_yp2 - m_grid_width * 0.5; break; case 4: // Point1 calc_points(); if(m_p1_active) m_ellipse.init(m_xp2, m_yp2, m_point_size, m_point_size, 32); else m_ellipse.init(m_xp1, m_yp1, m_point_size, m_point_size, 32); break; case 5: // Point2 calc_points(); if(m_p1_active) m_ellipse.init(m_xp1, m_yp1, m_point_size, m_point_size, 32); else m_ellipse.init(m_xp2, m_yp2, m_point_size, m_point_size, 32); break; case 6: // Text m_gamma_spline.values(&kx1, &ky1, &kx2, &ky2); sprintf(tbuf, "%5.3f %5.3f %5.3f %5.3f", kx1, ky1, kx2, ky2); m_text.text(tbuf); m_text.size(m_text_height, m_text_width); m_text.start_point(m_xt1 + m_border_width * 2.0, (m_yt1 + m_yt2) * 0.5 - m_text_height * 0.5); m_text_poly.width(m_text_thickness); m_text_poly.line_join(vcgen_stroke::round_join); m_text_poly.line_cap(vcgen_stroke::round_cap); m_text_poly.rewind(0); break; } }
void knowledge(int blessing) { if (blessing < 0) mprint("You feel ignorant."); else { mprint("You feel knowledgeable!"); menuclear(); menuprint("Current Point Total: "); menulongprint(calc_points()); menuprint("\nAlignment:"); if (Player.alignment == 0) menuprint("Neutral, embodying the Cosmic Balance"); else if (abs(Player.alignment) < 10) menuprint("Neutral, tending toward "); else if (abs(Player.alignment) < 50) menuprint("Neutral-"); else if (abs(Player.alignment) < 100) ; else if (abs(Player.alignment) < 200) menuprint("Servant of "); else if (abs(Player.alignment) < 400) menuprint("Master of "); else if (abs(Player.alignment) < 800) menuprint("The Essence of "); else menuprint("The Ultimate Avatar of "); if (Player.alignment < 0) menuprint("Chaos\n"); else if (Player.alignment > 0) menuprint("Law\n"); showmenu(); morewait(); menuclear(); menuprint("Current stati:\n"); if (Player.status[BLINDED]) menuprint("Blinded\n"); if (Player.status[SLOWED]) menuprint("Slowed\n"); #ifdef DEBUG if (Player.status[SLOWED]) fprintf(DG_debug_log, "Slowed is %d\n", Player.status[SLOWED] ); #endif if (Player.status[HASTED]) menuprint("Hasted\n"); if (Player.status[DISPLACED]) menuprint("Displaced\n"); if (Player.status[SLEPT]) menuprint("Slept\n"); if (Player.status[DISEASED]) menuprint("Diseased\n"); if (Player.status[POISONED]) menuprint("Poisoned\n"); if (Player.status[BREATHING]) menuprint("Breathing\n"); if (Player.status[INVISIBLE]) menuprint("Invisible\n"); if (Player.status[REGENERATING]) menuprint("Regenerating\n"); if (Player.status[VULNERABLE]) menuprint("Vulnerable\n"); if (Player.status[BERSERK]) menuprint("Berserk\n"); if (Player.status[IMMOBILE]) menuprint("Immobile\n"); if (Player.status[ALERT]) menuprint("Alert\n"); if (Player.status[AFRAID]) menuprint("Afraid\n"); if (Player.status[ACCURATE]) menuprint("Accurate\n"); if (Player.status[HERO]) menuprint("Heroic\n"); if (Player.status[LEVITATING]) menuprint("Levitating\n"); if (Player.status[TRUESIGHT]) /* FIXED! 12/30/98 DG */ menuprint("Sharp\n"); if (Player.status[SHADOWFORM]) menuprint("Shadowy\n"); if (Player.status[ILLUMINATION]) menuprint("Glowing\n"); if (Player.status[DEFLECTION]) menuprint("Buffered\n"); if (Player.status[RETURNING]) menuprint("Returning\n"); showmenu(); morewait(); menuclear(); menuprint("Immunities:\n"); if (p_immune(NORMAL_DAMAGE)) menuprint("Normal Damage\n"); if (p_immune(FLAME)) menuprint("Flame\n"); if (p_immune(ELECTRICITY)) menuprint("Electricity\n"); if (p_immune(COLD)) menuprint("Cold\n"); if (p_immune(POISON)) menuprint("Poison\n"); if (p_immune(ACID)) menuprint("Acid\n"); if (p_immune(FEAR)) menuprint("Fear\n"); if (p_immune(SLEEP)) menuprint("Sleep\n"); if (p_immune(NEGENERGY)) menuprint("Negative Energies\n"); if (p_immune(THEFT)) menuprint("Theft\n"); if (p_immune(GAZE)) menuprint("Gaze\n"); if (p_immune(INFECTION)) menuprint("Infection\n"); showmenu(); morewait(); menuclear(); menuprint("Ranks:\n"); switch(Player.rank[LEGION]) { case COMMANDANT: menuprint("Commandant of the Legion"); break; case COLONEL: menuprint("Colonel of the Legion"); break; case FORCE_LEADER: menuprint("Force Leader of the Legion"); break; case CENTURION: menuprint("Centurion of the Legion"); break; case LEGIONAIRE: menuprint("Legionaire"); break; } if (Player.rank[LEGION] > 0) { menuprint(" ("); menunumprint(Player.guildxp[LEGION]); menuprint(" XP).\n"); } switch(Player.rank[ARENA]) { case -1: menuprint("Ex-gladiator\n"); break; case CHAMPION: menuprint("Gladiator Champion"); break; case GLADIATOR: menuprint("Gladiator of the Arena"); break; case RETIARIUS: menuprint("Retiarius of the Arena"); break; case BESTIARIUS: menuprint("Bestiarius of the Arena"); break; case TRAINEE: menuprint("Gladiator Trainee of the Arena"); break; } if (Player.rank[ARENA] > 0) { menuprint(" (Opponent "); menunumprint(Arena_Opponent); menuprint(")\n"); } switch(Player.rank[COLLEGE]) { case ARCHMAGE: menuprint("Archmage of the Collegium Magii"); break; case MAGE: menuprint("Collegium Magii: Mage"); break; case PRECEPTOR: menuprint("Collegium Magii: Preceptor"); break; case STUDENT: menuprint("Collegium Magii: Student"); break; case NOVICE: menuprint("Collegium Magii: Novice"); break; } if (Player.rank[COLLEGE] > 0) { menuprint(" ("); menunumprint(Player.guildxp[COLLEGE]); menuprint(" XP).\n"); } switch(Player.rank[NOBILITY]) { case DUKE: menuprint("Duke of Rampart"); break; case LORD: menuprint("Peer of the Realm"); break; case KNIGHT: menuprint("Order of the Knights of Rampart"); break; case ESQUIRE: menuprint("Squire of Rampart"); break; case COMMONER: menuprint("Commoner"); break; default: menuprint("Lowly Commoner\n"); break; } if (Player.rank[NOBILITY] > 1) { menuprint(" ("); menunumprint(Player.rank[NOBILITY] - 1); menuprint(ordinal(Player.rank[NOBILITY] - 1)); menuprint(" Quest Completed)\n"); } else if (Player.rank[NOBILITY] == 1) { menuprint(" (1st Quest Undertaken)\n"); } switch(Player.rank[CIRCLE]) { case -1: menuprint("Former member of the Circle.\n"); break; case PRIME: menuprint("Prime Sorceror of the Inner Circle"); break; case HIGHSORCEROR: menuprint("High Sorceror of the Inner Circle"); break; case SORCEROR: menuprint("Member of the Circle of Sorcerors"); break; case ENCHANTER: menuprint("Member of the Circle of Enchanters"); break; case INITIATE: menuprint("Member of the Circle of Initiates"); break; } if (Player.rank[CIRCLE] > 0) { menuprint(" ("); menunumprint(Player.guildxp[CIRCLE]); menuprint(" XP).\n"); } switch(Player.rank[ORDER]) { case -1: menuprint("Washout from the Order of Paladins\n"); break; case JUSTICIAR: menuprint("Justiciar of the Order of Paladins"); break; case PALADIN: menuprint("Paladin of the Order"); break; case CHEVALIER: menuprint("Chevalier of the Order"); break; case GUARDIAN: menuprint("Guardian of the Order"); break; case GALLANT: menuprint("Gallant of the Order"); break; } if (Player.rank[ORDER] > 0) { menuprint(" ("); menunumprint(Player.guildxp[ORDER]); menuprint(" XP).\n"); } switch(Player.rank[THIEVES]) { case SHADOWLORD: menuprint("Guild of Thieves: Shadowlord"); break; case TMASTER: menuprint("Guild of Thieves: Master Thief"); break; case THIEF: menuprint("Guild of Thieves: Thief"); break; case ATHIEF: menuprint("Guild of Thieves: Apprentice Thief"); break; case TMEMBER: menuprint("Guild of Thieves: Candidate Member"); break; } if (Player.rank[THIEVES] > 0) { menuprint(" ("); menunumprint(Player.guildxp[THIEVES]); menuprint(" XP).\n"); } switch(Player.rank[PRIESTHOOD]) { case LAY: menuprint("A lay devotee of "); break; case ACOLYTE: menuprint("An Acolyte of "); break; case PRIEST: menuprint("A Priest of "); break; case SPRIEST: menuprint("A Senior Priest of "); break; case HIGHPRIEST: menuprint("The High Priest of "); break; } switch(Player.patron) { case ODIN: menuprint("Odin"); break; case SET: menuprint("Set"); break; case ATHENA: menuprint("Athena"); break; case HECATE: menuprint("Hecate"); break; case DRUID: menuprint("Druidism"); break; case DESTINY: menuprint("the Lords of Destiny"); break; } if (Player.rank[PRIESTHOOD] > 0) { menuprint(" ("); menunumprint(Player.guildxp[PRIESTHOOD]); menuprint(" XP).\n"); } #ifdef INCLUDE_MONKS switch(Player.rank[MONKS]) { case MONK_GRANDMASTER: menuprint("Tholian Monks: Grandmaster"); break; case MONK_MASTER_TEARS: menuprint("Tholian Monks: Master of Tears"); break; case MONK_MASTER_PAINS: menuprint("Tholian Monks: Master of Pain"); break; case MONK_MASTER_SIGHS: menuprint("Tholian Monks: Master of Sighs"); break; case MONK_MASTER: menuprint("Tholian Monks: Master"); break; case MONK_MONK: menuprint("Tholian Monks: Monk"); break; case MONK_TRAINEE: menuprint("Tholian Monks: Trainee"); break; } if (Player.rank[MONKS] > 0) { menuprint(" ("); menunumprint(Player.guildxp[MONKS]); menuprint(" XP).\n"); } #endif if (Player.rank[ADEPT] > 0) menuprint("**************\n*Omegan Adept*\n**************\n"); showmenu(); morewait(); xredraw(); } }
short dump_basic( FILE *dumpfile ) { int curcol; long total_balance; char *cp; bank_account *account; /* reset "checksum" */ dumpcheck = 0; strcpy( dump_buf, "[*] " ); strcat( dump_buf, VERSIONSTRING ); strcat( dump_buf, " character dump [*]\n\n" ); if ( !dump( dumpfile, dump_buf, FALSE ) ) return FALSE; curcol = sprintf( dump_buf, "Name : %s\n", Player.name ); if ( gamestatusp( CHEATED ) ) { if ( 72 > strlen( dump_buf ) ) cp = strrchr( dump_buf, '\n' ); else cp = &(dump_buf[ 70 ]); strcpy( cp, " (WIZARD)\n" ); } if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; sprintf( dump_buf, "Level : %s [%d]\n", levelname( Player.level ), Player.level ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; sprintf( dump_buf, "Alignment : %s\n\n", alignment_string( Player.alignment ) ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; /* sprintf( dump_buf, "Str : %5d [%d]%n%*sHP : %5d [%d]%n%*sHit : %d\n", Player.str, Player.maxstr, &curcol, 26 - curcol, spaces, Player.hp, Player.maxhp, &curcol, 57 - curcol, spaces, Player.hit ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; */ curcol = sprintf( dump_buf, "Str : %5d [%d]", Player.str, Player.maxstr ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 26; curcol++ ) *cp++ = ' '; curcol += sprintf( cp, "HP : %5d [%d]", Player.hp, Player.maxhp ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 57; curcol++ ) *cp++ = ' '; sprintf( cp, "Hit : %d\n", Player.hit ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; curcol = sprintf( dump_buf, "Con : %5d [%d]", Player.con, Player.maxcon ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 26; curcol++ ) *cp++ = ' '; curcol += sprintf( cp, "Mana : %5ld [%ld]", Player.mana, Player.maxmana ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 57; curcol++ ) *cp++ = ' '; sprintf( cp, "Damage : %d\n", Player.dmg ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; curcol = sprintf( dump_buf, "Dex : %5d [%d]", Player.dex, Player.maxdex ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 57; curcol++ ) *cp++ = ' '; sprintf( cp, "Defense : %d\n", Player.defense ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; curcol = sprintf( dump_buf, "Agi : %5d [%d]", Player.agi, Player.maxagi ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 26; curcol++ ) *cp++ = ' '; sprintf( cp, "Exp : %-10ld Armor : %d\n", Player.xp, Player.absorption ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; curcol = sprintf( dump_buf, "Int : %5d [%d]", Player.iq, Player.maxiq ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 26; curcol++ ) *cp++ = ' '; sprintf( cp, "Carry : %-10d Speed : %d.%d\n", Player.itemweight, 5 / Player.speed, 500 / Player.speed % 100 ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; curcol = sprintf( dump_buf, "Pow : %5d [%d]", Player.pow, Player.maxpow ); cp = strrchr( dump_buf, '\0' ); for ( ; curcol < 26; curcol++ ) *cp++ = ' '; sprintf( cp, "Capacity : %d\n\n", Player.maxweight ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; total_balance = 0; for( account = bank; account; account = account->next_account ) { if ( account->player ) total_balance += account->balance; } sprintf( dump_buf, "Cash (carried/bank) : %ld / %ld\n", Player.cash, total_balance ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; sprintf( dump_buf, "Current Point Total : %ld\n", calc_points() ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; sprintf( dump_buf, "Elapsed Game Time : %s\n\n", elapsed_time_string( Time ) ); if ( !dump( dumpfile, dump_buf, TRUE ) ) return FALSE; sprintf( dump_buf, "[Verification: %8.8lx]\n\n", dumpcheck ); if ( !dump( dumpfile, dump_buf, FALSE ) ) return FALSE; return TRUE; }