home *** CD-ROM | disk | FTP | other *** search
- function updateStickies(sticky)
- {
- if(++m_stickyNdx >= m_maxStickies)
- {
- m_stickyNdx = 0;
- }
- var _loc1_ = m_stickies[m_stickyNdx];
- _loc1_.unloadMovie();
- m_stickies[m_stickyNdx] = sticky;
- }
- function step()
- {
- if(hp_bar._alpha > 0)
- {
- hp_bar._alpha -= 5;
- }
- if(isDead())
- {
- vy += 0.08;
- _rotation = _rotation - 0.2;
- }
- else
- {
- updateCannon();
- }
- updatePosition();
- if(_X < goal_xspot && !isDead())
- {
- vx = 0;
- }
- if(_Y > _parent._parent.g_ground + 100)
- {
- destroy();
- }
- if(_X < -50)
- {
- destroy();
- }
- }
- function updateCannon()
- {
- if(shootTimer-- < 0)
- {
- shootTimer = 300;
- _parent._parent.shootAtDragonProjectile(_X,_Y,2,"proj_enemy_ice");
- }
- }
- function updatePosition()
- {
- _X = _X + vx;
- _Y = _Y + vy;
- }
- function takeDamage(amt, xp, yp)
- {
- if(hp > 0)
- {
- hp -= amt;
- if(hp <= 0)
- {
- hp = 0;
- _parent._parent.addScore(200,_X,_Y);
- if(random(6) == 0)
- {
- var _loc3_ = _parent._parent.addObj("ammo_box_heal",_parent._parent.ammo_layer,_parent._parent.getNextAmmoLevel());
- _loc3_._x = _X;
- _loc3_._y = _Y;
- }
- }
- else
- {
- hp_bar.bar._width = hp / max_hp * 100;
- hp_bar._alpha = 100;
- }
- if(_parent._parent.g_dmg_text_on)
- {
- var _loc2_ = _parent._parent.addObj("dmg_text",_parent._parent.score_layer,_parent._parent.getNextScoreLevel());
- _loc2_._x = xp;
- _loc2_._y = yp;
- _loc2_.val = amt;
- }
- }
- }
- function isDead()
- {
- return hp == 0;
- }
- function setHP(num)
- {
- hp = num;
- }
- function destroy()
- {
- _parent._parent.removeEnemy(this);
- }
- function slowShooting(amt)
- {
- shootTimer += amt;
- if(shootTimer > 500)
- {
- shootTimer = 500;
- }
- }
- vx = -0.8;
- vy = 0;
- max_hp = Math.floor(10 * (1 + _parent._parent.g_level / 100));
- hp = max_hp;
- shootTimer = 300;
- etype = "dragon_scout";
- var m_maxStickies = 3;
- var m_stickies = new Array(m_maxStickies);
- var m_stickyNdx = 0;
-