Esempio n. 1
0
        /// <summary>
        /// Periodically call this method to make sure conversation progresses
        /// </summary>
        public void Update(int tickCounter)
        {
            if (endTick > 0 && currentLineNode == null)
            {
                PlayNextLine(false);
            }
            else
            {
                // rotate the primary speaker to face the secondary speaker
                if (currentLineNode.Speaker1 != Speaker.Player && currentLineNode.Speaker2 != Speaker.None)
                {
                    Mooege.Core.GS.Actors.Actor speaker1 = GetSpeaker(currentLineNode.Speaker1);
                    Mooege.Core.GS.Actors.Actor speaker2 = GetSpeaker(currentLineNode.Speaker2);

                    Vector3D translation     = speaker2.Position - speaker1.Position;
                    Vector2F flatTranslation = new Vector2F(translation.X, translation.Y);

                    float facingAngle = flatTranslation.Rotation();
                    speaker1.SetFacingRotation(facingAngle);

                    player.World.BroadcastIfRevealed(new ACDTranslateFacingMessage
                    {
                        ActorId         = speaker1.DynamicID,
                        Angle           = facingAngle,
                        TurnImmediately = false
                    }, speaker1);
                }

                // start the next line if the playback has finished
                if (tickCounter > endTick)
                {
                    PlayNextLine(false);
                }
            }
        }
Esempio n. 2
0
        // generates a random item from given type category.
        // we can also set a difficulty mode parameter here, but it seems current db doesnt have nightmare or hell-mode items with valid snoId's /raist.
        public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor player, ItemTypeTable type)
        {
            var itemDefinition = GetRandom(Items.Values
                                           .Where(def => ItemGroup
                                                  .HierarchyToHashList(ItemGroup.FromHash(def.ItemType1)).Contains(type.Hash)).ToList());

            return(CreateItem(player, itemDefinition));
        }
Esempio n. 3
0
        // Creates an item based on supplied definition.
        public static Item CreateItem(Mooege.Core.GS.Actors.Actor owner, ItemTable definition)
        {
            // Logger.Trace("Creating item: {0} [sno:{1}, gbid {2}]", definition.Name, definition.SNOActor, StringHashHelper.HashItemName(definition.Name));

            Type type = GetItemClass(definition);

            var item = (Item)Activator.CreateInstance(type, new object[] { owner.World, definition });

            return(item);
        }
Esempio n. 4
0
        // generates a random item.
        public static Item GenerateRandom(Mooege.Core.GS.Actors.Actor owner)
        {
            var itemDefinition = GetRandom(Items.Values.ToList());

            return(CreateItem(owner, itemDefinition));
        }