Esempio n. 1
0
        internal override void Update(double gameTime)
        {
            base.Update(gameTime);
            if (currentHp <= 0) return;

            //aoe heal
            List<Moveable> players = InGame.getInstance().getPlayerMoveables();
            if (!isMoving() && players.Count > 0 && a1.use(gameTime)) {
                foreach (Moveable mob in players) {
                    if (mob == this) {
                        doHeal(this);
                        continue;
                    }
                    if (!mob.isDead() && (Math.Sqrt(Math.Pow(mob.playerX - playerX, 2) + Math.Pow(mob.playerY - playerY, 2)) < AOEHEAL_RANGE))
                        InGame.getInstance().addProjectile(new Projectile(this, getMid(), mob, doHeal, healProjectileTexture, healProjectileRect));
                }
                InGame.getInstance().addGroundEffect(new CircleWave(gameTime, getMid(), healWaveTexture, 60, new Color(173 , 255,47)));
                weaponPlayer.doAnimation1();
            }
            //big heal
            if ( !isMoving() && players.Count > 0 && a2.use(gameTime)) {

                bigHealTarget = this;//self
                foreach (Moveable mob in players) {
                    if (!mob.isDead() && bigHealTarget.getHPpercent() > mob.getHPpercent() && (Math.Sqrt(Math.Pow(mob.playerX - playerX, 2) + Math.Pow(mob.playerY - playerY, 2)) < BIGHEAL_RANGE))
                        bigHealTarget = mob;
                }
                if(bigHealTarget != null)
                    InGame.getInstance().addProjectile(new Projectile(this, getMid(), bigHealTarget, doBigHeal,bigHealProjectileTexture,bigHealProjectileRect));

                weaponPlayer.doAnimation2();
            }
            //update abilitys effected by cdReduc
            a1.setCDReduc(buffs.getValue(BuffType.CDreduc));
            a2.setCDReduc(buffs.getValue(BuffType.CDreduc));
        }