Ejemplo n.º 1
0
        public void ReleaseSkill(GameUnit.GameUnit skillMaker, int skillRange, Vector2 skillMakerPosition, Vector2 targetPositon)
        {
            ReleaseSkillCommand releaseSkillCommand = new ReleaseSkillCommand(skillMaker, skillRange, skillMakerPosition, targetPositon);

            if (releaseSkillCommand.Judge())
            {
                Debug.Log("箭雨发动");
                //TODO技能伤害范围染色
                Gameplay.Instance().gamePlayInput.HandleSkillCancel(BattleMap.BattleMap.Instance().GetUnitCoordinate(skillMaker), skillRange);//取消技能可释放范围染色

                List <Vector2>    vector2s       = new List <Vector2>();
                GameUnit.GameUnit unit           = (GameUnit.GameUnit) this.GetSelectingUnits()[0];
                Vector3           unitCoordinate = BattleMap.BattleMap.Instance().GetUnitCoordinate(unit);
                vector2s = unit.GetComponent <ShowRange>().GetSkillRnage(unitCoordinate, range);
                foreach (Vector2 vector2 in vector2s)
                {
                    if (BattleMap.BattleMap.Instance().CheckIfHasUnits(vector2))
                    {
                        GameUnit.GameUnit gameUnit = BattleMap.BattleMap.Instance().GetUnitsOnMapBlock(vector2);
                        gameUnit.hp -= damage;
                    }
                }
                //TODO取消技能伤害范围染色
                //GamePlay.Gameplay.Instance().gamePlayInput.isSkill = false;//箭雨释放完毕;
            }
        }
Ejemplo n.º 2
0
 private void Action()
 {
     //获取被选中的友军,需要自己根据技能描述强转类型,一旦强转的类型是错的代码会出错
     GameUnit.GameUnit unit = (GameUnit.GameUnit) this.GetSelectingUnits()[0];
     //加buff
     unit.GetComponent("Couragebuff_1");
 }
Ejemplo n.º 3
0
 //攻击范围染色
 public void HandleAtkConfirm(Vector2 target)
 {
     BattleMap.BattleMap map = BattleMap.BattleMap.Instance();
     if (map.CheckIfHasUnits(target))
     {
         GameUnit.GameUnit unit = BattleMap.BattleMap.Instance().GetUnitsOnMapBlock(target);
         unit.GetComponent <ShowRange>().MarkAttackRange(target);
     }
 }
Ejemplo n.º 4
0
 public void HandleAtkCancel(Vector2 target)
 {
     GameUnit.GameUnit unit = null;
     if (BattleMap.BattleMap.Instance().CheckIfHasUnits(target))
     {
         unit = BattleMap.BattleMap.Instance().GetUnitsOnMapBlock(target);
     }
     else
     {
         unit = BattleMap.BattleMap.Instance().GetUnitsOnMapBlock(TargetList[0]);
     }
     unit.GetComponent <ShowRange>().CancleAttackRangeMark(target);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 删除某个单位的某个技能
 /// </summary>
 /// <param name="unit"></param>被删除技能的单位
 /// <param name="ability"></param>被删除的技能
 public static void DeleteUnitAbility(this GameplayTool self, GameUnit.GameUnit unit, string ability)
 {
     GameObject.Destroy(unit.GetComponent(ability));
 }