コード例 #1
0
ファイル: site2.c プロジェクト: albert-wang/OmegaRPG
void l_vault(void)
{
    print1("You come to a thick vault door with a complex time lock.");
    if ((hour()==23)) {
        print2("The door is open.");
        Level->site[12][56].locchar = FLOOR;
    }
    else {
        print2("The door is closed.");
        Level->site[12][56].locchar = WALL;
        morewait();
        clearmsg();
        if (cinema_confirm("You're about to try to crack the safe.")=='y') {
            if (random_range(100) < Player.rank[THIEVES]*Player.rank[THIEVES]) {
                print2("The lock clicks open!!!");
                gain_experience(5000);
                Level->site[12][56].locchar = FLOOR;
            }
            else {
                print2("Uh, oh, set off the alarm.... The castle guard arrives....");
                morewait();
                if (Player.rank[NOBILITY] == DUKE) {
                    clearmsg();
                    print1("\"Ah, just testing us, your Grace?  I hope we're up to scratch.\"");
                    morewait();
                }
                else
                    send_to_jail();
            }
        }
        else print2("Good move.");
    }
}
コード例 #2
0
ファイル: move.c プロジェクト: anylonen/omega
void l_sacrificestone(void)
{
  int sacrifice=1;
  int oldmaxhp = Player.maxhp;
  print1("You have come on a weathered basaltic block.");
  print2("On the top surface is an indentation in human shape.");
  morewait();
  print1("You see old rust colored stains in the grain of the stone.");
  print2("You sense something awakening. Touch the block? [yn] ");
  if (ynq2() == 'y') {
    print1("You sense great pain emanating from the ancient altar.");
    print2("Climb on to the block? [yn] ");
    if (ynq2() == 'y') {
      print1("You are stuck fast to the block!");
      print2("You feel your life-force being sucked away!");
      morewait();
      print1("Hit ESCAPE to try and get up at any moment, SPACE to remain.");
      do {
	switch(random_range(4)) {
	  case 0: print2("You feel weaker."); break;
	  case 1: print2("You feel your life fading."); break;
	  case 2: print2("Your energy is vanishing."); break;
	  case 3: print2("You are being drained."); break;
	  }
	Player.hp -= sacrifice;
	Player.maxhp -= sacrifice/2;
	sacrifice *= 2;
	dataprint();
	if ((Player.hp < 1) || (Player.maxhp < 1))
	  p_death("self-sacrifice");
      } while (stillonblock());
      print1("You manage to wrench yourself off the ancient altar!");
      print2("You leave some skin behind, though....");
      morewait();
      if ((oldmaxhp > 10) && (Player.maxhp < 3 * oldmaxhp/4)) {
	print1("A strange red glow arises from the altar.");
	print2("The glow surrounds you.... You sense gratitude.");
	Player.pow += sacrifice;
	Player.maxpow += sacrifice/10;
	dataprint();
      }
      else {
	print1("You a have a sense of rejection.");
	print2("A roil of fetid vapor smokes up from the altar.");
	gain_experience(sacrifice);
      }
    }
    else {
      print1("You sense an emotion of pique all around you.");
      print2("You retreat from the strange stone.");
    }
  }
  else {
    print1("You decide discretion to be the better part of valour.");
    print2("The stone seems to subside sleepily.");
  }
}
コード例 #3
0
ファイル: move.c プロジェクト: anylonen/omega
void l_chaos(void)
{
  if (gamestatusp(MOUNTED)) {
    print1("Your steed tries to swim in the raw Chaos, but seems to");
    print2("be having some difficulties...");
    morewait();
    print1("probably because it's just turned into a chaffinch.");
    morewait();
    resetgamestatus(MOUNTED);
  }
  if (! onewithchaos)
    print1("You are immersed in raw Chaos....");
  if (Player.rank[ADEPT]) {
    if (! onewithchaos)
    {
      onewithchaos = 1;
      print2("You achieve oneness of Chaos....");
    }
    Player.mana = max(Player.mana,calcmana());
    Player.hp = max(Player.hp, Player.maxhp);
  }
  else if (onewithchaos) /* adept that gets amnesia from chaos storm */
  {
    print2("The chaos sea doesn't seem to bother you at all.");
  }
  else if (Player.rank[PRIESTHOOD] && (! saved)) {
    print2("A mysterious force protects you from the Chaos!");
    print3("Wow.... You feel a bit smug.");
    gain_experience(500);
    saved = TRUE;
  }
  else {
    print2("Uh oh....");
    if (saved) nprint2("Nothing mysterious happens this time....");
    morewait();
    print1("Congratulations! You've achieved maximal entropy!");
    Player.alignment -= 50;
    gain_experience(1000);
    p_death("immersion in raw Chaos");
  }
}
コード例 #4
0
ファイル: effect2.c プロジェクト: anylonen/omega
void i_law(pob o)
{
  if (Player.alignment > 0) {
    Player.alignment += random_range(20);
    mprint("You feel wonderfully lawful!");
    gain_experience(Player.alignment*10);
  }
  else {
    mprint("You feel a sense of inner constraint!");
  }
  /* Potion of Law always makes player more lawful. PGM */
  Player.alignment += random_range(20);
}
コード例 #5
0
ファイル: effect2.c プロジェクト: anylonen/omega
void i_chaos(pob o)
{
  if (Player.alignment < 0) {
    Player.alignment -= random_range(20);
    mprint("You feel deliciously chaotic!");
    gain_experience(abs(Player.alignment)*10);
  }
  else {
    mprint("You feel a sense of inner turmoil!");
  }
  /* Potion of Chaos always makes player more chaotic. PGM */
  Player.alignment -= random_range(20);
}
コード例 #6
0
ファイル: aux1.cpp プロジェクト: Geozop/OmegaRPG
/* check to see if too much tunneling has been done in this level */
void tunnelcheck(void)
{
    if ((Level->depth == 0 && Current_Environment != E_DLAIR) ||
            Current_Environment == E_ASTRAL)
        return;
    Level->tunnelled++;
    if ((Level->tunnelled) > (Level->level_length)/4)
        mprint("Dust and stone fragments fall on you from overhead.");
    if ((Level->tunnelled) >(Level->level_length)/2)
        mprint("You hear groaning and creaking noises.");
    if ((Level->tunnelled) > (3*(Level->level_length))/4)
        mprint("The floor trembles and you hear a loud grinding screech.");
    if ((Level->tunnelled) > Level->level_length) {
        mprint("With a scream of tortured stone, the entire dungeon caves in!!!");
        gain_experience(5000);
        if (Player.status[SHADOWFORM]) {
            change_environment(E_COUNTRYSIDE);
            switch (Country[Player.x][Player.y].base_terrain_type)
            {
            case CASTLE:
            case STARPEAK:
            case CAVES:
            case VOLCANO:
                Country[Player.x][Player.y].current_terrain_type = MOUNTAINS;
                break;
            case DRAGONLAIR:
                Country[Player.x][Player.y].current_terrain_type = DESERT;
                break;
            case MAGIC_ISLE:
                Country[Player.x][Player.y].current_terrain_type = CHAOS_SEA;
                break;
            case PALACE:
                Country[Player.x][Player.y].current_terrain_type = JUNGLE;
                break;
            }
            Country[Player.x][Player.y].base_terrain_type =
                Country[Player.x][Player.y].current_terrain_type;
            c_set(Player.x, Player.y, CHANGED);
            print1("In your shadowy state, you float back up to the surface.");
            return;
        }
        mprint("You are flattened into an unpleasant jellylike substance.");
        p_death("dungeon cave-in");
    }
}
コード例 #7
0
ファイル: itemf1.c プロジェクト: albert-wang/OmegaRPG
/* use a thieves pick */
void i_pick(pob o)
{
    int dir;
    int ox,oy;
    o->used = FALSE;
    if ((! o->known) && (! Player.rank[THIEVES]))
        mprint("You have no idea what do with a piece of twisted metal.");
    else {
        if (o->known < 1) o->known = 1;
        Objects[o->id].known = 1;
        mprint("Pick lock:");
        dir = getdir();
        if (dir == ABORT)
            resetgamestatus(SKIP_MONSTERS);
        else {
            ox = Player.x + Dirs[0][dir];
            oy = Player.y + Dirs[1][dir];
            if ((Level->site[ox][oy].locchar != CLOSED_DOOR) ||
                    loc_statusp(ox,oy,SECRET)) {
                mprint("You can't unlock that!");
                resetgamestatus(SKIP_MONSTERS);
            }
            else if (Level->site[ox][oy].aux == LOCKED) {
                if (Level->depth == MaxDungeonLevels-1)
                    mprint("The lock is too complicated for you!!!");
                else if (Level->depth*2 + random_range(50) <
                         Player.dex+Player.level+Player.rank[THIEVES]*10) {
                    mprint("You picked the lock!");
                    Level->site[ox][oy].aux = UNLOCKED;
                    lset(ox, oy, CHANGED);
                    gain_experience(max(3,Level->depth));
                }
                else mprint("You failed to pick the lock.");
            }
            else mprint("That door is already unlocked!");
        }
    }
}
コード例 #8
0
ファイル: effect2.c プロジェクト: anylonen/omega
void sanctify(int blessing)
{
  if (blessing > -1) {
    if (Level->environment == E_TEMPLE) 
      mprint("Odd, the spell has no effect. I wonder why.");
    else if (Level->site[Player.x][Player.y].locchar == ALTAR) 
      mprint("This site can't get any holier!");
    else if (Player.patron == 0) {
      mprint("The gods are angered!");
      Level->site[Player.x][Player.y].locchar = LAVA;
      Level->site[Player.x][Player.y].p_locf = L_LAVA;
      lset(Player.x, Player.y, CHANGED);
      p_movefunction(L_LAVA);
    }
    else {
      Level->site[Player.x][Player.y].locchar = ALTAR;
      Level->site[Player.x][Player.y].aux = Player.patron;
      Level->site[Player.x][Player.y].p_locf = L_ALTAR;
      lset(Player.x, Player.y, CHANGED);
      mprint("You are standing on sacred ground!");
    }
  }
  else {
    if (Level->site[Player.x][Player.y].locchar == ALTAR) {
      mprint("The altar crumbles before your unholy blast....");
      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 (Level->site[Player.x][Player.y].aux == Player.patron) {
	mprint("Your deity is not amused....");
	p_damage(Player.hp-1,UNSTOPPABLE,"Divine Wrath");
      }
      else if ((Player.patron == ATHENA) || (Player.patron == ODIN)) {
	if ((Level->site[Player.x][Player.y].aux == SET) ||
	    (Level->site[Player.x][Player.y].aux == HECATE)) {
	  mprint("Your deity applauds the eradication of Chaos' taint");
	  gain_experience(1000);
	}
	else {
	  mprint("Your deity approves of your action.");
	  gain_experience(100);
	}
      }
      else if ((Player.patron == SET) || (Player.patron == HECATE)) {
	if ((Level->site[Player.x][Player.y].aux == ODIN) ||
	    (Level->site[Player.x][Player.y].aux == ATHENA)) {
	  mprint("Your deity applauds the obliteration of Law");
	  gain_experience(1000);
	}
	else {
	  mprint("Your deity approves of your action.");
	  gain_experience(100);
	}
      }
      else if (Player.patron == DRUID) {
	mprint("Your attempt to maintain the Balance is applauded....");
	gain_experience(250);
      }
      else mprint("Nothing much happens");
    }
    else mprint("You feel an aura of unholiness arising from this spot....");
  }
}
コード例 #9
0
ファイル: omon.c プロジェクト: tcadigan/omega_0.75
void m_death(struct monster *m)
{
    pob corpse;
    pml ml;
    int x;
    int y;
    int found = FALSE;
    m->hp = -1;

    if(los_p(Player.x, Player.y, m->x, m->y)) {
        putspot(m->x, m->y, getspot(m->x, m->y, FALSE));
        gain_experience(m->xpv);
        calc_melee();

        if(m->uniqueness != COMMON) {
            strcpy(Str1, m->monstring);
        }
        else {
            strcpy(Str1, "The ");
            strcat(Str1, m->monstring);
        }

        strcat(Str1, " is dead!");
        mprint(Str1);
    }

    m_dropstuff(m);

    /* Death */
    if(m->id == (ML10 + 0)) {
        mprint("Death lies sprawled out on the ground...");
        mprint("Death laughs ironically and gets back to his feet.");
        mprint("He gestures and another scythe appears in his hands.");

        switch(random_range(10)) {
        case 0:
            mprint("Death performs a little bow and goes back on guard.");

            break;
        case 1:
            mprint("\'A hit! A palpable hit!\' Death goes back on the attack.");

            break;
        case 2:
            mprint("\'Ah, if only it could be so simple!\' snickers Death.");

            break;
        case 3:
            mprint("\'This fool things he can slay death! What a jest!\' says Death.");

            break;
        case 4:
            mprint("\'You point is well taken.\' says Death, attacking again.");

            break;
        case 5:
            mprint("\'Oh, come now, stop delaying the inevitable.\' says Death.");

            break;
        case 6:
            mprint("\'Your destiny ends here with me.\' says Death, scythe raised.");

            break;
        case 7:
            mprint("\'I almost felt that.\' says Death, smiling.");

            break;
        case 8:
            mprint("\'Timeo Mortis?\' asks Death quizzically, \'Not me!\'");

            break;
        case 9:
            mprint("Death sighs theatrically. \'They never learn.\'");

            break;
        }

        strengthen_death(m);
    }
    else {
        Level->site[m->x][m->y].creature = NULL;

        if(random_range(2) || (m->uniqueness != COMMON)) {
            corpse = (pob)malloc(sizeof(objtype));
            make_corpse(corpse, m);
            drop_at(m->x, m->y, corpse);
        }

        plotspot(m->x, m->y, FALSE);

        switch(m->id) {
        case ML0 + 8: /* Hiscore NPC */
            switch(m->aux2) {
            case 0:
                mprint("You hear a faroff dirge. You feel a sense of triumph.");

                break;
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
                mprint("You hear a faroff sound like angels crying...");
                strcpy(Priest[1], nameprint());
                Priestbehavior[1] = 2933;

                break;
            case 7:
                mprint("A furtive figure dashes out of the shadows, takes a look at");
                mprint("the corpse, and runs away!");
                strcpy(Shadowlord, nameprint());
                Shadowlordbehavior = 2912;

                break;
            case 8:
                mprint("An aide-de-camp approaches, removes the corpse's insignia,");
                mprint("and departs.");
                strcpy(Commandant, nameprint());
                Commandantbehavior = 2912;

                break;
            case 9:
                mprint("An odd glow surrounds the corpse, and slowly fades.");
                strcpy(Archmage, nameprint());
                Archmagebehavior = 2933;

                break;
            case 10:
                mprint("A demon materializes, takes a quick look at the corpse,");
                mprint("and teleports away with a faint popping noise.");
                strcpy(Prime, nameprint());
                Primebehavior = 2932;

                break;
            case 11:
                mprint("A sports columnist rushes forward and takes a quick photo");
                mprint("of the corpse and rushes off muttering about a deadline.");
                strcpy(Champion, nameprint());
                Championbehavior = 2913;

                break;
            case 12:
                mprint("You hear a fanfare in the distance, and feel dismayed.");
                strcpy(Duke, nameprint());
                Dukebehavior = 2911;

                break;
            case 13:
                if(Player.alignment > 10) {
                    mprint("You feel smug.");
                }
                else if(Player.alignment < 10) {
                    mprint("You feel ashamed.");
                }

                strcpy(Chaoslord, nameprint());
                Chaoslordbehavior = 2912;

                break;
            case 14:
                if(Player.alignment < 10) {
                    mprint("You feel smug.");
                }
                else if(Player.alignment > 10) {
                    mprint("You feel ashamed.");
                }

                strcpy(Lawlord, nameprint());
                Lawlordbehavior = 2911;

                break;
            case 15:
                /*
                 * Just a tad complicated. Promote a new justiciar if
                 * an guards are left in the city, otherwise destroy
                 * the Order!
                 */
                Player.alignment -= 100;

                if(!gamestatusp(DESTROYED_ORDER)) {
                    mprint("In the distance you hear a trumpet. A Servent of Law");
                    mprint("materializes, sheds a tear, and leaves.");
                    strcpy(Justiciar, nameprint());
                    Justiciarbehavior = 2911;

                    /* Promote one of the city guards to be justiciar */
                    ml = City->mlist;

                    while(!found && (ml != NULL)) {
                        if((ml->m->id == (ML0 + 3)) && (ml->m->hp > 0)) {
                            found = 1;
                        }
                        else {
                            found = 0;
                        }

                        if(!found) {
                            ml = ml->next;
                        }
                    }

                    if(ml != NULL) {
                        mprint("A new justiciar has been promoted!");
                        x = ml->m->x;
                        y = ml->m->y;
                        ml->m->x = x;
                        ml->m->y = y;
                        ml->m->click = (Tick + 1) % 60;
                        m_status_reset(ml->m, AWAKE);
                        m_status_reset(ml->m, HOSTILE);
                    }

                    /* 
                     * Will cause order to be destroyed if no guards or justiciar
                     */
                    alert_guards();
                }
                else {
                    mprint("A Servant of Chaos materializes, grabs the corpse,");
                    mprint("snickers a bit, and vanishes.");
                }
            }
            
            break;
        case ML0 + 3: /* Guard */
            Player.alignment -= 10;
            
            if((Current_Environment == E_CITY)
               || (Current_Environment == E_VILLAGE)) {
                alert_guards();
            }
            
            break;
        case ML3 + 5: /* Goblin king */
            if(!gamestatusp(ATTACKED_ORACLE)) {
                mprint("You seem to hear a woman's voice from far off:");
                mprint("\'Well don! Come to me now...\'");
            }
            
            setgamestatus(COMPLETED_CAVES);
            
            break;
        case ML7 + 5: /* Great worm */
            if(!gamestatusp(ATTACKED_ORACLE)) {
                mprint("A female voice sounds from just behind your ear:");
                mprint("\'Well fought! I have some new advice for you...\'");
            }
            
            setgamestatus(COMPLETED_SEWERS);
            
            break;
        case ML10 + 1:
            setgamestatus(KILLED_EATER);
            
            break;
        case ML10 + 2:
            setgamestatus(KILLED_LAWBRINGER);
            
            break;
        case ML10 + 3:
            setgamestatus(KILLED_DRAGONLORD);
            
            break;
        case ML10 + 4:
            setgamestatus(COMPLETED_VOLCANO);
            
            if(!gamestatusp(ATTACKED_ORACLE)) {
                mprint("You feel a soft touch on your shoulder...");
                mprint("You turn around but there is no one there!");
                mprint("You turn back and see a not: \'See me soon.\'");
                mprint("The note vanishes in a burst of blue fire!");
            }
            
            break;
        case ML10 + 9: /* Elemental master */
            if(!gamestatusp(ATTACKED_ORACLE)) {
                mprint("Words appear before you, traced in blue flame!");
                mprint("\'Return to the Prime Plane via the Circle of Sorcerors...");
            }
            
            break;
        }
    }
    
    dodrawspot(m->x, m->y);
}
コード例 #10
0
ファイル: move.c プロジェクト: anylonen/omega
void l_magic_pool(void)
{
  int possibilities=random_range(100);
  print1("This pool seems to be enchanted....");
  if (gamestatusp(MOUNTED)) {
    if (random_range(2)) {
      print2("Your horse is polymorphed into a fig newton.");
      resetgamestatus(MOUNTED);
    }
    else print2("Whatever it was, your horse enjoyed it....");
  }
  else  if (possibilities == 0) {
    print1("Oh no! You encounter the DREADED AQUAE MORTIS...");
    if (random_range(1000) < Player.level*Player.level*Player.level) {
      print2("The DREADED AQUAE MORTIS throttles you within inches....");
      print3("but for some reason chooses to let you escape.");
      gain_experience(500);
      Player.hp = 1;
    }
    else p_death("the DREADED AQUAE MORTIS!");
  }
  else if (possibilities < 25)
    augment(0);
  else if (possibilities < 30)
    augment(1);
  else if (possibilities < 60)
    augment(-1);
  else if (possibilities < 65)
    cleanse(1);
  else if (possibilities < 80) {
    if (Player.possessions[O_WEAPON_HAND] != NULL) {
      print1("You drop your weapon in the pool! It's gone forever!");
      dispose_lost_objects(1,Player.possessions[O_WEAPON_HAND]);
    }
    else print1("You feel fortunate.");
  }
  else if (possibilities < 90) {
    if (Player.possessions[O_WEAPON_HAND] != NULL) {
      print1("Your weapon leaves the pool with a new edge....");
      Player.possessions[O_WEAPON_HAND]->plus += random_range(10)+1;
      calc_melee();
    }
    else print1("You feel unfortunate.");
  }
  else if (possibilities < 95) {
    Player.hp += 10;
    print1("You feel healthier after the dip...");
  }
  else if (possibilities < 99) {
    print1("Oooh, a tainted pool...");
    p_poison(10);
  }
  else if (possibilities == 99) {
    print1("Wow! A pool of azoth!");
    heal(10);
    cleanse(1);
    Player.mana = calcmana()*3;
    Player.str = (Player.maxstr++)*3;
  }
  print2("The pool seems to have dried up.");
  Level->site[Player.x][Player.y].locchar = TRAP;
  Level->site[Player.x][Player.y].p_locf = L_TRAP_PIT;
  lset(Player.x, Player.y, CHANGED);
}
コード例 #11
0
ファイル: move.c プロジェクト: anylonen/omega
void l_abyss(void)
{
  int i;
  if (Current_Environment != Current_Dungeon) {
    print1("You fall through a dimensional portal!");
    morewait();
    strategic_teleport(-1);
  }
  else {
    print1("You enter the infinite abyss!");
    morewait();
    if (random_range(100)==13) {
      print1("As you fall you see before you what seems like");
      print2("an infinite congerie of iridescent bubbles.");
      print3("You have met Yog Sothoth!!!");
      morewait();
      clearmsg();
      if (Player.alignment > -10) 
	p_death("the Eater of Souls");
      else {
	print1("The All-In-One must have taken pity on you.");
	print2("A transdimensional portal appears...");
	morewait();
	change_level(Level->depth,Level->depth+1,FALSE);
	gain_experience(2000);
	Player.alignment -= 50;
      }
    }
    else {
      i = 0;
      print1("You fall...");
      while(random_range(3)!=2) {
	if (i%6 == 0)
	    print2("and fall... ");
	else
	    nprint2("and fall... ");
	i++;
	morewait();
      }
      i++;
      print1("Finally,you emerge through an interdimensional interstice...");
      morewait();
      if (Level->depth+i>MaxDungeonLevels) {
	print2("You emerge high above the ground!!!!");
	print3("Yaaaaaaaah........");
	morewait();
	change_environment(E_COUNTRYSIDE);
	do {
	  setPlayerXY( random_range(COUNTRY_WIDTH), random_range(COUNTRY_LENGTH));
	} while(Country[Player.x][Player.y].base_terrain_type == CHAOS_SEA);
	p_damage(i*50,NORMAL_DAMAGE,"a fall from a great height");
      }
      else {
	print2("You built up some velocity during your fall, though....");
	morewait();
	p_damage(i*5,NORMAL_DAMAGE,"a fall through the abyss");
	change_level(Level->depth,Level->depth+i,FALSE);
	gain_experience(i*i*50);
      }
    }
  }
}
コード例 #12
0
ファイル: site2.c プロジェクト: albert-wang/OmegaRPG
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");
            }
        }
    }
}
コード例 #13
0
ファイル: site2.c プロジェクト: albert-wang/OmegaRPG
void l_oracle(void)
{
    char response;
    if (gamestatusp(ATTACKED_ORACLE) && (! gamestatusp(COMPLETED_ASTRAL))) {
        print1("You come before a blue crystal dais. You see a broken mirror.");
        print2("Look in the mirror? [yn] ");
        if (ynq2()=='y') {
            print1("A strange force rips you from your place....");
            Player.hp = 1;
            print2("You feel drained....");
            dataprint();
            print3("You find yourself in a weird flickery maze.");
            change_environment(E_ASTRAL);
        }
    }
    else {
        print1("You come before a blue crystal dais. There is a bell and a mirror.");
        print2("Ring the bell [b], look in the mirror [m], or leave [ESCAPE] ");
        do response = (char) mcigetc();
        while ((response != 'b') && (response != 'm') && (response != ESCAPE));
        if (response == 'b') {
            print1("The ringing note seems to last forever.");
            print2("You notice a robed figure in front of you....");
            morewait();
            print1("The oracle doffs her cowl. Her eyes glitter with blue fire!");
            print2("Attack her? [yn] ");
            if (ynq2() == 'y') {
                setgamestatus(ATTACKED_ORACLE);
                print1("The oracle deftly avoids your attack.");
                print2("She sneers at you and vanishes.");
            }
            else {
                print2("She stares at you...and speaks:");
                if (!gamestatusp(SPOKE_TO_DRUID)) {
                    print3("'The ArchDruid speaks wisdom in his forest shrine.'");
                }
                else if (!gamestatusp(COMPLETED_CAVES)) {
                    print3("'Thou mayest find aught of interest in the caves to the South.'");
                }
                else if (!gamestatusp(COMPLETED_SEWERS)) {
                    print3("'Turn thy attention to the abyssal depths of the city.'");
                }
                else if (!gamestatusp(COMPLETED_CASTLE)) {
                    print3("'Explorest thou the depths of the Castle of the ArchMage.'");
                }
                else if (!gamestatusp(COMPLETED_ASTRAL)) {
                    morewait();
                    print1("'Journey to the Astral Plane and meet the Gods' servants.'");
                    print2("The oracle holds out her hand. Do you take it? [yn] ");
                    if (ynq2()=='y') {
                        print1("'Beware: Only the Star Gem can escape the Astral Plane.'");
                        print2("A magic portal opens behind the oracle. She leads you");
                        morewait();
                        print1("through a sequence of special effects that would have");
                        print2("IL&M technicians cursing in awe and deposits you in an");
                        morewait();
                        clearmsg();
                        print1("odd looking room whose walls seem strangely insubstantial.");
                        gain_experience(5000);
                        change_environment(E_ASTRAL);
                    }
                    else print3("You detect the hint of a sneer from the oracle.");
                }
                else if (!gamestatusp(COMPLETED_VOLCANO)) {
                    print3("'The infernal maw may yield its secrets to thee now.'");
                }
                else if (!gamestatusp(COMPLETED_CHALLENGE)) {
                    print3("'The challenge of adepthood yet awaits thee.'");
                }
                else {
                    morewait();
                    print1("'My lord: Thou hast surpassed my tutelage forever.");
                    print2("Fare thee well.'");
                    print3("The oracle replaces her hood and seems to fade away....");
                }
            }
        }
        else if (response == 'm') {
            print1("You seem to see yourself. Odd....");
            knowledge(1);
        }
        else print2("You leave this immanent place.");
    }
}
コード例 #14
0
ファイル: site2.c プロジェクト: albert-wang/OmegaRPG
void l_brothel(void)
{
    char response;
    print1("You come to a heavily reinforced inner door.");
    print2("A sign reads `The House of the Eclipse'");
    morewait();
    clearmsg();
    if (cinema_confirm("You are about to open the door.")=='y') {
        menuclear();
        menuprint("a:knock on the door.\n");
        menuprint("b:try to pick the lock.\n");
        menuprint("c:bash down the door.\n");
        menuprint("ESCAPE: Leave this house of ill repute.\n");
        showmenu();
        do
            response = menugetc();
        while ((response != 'a') &&
                (response != 'b') &&
                (response != 'c') &&
                (response != ESCAPE));
        xredraw();
        if (response == 'a') {
            if (!nighttime())
                print2("There is no reponse.");
            else {
                print1("A window opens in the door.");
                print2("`500Au, buddy. For the night.' pay it? [yn] ");
                if (ynq2()=='y') {
                    if (Player.cash < 500) {
                        print1("`What, no roll?!'");
                        print2("The bouncer bounces you a little and lets you go.");
                        p_damage(25,UNSTOPPABLE,"da bouncer");
                    }
                    else {
                        Player.cash -= 500;
                        print1("You are ushered into an opulently appointed hall.");
                        print2("After an expensive dinner (takeout from Les Crapuleux)");
                        morewait();
                        if (Player.preference == 'n') {
                            switch(random_range(4)) {
                            case 0:
                                print1("you spend the evening playing German Whist with");
                                break;
                            case 1:
                                print1("you spend the evening discussing philosophy with");
                                break;
                            case 2:
                                print1("you spend the evening playing chess against");
                                break;
                            case 3:
                                print1("you spend the evening telling your adventures to");
                            }
                            print2("various employees of the House of the Eclipse.");
                        }
                        else {
                            print1("you spend an enjoyable and educational evening with");
                            if (Player.preference == 'm' ||
                                    (Player.preference == 'y' && random_range(2)))
                                switch(random_range(4)) {
                                case 0:
                                    print2("Skarn the Insatiable, a satyr.");
                                    break;
                                case 1:
                                    print2("Dryden the Defanged, an incubus.");
                                    break;
                                case 2:
                                    print2("Gorgar the Equipped, a centaur.");
                                    break;
                                case 3:
                                    print2("Hieronymus, the mendicant priest of Eros.");
                                    break;
                                }
                            else switch(random_range(4)) {
                                case 0:
                                    print2("Noreen the Nymph (omaniac)");
                                    break;
                                case 1:
                                    print2("Angelface, a recanted succubus.");
                                    break;
                                case 2:
                                    print2("Corporal Sue of the City Guard (moonlighting).");
                                    break;
                                case 3:
                                    print2("Sheena the Queena the Jungle, a wereleopard.");
                                    break;
                                }
                        }
                        morewait();
                        if (hour() > 12) Time += ((24-hour())+8) * 60;
                        else {
                            Time += ((9-hour())*60);
                            Date++;
                        }
                        Player.food = 40;
                        Player.status[DISEASED] = 0;
                        Player.status[POISONED] = 0;
                        Player.hp = Player.maxhp;
                        /* reduce temporary stat gains to max stat levels */
                        toggle_item_use(TRUE);
                        Player.str = min(Player.str,Player.maxstr);
                        Player.con = min(Player.con,Player.maxcon);
                        Player.agi = min(Player.agi,Player.maxagi);
                        Player.dex = min(Player.dex,Player.maxdex);
                        Player.iq = min(Player.iq,Player.maxiq);
                        Player.pow = min(Player.pow,Player.maxpow);
                        toggle_item_use(FALSE);
                        if (Player.preference == 'n')
                            Player.iq++; /* whatever :-) */
                        else
                            Player.con++;
                        gain_experience(100);
                        timeprint();
                        dataprint();
                        showflags();
                        morewait();
                        clearmsg();
                        if (Player.preference == 'n')
                            print1("You arise refreshed the next morning...");
                        else
                            print1("You arise, tired but happy, the next morning...");
                    }
                }
                else print2("What are you, some kinda prude?");
            }
        }
        else if (response == 'b') {
            if (nighttime()) {
                print1("As you fumble at the lock, the door opens....");
                print2("The bouncer tosses you into the street.");
            }
            else print1("The door appears to be bolted and barred from behind.");
        }
        else if (response == 'c') {
            if (nighttime()) {
                print1("As you charge toward the door it opens....");
                print2("Yaaaaah! Thud!");
                morewait();
                print1("You run past the startled bouncer into a wall.");
                p_damage(20,UNSTOPPABLE,"a move worthy of Clouseau");
                print2("The bouncer tosses you into the street.");
            }
            else {
                print1("Ouch! The door resists your efforts.");
                p_damage(1,UNSTOPPABLE,"a sturdy door");
                morewait();
                print1("You hear an irritated voice from inside:");
                print2("'Keep it down out there! Some of us are trying to sleep!'");
            }
        }
    }
}
コード例 #15
0
ファイル: effect1.c プロジェクト: albert-wang/OmegaRPG
/* various kinds of wishes */
void wish(int blessing)
{
    int i;
    char wishstr[80];
    clearmsg();
    print1("What do you wish for? ");
    if (blessing < 0)
        deathprint();
    else
        strcpy(wishstr,msgscanstring());
    if (blessing < 0 || strcmp(wishstr,"Death")==0) {
        print2("As you wish, so shall it be.");
        p_death("a deathwish");
    }
    if (strcmp(wishstr,"Power")==0) {
        print2("You feel a sudden surge of energy");
        Player.mana=calcmana()*10;
    }
    else if (strcmp(wishstr,"Skill")==0) {
        print2("You feel more competent.");
        if (gamestatusp(CHEATED))
            gain_experience(10000);
        else
            gain_experience(min(10000,Player.xp));
    }
    else if (strcmp(wishstr,"Wealth")==0) {
        print2("You are submerged in shower of gold pieces!");
        Player.cash += 10000;
    }
    else if (strcmp(wishstr,"Balance")==0) {
        print2("You feel neutral.");
        Player.alignment = 0;
    }
    else if (strcmp(wishstr,"Chaos")==0) {
        print2("You feel chaotic.");
        Player.alignment -= 25;
    }
    else if (strcmp(wishstr,"Law")==0) {
        print2("You feel lawful.");
        Player.alignment += 25;
    }
    else if (strcmp(wishstr,"Location")==0)
        strategic_teleport(1);
    else if (strcmp(wishstr,"Knowledge")==0) {
        print2("You feel more knowledgeable.");
        i = random_range(NUMSPELLS);
        if (Spells[i].known)
            Spells[i].powerdrain =
                (max(1,Spells[i].powerdrain/2));
        else Spells[i].known = TRUE;
    }
    else if (strcmp(wishstr,"Health")==0) {
        print2("You feel vigorous");
        Player.hp = max( Player.hp, Player.maxhp);
        Player.status[DISEASED] = 0;
        Player.status[POISONED] = 0;
        Player.food = 43;
        /* Wish for Health when starving does some good. PGM */
    }
    else if (strcmp(wishstr,"Destruction")==0)
        annihilate(gamestatusp(CHEATED));
    else if (strcmp(wishstr,"Acquisition")==0)
        acquire(gamestatusp(CHEATED));
    else if (strcmp(wishstr,"Summoning")==0)
        summon(gamestatusp(CHEATED),-1);
    else if (strcmp(wishstr,"Stats") == 0 && gamestatusp(CHEATED))
    {
        Player.str = Player.maxstr = Player.con = Player.maxcon =
                                         Player.agi = Player.maxagi = Player.dex = Player.maxdex =
                                                 Player.iq = Player.maxiq = Player.pow = Player.maxpow = 200;
        calc_melee();
    }
    else print2("You feel stupid.");
    dataprint();
    showflags();
}
コード例 #16
0
ファイル: opriest.c プロジェクト: tcadigan/omega_0.75
/* Prayer occurs at altars, hence the name of the function */
void l_altar()
{
    int i;
    int deity;
    char response;

    if(Current_Environment == E_COUNTRYSIDE) {
        deity = DRUID;
    }
    else {
        deity = Level->site[Player.x][Player.y].aux;
    }

    switch(deity) {
    case ODIN:
        print1("This granite altar is graven with a gallows.");

        break;
    case SET:
        print1("This sandstone altar has a black hand drawn on it.");

        break;
    case HECATE:
        print1("This silver altar is inlaid with a black cresent moon.");

        break;
    case ATHENA:
        print1("This golden altar is inscribed with an owl.");

        break;
    case DESTINY:
        print1("This crystal altar is in the form of an omega.");

        break;
    case DRUID:
        print1("This oaken altar is ornately engraved with leaves.");

        break;
    default:
        print1("This rude altar has no markings.");

        break;
    }

    print2("Worship at this altar? [yn] ");

    if(ynq2() == 'y') {
        if(Player.rank[PRIESTHOOD] == 0) {
            increase_priest_rank(deity);
        }
        else if(!check_sacrilege(deity)) {
            if(Blessing) {
                print1("You have a sense of immanence.");
            }

            print2("Request a Blessing, Sacrifice an item, or just Pray [b,s,p] ");
            response = mcigetc();

            while((response != 'b')
                  && (response != 's')
                  && (response != 'p')
                  && (response != ESCAPE)) {
                response = mcigetc();
            }

            if(response == 'b') {
                print1("You beg a heavenly benefice.");
                print2("You hear a gong resonating throughout eternity...");
                morewait();

                if(Blessing) {
                    print1("A shaft of lecent radiance lances dwon from the heavens!");
                    print2("You feel uplifted...");
                    morewait();
                    gain_experience(Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * 50);
                    cleanse(1);
                    heal(10);
                    bless(1);
                    Blessing = FALSE;
                    increase_priest_rank(deity);
                }
                else {
                    print1("Your ardent plea is ignored.");
                    print2("You feel ashamed.");
                    Player.xp -= (Player.xp / 4);
                }

                calc_melee();
            }
            else if(response == 's') {
                print1("Which item to Sacrifice?");
                i = getitem('\0');

                if(i == ABORT) {
                    i = 0;
                }

                if(Player.possessions[i] == NULL) {
                    print1("You have insulted your deity!");
                    print2("Not a good idea, as it turns out...");
                    dispel(-1);
                    p_damage(Player.hp - 1, UNSTOPPABLE, "a god's pique");
                }
                else if(true_item_value(Player.possessions[i]) > (Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * Player.rank[PRIESTHOOD] * 50)) {
                    print1("With a burst of blue flame, your offering vanishes!");
                    dispose_lost_objects(1, Player.possessions[i]);
                    print2("A violet nimbus settles around your head and slowly fades.");
                    morewait();
                    Blessing = TRUE;
                }
                else {
                    print1("A darkling glow envelopes your offering!");
                    print2("The glow slowly fades...");
                    morewait();
                    setgamestatus(SUPPRESS_PRINTING);

                    if(Player.possessions[i]->used) {
                        Player.possessions[i]->used = FALSE;
                        item_use(Player.possessions[i]);
                        Player.possessions[i]->blessing = -1 - abs(Player.possessions[i]->blessing);
                        Player.possessions[i]->used = TRUE;
                        item_use(Player.possessions[i]);
                    }
                    else {
                        Player.possessions[i]->blessing = -1 - abs(Player.possessions[i]->blessing);
                    }

                    resetgamestatus(SUPPRESS_PRINTING);
                }
            }
            else if(response == 'p') {
                if(deity != Player.patron) {
                    print1("Nothing seems to happen.");
                }
                else {
                    increase_priest_rank(deity);
                }
            }
        }
    }
}
コード例 #17
0
ファイル: guild1.cpp プロジェクト: B-Rich/OmegaRPG
void l_castle(void)
{
    Object* o;
    int x, y;

    if (Player.level < 3) {
        print1("You can't possibly enter the castle, you nobody!");
        print2("Come back when you are famous.");
    }
    else {
        print1("You are ushered into the castle.");
        if (Player.rank[NOBILITY]<DUKE) {
            print2("His Grace, ");
            nprint2(Duke);
            nprint2("-- Duke of Rampart! <fanfare>");
            morewait();
            clearmsg();
        }
        if (Player.rank[NOBILITY]==0) {
            print1("Well, sirrah, wouldst embark on a quest? [yn] ");
            if (ynq1() == 'y') {
                print2("Splendid. Bring me the head of the Goblin King.");
                Player.rank[NOBILITY]=COMMONER;
            }
            else {
                print1("You scoundrel! Guards! Take this blackguard away!");
                morewait();
                p_damage(Player.maxhp / 2, UNSTOPPABLE, "castle guards for lese majeste");
                send_to_jail();
            }
        }
        else if (Player.rank[NOBILITY]==COMMONER) {
            if (find_and_remove_item(CORPSEID,GOBLIN_KING)) {
                print1("Good job, sirrah! I promote you to the rank of esquire.");
                Player.rank[NOBILITY]=ESQUIRE;
                gain_experience(100);
                print2("Now that you have proved yourself true, another quest!");
                morewait();
                print1("Bring to me a Holy Defender!");
                print2("One is said to be in the possession of the Great Wyrm");
                morewait();
                clearmsg();
                print1("in the depths of the sewers below the city.");
            }
            else print2("Do not return until you achieve the quest, caitiff!");
        }
        else if (Player.rank[NOBILITY]==ESQUIRE) {
            if (find_and_remove_item(OB_DEFENDER,-1)) {
                print1("My thanks, squire. In return, I dub thee knight!");
                Player.rank[NOBILITY]=KNIGHT;
                gain_experience(1000);
                print2("If thou wouldst please me further...");
                morewait();
                print1("Bring me a suit of dragonscale armor.");
                print2("You might have to kill a dragon to get one....");
            }
            else print2("Greetings, squire. My sword? What, you don't have it?");
        }
        else if (Player.rank[NOBILITY]==KNIGHT) {
            if (find_and_remove_item(OB_DRAGONSCALE,-1)) {
                print1("Thanks, good sir knight.");
                print2("Here are letters patent to a peerage!");
                Player.rank[NOBILITY]=LORD;
                gain_experience(10000);
                morewait();
                print1("If you would do me a final service...");
                print2("I require the Orb of Mastery. If you would be so kind...");
                morewait();
                print1("By the way, you might find the Orb in the possession");
                print2("Of the Elemental Master on the Astral Plane");
            }
            else print2("Your quest is not yet complete, sir knight.");
        }
        else if (Player.rank[NOBILITY]==LORD) {
            if (find_item(&o,OB_ORB_MASTERY,-1)) {
                print1("My sincerest thanks, my lord.");
                print2("You have proved yourself a true paragon of chivalry");
                morewait();
                print1("I abdicate the Duchy in your favor....");
                print2("Oh, you can keep the Orb, by the way....");
                Player.rank[NOBILITY]=DUKE;
                gain_experience(10000);
                strcpy(Duke,Player.name);
                morewait();
                Dukebehavior = fixnpc(4);
                save_hiscore_npc(12);
                for (y = 52; y < 63; y++)
                    for (x = 2; x < 52; x++) {
                        if (Level->site[x][y].p_locf == L_TRAP_SIREN) {
                            Level->site[x][y].p_locf = L_NO_OP;
                            lset(x, y, CHANGED);
                        }
                        if (x >= 12 && loc_statusp(x, y, SECRET)) {
                            lreset(x, y, SECRET);
                            lset(x, y, CHANGED);
                        }
                        if (x >= 20 && x <= 23 && y == 56) {
                            Level->site[x][y].locchar = FLOOR;
                            lset(x, y, CHANGED);
                        }
                    }

            }
            else print2("I didn't really think you were up to the task....");
        }
    }
}
コード例 #18
0
ファイル: spell.c プロジェクト: albert-wang/OmegaRPG
/* Has all kinds of effects in different circumstances.
   Eventually will be more interesting */
void s_ritual(void)
{
    pob symbol;
    int i,roomno;
    int x,y;

    mprint("You begin your ritual....");
    mprint("You enter a deep trance. Time Passes...");
    setgamestatus(SKIP_PLAYER);
    time_clock(FALSE);
    setgamestatus(SKIP_PLAYER);
    time_clock(FALSE);
    setgamestatus(SKIP_PLAYER);
    time_clock(FALSE);
    setgamestatus(SKIP_PLAYER);
    time_clock(FALSE);
    setgamestatus(SKIP_PLAYER);
    time_clock(FALSE);
    if (RitualHour == hour())
        mprint("Your mental fatigue prevents from completing the ritual!");
    else if (random_range(100) > Player.iq+Player.pow+Player.level)
        mprint("Your concentration was broken -- the ritual fails!");
    else {
        mprint("You charge the ritual with magical energy and focus your will.");
        mprint("Time Passes...");
        setgamestatus(SKIP_PLAYER);
        time_clock(FALSE);
        setgamestatus(SKIP_PLAYER);
        time_clock(FALSE);
        setgamestatus(SKIP_PLAYER);
        time_clock(FALSE);
        setgamestatus(SKIP_PLAYER);
        time_clock(FALSE);
        setgamestatus(SKIP_PLAYER);
        time_clock(FALSE);
        RitualHour = hour();
        /* set of random conditions for different ritual effects */
        if (Current_Environment == E_CITY) {
            mprint("Flowing waves of mystical light congeal all around you.");
            mprint("'Like wow, man! Colors!'");
            mprint("Appreciative citizens throw you spare change.");
            Player.cash +=random_range(50);
        }
        else if ( (roomno=Level->site[Player.x][Player.y].roomnumber) >= ROOMBASE )
        {
            if (RitualRoom == roomno)
                mprint("For some reason the ritual doesn't work this time...");
            else {
                RitualRoom = roomno;
                switch (RitualRoom) {
                case RS_TREASURE: /* ransacked treasure chamber */
                    mprint("Your spell sets off frenetic growth all around you!");
                    for(i=0; i<8; i++) {
                        Level->site[Player.x+Dirs[0][i]][Player.y+Dirs[1][i]].locchar =
                            HEDGE;
                        Level->site[Player.x+Dirs[0][i]][Player.y+Dirs[1][i]].p_locf =
                            L_TRIFID;
                        lset(Player.x+Dirs[0][i], Player.y+Dirs[1][i], CHANGED);
                    }
                    break;
                case RS_HAREM: /* harem */
                case RS_BOUDOIR: /* boudoir */
                    mprint("A secret panel opens next to the bed....");
                    if (random_range(2))
                        summon(0,INCUBUS); /* succubus/incubus */
                    else summon(0,SATYR); /* satyr/nymph */
                    break;
                case RS_SHRINE: /*shrine to high magic */
                    mprint("A storm of mana coaelesces around you.");
                    mprint("You are buffeted by bursts of random magic.");
                    p_damage(random_range(Player.pow),UNSTOPPABLE,"high magic");
                    mprint("Continue ritual? Could be dangerous.... [yn] ");
                    if (ynq()=='y') s_wish();
                    else mprint("The mana fades away to nothingness.");
                    x = Player.x;
                    y = Player.y;
                    while (x >= 0 && Level->site[x - 1][y].roomnumber == RS_SHRINE)
                        x--;
                    while (y >= 0 && Level->site[x][y - 1].roomnumber == RS_SHRINE)
                        y--;
                    for (i = 0; Level->site[x][y].roomnumber == RS_SHRINE;) {
                        Level->site[x][y].roomnumber = RS_ZORCH;
                        lset(x, y, CHANGED);
                        x++;
                        i++;
                        if (Level->site[x][y].roomnumber != RS_SHRINE) {
                            x -= i;
                            i = 0;
                            y++;
                        }
                    }
                    break;
                case RS_MAGIC_LAB: /* magician's lab */
                    mprint("Your magical activity sets off a latent spell in the lab!");
                    cast_spell(random_range(NUMSPELLS));
                    break;
                case RS_PENTAGRAM: /* pentagram room */
                    mprint("A smoky form begins to coalesce....");
                    summon(-1,-1);
                    mprint("Fortunately, it seems confined to the pentagram.");
                    m_status_reset(Level->mlist->m,MOBILE);
                    break;
                case RS_OMEGA_DAIS: /* blue omega room */
                    mprint("The Lords of Destiny look upon you....");
                    if (Player.level > 10) {
                        mprint("A curtain of blue flames leaps up from the omega.");
                        morewait();
                        l_adept();
                    }
                    else {
                        if (Player.patron == DESTINY) {
                            mprint("Your patrons take pity on you.");
                            if ((Player.rank[PRIESTHOOD]<SPRIEST) &&
                                    (! find_item(&symbol,OB_SYMBOL_DESTINY,-1))) {
                                symbol = ((pob) checkmalloc(sizeof(objtype)));
                                *symbol = Objects[OB_SYMBOL_DESTINY];
                                symbol->known = 2;
                                symbol->charge = 17;
                                gain_item(symbol);
                                mprint("You feel uplifted.");
                            }
                            else gain_experience(min(1000,Player.xp));
                        }
                        else if (random_range(3)==1) {
                            mprint("You feel Fated.");
                            gain_experience(Player.level*Player.level*10);
                            Player.hp = max(Player.hp, Player.maxhp);
                        }
                        else if (random_range(2)) {
                            mprint("You feel Doomed.");
                            Player.hp = 1;
                            Player.mana = 0;
                            Player.xp = 0;
                        }
                        else mprint("The Lords of Destiny laugh at you!");
                    }
                    break;
                default:
                    mprint("Well, not much effect. Chalk it up to experience.");
                    gain_experience(Player.level*5);
                    break;
                }
            }
        }
        else {
            if (RitualRoom == Level->site[Player.x][Player.y].roomnumber)
                mprint("The ritual fails for some unexplainable reason.");
            else {
                mprint("The ritual seems to be generating some spell effect.");
                RitualRoom = Level->site[Player.x][Player.y].roomnumber;
                switch (RitualRoom) {
                case RS_WALLSPACE:
                    shadowform();
                    break;
                case RS_CORRIDOR:
                    haste(0);
                    break;
                case RS_PONDS:
                    breathe(0);
                    break;
                case RS_ADEPT:
                    hero(1);
                    break;
                default:
                    mprint("The ritual doesn't seem to produce any tangible results...");
                    gain_experience(Player.level*6);
                }
            }
        }
    }
}
コード例 #19
0
ファイル: site2.c プロジェクト: albert-wang/OmegaRPG
void l_trifid(void)
{
    int damage=0,stuck=TRUE;
    print1("The hedge comes alive with a surge of alien growth!");
    while (stuck) {
        dataprint();
        damage += Level->depth/2+1;
        print2("Razor-edged vines covered in suckers attach themselves to you.");
        morewait();
        if (find_and_remove_item(OB_SALT_WATER,-1)) {
            print1("Thinking fast, you toss salt water on the trifid...");
            print2("The trifid disintegrates with a frustrated sigh.");
            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);
            gain_experience(1000);
            stuck = FALSE;
        }
        else {
            p_damage(damage,UNSTOPPABLE,"a trifid");
            morewait();
            print1("You are entangled in tendrils...");
            menuclear();
            menuprint("a: Try to break free.\n");
            menuprint("b: Hang limp and hope the tendrils uncoil.\n");
            menuprint("c: Pray for assistance.\n");
            menuprint("d: Attempt to bargain with the hedge.\n");
            menuprint("e: Click your heels together and wish for escape.\n");
            menuprint("ANYTHING ELSE: writhe and scream hopelessly.\n");
            showmenu();
            switch(menugetc()) {
            case 'a':
                if (Player.str > random_range(200)) {
                    print1("Amazing! You're now free.");
                    print2("The trifid writhes hungrily at you.");
                    stuck = FALSE;
                }
                else print1("Well, THAT didn't work.");
                break;
            case 'b':
                print1("Well, at least you're facing your fate with dignity.");
                break;
            case 'c':
                if ((Player.patron == DRUID) &&
                        (Player.rank[PRIESTHOOD] > random_range(5))) {
                    print1("A shaft of golden light bathes the alien plant");
                    print2("which grudginly lets you go....");
                    stuck = FALSE;
                }
                else print1("You receive no divine aid as yet.");
                break;
            case 'd':
                print1("The hedge doesn't answer your entreaties.");
                break;
            case 'e':
                print1("You forgot your ruby slippers, stupid.");
                break;
            default:
                print1("The hedge enjoys your camp play-acting....");
                break;
            }
        }
    }
    xredraw();
}