var currentHour = 8;

var currentMinute = 0;

var currentClick = 1;

var obfuscateTime = false;

var ending = false;

var creditCount = 5;

var displayedCredits = 509;

var ninjaInstalled = false;

var corroderInstalled = false;

var gordianInstalled = false;

var opusInstalled = false;



macros['incrementTime'] =

{

handler: function(place, object, parameters)

{

currentMinute += 1 + Math.floor((Math.random() * 3));

if (currentMinute >= 60)

{

currentHour++;

currentMinute -= 60;

}

}

};



macros['printTime'] =

{

handler: function(place, object, parameters)

{

if (ending)

{

insertText(place, "∞");

}

else if (obfuscateTime)

{

insertText(place, "??:??");

}

else

{

var hourString = currentHour < 10 ? "0" + currentHour : currentHour;

\t\t\t

if (currentHour == 24)

{\t\t

hourString = "00";

}





var minuteString = currentMinute < 10 ? "0" + currentMinute : currentMinute;

insertText(place, hourString + ":" + minuteString);

}\t\t

}

};



macros['printPrograms'] =

{

handler: function(place, object, parameters)

{

var hasPrograms = ninjaInstalled || corroderInstalled || opusInstalled || gordianInstalled;



if (hasPrograms == false)

{

return;

}



var programsString = "Programs:\sn";



if (ninjaInstalled)

{

programsString += "<span class=\s"criminal\s">Ninja</span>\sn"

}

\t\t

if (corroderInstalled)

{

programsString += "<span class=\s"anarch\s">Corroder</span>\sn"

}



if (gordianInstalled)

{

programsString += "<span class=\s"shaper\s">Gordian Blade</span>\sn"

}



if (opusInstalled)

{

programsString += "Magnum Opus\sn"

}



new Wikifier(place,"<div class=\s"timewidget\s">" + programsString +"</div>");

}

};



macros['printHardware'] =

{

handler: function(place, object, parameters)

{

var hasHardware = state.history[0].variables.rndInterfaceCount;



if (hasHardware == 0)

{

return;

}



var hardwareString = "Hardware:\sn";



if (state.history[0].variables.rndInterfaceCount > 1)

{

hardwareString += "R&D Interface (" + state.history[0].variables.rndInterfaceCount + ")\sn"

}

else

{

hardwareString += "R&D Interface\sn"

}



new Wikifier(place,"<div class=\s"timewidget\s">" + hardwareString +"</div>");

}

};



macros['printStolenAgendas'] =

{

handler: function(place, object, parameters)

{

if (stolenAgendas.length == 0)

{

return;

}



var agendasString = "Stolen Agendas:\sn";



\t\tfor (var index = 0; index < stolenAgendas.length; index++)

\t\t{

\t\t\tagendasString += "<span class=\s"weyland\s">" + stolenAgendas[index].name + "</span>\sn";

\t\t}



\t\tvar theftProgress = countAgendaPoints(stolenAgendas);



\t\tif (theftProgress >= 7)

\t\t{

\t\t\ttheftProgress = 100;

\t\t}

\t\telse

\t\t{

\t\t\ttheftProgress = theftProgress * 15;

\t\t}



\t\tagendasString += "Victory: " + theftProgress + "%"



new Wikifier(place,"<div class=\s"timewidget\s">" + agendasString + "</div>");

}

};



macros['obfuscateTime'] =

{

handler: function(place, object, parameters)

{

obfuscateTime = true;

}

}



macros['deobfuscateTime'] =

{

handler: function(place, object, parameters)

{

obfuscateTime = false;

}

}



macros['ending'] =

{

handler: function(place, object, parameters)

{

ending = true;

}

}



macros['incrementClick'] =

{

handler: function(place, object, parameters)

{

currentClick++;



currentHour = 4 + currentClick * 4;

currentMinute = 1 + Math.floor((Math.random() * 14));

}

}



macros['resetClicks'] =

{

handler: function(place, object, parameters)

{

currentClick = 1;



currentHour = 4 + currentClick * 4;

currentMinute = 1 + Math.floor((Math.random() * 14));

}

}



macros['modifyDisplayedCredits'] =

{

handler: function(place, object, parameters)

{

displayedCredits += Math.floor(parameters[0]);

creditCount = Math.floor(displayedCredits / 100);

}

};



macros['modifyCredits'] =

{

handler: function(place, object, parameters)

{

creditCount += Math.floor(parameters[0]);

\t\t

\t\tif (state.history[0].variables.isModding == true)

\t\t{

\t\t\tdisplayedCredits += Math.floor(parameters[0]) * 100;

\t\t}

\t\telse

\t\t{

\t\t\tdisplayedCredits = (creditCount * 100) + Math.floor((Math.random() * 15));

\t\t}



}

};



macros['applyBPCredits'] =

{

handler: function(place, object, parameters)

{

creditCount += state.history[0].variables.corpBP;

displayedCredits += (state.history[0].variables.corpBP * 100);

}

};



macros['withdrawUnusedBP'] =

{

handler: function(place, object, parameters)

{

var unusedBP = state.history[0].variables.corpBP - state.history[0].variables.creditsSpentDuringRun;



creditCount -= unusedBP;

displayedCredits -= (unusedBP * 100);

}

};



macros['spendCreditsToBreak'] =

{

handler: function(place, object, parameters)

{

creditCount -= state.history[0].variables.creditsUsedToBreak;

displayedCredits -= (state.history[0].variables.creditsUsedToBreak * 100);

\t\tstate.history[0].variables.creditsUsedToBreak = 0;

}

};



macros['printCredits'] =

{

handler: function(place, object, parameters)

{

if (ending)

{

insertText(place, "∞");

}

else if (state.history[0].variables.isModding == true)

{

insertText(place, displayedCredits - 300);

}

else

{

insertText(place, displayedCredits);

}\t

}

};



macros['installNinja'] = {

handler: function(place, object, parameters)\t

{

ninjaInstalled = true;\t

}

}



macros['installCorroder'] = {

handler: function(place, object, parameters)\t

{

corroderInstalled = true;\t

}

}



macros['installGordian'] = {

handler: function(place, object, parameters)\t

{

gordianInstalled = true;\t

}

}



macros['installOpus'] = {

handler: function(place, object, parameters)\t

{

opusInstalled = true;\t

}

}



function runnerCard(name, id, description, cost, moddedDescription, specialOrderDescription, drawDescription) {

this.name = name;

this.id = id;

this.description = description;

this.cost = cost;

this.moddedDescription = moddedDescription;

this.specialOrderDescription = specialOrderDescription;

this.drawDescription = drawDescription;

}



var runnerDeck = [



new runnerCard("Sure Gamble", 1, "-Use SureGamble.script again to make money in online gambling rings (Cost: Four hours, 500 credits)", 5, "", "", "The computer seems to have found another online gambling site that is vulnerable to exploits. You could use that to make some quick cash, assuming you already have a decent bankroll."),



\tnew runnerCard("Gordian Blade", 0, "-Install Gordian Blade v8.14.3.175, an Icebreaker-Decoder Program capable of breaking Code Gates (Cost: Four hours, 400 credits)", 4, "-Install a Modded Gordian Blade v8.14.3.175, an Icebreaker-Decoder Program capable of breaking Code Gates (Cost: Four hours, 100 credits)", "-Order a Gordian Blade, an Icebreaker Program capable of breaking Code Gates", "The computer found an online repository holding the source code for an Icebreaker program known as \s"Gordian Blade\s". Might be worth checking out."),



\tnew runnerCard("Modded", 1, "-Mod another Program or piece of Hardware yourself, letting you save another 300 credits on the install cost (Cost: Four hours)", 0, "", "", "You find yourself energized, almost manic; you feel like you can create anything. You feel eager to code something, anything - you feel like doing it all by hand, modding everything yourself."),

\tnew runnerCard("Diesel", 1, "-Go on another Diesel binge. The surge of creativity should reveal new options. (Cost: Four hours)", 0, "", "", "A shipment of Diesel energy drinks comes in; you spend some time filling the fridge with it. You silently wonder how many of these cans you could drink before passing out..."),

\tnew runnerCard("Special Order", 1, "-Make another \s"Special Order\s" to some of Mac's connections for a particular Icebreaker Program (Cost: Four hours, 100 credits)", 1, "", "", "You receive a message from one of Mac's connections, saying they're waiting for that \s"Special Order\s" you talked about."),



\tnew runnerCard("R&D Interface", 0, "-Arrange for a backdoor interface to be installed on Weyland's R&D server (Cost: Four hours, 400 credits)", 4, "-Arrange for a Modded backdoor interface to be installed on Weyland's R&D server (Cost: Four hours, 100 credits)", "", "Another message from one of Mac's numerous connections; this one seems to be a corporate employee, working for Weyland's R&D division. If you have a man on the inside, you could certainly make use of that..."),

\tnew runnerCard("Magnum Opus", 0, "-Build your Magnum Opus, a program doubling your money-making efficiency (Cost: Four hours, 500 credits)", 5, "-Build your (heavily Modded) Magnum Opus, a program doubling your money-making efficiency (Cost: Four hours, 200 credits)", "", "You have visions of an incredible program, one capable of making coding almost effortless. A program that reads your mind and codes for you, pulling implementations from all over the Net. This would be your Magnum Opus."),

\tnew runnerCard("The Maker's Eye", 0, "-Use a special meditation technique (\s"The Maker's Eye\s") to run R&D, accessing more data (Cost: Four hours, 200+ credits)", 2, "", "", "The computer unearths a text file detailing an arcane meditation technique known as \s"The Maker's Eye\s". You skim the file suspiciously."),

\tnew runnerCard("Ninja", 1, "-Install Ninja v1.0.0.27, an Icebreaker-Killer Program capable of breaking Sentries (Cost: Four hours, 400 credits)", 4, "-Install a Modded Ninja v1.0.0.27, an Icebreaker-Killer Program capable of breaking Sentries (Cost: Four hours, 100 credits)", "-Order a Ninja, an Icebreaker Program capable of breaking Sentries", "The computer's passive scan of the Net has turned up something interesting: the source code to an Icebreaker program known as \s"Ninja\s", a favorite amongst Criminals."),

\tnew runnerCard("Modded", 2, "-Mod yet another Program or piece of Hardware yourself, letting you save yet another 300 credits on the install cost (Cost: Four hours)", 0, "", "", "You find yourself energized again, bordering on manic; you feel like you can create anything. You feel eager to code something, anything - you feel like doing it all by hand, modding everything yourself."),



\tnew runnerCard("Corroder", 0, "-Install Corroder v0.7.12.3b, an Icebreaker-Fracter Program capable of breaking Barriers (Cost: Four hours, 200 credits)", 2, "-Install a Modded Corroder v0.7.12.3b, an Icebreaker-Fracter Program capable of breaking Barriers (Cost: Four hours)", "-Order a Corroder, an Icebreaker Program capable of breaking Barriers", "In some seedy corner of the Net, the computer found a gem: the source code to an Icebreaker program, a Fracter capable of breaking any Barrier. This is definitely worth your time."),

\tnew runnerCard("Sure Gamble", 2, "-Use SureGamble.script one more time to make money in online gambling rings (Cost: Four hours, 500 credits)", 5, "", "", "The computer seems to have found another online gambling site that is vulnerable to exploits. You could use that to make some quick cash, assuming you already have a decent bankroll."),

\tnew runnerCard("R&D Interface", 1, "-Arrange for a second backdoor interface to be installed on Weyland's R&D server (Cost: Four hours, 400 credits)", 4, "-Arrange for a Modded backdoor interface to be installed on Weyland's R&D server (Cost: Four hours, 100 credits)", "", "Another message from one of Mac's numerous connections; this one seems to be a corporate employee, working for Weyland's R&D division. If you have a man on the inside, you could certainly make use of that..."),

\tnew runnerCard("Magnum Opus", 1, "-Build your Magnum Opus, a program doubling your money-making efficiency (Cost: Four hours, 500 credits)", 5, "-Build your (heavily Modded) Magnum Opus, a program doubling your money-making efficiency (Cost: Four hours, 200 credits)", "", "You have visions of an incredible program, one capable of making coding almost effortless. A program that reads your mind and codes for you, pulling implementations from all over the Net. Wait...didn't you do this already?"),

\tnew runnerCard("Diesel", 2, "-Go on yet another Diesel binge. The surge of creativity should reveal new options. (Cost: Four hours)", 0, "", "", "Another shipment of Diesel energy drinks comes in; you spend some time filling the fridge with it. You silently wonder how many of these cans you could drink before passing out..."),



\tnew runnerCard("The Maker's Eye", 1, "-Use \s"The Maker's Eye\s" again to run R&D, accessing more data (Cost: Four hours, 200+ credits)", 2, "", "", "The computer brings up The Maker's Eye script again. You haven't tried it in a while; who knows what it could turn up. Might be worth a shot."),

\tnew runnerCard("Corroder", 1, "-Install Corroder v0.7.12.3b, an Icebreaker-Fracter Program capable of breaking Barriers (Cost: Four hours, 200 credits)", 2, "-Install a Modded Corroder v0.7.12.3b, an Icebreaker-Fracter Program capable of breaking Barriers (Cost: Four hours)", "-Order a Corroder, an Icebreaker Program capable of breaking Barriers", "In some seedy corner of the Net, the computer found a gem: the source code to an Icebreaker program, a Fracter capable of breaking any Barrier. But hold on, don't you already have one of those?"),



\tnew runnerCard("Gordian Blade", 1, "-Install Gordian Blade v8.14.3.175, an Icebreaker-Decoder Program capable of breaking Code Gates (Cost: Four hours, 400 credits)", 4, "-Install a Modded Gordian Blade v8.14.3.175, an Icebreaker-Decoder Program capable of breaking Code Gates (Cost: Four hours, 100 credits)", "-Order a Gordian Blade, an Icebreaker Program capable of breaking Code Gates", "The computer found an online repository holding the source code for an Icebreaker program known as \s"Gordian Blade\s"...What's going on? Why is this computer suggesting redundant options over and over? Must be a glitch..."),

\tnew runnerCard("The Maker's Eye", 2, "-Use \s"The Maker's Eye\s" one more time to run R&D, accessing more data (Cost: Four hours, 200+ credits)", 2, "", "", "The computer brings up The Maker's Eye script again. It's certainly not the most original option, but at least it's not completely redundant."),

\tnew runnerCard("Magnum Opus", 2, "-Build your Magnum Opus, a program doubling your money-making efficiency (Cost: Four hours, 500 credits)", 5, "-Build your (heavily Modded) Magnum Opus, a program doubling your money-making efficiency (Cost: Four hours, 200 credits)", "", "You have visions of an incredible program, one capable of making coding almost effortless. A program that reads your mind and codes for you, pulling implementations from all over the Net. This thing again? This must be Déjà Vu..."),



\tnew runnerCard("Special Order", 2, "-Make yet another \s"Special Order\s" to some of Mac's connections for a particular Icebreaker Program (Cost: Four hours, 100 credits)", 1, "", "", "You receive a message from one of Mac's connections, saying they're waiting for that \s"Special Order\s" you talked about. You don't think you'll need to take them up on it, but you make a note of it anyways."),

\tnew runnerCard("R&D Interface", 2, "-Arrange for a third backdoor interface to be installed on Weyland's R&D server (Cost: Four hours, 400 credits)", 4, "-Arrange for a Modded backdoor interface to be installed on Weyland's R&D server (Cost: Four hours, 100 credits)", "", "Again, the Weyland snitch messages you. The last two R&D Interfaces worked like a charm; a third one certainly wouldn't hurt."),

\tnew runnerCard("Gordian Blade", 2, "-Install Gordian Blade v8.14.3.175, an Icebreaker-Decoder Program capable of breaking Code Gates (Cost: Four hours, 400 credits)", 4, "-Install a Modded Gordian Blade v8.14.3.175, an Icebreaker-Decoder Program capable of breaking Code Gates (Cost: Four hours, 100 credits)", "-Order a Gordian Blade, an Icebreaker Program capable of breaking Code Gates", "The computer found an online repository holding the source code for an Icebreaker program known as \s"Gordian Blade\s"...Another redundant option? To Hell with this janky computer."),

];



var runnerHand = [

new runnerCard("Ninja", 0, "-Install Ninja v1.0.0.27, an Icebreaker-Killer Program capable of breaking Sentries (Cost: Four hours, 400 credits)", 4, "-Install a Modded Ninja v1.0.0.27, an Icebreaker-Killer Program capable of breaking Sentries (Cost: Four hours, 100 credits)", "-Order a Ninja, an Icebreaker Program capable of breaking Sentries", "The computer's passive scan of the Net has turned up something interesting: the source code to an Icebreaker program known as \s"Ninja\s", a favorite amongst Criminals."),

new runnerCard("Special Order", 0, "-Make a \s"Special Order\s" to some of Mac's connections for a particular Icebreaker Program (Cost: Four hours, 100 credits)", 1, "", "", "You receive a message from one of Mac's connections, saying they're waiting for that \s"Special Order\s" you talked about."),

\tnew runnerCard("Modded", 0, "-Mod a Program or piece of Hardware yourself, letting you save about 300 credits on the install cost (Cost: Four hours)", 0, "", "", "You find yourself energized again, bordering on manic; you feel like you can create anything. You feel eager to code something, anything - you feel like doing it all by hand, modding everything yourself."),

\tnew runnerCard("Diesel", 0, "-Go on a Diesel binge. The surge of creativity should reveal new options. (Cost: Four hours)", 0, "", "", "A shipment of Diesel energy drinks comes in; you spend some time filling the fridge with it. You silently wonder how many of these cans you could drink before passing out...")

];



macros['clickToDraw'] = {

handler: function(place, object, parameters)\t

{

if (runnerDeck.length == 0)

{

return;

}



var cardDrawn = runnerDeck.splice(0, 1)[0];



new Wikifier(place, cardDrawn.drawDescription);



runnerHand.push(cardDrawn);

}

}



macros['specialOrder'] = {

handler: function(place, object, parameters)\t

{

if (runnerDeck.length == 0)

{

return;

}



var index = runnerGetIndexOfCardInDeck(parameters[0]);



runnerHand.push(runnerDeck.splice(index, 1)[0]);

}

}



macros['printCardsInHand'] = {

handler: function(place, object, parameters)\t

{

if (runnerHand.length == 0)

{

new Wikifier(place, "<span class=\s"danger\s">SYSTEMS OVERHEATING. NO OPTIONS AVAILABLE. PLEASE REFRAIN FROM USING THE COMPUTER AT THIS TIME. SELF-DIAGNOSTICS SHOULD BE COMPLETED WITHIN FOUR HOURS.</span>");



return;

}



var index;



for\t(index = 0; index < runnerHand.length; index++)

{

if (runnerHand[index].cost > creditCount)

{

new Wikifier(place, "==" + runnerHand[index].description + "== <span class=\s"notEnough\s">Not enough credits.</span>");

}

else

{

printOption(place, runnerHand[index], index);

}\t



if (index + 1 != runnerHand.length)

{

new Wikifier(place, "\sn");

}

}\t

}

}



macros['printDiscardOptions'] = {

handler: function(place, object, parameters)\t

{

if (runnerHand.length == 0)

{

new Wikifier(place, "<span class=\s"danger\s">You shouldn't be here.</span>");



return;

}



var index;



for\t(index = 0; index < runnerHand.length; index++)

{

new Wikifier(place, "[[Discard " + runnerHand[index].name + "|Discard][$cardToDiscard = " + index + "]].");



if (index + 1 != runnerHand.length)

{

new Wikifier(place, "\sn");

}

}\t

}

}



macros['printClickToDrawOption'] = {

handler: function(place, object, parameters)\t

{

if (runnerDeck.length == 0)

{

new Wikifier(place, "==-Take a nap while the computer searches for new options (Cost: Four hours)== <span class=\s"danger\s">You feel extremely paranoid, like the Weyland Corporation is about to kick down your door any second. You definitely don't feel like napping right now.</span>");



return;

}



new Wikifier(place, "-[[Take a nap while the computer searches for new options (Cost: Four hours)|Draw a card]]");\t

}

}



macros['printTagRemovalOption'] = {

handler: function(place, object, parameters)\t

{

if (creditCount < 2)

{

new Wikifier(place, "==Remove a tag (Cost: Four hours, 200 credits)== <span class=\s"notEnough\s">Not enough credits.</span>");



return;

}



new Wikifier(place, "[[Remove a tag (Cost: Four hours, 200 credits)|Remove a Tag]].");\t

}

}



macros['removeCardJustPlayed'] = {

handler: function(place, object, parameters)\t

{

var index = state.history[0].variables.cardJustPlayed;



runnerHand.splice(index, 1);\t

}

}



macros['applySnareEffect'] = {

handler: function(place, object, parameters)\t

{

\t\tnew Wikifier(place, "<span class=\s"console\s"><span class=\s"danger\s">WARNING: An electrical surge has caused a massive system failure. The following options have been lost:\sn\sn</span></span>");



new Wikifier(place, "<span class=\s"console\s">-" + runnerHand.splice(Math.floor((Math.random() * runnerHand.length)), 1)[0].name + "\sn</span>");\t

\t\tnew Wikifier(place, "<span class=\s"console\s">-" + runnerHand.splice(Math.floor((Math.random() * runnerHand.length)), 1)[0].name + "\sn</span>");

\t\tnew Wikifier(place, "<span class=\s"console\s">-" + runnerHand.splice(Math.floor((Math.random() * runnerHand.length)), 1)[0].name + "\sn\sn</span>");

}

}



macros['discardCard'] = {

handler: function(place, object, parameters)\t

{

var index = state.history[0].variables.cardToDiscard;



if (index >= 0)

{

runnerHand.splice(index, 1);\t

}

}

}



macros['printModdedOptions'] = {

handler: function(place, object, parameters)\t

{

if (runnerHand.length == 0)

{

new Wikifier(place, "<span class=\s"danger\s">Something is wrong. You found a bug, now go report it.</span>");



return;

}



var index;



for\t(index = 0; index < runnerHand.length; index++)

{

var card = runnerHand[index];



switch (card.name)

{

case "Ninja":



if (ninjaInstalled == false && creditCount >= card.cost)

{

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.moddedDescription + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Magnum Opus":



if (opusInstalled == false && creditCount >= card.cost)

{

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.moddedDescription + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Corroder":



if (corroderInstalled == false && creditCount >= card.cost)

{

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.moddedDescription + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Gordian Blade":



if (gordianInstalled == false && creditCount >= card.cost)

{

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.moddedDescription + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;\t



case "R&D Interface":



if (creditCount >= card.cost)

{

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.moddedDescription + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;\t

}

}\t

}

}



macros['printSpecialOrderOptions'] = {

handler: function(place, object, parameters)\t

{

if (corroderInstalled == false && runnerHasCardInHand("Corroder") == false)

{

var index = runnerGetIndexOfCardInDeck("Corroder");



if (index >= 0)

{

var card = runnerDeck[index];

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.specialOrderDescription + "|Order " + card.name + "]]");

}

}



if (gordianInstalled == false && runnerHasCardInHand("Gordian Blade") == false)

{

var index = runnerGetIndexOfCardInDeck("Gordian Blade");



if (index >= 0)

{

var card = runnerDeck[index];

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.specialOrderDescription + "|Order " + card.name + "]]");

}

}





if (ninjaInstalled == false && runnerHasCardInHand("Ninja") == false)

{

var index = runnerGetIndexOfCardInDeck("Ninja");



if (index >= 0)

{

var card = runnerDeck[index];

new Wikifier(place, "\sn");

new Wikifier(place, "[[" + card.specialOrderDescription + "|Order " + card.name + "]]");

}

}

}

}



function printOption(place, card, index)

{

switch (card.name)

{

case "Ninja":



if (ninjaInstalled)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s"> " + card.name + " already installed.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Magnum Opus":



if (opusInstalled)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s"> " + card.name + " already installed.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Corroder":



if (corroderInstalled)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s"> " + card.name + " already installed.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Gordian Blade":



if (gordianInstalled)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s"> " + card.name + " already installed.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Modded":



if (CanPlayModded() == false)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s">No programs or hardware to install.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "Special Order":



if (CanPlaySpecialOrder() == false)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s">Nothing to order.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;

case "The Maker's Eye":



var rndRunCost = GetRunCost(rndIce);



if (rndRunCost == -1)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s">You don't have the Icebreakers necessary to break through R&D.</span>");

}

else if (rndRunCost + 2 > creditCount)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s">Not enough credits to run R&D.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;



case "Diesel":



if (runnerDeck.length < 3)

{

new Wikifier(place, "==" + card.description + "== <span class=\s"notEnough\s">You're pretty sick of Diesel.</span>");

}\t

else

{

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

}\t



break;



default:

\t\t\t

new Wikifier(place, "[[" + card.description + "|Play " + card.name + "][$cardJustPlayed = " + index + "]]");

\t\t\t

break;

}

}



function CanPlayModded()

{

if (corroderInstalled == false && runnerHasCardInHand("Corroder"))

{

return true;

}



if (ninjaInstalled == false && runnerHasCardInHand("Ninja") && creditCount >= 1)

{

return true;

}



if (gordianInstalled == false && runnerHasCardInHand("Gordian Blade") && creditCount >= 1)

{

return true;

}



if (opusInstalled == false && runnerHasCardInHand("Magnum Opus") && creditCount >= 2)

{

return true;

}



if (runnerHasCardInHand("R&D Interface") && creditCount >= 1)

{

return true;

}



return false;

}



function runnerHasCardInHand(cardName)

{

for\t(var index = 0; index < runnerHand.length; index++)

{

if (runnerHand[index].name == cardName)

{

return true;

}

}



return false;

}



function runnerGetIndexOfCardInDeck(cardName)

{

for\t(var index = 0; index < runnerDeck.length; index++)

{

if (runnerDeck[index].name == cardName)

{

return index;

}

}



return -1;

}



function CanPlaySpecialOrder()

{

if (corroderInstalled == false && runnerHasCardInHand("Corroder") == false && runnerGetIndexOfCardInDeck("Corroder") >= 0)

{

return true;

}



if (ninjaInstalled == false && runnerHasCardInHand("Ninja") == false && runnerGetIndexOfCardInDeck("Ninja") >= 0)

{

return true;

}



if (gordianInstalled == false && runnerHasCardInHand("Gordian Blade") == false && runnerGetIndexOfCardInDeck("Gordian Blade") >= 0)

{

return true;

}



return false;

}



///*****************************CORP CODE*******************************///



function getCorpCreditCount()

{

return state.history[0].variables.corpCreditCount;

}



function modifyCorpCreditCount(value)

{

state.history[0].variables.corpCreditCount += value;



if (state.history[0].variables.corpCreditCount < 0) {

throw "Corp credits negative somehow";

}

\t

}



function corpCard(name, id, cost, costToBreak, agendaValue, iceType, description, rezzed) {

this.name = name;

this.id = id;

this.rezzed = rezzed;

if (rezzed == null)

{

this.rezzed = false;

}



this.cost = cost

this.costToBreak = costToBreak;

this.agendaValue = agendaValue;

this.iceType = iceType;

this.advancementCounters = 0;

this.previouslyAccessed = false;

\tthis.description = description;

}



var corpDeck = [

new corpCard("Project Atlas", 0, 3, 0, 2, "", "this is project atlas"),

new corpCard("Green Level Clearance", 0, 1, 0, 0, "", "Green Level Clearance refers to Green-two security clearance, the highest level of security clearance a corp can gain access to within legal bounds. Having high security clearance can be extremely profitable to a Corporation, especially to a known war profiteer such as the Weyland Consortium. By leveraging their security clearance, the corp can accelerate its R&D process and make money simultaneously with very little investment."),

\tnew corpCard("Beanstalk Royalties", 0, 0, 0, 0, "", "The Weyland Space Elevator, colloquially referred to as \s"The Beanstalk\s", is employed by all manners of people, from tourists to megacorporations. The Weyland Consortium has been profiting from the Beanstalk's construction for many many years, essentially enjoying a monopoly on easy access to space and low-Earth orbit. This Operation details plans to retroactively increase the royalty fees levied upon any enterprise employing the Beanstalk, for no reason other than the Consortium's desire for increased profits. No improvements or additional services will be provided; the Beanstalk just costs more to use from now on. Money for nothing, as it were."),

\tnew corpCard("Snare!", 0, 4, 0, 0, "", "this is snare!"),

\tnew corpCard("Blue Level Clearance", 0, 2, 0, 0, "", "Blue Level Clearance refers to Blue-one security clearance, a hypothetical, fictional or highly classified level of security clearance, depending on who you ask. While no corp is supposed to legally have Blue-one security clearance, it appears that the Weyland Consortium has once again achieved something it wasn't supposed to and breached the highest levels of governmental security regulations. Such wide-reaching clearance can be leveraged to accelerate its R&D process and make large amounts of money simultaneously with very little investment."),



\tnew corpCard("Wendigo", 0, 2, 3, 0, "C", "Wendigo is a medium-strength <span class=\s"shaper\s">Code Gate</span>. It can easily be identified by the simulated cold it inflicts upon intruders. Wendigo functions not by stopping Runners outright but instead targeting installed Icebreakers, \s"freezing\s" them. Frozen Icebreakers become unusable for the remainder of the Run. Smart sysops will configure Wendigo to look for Icebreakers capable of breaking through subsequent layers of ICE; as such, Wendigo effectively makes Running impossible if not broken."),

\tnew corpCard("Restructure", 0, 10, 0, 0, "", "Restructure is an extremely complex Operation involving the movement of personnel from department to department to achieve higher levels of efficiency. Such restructuring is always accompanied by mass layoffs as cheaper personnel becomes available. While these practices only result in 1% to 2% increases in profits, these are massively worthwhile to a corporation as rich as the Weyland Consortium. The human cost of such an Operation is always coldly calculated by those in the Administration Department, and once a corporation reaches high enough levels of revenue, it can Restructure its way to ever-higher profits."),

\tnew corpCard("Hostile Takeover", 1, 2, 0, 1, "", "this is ht"),

\tnew corpCard("Rainbow", 0, 3, 3, 0, "BCS", "Rainbow is a medium-strength generic piece of ICE. It employs a three-pronged mode of attack against intruders, incorporating aspects of all types of ICE in its defense. Its blue ribbon mimics Sentries in trying to aggressively kill the Runner's connection and frighten intruders with simulated physical violence. Its red ribbon mimics Barriers in trying to crash the Runner's cyberspace environment, simulating impacts with hard surfaces. Finally, the green ribbon attempts to trap Runners in a virtual cage, making them unable to proceed. Rainbow's mode of attack is both its greatest strength and its downfall: its complexity makes it difficult and expensive to break with any Icebreaker. However, since it incorporates elements of all ICE types, it can be targeted and broken by any Icebreaker, given enough credits."),

\tnew corpCard("Green Level Clearance", 1, 1, 0, 0, "", "Green Level Clearance refers to Green-two security clearance, the highest level of security clearance a corp can gain access to within legal bounds. Having high security clearance can be extremely profitable to a Corporation, especially to a known war profiteer such as the Weyland Consortium. By leveraging their security clearance, the corp can accelerate its R&D process and make money simultaneously with very little investment."),



\tnew corpCard("Scorched Earth", 1, 3, 0, 0, "", "Operation Scorched Earth refers to a Black Ops tactic employed by the Weyland Consortium to deal with problem individuals. Once the target has been identified and located (usually by means of an electronic Tag) their position is then carpet bombed into oblivion through whatever means is most easily explained as an accident after the fact. Due to the Weyland's Consortium involvement in military affairs, demolitions business and power generation, every corner of the civilized world can be targeted by Scorched Earth tactics.\sn\snIn case it isn't obvious, this is a MAJOR threat to your survival, and the number one reason why people don't tend to oppose the Consortium for very long. If you want to stay alive, paranoia is your greatest asset. Do not make Runs when fatigued, always keep some cash on hand and never EVER ignore a tag."),

\tnew corpCard("Hadrian's Wall", 0, 10, 7, 0, "B", "Hadrian's Wall is a high-strength <span class=\s"anarch\s">Barrier</span>. Named after its egotistical designer, this ICE takes the form of bird-construct, usually a bright red to evoke evolutionarily-triggered fears. While its violent representation would seem more appropriate for a dangerous Sentry, this bird is a relatively harmless Barrier. Its talons can do nothing more than end Runs; Hadrian was known for a being both a genius and a big softie with an ornithologist streak. Still, never underestimate the power of Hadrian's Wall. It is impervious to all but the most distributed of attacks, requiring massive amounts of credits to break. This resilience comes at a cost, as it is one of the most expensive pieces of ICE to activate and maintain for a Corporation. Most modern Icebreaker-<span class=\s"anarch\s">Fracters</span> have the capability to take down a Hadrian's Wall long enough to break through, but it remains extremely taxing. The true threat of Hadrian's Wall, however, is not the ICE; it is the Corporation that employs it. Any Corporation willing to go to such extreme lengths to protect its servers would not hesitate to end your life if given the chance."),

\tnew corpCard("Hedge Fund", 0, 5, 0, 0, "", "This is a fairly straightforward Operation, allowing the corp to leverage its existing funds into acquiring more money with little effort. Advances in stock-prediction and market-analysis AIs have made modern Hedge Funds frighteningly efficient.\sn\snOther dictionaries have more colourful definitions: Hedge Fund. Noun. An ingenious device by which the rich get richer even while every other poor SOB is losing his shirt. - The Anarch's Dictionary, Volume Who's Counting?"),

\tnew corpCard("Geothermal Fracking", 0, 4, 0, 2, "", "this is gt"),

\tnew corpCard("Snare!", 1, 4, 0, 0, "", "this is snare!!"),



\tnew corpCard("Project Atlas", 1, 3, 0, 2, "", "this is atlas"),

\tnew corpCard("Melange Mining Corp", 1, 1, 1, 0, "", "this is melange"),

\tnew corpCard("Blue Level Clearance", 1, 2, 0, 0, "", "Blue Level Clearance refers to Blue-one security clearance, a hypothetical, fictional or highly classified level of security clearance, depending on who you ask. While no corp is supposed to legally have Blue-one security clearance, it appears that the Weyland Consortium has once again achieved something it wasn't supposed to and breached the highest levels of governmental security regulations. Such wide-reaching clearance can be leveraged to accelerate its R&D process and make large amounts of money simultaneously with very little investment."),

\tnew corpCard("Priority Requisition", 1, 5, 0, 3, "", "this is prireq"),

\tnew corpCard("Scorched Earth", 2, 3, 0, 0, "", "Operation Scorched Earth refers to a Black Ops tactic employed by the Weyland Consortium to deal with problem individuals. Once the target has been identified and located (usually by means of an electronic Tag) their position is then carpet bombed into oblivion through whatever means is most easily explained as an accident after the fact. Due to the Weyland's Consortium involvement in military affairs, demolitions business and power generation, every corner of the civilized world can be targeted by Scorched Earth tactics.\sn\snIn case it isn't obvious, this is a MAJOR threat to your survival, and the number one reason why people don't tend to oppose the Consortium for very long. If you want to stay alive, paranoia is your greatest asset. Do not make Runs when fatigued, always keep some cash on hand and never EVER ignore a tag."),



\tnew corpCard("Guard", 1, 4, 4, 0, "S", "Guard is a medium-strength <span class=\s"criminal\s">Sentry</span>. It takes the form of a lithe, agile martial artist and attacks intruders with a melee weapon. This, of course, is a ruse; the fighter avatar is meant purely as a distraction for the Guard script, which scans for the source of unauthorized connections and terminates them aggressively. While most Sentries seek to inflict harm on intruders in some form or another, Guard simply kills your connection in the most efficient way possible. It thus has the added upside of being virtually impossible to bypass without an appropriate Icebreaker."),

\tnew corpCard("Beanstalk Royalties", 1, 0, 0, 0, "", "The Weyland Space Elevator, colloquially referred to as \s"The Beanstalk\s", is employed by all manners of people, from tourists to megacorporations. The Weyland Consortium has been profiting from the Beanstalk's construction for many many years, essentially enjoying a monopoly on easy access to space and low-Earth orbit. This Operation details plans to retroactively increase the royalty fees levied upon any enterprise employing the Beanstalk, for no reason other than the Consortium's desire for increased profits. No improvements or additional services will be provided; the Beanstalk just costs more to use from now on. Money for nothing, as it were."),

\tnew corpCard("Rainbow", 1, 3, 3, 0, "BCS", "Rainbow is a medium-strength generic piece of ICE. It employs a three-pronged mode of attack against intruders, incorporating aspects of all types of ICE in its defense. Its blue ribbon mimics Sentries in trying to aggressively kill the Runner's connection and frighten intruders with simulated physical violence. Its red ribbon mimics Barriers in trying to crash the Runner's cyberspace environment, simulating impacts with hard surfaces. Finally, the green ribbon attempts to trap Runners in a virtual cage, making them unable to proceed. Rainbow's mode of attack is both its greatest strength and its downfall: its complexity makes it difficult and expensive to break with any Icebreaker. However, since it incorporates elements of all ICE types, it can be targeted and broken by any Icebreaker, given enough credits."),

\tnew corpCard("Hostile Takeover", 2, 2, 0, 1, "", "this is ht"),

\tnew corpCard("Wendigo", 1, 2, 3, 0, "C", "Wendigo is a medium-strength <span class=\s"shaper\s">Code Gate</span>. It can easily be identified by the simulated cold it inflicts upon intruders. Wendigo functions not by stopping Runners outright but instead targeting installed Icebreakers, \s"freezing\s" them. Frozen Icebreakers become unusable for the remainder of the Run. Smart sysops will configure Wendigo to look for Icebreakers capable of breaking through subsequent layers of ICE; as such, Wendigo effectively makes Running impossible if not broken.a"),



\tnew corpCard("Snare!", 2, 4, 0, 0, "", "this is snare!!!"),

\tnew corpCard("Guard", 2, 4, 4, 0, "S", "Guard is a medium-strength <span class=\s"criminal\s">Sentry</span>. It takes the form of a lithe, agile martial artist and attacks intruders with a melee weapon. This, of course, is a ruse; the fighter avatar is meant purely as a distraction for the Guard script, which scans for the source of unauthorized connections and terminates them aggressively. While most Sentries seek to inflict harm on intruders in some form or another, Guard simply kills your connection in the most efficient way possible. It thus has the added upside of being virtually impossible to bypass without an appropriate Icebreaker."),

\tnew corpCard("Restructure", 1, 10, 0, 0, "", "Restructure is an extremely complex Operation involving the movement of personnel from department to department to achieve higher levels of efficiency. Such restructuring is always accompanied by mass layoffs as cheaper personnel becomes available. While these practices only result in 1% to 2% increases in profits, these are massively worthwhile to a corporation as rich as the Weyland Consortium. The human cost of such an Operation is always coldly calculated by those in the Administration Department, and once a corporation reaches high enough levels of revenue, it can Restructure its way to ever-higher profits."),

\tnew corpCard("Hedge Fund", 1, 5, 0, 0, "", "This is a fairly straightforward Operation, allowing the corp to leverage its existing funds into acquiring more money with little effort. Advances in stock-prediction and market-analysis AIs have made modern Hedge Funds frighteningly efficient.\sn\snOther dictionaries have more colourful definitions: Hedge Fund. Noun. An ingenious device by which the rich get richer even while every other poor SOB is losing his shirt. - The Anarch's Dictionary, Volume Who's Counting?"),

\tnew corpCard("Project Atlas", 2, 3, 0, 2, "", "this is atlas"),



\tnew corpCard("Hadrian's Wall", 1, 10, 7, 0, "B", "Hadrian's Wall is a high-strength <span class=\s"anarch\s">Barrier</span>. Named after its egotistical designer, this ICE takes the form of bird-construct, usually a bright red to evoke evolutionarily-triggered fears. While its violent representation would seem more appropriate for a dangerous Sentry, this bird is a relatively harmless Barrier. Its talons can do nothing more than end Runs; Hadrian was known for a being both a genius and a big softie with an ornithologist streak. Still, never underestimate the power of Hadrian's Wall. It is impervious to all but the most distributed of attacks, requiring massive amounts of credits to break. This resilience comes at a cost, as it is one of the most expensive pieces of ICE to activate and maintain for a Corporation. Most modern Icebreaker-<span class=\s"anarch\s">Fracters</span> have the capability to take down a Hadrian's Wall long enough to break through, but it remains extremely taxing. The true threat of Hadrian's Wall, however, is not the ICE; it is the Corporation that employs it. Any Corporation willing to go to such extreme lengths to protect its servers would not hesitate to end your life if given the chance."),

\tnew corpCard("Blue Level Clearance", 1, 2, 0, 0, "", "Blue Level Clearance refers to Blue-one security clearance, a hypothetical, fictional or highly classified level of security clearance, depending on who you ask. While no corp is supposed to legally have Blue-one security clearance, it appears that the Weyland Consortium has once again achieved something it wasn't supposed to and breached the highest levels of governmental security regulations. Such wide-reaching clearance can be leveraged to accelerate its R&D process and make large amounts of money simultaneously with very little investment."),

\tnew corpCard("Rainbow", 2, 3, 3, 0, "BCS", "Rainbow is a medium-strength generic piece of ICE. It employs a three-pronged mode of attack against intruders, incorporating aspects of all types of ICE in its defense. Its blue ribbon mimics Sentries in trying to aggressively kill the Runner's connection and frighten intruders with simulated physical violence. Its red ribbon mimics Barriers in trying to crash the Runner's cyberspace environment, simulating impacts with hard surfaces. Finally, the green ribbon attempts to trap Runners in a virtual cage, making them unable to proceed. Rainbow's mode of attack is both its greatest strength and its downfall: its complexity makes it difficult and expensive to break with any Icebreaker. However, since it incorporates elements of all ICE types, it can be targeted and broken by any Icebreaker, given enough credits."),

\tnew corpCard("Melange Mining Corp", 2, 1, 1, 0, "", "this is melange"),

\tnew corpCard("Hedge Fund", 2, 5, 0, 0, "", "This is a fairly straightforward Operation, allowing the corp to leverage its existing funds into acquiring more money with little effort. Advances in stock-prediction and market-analysis AIs have made modern Hedge Funds frighteningly efficient.\sn\snOther dictionaries have more colourful definitions: Hedge Fund. Noun. An ingenious device by which the rich get richer even while every other poor SOB is losing his shirt. - The Anarch's Dictionary, Volume Who's Counting?"),



\tnew corpCard("Ice Wall", 1, 1, 1, 0, "B", "Ice Wall is a low-strength <span class=\s"anarch\s">Barrier</span>. It is the most basic of defenses, simply preventing any unauthorized access. Its imposing appearance as an endless, impenetrable wall of Ice is meant to hide its simplicity: any decent Icebreaker-<span class=\s"anarch\s">Fracter</span> will make short work of such shoddy defenses."),

\tnew corpCard("Beanstalk Royalties", 2, 0, 0, 0, "", "The Weyland Space Elevator, colloquially referred to as \s"The Beanstalk\s", is employed by all manners of people, from tourists to megacorporations. The Weyland Consortium has been profiting from the Beanstalk's construction for many many years, essentially enjoying a monopoly on easy access to space and low-Earth orbit. This Operation details plans to retroactively increase the royalty fees levied upon any enterprise employing the Beanstalk, for no reason other than the Consortium's desire for increased profits. No improvements or additional services will be provided; the Beanstalk just costs more to use from now on. Money for nothing, as it were."),

\tnew corpCard("Green Level Clearance", 2, 1, 0, 0, "", "Green Level Clearance refers to Green-two security clearance, the highest level of security clearance a corp can gain access to within legal bounds. Having high security clearance can be extremely profitable to a Corporation, especially to a known war profiteer such as the Weyland Consortium. By leveraging their security clearance, the corp can accelerate its R&D process and make money simultaneously with very little investment."),

\tnew corpCard("Wendigo", 2, 2, 3, 0, "C", "Wendigo is a medium-strength <span class=\s"shaper\s">Code Gate</span>. It can easily be identified by the simulated cold it inflicts upon intruders. Wendigo functions not by stopping Runners outright but instead targeting installed Icebreakers, \s"freezing\s" them. Frozen Icebreakers become unusable for the remainder of the Run. Smart sysops will configure Wendigo to look for Icebreakers capable of breaking through subsequent layers of ICE; as such, Wendigo effectively makes Running impossible if not broken using an Icebreaker-<span class=\s"shaper\s">Decoder</span>."),

\tnew corpCard("Priority Requisition", 2, 5, 0, 3, "", "this is prireq"),



\tnew corpCard("Hadrian's Wall", 2, 10, 7, 0, "B", "Hadrian's Wall is a high-strength <span class=\s"anarch\s">Barrier</span>. Named after its egotistical designer, this ICE takes the form of bird-construct, usually a bright red to evoke evolutionarily-triggered fears. While its violent representation would seem more appropriate for a dangerous Sentry, this bird is a relatively harmless Barrier. Its talons can do nothing more than end Runs; Hadrian was known for a being both a genius and a big softie with an ornithologist streak. Still, never underestimate the power of Hadrian's Wall. It is impervious to all but the most distributed of attacks, requiring massive amounts of credits to break. This resilience comes at a cost, as it is one of the most expensive pieces of ICE to activate and maintain for a Corporation. Most modern Icebreaker-<span class=\s"anarch\s">Fracters</span> have the capability to take down a Hadrian's Wall long enough to break through, but it remains extremely taxing. The true threat of Hadrian's Wall, however, is not the ICE; it is the Corporation that employs it. Any Corporation willing to go to such extreme lengths to protect its servers would not hesitate to end your life if given the chance."),

\tnew corpCard("Restructure", 2, 10, 0, 0, "", "Restructure is an extremely complex Operation involving the movement of personnel from department to department to achieve higher levels of efficiency. Such restructuring is always accompanied by mass layoffs as cheaper personnel becomes available. While these practices only result in 1% to 2% increases in profits, these are massively worthwhile to a corporation as rich as the Weyland Consortium. The human cost of such an Operation is always coldly calculated by those in the Administration Department, and once a corporation reaches high enough levels of revenue, it can Restructure its way to ever-higher profits."),

];



var corpHand = [

new corpCard("Guard", 0, 4, 4, 0, "S", "Guard is a medium-strength <span class=\s"criminal\s">Sentry</span>. It takes the form of a lithe, agile martial artist and attacks intruders with a melee weapon. This, of course, is a ruse; the fighter avatar is meant purely as a distraction for the Guard script, which scans for the source of unauthorized connections and terminates them aggressively. While most Sentries seek to inflict harm on intruders in some form or another, Guard simply kills your connection in the most efficient way possible. It thus has the added upside of being virtually impossible to bypass without an appropriate Icebreaker-<span class=\s"criminal\s">Killer</span>."),

\tnew corpCard("Priority Requisition", 0, 5, 0, 3, "", "this is the pri req that the corp started with"),

\tnew corpCard("Scorched Earth", 0, 3, 0, 0, "", "Operation Scorched Earth refers to a Black Ops tactic employed by the Weyland Consortium to deal with problem individuals. Once the target has been identified and located (usually by means of an electronic Tag) their position is then carpet bombed into oblivion through whatever means is most easily explained as an accident after the fact. Due to the Weyland's Consortium involvement in military affairs, demolitions business and power generation, every corner of the civilized world can be targeted by Scorched Earth tactics.\sn\snIn case it isn't obvious, this is a MAJOR threat to your survival, and the number one reason why people don't tend to oppose the Consortium for very long. If you want to stay alive, paranoia is your greatest asset. Do not make Runs when fatigued, always keep some cash on hand and never EVER ignore a tag.")

];



var rndIce = [

new corpCard("Quandary", 0, 1, 1, 0, "C", "Quandary is a low-strength <span class=\s"shaper\s">Code Gate</span>. It is a simple and harmless trick, filling the intruder's sensory feed with garbage data which the human mind attempts into parse into sensible images through pareidolia. The hallucinations are meant to scare off casual intruders; any seasoned Runner knows that breaking Quandary is a trivial matter for even the most basic Icebreaker-<span class=\s"shaper\s">Decoder</span>.", true)

];



var hqIce = [

new corpCard("Ice Wall", 0, 1, 1, 0, "B", "Ice Wall is a low-strength <span class=\s"anarch\s">Barrier</span>. It is the most basic of defenses, simply preventing any unauthorized access. Its imposing appearance as an endless, impenetrable wall of Ice is meant to hide its simplicity: any decent Icebreaker-<span class=\s"anarch\s">Fracter</span> will make short work of such shoddy defenses.", true)

];



var remoteIce = [

];



var cardsInRemote = [



];



var stolenAgendas = [



];



var scoredAgendas = [

\tnew corpCard("Hostile Takeover", 0, 2, 0, 1),

];



function GetBreakCost(ice)

{

if (ice.iceType != "BCS")

{

return ice.costToBreak;

}

else

{

//special case for rainbow

if (corroderInstalled || gordianInstalled)

{

return ice.costToBreak;

}

else

{

return 4; //cost to break with Ninja

}

}

}



function getIceTypeString(ice)

{

\tswitch (ice.iceType)

\t{

\t\tcase "B":



\t\t\treturn "<span class=\s"anarch\s">Barrier</span>";



\t\t\tbreak;



\t\tcase "C":



\t\t\treturn "<span class=\s"shaper\s">Code Gate</span>";



\t\t\tbreak;



\t\tcase "S":

\t\t\t

\t\t\treturn typeString = "<span class=\s"criminal\s">Sentry</span>";



\t\t\tbreak;



\t\tcase "BCS":



\t\t\treturn typeString = "Generic";



\t\t\tbreak;

\t}



\treturn "";

}



function printServerDescription(server, place)

{

for\t(var index = 0; index < server.length; index++)

{

var ice = server[index];

\t

if (ice.rezzed == false)

{

new Wikifier(place, "-An unknown piece of ICE\sn");\t

}

else

{

var breakString = GetBreakCost(ice) + "00 credits to break";



switch (ice.iceType)

{

case "B":



if (corroderInstalled == false)

{

breakString = "requires a <span class=\s"anarch\s">Fracter</span>";

}

break;



case "C":



if (gordianInstalled == false)

{

breakString = "requires a <span class=\s"shaper\s">Decoder</span>";

}

break;



case "S":



if (ninjaInstalled == false)

{

breakString = "requires a <span class=\s"criminal\s">Killer</span>";

}

break;



case "BCS":



icebreakerInstalled = gordianInstalled || ninjaInstalled || corroderInstalled;



if (icebreakerInstalled == false)

{

breakString = "requires any Icebreaker";

}



break;



}



new Wikifier(place, "-" + ice.name + " (" + getIceTypeString(ice) + ", " + breakString + ")\sn");

}\t\t

}

}



function GetRunCost(server)

{

var runCost = 0;



for\t(var index = 0; index < server.length; index++)

{

var ice = server[index];



if (ice.rezzed == false)

{\t

continue;

}



var icebreakerInstalled = false;



switch (ice.iceType)

{

case "B":



icebreakerInstalled = corroderInstalled;



break;



case "C":



icebreakerInstalled = gordianInstalled;



break;



case "S":



icebreakerInstalled = ninjaInstalled;



break;



case "BCS":



icebreakerInstalled = gordianInstalled || ninjaInstalled || corroderInstalled;



break;



}



if (icebreakerInstalled == false)

{

return -1;

}



runCost += GetBreakCost(ice);

}



return Math.max(runCost - state.history[0].variables.corpBP, 0);

}



macros['printRunOptions'] = {

handler: function(place, object, parameters)\t

{\t\t

var rndRunCost = GetRunCost(rndIce);

var hqRunCost = GetRunCost(hqIce);

var remoteRunCost = GetRunCost(remoteIce);





//R&D

if (rndIce.length == 0)

{

new Wikifier(place, "R&D is currently not protected by any ICE.");

}

else

{

new Wikifier(place, "R&D is protected by the following ICE:\sn");

printServerDescription(rndIce, place);

}\t\t\t\t



var rndMultiAccess = 1 + state.history[0].variables.rndInterfaceCount;

var willAccessNewCards = false;



for (var index = 0; index < rndMultiAccess; index++)

{

if (corpDeck[index].previouslyAccessed == false)

{

willAccessNewCards = true;

}

}

\t

if (willAccessNewCards == false)

{

new Wikifier(place, "==Run R&D== <span class=\s"notEnough\s">You've already run R&D today. Running it again would only let you access the same data as last time.</span>\sn");

}

else if (rndRunCost == -1)

{

new Wikifier(place, "==Run R&D== <span class=\s"notEnough\s">You don't have the Icebreakers necessary to get through.</span>\sn");

}\t

else if (rndRunCost > creditCount)

{

new Wikifier(place, "==Run R&D== <span class=\s"notEnough\s">You don't have enough credits to break through.</span>\sn");

}\t

else

{

var costString = rndRunCost > 0 ? rndRunCost + "00+" : "???";



new Wikifier(place, "[[Run R&D (Cost: At least four hours, " + costString + " credits)|Run Dynamic][$serverBeingRun = \s"R&D\s"]]\sn");

}\t



//HQ

new Wikifier(place, "\snHQ currently holds " + corpHand.length + " distinct interesting piece(s) of data.\sn");



if (hqIce.length == 0)

{

new Wikifier(place, "HQ is currently not protected by any ICE.\sn");

}

else

{

\t\t\t

new Wikifier(place, "HQ is protected by the following ICE:\sn");

printServerDescription(hqIce, place);

}\t\t\t\t



if (corpHand.length == 0)

{

new Wikifier(place, "==Run HQ== <span class=\s"notEnough\s">HQ is currently empty. There's no point in Running on an empty server.</span>\sn");

}

else if (hqRunCost == -1)

{

new Wikifier(place, "==Run HQ== <span class=\s"notEnough\s">You don't have the Icebreakers necessary to get through.</span>\sn");

}\t

else if (hqRunCost > creditCount)

{

new Wikifier(place, "==Run HQ== <span class=\s"notEnough\s">You don't have enough credits to break through.</span>\sn");

}\t

else

{

var costString = hqRunCost > 0 ? hqRunCost + "00+" : "???";



new Wikifier(place, "[[Run HQ (Cost: At least four hours, " + costString + " credits)|Run Dynamic][$serverBeingRun = \s"HQ\s"]]\sn");

}



//Remote

if (cardsInRemote.length == 0)

{

new Wikifier(place, "\snThe remote server is currently empty.\sn");

}

\t\t

if (cardsInRemote.length > 0)

{

if (cardsInRemote[0].rezzed == false)

{

if (cardsInRemote[0].advancementCounters == 0)

{

new Wikifier(place, "\snThe remote server currently hosts an unknown, inactive project.\sn");

}

else

{

new Wikifier(place, "\snThe remote server currently hosts an unknown project. The Weyland Corporation has spent considerable time and money advancing this project, to the tune of " + cardsInRemote[0].advancementCounters + " trillion credits. This indicates this project is either extremely important...or a honeypot meant to entice and trap people like you.\sn");

}

}

else

{

new Wikifier(place, "\snThe remote server currently hosts " + cardsInRemote[0].name + ".\sn");

}

}



if (remoteIce.length == 0)

{

new Wikifier(place, "The remote server is currently not protected by any ICE.\sn");

}

else

{

\t\t\t

new Wikifier(place, "The remote server is protected by the following ICE:\sn");

printServerDescription(remoteIce, place);

}\t\t\t\t



if (cardsInRemote.length == 0)

{

new Wikifier(place, "==Run the Remote Server== <span class=\s"notEnough\s">The Remote Server is currently empty. There's no point in Running on an empty server.</span>\sn");

}

else if (remoteRunCost == -1)

{

new Wikifier(place, "==Run the Remote Server== <span class=\s"notEnough\s">You don't have the Icebreakers necessary to get through.</span>\sn");

}\t

else if (remoteRunCost > creditCount)

{

new Wikifier(place, "==Run the Remote Server== <span class=\s"notEnough\s">You don't have enough credits to break through.</span>\sn");

}\t

else

{

var costString = remoteRunCost > 0 ? remoteRunCost + "00+" : "???";



new Wikifier(place, "[[Run the Remote Server (Cost: At least four hours, " + costString + " credits)|Run Dynamic][$serverBeingRun = \s"Remote\s"]]\sn");

}

}

}



function canBreak(ice)

{

\tswitch (ice.iceType)

\t{

\t\tcase "B":



\t\t\treturn corroderInstalled;



\t\t\tbreak;



\t\tcase "C":



\t\t\treturn gordianInstalled;



\t\t\tbreak;



\t\tcase "S":



\t\t\treturn ninjaInstalled;



\t\t\tbreak;



\t\tcase "BCS":



\t\t\treturn gordianInstalled || ninjaInstalled || corroderInstalled;



\t\t\tbreak;

\t}



\treturn false;

}



function getBreakerString(ice)

{

\tswitch (ice.iceType)

\t{

\t\tcase "B":



\t\t\treturn "<span class=\s"anarch\s">Corroder</span>";



\t\t\tbreak;



\t\tcase "C":



\t\t\treturn "<span class=\s"shaper\s">Gordian Blade</span>";



\t\t\tbreak;



\t\tcase "S":



\t\t\treturn "<span class=\s"criminal\s">Ninja</span>";



\t\t\tbreak;



\t\tcase "BCS":



\t\t\tif (gordianInstalled)

\t\t\t{

\t\t\t\treturn "<span class=\s"shaper\s">Gordian Blade</span>";

\t\t\t}

\t\t\telse if (corroderInstalled)

\t\t\t{

\t\t\t\treturn "<span class=\s"anarch\s">Corroder</span>";

\t\t\t}

\t\t\telse if (ninjaInstalled)

\t\t\t{

\t\t\t\treturn "<span class=\s"criminal\s">Ninja</span>";

\t\t\t}



\t\t\tbreak;

\t}



\treturn "invalid";

}



function getBreakerTypeString(ice)

{

\tswitch (ice.iceType)

\t{

\t\tcase "B":



\t\t\treturn "a <span class=\s"anarch\s">Fracter</span>";



\t\t\tbreak;



\t\tcase "C":



\t\t\treturn "a <span class=\s"shaper\s">Decoder</span>";



\t\t\tbreak;



\t\tcase "S":



\t\t\treturn "a <span class=\s"criminal\s">Killer</span>";



\t\t\tbreak;



\t\tcase "BCS":



\t\t\treturn "an Icebreaker";



\t\t\tbreak;

\t}



\treturn "invalid";

}



macros['printRunText'] =

{

handler: function(place, object, parameters)\t

{\t\t

var server;



switch (state.history[0].variables.serverBeingRun)

{

case "R&D":

\t\t\t\t

server = rndIce;

\t\t\t\t

break;



case "HQ":

\t\t\t\t

server = hqIce;

\t\t\t\t

break;



case "Remote":

\t\t\t\t

server = remoteIce;

\t\t\t\t

break;

\t\t\t

default:

\t\t\t\t

throw "Running invalid server";



break;

}



var iceIndex = state.history[0].variables.iceBeingApproached;



if (iceIndex >= server.length)

{

new Wikifier(place, "You've passed all the ICE protecting the server; now all that's left is to access the contents.\sn\sn");\t\t\t



switch (state.history[0].variables.serverBeingRun)

{

case "R&D":

\t\t\t\t\t

new Wikifier(place, "[[Access R&D|Access Dynamic]].");

\t\t\t\t\tstate.history[0].variables.cardsToMultiAccess = state.history[0].variables.rndInterfaceCount;

\t\t\t\t\t

\t\t\t\t\tif (state.history[0].variables.playingMakersEye == true)

\t\t\t\t\t{

\t\t\t\t\t\tstate.history[0].variables.cardsToMultiAccess += 2;

\t\t\t\t\t}



break;



case "HQ":

\t\t\t\t\t

new Wikifier(place, "[[Access HQ|Access Dynamic]].");

\t\t\t\t\tstate.history[0].variables.cardsToMultiAccess = 0;

\t\t\t\t\t

break;



case "Remote":

\t\t\t\t\t

new Wikifier(place, "[[Access the Remote Server|Access Dynamic]].");

\t\t\t\t\tstate.history[0].variables.cardsToMultiAccess = 0;

\t\t\t\t\t

break;

}\t\t\t

}

else

{

var ice = server[iceIndex];



if (ice.rezzed == false)

{

new Wikifier(place, "You encounter an unknown, inactive piece of ICE.\sn\sn");

if (getCorpCreditCount() < ice.cost)

{

new Wikifier(place, "As you approach the inactive ICE, it fails to react; it seems like whoever is managing this server can't (or doesn't want to?) activate this ICE. Maybe they don't have the budget for it? Either way, it won't stop you. You can keep going freely.\sn\sn");



new Wikifier(place, "[[Continue your Run|Run Dynamic][$iceBeingApproached = $iceBeingApproached + 1]]");



\t\t\t\t\treturn;

}

else

{





\t\t\t\t\tswitch (ice.name)

\t\t\t\t\t{

\t\t\t\t\t\tcase "Wendigo":



\t\t\t\t\t\t\tnew Wikifier(place, "As you approach the inactive ICE, you begin to feel a chill. Somehow there seems to be cold breeze coming the blue ball of data that is the inactive ICE. The sensation is illusory, of course; there is no weather in cyberspace, but it feels real all the same.\sn\snThe ICE begins to project gusts of increasingly cold wind, accompanied by snow. Each wave chills you to the bone as you watch the ICE morph in front of you, growing larger and larger. Deep, cavernous eyes emerge from the shapeless ICE, piercing your soul - peering through you as if it were looking at a precise point in your innards.\sn\snAn entire face forms around the eyes; a skull-like nose cavity floats above two rows of pointed teeth, accompanying tusk-like canines. Tendrils of snowy wind emerge constantly from the ICE, bathing the ghostly visage in white and whipping your body with freezing cold.\sn\sn");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Guard":



\t\t\t\t\t\t\tnew Wikifier(place, "Approaching the ICE, it seems to remain inert. The blue ball of data floats harmlessly in front of you as you pass by it, and you assume it must be inactive.\sn\snSuddenly, your whole body is coursed with a sense of unease, and you barely have time to turn around to see the blue ball transform into the silhouette of a muscular humanoid wielding what appears to be an electrified baton. You command your body to fly away as it comes to life and somersaults towards you, swinging its weapon.\sn\snThe ICE pursues you relentlessly as you fly off, jumping from one unseen platform to the next. Walls begin to form around you, boxing you in and cutting your escape. You get a glimpse of your pursuer's face: a featureless dark blue sphere, marked only by a central pulsing blue light.\sn\sn");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Ice Wall":



\t\t\t\t\t\t\tnew Wikifier(place, "As you approach the inactive ICE, it springs into life, the blue ball stretching into an infinite long wall of Ice. The wall grows and grows, and it seems impossible to distance yourself from it or fly above or below it. You sense an imminent collision...\sn\sn");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Quandary":



\t\t\t\t\t\t\tnew Wikifier(place, "As you approach the inactive ICE, it springs into life, the blue ball turning into a tiny kitten-like figure. A reflective blue helmet covers its head, and hallucinations fill your view when you attempt to focus on the creature. Chaotic noises fill your ears, and you sense your grip on cyberspace loosen...\sn\sn");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Rainbow":



\t\t\t\t\t\t\tnew Wikifier(place, "Staring down the inactive blue ball of ICE, you slowly approach it. It bursts into a rainbow of brightly-colored electronic ribbons, each one covered with complex engravings. The ribbons fly off in all directions, occasionally splitting off and re-merging together moments later. They seem to be paiting the area around you, blocking your escape. The blue ribbon flies directly towards you, its end a knife-like point. You fly backwards and crash into the red ribbon, its surface harder than concrete. Meanwhile, the green ribbon seems to split off into dozens of lines to trace a cage around you.\sn\sn");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Hadrian's Wall":



\t\t\t\t\t\t\tnew Wikifier(place, "Approaching the inactive ICE, the blue ball of data comes into view. Time seems to slow down as the ball turns a deep red and cracks form along its surface. An impossibly loud screech rings in your ears as the ICE explodes into an enormous, fully-formed bird of prey. It spreads majestic wings in front of you, blocking your sight. Glowing printed circuits cover its gigantic body, shifting as data courses through it.\sn\snYou are forced out of your awed trance as the ICE flies up hundreds of meters with one flap of its wings and dives down towards you with alarming speed, talons at the ready. You feel a powerful gust of simulated air on your body as you dodge to one side. From above, you can see it coming back for another pass.\sn\sn");



\t\t\t\t\t\tbreak;

\t\t\t\t\t}



modifyCorpCreditCount(-ice.cost);

ice.rezzed = true;

}

}



\t\t\t//You have encountered (icename)

\t\t\t//it is a (icetype)

\t\t\t//Breaking it using your (program) will cost X credits.

\t\t\t//There are Y more pieces of ICE after this, breaking them all will cost an additional Z credits

\t\t\t//Do you want to break this ice?



\t\t\tnew Wikifier(place, "The system's voice comes online: <span class=\s"console\s">Scan complete. You have encountered " + ice.name + ".</span>\sn\sn");



\t\t\tnew Wikifier(place, "<span class=\s"console\s">" + ice.description + "</span>\sn\sn");



\t\t\tif (canBreak(ice))\t\t

\t\t\t{

\t\t\t\tvar currentIceBreakCost = GetBreakCost(ice);



\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Breaking through it using your " + getBreakerString(ice) + " will cost " + currentIceBreakCost + "00 credits.</span>\sn\sn");



\t\t\t\tif (currentIceBreakCost > creditCount)

\t\t\t\t{

\t\t\t\t\tnew Wikifier(place, "While you have the right program for the job, Icebreakers require massive amounts of computing power, which costs money. And you just don't have enough.\sn\sn");



\t\t\t\t\tswitch (ice.name)

\t\t\t\t\t{

\t\t\t\t\t\tcase "Wendigo":



\t\t\t\t\t\t\tnew Wikifier(place, "As the cold becomes too much to bear, you sense your programs freeze into uselessness. Your vision fades away as [[your run ends|Unsuccessful Run]].");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Guard":



\t\t\t\t\t\t\tnew Wikifier(place, "Cornered, the silhouette catches up to you and swings its baton into your avatar. Your vision turns to static as [[your run ends|Unsuccessful Run]].");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Ice Wall":



\t\t\t\t\t\t\tnew Wikifier(place, "You crash into the enormous wall of ice. The impact brings no pain, but [[your run ends|Unsuccessful Run]].");





\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Quandary":



\t\t\t\t\t\t\tnew Wikifier(place, "The hallucinations are replaced by a film of neon blue, covering your vision. Deafened by the noise, [[your run ends|Unsuccessful Run]].");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Rainbow":



\t\t\t\t\t\t\tnew Wikifier(place, "The red ribbon cuts off your escape, and the green ribbon wraps around you in your confusion. The blue ribbon impales your trapped body and [[your run ends|Unsuccessful Run]].");



\t\t\t\t\t\tbreak;

\t\t\t\t\t\tcase "Hadrian's Wall":



\t\t\t\t\t\t\tnew Wikifier(place, "You attempt to fly away, but the enormous bird catches you easily between its talons. You can feel it crushing your body, but somehow you feel no pain as [[your run ends|Unsuccessful Run]].");



\t\t\t\t\t\tbreak;

\t\t\t\t\t}

\t\t\t\t\t

\t\t\t\t\treturn;

\t\t\t\t}



\t\t\t\tvar remainingIceCount = server.length - (iceIndex + 1);



\t\t\t\tif (remainingIceCount == 0)

\t\t\t\t{

\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">There are no more pieces of ICE protecting the server after this one.</span>\sn\sn");

\t\t\t\t}

\t\t\t\telse

\t\t\t\t{

\t\t\t\t\tvar remainingIce = server.slice(iceIndex + 1);

\t\t\t\t\tvar remainingCost = 0;

\t\t\t\t\tvar unrezzedIceRemains = false;



\t\t\t\t\tfor (var index = 0; index < remainingIce.length; index++)

\t\t\t\t\t{

\t\t\t\t\t\tif (remainingIce[index].rezzed == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tremainingCost += GetBreakCost(remainingIce[index]);

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tunrezzedIceRemains = true;

\t\t\t\t\t\t}

\t\t\t\t\t}



\t\t\t\t\tif (remainingIceCount == 1)

\t\t\t\t\t{

\t\t\t\t\t\tif (remainingCost == 0)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">There is only one piece of ICE protecting the server after this one, but it is inactive and unknown. Breaking it will cost an additional ??? credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">There is only one piece of ICE protecting the server after this one. Breaking it will cost an additional " + remainingCost + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t}

\t\t\t\t\telse

\t\t\t\t\t{

\t\t\t\t\t\tif (unrezzedIceRemains)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">There are " + remainingIceCount + " pieces of ICE protecting the server after this one. Some of them are inactive, unknown. Breaking the known ones will cost " + remainingCost + "00 credits. The break cost for the inactive pieces is unknown.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">There are " + remainingIceCount + " pieces of ICE protecting the server after this one. Breaking them all will cost an additional " + remainingCost + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}\t\t\t\t\t\t

\t\t\t\t\t}



\t\t\t\t\tif (currentIceBreakCost + remainingCost > creditCount)

\t\t\t\t\t{

\t\t\t\t\t\tnew Wikifier(place, "At this point, you can plainly see you won't have enough credits to make it through all the ICE on this server. Even if you have the right programs for the job, Icebreakers require massive amounts of computing power, which costs credits. And you just don't have enough.\sn\sn");



\t\t\t\t\t\tnew Wikifier(place, "You should quit while you're ahead. No sense in spending all that cash just to come up short. [[Give up and end your Run|Unsuccessful Run]].");

\t\t\t\t\t\treturn;

\t\t\t\t\t}

\t\t\t\t}\t



\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Do you want to break through this " + ice.name + "?</span>\sn\sn");



\t\t\t\tnew Wikifier(place, "[[Continue your Run (Cost: " + currentIceBreakCost + "00 credits)|Run Dynamic][$iceBeingApproached = $iceBeingApproached + 1, $creditsUsedToBreak = " + currentIceBreakCost + ", $creditsSpentDuringRun = $creditsSpentDuringRun + " + currentIceBreakCost + "]].\sn\sn");

\t\t\t\tnew Wikifier(place, "[[Give up and end your Run|Unsuccessful Run]].");

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">You need " + getBreakerTypeString(ice) + " program to break through this ICE. Breaking through without it is impossible.</span>\sn\sn");



\t\t\t\tswitch (ice.name)

\t\t\t\t{

\t\t\t\t\tcase "Wendigo":



\t\t\t\t\t\tnew Wikifier(place, "As the cold becomes too much to bear, you sense your programs freeze into uselessness. Your vision fades away as [[your run ends|Unsuccessful Run]].");



\t\t\t\t\tbreak;

\t\t\t\t\tcase "Guard":



\t\t\t\t\t\tnew Wikifier(place, "Cornered, the silhouette catches up to you and swings its baton into your avatar. Your vision turns to static as [[your run ends|Unsuccessful Run]].");



\t\t\t\t\tbreak;

\t\t\t\t\tcase "Ice Wall":



\t\t\t\t\t\tnew Wikifier(place, "You crash into the enormous wall of ice. The impact brings no pain, but [[your run ends|Unsuccessful Run]].");





\t\t\t\t\tbreak;

\t\t\t\t\tcase "Quandary":



\t\t\t\t\t\tnew Wikifier(place, "The hallucinations are replaced by a film of neon blue, covering your vision. Deafened by the noise, [[your run ends|Unsuccessful Run]].");



\t\t\t\t\tbreak;

\t\t\t\t\tcase "Rainbow":



\t\t\t\t\t\tnew Wikifier(place, "The red ribbon cuts off your escape, and the green ribbon wraps around you in your confusion. The blue ribbon impales your trapped body and [[your run ends|Unsuccessful Run]].");



\t\t\t\t\tbreak;

\t\t\t\t\tcase "Hadrian's Wall":



\t\t\t\t\t\tnew Wikifier(place, "You attempt to fly away, but the enormous bird catches you easily between its talons. You can feel it crushing your body, but somehow you feel no pain as [[your run ends|Unsuccessful Run]].");



\t\t\t\t\tbreak;

\t\t\t\t}

\t\t\t}

}\t

}

}



function removeCardFromServer(cardName, server)

{

\tswitch (server)

\t{

\t\tcase "R&D":

\t\t\t

\t\t\tfor (var index = 0; index < corpDeck.length; index++)

\t\t\t{

\t\t\t\tif (corpDeck[index].name == cardName)

\t\t\t\t{

\t\t\t\t\treturn corpDeck.splice(index, 1)[0];

\t\t\t\t}

\t\t\t}\t\t\t\t

\t\t\t

\t\t\tbreak;



\t\tcase "HQ":

\t\t\t

\t\t\tfor (var index = 0; index < corpHand.length; index++)

\t\t\t{

\t\t\t\tif (corpHand[index].name == cardName)

\t\t\t\t{

\t\t\t\t\treturn corpHand.splice(index, 1)[0];

\t\t\t\t}

\t\t\t}



\t\t\tbreak;



\t\tcase "Remote":



\t\t\tvar cardRemoved = cardsInRemote.splice(0, 1)[0];



\t\t\treturn cardRemoved;

\t\t\t

\t\t\tbreak;

\t\t

\t\tdefault:

\t\t\t

\t\t\tthrow "invalid server";



\t\t\tbreak;

\t}



\tthrow "CARD NOT FOUND";



\treturn null;

}



function countAgendaPoints(agendas)

{

\tvar agendaPoints = 0;



\tfor (var index = 0; index < agendas.length; index++)

\t{

\t\tagendaPoints += agendas[index].agendaValue;

\t}



\treturn agendaPoints;

}



macros['trashMelangeFromServerBeingRun'] = {

handler: function(place, object, parameters)\t

{\t

\t\tremoveCardFromServer("Melange Mining Corp", state.history[0].variables.serverBeingRun);



\t\tcreditCount -= 1;

displayedCredits -= 100;



\t\tstate.history[0].variables.creditsSpentDuringRun += 1;

\t}

}



macros['printAccessText'] = {

handler: function(place, object, parameters)\t

{\t\t

var cardBeingAccessed;\t\t



switch (state.history[0].variables.serverBeingRun)

{

case "R&D":

\t\t\t\t

\t\t\t\tif (state.history[0].variables.isMultiAccessing == false)

\t\t\t\t{

\t\t\t\t\tnew Wikifier(place, "Passing the final piece of ICE protecting R&D, you are whisked away to the cyberspace representation of one of their datacores. Peering inside, you can see a massive amount of data, shifting to and fro...This is the project nearing completion within R&D; if left alone, the Corporation will be ready to use it within 24 hours.\sn\sn");

\t\t\t

\t\t\t\t\tif (state.history[0].variables.cardsToMultiAccess > 0)

\t\t\t\t\t{

\t\t\t\t\t\tstate.history[0].variables.isMultiAccessing = true;

\t\t\t\t\t}

\t\t\t\t}

\t\t\t\telse

\t\t\t\t{

\t\t\t\t\tnew Wikifier(place, "Venturing deeper into R&D, you are whisked away to the cyberspace representation of another one of their datacores. Peering inside, you can see a massive amount of data, shifting to and fro...");

\t\t\t\t\t

\t\t\t\t\tif (state.history[0].variables.currentRnDMultiAccessIndex == 0)

\t\t\t\t\t{

\t\t\t\t\t\tnew Wikifier(place, "You've trashed everything else that was in progress within R&D, so you suspect this project will be moved to priority #1. In all likelyhood the Corporation will be ready to use it within 24 hours.\sn\sn");

\t\t\t\t\t}

\t\t\t\t\telse

\t\t\t\t\t{

\t\t\t\t\t\tnew Wikifier(place, "This is a project deeper within R&D, and so it is not actively being developped. It is further along in the R&D pipeline, so it may be ready soon, but not necessarily right away.\sn\sn");

\t\t\t\t\t}

\t\t\t\t}\t\t\t\t



\t\t\t\tcardBeingAccessed = corpDeck[state.history[0].variables.currentRnDMultiAccessIndex];\t\t\t\t

\t\t\t\t

break;



case "HQ":

\t\t\t\t

\t\t\t\tvar cardsInHQ = corpHand.length;



\t\t\t\tif (cardsInHQ == 1)

\t\t\t\t{

\t\t\t\t\tnew Wikifier(place, "Passing the final piece of ICE protecting HQ, you are whisked away to the cyberspace representation of the only datacore left in the server. Peering inside, you can see a massive amount of data, shifting back and forth...\sn\sn");

\t\t\t\t}

\t\t\t\telse

{

\t\t\t\t\tnew Wikifier(place, "Passing the final piece of ICE protecting HQ, you are whisked away to the cyberspace representation of one of the " + cardsInHQ + " datacores in the server. The datacores are completely anonymous from the outside, and so the script is forced to pick one at random. Let's hope it picked a good one this time...\sn\sn");

\t\t\t\t}

\t\t\t\t

\t\t\t\tcardBeingAccessed = corpHand[Math.floor((Math.random() * cardsInHQ))];



break;



case "Remote":

\t\t\t\t

\t\t\t\tnew Wikifier(place, "Passing the final piece of ICE protecting the Remote Server, you are whisked away to the cyberspace representation of the datacore being hosted remotely. Peering inside, you can see a truly massive amount of data, in constant flux...\sn\sn");



cardBeingAccessed = cardsInRemote[0];

\t\t\t\t

break;

\t\t\t

default:

\t\t\t\t

throw "Running invalid server";



break;

}



\t\tnew Wikifier(place, "The system's voice chimes in: <span class=\s"console\s">You have accessed a datacore labeled <span class=\s"weyland\s">" + cardBeingAccessed.name + "</span>.</span>\sn\sn");



\t\tcardBeingAccessed.previouslyAccessed = true;



\t\tvar cardRemoved = false;



\t\t//card is an agenda

\t\tif (cardBeingAccessed.agendaValue > 0)

\t\t{

\t\t\tswitch (cardBeingAccessed.agendaValue)

\t\t\t{

\t\t\t\tcase 1:



\t\t\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This is a project of high importance to the Weyland Corporation, one of the Corporation's most sensitive Agendas. Accessing and stealing this data will assuredly disrupt the Corporation's plans.</span>\sn\sn");



\t\t\t\tbreak;



\t\t\t\tcase 2:



\t\t\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This is a project of extreme importance to the Weyland Corporation, one of the Corporation's most secret Agendas. Accessing and stealing this data will throw the Corporation into disarray.</span>\sn\sn");



\t\t\t\tbreak;



\t\t\t\tcase 3:



\t\t\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This is a project of utmost importance to the Weyland Corporation. It is the Corporation's most critical Agenda. Accessing and stealing this data will harm the Corporation in a major way, possibly beyond repair.</span>\sn\sn");



\t\t\t\tbreak;

\t\t\t}

\t\t\t

\t\t\tnew Wikifier(place, "You grin as you order the system to download the entire contents of the datacore to your rig. Within seconds the transfer is complete, and you input the command to wipe the Corporate datacore clean. Out of spite, you upload a few viruses to the datacore. You doubt they'll do any real damage, but it will add insult to the injury and piss off whatever sysops has to clean up your mess.\sn\sn");



\t\t\tstolenAgendas.push(removeCardFromServer(cardBeingAccessed.name, state.history[0].variables.serverBeingRun));



\t\t\tcardRemoved = true;

\t\t

\t\t\tif (countAgendaPoints(stolenAgendas) >= 7)

\t\t\t{

\t\t\t\tnew Wikifier(place, "As the last bits of the datacore are wiped out, you are overcome by a powerful sense of satisfaction. You've made it virtually impossible for them to recover from your attacks. You jack out and exhale, confident that [[it's all over|Win the Game]].");



\t\t\t\treturn;

\t\t\t}

\t\t}

\t\t//card is trashable

\t\telse if (cardBeingAccessed.name == "Melange Mining Corp")

\t\t{

\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This project is identical to the first mining operation we disrupted on the Moon. Most likely this is an effort by the Weyland Corporation to recoup their losses and get their operation back online. Disrupting it again would deny the Corporation colossal amounts of credits.</span>.\sn\sn");

\t\t\t

\t\t\tif (creditCount <= 0)

\t\t\t{

\t\t\t\tnew Wikifier(place, "==Contract a Scrubber and disrupt Melange Mining Corp (Cost: 100 credits)== <span class=\s"notEnough\s">Not enough credits.</span>.\sn\sn");

\t\t\t}

\t\t\telse if (state.history[0].variables.cardsToMultiAccess > 0)

\t\t\t{

\t\t\t\tnew Wikifier(place, "[[Contract a Scrubber and disrupt Melange Mining Corp (Cost: 100 credits)|Access Dynamic][$trashMelange = true]].\sn\sn");

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tnew Wikifier(place, "[[Contract a Scrubber and disrupt Melange Mining Corp (Cost: 100 credits)|Successful Run][$trashMelange = true]].\sn\sn");

\t\t\t}\t\t\t

\t\t}\t\t

\t\t//card is Snare!

\t\telse if (cardBeingAccessed.name == "Snare!")\t\t

\t\t{

\t\t\t//auto-trash the snare

\t\t\tremoveCardFromServer(cardBeingAccessed.name, state.history[0].variables.serverBeingRun);



\t\t\tif (getCorpCreditCount() >= 4)

\t\t\t{

\t\t\t\tmodifyCorpCreditCount(-4);

\t\t\t\tnew Wikifier(place, "[[The system's voice is immediately drowned out by harsh noise and excruciating pain|Snare!]].");

\t\t\t\treturn;

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This is an extremely dangerous ambush, capable of killing Runners who access it through spikes of neural feedback. The ones who survive are then electronically tagged, providing the Corporation with their GPS coordinates. Tagged individuals are usually terminated with extreme prejudice within 24 hours.\sn\snTo minimize the danger of Snares, follow these rules:\sn\sn-Never Run a server while your system is offering less than three options. An overworked rig will be fried by the Snare; take frequent breaks to let it cool off.\sn-Never Run a server as the last thing you do before going to sleep. If you hit a Snare, you won't have enough time to remove the ensuing tag before the Corporate goons break down your door in the middle of the night.\sn-Never ignore a Tag. Remove it ASAP if you want to live.\sn-Snares are expensive to trigger; if the Corporation is running low on funds (less than ~4 Trillion credits) they won't be able to afford to trigger the trap and it'll remain inert and harmlessly trashed.</span>\sn\snWow. Seems like you were lucky this time. You silently thank the chaotic forces of the Universe for working out in your favor, command the system to destroy the inactive Snare and move on.\sn\sn");

\t\t\t}\t\t\t

\t\t}

\t\t//non-agenda, non-asset card (ICE, operation)

\t\telse

\t\t{

\t\t\tif (cardBeingAccessed.iceType != "")

\t\t\t{

\t\t\t\t//ICE

\t\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This is a piece of ICE, which the Corporation can use to protect its servers. " + cardBeingAccessed.description + "</span>\sn\sn");

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\t//operation

\t\t\t\tnew Wikifier(place, "The system continues: <span class=\s"console\s">This is an Operation, which the Corporation can put into action given enough time and money.\sn\sn" + cardBeingAccessed.description + "\sn\snAs with all Operations, there is no way for you to interfere or sabotage it, but being warned of its existence can be helpful.</span>\sn\sn");

\t\t\t}\t\t\t

\t\t\t

\t\t\tif (cardBeingAccessed.iceType != "")

\t\t\t{

\t\t\t\tswitch (cardBeingAccessed.iceType) {

\t\t\t\t\tcase "B":



\t\t\t\t\t\tif (corroderInstalled == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be able to break through it using your <span class=\s"anarch\s">Corroder</span> for the cost of " + GetBreakCost(cardBeingAccessed) + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be unable to break through it. A <span class=\s"anarch\s">Fracter</span> is required.</span>\sn\sn");

\t\t\t\t\t\t}



\t\t\t\t\t\tbreak;



\t\t\t\t\tcase "C":



\t\t\t\t\t\tif (gordianInstalled == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be able to break through it using your <span class=\s"shaper\s">Gordian Blade</span> for the cost of " + GetBreakCost(cardBeingAccessed) + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be unable to break through it. A <span class=\s"shaper\s">Decoder</span> is required.</span>\sn\sn");

\t\t\t\t\t\t}



\t\t\t\t\t\tbreak;



\t\t\t\t\tcase "S":



\t\t\t\t\t\tif (ninjaInstalled == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be able to break through it using your <span class=\s"criminal\s">Ninja</span> for the cost of " + GetBreakCost(cardBeingAccessed) + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be unable to break through it. A <span class=\s"criminal\s">Decoder</span> is required.</span>\sn\sn");

\t\t\t\t\t\t}



\t\t\t\t\t\tbreak;



\t\t\t\t\tcase "BCS":



\t\t\t\t\t\tif (corroderInstalled == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be able to break through it using your <span class=\s"anarch\s">Corroder</span> for the cost of " + GetBreakCost(cardBeingAccessed) + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse if (gordianInstalled == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be able to break through it using your <span class=\s"shaper\s">Gordian Blade</span> for the cost of " + GetBreakCost(cardBeingAccessed) + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse if (ninjaInstalled == true)

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be able to break through it using your <span class=\s"criminal\s">Ninja</span> for the cost of " + GetBreakCost(cardBeingAccessed) + "00 credits.</span>\sn\sn");

\t\t\t\t\t\t}

\t\t\t\t\t\telse

\t\t\t\t\t\t{

\t\t\t\t\t\t\tnew Wikifier(place, "<span class=\s"console\s">Should the Corporation install this ICE, you will be unable to break through it. An Icebreaker is required.</span>\sn\sn");

\t\t\t\t\t\t}



\t\t\t\t\t\tbreak;

\t\t\t\t}\t\t\t\t

\t\t\t}

\t\t}



\t\t//can multiaccess

\t\tif (state.history[0].variables.cardsToMultiAccess > 0)

\t\t{

\t\t\tif (state.history[0].variables.playingMakersEye == true && state.history[0].variables.cardsToMultiAccess > state.history[0].variables.rndInterfaceCount)

\t\t\t{

\t\t\t\tnew Wikifier(place, "Using your enhanced perception granted by The Maker's Eye, you perceive additional distant datacores within R&D.\sn\sn");

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tnew Wikifier(place, "The information granted by your backdoor R&D Interface proves useful, and you can access additional distant datacores within R&D.\sn\sn");

\t\t\t}



\t\t\tstate.history[0].variables.cardsToMultiAccess -= 1;



\t\t\tif (cardRemoved == false)

\t\t\t{

\t\t\t\tnew Wikifier(place, "[[Dig deeper into R&D|Access Dynamic][$currentRnDMultiAccessIndex = $currentRnDMultiAccessIndex + 1]].");

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tnew Wikifier(place, "[[Dig deeper into R&D|Access Dynamic]].");

\t\t\t}

\t\t}

\t\t//the run is over, successful

\t\telse

\t\t{

\t\t\tnew Wikifier(place, "[[Exit the Server, ending your run|Successful Run]].");

\t\t}

\t}

}



macros['printSnareOptions'] = {

handler: function(place, object, parameters)\t

{\t\t

\t\t//can multiaccess

\t\tif (state.history[0].variables.cardsToMultiAccess > 0)

\t\t{

\t\t\tif (state.history[0].variables.playingMakersEye == true && state.history[0].variables.cardsToMultiAccess > state.history[0].variables.rndInterfaceCount)

\t\t\t{

\t\t\t\tnew Wikifier(place, "Using your enhanced perception granted by The Maker's Eye, you perceive additional distant datacores within R&D. Hopefully this next one won't be a trap...\sn\sn");

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tnew Wikifier(place, "The information granted by your backdoor R&D Interface proves useful, and you can access additional distant datacores within R&D. Hopefully this next one won't be a trap...\sn\sn");

\t\t\t}



\t\t\tstate.history[0].variables.cardsToMultiAccess -= 1;



\t\t\tnew Wikifier(place, "There's no way they would hide two of these Snares in a row, right? [[Dig deeper into R&D|Access Dynamic]].");

\t\t}

\t\t//the run is over, successful

\t\telse

\t\t{

\t\t\tnew Wikifier(place, "At least now the trap has been sprung and destroyed, you won't have to deal with it in the future. Plus, traps like this one are expensive. If they're spending resources on traps, they're not spending resources advancing their Agendas.\sn\sn[[Exit the Server, ending your run|Successful Run]].");

\t\t}

\t}

}



macros['changeCyberspaceMusicForAgendas'] = {

handler: function(place, object, parameters)\t

\t{

\t\tif (stolenAgendas.length >= 2 && state.history[0].variables.currentCyberspaceMusic != "cyberspace2.mp3")

\t\t{

\t\t\tnew Wikifier(place, "\sn\snEven though the Net looks the same as it always has, it feels different today somehow. It feels more...familiar? Like you've come into your own, like the Net has become your second home. You certainly feel more at home on the Net than you do anywhere else these days.\sn\snYou feel more mature, more accomplished, more confident. Raiding corporate servers has become routine; it's just what you do. It feels natural. It feels //right//.\sn\snIn the more practical sense, you can sense all the frantic back-and-forth communications traversing Weyland's internal servers. The Corporation is in an extremely rough shape. Your next big heist might just be the killing blow.\sn\snEnough nonsense. Let's get to work.");

\t\t\t

\t\t\tstate.history[0].variables.currentCyberspaceMusic = "cyberspace2.mp3";



\t\t}

\t}

}



function corpHasCardInHand(cardName) {

for (var index = 0; index < corpHand.length; index++) {

if (corpHand[index].name == cardName) {

return true;

}

}



return false;

}



function corpIndexOfCardInHand(cardName) {

for (var index = 0; index < corpHand.length; index++)

\t{

if (corpHand[index].name == cardName)

\t\t{

return index;

}

}



return -1;

}



macros['printEndOfTurnOptions'] = {

handler: function(place, object, parameters)\t

{\t\t

\t\tif (state.history[0].variables.tagCount > 0)

\t\t{

\t\t\tvar scorchCount = 0;



\t\t\tfor (var index = 0; index < corpHand.length; index++)

\t\t\t{

if (corpHand[index].name == "Scorched Earth")

\t\t\t\t{

scorchCount += 1;

}

}



\t\t\tif (corpDeck[0].name == "Scorched Earth")

\t\t\t{

\t\t\t\tscorchCount += 1;

\t\t\t}



\t\t\tvar availableCredits = getCorpCreditCount();



\t\t\tif (corpHasCardInHand("Beanstalk Royalties") || corpDeck[0].name == "Beanstalk Royalties")

\t\t\t{

\t\t\t\tavailableCredits += 3;

\t\t\t}

\t\t\telse if (corpHasCardInHand("Green Level Clearance") || corpDeck[0].name == "Green Level Clearance")

\t\t\t{

\t\t\t\tavailableCredits += 2;

\t\t\t}

\t\t\telse

\t\t\t{

\t\t\t\tavailableCredits += 1;

\t\t\t}



\t\t\tif (availableCredits >= 6 && scorchCount >= 2)

\t\t\t{

\t\t\t\tnew Wikifier(place, "<<fadeinsound $gameOverMusic >><<fadeoutsound $currentAmbianceMusic >>Dreaming of man-eating Venus Flytraps, [[you sleep restlessly|Die to scorched earth]]...");

\t\t\t\treturn;

\t\t\t}

\t\t\telse if (availableCredits >= 2 && scorchCount >= 1 && runnerHand.length < 4)

\t\t\t{

\t\t\t\tnew Wikifier(place, "<<fadeinsound $gameOverMusic >><<fadeoutsound $currentAmbianceMusic >>Dreaming of man-eating Venus Flytraps, [[you sleep restlessly|Die to scorched earth]]...");

\t\t\t\treturn;

\t\t\t}

\t\t}

\t\telse if (state.history[0].variables.cardsInHand > 5)

\t\t{

\t\t\tnew Wikifier(place, "[[Clean up unused options|Discard]].");

\t\t\treturn;

\t\t}



\t\tnew Wikifier(place, "[[You fall asleep|Corporate Status]].");\t\t

\t}

}



var corpTurnResultString = "CORP TURN RESULTS GO HERE.";

var availableCorpClicks = 3;



function corpDraw()

{

\tif (corpDeck.length == 0)

\t{

\t\tthrow "corp deck empty!!!";

\t}



\tvar cardDrawn = corpDeck.splice(0, 1)[0];



corpHand.push(cardDrawn);

}



function corpHasAgendasInHQ()

{

\tfor (var index = 0; index < corpHand.length; index++)

\t{

if (corpHand[index].agendaValue > 0)

\t\t{

return true;

}

}



\treturn false;

}



macros['executeCorpTurn'] = {

handler: function(place, object, parameters)\t

{\t\t

\t\tavailableCorpClicks = 3;





\t\tif (state.history[0].variables.developerMode == true)

\t\t{

\t\t\tcorpTurnResultString = "corp cards in hand at start of turn: " + corpHand.length + "\sn\sn";\t\t

\t\t}



\t\t//mandatory draw

\t\tcorpDraw(); \t

\t\tcorpTurnResultString = "The Weyland Consortium's R&D Department continues churning ever forward as another project leaves the R&D server and enters HQ, ready to be deployed.\sn\sn";



\t\t//if we can use an installed melange and have less than 25 credits, use melange

\t\tif (cardsInRemote.length > 0 && getCorpCreditCount() < 25 && cardsInRemote[0].name == "Melange Mining Corp")

\t\t{

\t\t\tif (cardsInRemote[0].rezzed == false && getCorpCreditCount() >= 1)

\t\t\t{

\t\t\t\tcardsInRemote[0].rezzed = true;

\t\t\t\tmodifyCorpCreditCount(-1);

\t\t\t\tcorpTurnResultString = "Activity in Weyland's remote server has been detected; this spike of activity appears to come from an off-planet server. Press releases indicate that the Weyland Consortium's mining operations have resumed activity. In all likelihood, they've repaired the damage you caused early in your career and their Helium-3 mining is back underway. Unless disrupted, the corp will be making money hand over fist - and a rich corporation is a dangerous corporation.\sn\sn";



\t\t\t\tmodifyCorpCreditCount(7);

\t\t\t\treturn;

\t\t\t}

\t\t\telse if (cardsInRemote[0].rezzed == true)

\t\t\t{

\t\t\t\tmodifyCorpCreditCount(7);

\t\t\t\tcorpTurnResultString += "Weyland's remote server is still buzzing with activity; it seems like they're concentrating all their efforts on getting as much profit as they can out of their mining operation. At the moment they're bringing in upwards of 7 trillions of credits //every day//. If you don't intervene soon by Running the remote server, they'll soon have more money than God, at which point we are all well and truly screwed.\sn\sn";

\t\t\t\treturn;

\t\t\t}\t\t\t

\t\t}



\t\t//if we can score an agenda in the remote, score it

\t\tif (cardsInRemote.length > 0 && cardsInRemote[0].agendaValue > 0 && getCorpCreditCount() >= 3 && cardsInRemote[0].cost == cardsInRemote[0].advancementCounters + 3)

\t\t{

\t\t\tvar agendaScored = removeCardFromServer(cardsInRemote[0].name, "Remote");



\t\t\tscoredAgendas.push(agendaScored);



\t\t\tstate.history[0].variables.corpAgendaPoints = countAgendaPoints(scoredAgendas);



\t\t\tmodifyCorpCreditCount(-3);



\t\t\tswitch (agendaScored.name)

\t\t\t{

\t\t\t\tcase "Priority Requisition":



\t\t\t\tcorpTurnResultString += "Systems detected a colossal burst of activity within the Remote server, followed by that server being systemically emptied of its contents overnight. This pattern usually only means one thing, and it's never good news: the corporation has successfully completed a key project and advanced its Agenda. Given the fact that this project took multiple days to advance to completion as well as the investment of some 5 trillion credits, this project was a major one. Conservative estimates would say that the Corporate Agenda has progressed by at least 45% due to the completion of this project.\sn\snThe exact nature of the project is unknown, and even specialty news sites are tight-lipped about the nature of this \s"Priority Requisition\s" project that has been completed.\sn\sn";



\t\t\t\tbreak;



\t\t\t\tcase "Project Atlas":



\t\t\t\tcorpTurnResultString += "Systems detected a colossal burst of activity within the Remote server, followed by that server being systemically emptied of its contents overnight. This pattern usually only means one thing, and it's never good news: the corporation has successfully completed a key project and advanced its Agenda. Fringe news sites are awash with rumours and leaks of a supposed \s"Project