Combined Code
frame 1 {
var capacity = 4;
var boltback = 0;
var ammo = 0;
var chambered = 0;
var emptychambered = 0;
var boltcharged = 0;
var reloadque = 0;
var triggerchecker = 1;
var firemode = 0;
}
movieClip 6 {
}
frame 2 {
stop();
}
movieClip 9 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 11 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 46 {
gotoAndStop(1);
}
}
movieClip 15 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 19 {
frame 1 {
stop();
}
frame 26 {
++_root.ammo;
--_root.reloadque;
if (_root.reloadque > 0) {
gotoAndPlay(3);
_root.pushbullet.gotoAndPlay(3);
} else {
_root.rifle.bolthandle.boltbutton.enabled = true;
_root.rifle.trigger.triggerbutton.enabled = true;
_root.pushbullet.gotoAndStop(2);
}
}
}
button 22 {
on (release) {
this.gotoAndPlay(2);
if (_root.firemode == 0) {
if (_root.chambered == 1) {
_root.firing = 1;
_root.chambered = 0;
_root.emptychambered = 1;
_root.bul.casing.gotoAndStop(2);
_root.muzzleflash.gotoAndPlay(2);
_root.gotoAndPlay(3);
}
if (_root.boltcharged == 1 && _root.triggerchecker == 1) {
_root.rifle.bolt.subbolt.gotoAndPlay(2);
}
}
}
}
movieClip 23 {
frame 1 {
stop();
}
frame 25 {
gotoAndStop(1);
}
}
movieClip 29 {
frame 1 {
stop();
}
frame 3 {
_root.boltcharged = 0;
}
}
button 34 {
on (press) {
if (_root.boltback != 1) {
play();
}
}
}
movieClip 37 {
frame 1 {
stop();
}
frame 6 {
_root.firemode = 1;
stop();
}
frame 11 {
_root.firemode = 2;
stop();
}
frame 23 {
_root.firemode = 0;
gotoAndStop(1);
}
}
movieClip 38 {
frame 1 {
stop();
}
frame 35 {
stop();
}
frame 70 {
gotoAndStop(1);
}
}
button 43 {
on (press) {
if (_root.firemode != 2) {
this.gotoAndPlay(2);
_root.rifle.bolt.gotoAndPlay(2);
}
}
}
button 45 {
on (press) {
if (_root.ammo > 0) {
this.gotoAndPlay(36);
_root.rifle.bolt.gotoAndPlay(36);
}
}
}
movieClip 47 {
frame 1 {
stop();
}
frame 2 {
_root.triggerchecker = 0;
}
frame 16 {
_root.rifle.bolt.subbolt.gotoAndStop(2);
_root.boltback = 1;
}
frame 22 {
if (_root.chambered == 1 || _root.emptychambered == 1) {
_root.chambered = 0;
_root.emptychambered = 0;
_root.bul.gotoAndPlay(3);
}
}
frame 35 {
if (_root.ammo <= _root.capacity) {
_root.reload.gotoAndPlay(2);
}
stop();
}
frame 36 {
_root.reload.gotoAndStop(1);
}
frame 55 {
_root.boltcharged = 1;
_root.boltback = 0;
if (_root.ammo > 0) {
_root.chambered = 1;
--_root.ammo;
_root.bul.casing.gotoAndStop(2);
_root.bul.gotoAndStop(2);
_root.pushbullet.gotoAndStop(1);
}
}
frame 70 {
_root.triggerchecker = 1;
gotoAndStop(1);
}
}
movieClip 48 {
}
movieClip 51 {
frame 1 {
stop();
}
}
button 55 {
on (release) {
_root.reloadque = _root.capacity - _root.ammo + 1;
_root.refill.gotoAndPlay(2);
gotoAndPlay(1);
_root.rifle.bolthandle.boltbutton.enabled = false;
_root.rifle.trigger.triggerbutton.enabled = false;
}
}
movieClip 56 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
frame 35 {
gotoAndStop(2);
}