Exemplo n.º 1
0
        /// <summary>
        /// 显示一个输入UI
        /// </summary>
        /// <param name="hero">传入当前回合的英雄</param>
        public void ShowInputUI(HeroMono hero)
        {
            //保存这个英雄的信息
            _CurHero = hero;
            FirstMenu.Clear();
            //设置tips
            TextTip.text = "当前英雄回合:" + hero.Name;
            Button button = null;

            if (UnityStaticTool.CreateObjectReletiveTo <Button>(ButtonPrefab, FirstMenuGrid.transform, out button))
            {
                button.GetComponentInChildren <Text>().text = "技能";
                button.onClick.AddListener(OnSkillButtonClick);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 退出的时候清除调用
 /// </summary>
 public void Clear()
 {
     //清除玩家队列对象
     _PlayerTeam.Clear();
     //清除敌人队列对象
     _EnemyTeam.Clear();
     //清除行动列表
     _AttackList.Clear();
     //清除当前回合英雄引用
     _CurTurnHero = null;
     //清除BattleUI
     CurrentBattleUI.Clear();
     //清除技能控制器
     SkillController.Instance.Clear();
 }
Exemplo n.º 3
0
        /// <summary>
        /// 注册玩家英雄UI信息
        /// </summary>
        /// <param name="hero">注册的英雄对象</param>
        public override void RegisterPlayerHero(HeroMono hero)
        {
            BattleHeroUI hero_UI = null;

            if (UnityStaticTool.CreateObjectReletiveTo <BattleHeroUI>(BattleHeroUIPrefab, PlayerHeroParent, out hero_UI))
            {
                BattleController.Instance.DebugLog(LogType.INFO, "Register player hero in UI successfully!");
                hero_UI.Init(hero);
                _HeroUI.Add(hero, hero_UI);
            }
            else
            {
                BattleController.Instance.DebugLog(LogType.INFO, "Failed to register player hero!");
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 设置技能特效
 /// </summary>
 public override void SetSkillEffect(HeroMono attacker, List <HeroMono> targets, System.Action callback)
 {
     for (int i = 0; i < targets.Count; i++)
     {
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.position = attacker.HeroPosition;
         if (attacker.IsPlayerHero)
         {
             SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.localScale = new Vector3(-1f, 1f, 1f);
         }
         else
         {
             SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.localScale = new Vector3(1f, 1f, 1f);
         }
         StartCoroutine(SkillController.Instance.MagicSkillEffect(GetSkillIDAndLevel(), SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i], attacker.AttackPosition.position, targets[i].HeroPosition, 3f, 0f, 0f, callback));
     }
 }
Exemplo n.º 5
0
        public override void DefenseSkill(HeroMono attacker, HeroMono defender)
        {
            long hurt = 0;
            //完全物理攻击,没有任何添加
            bool is_physicl_critical = this.IsInPercent(CriticalChance);

            hurt = attacker.CurrentAttack + Mathf.RoundToInt(this.Attack * (is_physicl_critical ? 2 : 1)) - defender.CurrentDefense;
            defender.CurrentLife -= hurt;
            //播放动画
            defender.PlayTriggerAnimation(HeroAnimation.Defense1);
            if (!defender.HasLife())
            {
                defender.ExcuteBuff(Global.BuffActiveState.IsDead);
                defender.ExcuteSkill(Global.BuffActiveState.IsDead);
            }
            else
            {
                //如果是物理攻击防御技能则发动
                defender.ExcuteBuff(Global.BuffActiveState.Attacked);
                defender.ExcuteSkill(Global.BuffActiveState.Attacked);
            }
            //显示HeroHub
            if (is_physicl_critical)
            {
                if (hurt > 0)
                {
                    defender.ShowHeroHub(HubType.Critical, new ValueUnit(hurt, Global.UnitType.Value));
                }
                else if (hurt == 0)
                {
                    defender.ShowHeroHub(HubType.Miss);
                }
            }
            //正常的显示
            else if (hurt > 0)
            {
                defender.ShowHeroHub(HubType.DecreseLife, new ValueUnit(hurt, Global.UnitType.Value));
            }
            else if (hurt == 0)
            {
                defender.ShowHeroHub(HubType.Miss);
            }
            //进行buff判断
            AddSkillBuff(attacker, defender);
            // Debug.Log((attacker.IsPlayerHero ? "玩家的" : "敌人的") + attacker.Name + "使用技能" + this.Name + "对" + defender.Name + "造成" + hurt + "点伤害");
        }
Exemplo n.º 6
0
 /// <summary>
 /// 初始化系统数据
 /// </summary>
 void Init()
 {
     if (CurrentBattleUI == null)
     {
         CurrentBattleUI = GetComponent <BaseBattleUI>();
         if (CurrentBattleUI == null)
         {
             CurrentBattleUI = this.gameObject.AddComponent <BaseBattleUI>();
         }
         DebugLog(LogType.ERROR, "Not found Battle UI,Use BaseBattleUI instead!");
     }
     _SystemState    = Global.CombatSystemType.ExitSystem;
     _PlayerTeam     = new List <HeroMono>();
     _EnemyTeam      = new List <HeroMono>();
     _AttackList     = new List <HeroMono>();
     _CurTurnHero    = null;
     _IsBattling     = false;
     _IsExcuteAction = true;
 }
Exemplo n.º 7
0
 /// <summary>
 /// 增加技能Buff或者Debuff
 /// </summary>
 public virtual void AddSkillBuff(HeroMono attacker, HeroMono defender)
 {
     for (int i = 0; i < _Skill.SkillBuff.Count; i++)
     {
         //表示buff或者debuff预测成功,则进行添加
         if (this.IsInPercent(_Skill.SkillBuff[i].SuccessChance))
         {
             BattleController.Instance.DebugLog(LogType.INFO, "添加一个buff");
             if (_Skill.SkillBuff[i].TargetType == Global.BuffTargetType.Attacker)
             {
                 attacker.AddBuff(_Skill.SkillBuff[i]);
             }
             else if (_Skill.SkillBuff[i].TargetType == Global.BuffTargetType.Defenser)
             {
                 defender.AddBuff(_Skill.SkillBuff[i]);
             }
         }
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 设置技能特效
 /// </summary>
 public override void SetSkillEffect(HeroMono attacker, List <HeroMono> targets, System.Action callback)
 {
     for (int i = 0; i < targets.Count; i++)
     {
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.position = targets[i].HeroPosition;
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].gameObject.SetActive(true);
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].GetComponent <Animator>().SetTrigger("show");
     }
     StartCoroutine(SkillController.Instance.WaitForTime(_Skill.SkillEndDelay, () =>
     {
         // for (int i = 0; i < SkillController.Instance.SkillEffect[GetSkillIDAndLevel()].Count; i++)
         // {
         //     SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].gameObject.SetActive(false);
         // }
         if (callback != null)
         {
             callback();
         }
     }));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 获取当前行动列表中速度最快的英雄对象
 /// </summary>
 void GetMaxSpeedHero()
 {
     _CurTurnHero = _AttackList[0];
     for (int i = 0; i < _AttackList.Count; i++)
     {
         if (_AttackList[i].CurrentSpeed > _CurTurnHero.CurrentSpeed && !_AttackList[i].IsDead())
         {
             _CurTurnHero = _AttackList[i];
         }
     }
     if (_CurTurnHero.IsDead())
     {
         // Debug.Log("当前随机到了:" + _CurTurnHero.Name + " 剩余血量:" + _CurTurnHero.CurrentLife + " 死亡标志为:" + _CurTurnHero.IsDeath);
         // //表示当前列表中没有可以行动的英雄,重新计算行动列表,重新开始这个回合
         // Debug.Log("回合重新计算");
         //对行动列表进行处理(这里会处理多回合和跳过回合的情况)
         CaculateActiveHeroList();
         //接着从行动列表中选出速度最快的英雄作为当前回合的行动者
         GetMaxSpeedHero();
     }
 }
Exemplo n.º 10
0
        /// <summary>
        /// 显示一个Hub
        /// </summary>
        /// <param name="hero">为哪个英雄显示</param>
        /// <param name="type">Hub类型</param>
        /// <param name="life">生命值变化</param>
        /// <param name="magic">魔力值变化</param>
        public override void ShowHubInfo(HeroMono hero, HubType type, ValueUnit value = null)
        {
            HeroHubInfo info = GetHubInfoByType(type);

            if (info == null)
            {
                return;
            }
            TextHub.color           = info.TextColor;
            TextHub.text            = info.Name.Replace("[CRITICAL]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[LIFE]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[MAGIC]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[ATTACK]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[DEFENSE]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[MAGIC ATTACK]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[MAGIC DEFENSE]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[MAX LIFE]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[MAX MAGIC]", value.RealTempValue(0).ToString());
            TextHub.text            = TextHub.text.Replace("[SPEED]", value.RealTempValue(0).ToString());
            this.transform.position = hero.HeroPosition;
            this.gameObject.SetActive(true);
            StartCoroutine(Show(this.transform.position));
        }
Exemplo n.º 11
0
 /// <summary>
 /// 创建UI上的所有参与战斗的英雄Mono对象并向BattleController注册这个对象
 /// </summary>
 /// <param name="player">玩家队伍数据</param>
 /// <param name="enemy">敌人队伍数据</param>
 public override void CreateHeros(List <Hero> player, List <Hero> enemy)
 {
     //清除玩家和敌人队列的所有数据
     UnityStaticTool.DestoryChilds(PlayerTeam.gameObject, true);
     UnityStaticTool.DestoryChilds(EnemyTeam.gameObject, true);
     //创建玩家的英雄对象
     for (int i = 0; i < player.Count; i++)
     {
         HeroMono   hero_temp = null;
         GameObject prefab    = Resources.Load <GameObject>("Hero/" + player[i].ID);
         if (UnityStaticTool.CreateObjectReletiveTo <HeroMono>((prefab == null ? HeroPrefab : prefab), PlayerTeam, out hero_temp))
         {
             hero_temp.Init(player[i], true);
             hero_temp.transform.position = PlayerTeamPos[i].position;
             //记录英雄坐标
             hero_temp.HeroPosition = PlayerTeamPos[i].position;
             //记录这个英雄的对象引用
             BattleController.Instance.RegisterPlayerHeroMono(hero_temp);
         }
     }
     //创建传入进来的敌人对象
     for (int i = 0; i < enemy.Count; i++)
     {
         HeroMono   enemy_temp = null;
         GameObject prefab     = Resources.Load <GameObject>("Hero/" + player[i].ID);
         if (UnityStaticTool.CreateObjectReletiveTo <HeroMono>((prefab == null ? HeroPrefab : prefab), EnemyTeam, out enemy_temp))
         {
             enemy_temp.Init(enemy[i], false);
             enemy_temp.transform.position = EnemyTeamPos[i].position;
             //记录英雄的坐标
             enemy_temp.HeroPosition = EnemyTeamPos[i].position;
             //记录这个敌人英雄的对象引用
             BattleController.Instance.RegisterEnemyHeroMono(enemy_temp);
         }
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// 设置技能特效
 /// </summary>
 public override void SetSkillEffect(HeroMono attacker, List<HeroMono> targets, System.Action callback)
 {
     for (int i = 0; i < targets.Count; i++)
     {
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.position = targets[i].HeroPosition;
         if (attacker.IsPlayerHero)
         {
             SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.localScale = new Vector3(-1f, 1f, 1f);
         }
         else
         {
             SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].transform.localScale = new Vector3(1f, 1f, 1f);
         }
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].gameObject.SetActive(true);
         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].GetComponent<Animator>().SetTrigger("show");
     }
     // StartCoroutine(SkillController.Instance.WaitForTime(0.5f, () =>
     // {
     //     for (int i = 0; i < SkillController.Instance.SkillEffect[GetSkillIDAndLevel()].Count; i++)
     //     {
     //         SkillController.Instance.SkillEffect[GetSkillIDAndLevel()][i].gameObject.SetActive(false);
     //     }
     // }));
 }
Exemplo n.º 13
0
 /// <summary>
 /// 取消所有高亮显示
 /// </summary>
 public override void DeselectHero(HeroMono hero)
 {
     _HeroUI[hero].Deselect();
 }
Exemplo n.º 14
0
 /// <summary>
 /// 英雄死亡时候回调用
 /// </summary>
 public virtual void HeroDead(HeroMono hero)
 {
 }
Exemplo n.º 15
0
 /// <summary>
 /// 战斗界面英雄UI的初始化函数
 /// </summary>
 public virtual void Init(HeroMono hero)
 {
 }
Exemplo n.º 16
0
 /// <summary>
 /// 向控制器注册敌人英雄的Mono对象
 /// </summary>
 /// <param name="hero"></param>
 public void RegisterEnemyHeroMono(HeroMono hero)
 {
     _EnemyTeam.Add(hero);
 }
Exemplo n.º 17
0
 public override void Init(Skill skill, HeroMono hero)
 {
     // SkillEffects.Add(Resources.Load<GameObject>("SkillEffect/RespwanSkill/effect"));
     base.Init(skill, hero);
 }
Exemplo n.º 18
0
 /// <summary>
 /// 防御一个技能
 /// </summary>
 /// <param name="attacker">技能发起者</param>
 /// <param name="denfender">技能防御者</param>
 /// <param name="skill">技能对象</param>
 public void DefenseSkill <T>(HeroMono attacker, HeroMono defender, T skill) where T : BaseSkill
 {
     skill.DefenseSkill(attacker, defender);
 }
Exemplo n.º 19
0
 /// <summary>
 /// 当获得一个buff或者debuff的时候将会回调
 /// </summary>
 public virtual void OnAddBuff(HeroMono hero, Buff buff)
 {
 }
Exemplo n.º 20
0
 /// <summary>
 /// 当移除一个buff或者debuff的时候将会回调
 /// </summary>
 public virtual void OnRemoveBuff(HeroMono hero, Buff buff)
 {
 }
Exemplo n.º 21
0
 /// <summary>
 /// 被一个英雄使用一个技能攻击之后的防守
 /// </summary>
 /// <param name="skill">使用的技能</param>
 /// <param name="attacker">攻击者</param>
 public void Defense(Global.SkillType skill, HeroMono attacker)
 {
     //防御的时候是判断技能属于物理还是防御,然后叠加,然后检测是否有技能对此攻击技能有影响,还有buff的影响
     SkillController.Instance.DefenseSkill(attacker, this, attacker._Skills[skill]);
 }
Exemplo n.º 22
0
 /// <summary>
 /// 当一个buff或者debuff执行一次的时候将会回调
 /// </summary>
 public virtual void OnBuffAction(HeroMono hero, Buff buff)
 {
 }
Exemplo n.º 23
0
        /// <summary>
        /// 获取当前技能的目标对象列表
        /// </summary>
        /// <param name="attacker">技能发起者</param>
        /// <param name="skillTarget">技能目标类型</param>
        /// <returns>返回目标对象列表</returns>
        public List <HeroMono> SkillTarget(HeroMono attacker, Global.SkillTargetType skillTarget)
        {
            List <HeroMono> result = new List <HeroMono>();

            switch (skillTarget)
            {
            case Global.SkillTargetType.None:
                break;

            case Global.SkillTargetType.OneEnemy:
                result.AddRange(GetAliveTarget(!attacker.IsPlayerHero, 1));
                break;

            case Global.SkillTargetType.TwoEnemy:
                result.AddRange(GetAliveTarget(!attacker.IsPlayerHero, 2));
                break;

            case Global.SkillTargetType.ThreeEnemy:
                result.AddRange(GetAliveTarget(!attacker.IsPlayerHero, 3));
                break;

            case Global.SkillTargetType.FourEnemy:
                result.AddRange(GetAliveTarget(!attacker.IsPlayerHero, 4));
                break;

            case Global.SkillTargetType.FiveEnemy:
                result.AddRange(GetAliveTarget(!attacker.IsPlayerHero, 5));
                break;

            case Global.SkillTargetType.AllEnemy:
                if (attacker.IsPlayerHero)
                {
                    result.AddRange(GetEnemyTeamAlive());
                }
                else
                {
                    result.AddRange(GetPlayerTeamAlive());
                }
                break;

            case Global.SkillTargetType.Self:
                result.Add(attacker);
                break;

            case Global.SkillTargetType.OneSelf:
                result.AddRange(GetAliveTarget(attacker.IsPlayerHero, 1));
                break;

            case Global.SkillTargetType.TwoSelf:
                result.AddRange(GetAliveTarget(attacker.IsPlayerHero, 2));
                break;

            case Global.SkillTargetType.ThreeSelf:
                result.AddRange(GetAliveTarget(attacker.IsPlayerHero, 3));
                break;

            case Global.SkillTargetType.FourSelf:
                result.AddRange(GetAliveTarget(attacker.IsPlayerHero, 4));
                break;

            case Global.SkillTargetType.FiveSelf:
                result.AddRange(GetAliveTarget(attacker.IsPlayerHero, 5));
                break;

            case Global.SkillTargetType.AllSelf:
                if (attacker.IsPlayerHero)
                {
                    result.AddRange(GetPlayerTeamAlive());
                }
                else
                {
                    result.AddRange(GetEnemyTeamAlive());
                }
                break;

            case Global.SkillTargetType.OneEnemyWithDead:
                result.AddRange(GetTarget(!attacker.IsPlayerHero, 1));
                break;

            case Global.SkillTargetType.TwoEnemyWithDead:
                result.AddRange(GetTarget(!attacker.IsPlayerHero, 2));
                break;

            case Global.SkillTargetType.ThreeEnemyWithDead:
                result.AddRange(GetTarget(!attacker.IsPlayerHero, 3));
                break;

            case Global.SkillTargetType.FourEnemyWithDead:
                result.AddRange(GetTarget(!attacker.IsPlayerHero, 4));
                break;

            case Global.SkillTargetType.FiveEnemyWithDead:
                result.AddRange(GetTarget(!attacker.IsPlayerHero, 5));
                break;

            case Global.SkillTargetType.AllEnemyWithDead:
                if (!attacker.IsPlayerHero)
                {
                    result.AddRange(_PlayerTeam);
                }
                else
                {
                    result.AddRange(_EnemyTeam);
                }
                break;

            case Global.SkillTargetType.OneSelfWithDead:
                result.AddRange(GetTarget(attacker.IsPlayerHero, 1));
                break;

            case Global.SkillTargetType.TwoSelfWithDead:
                result.AddRange(GetTarget(attacker.IsPlayerHero, 2));
                break;

            case Global.SkillTargetType.ThreeSelfWithDead:
                result.AddRange(GetTarget(attacker.IsPlayerHero, 3));
                break;

            case Global.SkillTargetType.FourSelfWithDead:
                result.AddRange(GetTarget(attacker.IsPlayerHero, 4));
                break;

            case Global.SkillTargetType.FiveSelfWithDead:
                result.AddRange(GetTarget(attacker.IsPlayerHero, 5));
                break;

            case Global.SkillTargetType.AllSelfWithDead:
                if (attacker.IsPlayerHero)
                {
                    result.AddRange(_PlayerTeam);
                }
                else
                {
                    result.AddRange(_EnemyTeam);
                }
                break;

            case Global.SkillTargetType.OneDeadEnemy:
                result.AddRange(GetDeadTarget(!attacker.IsPlayerHero, 1));
                break;

            case Global.SkillTargetType.TwoDeadEnemy:
                result.AddRange(GetDeadTarget(!attacker.IsPlayerHero, 2));
                break;

            case Global.SkillTargetType.ThreeDeadEnemy:
                result.AddRange(GetDeadTarget(!attacker.IsPlayerHero, 3));
                break;

            case Global.SkillTargetType.FourDeadEnemy:
                result.AddRange(GetDeadTarget(!attacker.IsPlayerHero, 4));
                break;

            case Global.SkillTargetType.FiveDeadEnemy:
                result.AddRange(GetDeadTarget(!attacker.IsPlayerHero, 5));
                break;

            case Global.SkillTargetType.AllDeadEnemy:
                if (!attacker.IsPlayerHero)
                {
                    result.AddRange(GetPlayerTeamDead());
                }
                else
                {
                    result.AddRange(GetEnemyTeamDead());
                }
                break;

            case Global.SkillTargetType.OneDeadSelf:
                result.AddRange(GetDeadTarget(attacker.IsPlayerHero, 1));
                break;

            case Global.SkillTargetType.TwoDeadSelf:
                result.AddRange(GetDeadTarget(attacker.IsPlayerHero, 2));
                break;

            case Global.SkillTargetType.ThreeDeadSelf:
                result.AddRange(GetDeadTarget(attacker.IsPlayerHero, 3));
                break;

            case Global.SkillTargetType.FourDeadSelf:
                result.AddRange(GetDeadTarget(attacker.IsPlayerHero, 4));
                break;

            case Global.SkillTargetType.FiveDeadSelf:
                result.AddRange(GetDeadTarget(attacker.IsPlayerHero, 5));
                break;

            case Global.SkillTargetType.AllDeadSelf:
                if (attacker.IsPlayerHero)
                {
                    result.AddRange(GetPlayerTeamDead());
                }
                else
                {
                    result.AddRange(GetEnemyTeamDead());
                }
                break;
            }
            return(result);
        }
Exemplo n.º 24
0
 /// <summary>
 /// 英雄死亡时候回调用
 /// </summary>
 public override void HeroDead(HeroMono hero)
 {
     BattleController.Instance.DebugLog(LogType.WARNING, "英雄" + hero.Name + "死亡");
 }
Exemplo n.º 25
0
 /// <summary>
 /// 当一个buff或者debuff执行一次的时候将会回调
 /// </summary>
 public override void OnBuffAction(HeroMono hero, Buff buff)
 {
     BattleController.Instance.DebugLog(LogType.INFO, "英雄 " + hero.Name + " 执行了一个buff " + buff.Name);
 }
Exemplo n.º 26
0
        /// <summary>
        /// 执行一个Buff或者Debuff
        /// </summary>
        /// <param name="hero">buff执行对象</param>
        /// <param name="buff">要执行的buff</param>
        public void ExcuteBuff(HeroMono hero, Buff buff)
        {
            long temp = 0;

            switch (buff.BuffType)
            {
            case Global.BuffType.IncreaseAttack:
                temp = buff.ChangeHeroProperty.Attack.RealTempValue(hero.CurrentAttack);
                hero.CurrentAttack += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseAttack, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseAttack, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseDefense:
                temp = buff.ChangeHeroProperty.Defense.RealTempValue(hero.CurrentDefense);
                hero.CurrentDefense += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseDefense, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseDefense, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseLife:
                temp              = buff.ChangeHeroProperty.CurrentLife.RealTempValue(hero.CurrentMaxLife);
                hero.CurrentLife += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseLife, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseLife, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseMagic:
                temp = buff.ChangeHeroProperty.CurrentMagic.RealTempValue(hero.CurrentMaxMagic);
                hero.CurrentMagic += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseMagic, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseMagic, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseMagicAttack:
                temp = buff.ChangeHeroProperty.MagicAttack.RealTempValue(hero.CurrentMagicAttack);
                hero.CurrentMagicAttack += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseMagicAttack, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseMagicAttack, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseMagicDefense:
                temp = buff.ChangeHeroProperty.MagicDefense.RealTempValue(hero.CurrentMagicDefense);
                hero.CurrentMagicDefense += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseMagicDefense, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseMagicDefense, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseSpeed:
                temp = buff.ChangeHeroProperty.Speed.RealTempValue(hero.CurrentSpeed);
                hero.CurrentSpeed += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseSpeed, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseSpeed, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseMaxLife:
                temp = buff.ChangeHeroProperty.MaxLife.RealTempValue(hero.CurrentMaxLife);
                hero.CurrentMaxLife += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseMaxLife, new ValueUnit(temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseMaxLife, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.IncreaseMaxMagic:
                temp = buff.ChangeHeroProperty.MaxMagic.RealTempValue(hero.CurrentMaxMagic);
                hero.CurrentMaxMagic += temp;
                if (temp > 0)
                {
                    hero.ShowHeroHub(HubType.IncreseMaxMagic, new ValueUnit(-temp, Global.UnitType.Value));
                }
                else
                {
                    hero.ShowHeroHub(HubType.DecreseMaxMagic, new ValueUnit(-temp, Global.UnitType.Value));
                }
                break;

            case Global.BuffType.ActiveTurn:
                hero.CurrentTurnLast += buff.ChangeHeroProperty.Turn;
                BattleController.Instance.DebugLog(LogType.INFO, hero.Name + "回合数增加:" + buff.ChangeHeroProperty.Turn);
                break;
            }
        }
Exemplo n.º 27
0
 /// <summary>
 /// 取消所有高亮显示
 /// </summary>
 public virtual void DeselectHero(HeroMono hero)
 {
 }
Exemplo n.º 28
0
 /// <summary>
 /// 显示一个Hub
 /// </summary>
 /// <param name="hero">为哪个英雄显示</param>
 /// <param name="type">Hub类型</param>
 /// <param name="value">数值变化</param>
 public virtual void ShowHubInfo(HeroMono hero, HubType type, ValueUnit value = null)
 {
 }
 /// <summary>
 /// 控制器调用表示开始接收一个玩家输入
 /// </summary>
 public override void WaitForInput(HeroMono hero)
 {
     _IsWaitingInput = true;
     //显示输入UI
     BattleInputUI.Instance.ShowInputUI(hero);
 }
Exemplo n.º 30
0
 /// <summary>
 /// 向控制器注册玩家英雄的Mono对象
 /// </summary>
 /// <param name="hero"></param>
 public void RegisterPlayerHeroMono(HeroMono hero)
 {
     _PlayerTeam.Add(hero);
 }