Combined Code
frame 1 {
player_mana = 68;
}
frame 1 {
function onEnterFrame() {
if (players_turn) {
if (player_attack && player.attack_mc._currentframe == player.attack_mc._totalframes) {
ehealth -= 20 + random(10);
player_attack = false;
players_turn = false;
player.gotoAndStop(1);
enemy.gotoAndStop(1);
} else {
if (player_magic && player.magic_mc._currentframe == player.magic_mc._totalframes) {
ehealth -= 30 * random(3);
player_magic = false;
players_turn = false;
player.gotoAndStop(1);
enemy.gotoAndStop(1);
}
}
} else {
if (!enemy_attack && !enemy_magic) {
switch (random(3)) {
case 0:
player.gotoAndStop(4);
enemy.gotoAndStop(2);
enemy_attack = true;
break;
case 1:
player.gotoAndStop(4);
enemy.gotoAndStop(3);
enemy_magic = true;
}
}
if (enemy_attack && enemy.attack_mc._currentframe == enemy.attack_mc._totalframes) {
health -= 10 + random(10);
players_turn = true;
enemy_attack = false;
enemy.gotoAndStop(1);
player.gotoAndStop(1);
} else {
if (enemy_magic && enemy.magic_mc._currentframe == enemy.magic_mc._totalframes) {
health -= 3 * random(10);
players_turn = true;
enemy_magic = false;
enemy.gotoAndStop(1);
player.gotoAndStop(1);
}
}
}
}
stop();
health = 164;
ehealth = 300;
var players_turn = true;
var player_attack = false;
var player_magic = false;
var health = 164;
var ehealth = 300;
var enemy_attack = false;
var enemy_magic = false;
attack.onRelease = function () {
if (players_turn && !player_attack && !player_magic) {
player_attack = true;
enemy.gotoAndStop(4);
player.gotoAndStop(2);
}
};
magic.onRelease = function () {
if (players_turn && !player_attack && !player_magic && _root.player_mana >= 12) {
_root.player_mana -= 12;
player_magic = true;
enemy.gotoAndStop(4);
player.gotoAndStop(3);
}
};
}
movieClip 7 {
}
movieClip 10 {
}
instance of movieClip 10 {
onClipEvent (enterFrame) {
this._xscale = _root.health;
if (_root.health <= 0) {
_root.health = 0;
_root.gotoAndStop(2);
} else {
if (_root.health >= 164) {
_root.health = 164;
}
}
}
}
instance of movieClip 10 {
onClipEvent (enterFrame) {
this._xscale = _root.ehealth;
if (_root.ehealth <= 0) {
_root.ehealth = 0;
_root.gotoAndStop(3);
} else {
if (_root.ehealth >= 300) {
_root.ehealth = 300;
}
}
}
}
// unknown tag 88 length 73
// unknown tag 88 length 62
movieClip 30 {
}
movieClip 37 {
}
movieClip 40 {
}
movieClip 46 {
}
movieClip 85 {
}
movieClip 87 {
}
movieClip 88 {
frame 1 {
stop();
}
}
movieClip 93 {
}
movieClip 98 {
}
movieClip 105 {
}
movieClip 128 {
}
movieClip 131 {
}
movieClip 139 {
}
movieClip 140 {
}
movieClip 141 {
frame 1 {
stop();
}
}