Exemplo n.º 1
0
        public Skill(IEntity caster, String skillName, int apCost, SKILL_TARGET focusATarget,
                     List <SkillEffect> skillEffects, List <Point> range)
        {
            _caster           = caster;
            _skillName        = skillName;
            _apCost           = apCost;
            _skillTarget      = focusATarget;
            _skillEffects     = skillEffects;
            _skillOrientation = SKILL_ORIENTATION.TOP;
            //_textButton = new TextButton(skillName, LevelManager.getLevelManager().getLevel().getHUD().getSkin());
            if (this._caster != null)
            {
                AddListenerToTextButton();
            }

            _orientedRange    = new List <Point> [4];
            _orientedRange[0] = range;
            for (int i = 1; i < 4; i++)
            {
                _orientedRange[i] = new List <Point>(range.Count);
            }
            for (int i = 0; i < range.Count; i++)
            {
                this._orientedRange[(int)SKILL_ORIENTATION.RIGHT].Add(new Point(range[i].Y, -range[i].X));
                this._orientedRange[(int)SKILL_ORIENTATION.BOT].Add(new Point(-range[i].X, -range[i].Y));
                this._orientedRange[(int)SKILL_ORIENTATION.LEFT].Add(new Point(-range[i].Y, -range[i].X));
            }
        }
Exemplo n.º 2
0
 public Skill(Skill s, IEntity caster, bool addToHUD)
 {
     _caster           = caster;
     _skillName        = s._skillName;
     _apCost           = s._apCost;
     _skillTarget      = s._skillTarget;
     _skillEffects     = s._skillEffects;
     _skillOrientation = s._skillOrientation;
     //_textButton = s._textButton;
     if (addToHUD)
     {
         AddListenerToTextButton();
     }
     _orientedRange = s._orientedRange;
 }
Exemplo n.º 3
0
        //public List<Point> getRange(SKILL_ORIENTATION skillOrientation)
        //{
        //    return this._orientedRange[skillOrientation.ordinal()];
        //}

        //public TextButton getTextButton()
        //{
        //    return this._textButton;
        //}

        public void setSkillOrientation(SKILL_ORIENTATION skillOrientation)
        {
            //if (skillOrientation != this._skillOrientation)
            //{
            //    this._skillOrientation = skillOrientation;
            //    Layer l = LevelManager.getLevelManager().getLevel().getLayer(Layer.SKILL_HIGHLIGHTER);
            //    l.removeAllTiles();
            //    for (int i = 0; i < _orientedRange[skillOrientation.ordinal()].size(); i++)
            //    {
            //        Point casterPosition = _caster.getPhysicsComponent().getPointPosition();
            //        l.addTile(new GroundHighlighter("sprites/ground_highlighter.png",
            //                    casterPosition.X + _orientedRange[skillOrientation.ordinal()].get(i).x,
            //                    casterPosition.Y + _orientedRange[skillOrientation.ordinal()].get(i).y));
            //    }
            //}
        }
Exemplo n.º 4
0
 public Skill(IEntity caster, String skillName, int apCost, SKILL_TARGET focusATarget, List <SkillEffect> skillEffects)
 {
     this._caster           = caster;
     this._skillName        = skillName;
     this._apCost           = apCost;
     this._skillTarget      = focusATarget;
     this._skillEffects     = skillEffects;
     this._skillOrientation = SKILL_ORIENTATION.TOP;
     //this._textButton = new TextButton(skillName, LevelManager.getLevelManager().getLevel().getHUD().getSkin());
     //this._textButton.addListener(new ClickListener() {
     //        @Override
     //        public void clicked(InputEvent event, float x, float y)
     //        {
     //                FightManager.getFightManager().selectedSkill = Skill.this;
     //        }
     //});
 }