コード例 #1
0
        public virtual bool IsArtifactListedInRoom(IArtifact artifact)
        {
            if (artifact != null && artifact.IsInRoom(this))
            {
                if (artifact.IsListed == false)
                {
                    artifact.Seen = true;
                }

                return(artifact.IsListed);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        public override void PlayerExecute()
        {
            Debug.Assert(gDobjArtifact != null);

            var ac = gDobjArtifact.BoundMonster;

            if (ac != null)
            {
                var monsterUid = ac.GetMonsterUid();

                var keyUid = ac.GetKeyUid();

                var guardUid = ac.Field3;

                Monster = monsterUid > 0 ? gMDB[monsterUid] : null;

                Key = keyUid > 0 ? gADB[keyUid] : null;

                Guard = guardUid > 0 ? gMDB[guardUid] : null;

                Debug.Assert(Monster != null);

                PlayerProcessEvents(PpeBeforeGuardMonsterCheck);

                if (GotoCleanup)
                {
                    goto Cleanup;
                }

                if (Guard != null && Guard.IsInRoom(gActorRoom))
                {
                    gOut.Print("{0} won't let you!", Guard.GetTheName(true));

                    goto Cleanup;
                }

                if (keyUid == -1)
                {
                    gOut.Print("There's no obvious way to do that.");

                    goto Cleanup;
                }

                if (Key != null && !Key.IsCarriedByCharacter() && !Key.IsWornByCharacter() && !Key.IsInRoom(gActorRoom))
                {
                    gOut.Print("You don't have the key.");

                    goto Cleanup;
                }

                PrintMonsterFreed();

                Monster.SetInRoom(gActorRoom);

                gDobjArtifact.SetInLimbo();
            }
            else
            {
                PrintCantVerbObj(gDobjArtifact);

                NextState = Globals.CreateInstance <IStartState>();

                goto Cleanup;
            }

Cleanup:

            if (NextState == null)
            {
                NextState = Globals.CreateInstance <IMonsterStartState>();
            }
        }