Пример #1
0
            /// <summary> 处理输入 </summary>
            private void HandleInput()
            {
                if (IsOnUI())
                {
                    return;
                }

                AttackTrail currentTrail = self.GetPlayer().GetAttackTrailsAt(cardID)[points.Count];

                currentTrail.DrawTrail(self.currentPlayer.position, GetPosition());

                // 设定人物方向
                self.GetPlayer().direction = Sign(GetPosition().x - self.currentPlayer.position.x);

                // 设定轨迹
                if (Input.GetMouseButtonDown(0))
                {
                    // 左键设定轨迹
                    points.Add(GetPosition());
                }
                else if (Input.GetMouseButtonDown(1))
                {
                    // 右键撤销
                    if (points.Count > 0)
                    {
                        currentTrail.ClearTrail();
                        points.RemoveAt(points.Count - 1);
                    }
                    else
                    {
                        fsm.TransitionTo <IdleState>();
                    }
                }
            }
Пример #2
0
        /// <summary> 专注效果 (玩家, 攻击方, 攻击轨迹) </summary>
        public List <(Action, float)> Activate(Player player, Player attacker, AttackTrail trail)
        {
            List <(Action, float)> ret = new List <(Action, float)>();

            void Activate(ConcentrateTrail self, List <ConcentrateEffect> effects)
            {
                foreach (var effect in effects)
                {
                    ret.Add((() => effect.Activate(self, player, attacker, trail), effect.priority));
                }
            }

            if (trail.power > power)
            {
                // 终止
                Activate(this, terminateEffects);
            }
            else
            {
                // 反应
                Activate(this, reactEffects);
                // 任意反应
                foreach (var other in player.GetActivatedTrailList())
                {
                    Activate(other, other.arbitraryEffects);
                }
            }
            return(ret);
        }
Пример #3
0
 public override void Activate(AttackTrail self, Player player, Player enemy, float dir)
 {
     if (enemy.type == Player.Type.OBSTACLE)
     {
         return;
     }
     if (isRelative)
     {
         position = enemy.transform.position + player.direction * position;
     }
     BattleManager.instance.effects.Enqueue(new SpecialEffects.Move(enemy.transform, position, 8f));
 }
Пример #4
0
                public override void Activate(AttackTrail self, Player player, Player enemy, float dir)
                {
                    if (enemy.isDodge)
                    {
                        enemy.isDodge = false;
                        return;
                    }
                    float damage = player.attack * power;

                    enemy.hitPoint          -= damage;
                    enemy.bodyHitPoint[dir] -= damage;
                    //enemy.AddBuff(new DamageBuff(2, 1.0f));
                    enemy.GetComponent <PlayerUI>().ShowDamageText(damage);
                    Log($"{enemy.name} 受到 {damage} 点伤害.");
                    Log($"{enemy.bodyHitPoint[90]} {enemy.bodyHitPoint[0]} {enemy.bodyHitPoint[-90]}");
                }
Пример #5
0
 public override void Activate(ConcentrateTrail self, Player player, Player enemy, AttackTrail trail)
 {
     self.card.Activate(player, self.card.discardEffects);
     self.isExist = false;
 }
Пример #6
0
 public override void Activate(ConcentrateTrail self, Player player, Player enemy, AttackTrail trail)
 {
     player.hitPoint += power;
     Log($"{player.name} 恢复了 {power} HP.");
 }
Пример #7
0
 public override void Activate(ConcentrateTrail self, Player player, Player enemy, AttackTrail trail)
 {
     player.isDodge = true;
     Log($"{enemy.name} 没打中.");
 }