public CreatureEffect_FaceAttacher MakeFaceEffect(BattleUnitView target)
        {
            CreatureEffect_FaceAttacher effectFaceAttacher = this.MakeEffect("3/RedShoes_Attract", apply: false) as CreatureEffect_FaceAttacher;

            effectFaceAttacher.AttachTarget(target);
            return(effectFaceAttacher);
        }
        public override void Execute()
        {
            var trate        = TrateView.Trate;
            var card         = BattleUnitView.Card;
            var activePlayer = BattleArena.GetActivePlayer();

            if (activePlayer.ManaPull <= 0 ||
                activePlayer.ManaPull < trate.Mana)
            {
                AddHistoryLogSignal.Dispatch(new[]
                {
                    "Player '", activePlayer.Name, "' Has ERROR! 'Add trate' '",
                    trate.SourceTrate.name,
                    "' to battle card '", card.SourceCard.name, "' 'not enough mana!'"
                }, LogType.Hand);
                BattleArena.ApplyTrate = null;
                InitAttackLineSignal.Dispatch(false);
                return;
            }

            if (BattleUnitView.TrateViews.Count >= BattleCard.MaxTratesCount)
            {
                AddHistoryLogSignal.Dispatch(new[]
                {
                    "PLAYER '", activePlayer.Name, "' has ERROR! Add Trate '",
                    trate.SourceTrate.name, "' to cart 'not enough space'"
                }, LogType.Hand);
                BattleArena.ApplyTrate = null;
                InitAttackLineSignal.Dispatch(false);
                return;
            }

            if (activePlayer.LessManaPull(trate.Mana))
            {
                BattleUnitView.AddTrate(TrateView);
                // add history battle log
                AddHistoryLogSignal.Dispatch(new[]
                {
                    "Player '", activePlayer.Name, "' Add trate '", trate.SourceTrate.name,
                    "' to battle card '", card.SourceCard.name, "'"
                }, LogType.Hand);
            }
            else
            {
                AddHistoryLogSignal.Dispatch(new[]
                {
                    "Player '", activePlayer.Name, "' Has ERROR! 'Add trate' '",
                    trate.SourceTrate.name,
                    "' to battle card '", card.SourceCard.name, "' 'not enough mana!'"
                }, LogType.Hand);
                BattleArena.ApplyTrate = null;
                InitAttackLineSignal.Dispatch(false);
                return;
            }

            BattleArena.ApplyTrate = null;
            InitAttackLineSignal.Dispatch(false);
            // Init mana view
            InitManaSignal.Dispatch();
        }
 private void OnDeadEvent(BattleUnitView view)
 {
     if (!((UnityEngine.Object) this._auraEffect != (UnityEngine.Object)null))
     {
         return;
     }
     UnityEngine.Object.Destroy((UnityEngine.Object) this._auraEffect);
 }
Exemple #4
0
    public int Spirit;    //精神-->Crit|Hit


    public BattleUnit GetBattleUnit(BattleUnitView view, Vector2Int pos)
    {
        BattleUnit unit = new BattleUnit(Name, UnitSide.Ally, view, pos);

        unit.HotKeys = HotKeys;
        unit.Skills  = new List <Skill>();
        for (int i = 0; i < HotKeys.Count; i++)
        {
            if (HotKeys[i].type == 0)
            {
                Skill skill = LoadFiles.GetSkill(Skills[HotKeys[i].param]);
                unit.Skills.Add(skill);
            }
            else
            {
                //Todo Item
            }
        }
        return(unit);
    }
    public BattleUnit(string name, UnitSide side, BattleUnitView view, Vector2Int pos)
    {
        Name     = name;
        Image    = "5";
        Side     = side;
        View     = view;
        Steps    = 3;
        Position = pos;

        HP                 = 100;
        HpMax              = 100;
        MP                 = 100;
        MpMax              = 100;
        Spirit             = 100;
        SpiritMax          = 100;
        Speed              = 5;
        SpeedMax           = 5;
        Attack             = 100;
        Defence            = 10;
        Dodge              = 0;
        Shield             = 0;
        Rebound            = 0;
        DamageToManaShiled = 0;
        Crippled           = false;
        SingTime           = 0;
        CD                 = 0;

        HotKeys = new List <HotKeyInfo>();
        HotKeyInfo info = new HotKeyInfo();

        HotKeys.Add(info);

        Skills = new List <Skill>();
        Skill skill = new Skill();

        Skills.Add(skill);

        view.Init();
    }