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

            base.OnTick();
        }
Exemple #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);
        }
Exemple #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");
                }
            }
        }