Beispiel #1
0
void weapon_demonblade(int dmgmod, pob o, pmt m)
{ 
  if (o->blessing > -1) {
    mprint("Demonblade disintegrates with a soft sigh.");
    mprint("You stop foaming at the mouth.");
    Player.status[BERSERK] = 0;
    conform_lost_object(o);
  }
  else if (m->specialf == M_SP_DEMON) {
    mprint("The demon flees in terror before your weapon!");
    m_vanish(m);
  }
  else if (m->meleef != M_MELEE_SPIRIT) {
    if (m->level > random_range(10)) {
      if( Player.hp < Player.maxhp )
        Player.hp = min(Player.maxhp,Player.hp+m->hp);
      Player.str++;
      if( Player.pow < Player.maxpow )
        Player.pow = min(Player.maxpow,Player.pow+m->level);
      m_death(m);
      mprint("You feel a surge of raw power from Demonblade!");
    }
    else p_hit(m,Player.dmg+dmgmod,NORMAL_DAMAGE);

  }
  else {
    mprint("Demonblade howls as it strikes the spirit!");
    if (random_range(10) == 1) {
      mprint("... and shatters into a thousand lost fragments!");
      morewait();
      p_damage(50,UNSTOPPABLE,"Demonblade exploding");
      conform_lost_object(o);
    }
    else {
      mprint("You feel your lifeforce draining....");
      p_damage(25,UNSTOPPABLE,"a backlash of negative energies");
      Player.str -= 3;
      Player.con -= 3;
      if (Player.str < 1 || Player.con < 1)
	p_death("a backlash of negative energies");
    }
  }
}
Beispiel #2
0
int check_sacrilege(int deity)
{
    int i;
    int sacrilege = FALSE;

    if((Player.patron != deity) && (Player.patron > 0)) {
        sacrilege = TRUE;
        --Player.pow;
        --Player.maxpow;

        switch(Player.patron) {
        case ODIN:
            print1("Odin notices your lack of faith!");
            morewait();

            if(deity == ATHENA) {
                print2("However, Athena intercedes on your behalf.");
                sacrilege = FALSE;
            }
            else {
                print2("You are struck by a thunderbolt!");
                p_damage(Player.level * 5, UNSTOPPABLE, "Odin's wrath");

                if(Player.hp > 0) {
                    morewait();
                    print2("The bolt warps your feeble frame...");
                    Player.maxcon = Player.maxcon / 2;
                    Player.con = min(Player.con, Player.maxcon);
                    Player.maxstr = Player.maxstr / 2;
                    Player.con = min(Player.str, Player.maxstr);
                }
            }

            morewait();

            break;
        case SET:
            print1("Set notices you lack of faith1");
            morewait();

            if(deity == HECATE) {
                print1("But since you pray to a friendly deity,");
                print2("Set decided not to punish you.");
                sacrilege = FALSE;
            }
            else {
                print2("You are blasted by a shaft of black fire!");
                p_damage(Player.level * 5, UNSTOPPABLE, "Set's anger");

                if(Player.hp > 0) {
                    morewait();
                    print1("You are wreathed in clouds of smoke.");

                    for(i = 0; i < MAXITEMS; ++i) {
                        if((Player.possessions[i] != NULL)
                           && (Player.possessions[i]->blessing > -1)) {
                            conform_lost_object(Player.possessions[i]);
                        }
                    }

                    morewait();
                    print2("You feel Set's Black Hand on your heart...");
                    Player.maxcon = Player.maxcon / 4;
                    Player.con = Player.maxcon;
                }
            }

            morewait();

            break;
        case HECATE:
            print1("Hecate notices your lack of faith!");
            morewait();

            if(deity == SET) {
                print1("But ignores the affront since she likes Set.");
                sacrilege = FALSE;
            }
            else {
                print1("You are zapped by dark moonbeams!");
                p_damage(Player.level * 5, UNSTOPPABLE, "Hecate's malice");

                if(Player.hp > 0) {
                    print2("The beams leach you of magical power!");
                    Player.maxpow = Player.maxpow / 5;
                    Player.pow = min(Player.pow, Player.maxpow);

                    for(i = 0; i < NUMSPELLS; ++i) {
                        Spells[i].known = FALSE;
                    }
                }
            }
            
            morewait();
            
            break;
        case ATHENA:
            print1("Athena notices your lack of faith!");
            morewait();

            if(deity == ODIN) {
                print2("But lets you off this time since Odin is also Lawful.");
                sacrilege = FALSE;
            }
            else {
                print2("You are zorched by godsfire!");

                if(Player.hp > 0) {
                    morewait();
                    print1("the fire burns away your worldly experience!");
                    Player.level = 0;
                    Player.xp = 0;
                    Player.hp = Player.con;
                    Player.maxhp = Player.hp;
                    print2("Your power is reduced by the blast!!!");
                    Player.maxpow = Player.maxpow / 3;
                    Player.pow = Player.maxpow;
                    Player.mana = min(Player.mana, calcmana());
                }
            }

            morewait();

            break;
        case DESTINY:
            print2("The Lords of Destiny ignore your lack of faith.");
            sacrilege = FALSE;
            morewait();

            break;
        case DRUID:
            print2("your treachery to the Archdruid has been noted.");

            if(random_range(2) == 1) {
                Player.alignment += 40;
            }
            else {
                Player.alignment -= 40;
            }

            morewait();

            break;
        }

        if(sacrilege) {
            Player.patron = 0;
            Player.rank[PRIESTHOOD] = 0;
        }
    }

    return sacrilege;
}
Beispiel #3
0
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");
            }
        }
    }
}