/* lball spell */ void s_lball(void) { int x=Player.x,y=Player.y; setspot(&x,&y); lball(Player.x,Player.y,x,y,Player.level*10+10); }
void Monster::m_lball() { lball(this->x,this->y,Player.x,Player.y,this->dmg); }
void m_lball(pmt m) { lball(m->x,m->y,Player.x,Player.y,m->dmg); }
void l_safe(void) { char response; pob newitem; int attempt = 0; response = cinema_interact("pfqi", "You have discovered a safe!", "Pick the lock [p], Force the door [f], or ignore [ESCAPE]", NULL); if (response == 'p') attempt = (2*Player.dex + Player.rank[THIEVES]*10 - random_range(100))/10; else if (response == 'f') attempt = (Player.dmg - random_range(100))/10; if (attempt > 0) { Player.alignment -= 4; gain_experience(50); print2("The door springs open!"); Level->site[Player.x][Player.y].locchar = FLOOR; Level->site[Player.x][Player.y].p_locf = L_NO_OP; lset(Player.x, Player.y, CHANGED); if (random_range(2) == 1) { print1("You find:"); do { newitem = create_object(difficulty()); print2(itemid(newitem)); morewait(); gain_item(newitem); } while (random_range(3) == 1); } else print2("The safe was empty (awwwww....)"); } else { print3("Your attempt at burglary failed!"); if (attempt == -1) { print1("A siren goes off! You see flashing red lights everywhere!"); morewait(); if (Last_Environment == E_CITY) { print2("The city guard shows up! They collar you in no time flat!"); change_environment(E_CITY); morewait(); send_to_jail(); } } else if (attempt == -2) { print1("There is a sudden flash!"); p_damage(random_range(25),FLAME,"a safe"); print2("The safe has self-destructed."); Level->site[Player.x][Player.y].locchar = RUBBLE; Level->site[Player.x][Player.y].p_locf = L_RUBBLE; lset(Player.x, Player.y, CHANGED); } else if (attempt == -3) { print1("The safe jolts you with electricity!"); lball(Player.x,Player.y,Player.x,Player.y,30); } else if (attempt < -3) { print1("You are hit by an acid spray!"); if (Player.possessions[O_CLOAK] != NULL) { print2("Your cloak is destroyed!"); conform_lost_object(Player.possessions[O_CLOAK]); p_damage(10,ACID,"a safe"); } else if (Player.possessions[O_ARMOR] != NULL) { print2("Your armor corrodes!"); Player.possessions[O_ARMOR]->dmg-=3; Player.possessions[O_ARMOR]->hit-=3; Player.possessions[O_ARMOR]->aux-=3; p_damage(10,ACID,"a safe"); } else { print2("The acid hits your bare flesh!"); p_damage(random_range(100),ACID,"a safe"); } } } }