Frame 1
totalB = this.getBytesTotal();
KB = int(totalB / 1024);
Frame 2
loadB = this.getBytesLoaded();
percent = int((loadB / totalB) * 99);
LoadBar.gotoAndStop(99 - _root.percent);
Frame 3
if (percent < 99) {
gotoAndPlay (2);
} else {
gotoAndPlay (30);
}
Frame 30
function OffScreen(it) {
if ((((it._y > (550 + it.extent)) || (it._y < (-it.extent))) || (it._x > (700 + it.extent))) || (it._x < (-it.extent))) {
return(1);
}
return(0);
}
function FindBlankBomb() {
i = _root.BombRotate;
while (i < _root.MAXBOMBS) {
if (_root.Bombs[i].Status == 0) {
_root.BombRotate++;
if (_root.BombRotate >= _root.MAXBOMBS) {
_root.BombRotate = 0;
}
return(_root.Bombs[i]);
}
i++;
}
i = 0;
while (i < _root.BombRotate) {
if (_root.Bombs[i].Status == 0) {
_root.BombRotate++;
if (_root.BombRotate >= _root.MAXBOMBS) {
_root.BombRotate = 0;
}
return(_root.Bombs[i]);
}
i++;
}
}
function RemoveBomb(it) {
it.Status = 0;
it._visible = false;
it._x = 1000;
it._y = 1000;
_root.NumBombs--;
}
function FindBlankMissile() {
i = _root.MissileRotate;
while (i < _root.MAXMISSILES) {
if (_root.Missiles[i].Status == 0) {
_root.MissileRotate++;
if (_root.MissileRotate >= _root.MAXMISSILES) {
_root.MissileRotate = 0;
}
return(_root.Missiles[i]);
}
i++;
}
i = 0;
while (i < _root.MissileRotate) {
if (_root.Missiles[i].Status == 0) {
_root.MissileRotate++;
if (_root.MissileRotate >= _root.MAXMISSILES) {
_root.MissileRotate = 0;
}
return(_root.Missiles[i]);
}
i++;
}
return(null);
}
function RemoveMissile(it) {
it.Status = 0;
it._visible = false;
it._x = 1000;
it._y = 1000;
_root.NumMissiles--;
}
function FindBlankEnemyMissile() {
i = _root.EnemyMissileRotate;
while (i < _root.MAXENEMYMISSILES) {
if (_root.EnemyMissiles[i].Status == 0) {
_root.EnemyMissileRotate++;
if (_root.EnemyMissileRotate >= _root.MAXENEMYMISSILES) {
_root.EnemyMissileRotate = 0;
}
return(_root.EnemyMissiles[i]);
}
i++;
}
i = 0;
while (i < _root.EnemyMissileRotate) {
if (_root.EnemyMissiles[i].Status == 0) {
_root.EnemyMissileRotate++;
if (_root.EnemyMissileRotate >= _root.MAXENEMYMISSILES) {
_root.EnemyMissileRotate = 0;
}
return(_root.EnemyMissiles[i]);
}
i++;
}
return(null);
}
function RemoveEnemyMissile(it) {
it.Status = 0;
it._visible = false;
it._x = 1000;
it._y = 1000;
_root.NumEnemyMissiles--;
}
function RemoveEnemy(it) {
it.Status = 0;
it._visible = false;
it._x = 1000;
it._y = 1000;
_root.NumEnemies--;
}
function CheckEnemyDeath(it) {
if (it.Health <= 0) {
if (_root.Player.AmmoMax4 == 4) {
_root.Player.Gold = _root.Player.Gold + ((it.Gold * 2) * _root.SpeedUp);
} else {
_root.Player.Gold = _root.Player.Gold + (it.Gold * _root.SpeedUp);
}
var _local3 = _root.attachMovie(it.DeathMovie, "EnemyDying" + it.index, (_root.ENEMYDEPTH + (it.index * 2)) + 1);
_local3._width = (it._width + 50) / 2;
_local3._height = (it._height + 50) / 2;
_local3._rotation = it._rotation;
_local3._x = it._x;
_local3._y = it._y;
if (!_local3.sound) {
_local3.sound = new Sound();
}
_local3.sound.attachSound(it.DeathSound);
_local3.sound.start();
_root.RemoveEnemy(it);
return(1);
}
return(0);
}
function MakeEnemy(enemynum, behave, it) {
it._visible = true;
it.Status = 1;
it.EnemyNum = enemynum;
it.MissileDelay = 0;
it.MissileNum = 0;
it.MissileDam = 0;
it.MissileBehave = 0;
if (enemynum < 10) {
if (enemynum < 5) {
if (enemynum == 1) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 5;
it.Health = (it.MaxHealth = 80);
it.DeathMovie = "DustCloud";
it.DeathSound = "hit.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.4;
it.YSpeed = 0.4;
it.XVel = 0;
it.YVel = 10;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
} else if (enemynum == 2) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 3;
it.Health = (it.MaxHealth = 40);
it.DeathMovie = "DustCloud";
it.DeathSound = "hit.wav";
it.AirCollide = 1;
it.Regeneration = 1;
it.XSpeed = 0.4;
it.YSpeed = 0.4;
it.XVel = 0;
it.YVel = 10;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 50;
it.MissileNum = 17;
it.MissileDam = 10;
it.MissileBehave = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
} else if (enemynum == 3) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 15;
it.Health = (it.MaxHealth = 300);
it.DeathMovie = "BloodCloud";
it.DeathSound = "splat.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.5;
it.YSpeed = 0.5;
it.XVel = 0;
it.YVel = 3;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 40;
it.MissileNum = 14;
it.MissileDam = 150;
it.MissileBehave = 2;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
} else {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 3;
it.Health = (it.MaxHealth = 50);
it.DeathMovie = "BloodCloud";
it.DeathSound = "splat.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.2;
it.YSpeed = 0.2;
it.XVel = 0;
it.YVel = 2;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
}
} else if (enemynum == 5) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 6;
it.Health = (it.MaxHealth = 100);
it.DeathMovie = "DustCloud";
it.DeathSound = "hit.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.2;
it.YSpeed = 0.2;
it.XVel = 0;
it.YVel = 5;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 30;
it.MissileNum = 0;
it.MissileDam = 20;
it.MissileBehave = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
} else if (enemynum == 6) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 1;
it.Health = (it.MaxHealth = 5);
it.DeathMovie = "BloodCloud";
it.DeathSound = "splat2.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = 2;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 100;
it.MissileNum = 4;
it.MissileDam = 2;
it.MissileBehave = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
} else if (enemynum == 7) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 25;
it.Health = (it.MaxHealth = 140);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "hit.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 8;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (enemynum == 8) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 2;
it.Health = (it.MaxHealth = 12);
it.DeathMovie = "BloodCloud";
it.DeathSound = "splat2.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = 2;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomSwoop;
} else {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 20;
it.Health = (it.MaxHealth = 80);
it.DeathMovie = "DustCloud";
it.DeathSound = "hit.wav";
it.AirCollide = 1;
it.Regeneration = 0;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = 2;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomAccel;
}
} else if (enemynum < 20) {
if (enemynum < 15) {
if (enemynum == 10) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 25;
it.Health = (it.MaxHealth = 50);
it.DeathMovie = "DustCloud";
it.DeathSound = "splat2.wav";
it.AirCollide = 1;
it.Regeneration = 20;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 1;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (enemynum == 11) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 10;
it.Health = (it.MaxHealth = 300);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "woodbreak.wav";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 50;
it.MissileNum = 33;
it.MissileDam = 40;
it.MissileBehave = 2;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (enemynum == 12) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 9;
it.Health = (it.MaxHealth = 300);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "woodbreak.wav";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 50;
it.MissileNum = 32;
it.MissileDam = 30;
it.MissileBehave = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (enemynum == 13) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 12;
it.Health = (it.MaxHealth = 300);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "woodbreak.wav";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 60;
it.MissileNum = 34;
it.MissileDam = 25;
it.MissileBehave = 1;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 30;
it.Health = (it.MaxHealth = 700);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "woodbreak.wav";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 50;
it.MissileNum = 33;
it.MissileDam = 100;
it.MissileBehave = 4;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
}
} else if (enemynum == 15) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 30;
it.Health = (it.MaxHealth = 600);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "woodbreak.wav";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 25;
it.MissileNum = 32;
it.MissileDam = 75;
it.MissileBehave = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (enemynum == 16) {
it._x = it.extent + ((700 - (it.extent * 2)) * Math.random());
it._y = -it.extent;
it._rotation = 0;
it.Gold = 50;
it.Health = (it.MaxHealth = 800);
it.DeathMovie = "FragmentCloud";
it.DeathSound = "woodbreak.wav";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.MissileDelay = 20;
it.MissileNum = 34;
it.MissileDam = 150;
it.MissileBehave = 1;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
}
}
if (behave) {
if (behave == 1) {
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 5;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (behave == 2) {
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 10;
it.XAccel = (-(it._x - 350)) / 600;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedAccel;
} else if (behave == 3) {
it._x = 350 - it.extent;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 10;
it.XAccel = Math.random() - 0.5;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedAccel;
} else if (behave == 4) {
it.XSpeed = 0;
it.YSpeed = 0.2;
it.XVel = 8;
it.YVel = 6;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.Spiral;
} else if (behave == 5) {
it._rotation = 180;
it._y = 550 + it.extent;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = -5;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (behave == 6) {
it._rotation = 180;
it._y = 550 + it.extent;
it.XSpeed = 0.1;
it.YSpeed = 0.2;
it.XVel = 8;
it.YVel = 6;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.UpSpiral;
} else if (behave == 7) {
it._rotation = 180;
it._x = _root.Me._x;
it._y = 550 + it.extent;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = -8;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (behave == 8) {
it._x = _root.Me._x;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = 8;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.FixedVel;
} else if (behave == 9) {
it._y = 550 + it.extent;
it.XSpeed = 0.1;
it.YSpeed = 0.1;
it.XVel = 0;
it.YVel = -5;
it.XAccel = 0;
it.YAccel = 0;
_root.EnemyMoveFuncs[it.index] = _root.RandomAccel;
}
}
it.MissileTimer = int(Math.random() * it.MissileDelay);
_root.NumEnemies++;
}
function SetAmmo(ammonum) {
if (ammonum == 0) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "electric.wav";
_root.Player.MissileInterval = 8;
_root.Player.MissileNumHits = 2;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 10;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -10;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 1) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "electric.wav";
_root.Player.MissileInterval = 8;
_root.Player.MissileNumHits = 3;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 10;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -8;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 2) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "electric.wav";
_root.Player.MissileInterval = 10;
_root.Player.MissileNumHits = 5;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 16;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 10;
_root.Player.MissileYStartVel = -30;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = RandomVel;
} else if (ammonum == 3) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "electric.wav";
_root.Player.MissileInterval = 10;
_root.Player.MissileNumHits = 10;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 25;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 15;
_root.Player.MissileYStartVel = -25;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = RandomVel;
} else if (ammonum == 4) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "ice.wav";
_root.Player.MissileInterval = 8;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 24;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -10;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 5) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "woosh.wav";
_root.Player.MissileInterval = 6;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 20;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -12;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 6) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "ice.wav";
_root.Player.MissileInterval = 15;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 150;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -7;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 7) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "woosh.wav";
_root.Player.MissileInterval = 7;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 100;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -12;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 8) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "waterdrop.wav";
_root.Player.MissileInterval = 10;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 2;
_root.Player.MissileDamage = 15;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = -1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 9) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "waterdrop.wav";
_root.Player.MissileInterval = 12;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 10;
_root.Player.MissileDamage = 10;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = -1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 10) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "waterdrop.wav";
_root.Player.MissileInterval = 24;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 50;
_root.Player.MissileDamage = 50;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = -1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 11) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "waterdrop.wav";
_root.Player.MissileInterval = 12;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 25;
_root.Player.MissileDamage = 50;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = -1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 12) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "fire2.wav";
_root.Player.MissileInterval = 2;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 5;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -15;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 13) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "fire2.wav";
_root.Player.MissileInterval = 2;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 7;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileYStartVel = -15;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 14) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "fire2.wav";
_root.Player.MissileInterval = 3;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 22;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -10;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 15) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "tornado.wav";
_root.Player.MissileInterval = 12;
_root.Player.MissileNumHits = 1000;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 25;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0.1;
_root.Player.MissileYSpeed = 0.1;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = -5;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = RandomAccel;
} else if (ammonum == 16) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "orbzap.wav";
_root.Player.MissileInterval = 12;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 40;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 17) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "orbzap.wav";
_root.Player.MissileInterval = 12;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 60;
_root.Player.MissileBuffer = 0;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 8;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 18) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "orbzap.wav";
_root.Player.MissileInterval = 8;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 100;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 15;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 0;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 19) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "orbzap.wav";
_root.Player.MissileInterval = 5;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 75;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = -1;
_root.Player.MissileMoveFunc = FixedVel;
} else if (ammonum == 20) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "leafwoosh.wav";
_root.Player.MissileInterval = 8;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 30;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 21) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "leafwoosh.wav";
_root.Player.MissileInterval = 6;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 30;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileYAccel = 1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 22) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "leafwoosh.wav";
_root.Player.MissileInterval = 4;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 44;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = 1;
_root.Player.MissileMoveFunc = FixedAccel;
} else if (ammonum == 23) {
_root.Player.MissileNum = ammonum;
_root.Player.MissileSound = "leafwoosh.wav";
_root.Player.MissileInterval = 4;
_root.Player.MissileNumHits = 1;
_root.Player.MissileVampDamage = 0;
_root.Player.MissileDamage = 60;
_root.Player.MissileBuffer = 1;
_root.Player.MissileXSpeed = 0;
_root.Player.MissileYSpeed = 0;
_root.Player.MissileXStartVel = 0;
_root.Player.MissileYStartVel = 0;
_root.Player.MissileXAccel = 0;
_root.Player.MissileYAccel = -1;
_root.Player.MissileMoveFunc = FixedAccel;
}
_root.DisplayWeapon2.removeMovieClip();
_root["Fire" + ammonum].duplicateMovieClip("DisplayWeapon2", _root.STATUSDEPTH + 2);
_root.DisplayWeapon2._xscale = _root.DisplayWeapon2._xscale / 1.75;
_root.DisplayWeapon2._yscale = _root.DisplayWeapon2._yscale / 1.75;
_root.DisplayWeapon2._x = 370;
_root.DisplayWeapon2._y = 529;
if (ammonum < 4) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y - 8;
} else if ((ammonum == 4) || (ammonum == 6)) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y + 4;
} else if (ammonum < 8) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y - 0;
} else if (ammonum < 12) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y + 4;
} else if (ammonum < 15) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y + 0;
} else if (ammonum < 16) {
_root.DisplayWeapon2._x = _root.DisplayWeapon2._x + 4;
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y + 10;
} else if (ammonum < 20) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y + 4;
} else if (ammonum < 24) {
_root.DisplayWeapon2._y = _root.DisplayWeapon2._y + 5;
}
}
function FixedVel(it) {
it._x = it._x + (it.XVel + _root.World.XLandSpeed);
it._y = it._y + (it.YVel + _root.World.YLandSpeed);
}
function FixedAccel(it) {
it.XVel = it.XVel + it.XAccel;
it.YVel = it.YVel + it.YAccel;
it._x = it._x + (it.XVel + _root.World.XLandSpeed);
it._y = it._y + (it.YVel + _root.World.YLandSpeed);
}
function RandomVel(it) {
it._x = it._x + (it.XVel * (Math.random() - 0.5));
it._y = it._y + ((it.YVel * (Math.random() - 0.25)) + _root.World.YLandSpeed);
}
function RandomAccel(it) {
it.XAccel = it.XAccel + (it.XSpeed * (Math.random() - 0.5));
it.YAccel = it.YAccel + (it.YSpeed * (Math.random() - 0.5));
it.XVel = it.XVel + it.XAccel;
it.YVel = it.YVel + it.YAccel;
it._x = it._x + (it.XVel + _root.World.XLandSpeed);
it._y = it._y + (it.YVel + _root.World.YLandSpeed);
}
function RandomSwoop(it) {
it.XAccel = it.XAccel + (it.XSpeed * (Math.random() - 0.5));
if (it.XAccel > 1) {
it.XAccel = 1;
} else if (it.XAccel < -1) {
it.XAccel = -1;
}
it.YAccel = it.YAccel + (it.YSpeed * (Math.random() - 0.5));
if (it.YAccel > 1) {
it.YAccel = 1;
} else if (it.YAccel < -1) {
it.YAccel = -1;
}
it.XVel = it.XVel + it.XAccel;
it.YVel = it.YVel + it.YAccel;
if (it.XVel > 1) {
it.XVel = 1;
}
if (it.XVel < -1) {
it.XVel = -1;
}
if (it.YVel > 10) {
it.YVel = 10;
}
if (it.YVel < 2) {
it.YVel = 2;
}
it._rotation = it._rotation + it.XVel;
it._x = it._x + (it.YVel * Math.cos((Math.PI/180) * (it._rotation + 90)));
it._y = it._y + (it.YVel * Math.sin((Math.PI/180) * (it._rotation + 90)));
}
function Spiral(it) {
it.YAccel = it.YAccel + (it.YSpeed * (Math.random() - 0.5));
if (it.YAccel > 1) {
it.YAccel = 1;
} else if (it.YAccel < -1) {
it.YAccel = -1;
}
it.YVel = it.YVel + it.YAccel;
if (it.YVel > 10) {
it.YVel = 10;
}
if (it.YVel < 6) {
it.YVel = 6;
}
it._rotation = it._rotation + it.XVel;
it._x = it._x + (it.YVel * Math.cos((Math.PI/180) * (it._rotation + 90)));
it._y = it._y + ((it.YVel * Math.sin((Math.PI/180) * (it._rotation + 90))) + 4);
}
function UpSpiral(it) {
it.YAccel = it.YAccel + (it.YSpeed * (Math.random() - 0.5));
if (it.YAccel > 1) {
it.YAccel = 1;
} else if (it.YAccel < -1) {
it.YAccel = -1;
}
it.YVel = it.YVel + it.YAccel;
if (it.YVel > 10) {
it.YVel = 10;
}
if (it.YVel < 6) {
it.YVel = 6;
}
it._rotation = it._rotation + it.XVel;
it._x = it._x + (it.YVel * Math.cos((Math.PI/180) * (it._rotation + 90)));
it._y = it._y + ((it.YVel * Math.sin((Math.PI/180) * (it._rotation + 90))) - 4);
}
function Init() {
_root.loop1.gotoAndPlay(1);
_root.loop2.gotoAndPlay(3);
_root.loop2.removeMovieClip();
_root.SpeedUp = 2;
_root.MAXCLOUDS = 5;
_root.MAXMISSILES = 20;
_root.MAXENEMYMISSILES = 20;
_root.MAXENEMIES = 18;
_root.BACKGROUNDDEPTH = 1000;
_root.CLOUDDEPTH = 10000;
_root.MUSICDEPTH = 11000;
_root.MEDEPTH = 12000;
_root.MISSILEDEPTH = 14000;
_root.ENEMYMISSILEDEPTH = 15000;
_root.ENEMYDEPTH = 13000;
_root.ENEMYDEPTH2 = 9000;
_root.STATUSDEPTH = 20000;
_root.HIGHESTDEPTH = 30000;
_root.PIXELBUFFER = 10;
_root.WEAPONCOSTS = [100, 500, 2000, 4000, 150, 600, 2200, 4500, 200, 750, 2800, 4200, 200, 600, 2500, 5000, 300, 900, 4000, 5000, 250, 700, 3000, 5500, 500, 1000, 1500, 2000, 1000, 2000, 3000, 3000];
_root.WEAPONTEXTS = ["NATURAL LIGHTNING\nA dependable and flexible spell, Natural Lightning does reliable damage with the added benefit of being able to pass through a target and damage another but only if the first is very weak. Pressing 1 cycles between the lightning spells you have.", "SYNTHETIC ARC\nBy harnessing the power of lightning and improving it, wizard cults have been able to greatly enhance the ability of this spell to continue through targets increasing its damaging potential. The only drawback is a slightly slower rate of fire. Pressing 1 cycles between the lightning spells you have.", "SPARK OF DESIGN\nUsing a far more expensive process, this spell can pass through twice as many foes wreaking destruction on its way. With the same rate of fire as its predecessor it produces a much higher damage rate. A highly random path of travel increases fatality. Pressing 1 cycles between the lightning spells you have.", "DARK LIGHTNING\nOrigin unknown, damaging potential unresearched. None have been able to wield this spell and those who tried have perished. Pressing 1 cycles between the lightning spells you have.", "ICE BALL\nA simple ice based spell, Ice Ball is provides the caster with what they'd expect. A low damage, medium rate of fire, tool of cold death. Pressing 2 cycles between the ice spells you have.", "ICE SHARD\nThis extremely sharp piercing spell has the ability to devour weak enemies and has a high rate of fire. The only drawback is that the extreme coldness freezes wounds preventing bleeding. Pressing 2 cycles between the ice spells you have.", "FLESH SHREDDER\nThis spinning ball of ice is encased with large sharp edges that rip up organic matter. A very slow rate of fire but very high rate of damage make this ideal for disposing of massive targets. Pressing 2 cycles between the ice spells you have.", "ICE GIFT OF GODS\nBelieved to have a high rate of fire along with massive damage. Pressing 2 cycles between the ice spells you have.", "WATER THIEF\nWith the ability to not only vanquish but steal small amounts of life from fallen foes, this is ideal for repairing yourself while dispatching others. Pressing 3 cycles between the liquid spells you have.", "BLOOD OF FALLEN\nA far greater health stealing and damaging rate makes Blood of Fallen superior in all ways to Water Thief. The difference in rate of fire is neglibable. Pressing 3 cycles between the liquid spells you have.", "WELL OF SOULS\nAn extremely slow rate of fire is made up for by both extreme damage and health restoration. Well of Souls is not for fighting the many and weak, but the few and powerful. Pressing 3 cycles between the liquid spells you have.", "VAMPYRIC BLOOD\nImproved rate of damage and greatly improved rate of fire, this is a gift from the Vampyre Gods that few will ever receive. Pressing 3 cycles between the liquid spells you have.", "FIRE ROCK\nNo spells have a greater rate of fire than that of fire itself. A blanket of fiery rocks is sent forth to destroy all it touches. Pressing 4 cycles between the fire spells you have.", "FLAMING ARROW\nFire with the ability to pierce the heart of foes both to your left and right only to see their corpses riddled with more flaming arrows due to their great rate of fire. Pressing 4 cycles between the fire spells you have.", "HELL FIRE\nWith nearly the same hellacious rate of fire as Flaming Arrow this spell does far more damage and is fired in 4 directions. Enveloped in a bath of flaming death it will be difficult for your adversaries to cause you pain. Pressing 4 cycles between the fire spells you have.", "TORNADO OF FIRE\nThis is believed to be an erratic tower of death sucking up all that it happens to hover over for too long. Pressing 4 cycles between the fire spells you have.", "RANDOM POLARITY\nThis spell harnesses the power of the globe's rotation for velocity and thus moves only eastward and westward. Its random polarity prevents it from firing from the same side each time. Pressing 5 cycles between the orb spells you have.", "POLAR SIMILARITY\nThis spell has the advantage of having fixed polarity so you know from which side it will fire each time. An increased damage due to its more potent size also increases its effectiveness. Pressing 5 cycles between the orb spells you have.", "ORBITAL BLUE\nAnother fixed polarity side firing spell but with greatly increased velocity. Pressing 5 cycles between the orb spells you have.", "DIAMOND DELUSIONS\nApparently just having this spell increases your fortune somehow. Its usage, however, has not been documented. Pressing 5 cycles between the orb spells you have.", "FALL LEAVES\nA spell which harnesses the power of nature such as this will do superior damage to the evil creatures you battle. The drawback, however, is that the leaves only fall backward. Use it wisely. Pressing 6 cycles between the leaf spells you have.", "LIFE WRATH\nA leaf pulled from its branch before its time is through has the power to cause great destruction via potent poisons. This spell makes use of natural wrath with backward falling leaves. Pressing 6 cycles between the leaf spells you have.", "FOREST FIRE\nThese molten leaves will devour any foe foolish enough to try to attack you from the back. A rain of embers will befall them. Pressing 6 cycles between the leaf spells you have.", "NATURAL DEVIATION\nWith methods unknown, wizards of great power have been able to harness the immense powers of natural destruction and forced them on an unnatural path. See for yourself. Pressing 6 cycles between the leaf spells you have.", "The first of four health upgrades which will allow you to take more punishment before dying.", "The second of four health upgrades which will allow you to take more punishment before dying.", "The third of four health upgrades which will allow you to take more punishment before dying.", "The last of four health upgrades which will allow you to take more punishment before dying.", "This will teach Fireclaw how to fly in a more aerodynamic way that is not intuitive to dragons raised in captivity. This will allow for a greater maximum flight speed.", "A hormone rich treatment which can greatly increase the strength of a dragon's wing flap, this ability is sure to increase your maneuverability. Fireclaw will be able to accelerate and decelerate far faster.", "Shields up! This will provide you and Fireclaw with a visible force field which will prevent a great deal of damage. Instead of always taking full damage from projectiles and creatures you will take a random amount of partial damage.", "Sometimes collisions cannot be avoided. This is an ability Fireclaw can learn which will have him perform a vertical flip avoiding a potentially fatal collision. Pressing F performs the flip which can be done at most once every 10 seconds."];
_root.LEVELTEXTS = ["Wandering in the woods of Shirknal you found an orphan dragon. His parents were slain by the knights of King Bleu Robe, a smarmy French tyrant. Your quest: to lay siege on his castle with your now full grown dragon companion, Fireclaw!", "You are now halfway to the river Thal. One day's journey over these plains should take you to its crystal waters. The wildlife is becoming a bit more savage closer to the water, however. You may need stronger spells.", "Having reached the river Thal you must now follow it northward to until you reach the town of Riverfalls. There you will find rest and supplies before beginning to follow the river again.", "The river journey may have been treacherous, however, the condition of Riverfalls is far worse. King Bleu Robe has enslaved the populace and is using them to smelt his gold into coinage. You must bypass the town and head east through the desert.", "Desert travel has proven most difficult for Fireclaw who is now exhausted and in desperate need of water. You must turn back and return to the river or he will die. Be patient with his slow flight, he is very ill.", "You have reached the shore and Fireclaw is restored to his former self! Having spoken to a beautiful maiden at the riverbank of the atrocities committed at Riverfalls you are determined to destroy King Bleu Robe's fortifications and free the populace.", "Not only have you freed the people of Riverfalls, you have stolen 5,000 of the king's gold coinage! This should come in very handy for purchasing spells and upgrades for the next leg of your journey into the foothills of Mt. Blak.", "The weather conditions are worsening. Travel will become more arduous as winds continue to increase their strength, blowing you off your course. You may need special flying abilities to facilitate your travel and bring leaf spells!", "After battling harsh winds a rest would be nice, however, that is not your fate. You must cross the Forest of Frozen Ferns which will be so cold it will continually damage you. Find a means of restoring your health during this trip.", "You are handling the cold well, but the conditions only worsen as you must face both extreme cold and wind. You very well may not survive.", "You have braved horrid conditions, but now you must face horrible beasts. You have entered the highest rocklands of Mt. Blak before the Lavalands begin. Hopefully you can keep alive long enough here for a fiery death in the Lavalands.", "Having reached the Lavalands you see why few have lived to tell of its horrible nature. The inhabitants are all ferocious and aggressive. You must be no different. King Bleu Robe's kingdom is just beyond these vile lands.", "You have braved many horrors on this quest, but none will compare to the reinforcements of King Bleu Robe, for he has many adversaries but none have breached his defenses. Fare thee well or fare thee dead."];
_root.BGS = [1, 1, 6, 5, 5, 1, 2, 2, 4, 4, 2, 3, 3];
_root.XLANDSPEEDS = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 2, -2, 2, -2, 0, 0, 0, 0, 0, 0, 2, -2, 2, -2, 2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
_root.YLANDSPEEDS = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2];
_root.FRICTIONS = [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05];
_root.FRICTIONCONS = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5];
_root.ENEMYTYPES1 = [6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 4, 1, 4, 1, 4, 2, 1, 2, 1, 2, 1, 5, 1, 1, 5, 1, 5, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 5, 7, 5, 7, 5, 10, 10, 10, 10, 10, 10, 10, 9, 10, 9, 10, 9];
_root.ENEMYBEHAVE1 = [0, 0, 0, 0, 5, 5, 3, 0, 3, 0, 2, 3, 3, 1, 0, 3, 5, 5, 4, 1, 4, 0, 1, 4, 0, 2, 3, 1, 3, 0, 1, 2, 0, 0, 3, 0, 0, 1, 3, 0, 1, 0, 6, 7, 5, 5, 7, 5, 9, 0, 0, 0, 9, 0, 0, 8, 0, 8, 0, 0, 8, 1, 2, 1, 3, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 8];
_root.ENEMYFREQS1 = [50, 1, 25, 100, 1, 25, 50, 20, 78, 1, 50, 10, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 70, 20, 50, 20, 20, 30, 70, 20, 50, 20, 20, 30, 30, 28, 54, 85, 15, 50, 23, 65, 43, 20, 26, 50, 32, 29, 42, 35, 19, 16, 80, 60, 40, 20, 30, 20, 28, 25, 35, 30, 16, 14, 90, 90, 90, 90, 90, 50, 45, 24, 70, 30, 90, 14];
_root.ENEMYTYPES2 = [6, 6, 6, 6, 6, 6, 8, 6, 8, 6, 8, 8, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 4, 8, 6, 4, 8, 6, 9, 9, 9, 9, 9, 9, 5, 5, 1, 1, 5, 1, 7, 9, 7, 7, 7, 10, 10, 9, 7, 5, 10, 3, 3, 9, 3, 9, 3, 9, 14, 3, 14, 3, 14, 3];
_root.ENEMYBEHAVE2 = [1, 1, 1, 1, 1, 1, 1, 0, 3, 0, 1, 1, 3, 1, 0, 3, 1, 0, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 1, 0, 9, 9, 9, 9, 9, 9, 0, 4, 2, 1, 0, 0, 8, 0, 8, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
_root.ENEMYFREQS2 = [50, 1, 50, 50, 10, 50, 1, 20, 100, 60, 60, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 40, 20, 50, 20, 30, 20, 100, 50, 100, 50, 100, 50, 30, 30, 30, 30, 30, 30, 40, 20, 50, 20, 30, 20, 86, 65, 43, 23, 35, 29, 43, 23, 43, 33, 15, 150, 110, 60, 50, 23, 90, 29, 35, 20, 40, 20, 25, 20, 90, 90, 90, 90, 90, 90];
_root.ENEMYTYPES3 = [0, 8, 8, 12, 8, 8, 6, 6, 6, 11, 4, 6, 3, 6, 4, 13, 2, 2, 3, 6, 4, 13, 4, 6, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 12, 11, 12, 11, 12, 8, 2, 2, 8, 2, 2, 13, 13, 13, 13, 13, 13, 7, 9, 6, 9, 6, 7, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16];
_root.ENEMYBEHAVE3 = [2, 2, 2, 0, 2, 2, 1, 0, 1, 0, 1, 5, 0, 2, 3, 0, 0, 0, 0, 4, 1, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 5, 7, 7, 6, 0, 0, 0, 0, 0, 0, 4, 5, 7, 8, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
_root.ENEMYFREQS3 = [100, 100, 50, 100, 100, 30, 50, 25, 10, 100, 25, 10, 150, 10, 100, 100, 50, 25, 150, 10, 100, 100, 5, 25, 100, 90, 80, 70, 60, 50, 150, 100, 150, 50, 100, 100, 50, 25, 10, 50, 25, 10, 50, 35, 15, 40, 25, 10, 43, 23, 43, 33, 15, 10, 50, 25, 5, 50, 5, 50, 50, 25, 30, 50, 25, 10, 43, 23, 35, 33, 15, 10, 50, 25, 20, 50, 25, 35];
_root.Pause = 0;
_root.Mute = 0;
_root.CantSend = 0;
_root.FireOsc2 = 0;
_root.FireOsc4 = 0;
_root.DeadTimer = 0;
_root.Dead = 0;
_root.DrawClouds = 1;
_root.NewLevelStage = 0;
_root.LevelStage = 0;
_root.LevelTimer = 0;
_root.GameTimer = 0;
_root.SoundDelay = 0;
_root.NumMessages = 0;
_root.NumMissiles = 0;
_root.NumEnemyMissiles = 0;
_root.NumEnemies = 0;
_root.Level = 0;
_root.EnemyDelay1 = 0;
_root.EnemyDelay2 = 0;
_root.EnemyDelay3 = 0;
_root.FlipDelay = 0;
_root.MissileRotate = 0;
_root.EnemyMissileRotate = 0;
_root.LastUpdate = 0;
_root.SlowCount = 0;
_root.SelectedWeapon = 0;
_root.Player = {};
_root.Player.Health = 50;
_root.Player.MaxHealth = 50;
_root.Player.Lives = 3;
_root.Player.Gold = 100;
_root.Player.MaxSpeed = 10;
_root.Player.XVel = 0;
_root.Player.YVel = 0;
_root.Player.XAccel = 2;
_root.Player.YAccel = 2;
_root.Player.PendingAnim = 0;
_root.Player.IsFiring = 0;
_root.Player.MissileDelay = 0;
_root.Player.AmmoMax0 = 0;
_root.Player.AmmoMax1 = 0;
_root.Player.AmmoMax2 = 0;
_root.Player.AmmoMax3 = 0;
_root.Player.AmmoMax4 = 0;
_root.Player.AmmoMax5 = 0;
_root.Player.AmmoMax6 = 0;
_root.Player.Speed = 0;
_root.Player.Manuv = 0;
_root.Player.Shield = 0;
_root.Player.Flip = 0;
_root.hitTransform = new Object();
_root.hitTransform = {ra:"100", rb:"150", ga:"0", gb:"0", ba:"0", bb:"0", aa:"100", ab:"0"};
_root.healTransform = new Object();
_root.healTransform = {ra:"0", rb:"0", ga:"100", gb:"150", ba:"0", bb:"0", aa:"100", ab:"0"};
_root.normTransform = new Object();
_root.normTransform = {ra:"100", rb:"0", ga:"100", gb:"0", ba:"100", bb:"0", aa:"100", ab:"0"};
_root.World = {};
_root.World.XLandSpeed = 0;
_root.World.YLandSpeed = 0;
_root.World.Friction = 0;
_root.World.FrictionConstant = 0;
_root.World.BGToggle = 0;
var _local2 = _root.attachMovie("Me", "Me", _root.MEDEPTH);
_local2._x = 1000;
_local2._y = 1000;
_local2._visible = false;
i = 0;
while (i < 35) {
_root["Fire" + i].extent = Math.sqrt((_root["Fire" + i]._width * _root["Fire" + i]._width) + (_root["Fire" + i]._height * _root["Fire" + i]._height)) / 2;
_root["Fire" + i]._visible = false;
_root["Fire" + i].stop();
i++;
}
_root.Missiles = new Array();
_root.MissileMoveFuncs = new Array();
i = 0;
while (i < _root.MAXMISSILES) {
_local2 = _root.Fire0.duplicateMovieClip("Missile" + i, _root.MISSILEDEPTH + i);
_local2.extent = _root.Fire0.extent;
_local2.Num = 0;
_root.Missiles[i] = _local2;
_local2.index = i;
_local2.Status = 0;
_local2.VampDamage = 0;
_local2.Damage = 0;
_local2.NumHits = 0;
_local2.Buffer = 0;
_local2.XSpeed = 0;
_local2.YSpeed = 0;
_local2.XVel = 0;
_local2.YVel = 0;
_local2.XAccel = 0;
_local2.YAccel = 0;
_local2._x = 1000;
_local2._y = 1000;
_local2._visible = false;
i++;
}
_root.EnemyMissiles = new Array();
_root.EnemyMissileMoveFuncs = new Array();
i = 0;
while (i < _root.MAXENEMYMISSILES) {
_local2 = _root.Fire0.duplicateMovieClip("EnemyMissile" + i, _root.ENEMYMISSILEDEPTH + i);
_local2.extent = _root.Fire0.extent;
_local2.Num = 0;
_root.EnemyMissiles[i] = _local2;
_local2.index = i;
_local2.Status = 0;
_local2.VampDamage = 0;
_local2.Damage = 0;
_local2.NumHits = 0;
_local2.Buffer = 0;
_local2.XSpeed = 0;
_local2.YSpeed = 0;
_local2.XVel = 0;
_local2.YVel = 0;
_local2.XAccel = 0;
_local2.YAccel = 0;
_local2._x = 1000;
_local2._y = 1000;
_local2._visible = false;
i++;
}
_root.Enemies = new Array();
_root.EnemyMoveFuncs = new Array();
i = 1;
while (i < 5) {
_root["Cloud" + i]._visible = false;
_root["Cloud" + i].stop();
i++;
}
_root.Clouds = new Array();
i = 0;
while (i < _root.MAXCLOUDS) {
_local2 = _root["Cloud" + ((i % 4) + 1)].duplicateMovieClip("skycloud" + i, _root.CLOUDDEPTH + i);
_local2.extent = 182;
_local2._x = 1000;
_local2._y = 1000;
_local2._visible = false;
_root.Clouds[i] = _local2;
i++;
}
_root.attachMovie("statusbar", "statusbar1", _root.STATUSDEPTH);
_root.statusbar1.level_txt.embedFonts = true;
_root.statusbar1._x = 0;
_root.statusbar1._y = 462;
}
function PurchaseWeapon() {
UpdateStatusBar();
if (_root.Player.Gold < _root.WEAPONCOSTS[_root.SelectedWeapon]) {
_root.DisplayMessage("You do not have enough gold.");
return(undefined);
}
if (_root.SelectedWeapon < 28) {
indi = int(_root.SelectedWeapon / 4);
whichi = _root.SelectedWeapon % 4;
if (whichi > _root.Player["AmmoMax" + indi]) {
if (_root.SelectedWeapon < 24) {
_root.DisplayMessage("You cannot purchase this spell until you own the one before it.");
} else {
_root.DisplayMessage("You cannot purchase this health upgrade until you own the one before it.");
}
return(undefined);
}
if (whichi != _root.Player["AmmoMax" + indi]) {
if (_root.SelectedWeapon < 24) {
_root.DisplayMessage("You already have this spell.");
} else {
_root.DisplayMessage("You already have this health upgrade.");
}
return(undefined);
}
_root.Player.Gold = _root.Player.Gold - _root.WEAPONCOSTS[_root.SelectedWeapon];
_root.Player["AmmoMax" + indi]++;
if (_root.SelectedWeapon < 24) {
_root.SetAmmo(_root.SelectedWeapon);
} else if (_root.SelectedWeapon == 24) {
_root.Player.Health = (_root.Player.MaxHealth = 100);
} else if (_root.SelectedWeapon == 25) {
_root.Player.Health = (_root.Player.MaxHealth = 200);
} else if (_root.SelectedWeapon == 26) {
_root.Player.Health = (_root.Player.MaxHealth = 350);
} else if (_root.SelectedWeapon == 27) {
_root.Player.Health = (_root.Player.MaxHealth = 600);
}
} else if (_root.SelectedWeapon == 28) {
if (_root.Player.Speed == 1) {
_root.DisplayMessage("You already have extra top speed.");
return(undefined);
}
_root.Player.Gold = _root.Player.Gold - _root.WEAPONCOSTS[_root.SelectedWeapon];
_root.Player.MaxSpeed = 18;
_root.Player.Speed = 1;
} else if (_root.SelectedWeapon == 29) {
if (_root.Player.Manuv == 1) {
_root.DisplayMessage("You already have better maneuverability.");
return(undefined);
}
_root.Player.Gold = _root.Player.Gold - _root.WEAPONCOSTS[_root.SelectedWeapon];
_root.Player.XAccel = 3;
_root.Player.YAccel = 3;
_root.Player.Manuv = 1;
} else if (_root.SelectedWeapon == 30) {
if (_root.Player.Shield == 1) {
_root.DisplayMessage("You already have force shielding.");
return(undefined);
}
_root.Player.Gold = _root.Player.Gold - _root.WEAPONCOSTS[_root.SelectedWeapon];
_root.Player.Shield = 1;
_root.Me.attachMovie("ForceField", "ForceField", _root.Me.getNextHighestDepth());
} else if (_root.SelectedWeapon == 31) {
if (_root.Player.Flip == 1) {
_root.DisplayMessage("You already have this ability.");
return(undefined);
}
_root.Player.Gold = _root.Player.Gold - _root.WEAPONCOSTS[_root.SelectedWeapon];
_root.Player.Flip = 1;
}
_root.DisplayMessage("Purchase complete.");
UpdateStatusBar();
}
function DisplayMessage(thamessage) {
var _local2 = _root.attachMovie("TmpMessage", "msg" + _root.NumMessages, _root.HIGHESTDEPTH + _root.NumMessages);
_local2.msg_mc.msg.text = thamessage;
_local2._x = 350;
_local2._y = 275;
_root.NumMessages++;
_local2.gotoAndPlay(1);
}
function UnDisplayWeapon() {
_root.DisplayWeapon1.removeMovieClip();
}
function DisplayWeapon(weap) {
_root.SelectedWeapon = weap;
UnDisplayWeapon();
_root["Fire" + _root.SelectedWeapon].duplicateMovieClip("DisplayWeapon1", _root.STATUSDEPTH + 1);
_root.DisplayWeapon1._xscale = _root.DisplayWeapon1._xscale / 1.75;
_root.DisplayWeapon1._yscale = _root.DisplayWeapon1._yscale / 1.75;
_root.DisplayWeapon1._x = 355;
_root.DisplayWeapon1._y = 140;
if (_root.SelectedWeapon < 4) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y - 8;
} else if ((_root.SelectedWeapon == 4) || (_root.SelectedWeapon == 6)) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 4;
} else if (_root.SelectedWeapon < 8) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y - 0;
} else if (_root.SelectedWeapon < 12) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 4;
} else if (_root.SelectedWeapon < 15) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 0;
} else if (_root.SelectedWeapon < 16) {
_root.DisplayWeapon1._x = _root.DisplayWeapon1._x + 4;
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 10;
} else if (_root.SelectedWeapon < 20) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 4;
} else if (_root.SelectedWeapon < 24) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 5;
} else if (_root.SelectedWeapon < 28) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 6;
} else if (_root.SelectedWeapon < 32) {
_root.DisplayWeapon1._y = _root.DisplayWeapon1._y + 6;
}
_root.cost_txt.text = _root.WEAPONCOSTS[_root.SelectedWeapon];
_root.weapon_txt.text = _root.WEAPONTEXTS[_root.SelectedWeapon];
}
function UpdateStatusBar() {
if (_root.Player.Health < 1) {
_root.statusbar1.LifeMeter1._visible = false;
if (_root.Dead == 0) {
_root.Dead = 1;
_root.DeadTimer = 40;
_root.Player.Lives--;
_root.Me.gotoAndPlay(162);
_root.Player.Health = -1000000;
}
} else {
lifeperc = int((_root.Player.Health / _root.Player.MaxHealth) * 100);
if (lifeperc < 1) {
lifeperc = 1;
}
_root.statusbar1.LifeMeter1._visible = true;
if (lifeperc > 100) {
_root.Player.Health = _root.Player.MaxHealth;
lifeperc = 100;
}
_root.statusbar1.LifeMeter1.gotoAndStop(lifeperc);
}
_root.statusbar1.gold_txt.text = _root.Player.Gold;
if (_root.Player.Lives > 3) {
_root.statusbar1.Life4._visible = true;
} else {
_root.statusbar1.Life4._visible = false;
}
if (_root.Player.Lives > 2) {
_root.statusbar1.Life3._visible = true;
} else {
_root.statusbar1.Life3._visible = false;
}
if (_root.Player.Lives > 1) {
_root.statusbar1.Life2._visible = true;
} else {
_root.statusbar1.Life2._visible = false;
}
if (_root.Player.Lives > 0) {
_root.statusbar1.Life1._visible = true;
} else {
_root.statusbar1.Life1._visible = false;
}
if (_root.Player.AmmoMax6 > 3) {
_root.statusbar1.Health4._visible = true;
} else {
_root.statusbar1.Health4._visible = false;
}
if (_root.Player.AmmoMax6 > 2) {
_root.statusbar1.Health3._visible = true;
} else {
_root.statusbar1.Health3._visible = false;
}
if (_root.Player.AmmoMax6 > 1) {
_root.statusbar1.Health2._visible = true;
} else {
_root.statusbar1.Health2._visible = false;
}
if (_root.Player.AmmoMax6 > 0) {
_root.statusbar1.Health1._visible = true;
} else {
_root.statusbar1.Health1._visible = false;
}
_root.statusbar1.level_txt.text = _root.Level + 1;
}
function RWK() {
if (_root.CantSend) {
_root.DisplayMessage("You can only submit your gold transfer once.");
return(undefined);
}
servernum = int(_root.server_txt.text);
if ((servernum != 1) && (servernum != 2)) {
_root.DisplayMessage("Invalid Server Number");
return(undefined);
}
delete _root.Sender;
_root.Sender = new LoadVars();
delete _root.Shit;
_root.Shit = new LoadVars();
theurl = ((((((((((((((((((((((((((("http://rwk" + servernum) + ".racewarkingdoms.com/cgi-bin/rwk.cgi?wiz") + _root.playername_txt.text) + "|") + _root.Player.Gold) + "|") + _root.Player.AmmoMax0) + ",") + _root.Player.AmmoMax1) + ",") + _root.Player.AmmoMax2) + ",") + _root.Player.AmmoMax3) + ",") + _root.Player.AmmoMax4) + ",") + _root.Player.AmmoMax5) + ",") + _root.Player.AmmoMax6) + ",") + _root.Player.Speed) + ",") + _root.Player.Manuv) + ",") + _root.Player.Shield) + ",") + _root.Player.Flip) + ",";
_root.Sender.sendAndLoad(theurl, _root.Shit, "POST");
_root.DisplayMessage("Message Sent to RWK Server");
_root.CantSend = 1;
}
function SlowClear() {
DisplayWeapon(0);
UpdateStatusBar();
_root.main_mc.main_txt.text = _root.LEVELTEXTS[_root.Level];
_quality = "LOW";
_quality = "MEDIUM";
_quality = "HIGH";
clearInterval(_root.interv);
}
function ClearStuff() {
_root.loop2.gotoAndPlay(3);
if (_root.Mute == 0) {
_root.loop1.gotoAndPlay(2);
}
it = _root.Me;
it._x = 1000;
it._y = 1000;
it._visible = false;
it.clip.stop();
it.clip._visible = false;
if (it.clip2) {
it.clipe2.removeMovieClip();
}
it.clip.duplicateMovieClip("clip2", it.MovieClip.getNextHighestDepth());
it.clip2.stop();
it.clip2._visible = false;
it.clip2._xscale = (100 * (it.clip2._width + (_root.PIXELBUFFER * 2))) / it.clip2._width;
it.clip2._yscale = (100 * (it.clip2._height + (_root.PIXELBUFFER * 2))) / it.clip2._height;
i = 0;
while (i < _root.MAXMISSILES) {
it = _root.Missiles[i];
it._x = 1000;
it._y = 1000;
it._visible = false;
i++;
}
i = 0;
while (i < _root.MAXENEMYMISSILES) {
it = _root.EnemyMissiles[i];
it._x = 1000;
it._y = 1000;
it._visible = false;
i++;
}
i = 0;
while (i < _root.MAXENEMIES) {
dead = 0;
it = _root.Enemies[i];
if (it.Status == 1) {
_root.RemoveEnemy(it);
}
i++;
}
i = 0;
while (i < _root.MAXCLOUDS) {
it = _root.Clouds[i];
it._rotation = 360 * Math.random();
it._x = (it.extent / 2) + ((700 - it.extent) * Math.random());
it._y = 550 * Math.random();
it._visible = false;
i++;
}
if (_root.bga) {
_root.bga.removeMovieClip();
}
if (_root.bgb) {
_root.bgb.removeMovieClip();
}
}
function Clear() {
_root.cost_txt.embedFonts = true;
_root.weapon_txt.embedFonts = true;
_root.main_mc.main_txt.embedFonts = true;
_root.Dead = 0;
_root.Player.Health = _root.Player.MaxHealth;
_root.ClearStuff();
_root.interv = setInterval(_root.SlowClear, 200);
}
function ResetEnemies(LevelIndex) {
_root.NewLevelStage = 0;
_root.EnemyDelay1 = 0;
_root.EnemyDelay2 = 0;
_root.EnemyDelay3 = 0;
_root.World.XLandSpeed = _root.XLANDSPEEDS[LevelIndex];
_root.World.YLandSpeed = _root.YLANDSPEEDS[LevelIndex];
_root.World.Friction = _root.FRICTIONS[LevelIndex];
_root.World.FrictionConstant = _root.FRICTIONCONS[LevelIndex];
i = 0;
while (i < _root.MAXENEMIES) {
_root.Enemies[i].removeMovieClip();
if (_root["ENEMYTYPES" + int((i / (_root.MAXENEMIES / 3)) + 1)][LevelIndex] > 10) {
it = _root.attachMovie("E" + _root["ENEMYTYPES" + int((i / (_root.MAXENEMIES / 3)) + 1)][LevelIndex], "Enemy" + i, _root.ENEMYDEPTH2 + (i * 2));
} else {
it = _root.attachMovie("E" + _root["ENEMYTYPES" + int((i / (_root.MAXENEMIES / 3)) + 1)][LevelIndex], "Enemy" + i, _root.ENEMYDEPTH + (i * 2));
}
it._x = 1000;
it._y = 1000;
it._visible = false;
it.index = i;
it.Status = 0;
it.Gold = 0;
it.Health = (it.MaxHealth = 0);
it.DeathMovie = "BloodCloud";
it.AirCollide = 0;
it.Regeneration = 0;
it.XSpeed = 0;
it.YSpeed = 0;
it.XVel = 0;
it.YVel = 0;
it.XAccel = 0;
it.YAccel = 0;
it.extent = Math.sqrt((it._width * it._width) + (it._height * it._height)) / 2;
it._x = 1000;
it._y = 1000;
it.clip.stop();
it.clip._visible = false;
if (it.clip2) {
it.clipe2.removeMovieClip();
}
it.clip.duplicateMovieClip("clip2", it.MovieClip.getNextHighestDepth());
it.clip2.stop();
it.clip2._visible = false;
it.clip2._xscale = (100 * (it.clip2._width + (_root.PIXELBUFFER * 2))) / it.clip2._width;
it.clip2._yscale = (100 * (it.clip2._height + (_root.PIXELBUFFER * 2))) / it.clip2._height;
_root.Enemies[i] = it;
i++;
}
}
function PreUpdate() {
_root.Pause = 0;
_quality = "LOW";
_root.loop1.gotoAndPlay(1);
if (_root.Mute != 1) {
_root.loop2.gotoAndPlay(3);
_root.loop2.removeMovieClip();
_root.attachMovie("battle" + int((Math.random() * 5) + 1), "loop2", _root.MUSICDEPTH);
_root.loop2.gotoAndPlay(2);
}
UnDisplayWeapon();
_root.LevelStage = 0;
_root.LevelTimer = 0;
_root.GameTimer = 0;
_root.SelectedWeapon = 0;
_root.SoundDelay = 0;
_root.FlipDelay = 0;
_root.EnemyDelay1 = 0;
_root.EnemyDelay2 = 0;
_root.EnemyDelay3 = 0;
_root.Player.MissileDelay = 0;
_root.Me._visible = true;
_root.Me._x = 350 - (_root.Me._width / 2);
_root.Me._y = 275;
_root.attachMovie("bg" + _root.BGS[_root.Level], "bga", _root.BACKGROUNDDEPTH);
_root.bga._x = 0;
_root.bga._y = -850;
_root.attachMovie("bg" + _root.BGS[_root.Level], "bgb", _root.BACKGROUNDDEPTH + 1);
_root.bgb._x = 0;
_root.bgb._y = -2250;
_root.ResetEnemies((_root.Level * 6) + _root.LevelStage);
}
function UpdatePlayerFrame() {
if (_root.Dead) {
return(undefined);
}
if (_root.Player.PendingAnim) {
if (_root.Player.IsFiring && (_root.Player.PendingAnim == 51)) {
_root.Me.gotoAndPlay(_root.Player.PendingAnim + 25);
} else {
_root.Me.gotoAndPlay(_root.Player.PendingAnim);
}
_root.Player.PendingAnim = 0;
} else if (_root.Player.IsFiring) {
_root.Me.gotoAndPlay(26);
} else {
_root.Me.gotoAndPlay(1);
}
}
function Update() {
if (_root.Pause == 1) {
if (Math.random() < 0.02) {
_quality = "HIGH";
_root.DisplayMessage("Press \"P\" to unpause.");
}
return(undefined);
}
UpdateStatusBar();
_root.GameTimer++;
if (_root.Me.hot != 0) {
myColor = new Color(_root.Me);
myColor.setTransform(_root.normTransform);
delete myColor;
_root.Me.hot = 0;
}
if (_root.Dead) {
_root.DeadTimer--;
if (_root.DeadTimer <= 0) {
if (_root.Player.Lives <= -1) {
if (!_root.BlackOut1) {
_root.attachMovie("BlackOut", "BlackOut1", _root.HIGHESTDEPTH - 1);
} else if (_root.BlackOut1._currentframe == 25) {
_root.BlackOut1.removeMovieClip();
if (_root.Player.Lives < 0) {
_root.ClearStuff();
gotoAndStop ("DeadFrame");
return(undefined);
}
gotoAndStop ("UpgradeFrame");
return(undefined);
}
} else {
_root.Dead = 0;
_root.Player.Health = _root.Player.MaxHealth;
_root.Me.gotoAndPlay(101);
}
}
} else {
if (_root.NewLevelStage == 0) {
_root.LevelTimer = _root.LevelTimer + _root.SpeedUp;
}
if (_root.LevelTimer > 5000) {
if (_root.LevelStage != 5) {
_root.NewLevelStage = 1;
_root.LevelStage = 5;
} else if ((_root.LevelTimer > 6000) && (_root.NumEnemies == 0)) {
if (!_root.BlackOut1) {
_root.attachMovie("BlackOut", "BlackOut1", _root.HIGHESTDEPTH - 1);
} else if (_root.BlackOut1._currentframe == 25) {
_root.BlackOut1.removeMovieClip();
_root.Level++;
if (_root.Level == 6) {
_root.Player.Gold = _root.Player.Gold + 5000;
} else if (_root.Level > 6) {
_root.Player.Gold = _root.Player.Gold + 1000;
} else {
_root.Player.Gold = _root.Player.Gold + 250;
}
if (_root.Level == 13) {
_root.ClearStuff();
gotoAndStop ("WonFrame");
return(undefined);
}
gotoAndStop ("UpgradeFrame");
return(undefined);
}
}
} else if (_root.LevelTimer > 3700) {
if (_root.LevelStage != 4) {
_root.NewLevelStage = 1;
_root.LevelStage = 4;
}
} else if (_root.LevelTimer > 2800) {
if (_root.LevelStage != 3) {
_root.NewLevelStage = 1;
_root.LevelStage = 3;
}
} else if (_root.LevelTimer > 1500) {
if (_root.LevelStage != 2) {
_root.NewLevelStage = 1;
_root.LevelStage = 2;
}
} else if (_root.LevelTimer > 500) {
if (_root.LevelStage != 1) {
_root.NewLevelStage = 1;
_root.LevelStage = 1;
}
}
}
LevelIndex = (_root.Level * 6) + _root.LevelStage;
CurTime = getTimer();
if (_root.LastUpdate && ((CurTime - _root.LastUpdate) > 60)) {
_root.SlowCount = _root.SlowCount + ((CurTime - _root.LastUpdate) / 60);
} else {
_root.SlowCount = _root.SlowCount / 2;
}
_root.LastUpdate = CurTime;
UpOrDown = 0;
LeftOrRight = 0;
if (_root.Dead != 1) {
if (Key.isDown(38)) {
UpOrDown++;
}
if (Key.isDown(40)) {
UpOrDown--;
}
if (Key.isDown(37)) {
LeftOrRight++;
}
if (Key.isDown(39)) {
LeftOrRight--;
}
}
if (UpOrDown == 1) {
if (LeftOrRight) {
_root.Player.YVel = _root.Player.YVel - (_root.Player.YAccel * 0.707);
} else {
_root.Player.YVel = _root.Player.YVel - _root.Player.YAccel;
}
} else if (UpOrDown == -1) {
if (LeftOrRight) {
_root.Player.YVel = _root.Player.YVel + (_root.Player.YAccel * 0.707);
} else {
_root.Player.YVel = _root.Player.YVel + _root.Player.YAccel;
}
}
if (LeftOrRight == 1) {
if (UpOrDown) {
_root.Player.XVel = _root.Player.XVel - (_root.Player.XAccel * 0.707);
} else {
_root.Player.XVel = _root.Player.XVel - _root.Player.XAccel;
}
} else if (LeftOrRight == -1) {
if (UpOrDown) {
_root.Player.XVel = _root.Player.XVel + (_root.Player.XAccel * 0.707);
} else {
_root.Player.XVel = _root.Player.XVel + _root.Player.XAccel;
}
}
TrueSpeed = Math.sqrt((_root.Player.XVel * _root.Player.XVel) + (_root.Player.YVel * _root.Player.YVel));
if (TrueSpeed > _root.Player.MaxSpeed) {
_root.Player.XVel = (_root.Player.XVel / TrueSpeed) * _root.Player.MaxSpeed;
_root.Player.YVel = (_root.Player.YVel / TrueSpeed) * _root.Player.MaxSpeed;
TrueSpeed = _root.Player.MaxSpeed;
}
_root.Me._x = Math.min(Math.max((_root.Me._x + _root.Player.XVel) + (_root.World.XLandSpeed * 3), 20), 680);
_root.Me._y = Math.min(Math.max((_root.Me._y + _root.Player.YVel) + _root.World.YLandSpeed, 20), 500);
if (TrueSpeed > 0.05) {
NewMaxSpeed = Math.max(TrueSpeed - ((_root.World.Friction * TrueSpeed) + _root.World.FrictionConstant), 0);
if (_root.Dead) {
NewMaxSpeed = NewMaxSpeed / 2;
}
_root.Player.XVel = (_root.Player.XVel / TrueSpeed) * NewMaxSpeed;
_root.Player.YVel = (_root.Player.YVel / TrueSpeed) * NewMaxSpeed;
} else {
_root.Player.XVel = 0;
_root.Player.YVel = 0;
}
if (_root.Player.Manuv) {
if (UpOrDown == 0) {
_root.Player.YVel = _root.Player.YVel / 1.5;
}
if (LeftOrRight == 0) {
_root.Player.XVel = _root.Player.XVel / 1.5;
}
}
if ((_root.Dead != 1) && (Key.isDown(32))) {
if ((_root.NumMissiles < _root.MAXMISSILES) && (_root.Player.MissileDelay <= _root.GameTimer)) {
_root.Player.MissileDelay = _root.GameTimer + _root.Player.MissileInterval;
it = FindBlankMissile();
if (it) {
if (it.Num != _root.Player.MissileNum) {
index = it.index;
it.removeMovieClip();
it = _root["Fire" + _root.Player.MissileNum].duplicateMovieClip("Missile" + i, _root.MISSILEDEPTH + i);
it.extent = _root["Fire" + _root.Player.MissileNum].extent;
it.Num = _root.Player.MissileNum;
_root.Missiles[index] = it;
it.index = index;
}
it.gotoAndPlay(1);
it.Status = 1;
if (_root.Player.MissileNum == 13) {
if (_root.FireOsc2) {
_root.Player.MissileXStartVel = -3;
it._rotation = -12;
_root.FireOsc2 = 0;
} else {
_root.Player.MissileXStartVel = 3;
it._rotation = 12;
_root.FireOsc2 = 1;
}
} else if (_root.Player.MissileNum == 14) {
if (_root.FireOsc4 == 0) {
_root.Player.MissileXStartVel = -5;
_root.FireOsc4 = 1;
} else if (_root.FireOsc4 == 1) {
_root.Player.MissileXStartVel = -2;
_root.FireOsc4 = 2;
} else if (_root.FireOsc4 == 2) {
_root.Player.MissileXStartVel = 2;
_root.FireOsc4 = 3;
} else {
_root.Player.MissileXStartVel = 5;
_root.FireOsc4 = 0;
}
} else if (_root.Player.MissileNum == 16) {
if (Math.random() > 0.5) {
_root.Player.MissileXStartVel = 10;
} else {
_root.Player.MissileXStartVel = -10;
}
_root.Player.MissileYStartVel = (Math.random() - 0.5) * 2;
} else if (_root.Player.MissileNum == 17) {
_root.Player.MissileYStartVel = (Math.random() - 0.5) * 2;
} else if (_root.Player.MissileNum == 18) {
_root.Player.MissileYStartVel = (Math.random() - 0.5) * 2;
} else if (_root.Player.MissileNum == 19) {
_root.Player.MissileXStartVel = (Math.random() - 0.5) * 15;
_root.Player.MissileYStartVel = (Math.random() - 0.5) * 15;
} else if (_root.Player.MissileNum == 21) {
if (_root.FireOsc2) {
_root.Player.MissileXAccel = -0.35;
_root.FireOsc2 = 0;
} else {
_root.Player.MissileXAccel = 0.35;
_root.FireOsc2 = 1;
}
} else if (_root.Player.MissileNum == 22) {
if (_root.FireOsc2) {
_root.Player.MissileXAccel = -0.35;
_root.FireOsc2 = 0;
} else {
_root.Player.MissileXAccel = 0.35;
_root.FireOsc2 = 1;
}
} else if (_root.Player.MissileNum == 23) {
if (_root.FireOsc2) {
_root.Player.MissileXAccel = -0.25;
_root.FireOsc2 = 0;
} else {
_root.Player.MissileXAccel = 0.25;
_root.FireOsc2 = 1;
}
}
it.NumHits = _root.Player.MissileNumHits;
it.VampDamage = _root.Player.MissileVampDamage;
it.Damage = _root.Player.MissileDamage;
it.Buffer = _root.Player.MissileBuffer;
it.XSpeed = _root.Player.MissileXSpeed;
it.YSpeed = _root.Player.MissileYSpeed;
it.XVel = _root.Player.MissileXStartVel;
it.YVel = _root.Player.MissileYStartVel;
it.XAccel = _root.Player.MissileXAccel;
it.YAccel = _root.Player.MissileYAccel;
_root.MissileMoveFuncs[it.index] = _root.Player.MissileMoveFunc;
it._x = _root.Me._x + 7;
if ((_root.Player.MissileNum > 19) && (_root.Player.MissileNum < 23)) {
it._y = _root.Me._y - 20;
} else {
it._y = _root.Me._y - 50;
}
if (_root.SoundDelay <= _root.GameTimer) {
_root.SoundDelay = _root.GameTimer + 8;
if (!it.sound) {
it.sound = new Sound();
}
it.sound.attachSound(_root.Player.MissileSound);
it.sound.start();
}
it._visible = true;
_root.NumMissiles++;
}
}
if (_root.Player.IsFiring != 1) {
if (_root.Me._currentframe < 26) {
_root.Me.gotoAndPlay(_root.Me._currentframe + 25);
} else if ((_root.Me._currentframe > 50) && (_root.Me._currentframe < 76)) {
_root.Me.gotoAndPlay(_root.Me._currentframe + 25);
}
_root.Player.IsFiring = 1;
}
} else if (_root.Player.IsFiring) {
if ((_root.Me._currentframe > 25) && (_root.Me._currentframe < 51)) {
_root.Me.gotoAndPlay(_root.Me._currentframe - 25);
} else if ((_root.Me._currentframe > 75) && (_root.Me._currentframe < 101)) {
_root.Me.gotoAndPlay(_root.Me._currentframe - 25);
}
_root.Player.IsFiring = 0;
}
if (LeftOrRight || (UpOrDown)) {
if (_root.Me._currentframe < 51) {
_root.Player.PendingAnim = 51;
UpdatePlayerFrame();
} else if (_root.Player.PendingAnim == 0) {
_root.Player.PendingAnim = 51;
}
} else if (_root.Player.PendingAnim == 51) {
_root.Player.PendingAnim = 0;
}
i = 0;
while (i < _root.MAXMISSILES) {
it = _root.Missiles[i];
if (it.Status == 1) {
_root.MissileMoveFuncs[i](it);
if (OffScreen(it)) {
RemoveMissile(it);
}
}
i++;
}
Regen = 0;
if ((_root.GameTimer % 24) == 0) {
if (_root.FlipDelay > 0) {
_root.FlipDelay--;
}
Regen = 1;
if (_root.Level == 8) {
myColor = new Color(_root.Me);
myColor.setTransform(_root.hitTransform);
delete myColor;
_root.Me.hot = 1;
_root.Player.Health = _root.Player.Health - (8 / _root.SpeedUp);
} else if (_root.Level == 9) {
myColor = new Color(_root.Me);
myColor.setTransform(_root.hitTransform);
delete myColor;
_root.Me.hot = 1;
_root.Player.Health = _root.Player.Health - (12 / _root.SpeedUp);
}
}
if (((_root.NewLevelStage == 1) && (_root.NumEnemies == 0)) && (_root.NumEnemyMissiles == 0)) {
_root.ResetEnemies(LevelIndex);
}
i = 0;
for ( ; i < _root.MAXENEMIES ; i++) {
dead = 0;
it = _root.Enemies[i];
if (it.Status == 1) {
_root.EnemyMoveFuncs[i](it);
if (it.hot != 0) {
myColor = new Color(it);
myColor.setTransform(_root.normTransform);
delete myColor;
it.hot = 0;
}
if (it.EnemyNum == 10) {
difx = it._x - _root.Me._x;
dify = it._y - _root.Me._y;
distance = Math.sqrt((difx * difx) + (dify * dify));
if (distance < 1) {
distance = 1;
}
_root.Player.XVel = _root.Player.XVel + (((difx / distance) / distance) * 300);
_root.Player.YVel = _root.Player.YVel + (((dify / distance) / distance) * 300);
}
if (OffScreen(it)) {
_root.RemoveEnemy(it);
continue;
}
if (it.EnemyNum == 13) {
it.weapon._rotation = it.weapon._rotation + 3;
} else if (it.EnemyNum == 16) {
if (it.weapon.direction == 1) {
it.weapon._rotation = it.weapon._rotation + 3;
} else {
it.weapon.direction = 0;
it.weapon._rotation = it.weapon._rotation - 3;
}
if (Math.random() > 0.95) {
it.weapon.direction = !it.weapon.direction;
}
} else if (it.EnemyNum == 14) {
if (it.weapon.direction == 1) {
it.weapon._rotation = it.weapon._rotation + 1;
if (it.weapon._rotation > 25) {
it.weapon.direction = 0;
}
} else {
it.weapon.direction = 0;
it.weapon._rotation = it.weapon._rotation - 1;
if (it.weapon._rotation < -25) {
it.weapon.direction = 1;
}
}
}
if (it.MissileDelay) {
it.MissileTimer--;
if (it.MissileTimer <= 0) {
it.MissileTimer = it.MissileDelay;
if (_root.NumEnemyMissiles < _root.MAXENEMYMISSILES) {
it2 = FindBlankEnemyMissile();
if (it2) {
if (it2.Num != it.MissileNum) {
index = it2.index;
it2.removeMovieClip();
it2 = _root["Fire" + it.MissileNum].duplicateMovieClip("EnemyMissile" + i, _root.ENEMYMISSILEDEPTH + i);
it2.extent = _root["Fire" + it.MissileNum].extent;
it2.Num = it.MissileNum;
_root.EnemyMissiles[index] = it2;
it2.index = index;
}
it2.gotoAndPlay(1);
it2.Status = 1;
if (it.weapon) {
it.weapon.gotoAndPlay(1);
}
if (it.MissileBehave == 0) {
it2._rotation = it._rotation + 180;
it2.XVel = -10 * Math.cos((Math.PI/180) * (it2._rotation + 90));
it2.YVel = -10 * Math.sin((Math.PI/180) * (it2._rotation + 90));
it2.Damage = it.MissileDam;
it2.XSpeed = 0;
it2.YSpeed = 0;
it2.XAccel = 0;
it2.YAccel = 0;
_root.EnemyMissileMoveFuncs[it2.index] = _root.FixedVel;
} else if (it.MissileBehave == 1) {
it2._rotation = it.weapon._rotation + 180;
it2.XVel = -10 * Math.cos((Math.PI/180) * (it2._rotation + 90));
it2.YVel = -10 * Math.sin((Math.PI/180) * (it2._rotation + 90));
it2.Damage = it.MissileDam;
it2.XSpeed = 0;
it2.YSpeed = 0;
it2.XAccel = 0;
it2.YAccel = 0;
_root.EnemyMissileMoveFuncs[it2.index] = _root.FixedVel;
} else if (it.MissileBehave == 2) {
it2._rotation = it._rotation + 180;
it2.XVel = -18 * Math.cos((Math.PI/180) * (it2._rotation + 90));
it2.YVel = -18 * Math.sin((Math.PI/180) * (it2._rotation + 90));
it2.Damage = it.MissileDam;
it2.XSpeed = 0;
it2.YSpeed = 0;
it2.XAccel = 0;
it2.YAccel = 0;
_root.EnemyMissileMoveFuncs[it2.index] = _root.FixedVel;
} else {
it2._rotation = it.weapon._rotation + 180;
it2.XVel = -18 * Math.cos((Math.PI/180) * (it2._rotation + 90));
it2.YVel = -18 * Math.sin((Math.PI/180) * (it2._rotation + 90));
it2.Damage = it.MissileDam;
it2.XSpeed = 0;
it2.YSpeed = 0;
it2.XAccel = 0;
it2.YAccel = 0;
_root.EnemyMissileMoveFuncs[it2.index] = _root.FixedVel;
}
it2._x = it._x;
it2._y = it._y;
if (it2.Num == 33) {
it2._x = it2._x + (-20 * Math.cos((Math.PI/180) * (it2._rotation + 90)));
it2._y = it2._y + (-20 * Math.sin((Math.PI/180) * (it2._rotation + 90)));
} else if (it2.Num == 34) {
it2._x = it2._x + (-20 * Math.cos((Math.PI/180) * (it2._rotation + 90)));
it2._y = it2._y + (-20 * Math.sin((Math.PI/180) * (it2._rotation + 90)));
}
it2._visible = true;
_root.NumEnemyMissiles++;
}
}
}
}
if ((_root.Dead != 1) && (_root.Me._currentframe < 101)) {
hit = it.clip;
hit2 = it.clip2;
x = 0;
while (x < _root.MAXMISSILES) {
if (_root.Missiles[x].Status == 0) {
} else {
it2 = _root.Missiles[x];
result = 0;
if (it2.Buffer == 0) {
result = hit.hitTest(it2._x, it2._y, true);
} else {
result = hit2.hitTest(it2._x, it2._y, true);
}
if (result) {
if ((it2.VampDamage > 0) && (it.Health > 0)) {
myColor = new Color(_root.Me);
myColor.setTransform(_root.healTransform);
delete myColor;
_root.Me.hot = 1;
if (it2.VampDamage > it.Health) {
_root.Player.Health = _root.Player.Health + it.Health;
} else {
_root.Player.Health = _root.Player.Health + it2.VampDamage;
}
it.Health = it.Health - it2.VampDamage;
}
it.Health = it.Health - it2.Damage;
it2.NumHits--;
if (CheckEnemyDeath(it)) {
dead = 1;
} else {
myColor = new Color(it);
myColor.setTransform(_root.hitTransform);
delete myColor;
it.hot = 1;
}
if (it2.NumHits <= 0) {
RemoveMissile(it2);
}
if (dead) {
break;
}
}
}
x++;
}
if (dead) {
continue;
}
if (it.AirCollide && (hit.hitTest(_root.Me._x, _root.Me._y, true))) {
if (_root.Player.Shield == 1) {
_root.Player.Health = _root.Player.Health - int(it.Health * Math.random());
} else {
_root.Player.Health = _root.Player.Health - it.Health;
}
myColor = new Color(_root.Me);
myColor.setTransform(_root.hitTransform);
delete myColor;
_root.Me.hot = 1;
if (_root.Player.Health > 0) {
it.Health = 0;
if (CheckEnemyDeath(it)) {
dead = 1;
}
}
}
if (dead) {
} else {
if (Regen && (it.Regeneration)) {
myColor = new Color(it);
myColor.setTransform(_root.healTransform);
delete myColor;
it.hot = 1;
it.Health = it.Health + it.Regeneration;
if (it.Health > it.MaxHealth) {
it.Health = it.MaxHealth;
}
}
continue;
if ((_root.NewLevelStage == 0) && (_root.LevelTimer <= 7000)) {
if (i < 6) {
if ((_root.ENEMYTYPES1[LevelIndex] != 0) && (_root.EnemyDelay1 <= _root.GameTimer)) {
_root.EnemyDelay1 = _root.GameTimer + _root.ENEMYFREQS1[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES1[LevelIndex], _root.ENEMYBEHAVE1[LevelIndex], it);
}
} else if (i < 12) {
if ((_root.ENEMYTYPES2[LevelIndex] != 0) && (_root.EnemyDelay2 <= _root.GameTimer)) {
_root.EnemyDelay2 = _root.GameTimer + _root.ENEMYFREQS2[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES2[LevelIndex], _root.ENEMYBEHAVE2[LevelIndex], it);
}
} else if ((_root.ENEMYTYPES3[LevelIndex] != 0) && (_root.EnemyDelay3 <= _root.GameTimer)) {
_root.EnemyDelay3 = _root.GameTimer + _root.ENEMYFREQS3[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES3[LevelIndex], _root.ENEMYBEHAVE3[LevelIndex], it);
}
}
}
} else {
if (Regen && (it.Regeneration)) {
myColor = new Color(it);
myColor.setTransform(_root.healTransform);
delete myColor;
it.hot = 1;
it.Health = it.Health + it.Regeneration;
if (it.Health > it.MaxHealth) {
it.Health = it.MaxHealth;
}
}
continue;
if ((_root.NewLevelStage == 0) && (_root.LevelTimer <= 7000)) {
if (i < 6) {
if ((_root.ENEMYTYPES1[LevelIndex] != 0) && (_root.EnemyDelay1 <= _root.GameTimer)) {
_root.EnemyDelay1 = _root.GameTimer + _root.ENEMYFREQS1[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES1[LevelIndex], _root.ENEMYBEHAVE1[LevelIndex], it);
}
} else if (i < 12) {
if ((_root.ENEMYTYPES2[LevelIndex] != 0) && (_root.EnemyDelay2 <= _root.GameTimer)) {
_root.EnemyDelay2 = _root.GameTimer + _root.ENEMYFREQS2[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES2[LevelIndex], _root.ENEMYBEHAVE2[LevelIndex], it);
}
} else if ((_root.ENEMYTYPES3[LevelIndex] != 0) && (_root.EnemyDelay3 <= _root.GameTimer)) {
_root.EnemyDelay3 = _root.GameTimer + _root.ENEMYFREQS3[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES3[LevelIndex], _root.ENEMYBEHAVE3[LevelIndex], it);
}
}
}
} else if ((_root.NewLevelStage == 0) && (_root.LevelTimer <= 7000)) {
if (i < 6) {
if ((_root.ENEMYTYPES1[LevelIndex] != 0) && (_root.EnemyDelay1 <= _root.GameTimer)) {
_root.EnemyDelay1 = _root.GameTimer + _root.ENEMYFREQS1[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES1[LevelIndex], _root.ENEMYBEHAVE1[LevelIndex], it);
}
} else if (i < 12) {
if ((_root.ENEMYTYPES2[LevelIndex] != 0) && (_root.EnemyDelay2 <= _root.GameTimer)) {
_root.EnemyDelay2 = _root.GameTimer + _root.ENEMYFREQS2[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES2[LevelIndex], _root.ENEMYBEHAVE2[LevelIndex], it);
}
} else if ((_root.ENEMYTYPES3[LevelIndex] != 0) && (_root.EnemyDelay3 <= _root.GameTimer)) {
_root.EnemyDelay3 = _root.GameTimer + _root.ENEMYFREQS3[LevelIndex];
_root.MakeEnemy(_root.ENEMYTYPES3[LevelIndex], _root.ENEMYBEHAVE3[LevelIndex], it);
}
}
}
i = 0;
for ( ; i < _root.MAXENEMYMISSILES ; i++) {
it = _root.EnemyMissiles[i];
if (it.Status == 1) {
_root.EnemyMissileMoveFuncs[i](it);
if (OffScreen(it)) {
RemoveEnemyMissile(it);
continue;
}
} else if ((_root.Dead != 1) && (_root.Me._currentframe < 101)) {
result = _root.Me.clip.hitTest(it._x, it._y, true);
if (result) {
if (_root.Player.Shield == 1) {
_root.Player.Health = _root.Player.Health - int(it.Damage * Math.random());
} else {
_root.Player.Health = _root.Player.Health - it.Damage;
}
myColor = new Color(_root.Me);
myColor.setTransform(_root.hitTransform);
delete myColor;
_root.Me.hot = 1;
RemoveEnemyMissile(it);
}
}
}
if (_root.DrawClouds) {
i = 0;
while (i < _root.MAXCLOUDS) {
it = _root.Clouds[i];
it._visible = true;
it._y = it._y + ((i / 3) + 3);
if (it._y > (550 + it.extent)) {
it._rotation = 360 * Math.random();
it._x = (it.extent / 2) + ((700 - it.extent) * Math.random());
it._y = (-it.extent) - (200 * Math.random());
}
i++;
}
}
_root.bga._y = _root.bga._y + _root.World.YLandSpeed;
if (_root.bga._y >= 550) {
_root.bga._y = _root.bga._y - 2800;
}
_root.bgb._y = _root.bgb._y + _root.World.YLandSpeed;
if (_root.bgb._y >= 550) {
_root.bgb._y = _root.bgb._y - 2800;
}
}
keyListen = {};
keyListen.onKeyDown = function () {
LastKey = Key.getCode();
if (LastKey == 32) {
} else if (LastKey == 70) {
if (_root.Player.Flip != 1) {
} else if (_root.FlipDelay == 0) {
_root.FlipDelay = 10;
_root.Me.gotoAndPlay(101);
}
} else if (LastKey == 77) {
if (_root.Mute == 0) {
_root.Mute = 1;
_root.loop1.gotoAndPlay(1);
_root.loop2.gotoAndPlay(3);
_root.loop2.removeMovieClip();
} else {
_root.Mute = 0;
if ((_root._currentframe == 45) || (_root._currentframe == 46)) {
_root.loop2.gotoAndPlay(3);
_root.loop2.removeMovieClip();
_root.attachMovie("battle" + int((Math.random() * 5) + 1), "loop2", _root.MUSICDEPTH);
_root.loop2.gotoAndPlay(2);
} else {
_root.loop1.gotoAndPlay(2);
}
}
} else if (LastKey == 80) {
if (_root.Pause == 0) {
_root.Pause = 1;
} else {
_quality = "LOW";
_root.Pause = 0;
}
} else if (LastKey == 49) {
if ((_root.Player.MissileNum >= 0) && (_root.Player.MissileNum < 4)) {
if (_root.Player.MissileNum == 0) {
_root.SetAmmo(_root.Player.AmmoMax0 - 1);
} else {
_root.SetAmmo(_root.Player.MissileNum - 1);
}
} else if (_root.Player.AmmoMax0 == 0) {
DisplayMessage("You do not have any lightning spells.");
} else {
_root.SetAmmo(_root.Player.AmmoMax0 - 1);
}
} else if (LastKey == 50) {
if ((_root.Player.MissileNum >= 4) && (_root.Player.MissileNum < 8)) {
if (_root.Player.MissileNum == 4) {
_root.SetAmmo(_root.Player.AmmoMax1 + 3);
} else {
_root.SetAmmo(_root.Player.MissileNum - 1);
}
} else if (_root.Player.AmmoMax1 == 0) {
DisplayMessage("You do not have any ice spells.");
} else {
_root.SetAmmo(_root.Player.AmmoMax1 + 3);
}
} else if (LastKey == 51) {
if ((_root.Player.MissileNum >= 8) && (_root.Player.MissileNum < 12)) {
if (_root.Player.MissileNum == 8) {
_root.SetAmmo(_root.Player.AmmoMax2 + 7);
} else {
_root.SetAmmo(_root.Player.MissileNum - 1);
}
} else if (_root.Player.AmmoMax2 == 0) {
DisplayMessage("You do not have any liquid spells.");
} else {
_root.SetAmmo(_root.Player.AmmoMax2 + 7);
}
} else if (LastKey == 52) {
if ((_root.Player.MissileNum >= 12) && (_root.Player.MissileNum < 16)) {
if (_root.Player.MissileNum == 12) {
_root.SetAmmo(_root.Player.AmmoMax3 + 11);
} else {
_root.SetAmmo(_root.Player.MissileNum - 1);
}
} else if (_root.Player.AmmoMax3 == 0) {
DisplayMessage("You do not have any fire spells.");
} else {
_root.SetAmmo(_root.Player.AmmoMax3 + 11);
}
} else if (LastKey == 53) {
if ((_root.Player.MissileNum >= 16) && (_root.Player.MissileNum < 20)) {
if (_root.Player.MissileNum == 16) {
_root.SetAmmo(_root.Player.AmmoMax4 + 15);
} else {
_root.SetAmmo(_root.Player.MissileNum - 1);
}
} else if (_root.Player.AmmoMax4 == 0) {
DisplayMessage("You do not have any orb spells.");
} else {
_root.SetAmmo(_root.Player.AmmoMax4 + 15);
}
} else if (LastKey == 54) {
if ((_root.Player.MissileNum >= 20) && (_root.Player.MissileNum < 24)) {
if (_root.Player.MissileNum == 20) {
_root.SetAmmo(_root.Player.AmmoMax5 + 19);
} else {
_root.SetAmmo(_root.Player.MissileNum - 1);
}
} else if (_root.Player.AmmoMax5 == 0) {
DisplayMessage("You do not have any nature spells.");
} else {
_root.SetAmmo(_root.Player.AmmoMax5 + 19);
}
}
};
Key.addListener(keyListen);
Init();
Frame 35
stop();
Frame 45
Update();
Frame 46
gotoAndPlay ("GameFrame");
Frame 50
_quality = "HIGH";
stop();
Frame 51
_quality = "HIGH";
stop();
Symbol 7 Button
on (release) {
getURL ("http://www.racewarkingdoms.com", "_blank");
}
Symbol 514 MovieClip Frame 1
stop();
Symbol 542 MovieClip Frame 1
stop();
Symbol 999 MovieClip [Me] Frame 25
_root.UpdatePlayerFrame();
Symbol 999 MovieClip [Me] Frame 50
_root.UpdatePlayerFrame();
Symbol 999 MovieClip [Me] Frame 75
_root.UpdatePlayerFrame();
Symbol 999 MovieClip [Me] Frame 100
_root.UpdatePlayerFrame();
Symbol 999 MovieClip [Me] Frame 161
_root.UpdatePlayerFrame();
Symbol 999 MovieClip [Me] Frame 222
_root.UpdatePlayerFrame();
Symbol 1004 MovieClip Frame 1
_visible = false;
stop();
Symbol 1007 MovieClip Frame 1
stop();
Symbol 1014 MovieClip [statusbar] Frame 1
stop();
Symbol 1016 MovieClip Frame 1
stop();
Symbol 1017 MovieClip [TmpMessage] Frame 1
Poopshit = 0;
msg_mc.msg.embedFonts = true;
Symbol 1017 MovieClip [TmpMessage] Frame 2
Poopshit++;
if (Poopshit > 100) {
this.removeMovieClip();
}
msg_mc._y = msg_mc._y + 1;
msg_mc.msg._alpha = 100 - Poopshit;
Symbol 1017 MovieClip [TmpMessage] Frame 3
gotoAndPlay (2);
Symbol 1066 MovieClip [FragmentCloud] Frame 25
this.removeMovieClip();
Symbol 1164 MovieClip [DustCloud] Frame 25
this.removeMovieClip();
Symbol 1195 MovieClip [BloodCloud] Frame 16
this.removeMovieClip();
Symbol 1196 MovieClip [blank] Frame 1
stop();
Symbol 1198 MovieClip [BlackOut] Frame 25
stop();
Symbol 1200 MovieClip [battle1] Frame 1
stop();
Symbol 1200 MovieClip [battle1] Frame 2
stop();
Symbol 1202 MovieClip [battle2] Frame 1
stop();
Symbol 1202 MovieClip [battle2] Frame 2
stop();
Symbol 1204 MovieClip [battle3] Frame 1
stop();
Symbol 1204 MovieClip [battle3] Frame 2
stop();
Symbol 1206 MovieClip [battle4] Frame 1
stop();
Symbol 1206 MovieClip [battle4] Frame 2
stop();
Symbol 1208 MovieClip [battle5] Frame 1
stop();
Symbol 1208 MovieClip [battle5] Frame 2
stop();
Symbol 1223 Button
on (release) {
if ((((((_root.Player.AmmoMax0 == 0) && (_root.Player.AmmoMax1 == 0)) && (_root.Player.AmmoMax2 == 0)) && (_root.Player.AmmoMax3 == 0)) && (_root.Player.AmmoMax4 == 0)) && (_root.Player.AmmoMax5 == 0)) {
_root.DisplayMessage("You must first purchase a spell...");
} else {
PreUpdate();
gotoAndPlay ("GameFrame");
}
}
Symbol 1224 Button
on (release) {
DisplayWeapon(0);
}
Symbol 1225 Button
on (release) {
DisplayWeapon(1);
}
Symbol 1226 Button
on (release) {
DisplayWeapon(2);
}
Symbol 1227 Button
on (release) {
DisplayWeapon(3);
}
Symbol 1228 Button
on (release) {
DisplayWeapon(4);
}
Symbol 1229 Button
on (release) {
DisplayWeapon(5);
}
Symbol 1230 Button
on (release) {
DisplayWeapon(6);
}
Symbol 1231 Button
on (release) {
DisplayWeapon(7);
}
Symbol 1232 Button
on (release) {
DisplayWeapon(8);
}
Symbol 1233 Button
on (release) {
DisplayWeapon(9);
}
Symbol 1234 Button
on (release) {
DisplayWeapon(10);
}
Symbol 1235 Button
on (release) {
DisplayWeapon(11);
}
Symbol 1236 Button
on (release) {
DisplayWeapon(12);
}
Symbol 1237 Button
on (release) {
DisplayWeapon(13);
}
Symbol 1238 Button
on (release) {
DisplayWeapon(14);
}
Symbol 1239 Button
on (release) {
DisplayWeapon(15);
}
Symbol 1240 Button
on (release) {
DisplayWeapon(16);
}
Symbol 1241 Button
on (release) {
DisplayWeapon(17);
}
Symbol 1242 Button
on (release) {
DisplayWeapon(18);
}
Symbol 1243 Button
on (release) {
DisplayWeapon(19);
}
Symbol 1244 Button
on (release) {
DisplayWeapon(20);
}
Symbol 1245 Button
on (release) {
DisplayWeapon(21);
}
Symbol 1246 Button
on (release) {
DisplayWeapon(22);
}
Symbol 1247 Button
on (release) {
DisplayWeapon(23);
}
Symbol 1248 Button
on (release) {
DisplayWeapon(24);
}
Symbol 1249 Button
on (release) {
DisplayWeapon(25);
}
Symbol 1250 Button
on (release) {
DisplayWeapon(26);
}
Symbol 1251 Button
on (release) {
DisplayWeapon(27);
}
Symbol 1252 Button
on (release) {
DisplayWeapon(28);
}
Symbol 1253 Button
on (release) {
DisplayWeapon(29);
}
Symbol 1254 Button
on (release) {
DisplayWeapon(30);
}
Symbol 1255 Button
on (release) {
DisplayWeapon(31);
}
Symbol 1260 Button
on (release) {
PurchaseWeapon();
}
Symbol 1262 MovieClip Frame 1
_root.Clear();
Symbol 1262 MovieClip Frame 10
main_txt.textColor = 684;
Symbol 1262 MovieClip Frame 18
main_txt.textColor = 10066329 /* 0x999999 */;
Symbol 1262 MovieClip Frame 27
main_txt.textColor = 684;
Symbol 1262 MovieClip Frame 35
main_txt.textColor = 10066329 /* 0x999999 */;
Symbol 1262 MovieClip Frame 44
main_txt.textColor = 684;
Symbol 1262 MovieClip Frame 51
main_txt.textColor = 10066329 /* 0x999999 */;
stop();
Symbol 1263 Button
on (release) {
getURL ("http://www.racewarkingdoms.com", "_blank");
}
Symbol 1474 MovieClip Frame 1
stop();
Symbol 1474 MovieClip Frame 2
stop();
Symbol 1498 Button
on (release) {
_root.RWK();
}
Symbol 1499 Button
on (release) {
gotoAndPlay (1);
}