예제 #1
0
        protected override void OnTick()
        {
            if (Intellect.InCombatAndActive())
            {
                //REMOVE APS
                if ((lastPosCheck - Position).Normalize() > 0.8)
                {
                    Intellect.IncActionPts(-1);
                    lastPosCheck = Position;
                }
            }

            base.OnTick();
        }
예제 #2
0
        public bool CanOpenInventory()
        {
            if (Intellect.OutsideCombatOrActive())
            {
                if (ActionPts > 1)
                {
                    Intellect.IncActionPts(-2);
                }
                else
                {
                    Log.Info("Not enough action points");
                    return(false);
                }
            }

            return(true);
        }
예제 #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");
                }
            }
        }