Ejemplo n.º 1
0
        /*
         *  BREAK etc.
         */
        public static string vbreak(State globals)
        {
            int msg;

            if (globals.@object == Definitions.MIRROR)
            {
                msg = 148;
                if (globals.closed)
                {
                    string output = Database.rspeak(197);
                    return($"{output}{Environment.NewLine}{Turn.dwarfend(globals)}");
                }
            }
            else if (globals.@object == Definitions.VASE && globals.prop[Definitions.VASE] == 0)
            {
                msg = 198;
                if (Database.toting(globals, Definitions.VASE))
                {
                    Database.drop(globals, Definitions.VASE, globals.loc);
                }
                globals.prop[Definitions.VASE]   = 2;
                globals.@fixed[Definitions.VASE] = -1;
            }
            else
            {
                return(actspk(globals.verb));
            }

            return(Database.rspeak(msg));
        }
Ejemplo n.º 2
0
 /*
  *  WAKE etc.
  */
 public static string vwake(State globals)
 {
     if (globals.@object != Definitions.DWARF || !globals.closed)
     {
         return(actspk(globals.verb));
     }
     else
     {
         string output = Database.rspeak(199);
         return(output + Environment.NewLine + Turn.dwarfend(globals));
     }
 }
Ejemplo n.º 3
0
        /*
         *  ATTACK, KILL etc.
         */
        public static string vkill(State globals)
        {
            string output = string.Empty;
            int    msg    = 0;
            int    i;

            switch (globals.@object)
            {
            case Definitions.BIRD:
                if (globals.closed)
                {
                    msg = 137;
                }
                else
                {
                    Database.dstroy(globals, Definitions.BIRD);
                    globals.prop[Definitions.BIRD] = 0;
                    if (globals.place[Definitions.SNAKE] == 19)
                    {
                        ++globals.tally2;
                    }
                    msg = 45;
                }
                break;

            case 0:
                msg = 44;
                break;

            case Definitions.CLAM:
            case Definitions.OYSTER:
                msg = 150;
                break;

            case Definitions.SNAKE:
                msg = 46;
                break;

            case Definitions.DWARF:
                if (globals.closed)
                {
                    output += Turn.dwarfend(globals);
                }
                msg = 49;
                break;

            case Definitions.TROLL:
                msg = 157;
                break;

            case Definitions.BEAR:
                msg = 165 + (globals.prop[Definitions.BEAR] + 1) / 2;
                break;

            case Definitions.DRAGON:
                if (globals.prop[Definitions.DRAGON] != 0)
                {
                    msg = 167;
                    break;
                }
                output += Database.rspeak(49);
                output += Environment.NewLine + Database.pspeak(Definitions.DRAGON, 1);
                globals.prop[Definitions.DRAGON] = 2;
                globals.prop[Definitions.RUG]    = 0;
                Database.move(globals, (Definitions.DRAGON + Definitions.MAXOBJ), -1);
                Database.move(globals, (Definitions.RUG + Definitions.MAXOBJ), 0);
                Database.move(globals, Definitions.DRAGON, 120);
                Database.move(globals, Definitions.RUG, 120);
                for (i = 1; i < Definitions.MAXOBJ; ++i)
                {
                    if (globals.place[i] == 119 || globals.place[i] == 121)
                    {
                        Database.move(globals, i, 120);
                    }
                }
                globals.newloc = 120;
                return(output);

            default:
                output += actspk(globals.verb);
                return(output);
            }

            output += Database.rspeak(msg);
            return(output);
        }
Ejemplo n.º 4
0
        /*
         *  DROP etc.
         */
        public static string vdrop(State globals)
        {
            int    i;
            string output = string.Empty;

            /*
             * check for dynamite
             */
            if (Database.toting(globals, Definitions.ROD2) && globals.@object == Definitions.ROD && !Database.toting(globals, Definitions.ROD))
            {
                globals.@object = Definitions.ROD2;
            }
            if (!Database.toting(globals, globals.@object))
            {
                return(actspk(globals.verb));
            }

            /*
             * snake and bird
             */
            if (globals.@object == Definitions.BIRD && Database.here(globals, Definitions.SNAKE))
            {
                output += Database.rspeak(30);
                if (globals.closed)
                {
                    output += Turn.dwarfend(globals);
                }
                Database.dstroy(globals, Definitions.SNAKE);
                globals.prop[Definitions.SNAKE] = -1;
            }

            /*
             * coins and vending machine
             */
            else if (globals.@object == Definitions.COINS && Database.here(globals, Definitions.VEND))
            {
                Database.dstroy(globals, Definitions.COINS);
                Database.drop(globals, Definitions.BATTERIES, globals.loc);
                output += Database.pspeak(Definitions.BATTERIES, 0);
                return(output);
            }

            /*
             * bird and dragon (ouch!!)
             */
            else if (globals.@object == Definitions.BIRD && Database.at(globals, Definitions.DRAGON) && globals.prop[Definitions.DRAGON] == 0)
            {
                output += Database.rspeak(154);
                Database.dstroy(globals, Definitions.BIRD);
                globals.prop[Definitions.BIRD] = 0;
                if (globals.place[Definitions.SNAKE] != 0)
                {
                    ++globals.tally2;
                }
                return(output);
            }

            /*
             * Bear and troll
             */
            if (globals.@object == Definitions.BEAR && Database.at(globals, Definitions.TROLL))
            {
                output += Database.rspeak(163);
                Database.move(globals, Definitions.TROLL, 0);
                Database.move(globals, (Definitions.TROLL + Definitions.MAXOBJ), 0);
                Database.move(globals, Definitions.TROLL2, 117);
                Database.move(globals, (Definitions.TROLL2 + Definitions.MAXOBJ), 122);
                Database.juggle(Definitions.CHASM);
                globals.prop[Definitions.TROLL] = 2;
            }

            /*
             * vase
             */
            else if (globals.@object == Definitions.VASE)
            {
                if (globals.loc == 96)
                {
                    output += Database.rspeak(54);
                }
                else
                {
                    globals.prop[Definitions.VASE] = Database.at(globals, Definitions.PILLOW) ? 0 : 2;
                    Database.pspeak(Definitions.VASE, globals.prop[Definitions.VASE] + 1);
                    if (globals.prop[Definitions.VASE] != 0)
                    {
                        globals.@fixed[Definitions.VASE] = -1;
                    }
                }
            }

            /*
             * handle liquid and bottle
             */
            i = Database.liq(globals);
            if (i == globals.@object)
            {
                globals.@object = Definitions.BOTTLE;
            }
            if (globals.@object == Definitions.BOTTLE && i != 0)
            {
                globals.place[i] = 0;
            }

            /*
             * handle bird and cage
             */
            if (globals.@object == Definitions.CAGE && globals.prop[Definitions.BIRD] != 0)
            {
                Database.drop(globals, Definitions.BIRD, globals.loc);
            }
            if (globals.@object == Definitions.BIRD)
            {
                globals.prop[Definitions.BIRD] = 0;
            }
            Database.drop(globals, globals.@object, globals.loc);

            return(output);
        }