void weapon_lightsabre(int dmgmod, pob o, pmt m) { if (! o->known) { mprint("Fumbling with the cylinder, you press the wrong stud...."); p_damage(100,UNSTOPPABLE,"fumbling with a lightsabre"); o->known = 1; } else { /* test prevents confusing immunity messages.... */ if (! m_immunityp(m,NORMAL_DAMAGE)) { mprint("Vzzzzmmm!"); m_damage(m,20,NORMAL_DAMAGE); } if ((m->hp>0) && (! m_immunityp(m,FLAME))) { mprint("Zzzzap!"); m_damage(m,20,FLAME); } } }
void m_trap_dart(struct monster *m) { if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " was hit by a dart!"); mprint(Str1); Level->site[m->x][m->y].locchar = TRAP; } m_damage(m, difficulty() * 2, NORMAL_DAMAGE); }
void m_fire(struct monster *m) { char Str1[80]; if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " was blasted by fire!"); mprint(Str1); } m_damage(m, random_range(100), FLAME); }
void m_trap_acid(struct monster *m) { char Str1[80]; if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " walked into a acid bath trap!"); mprint(Str1); Level->site[m->x][m->y].locchar = TRAP; } m_damage(m, random_range(difficulty() * difficulty()), ACID); }
void m_trap_fire(struct monster *m) { char Str1[80]; Level->site[m->x][m->y].locchar = TRAP; if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " was hit by a fire trap!"); mprint(Str1); } m_damage(m, (difficulty() + 1) * 5, FLAME); }
void m_trap_blade(struct monster *m) { char Str1[80]; Level->site[m->x][m->y].locchar = TRAP; if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " was hit by a blade trap!"); mprint(Str1); } m_damage(m, ((difficulty() + 1) & 7) - Player.defense, NORMAL_DAMAGE); }
void m_trap_pit(struct monster *m) { if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " fell into a pit!"); mprint(Str1); Level->site[m->x][m->y].locchar = TRAP; } if(!m_statusp(m, INTANGIBLE)) { m_status_reset(m, MOBILE); } m_damage(m, difficulty() * 5, NORMAL_DAMAGE); }
/* effects of hitting */ void p_hit (struct monster *m,int dmg,int dtype) { int dmult = 0; /* chance for critical hit..., 3/10 */ switch (random_range(10)) { case 0: if (random_range(100) < (Player.level #ifdef INCLUDE_MONKS + Player.rank[MONKS] #endif )) { strcpy(Str3,"You annihilate "); dmult = 1000; } else { strcpy(Str3,"You blast "); dmult=5; } break; case 1: case 2: strcpy(Str3,"You smash "); dmult=2; break; default: dmult=1; if (random_range(10)) strcpy(Str3,"You hit "); #ifdef NEW_QUOTES else switch(random_range(12)) { #else else switch(random_range(4)) { #endif case 0: strcpy(Str3,"You damage "); break; case 1: strcpy(Str3,"You inflict bodily harm on "); break; case 2: strcpy(Str3,"You injure "); break; case 3: strcpy(Str3,"You molest "); break; case 4: strcpy(Str3,"You tweak "); break; case 5: strcpy(Str3,"You smush "); break; case 6: strcpy(Str3,"You smurf "); break; case 7: strcpy(Str3,"You grind "); break; case 8: strcpy(Str3,"You hurt "); break; case 9: strcpy(Str3,"You bring pain to "); break; case 10: strcpy(Str3,"You recite nasty poetry at "); break; case 11: strcpy(Str3,"You smack "); break; } break; } if (Lunarity == 1) dmult = dmult * 2; else if (Lunarity == -1) dmult = dmult / 2; if (m->uniqueness == COMMON) strcat(Str3,"the "); strcat(Str3,m->monstring); strcat(Str3,". "); if (Verbosity != TERSE) mprint(Str3); else mprint("You hit it."); #ifdef INCLUDE_MONKS if (Player.possessions[O_WEAPON_HAND] == NULL) { /*barehanded*/ if (Player.rank[MONKS] > MONK_MASTER_SIGHS) { /* high level monks do unstoppable hand damage */ dtype = UNSTOPPABLE; } } #endif m_damage(m,dmult * random_range(dmg),dtype); if ((Verbosity != TERSE) && (random_range(10)==3) && (m->hp > 0)) mprint("It laughs at the injury and fights on!"); } /* and effects of missing */ void player_miss(struct monster *m,int dtype) { if (random_range(30)==1) /* fumble 1 in 30 */ p_fumble(dtype); else { if (Verbosity != TERSE) { if (random_range(10)) strcpy(Str3,"You miss "); else switch(random_range(4)) { case 0: strcpy(Str3,"You flail lamely at "); break; case 1: strcpy(Str3,"You only amuse "); break; case 2: strcpy(Str3,"You fail to even come close to "); break; case 3: strcpy(Str3,"You totally avoid contact with "); break; } if (m->uniqueness == COMMON) strcat(Str3,"the "); strcat(Str3,m->monstring); strcat(Str3,". "); mprint(Str3); } else mprint("You missed it."); } } /* oh nooooo, a fumble.... */ void p_fumble(int dtype) { mprint("Ooops! You fumbled...."); switch(random_range(10)) { case 0: case 1: case 2: case 3: case 4: case 5: drop_weapon(); break; case 6: case 7: case 8: break_weapon(); break; case 9: mprint("Oh No! You hit yourself!"); p_damage(Player.dmg,dtype,"stupidity"); break; } }
/* from f to t */ void ball(int fx, int fy, int tx, int ty, int dmg, int dtype) { int xx,yy,ex,ey,i; struct monster *target; Symbol expchar=('@' | CLR(LIGHT_PURPLE)); xx = fx; yy = fy; switch(dtype) { case FLAME: expchar=('*' | CLR(LIGHT_RED)); break; case COLD: expchar=('o' | CLR(WHITE)); break; case ELECTRICITY: expchar=('^' | CLR(LIGHT_BLUE)); break; } do_los(expchar,&xx,&yy,tx,ty); draw_explosion(expchar,xx,yy); for(i=0; i<9; i++) { ex = xx + Dirs[0][i]; ey = yy + Dirs[1][i]; if ((ex == Player.x) && (ey == Player.y)) { switch(dtype) { case FLAME: mprint("You were blasted by a fireball!"); p_damage(random_range(dmg),FLAME,"a fireball"); break; case COLD: mprint("You were blasted by a snowball!"); p_damage(random_range(dmg),COLD,"a snowball"); break; case ELECTRICITY: mprint("You were blasted by ball lightning!"); p_damage(random_range(dmg),ELECTRICITY,"ball lightning"); break; case UNSTOPPABLE: mprint("Oh No! Manastorm!"); p_damage(random_range(dmg),UNSTOPPABLE,"a manastorm!"); break; } } if (NULL != (target = Level->site[ex][ey].creature)) { if (los_p(Player.x,Player.y,target->x,target->y)) { if (target->uniqueness == COMMON) { strcpy(Str1,"The "); strcat(Str1,target->monstring); } else strcpy(Str1,target->monstring); switch(dtype) { case FLAME: strcat(Str1," was zorched by a fireball!"); break; case COLD: strcat(Str1," was blasted by a snowball!"); break; case ELECTRICITY: strcat(Str1," was zapped by ball lightning!"); break; case UNSTOPPABLE: strcat(Str1," was nuked by a manastorm!"); break; } mprint(Str1); } m_status_set(target,HOSTILE); m_damage(target,random_range(dmg),dtype); } if (Level->site[ex][ey].locchar == HEDGE) if (Level->site[ex][ey].p_locf != L_TRIFID) { if ((dtype == FLAME)||(dtype == ELECTRICITY)) { mprint("The hedge is blasted away!"); Level->site[ex][ey].p_locf = L_NO_OP; Level->site[ex][ey].locchar = FLOOR; plotspot(ex,ey,TRUE); lset(ex, ey, CHANGED); } else mprint("The hedge is unaffected."); } else mprint("The trifid absorbs the energy and laughs!"); else if (Level->site[ex][ey].locchar == WATER) if (dtype == FLAME) { mprint("The water is vaporised!"); Level->site[ex][ey].p_locf = L_NO_OP; Level->site[ex][ey].locchar = FLOOR; plotspot(ex,ey,TRUE); lset(ex, ey, CHANGED); } } }
/* from f to t */ void bolt(int fx, int fy, int tx, int ty, int hit, int dmg, int dtype) { int xx,yy; struct monster *target; Symbol boltchar = '?'; xx = fx; yy = fy; switch(dtype) { case FLAME: boltchar=('*' | CLR(LIGHT_RED)); break; case ELECTRICITY: boltchar = ('^' | CLR(LIGHT_BLUE)); break; case NORMAL_DAMAGE: boltchar = ('!' | CLR(BROWN)); break; case COLD: boltchar=('o' | CLR(WHITE)); break; default: assert(FALSE); /* this should never happen, right? WDT */ } clearmsg(); do_los(boltchar,&xx,&yy,tx,ty); if ((xx == Player.x) && (yy == Player.y)) { if (Player.status[DEFLECTION] > 0) mprint("The bolt just missed you!"); else { switch (dtype) { case FLAME: mprint("You were blasted by a firebolt!"); p_damage(random_range(dmg),dtype,"a firebolt"); break; case ELECTRICITY: mprint("You were zapped by lightning!"); p_damage(random_range(dmg),dtype,"a bolt of lightning"); break; case NORMAL_DAMAGE: mprint("You were hit by a missile!"); p_damage(random_range(dmg),dtype,"a missile"); break; case COLD: mprint("You were hit by an icicle!"); p_damage(random_range(dmg),dtype,"an icicle"); break; } } } else if (NULL != (target = Level->site[xx][yy].creature)) { if (hitp(hit,target->ac)) { if (target->uniqueness == COMMON) { strcpy(Str1,"The "); strcat(Str1,target->monstring); } else strcpy(Str1,target->monstring); switch (dtype) { /* WDT: these sentances really ought to be livened up. Especially * in full verbose mode. */ case FLAME: strcat(Str1," was blasted by a firebolt!"); break; case ELECTRICITY: strcat(Str1," was zapped by lightning!"); break; case NORMAL_DAMAGE: strcat(Str1," was hit by a missile!"); break; case COLD: strcat(Str1," was hit by an icicle!"); break; } mprint(Str1); m_status_set(target,HOSTILE); m_damage(target,random_range(dmg),dtype); } else { if (target->uniqueness == COMMON) { strcpy(Str1,"The "); strcat(Str1,target->monstring); } else strcpy(Str1,target->monstring); switch (dtype) { case FLAME: strcat(Str1," was missed by a firebolt!"); break; case ELECTRICITY: strcat(Str1," was missed by lightning!"); break; case NORMAL_DAMAGE: strcat(Str1," was missed by a missile!"); break; case COLD: strcat(Str1," was missed by a flying icicle!"); break; } mprint(Str1); } } else if (Level->site[xx][yy].locchar == HEDGE) if (Level->site[xx][yy].p_locf != L_TRIFID) { if ((dtype == FLAME)||(dtype == ELECTRICITY)) { mprint("The hedge is blasted away!"); Level->site[xx][yy].p_locf = L_NO_OP; Level->site[xx][yy].locchar = FLOOR; plotspot(xx, yy, TRUE); lset(xx, yy, CHANGED); } else mprint("The hedge is unaffected."); } else mprint("The trifid absorbs the energy and laughs!"); else if (Level->site[xx][yy].locchar == WATER) if (dtype == FLAME) { mprint("The water is vaporised!"); Level->site[xx][yy].p_locf = L_NO_OP; Level->site[xx][yy].locchar = FLOOR; lset(xx, yy, CHANGED); } }