//public override void Apply(BaseObject target)
        //{
        //    target.HandleHealEffect(this, Amount);
        //}
        public IEnumerator Knockback(Characters.Character source, ActionProduct action, Characters.Character target)
        {
            //yield return null;
            yield return(new WaitForSeconds(_delay));

            var direction = action.Direction;

            direction.Normalize();

            float i        = 0;
            float distance = 0;

            while (distance < _distance)
            {
                var speed = _stepSpeed * Mathf.Pow(_stepDiscount, i);

                if (target.Physic.MoveVelocity.magnitude < speed)
                {
                    target.Physic.MoveVelocity = speed * direction;
                }
                distance += speed;
                i++;

                yield return(new WaitForSeconds(_stepDuration));
            }

            yield return(null);
        }
 private void DoApply2(ActionProduct action, Characters.Character target)
 {
     foreach (var item in _items)
     {
         target.InventoryUser.TryStore(item);
     }
 }
 public void OnActionHandled(ActionProduct act)
 {
     if (_tags.Intersect(act.Tags).Count() != 0)
     {
         //OnInteraction(act.Source);
     }
 }
        // JUST GIVE THE ITEM
        protected override void DoApply(ActionProduct action, Characters.Character target)
        {
            if (_isItemTransfer)
            {
                return;
            }

            DoApply2(action, target);
        }
        // TODO: Handle not destroying the object if condition not satisfied

        // TRANSFER THE ITEM IF EXISTS IN FIRST GUY's inv
        protected override void DoApply(Characters.Character source, ActionProduct action, Characters.Character target)
        {
            if (_isItemTransfer)
            {
                // TODO Give item to other character
            }
            else
            {
                DoApply2(action, target);
            }
        }
        protected override void DoApply(ActionProduct action, Characters.Character target)
        {
            var stat = target.Attributes.GetStat(_tag);

            Debug.Assert(stat != null, "Make sure the stat and effect is given a tag");
            if (_isOperation)
            {
                stat.SetCurrent(_updateOperation.Evaluate(stat.Current, stat.Total));
            }
            else
            {
                stat.SetCurrent(stat.Current + _value);
            }
        }
 public virtual void Awake()
 {
     if (_action == Action.Asset)
     {
         _actionFinal = _assetAction.Create();
     }
     else if (_action == Action.Scene)
     {
         _actionFinal = _sceneAction.Create();
     }
     else
     {
         _actionFinal = null;
     }
 }
        protected override void DoApply(Character source, ActionProduct action, Character target)
        {
            var attitude = target.Agent.GetAttitude(_type);

            Debug.Assert(attitude != null);


            if (_isBaseUpdate)
            {
                attitude.BaseValue = _operation.Evaluate(attitude.BaseValue);
            }
            else
            {
                float result = attitude.GetTowards(source);
                attitude.SetTowards(source, _operation.Evaluate(result));
            }
        }
 protected override void DoApply(Characters.Character source, ActionProduct action, Characters.Character target)
 {
     target.StartCoroutine(Knockback(source, action, target));
 }
Example #10
0
 protected override void DoApply(Characters.Character source, ActionProduct action, Characters.Character target)
 {
     target.Recover();
 }
 protected override void DoApply(Character source, ActionProduct action, Character target)
 {
     DoApply(action, target);
 }
Example #12
0
 protected override void DoApply(ActionProduct action, Characters.Character target)
 {
     target.Kill();
 }
 protected override void DoApply(BaseObject source, ActionProduct action, Characters.Character target)
 {
     target.Injure();
 }
 protected override void DoApply(ActionProduct action, BaseObject target)
 {
     //target.Injure();
 }