コード例 #1
0
ファイル: SimplePunch.cs プロジェクト: Kalavarda/Unity
        public void Use(SkillContext context)
        {
            if (!ReadyToUse(context))
            {
                return;
            }

            _lastUseTime = DateTime.Now;

            var ratio = _source.GetSkillPower(this, context);

            context.Target.ChangeHP(-ratio * _weapon.Power, _source, this);
            OnSuccessUsed?.Invoke(this, context);
        }
コード例 #2
0
ファイル: Scratch.cs プロジェクト: Kalavarda/Unity
        public void Use(SkillContext context)
        {
            if (context.Distance > MaxDistance)
            {
                return;
            }

            if (context.Target is Player player)
            {
                var ratio = 1f;
                if (_source is ISkilled skilled)
                {
                    ratio = skilled.GetSkillPower(this, context);
                }

                var debuff = new Bleeding(_source, context.Target, this, DateTime.Now + DebuffDuration, BaseDamage * ratio);
                player.AddBuff(debuff);
                _lastUseTime = DateTime.Now;
                OnSuccessUsed?.Invoke(this, context);
                return;
            }

            throw new NotImplementedException();
        }