コード例 #1
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate(bool loaded)
        {
            base.OnPostCreate(loaded);
            SubscribeToTickEvent();

            //play death animation
            AnimationTree tree = GetFirstAnimationTree();

            if (tree != null)
            {
                tree.ActivateTrigger("death");
            }
        }
コード例 #2
0
        protected override void OnDie(MapObject prejudicial)
        {
            //TODO: GENDER BASED DEATH SOUNDS
            SoundPlay3D("VB//Sounds//HMXXXXBD.ogg", 0.5f, true);

            //play kill anim
            AnimationTree tree = GetFirstAnimationTree();

            if (tree != null)
            {
                tree.ActivateTrigger("death");
            }


            base.OnDie(prejudicial);
        }
コード例 #3
0
        public void BaseAttack(Dynamic ent, string skill)
        {
            foreach (MapObject m in ObjectsInPath(this, ent))
            {
                Log.Info("Objects in path {0}", m.Name);
            }

            MultipleActionItem mTmp = activeHeldItem as MultipleActionItem;

            if (mTmp != null && mTmp.Use(ent))
            {
                //remove action points, play sound, apply damage
                Intellect.IncActionPts(-mTmp.GetCurActionMode().ActionPoints);
                ent.DoDamage(this, Position, null, GetNetDamage(ent), false);
                SoundPlay3D(mTmp.GetCurActionMode().PlaySound, .5f, true);

                //TODO: do attack anim
                AnimationTree tree = GetFirstAnimationTree();
                if (tree != null)
                {
                    tree.ActivateTrigger("walkDance");
                }
            }
        }