Frame 1
var vers = System.capabilities.version.split(" ")[1].split(",")[0];
if (vers < 8) {
}
_root.comiter = 19200;
_root.grounditer = 1200;
Frame 2
var lc = new LocalConnection();
var domain = lc.domain();
trace(domain);
if ((((((((((domain != "localhost") && (domain != "chiudesign.com")) && (domain != "iconnicholson.com")) && (domain != "onehammer;com")) && (domain != "www.chiudesign.com")) && (domain != "chiudesign.com")) && (domain != "www.nny.com")) && (domain != "nny.com")) && (domain != "nicholsonny.com")) && (domain != "www.onehammer.com")) {
_root.titles._visible = true;
_root.titles.gotoAndPlay("error");
trace("wfw");
stop();
}
Frame 5
function gameover(eventObject) {
trace("game over");
}
stop();
trace("s");
if (!_root.game) {
_root.game = new com.iconnicholson.onehammer.Snowcraft1Rewrite(_root.floop, _root.gamemc, _root.titles, _root.sounds);
_root.game.addEventListener("gameover", this);
_root.game.dolevel(1);
} else {
_root.game.reset();
_root.game.dolevel(1);
}
var lastkey = "";
var secondfromlastkey = "";
var keyListener = new Object();
keyListener.onKeyDown = function () {
if ((lastkey == "v") && (secondfromlastkey == "l")) {
_root.game.dolevel(Number(chr(Key.getAscii())));
}
if ((lastkey == "r") && (secondfromlastkey == "c")) {
_root.titles._visible = true;
_root.titles.gotoAndPlay("credits");
_root.titles._visible = true;
}
secondfromlastkey = lastkey;
lastkey = chr(Key.getAscii());
};
Key.addListener(keyListener);
Symbol 19 MovieClip Frame 15
stop();
Symbol 32 MovieClip [reddudie] Frame 1
meter._visible = false;
stop();
Symbol 32 MovieClip [reddudie] Frame 2
stop();
meter._visible = false;
dazed = false;
Symbol 32 MovieClip [reddudie] Frame 3
meter.gotoAndPlay(1);
meter._visible = true;
stop();
Symbol 32 MovieClip [reddudie] Frame 4
stop();
meter._visible = false;
Symbol 32 MovieClip [reddudie] Frame 5
play();
Symbol 32 MovieClip [reddudie] Frame 7
meter._visible = false;
play();
Symbol 32 MovieClip [reddudie] Frame 15
gotoAndPlay ("dazed");
Symbol 32 MovieClip [reddudie] Frame 16
play();
meter._visible = false;
Symbol 32 MovieClip [reddudie] Frame 18
gotoAndStop(this._currentframe + Math.round(Math.random() * 3));
Symbol 32 MovieClip [reddudie] Frame 24
play();
Symbol 32 MovieClip [reddudie] Frame 27
gotoAndPlay ("walk");
Symbol 48 MovieClip [snowballshadow] Frame 1
stop();
Symbol 48 MovieClip [snowballshadow] Frame 15
stop();
Symbol 69 MovieClip [greendudie] Frame 6
gotoAndPlay ("walk");
Symbol 69 MovieClip [greendudie] Frame 7
stop();
Symbol 69 MovieClip [greendudie] Frame 8
stop();
Symbol 69 MovieClip [greendudie] Frame 9
stop();
Symbol 69 MovieClip [greendudie] Frame 10
stop();
Symbol 69 MovieClip [greendudie] Frame 11
justhit = true;
play();
Symbol 69 MovieClip [greendudie] Frame 17
justhit = true;
down = false;
play();
Symbol 69 MovieClip [greendudie] Frame 31
justhit = false;
down = false;
gotoAndPlay ("walk");
Symbol 69 MovieClip [greendudie] Frame 33
play();
Symbol 69 MovieClip [greendudie] Frame 36
down = true;
play();
Symbol 69 MovieClip [greendudie] Frame 57
gotoAndPlay ("midrecover");
Symbol 69 MovieClip [greendudie] Frame 58
play();
Symbol 69 MovieClip [greendudie] Frame 60
var nframe = (this._currentframe + Math.round(Math.random() * 4));
trace(nframe);
gotoAndStop(nframe);
Symbol 69 MovieClip [greendudie] Frame 74
gotoAndPlay(this._currentframe + Math.floor(Math.random() * 21));
Symbol 69 MovieClip [greendudie] Frame 78
if ((_root.sounds._currentframe == 1) && (Math.random() < 0.5)) {
if (Math.random() < 0.5) {
_root.sounds.gotoAndPlay("laugh");
} else {
_root.sounds.gotoAndPlay("laugh2");
}
}
gotoAndStop ("yealoop");
Symbol 69 MovieClip [greendudie] Frame 98
gotoAndStop ("yealoop");
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 9
gotoAndStop (1);
Symbol 85 MovieClip Frame 53
gotoAndStop (1);
Symbol 85 MovieClip Frame 59
gotoAndStop (1);
Symbol 85 MovieClip Frame 81
gotoAndStop (1);
Symbol 85 MovieClip Frame 92
gotoAndStop (1);
Symbol 85 MovieClip Frame 104
gotoAndStop (1);
Symbol 85 MovieClip Frame 119
gotoAndStop (1);
Symbol 85 MovieClip Frame 140
gotoAndStop (1);
Symbol 85 MovieClip Frame 195
gotoAndStop (1);
Symbol 85 MovieClip Frame 203
gotoAndStop (1);
Symbol 85 MovieClip Frame 233
gotoAndStop (1);
Symbol 85 MovieClip Frame 276
gotoAndStop (1);
Symbol 85 MovieClip Frame 355
gotoAndStop (1);
Symbol 110 MovieClip Frame 1
stop();
this._visible = false;
Symbol 110 MovieClip Frame 2
this._visible = true;
play();
Symbol 110 MovieClip Frame 73
gotoAndStop (1);
Symbol 110 MovieClip Frame 74
this._visible = true;
if (this.lev == 9) {
this.levelx.text = "Bonus Round";
} else {
this.levelfade.levelx.text = "Level " + this.lev;
}
_root.sounds.gotoAndPlay("goodbadugly");
play();
Symbol 110 MovieClip Frame 165
gotoAndStop (1);
Symbol 110 MovieClip Frame 166
this._visible = true;
play();
Symbol 110 MovieClip Frame 253
var me = this;
this.fromyour.scorebox.text = "SCORE: " + this.score;
this.fromyour.playagain.onRelease = function () {
me._visible = false;
_root.gotoAndPlay(1);
};
this.fromyour.visit.onRelease = function () {
getURL ("http://www.iconnicholson.com", "_blank");
};
this.fromyour.creditsblock.onRelease = function () {
_root.titles._visible = true;
_root.titles.gotoAndPlay("credits");
};
Symbol 110 MovieClip Frame 270
stop();
Symbol 110 MovieClip Frame 271
this._visible = true;
play();
Symbol 110 MovieClip Frame 290
_root.sounds.gotoAndPlay("halaluja");
Symbol 110 MovieClip Frame 358
var me = this;
this.fromyour.scorebox.text = "SCORE: " + this.score;
this.fromyour.playagain.onRelease = function () {
me._visible = false;
_root.gotoAndPlay(1);
};
this.fromyour.visit.onRelease = function () {
getURL ("http://www.iconnicholson.com", "_blank");
};
this.fromyour.creditsblock.onRelease = function () {
_root.titles._visible = true;
_root.titles.gotoAndPlay("credits");
};
Symbol 110 MovieClip Frame 375
stop();
Symbol 110 MovieClip Frame 420
stop();
Symbol 110 MovieClip Frame 422
trace("wtffff");
stop();
Symbol 115 MovieClip [__Packages.com.iconnicholson.onehammer.AGame] Frame 0
class com.iconnicholson.onehammer.AGame
{
var hackparent;
function AGame (floop) {
floop.onEnterFrame = floopenterframe;
floop.hackparent = this;
mx.events.EventDispatcher.initialize(this);
}
function ongameover() {
var _local2 = {target:this, type:"gameover"};
dispatchEvent(_local2);
}
function floopenterframe() {
hackparent.frameloop();
}
function frameloop() {
}
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
var paused = true;
}
Symbol 116 MovieClip [__Packages.mx.events.EventDispatcher] Frame 0
class mx.events.EventDispatcher
{
function EventDispatcher () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialize(object) {
if (_fEventDispatcher == undefined) {
_fEventDispatcher = new mx.events.EventDispatcher();
}
object.addEventListener = _fEventDispatcher.addEventListener;
object.removeEventListener = _fEventDispatcher.removeEventListener;
object.dispatchEvent = _fEventDispatcher.dispatchEvent;
object.dispatchQueue = _fEventDispatcher.dispatchQueue;
}
function dispatchQueue(queueObj, eventObj) {
var _local7 = "__q_" + eventObj.type;
var _local4 = queueObj[_local7];
if (_local4 != undefined) {
var _local5;
for (_local5 in _local4) {
var _local1 = _local4[_local5];
var _local3 = typeof(_local1);
if ((_local3 == "object") || (_local3 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
}
}
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
dispatchQueue(this, eventObj);
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
static var _fEventDispatcher = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 117 MovieClip [__Packages.com.iconnicholson.onehammer.Snowcraft1Rewrite] Frame 0
class com.iconnicholson.onehammer.Snowcraft1Rewrite extends com.iconnicholson.onehammer.AGame
{
var sounds, stage, titles, snowballs, adudies, greendudiestartingpoints, shiftdown, lev, starttime, dispatchEvent;
function Snowcraft1Rewrite (floop, stage, titles, sounds) {
super(floop);
this.sounds = sounds;
this.stage = stage;
this.titles = titles;
_root.comiter++;
snowballs = new Array();
adudies = new Array();
var _local5 = new Object();
var me = this;
_local5.onKeyDown = function () {
me.keydown(Key.getCode());
};
_local5.onKeyUp = function () {
me.keyup(Key.getCode());
};
Key.addListener(_local5);
greendudiestartingpoints = new Array();
greendudiestartingpoints[0] = new Array();
greendudiestartingpoints[0][0] = new Array(-20, -60, 180, 40);
greendudiestartingpoints[0][1] = new Array(-130, -60, 70, 40);
greendudiestartingpoints[0][2] = new Array(-130, 1, 70, 100);
greendudiestartingpoints[1] = new Array();
greendudiestartingpoints[1][0] = new Array(-20, -60, 180, 40);
greendudiestartingpoints[1][1] = new Array(-130, -60, 70, 40);
greendudiestartingpoints[1][2] = new Array(-130, 1, 70, 100);
greendudiestartingpoints[1][3] = new Array(-50, -100, -2, -99);
greendudiestartingpoints[1][4] = new Array(-50, 1, -49, 1);
greendudiestartingpoints[2] = new Array();
greendudiestartingpoints[2][0] = new Array(-20, -60, 180, 40);
greendudiestartingpoints[2][1] = new Array(-130, -60, 70, 40);
greendudiestartingpoints[2][2] = new Array(-130, 1, 70, 100);
greendudiestartingpoints[2][3] = new Array(-50, 100, -51, 101);
greendudiestartingpoints[2][4] = new Array(-50, 150, -51, 151);
greendudiestartingpoints[2][5] = new Array(-100, -50, -101, -51);
greendudiestartingpoints[2][6] = new Array(-150, -50, -151, -50);
greendudiestartingpoints[3] = new Array();
greendudiestartingpoints[3][0] = new Array(-20, -60, 180, 40);
greendudiestartingpoints[3][1] = new Array(-130, -60, 70, 40);
greendudiestartingpoints[3][2] = new Array(-130, 1, 70, 100);
greendudiestartingpoints[3][3] = new Array(-50, 100, -51, 101);
greendudiestartingpoints[3][4] = new Array(-50, 150, -51, 151);
greendudiestartingpoints[3][5] = new Array(-100, -50, -101, -51);
greendudiestartingpoints[3][6] = new Array(-150, -50, -151, -50);
greendudiestartingpoints[3][7] = new Array(-100, -50, -101, -51);
greendudiestartingpoints[3][8] = new Array(-150, -50, -151, -50);
greendudiestartingpoints[4] = new Array();
greendudiestartingpoints[4][0] = new Array(-20, -60, 180, 40);
greendudiestartingpoints[4][1] = new Array(-130, -60, 70, 40);
greendudiestartingpoints[4][2] = new Array(-130, 1, 70, 100);
greendudiestartingpoints[4][3] = new Array(-50, 100, -51, 101);
greendudiestartingpoints[4][4] = new Array(-50, 150, -51, 151);
greendudiestartingpoints[4][5] = new Array(-100, -50, -101, -51);
greendudiestartingpoints[4][6] = new Array(-150, -50, -151, -50);
greendudiestartingpoints[4][7] = new Array(-100, -50, -101, -51);
greendudiestartingpoints[4][8] = new Array(-150, -50, -151, -50);
greendudiestartingpoints[4][9] = new Array(-50, 100, -51, 101);
greendudiestartingpoints[4][10] = new Array(-50, 150, -51, 151);
greendudiestartingpoints[4][11] = new Array(-50, 100, -51, 101);
greendudiestartingpoints[4] = new Array();
greendudiestartingpoints[4][0] = new Array(-20, -60, 180, 40);
greendudiestartingpoints[4][1] = new Array(-130, -60, 70, 40);
greendudiestartingpoints[4][2] = new Array(-130, 1, 70, 100);
greendudiestartingpoints[4][3] = new Array(-50, 100, -51, 101);
greendudiestartingpoints[4][4] = new Array(-50, 150, -51, 151);
greendudiestartingpoints[4][5] = new Array(160, -50, 160, 80);
greendudiestartingpoints[4][6] = new Array(-150, -50, 270, 90);
greendudiestartingpoints[4][7] = new Array(-100, -50, 160, 150);
greendudiestartingpoints[4][8] = new Array(-150, -50, 300, 140);
greendudiestartingpoints[4][9] = new Array(-50, 100, 400, 150);
greendudiestartingpoints[4][10] = new Array(-50, 150, -51, 151);
greendudiestartingpoints[4][11] = new Array(-50, 100, 300, 205);
var _local4 = 0;
while (_local4 < greendudiestartingpoints[4].length) {
greendudiestartingpoints[4][_local4][0] = greendudiestartingpoints[4][_local4][2] - 400;
greendudiestartingpoints[4][_local4][1] = greendudiestartingpoints[4][_local4][3] - 200;
_local4++;
}
greendudiestartingpoints[5] = new Array();
greendudiestartingpoints[5][0] = new Array(-20, -60, 520, 40);
greendudiestartingpoints[5][1] = new Array(-130, -60, 460, 80);
greendudiestartingpoints[5][2] = new Array(-130, 1, 400, 130);
greendudiestartingpoints[5][3] = new Array(-50, 100, 340, 165);
greendudiestartingpoints[5][4] = new Array(-50, 150, 280, 200);
greendudiestartingpoints[5][5] = new Array(160, -50, 230, 250);
greendudiestartingpoints[5][6] = new Array(-150, -50, 470, 40);
greendudiestartingpoints[5][7] = new Array(-100, -50, 410, 80);
greendudiestartingpoints[5][8] = new Array(-150, -50, 340, 130);
greendudiestartingpoints[5][9] = new Array(-50, 100, 280, 165);
greendudiestartingpoints[5][10] = new Array(-50, 150, 230, 200);
greendudiestartingpoints[5][11] = new Array(-50, 100, 180, 250);
_local4 = 0;
while (_local4 < greendudiestartingpoints[5].length) {
if (_local4 < 6) {
greendudiestartingpoints[5][_local4][0] = -450 - (_local4 * 8);
greendudiestartingpoints[5][_local4][1] = greendudiestartingpoints[5][_local4][3];
} else {
greendudiestartingpoints[5][_local4][0] = greendudiestartingpoints[5][_local4][2];
greendudiestartingpoints[5][_local4][1] = -350 - (_local4 * 8);
}
_local4++;
}
greendudiestartingpoints[6] = new Array();
greendudiestartingpoints[6][0] = new Array(-20, -60, 400, 80);
greendudiestartingpoints[6][1] = new Array(-130, -60, 435, 70);
greendudiestartingpoints[6][2] = new Array(-130, 1, 435, 105);
greendudiestartingpoints[6][3] = new Array(-50, 100, 345, 135);
greendudiestartingpoints[6][4] = new Array(-50, 150, 310, 175);
greendudiestartingpoints[6][5] = new Array(160, -50, 350, 175);
greendudiestartingpoints[6][6] = new Array(-150, -50, 85, 220);
greendudiestartingpoints[6][7] = new Array(-100, -50, 135, 220);
greendudiestartingpoints[6][8] = new Array(-150, -50, 180, 220);
greendudiestartingpoints[6][9] = new Array(-50, 100, 110, 260);
greendudiestartingpoints[6][10] = new Array(-50, 150, 155, 260);
greendudiestartingpoints[6][11] = new Array(-50, 100, 125, 290);
_local4 = 0;
while (_local4 < greendudiestartingpoints[4].length) {
if (_local4 < 3) {
greendudiestartingpoints[6][_local4][0] = greendudiestartingpoints[6][_local4][2];
greendudiestartingpoints[6][_local4][1] = -250;
} else if (_local4 < 6) {
greendudiestartingpoints[6][_local4][0] = greendudiestartingpoints[6][_local4][2];
greendudiestartingpoints[6][_local4][1] = -350;
} else {
greendudiestartingpoints[6][_local4][0] = greendudiestartingpoints[6][_local4][2] - 400;
greendudiestartingpoints[6][_local4][1] = greendudiestartingpoints[6][_local4][3] - 200;
}
_local4++;
}
greendudiestartingpoints[7] = new Array();
greendudiestartingpoints[7][0] = new Array(-20, -60, 400, 80);
greendudiestartingpoints[7][1] = new Array(-130, -60, 435, 70);
greendudiestartingpoints[7][2] = new Array(-130, 1, 435, 105);
greendudiestartingpoints[7][3] = new Array(-50, 100, 345, 135);
greendudiestartingpoints[7][4] = new Array(-50, 150, 310, 175);
greendudiestartingpoints[7][5] = new Array(160, -50, 350, 175);
greendudiestartingpoints[7][6] = new Array(-150, -50, 85, 220);
greendudiestartingpoints[7][7] = new Array(-100, -50, 135, 220);
greendudiestartingpoints[7][8] = new Array(-150, -50, 180, 220);
greendudiestartingpoints[7][9] = new Array(-50, 100, 110, 260);
greendudiestartingpoints[7][10] = new Array(-50, 150, 155, 260);
greendudiestartingpoints[7][11] = new Array(-50, 100, 125, 290);
_local4 = 0;
while (_local4 < greendudiestartingpoints[4].length) {
if (_local4 < 6) {
greendudiestartingpoints[7][_local4][2] = greendudiestartingpoints[7][_local4 + 6][2] + 150;
greendudiestartingpoints[7][_local4][3] = greendudiestartingpoints[7][_local4 + 6][3] - 150;
}
greendudiestartingpoints[7][_local4][0] = greendudiestartingpoints[7][_local4][2] - 400;
greendudiestartingpoints[7][_local4][1] = greendudiestartingpoints[7][_local4][3] - 200;
_local4++;
}
greendudiestartingpoints[8] = new Array();
_local4 = 0;
while (_local4 < 50) {
greendudiestartingpoints[8].push(new Array(-50, 100, 50 + (Math.random() * 200), 50 + (Math.random() * 200)));
_local4++;
}
_local4 = 0;
while (_local4 < greendudiestartingpoints[4].length) {
if (_local4 < 10) {
greendudiestartingpoints[8][_local4][0] = greendudiestartingpoints[8][_local4][2] - 400;
greendudiestartingpoints[8][_local4][1] = greendudiestartingpoints[8][_local4][3] - 200;
} else {
greendudiestartingpoints[8][_local4][0] = greendudiestartingpoints[8][_local4][2] - 400;
greendudiestartingpoints[8][_local4][1] = greendudiestartingpoints[8][_local4][3];
}
_local4++;
}
reset();
mx.events.EventDispatcher.initialize(this);
}
function keydown(k) {
if (k == 16) {
shiftdown = true;
}
}
function keyup(k) {
if (k == 16) {
shiftdown = false;
}
}
function dolevel(level) {
clearbetweenlevels();
lev = level;
if (level == 1) {
titles.gotoAndPlay("seasonsgreetings");
} else {
titles.lev = level;
titles.gotoAndPlay("levelx");
}
var _local6;
_local6 = new com.iconnicholson.onehammer.RedSnowDudie(stage, sounds);
_local6.addEventListener("throwball", this);
adudies.push(_local6);
_local6.setwalkendx(reddudie1startx);
_local6.setwalkendy(reddudie1starty);
_local6.setposition(reddudie1startx + 200, reddudie1starty + 100);
_local6 = new com.iconnicholson.onehammer.RedSnowDudie(stage, sounds);
_local6.addEventListener("throwball", this);
adudies.push(_local6);
_local6.setwalkendx(reddudie2startx);
_local6.setwalkendy(reddudie2starty);
_local6.setposition(reddudie2startx + 200, reddudie2starty + 100);
_local6 = new com.iconnicholson.onehammer.RedSnowDudie(stage, sounds);
_local6.addEventListener("throwball", this);
adudies.push(_local6);
_local6.setwalkendx(reddudie3startx);
_local6.setwalkendy(reddudie3starty);
_local6.setposition(reddudie3startx + 200, reddudie3starty + 100);
trace("level: " + level);
var _local2;
var _local5 = 0;
while (_local5 < greendudiestartingpoints[level - 1].length) {
var _local3 = greendudiestartingpoints[level - 1][_local5];
_local2 = new com.iconnicholson.onehammer.GreenSnowDudie(stage, sounds, titles);
adudies.push(_local2);
_local2.addEventListener("throwball", this);
_local2.setposition(_local3[0], _local3[1]);
_local2.setwalkendx(_local3[2]);
_local2.setwalkendy(_local3[3]);
if ((level == 5) || (level > 6)) {
_local2.setwalkspeed(10);
}
if (level == 6) {
_local2.setwalkspeed(15);
}
_local5++;
}
}
function throwball(eventObject) {
var _local3 = new com.iconnicholson.onehammer.SnowBall(stage, sounds, eventObject.team, eventObject.force, eventObject.x, eventObject.y, eventObject.ineffective);
snowballs.push(_local3);
}
function frameloop() {
var _local9 = true;
var _local3 = 0;
while (_local3 < adudies.length) {
if (!(adudies[_local3] instanceof com.iconnicholson.onehammer.GreenSnowDudie)) {
} else {
var _local4 = adudies[_local3];
if (!_local4.dead) {
_local9 = false;
break;
}
}
_local3++;
}
if (_local9 && (!gameover)) {
if (lev == greendudiestartingpoints.length) {
ongameover(true);
} else {
dolevel(lev + 1);
}
}
var _local10 = true;
_local3 = 0;
while (_local3 < adudies.length) {
if (!(adudies[_local3] instanceof com.iconnicholson.onehammer.RedSnowDudie)) {
} else {
var _local5 = adudies[_local3];
if (!_local5.dead) {
_local10 = false;
break;
}
}
_local3++;
}
if (_local10) {
if (!gameover) {
_local3 = 0;
while (_local3 < adudies.length) {
if (!(adudies[_local3] instanceof com.iconnicholson.onehammer.GreenSnowDudie)) {
} else {
var _local4 = adudies[_local3];
if (!_local4.dead) {
_local4.gameover();
}
}
_local3++;
}
ongameover();
}
}
var _local7 = new Array();
var _local6 = 0;
while (_local6 < snowballs.length) {
var _local2 = snowballs[_local6];
_local3 = 0;
while (_local3 < adudies.length) {
if (adudies[_local3] instanceof com.iconnicholson.onehammer.GreenSnowDudie) {
var _local4 = adudies[_local3];
if (((((((_local2.team == "red") && (Math.abs(_local2.ballmc._x - _local4.dudiemc._x) < 30)) && (Math.abs(_local2.ballmc._y - (_local4.dudiemc._y - 20)) < 30)) && (!_local4.dead)) && (!_local4.down)) && (!_local2.dead)) && (!_local2.ineffective)) {
_local2.dead = true;
score = score + 10;
_local4.yougothit();
}
} else if (adudies[_local3] instanceof com.iconnicholson.onehammer.RedSnowDudie) {
var _local5 = adudies[_local3];
if ((((((_local2.team == "green") && (Math.abs(_local2.ballmc._x - _local5.dudiemc._x) < 30)) && (Math.abs(_local2.ballmc._y - (_local5.dudiemc._y - 20)) < 30)) && (!_local5.dead)) && (!_local2.dead)) && (!_local2.ineffective)) {
_local2.dead = true;
_local5.yougothit();
}
}
_local3++;
}
if (((Math.abs(_local2.ballmc._x) > 2999) || (Math.abs(_local2.ballmc._y) > 2999)) || (_local2.dead)) {
_local7.push(_local6);
} else {
_local2.frameloop();
}
_local6++;
}
_local6 = 0;
while (_local6 < adudies.length) {
var _local8 = adudies[_local6];
_local8.frameloop();
_local6++;
}
_local6 = 0;
while (_local6 < _local7.length) {
snowballs[_local7[_local6]].destroy();
snowballs.splice(_local7[_local6], 1);
_local6++;
}
}
function ongameover(win) {
var _local3 = new Date();
var _local2 = _local3.getTime() - starttime.getTime();
if (win) {
if (_local2 < 1800000) {
score = score + Math.round((1800000 - _local2) / 1000);
}
}
gameover = true;
titles.score = score;
if (win) {
titles.gotoAndPlay("gameoverwin");
} else {
titles.gotoAndPlay("gameoverlose");
}
var _local4 = {target:this, type:"gameover"};
dispatchEvent(_local4);
}
function clearbetweenlevels() {
var _local2 = 0;
while (_local2 < adudies.length) {
adudies[_local2].destroy();
_local2++;
}
adudies = new Array();
}
function reset() {
starttime = new Date();
titles._visible = false;
gameover = false;
score = 0;
}
var gameover = false;
var reddudie1startx = 450;
var reddudie1starty = 200;
var reddudie2startx = 420;
var reddudie2starty = 260;
var reddudie3startx = 310;
var reddudie3starty = 250;
var slomo = 0;
var score = 0;
}
Symbol 118 MovieClip [__Packages.com.iconnicholson.onehammer.ASnowDudie] Frame 0
class com.iconnicholson.onehammer.ASnowDudie
{
var stage, sounds, walkendx, walkendy, dudiemc;
function ASnowDudie (stage, sounds) {
this.stage = stage;
this.sounds = sounds;
mx.events.EventDispatcher.initialize(this);
}
function setwalkendx(n) {
walkendx = n;
}
function setwalkendy(n) {
walkendy = n;
}
function setwalkspeed(i) {
walkspeed = i;
}
function frameloop() {
}
function dispatchEvent() {
}
function addEventListener() {
}
function removeEventListener() {
}
function setposition(x, y) {
dudiemc._x = x;
dudiemc._y = y;
}
function checkline(x1, y1, x2, y2, x, y, less) {
var _local3 = (y2 - y1) / (x2 - x1);
var _local7 = (((_local3 * x) - _local3) - x1) + y1;
var _local1 = ((y - y1) / _local3) + x1;
if (less) {
if (x < _local1) {
x = _local1;
}
} else if (x > _local1) {
x = _local1;
}
var _local4 = new Array();
_local4[0] = x;
_local4[1] = y;
return(_local4);
}
function destroy() {
dudiemc.removeMovieClip();
}
var didfirstwalk = false;
var dead = false;
var walking = false;
var walkspeed = 5;
}
Symbol 119 MovieClip [__Packages.com.iconnicholson.onehammer.RedSnowDudie] Frame 0
class com.iconnicholson.onehammer.RedSnowDudie extends com.iconnicholson.onehammer.ASnowDudie
{
static var highestreddudie;
var dudiemc, team, hackparent, dead, walking, dispatchEvent, sounds, stage, walkendx, walkendy, walkxmov, walkymov, walkspeed, checkline;
function RedSnowDudie (stage, sounds) {
super(stage, sounds);
_root.comiter++;
dudiemc = stage.attachMovie("reddudie", "reddudie" + _root.comiter, _root.comiter);
dudiemc.selectioncircle._visible = false;
dudiemc.hackparent = this;
highestreddudie = dudiemc;
dudiemc.onPress = redpress;
dudiemc.onRelease = redrelease;
team = "red";
dudiemc.onRollOver = redrollover;
dudiemc.onRollOut = redrollout;
mx.events.EventDispatcher.initialize(this);
}
function redrollover() {
hackparent.mouseover();
}
function redrollout() {
hackparent.mouserollout();
}
function redpress() {
hackparent.onchosen();
}
function redrelease() {
hackparent.mouserelease();
}
function onchosen() {
if ((dudiemc.dazed || (dead)) || (walking)) {
return(undefined);
}
adobesucksmouseisdownflag = true;
if (dudiemc.getDepth() < highestreddudie.getDepth()) {
dudiemc.swapDepths(highestreddudie);
}
highestreddudie = dudiemc;
var _local2 = {target:this, type:"chosen"};
dispatchEvent(_local2);
dragdudie = true;
dudiemc.gotoAndPlay("cock");
}
function yougothit() {
dragdudie = false;
dudiemc.selectioncircle._visible = false;
adobesucksmouseisdownflag = false;
hitpoints--;
if (hitpoints == 1) {
dazed = 40;
dudiemc.dazed = true;
dudiemc.gotoAndPlay("hitdazed");
sounds.gotoAndPlay("hit1");
sounds.gotoAndPlay("birds");
}
if (hitpoints == 0) {
dead = true;
_root.grounditer++;
var _local3 = stage.createEmptyMovieClip("deadreddudie" + _root.grounditer, _root.grounditer);
dudiemc.swapDepths(_local3);
dudiemc.gotoAndPlay("dead");
sounds.gotoAndPlay("kids" + Math.ceil(Math.random() * 3));
}
}
function mouseover() {
if ((dudiemc.dazed || (dead)) || (walking)) {
return(undefined);
}
dudiemc.selectioncircle._visible = true;
}
function mouserollout() {
dudiemc.selectioncircle._visible = false;
if ((dudiemc.dazed || (dead)) || (walking)) {
return(undefined);
}
dudiemc.gotoAndStop("ready");
}
function throwball() {
var _local2 = 0.001;
trace(dudiemc.meter._currentframe);
if (dudiemc.meter._currentframe > 4) {
_local2 = dudiemc.meter._currentframe / 15;
}
var _local3 = {target:this, type:"throwball", force:_local2, team:team, x:dudiemc._x, y:dudiemc._y - 35, ineffective:_local2 < 0.1};
dispatchEvent(_local3);
}
function mouserelease() {
adobesucksmouseisdownflag = false;
dragdudie = false;
if ((dudiemc.dazed || (dead)) || (walking)) {
return(undefined);
}
throwball();
dudiemc.gotoAndStop("toss");
}
function frameloop() {
if (dead) {
return(undefined);
}
if (walking) {
if ((Math.abs(dudiemc._x - walkendx) < 10) && (Math.abs(dudiemc._y - walkendy) < 10)) {
walking = false;
walkendx = (walkendy = 0);
dudiemc.gotoAndStop("ready");
} else {
dudiemc._x = dudiemc._x + walkxmov;
dudiemc._y = dudiemc._y + walkymov;
if (sounds._currentframe == 1) {
sounds.gotoAndPlay("step");
}
}
return(undefined);
}
if (walkendx) {
walking = true;
dudiemc.gotoAndPlay("walk");
var _local3 = Math.sqrt(Math.pow(walkendy - dudiemc._y, 2) + Math.pow(walkendx - dudiemc._x, 2));
walkxmov = (walkendx - dudiemc._x) / (_local3 / walkspeed);
walkymov = (walkendy - dudiemc._y) / (_local3 / walkspeed);
return(undefined);
}
if (dazed) {
dazed--;
if (dazed == 0) {
dudiemc.dazed = false;
dudiemc.gotoAndStop("ready");
}
}
if (adobesucksmouseisdownflag && (dragdudie)) {
dudiemc._x = stage._xmouse;
dudiemc._y = stage._ymouse;
var _local2 = checkline(592, 0, 0, 320, dudiemc._x, dudiemc._y, 1);
dudiemc._x = _local2[0];
dudiemc._y = _local2[1];
}
}
var hitpoints = 2;
var dazed = 0;
var adobesucksmouseisdownflag = false;
var dragdudie = false;
var olddepth = 0;
}
Symbol 120 MovieClip [__Packages.com.iconnicholson.onehammer.GreenSnowDudie] Frame 0
class com.iconnicholson.onehammer.GreenSnowDudie extends com.iconnicholson.onehammer.ASnowDudie
{
var dudiemc, titles, team, checkline, walking, sounds, dead, stage, walkendx, walkendy, walkspeed, walkxmov, walkymov, dispatchEvent;
function GreenSnowDudie (stage, sounds, titles) {
super(stage, sounds);
_root.comiter++;
dudiemc = stage.attachMovie("greendudie", "greendudie" + _root.comiter, _root.comiter);
dudiemc.hackparent = this;
this.titles = titles;
team = "green";
mx.events.EventDispatcher.initialize(this);
}
function randomdestinationwithinboundaries() {
var _local2 = new Array();
_local2[0] = Math.random() * 500;
_local2[1] = Math.random() * 300;
var _local3 = checkline(610, 0, 0, 340, _local2[0], _local2[1], 0);
_local2[0] = _local3[0];
_local2[1] = _local3[1];
return(_local2);
}
function yougothit() {
walking = false;
cocking = (balling = 0);
dudiemc.justhit = false;
down = (dudiemc.down = false);
hitpoints--;
if (hitpoints == 2) {
dudiemc.justhit = true;
adobefrozenframebugfix = 50;
dudiemc.gotoAndPlay("hit");
sounds.gotoAndPlay("hit1");
}
if (hitpoints == 1) {
down = (dudiemc.down = true);
dudiemc.gotoAndPlay("down");
sounds.gotoAndPlay("hit1");
}
if (hitpoints == 0) {
dudiemc.gotoAndPlay("dead");
dead = true;
_root.grounditer++;
var _local3 = stage.createEmptyMovieClip("deadgreendudie" + _root.grounditer, _root.grounditer);
dudiemc.swapDepths(_local3);
sounds.gotoAndPlay("kids" + Math.ceil(Math.random() * 3));
}
}
function gameover() {
dead = true;
dudiemc.gotoAndPlay("yea");
}
function frameloop() {
if (dead) {
return(undefined);
}
if (dudiemc.down) {
return(undefined);
}
down = false;
if (dudiemc.justhit) {
adobefrozenframebugfix--;
if (adobefrozenframebugfix < 0) {
dudiemc.justhit = false;
}
return(undefined);
}
if (walking) {
if ((Math.abs(dudiemc._x - walkendx) < 10) && (Math.abs(dudiemc._y - walkendy) < 10)) {
dudiemc.gotoAndStop("balling");
if (titles._visible) {
walkspeed = 3;
return(undefined);
}
walking = false;
walkendx = (walkendy = 0);
} else {
dudiemc._x = dudiemc._x + walkxmov;
dudiemc._y = dudiemc._y + walkymov;
if (sounds._currentframe == 1) {
sounds.gotoAndPlay("step");
}
}
return(undefined);
}
if (cocking > 0) {
cocking--;
if (cocking == 10) {
dudiemc.gotoAndStop("toss");
throwball();
}
return(undefined);
}
if ((Math.random() > 0.975) || (walkendx)) {
walking = true;
dudiemc.gotoAndPlay("walk");
if (!walkendx) {
var _local2 = randomdestinationwithinboundaries();
walkendx = _local2[0];
walkendy = _local2[1];
}
var _local3 = Math.sqrt(Math.pow(walkendy - dudiemc._y, 2) + Math.pow(walkendx - dudiemc._x, 2));
walkxmov = (walkendx - dudiemc._x) / (_local3 / walkspeed);
walkymov = (walkendy - dudiemc._y) / (_local3 / walkspeed);
return(undefined);
}
if (titles._visible) {
return(undefined);
}
if (balling > 0) {
balling--;
if (balling <= 0) {
dudiemc.gotoAndStop("cock");
cocking = 15 + Math.round(Math.random() * 30);
}
return(undefined);
}
dudiemc.gotoAndStop("balling");
balling = 10 + Math.round(Math.random() * 50);
}
function throwball() {
var _local2 = {target:this, type:"throwball", force:0.3 + (Math.random() * 0.6), team:team, x:dudiemc._x, y:dudiemc._y - 15};
dispatchEvent(_local2);
}
var balling = 0;
var cocking = 0;
var down = false;
var hitpoints = 3;
var adobefrozenframebugfix = 0;
}
Symbol 121 MovieClip [__Packages.com.iconnicholson.onehammer.SnowBall] Frame 0
class com.iconnicholson.onehammer.SnowBall
{
var stage, sounds, team, force, shadowmc, ballmc, originalx, originaly, xmov, shadowxmov, ymov, shadowymov;
function SnowBall (stage, sounds, team, force, x, y, ineffective) {
this.stage = stage;
this.sounds = sounds;
this.team = team;
this.force = force;
if (ineffective) {
this.ineffective = ineffective;
}
trace(this.ineffective);
if (!_root.shadowiter) {
_root.shadowiter = 550;
}
_root.shadowiter++;
shadowmc = stage.attachMovie("snowballshadow", "snowballshadow" + _root.shadowiter, _root.shadowiter);
shadowmc.hackparent = this;
_root.comiter++;
ballmc = stage.attachMovie("snowball", "snowball" + _root.comiter, _root.comiter);
ballmc.hackparent = this;
ballmc._x = (originalx = x);
ballmc._y = (originaly = y);
shadowmc._x = x;
shadowmc._y = y + 35;
if (this.team == "red") {
xmov = (shadowxmov = -20);
ymov = (shadowymov = -10);
} else if (this.team == "green") {
xmov = (shadowxmov = 20);
ymov = (shadowymov = 10);
}
if (this.force >= 1) {
this.sounds.gotoAndPlay("longthrow");
} else {
this.sounds.gotoAndPlay("throw");
}
}
function destroy() {
ballmc.removeMovieClip();
shadowmc.removeMovieClip();
}
function frameloop() {
if (dead) {
return(undefined);
}
if (team == "red") {
if (ymov > -3) {
ineffective = true;
}
if ((ymov > -2) && (ymov < 50)) {
ymov = 51;
ballmc._visible = false;
shadowmc.gotoAndPlay("land");
sounds.gotoAndPlay("splat");
return(undefined);
}
if (ymov > 50) {
ymov = ymov + 1;
if (ymov > 100) {
dead = true;
}
return(undefined);
}
if ((force != 1) && ((originalx - ballmc._x) > (force * 100))) {
ymov = ymov + (3 - force);
force = force - (force * 0.15);
}
} else if (team == "green") {
if (ymov > 17) {
ineffective = true;
}
if ((ymov > 18) && (ymov < 50)) {
ymov = 51;
ballmc._visible = false;
shadowmc.gotoAndPlay("land");
return(undefined);
}
if (ymov > 50) {
ymov = ymov + 1;
if (ymov > 100) {
dead = true;
}
return(undefined);
}
if ((force < 1) && (Math.abs(originalx - ballmc._x) > (force * 300))) {
ymov = ymov + (2 - force);
force = force - (force * 0.15);
}
}
ballmc._x = ballmc._x + xmov;
ballmc._y = ballmc._y + ymov;
shadowmc._x = shadowmc._x + shadowxmov;
shadowmc._y = shadowmc._y + shadowymov;
}
var dead = false;
var ineffective = false;
var grounddistance = 35;
}