Frame 1
stop();
_global.ROOT = this;
preloader.onEnterFrame = function () {
loaded = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
this.bar._xscale = loaded;
this.perc.text = loaded;
trace(loaded);
if (loaded >= 100) {
_root.gotoAndStop("game");
}
};
Frame 2
function initGame(dLevel) {
if (dLevel == "hard") {
MONEY_PER_UNITS = 6;
FIXED_COST_DIVIDER = 500;
OIL_DIVIDER = 10;
} else if (dLevel == "medium") {
MONEY_PER_UNITS = 7;
FIXED_COST_DIVIDER = 500;
OIL_DIVIDER = 10;
} else {
MONEY_PER_UNITS = 9;
FIXED_COST_DIVIDER = 500;
OIL_DIVIDER = 10;
}
striking = (boycotting = 0);
buildingIds = ["raw", "resin", "compound", "transformation", "hq", "city", "landfill"];
STR_WARNING_PVC = "Warning! This application stream requires an upgrade of the resin production plant ";
raw = {fullName:"Raw materials", description:"PVC or Polyvinyl chloride is a thermoplastic made of 57% chlorine (derived from salt) and 43% ethylene (derived from oil). It is less dependent than other polymers on crude oil or natural gas, which are not renewable, and can therefore be regarded as a natural resource-saving plastic. ", angle:-35};
resin = {fullName:"PVC resin production ", description:"Here chlorine and ethylene, the raw materials for PVC, are transformed to produce an intermediate raw material called ethylene dichloride (EDC). EDC is then thermally cracked to produce VCM or vinyl chloride monomer. Finally, VCM is polymerised to produce PVC.", angle:-104, actions:{resinUp1:{fullName:"Upgrade plant 1", pic:"up1", description:"Increase resin production capacity", active:true, created:false, price:PVC_PLANT1_PRICE}, resinUp2:{fullName:"Upgrade plant 2", pic:"up2", description:"Increase resin production capacity", active:false, created:false, price:PVC_PLANT2_PRICE}, resinUp3:{fullName:"Upgrade plant 3", pic:"up3", description:"Increase resin production capacity", active:false, created:false, price:PVC_PLANT3_PRICE}, subProducts:{fullName:"Recover by-products", pic:"subproduct", description:"Increase sustainability and reduce costs", points:6, price:3500, active:true}, heat:{fullName:"Heat recovery ", pic:"heat", description:"Increase sustainability and reduce costs", points:5, price:4000, active:true}, water:{fullName:"Water treatment", pic:"water", description:"Reduce environmental impact", points:6, price:2000, active:true}, emissions:{fullName:"Reduce emissions", pic:"emissions", description:"Reduce environmental impact", points:7, price:2800, active:true}, resinSecurity:{fullName:"Health and safety", pic:"work", description:"Improve workers' safety conditions", points:4, price:2500, active:true}}};
compound = {fullName:"Compounding", description:"PVC compounds are produced by blending PVC resin with stabilisers, plasticisers, pigments and other additives to give the required properties in the final product. PVC compounds are available in granules. Either PVC resin is blended with additives and fed into melt processing or extrusion equipment, or PVC resin is blended with additives as a dry powder \u2013 a process which is known as \u2018dry blending\u2019.", angle:-134, actions:{RandD1:{fullName:"R&D 1", pic:"red1", description:"Improve PVC characteristics", active:true, price:3500}, RandD2:{fullName:"R&D 2", pic:"red2", description:"Develop formulations for new applications", active:true, price:2800}, Risk1:{fullName:"Stabilisers", pic:"red3", description:"Support stabilisers' risk assessment and invest in alternative additives (e.g. lead substitution)", points:5, price:2000, active:true}, Risk2:{fullName:"Plasticisers", pic:"red4", description:"Support plasticisers' risk assessment. Invest in research & development", points:5, price:3500, active:true}, compoundSecurity:{fullName:"Health and safety", pic:"work", description:"Improve workers' safety conditions", points:4, price:1000, active:true}}};
transformation = {fullName:"Manufacturing", description:"Here you can build new manufacturing plants. Each stream has particular material usage and market demand. Plan carefully your expansion according to your resin production capacity.", angle:172, actions:{ind1:{fullName:"Activate PVC flooring stream", pic:"floors", picStop:"floorsStop", description:"More than 50% of the PVC production goes into construction applications such as pipes, flooring, membranes, window profiles and cable. The use of PVC and other plastics in thermal insulation helps saving a significant amount of energy used for lighting and heating buildings.", active:true, price:4000}, ind2:{fullName:"Activate PVC pipes stream", pic:"pipes", picStop:"pipesStop", description:"PVC products are helping to improve people\u2019s lives and conserve natural resources on a daily basis. This is highly relevant in a world that is growing in population and places ever-increasing demands on water, food, shelter, sanitation, energy, health services and economic security.", active:true, price:3000}, ind3:{fullName:"Activate PVC membranes stream", pic:"membranes", picStop:"membranesStop", description:"PVC products are helping to improve people\u2019s lives and conserve natural resources on a daily basis. This is highly relevant in a world that is growing in population and places ever-increasing demands on water, food, shelter, sanitation, energy, health services and economic security.", active:true, price:5000}, ind4:{fullName:"Activate PVC windows stream", pic:"windows", picStop:"windowsStop", description:"PVC is an energy-efficient plastic. Its production uses significantly smaller amounts of energy when compared to other plastics. PVC window profiles have up to three times the heat insulation efficiency of other profiles. Using PVC cuts energy consumption from heating and air conditioning systems.", active:true, price:6000}, ind5:{fullName:"Activate PVC pakaging stream", pic:"packages", picStop:"packagesStop", description:"PVC has both excellent chemical resistance and mechanical properties, and therefore lends itself well to food, medical and technical packaging. PVC applications present safe and healthy solutions for consumers.", active:true, price:8000}, ind6:{fullName:"Activate PVC medical devices stream ", pic:"medicals", picStop:"medicalsStop", description:"Sensitive applications like medical devices e.g. gloves and fluid bags benefit from PVC\u2019s physical and technical characteristics. These ensure maximum health protection. ", active:true, price:12000}, ind7:{fullName:"Activate PVC hi-tech stream ", pic:"hitech", picStop:"hitechStop", description:"PVC is used in a great number of fields ranging from essential services to housing, transportation, consumer products, IT and electronics and medical devices and products. The applications are generally divided on the basis of the hardness of products, e.g. rigidity or flexibility.", active:true, price:18000}}};
STR_HQ = "This is the area where your actions are evaluated.";
hq = {fullName:"Industry Database ", description:STR_HQ + hqMessages, angle:114};
city = {fullName:"City", description:"The city represents the market, the place where collection and recycling schemes are activated, and where communication campaigns are developed.", angle:72, actions:{household:{fullName:"MSW", pic:"RSU", description:"Municipal Solid Waste collection programme", price:1000, active:true}, construction:{fullName:"B&C waste", pic:"construction", description:"Separate collection programme for waste from Building and Construction ", price:1500, active:true}, industrial:{fullName:"Industrial waste", pic:"industrial", description:"Industrial waste collection and recycling", price:2500, active:true}, advertising:{fullName:"Advertising", pic:"adv", description:"Develop an advertising campaign", price:2000, active:true}, greenwash:{fullName:"Communications", pic:"communication", description:"This action can contribute to improve awareness and perception in the short-term, but it must be accompanied by concrete measures", price:1000, active:true}}};
landfill = {fullName:"Waste management", description:"Disposal and recycling", angle:17, actions:{incinerator:{fullName:"Energy recovery", pic:"fire", description:"Build an incinerator with energy recovery", active:true, price:8000}, mechanical:{fullName:"Mechanical recycling", pic:"mechRec", description:"Build a mechanical recycling plant", active:true, price:6000}, chemical:{fullName:"Feedstock recycling", pic:"chemRec", description:"Build a feedstock recycling plant", active:true, price:10000}}};
messages = {insufficientPVC:{fullName:"Warning! PVC shortage", pic:"worker", description:"Upgrade PVC resin plant", mc:"resin", active:false, level:2}, insufficientCollecting:{fullName:"Warning! Collection", pic:"worker", description:"Recycling plants are over dimensioned compared to collection: increase collection", mc:"landfill", active:false, level:1}, insufficientRecycling:{fullName:"Warning! Recycling", pic:"worker", description:"Warning! too little separated waste is recycled or incinerated", mc:"landfill", active:false, level:1}, blockedIndustries:{fullName:"Blocked Industries", pic:"worker", description:"Warning! Some industries are blocked due to PVC resin shortage", mc:"transformation", active:false, level:2}, workersWarning:{fullName:"Warning! Trade unions", pic:"union", description:"Warning! Trade unions are concerned about worker safety in resin production and compounding plants", mc:"hq", active:false, level:1}, workersWarning2:{fullName:"Warning! Trade unions call for strike", pic:"union", description:"Warning! Safety measures are insufficient, workers at risk of accidents", mc:"hq", active:false, level:2}, strike:{fullName:"Strike", pic:"union", description:"Workers on strike, unions call for new safety measures", mc:"hq", active:false}, ecoWarning:{fullName:"NGOs concerned", pic:"environmentalist", description:"Environmental groups are concerned about the environmental impact of resin production", mc:"hq", active:false, level:1}, ecoWarning2:{fullName:"EU concerned", pic:"politician", description:"EU asks for improvements in PVC resin production plant", mc:"hq", active:false, level:2}, sanction:{fullName:"EU fine", pic:"politician", description:("EU fine of " + SANCTION) + " \u20AC because you ignored the request for plant improvement", mc:"hq", active:false}, consumerWarning:{fullName:"Consumers concerned", pic:"consumer", description:"Consumers are concerned, NGOs raise alarm about risk of toxic chemicals from PVC products", mc:"hq", active:false, level:1}, consumerWarning2:{fullName:"Consumers upset", pic:"consumer", description:"Study shows potential risk to human health using certain chemicals in the compounding process. A risk assessment is required and alternatives should be investigated", mc:"hq", active:false, level:2}, boycott:{fullName:"Boycott", pic:"consumer", description:"Consumers boycott PVC products", mc:"hq", active:false}, noIndustries:{fullName:"Build your first industry", pic:"ceo", description:"In this area you may build manufacturing plants. Choose the first plant to start", mc:"transformation", active:true}, lowMoney:{fullName:"Warning: lack of cash", pic:"ceo", description:"Your money has nearly run out; if you go into the red, you will be fired", mc:"hq", active:false, level:2}, tooMuchMoney:{fullName:"Investment needed", pic:"ceo", description:"\u2013 You are accumulating too much cash: the Management Board asks for more investment", mc:"hq", active:false, level:1}, euWarning:{fullName:"NGOs concerned", pic:"environmentalist", description:"Environmental groups consider your recycling efforts inadequate", mc:"hq", active:false, level:1}, euWarning2:{fullName:"EU concerned", pic:"politician", description:"EU asks for improvements in waste management and recycling", mc:"hq", active:false, level:2}, euSanction:{fullName:"EU fine", pic:"politician", description:("EU fine of " + EU_SANCTION) + " \u20AC because you ignored the request for recycling improvement", mc:"hq", active:false}};
lifeCycle = new Array();
oilPrices = new Array();
oilPrice = Math.round((MAX_OIL_PRICE + MIN_OIL_PRICE) / 2);
planetHigh();
closeBox();
warningBox._visible = false;
selectedBld = undefined;
rolledBld = undefined;
collectionPotential = 0;
recyclingPotential = 0;
burningPotential = 0;
wasteBonus = 0;
workersDissent = 0;
consumerDissent = 0;
ecoDissent = 0;
euDissent = 0;
cycle = 0;
fixedPoints = 0;
interfaceMC.sustainBar.bar.gotoAndStop(fixedPoints + 1);
marketBonus = 0;
interfaceMC.menuBG.onRollOver = function () {
};
buildings = new Object();
b = 0;
while (b < buildingIds.length) {
bName = buildingIds[b];
buildings[bName] = _root[bName];
b++;
}
b = 0;
while (b < buildingIds.length) {
bName = buildingIds[b];
mc = earth[bName];
earth[bName + "_baloon"]._visible = false;
mc.area.onRelease = function () {
earth.destination = buildings[this._parent._name].angle;
openBox(this._parent._name);
playSound("scroll");
};
mc.area.onRollOver = function () {
rollOverBuilding(this._parent._name);
};
mc.area.onRollOut = function () {
rollOutBuilding(this._parent._name);
};
earth[bName + "_roll"]._visible = false;
mc._alpha = 0;
bt = interfaceMC.fastMenu[bName];
bt.img.gotoAndStop(bName);
bt.gotoAndStop("normal");
bt.onRelease = function () {
earth._rotation = buildings[this._name].angle;
openBox(this._name);
playSound("scroll");
};
bt.onRollOver = function () {
rollOverBuilding(this._name);
earth[rolledBld + "_roll"]._visible = false;
this.gotoAndStop("roll");
};
bt.onRollOut = function () {
rollOutBuilding(this._name);
this.gotoAndStop("normal");
};
if (infoBox[bName] != undefined) {
layer = infoBox[bName];
} else {
layer = infoBox.createEmptyMovieClip(bName, infoBox.getNextHighestDepth());
layer.attachMovie("infoBoxField", "description", 10, {_x:10, _y:50});
}
layer.description.field.htmlText = buildings[bName].description;
createButtons(bName);
layer._visible = false;
b++;
}
earth.resinMC.resinUp1.gotoAndStop(1);
earth.resinMC.resinUp2.gotoAndStop(1);
earth.resinMC.resinUp3.gotoAndStop(1);
earth.cityMC.adv.gotoAndStop(1);
earth.cityMC.com.gotoAndStop(1);
earth.destination = buildings.transformation.angle;
for (i in industries) {
industries[i].active = false;
industries[i].price = transformation.actions[i].price;
earth.transformationMC[i]._visible = false;
earth.transformationMC[i].gotoAndStop(1);
earth.transformationMC[i].mc.stop();
}
earth.landfillMC.incinerator.gotoAndStop(1);
earth.landfillMC.mechanical.gotoAndStop(1);
earth.landfillMC.chemical.gotoAndStop(1);
earth.landfillMC.incinerator._visible = false;
earth.landfillMC.mechanical._visible = false;
earth.landfillMC.chemical._visible = false;
infoBox.resin.needleDisplay.tit = (infoBox.resin.needleDisplay.helpText.text = "PLANT USAGE");
infoBox.landfill.colBar.tit = (infoBox.landfill.colBar.helpText.text = "COLLECTING");
infoBox.landfill.recBar.tit = (infoBox.landfill.recBar.helpText.text = "RECYCLING");
infoBox.raw.lineChart.tit = (infoBox.raw.lineChart.helpText.text = "OIL PRICE");
infoBox.transformation.barMat.helpText.text = "MATERIAL USAGE";
infoBox.transformation.barMar.helpText.text = "MARKET DEMAND";
infoBox.transformation.barMat._visible = (infoBox.transformation.barMar._visible = false);
infoBox.transformation.barColors._visible = false;
infoBox.hq.arrow.gotoAndStop("equal");
interfaceMC.moneyDisplay.arrow.gotoAndStop("equal");
infoBox.hq.up.onPress = function () {
this._parent.description.onEnterFrame = function () {
this.field.scroll--;
};
};
infoBox.hq.up.onRelease = function () {
this._parent.description.onEnterFrame = undefined;
};
infoBox.hq.down.onPress = function () {
this._parent.description.onEnterFrame = function () {
this.field.scroll++;
};
};
infoBox.hq.down.onRelease = function () {
this._parent.description.onEnterFrame = undefined;
};
gameSpeed = 1;
interfaceMC.playBt.gotoAndStop("selected");
interfaceMC.pauseBt.gotoAndStop("normal");
interfaceMC.ffwdBt.gotoAndStop("normal");
titleBox.field.text = transformation.fullName;
interfaceMC.playBt.body.onRelease = function () {
changeSpeed(1);
this._parent.gotoAndStop("selected");
playSound("click");
};
interfaceMC.playBt.body.onRollOver = function () {
closeBox();
titleBox.field.text = STR_PLAY_BT;
titleBox.destination = TITLE_YOPEN;
};
interfaceMC.playBt.body.onRollOut = function () {
titleBox.destination = TITLE_YCLOSED;
};
interfaceMC.pauseBt.body.onRelease = function () {
changeSpeed(0);
this._parent.gotoAndStop("selected");
playSound("click");
};
interfaceMC.pauseBt.body.onRollOver = function () {
closeBox();
titleBox.field.text = STR_PAUSE_BT;
titleBox.destination = TITLE_YOPEN;
};
interfaceMC.pauseBt.body.onRollOut = function () {
titleBox.destination = TITLE_YCLOSED;
};
interfaceMC.ffwdBt.body.onRelease = function () {
changeSpeed(2);
this._parent.gotoAndStop("selected");
playSound("click");
};
interfaceMC.ffwdBt.body.onRollOver = function () {
closeBox();
titleBox.field.text = STR_FFWD_BT;
titleBox.destination = TITLE_YOPEN;
};
interfaceMC.ffwdBt.body.onRollOut = function () {
titleBox.destination = TITLE_YCLOSED;
};
interfaceMC.closeBt.onRelease = function () {
ROOT.areYouSure.gotoAndPlay(1);
ROOT.areYouSure._visible = true;
ROOT.engineOn = false;
ROOT.gamePaused = true;
playSound("click");
};
interfaceMC.closeBt.onRollOver = function () {
closeBox();
titleBox.field.text = STR_CLOSE_BT;
titleBox.destination = TITLE_YOPEN;
};
interfaceMC.closeBt.onRollOut = function () {
titleBox.destination = TITLE_YCLOSED;
};
theEnd.titleField.text = END_TITLE;
theEnd.descriptionField.text = END_DESCRIPTION;
theEnd.economicField.text = ECO_STR;
theEnd.environmentalField.text = ENV_STR;
gameOver.descriptionField.text = GAME_OVER_DESCRIPTION;
gameOver.button.onRelease = (theEnd.button.onRelease = (areYouSure.ok.onRelease = function () {
this._parent._visible = false;
titleMenu.gotoAndStop("menu");
initGame();
ROOT.gamePaused = false;
playSound("click");
}));
theEnd._visible = false;
gameOver._visible = false;
areYouSure.no.onRelease = function () {
this._parent._visible = false;
ROOT.engineOn = true;
ROOT.gamePaused = false;
playSound("click");
};
interfaceMC.timeBar.stop();
maxDemand = 0;
resinUse = 0;
money = STARTING_MONEY;
maxResin = STARTING_MAXRESIN;
displayMoney(money);
engineOn = true;
blocked = false;
clearInterval(economyIntervalId);
economyIntervalId = setInterval(this, "economy", TIME_SPEED);
ROOT.createEmptyMovieClip("soundBox", -1000);
menuMode();
}
function createButtons(id) {
cont = infoBox[id].createEmptyMovieClip("buttons", 20);
item = buildings[id];
for (a in item.actions) {
action = item.actions[a];
if (action.active) {
d = cont.getNextHighestDepth();
bt = cont.attachMovie("actionButton", a, d, {_y:BUTTONS_H, _x:d * ((BUTTON_RAD * 2) + BUTTON_MARGIN)});
bt.action = item.actions[a];
bt.aName = a;
bt.pic.attachMovie(action.pic, "pic", 10);
bt.bld = id;
bt.gotoAndStop("normal");
bt.stop._visible = false;
bt.onRollOver = function () {
this._parent._parent.description.field.htmlText = this.action.description;
if (this.action.price != undefined) {
if (money < this.action.price) {
this.price.gotoAndStop("no");
} else {
this.price.gotoAndStop("ok");
}
this.price.field.text = this.action.price + "\u20AC";
this.price._visible = true;
} else {
this.price._visible = false;
}
titleBox.field.text = this.action.fullName;
this.gotoAndStop("roll");
if (this._parent._parent._name == "transformation") {
infoBox.transformation.barMat._visible = (infoBox.transformation.barMar._visible = true);
infoBox.transformation.barColors._visible = true;
infoBox.transformation.barMat.gotoAndStop(industries[this.aName].mat);
infoBox.transformation.barMar.gotoAndStop(industries[this.aName].mar);
if (pvcLeft < industries[this.aName].pvc) {
this._parent._parent.description.field.htmlText = this._parent._parent.description.field.htmlText + (("<font color='#FF0000'>" + STR_WARNING_PVC) + "</font>");
}
}
};
bt.onDragOut = (bt.onRollOut = function () {
if (this._parent._parent._name == "transformation") {
infoBox.transformation.barMat._visible = (infoBox.transformation.barMar._visible = false);
infoBox.transformation.barColors._visible = false;
}
this._parent._parent.description.field.htmlText = buildings[selectedBld].description;
titleBox.field.text = buildings[selectedBld].fullName;
this.gotoAndStop("normal");
});
bt.onReleaseOutside = (bt.onRelease = function () {
if (this.action.price != undefined) {
if ((money >= this.action.price) || (cheating)) {
if (this.action.points != undefined) {
fixedPoints = fixedPoints + this.action.points;
sustPerc = ((fixedPoints + bPoints) + rPoints) + 1;
interfaceMC.sustainBar.bar.gotoAndStop(sustPerc);
}
if (!cheating) {
money = money - this.action.price;
}
displayMoney(money);
doAction(this._name);
this._parent._parent.description.field.htmlText = buildings[selectedBld].description;
titleBox.field.text = buildings[selectedBld].fullName;
createButtons(this.bld);
} else {
trace("errore");
}
} else {
doAction(this._name);
createButtons(this.bld);
}
});
}
}
cont._x = ((BOX_W / 2) - (cont._width / 2)) + BUTTON_RAD;
}
function rollOverBuilding(id) {
if ((id != rolledBld) && (earth.destination == undefined)) {
earth[rolledBld + "_roll"]._visible = false;
rolledBld = id;
closeBox();
titleBox.field.text = buildings[id].fullName;
titleBox.destination = TITLE_YOPEN;
earth[id + "_roll"]._visible = true;
}
}
function rollOutBuilding() {
if ((!boxOpened) && (earth.destination == undefined)) {
earth[rolledBld + "_roll"]._visible = false;
titleBox.destination = TITLE_YCLOSED;
rolledBld = undefined;
}
}
function openBox(id) {
earth[rolledBld + "_roll"]._visible = false;
infoBox[selectedBld]._visible = false;
selectedBld = id;
planet.destination = PLANET_LOW;
titleBox.destination = TITLE_YOPEN;
infoBox.destination = BOX_YOPEN;
infoBox[id]._visible = true;
if (id == "transformation") {
infoBox.transformation.barMat._visible = (infoBox.transformation.barMar._visible = (infoBox.transformation.barColors._visible = false));
}
boxOpened = true;
}
function closeBox() {
infoBox.destination = BOX_YCLOSED;
titleBox.destination = TITLE_YCLOSED;
boxOpened = false;
}
function displayMoney(m) {
interfaceMC.moneyDisplay.field.text = Math.round(m);
}
function doAction(act) {
switch (act) {
case "resinUp1" :
resin.actions.resinUp1.created = true;
resin.actions.resinUp1.active = false;
resin.actions.resinUp2.active = true;
earth.resinMC.resinUp1.play();
playSound("buybuilding");
maxResin = 60;
break;
case "resinUp2" :
resin.actions.resinUp2.created = true;
resin.actions.resinUp2.active = false;
earth.resinMC.resinUp2.play();
resin.actions.resinUp3.active = true;
maxResin = 80;
playSound("buybuilding");
break;
case "resinUp3" :
resin.actions.resinUp3.created = true;
resin.actions.resinUp3.active = false;
earth.resinMC.resinUp3.play();
maxResin = 100;
playSound("buybuilding");
break;
case "ind1" :
industries.ind1.active = true;
transformation.actions.ind1.active = false;
earth.transformationMC.ind1._visible = true;
earth.transformationMC.ind1.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "ind2" :
industries.ind2.active = true;
transformation.actions.ind2.active = false;
earth.transformationMC.ind2._visible = true;
earth.transformationMC.ind2.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "ind3" :
industries.ind3.active = true;
transformation.actions.ind3.active = false;
earth.transformationMC.ind3._visible = true;
earth.transformationMC.ind3.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "ind4" :
industries.ind4.active = true;
transformation.actions.ind4.active = false;
earth.transformationMC.ind4._visible = true;
earth.transformationMC.ind4.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "ind5" :
industries.ind5.active = true;
transformation.actions.ind5.active = false;
earth.transformationMC.ind5._visible = true;
earth.transformationMC.ind5.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "ind6" :
industries.ind6.active = true;
transformation.actions.ind6.active = false;
earth.transformationMC.ind6._visible = true;
earth.transformationMC.ind6.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "ind7" :
industries.ind7.active = true;
transformation.actions.ind7.active = false;
earth.transformationMC.ind7._visible = true;
earth.transformationMC.ind7.play();
clearWarning("noIndustries");
playSound("buybuilding");
break;
case "incinerator" :
earth.landfillMC.incinerator._visible = true;
landfill.actions.incinerator.active = false;
earth.landfillMC.incinerator.play();
burningPotential = burningPotential + BURN_POTENTIAL;
playSound("buybuilding");
break;
case "mechanical" :
landfill.actions.mechanical.active = false;
earth.landfillMC.mechanical._visible = true;
earth.landfillMC.mechanical.play();
recyclingPotential = recyclingPotential + MECH_POTENTIAL;
playSound("buybuilding");
break;
case "chemical" :
earth.landfillMC.chemical._visible = true;
landfill.actions.chemical.active = false;
earth.landfillMC.chemical.play();
recyclingPotential = recyclingPotential + CHEM_POTENTIAL;
playSound("buybuilding");
break;
case "household" :
city.actions.household.active = false;
collectionPotential = collectionPotential + HOUSEHOLD_POTENTIAL;
playSound("buy");
break;
case "construction" :
city.actions.construction.active = false;
collectionPotential = collectionPotential + CONSTRUCTION_POTENTIAL;
playSound("buy");
break;
case "industrial" :
city.actions.industrial.active = false;
collectionPotential = collectionPotential + INDUSTRIAL_POTENTIAL;
playSound("buy");
break;
case "RandD1" :
compound.actions.RandD1.active = false;
marketBonus = marketBonus + 2;
playSound("buy");
break;
case "RandD2" :
compound.actions.RandD2.active = false;
wasteBonus = 5;
playSound("buy");
break;
case "advertising" :
city.actions.advertising.active = false;
advChampaign = ADV_DURATION;
earth.cityMC.adv.gotoAndPlay("open");
marketBonus = marketBonus + ADV_BONUS;
playSound("buybuilding");
break;
case "greenwash" :
city.actions.greenwash.active = false;
comChampaign = COM_DURATION;
consumerDissent = 0;
ecoDissent = 0;
workersDissent = 0;
euDissent = 0;
earth.cityMC.com.gotoAndPlay("open");
playSound("buybuilding");
break;
case "subProducts" :
resin.actions.subProducts.active = false;
playSound("buy");
break;
case "heat" :
resin.actions.heat.active = false;
playSound("buy");
break;
case "water" :
resin.actions.water.active = false;
playSound("buy");
break;
case "emissions" :
resin.actions.emissions.active = false;
playSound("buy");
break;
case "resinSecurity" :
resin.actions.resinSecurity.active = false;
playSound("buy");
break;
case "Risk1" :
compound.actions.Risk1.active = false;
playSound("buy");
break;
case "Risk2" :
compound.actions.Risk2.active = false;
playSound("buy");
break;
case "compoundSecurity" :
compound.actions.compoundSecurity.active = false;
playSound("buy");
}
}
function industryOnOff(iName) {
if (industries[iName].active) {
tmp = transformation.actions[iName].pic;
transformation.actions[iName].pic = transformation.actions[iName].picStop;
transformation.actions[iName].picStop = tmp;
earth.transformationMC[iName].gotoAndStop("stopped");
} else {
if (industries[iName].created) {
tmp = transformation.actions[iName].pic;
transformation.actions[iName].pic = transformation.actions[iName].picStop;
transformation.actions[iName].picStop = tmp;
} else {
industries[iName].created = true;
transformation.actions[iName].price = undefined;
}
earth.transformationMC[iName]._visible = true;
earth.transformationMC[iName].play();
}
industries[iName].active = !industries[iName].active;
}
function warning(messageId) {
mc = messages[messageId].mc;
messages[messageId].active = true;
bal = earth[mc + "_baloon"];
bal._visible = true;
bal.msg = messageId;
bal.onRelease = function () {
showWarning(this.msg);
this._visible = false;
};
refreshWarningList();
}
function clearWarning(messageId) {
mc = messages[messageId].mc;
messages[messageId].active = false;
bal = earth[mc + "_baloon"];
if (bal.msg == messageId) {
bal._visible = false;
}
for (msg in messages) {
if ((messages[msg].mc == mc) && (messages[msg].active)) {
warning(msg);
}
}
refreshWarningList();
}
function refreshWarningList() {
hqMessages = "";
hqMessages = hqMessages + "<br><ul>";
for (msg in messages) {
if (messages[msg].active && (msg != noIndustries)) {
if (messages[msg].level == 2) {
hqMessages = hqMessages + (("<li><font color='#FF0000'>" + messages[msg].description) + "</font></li>");
} else {
hqMessages = hqMessages + (("<li>" + messages[msg].description) + "</li>");
}
}
}
hqMessages = hqMessages + "</ul>";
infoBox.hq.description.field.htmlText = (hq.description = STR_HQ + hqMessages);
}
function showWarning(messageId) {
if ((messageId != currentWarning) && (!blocked)) {
ROOT.playSound("warning");
closeBox();
currentWarning = messageId;
blocked = true;
msg = messages[messageId];
warningBox.face.gotoAndStop(msg.pic);
warningBox.title.titleField.text = msg.fullName;
warningBox.description.field.htmlText = msg.description;
warningBox.faces.gotoAndStop(msg.pic);
warningBox.gotoAndPlay(1);
warningBox._visible = true;
warningBox.blocker.onRelease = function () {
if (this._parent._currentframe == this._parent._totalframes) {
this._parent._visible = false;
blocked = false;
currentWarning = undefined;
}
};
}
}
function economy() {
timePerc = Math.ceil((cycle / GAME_DURATION) * 100);
interfaceMC.timeBar.gotoAndStop(timePerc);
oldMoney = money;
if (engineOn) {
date = Math.floor((dates.length / 100) * timePerc);
interfaceMC.timeBar.field.text = dates[date];
}
if ((timePerc >= 100) && (engineOn)) {
engineOn = false;
endGame("happy");
} else if (engineOn && (!blocked)) {
clearWarning("insufficientPVC");
clearWarning("blockedIndustries");
pvcLeft = maxResin;
produced = 0;
striking--;
updateOilPrice();
temp = money;
money = money - (PVC_PLANT0_PRICE / FIXED_COST_DIVIDER);
if (resin.actions.resinUp1.created) {
money = money - (PVC_PLANT1_PRICE / FIXED_COST_DIVIDER);
}
if (resin.actions.resinUp2.created) {
money = money - (PVC_PLANT2_PRICE / FIXED_COST_DIVIDER);
}
if (resin.actions.resinUp3.created) {
money = money - (PVC_PLANT3_PRICE / FIXED_COST_DIVIDER);
}
if (!landfill.actions.incinerator.active) {
money = money - (landfill.actions.incinerator.price / FIXED_COST_DIVIDER);
}
if (!landfill.actions.mechanical.active) {
money = money - (landfill.actions.mechanical.price / FIXED_COST_DIVIDER);
}
if (!landfill.actions.chemical.active) {
money = money - (landfill.actions.chemical.price / FIXED_COST_DIVIDER);
}
for (ind in industries) {
if (industries[ind].created) {
money = money - (industries[ind].price / FIXED_COST_DIVIDER);
}
if (industries[ind].active) {
log(ind);
demand = industries[ind].maxDemand;
if (striking <= 0) {
if (pvcLeft >= industries[ind].pvc) {
pvcLeft = pvcLeft - industries[ind].pvc;
produced = produced + industries[ind].pvc;
trace((((ind + ": ") + industries[ind].pvc) + " ") + produced);
gain = ((demand + marketBonus) - (oilPrice / OIL_DIVIDER)) * MONEY_PER_UNITS;
money = money + gain;
earth.transformationMC[ind].mc.play();
} else {
warning("blockedIndustries");
warning("insufficientPVC");
earth.transformationMC[ind].mc.stop();
}
} else {
earth.transformationMC[ind].mc.stop();
}
}
}
infoBox.resin.needleDisplay.moveNeedle(produced, maxResin);
lifeCycle.push(produced - wasteBonus);
if (lifeCycle.length > PVC_DURATION) {
waste = lifeCycle.shift();
trace("waste " + waste);
if (collectionPotential < waste) {
recyclable = collectionPotential;
nonRecyclable = waste - recyclable;
} else {
recyclable = waste;
nonRecyclable = 0;
}
log("--------------------------");
log(("rifiuti: " + waste) + "unita");
log((("riciclabili: " + recyclable) + "\n non riciclabili: ") + nonRecyclable);
log(newline);
if (recyclingPotential < recyclable) {
recycled = recyclingPotential;
unRecycled = recyclable - recycled;
if (burningPotential < unRecycled) {
burned = burningPotential;
unBurned = unRecycled - burned;
} else {
burned = unRecycled;
unBurned = 0;
}
disposed = unBurned + nonRecyclable;
} else {
recycled = recyclable;
disposed = nonRecyclable;
burned = 0;
}
if (((recyclingPotential - recyclable) > 30) && (waste > 30)) {
warning("insufficientCollecting");
} else {
clearWarning("insufficientCollecting");
}
log("riciclati: " + recycled);
log("bruciati: " + burned);
log("stoccati: " + disposed);
infoBox.landfill.colBar.barChart([{n:"Differentiated", q:recyclable, c:"0x009900"}, {n:"Undifferentiated", q:nonRecyclable, c:"0x666666"}]);
infoBox.landfill.recBar.barChart([{n:"recycled", q:recycled, c:"0x222222"}, {n:"burned", q:burned, c:"0x777777"}, {n:"disposed", q:disposed, c:"0xAAAAAA"}]);
if (waste > 0) {
bPoints = Math.round((100 / (waste / burned)) / 2);
rPoints = Math.round((100 / (waste / recycled)) / 1.5);
} else {
bPoints = (rPoints = 0);
}
sustPerc = ((fixedPoints + bPoints) + rPoints) + 1;
interfaceMC.sustainBar.bar.gotoAndStop(sustPerc);
}
if ((cycle % DISSENT_EVENT) == 0) {
workerPts = (resin.actions.resinSecurity.active ? 0 : 1);
workerPts = workerPts + (compound.actions.compoundSecurity.active ? 0 : 1);
if (((waste > 40) && (workerPts < 2)) || ((waste > 20) && (workerPts < 1))) {
if (random(DISSENT_SCATTERER) == 0) {
trace((("worker dissent " + workersDissent) + " ") + workerPts);
switch (workersDissent) {
case 0 :
warning("workersWarning");
workersDissent = 1;
break;
case 1 :
if (striking <= 0) {
clearWarning("workersWarning");
if (!messages.workersWarning.active) {
}
showWarning("workersWarning2");
warning("workersWarning2");
workersDissent = 2;
}
break;
case 2 :
if (striking > 0) {
break;
}
clearWarning("workersWarning");
clearWarning("workersWarning2");
showWarning("strike");
striking = STRIKE_DURATION;
workersDissent = 1;
}
}
} else {
clearWarning("workersWarning");
clearWarning("workersWarning2");
workersDissent = 0;
}
ecoPts = (resin.actions.subProducts.active ? 0 : 1);
ecoPts = ecoPts + (resin.actions.heat.active ? 0 : 1);
ecoPts = ecoPts + (resin.actions.water.active ? 0 : 1);
ecoPts = ecoPts + (resin.actions.emissions.active ? 0 : 1);
if (((waste > 40) && (ecoPts < 3)) || ((waste > 20) && (ecoPts < 2))) {
if (random(DISSENT_SCATTERER) == 0) {
trace("EUROPAAAAAA pvc?" + euDissent);
switch (ecoDissent) {
case 0 :
warning("ecoWarning");
ecoDissent = 1;
break;
case 1 :
clearWarning("ecoWarning");
warning("ecoWarning2");
showWarning("ecoWarning2");
ecoDissent = 2;
break;
case 2 :
ecoDissent = 3;
break;
case 3 :
clearWarning("ecoWarning");
clearWarning("ecoWarning2");
showWarning("sanction");
money = money - SANCTION;
displayMoney(money);
ecoDissent = 0;
}
}
} else {
clearWarning("ecoWarning");
clearWarning("ecoWarning2");
ecoDissent = 0;
}
consumerPts = (compound.actions.Risk1.active ? 0 : 1);
consumerPts = consumerPts + (compound.actions.Risk2.active ? 0 : 1);
if (((waste > 40) && (consumerPts < 2)) || ((waste > 20) && (consumerPts < 1))) {
if (random(DISSENT_SCATTERER) == 0) {
switch (consumerDissent) {
case 0 :
warning("consumerWarning");
consumerDissent = 1;
break;
case 1 :
if (boycotting <= 0) {
clearWarning("consumerWarning");
warning("consumerWarning2");
showWarning("consumerWarning2");
consumerDissent = 2;
}
break;
case 2 :
if (boycotting > 0) {
break;
}
clearWarning("consumerWarning");
clearWarning("consumerWarning2");
showWarning("boycott");
boycotting = BOYCOTT_DURATION;
marketBonus = marketBonus - BOYCOTT_POWER;
consumerDissent = 0;
}
}
} else {
clearWarning("consumerWarning");
clearWarning("consumerWarning2");
consumerDissent = 0;
}
if (((waste > 80) && ((recycled + burned) < (((MECH_POTENTIAL + CHEM_POTENTIAL) + BURN_POTENTIAL) / 1.5))) || ((waste > 40) && ((recycled + burned) < (((BURN_POTENTIAL + MECH_POTENTIAL) + CHEM_POTENTIAL) / 2)))) {
if (random(DISSENT_SCATTERER) == 0) {
trace("EUROPAAAAAA?" + euDissent);
switch (euDissent) {
case 0 :
warning("euWarning");
euDissent = 1;
break;
case 1 :
clearWarning("euWarning");
warning("euWarning2");
showWarning("euWarning2");
euDissent = 2;
break;
case 2 :
euDissent = 3;
break;
case 3 :
clearWarning("euWarning");
clearWarning("euWarning2");
showWarning("euSanction");
money = money - EU_SANCTION;
displayMoney(money);
euDissent = 0;
}
}
} else {
clearWarning("euWarning2");
clearWarning("euWarning");
euDissent = 0;
}
}
cycle++;
if ((((dMoney < 0) && (Math.abs(dMoney) < 500)) || (produced == 0)) && (money < MIN_PRICE)) {
money = money - 100;
}
dMoney = money - oldMoney;
if (dMoney > 0) {
infoBox.hq.arrow.gotoAndStop("up");
interfaceMC.moneyDisplay.arrow.gotoAndStop("up");
infoBox.hq.arrow.field.text = "+" + Math.round(dMoney);
} else if (dMoney < 0) {
infoBox.hq.arrow.gotoAndStop("down");
interfaceMC.moneyDisplay.arrow.gotoAndStop("down");
infoBox.hq.arrow.field.text = Math.round(dMoney);
} else {
infoBox.hq.arrow.gotoAndStop("equal");
interfaceMC.moneyDisplay.arrow.gotoAndStop("equal");
infoBox.hq.arrow.field.text = Math.round(dMoney);
}
if (money < 1000) {
if (random(DISSENT_SCATTERER) == 0) {
warning("lowMoney");
}
} else {
clearWarning("lowMoney");
}
if ((money < 0) && (!blocked)) {
endGame("bankrupt");
engineOn = false;
}
for (msg in messages) {
if (messages[msg].active) {
interfaceMC.fastMenu[messages[msg].mc].exMark.play();
}
}
if (advChampaign > 0) {
advChampaign--;
if (advChampaign == 0) {
earth.cityMC.adv.gotoAndPlay("close");
marketBonus = marketBonus - ADV_BONUS;
createButtons("city");
}
}
if (comChampaign > 0) {
comChampaign--;
if (comChampaign == 0) {
earth.cityMC.com.gotoAndPlay("close");
}
}
if (boycotting > 0) {
boycotting--;
if (boycotting == 0) {
marketBonus = marketBonus + BOYCOTT_POWER;
}
}
displayMoney(money);
}
}
function changeSpeed(n) {
if (n != gameSpeed) {
interfaceMC.playBt.gotoAndStop("normal");
interfaceMC.pauseBt.gotoAndStop("normal");
interfaceMC.ffwdBt.gotoAndStop("normal");
clearInterval(economyIntervalId);
engineOn = true;
if (n == 0) {
engineOn = false;
gamePaused = true;
} else if (n == 1) {
economyIntervalId = setInterval(this, "economy", TIME_SPEED);
gamePaused = false;
} else {
economyIntervalId = setInterval(this, "economy", TIME_SPEED / 2);
gamePaused = false;
}
gameSpeed = n;
}
}
function updateOilPrice() {
if ((random(2) == 0) && (oilPrice < MAX_OIL_PRICE)) {
oilPrice++;
} else if (oilPrice > MIN_OIL_PRICE) {
oilPrice--;
}
if (oilPrices.length > 5) {
oilPrices.shift();
}
oilPrices.push(oilPrice);
infoBox.raw.lineChart.drawChart(oilPrices, MAX_OIL_PRICE, MIN_OIL_PRICE);
}
function myOnKeyDown() {
if (Key.isDown(16)) {
cheating = !cheating;
playSound("test");
}
}
function menuMode() {
soundButton._visible = true;
playSound("title", true);
b = 0;
while (b < buildingIds.length) {
bName = buildingIds[b];
mc = earth[bName];
earth[bName + "_baloon"]._visible = false;
earth[bName]._visible = false;
earth[bName + "_roll"]._visible = false;
b++;
}
var _local1 = new flash.geom.ColorTransform();
_local1.rgb = 0;
var _local2 = new flash.geom.Transform(earth);
_local2.colorTransform = _local1;
planet.destination = 50;
planet.sizeDestination = 45;
interfaceMC._visible = false;
titleMenu._visible = true;
engineOn = false;
}
function planetMode() {
soundButton._visible = false;
stopAllSounds();
b = 0;
while (b < buildingIds.length) {
bName = buildingIds[b];
mc = earth[bName];
earth[bName]._visible = true;
b++;
}
var _local1 = new flash.geom.ColorTransform();
var _local2 = new flash.geom.Transform(earth);
_local2.colorTransform = _local1;
planet.destination = PLANET_HIGH;
planet.sizeDestination = 100;
interfaceMC._visible = true;
titleMenu._visible = false;
engineOn = true;
}
function menuPlay() {
planetMode();
}
function menuHowTo() {
}
function menuAbout() {
menuAboutBox.titleField.text = ABOUT_TITLE;
menuAboutBox.descriptionField.text = ABOUT_MSG;
menuAboutBox.gotoAndPlay(1);
menuAboutBox._visible = true;
}
function endGame(reason) {
interfaceMC.timeBar.field.text = dates[dates.length - 1];
if (reason == "bankrupt") {
gameOver._visible = true;
} else {
if (sustPerc < 25) {
grade = BAD;
} else if (sustPerc < 50) {
grade = POOR;
} else if (sustPerc < 75) {
grade = SUFFICIENT;
} else if (sustPerc < 90) {
grade = GOOD;
} else if (sustPerc >= 90) {
grade = EXCELLENT;
}
if (sustPerc > 100) {
sustPerc = 100;
}
theEnd.enviPoints.text = ((grade + " (") + sustPerc) + "%)";
ecoPerc = 0;
for (ind in transformation.actions) {
if (!transformation.actions[ind].active) {
ecoPerc = ecoPerc + 10;
}
}
if (!resin.actions.resinUp3.active) {
ecoPerc = ecoPerc + 5;
}
if (!compound.actions.Risk1.active) {
ecoPerc = ecoPerc + 5;
}
if (!compound.actions.Risk2.active) {
ecoPerc = ecoPerc + 5;
}
if (money < 2500) {
ecoPerc = ecoPerc + 0;
}
if (money < 5000) {
ecoPerc = ecoPerc + 5;
} else if (money < 10000) {
ecoPerc = ecoPerc + 10;
} else {
ecoPerc = ecoPerc + 15;
}
if (ecoPerc < 25) {
grade = BAD;
} else if (ecoPerc < 50) {
grade = POOR;
} else if (ecoPerc < 75) {
grade = SUFFICIENT;
} else if (ecoPerc < 90) {
grade = GOOD;
} else if (ecoPerc >= 90) {
grade = EXCELLENT;
}
if (ecoPerc > 100) {
ecoPerc = 100;
}
if (ecoPerc < 0) {
ecoPerc = 0;
}
theEnd.ecoPoints.text = ((grade + " (") + Math.round(ecoPerc)) + "%)";
theEnd._visible = true;
}
}
function playSound(sound_id, loop) {
if (soundsOn) {
id = soundBox.getNextHighestDepth();
obj = soundBox.createEmptyMovieClip("sound" + id, id);
obj.sound = new Sound(obj);
obj.sound.attachSound(sound_id);
if (!loop) {
obj.sound.start();
obj.onEnterFrame = function () {
if (this.sound.position >= this.sound.duration) {
removeMovieClip(this);
}
};
} else {
obj.sound.start(0, 100);
}
}
}
blackScreen.play();
stop();
cheating = false;
soundsOn = true;
soundButton.body.onRelease = function () {
if (soundsOn) {
soundsOn = false;
stopAllSounds();
this._parent.gotoAndStop("off");
} else {
soundsOn = true;
playSound("title", true);
this._parent.gotoAndStop("on");
}
};
START_YEAR = 1987;
END_YEAR = 2011;
ROT_SPEED = 50;
ROT_AUTOSPEED = 5;
ROT_OFFSET = 300;
FAST_INTERVAL = 20;
PLANET_YSPEED = 10;
PLANET_HIGH = 300;
PLANET_LOW = 300;
BUTTONS_H = 162;
BOX_W = 750;
BOX_YSPEED = 2;
BOX_YOPEN = -20;
BOX_YCLOSED = -210;
TITLE_YCLOSED = -30;
TITLE_YOPEN = 0;
BUTTON_RAD = 32;
BUTTON_MARGIN = 10;
GAME_DURATION = 340;
TIME_SPEED = 1000;
STARTING_MONEY = 5000;
STARTING_MAXRESIN = 30;
MIN_PRICE = 2000;
ADV_DURATION = 20;
COM_DURATION = 5;
ADV_BONUS = 5;
STRIKE_DURATION = 20;
BOYCOTT_DURATION = 20;
BOYCOTT_POWER = 10;
PVC_DURATION = 10;
MAX_OIL_PRICE = 10;
MIN_OIL_PRICE = 4;
DISSENT_EVENT = 4;
DISSENT_SCATTERER = 9;
INDUSTRIAL_POTENTIAL = 20;
HOUSEHOLD_POTENTIAL = 20;
CONSTRUCTION_POTENTIAL = 50;
MECH_POTENTIAL = 30;
CHEM_POTENTIAL = 40;
BURN_POTENTIAL = 30;
MONEY_PER_UNITS = 5;
FIXED_COST_DIVIDER = 500;
OIL_DIVIDER = 10;
PVC_PLANT0_PRICE = 0;
PVC_PLANT1_PRICE = 3000;
PVC_PLANT2_PRICE = 5000;
PVC_PLANT3_PRICE = 9000;
SANCTION = 5000;
EU_SANCTION = 10000;
months = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];
BAD = "Bad";
POOR = "Poor";
SUFFICIENT = "Average";
GOOD = "Good";
EXCELLENT = "Excellent";
STR_CLOSE_BT = "Back to menu";
STR_FFWD_BT = "Change game speed: Double";
STR_PAUSE_BT = "Pause game";
STR_PLAY_BT = "Change game speed: Normal";
GAME_OVER_DESCRIPTION = "You went bankrupt!\nPlay again, but consider carefully all the interactions and complexities faced by an industrial system! Real sustainability can only be achieved by taking into account environmental impact and social welfare, as well as the economic side of business (which is necessary if you want to make eco-compatible choices).";
ABOUT_MSG = "This game represents in an informal and fun way today\u2019s European PVC industry and the efforts the industry is making to ensure the sustainability of its production processes and applications.\nClearly, it is not easy to show the whole complexity of the vinyl system and the mechanisms that regulate research, production, markets and interaction with society (institutions, NGOs, consumers). We also like to apologise in advance, as in order to turn reality into a playable game we had to simplify highly complex contexts and approaches and summarise them into a handful of situations.\nThe information provided in the game is based on real experience and genuine data in order to represent the vinyl sector with good faith and, why not, a bit of humour. This means this game cannot be compared to a scientific study. For scientific information and data on the PVC industry, products and applications, please check out our website www.vinyl2010.org\nVinyl 2010 is an innovative project in the sustainability field. It was set up and is run by the four associations which represent the European PVC industry: the European Council of Vinyl Manufacturers (ECVM), the European Plastics Converters (EuPC), the European Stabiliser Producers Association (ESPA) and the European Council for Plasticisers and Intermediates (ECPI).\nVinyl 2010 provides the organisational and financial infrastructure to manage and monitor the Voluntary Commitment of the European PVC industry. It is a 10-year plan to evolve the PVC industry towards sustainability by improving production processes and products, investing in technology, minimising emissions and waste, and boosting collection and recycling.\nSince October 2004, Vinyl 2010 is a Partnership registered with the Secretariat of the UN Commission on Sustainable Development.\n";
ABOUT_TITLE = "About";
STR_REALLY_QUIT = "Do you really want to quit?";
END_TITLE = "The end";
END_DESCRIPTION = "The game is over but obviously the challenges of sustainability for the PVC industry do not end here. In real life, the commitment of the European PVC industry towards sustainability and minimising the environmental impact of production and products is continuing.\n\nSeveral initiatives on responsible production, the use of additives, PVC waste collection and recycling schemes are ongoing. Please find all the info on the www.vinyl2010.org website.";
ECO_STR = "Economic performance: ";
ENV_STR = "Sustainability performance: ";
menuAboutBox._visible = false;
menuAboutBox.blocker.onRelease = function () {
};
tutorial._visible = false;
tutorial.blocker.onRelease = function () {
};
areYouSure._visible = false;
areYouSure.blocker.onRelease = function () {
};
warningBox.stop();
industries = {ind1:{maxDemand:18, pvc:13, mar:3, mat:2}, ind2:{maxDemand:8, pvc:14, mar:1, mat:2}, ind3:{maxDemand:14, pvc:11, mar:3, mat:3}, ind4:{maxDemand:23, pvc:27, mar:4, mat:4}, ind5:{maxDemand:8, pvc:19, mar:1, mat:3}, ind6:{maxDemand:12, pvc:8, mar:2, mat:1}, ind7:{maxDemand:17, pvc:8, mar:4, mat:1}};
dates = new Array();
i = START_YEAR;
while (i < END_YEAR) {
m = 0;
while (m < months.length) {
dates.push((months[m] + "") + i);
m++;
}
i++;
}
earth = planet.earth;
earth.routines = function () {
if (titleMenu._visible) {
this._rotation = this._rotation + 0.2;
}
if ((!blocked) && (engineOn)) {
if (this.destination != undefined) {
DA = Math.abs(this._rotation - this.destination);
if (DA < 180) {
da = this._rotation - this.destination;
this._rotation = this._rotation - (da / ROT_AUTOSPEED);
}
if (Math.abs(da) < 1) {
this._rotation = this.destination;
this.destination = undefined;
}
} else {
dx = planet._xmouse - earth._x;
if (((Math.abs(dx) > ROT_OFFSET) && (_ymouse < interfaceMC._y)) && ((boxOpened && (_ymouse > (infoBox._y + infoBox._height))) || (!boxOpened))) {
planet.destination = PLANET_HIGH;
if (boxOpened) {
rolledBld = undefined;
closeBox();
}
earth._rotation = earth._rotation - ((dx > 0) ? ((dx - ROT_OFFSET) / ROT_SPEED) : ((dx + ROT_OFFSET) / ROT_SPEED));
this.destination = undefined;
}
}
}
};
setInterval(earth, "routines", FAST_INTERVAL);
planet.routines = function () {
if (!blocked) {
dy = this.destination - this._y;
if (Math.abs(dy) > 1) {
this._y = this._y + (dy / PLANET_YSPEED);
}
ds = this.sizeDestination - this._xscale;
if (Math.abs(ds) > 1) {
this._yscale = this._yscale + (ds / PLANET_YSPEED);
this._xscale = this._xscale + (ds / PLANET_YSPEED);
}
}
};
setInterval(planet, "routines", FAST_INTERVAL);
infoBox.routines = function () {
dy = this.destination - this._y;
if (Math.abs(dy) > 1) {
this._y = this._y + (dy / BOX_YSPEED);
}
};
setInterval(infoBox, "routines", FAST_INTERVAL);
titleBox.routines = function () {
dy = this.destination - this._y;
if (Math.abs(dy) > 1) {
this._y = this._y + (dy / BOX_YSPEED);
}
};
setInterval(titleBox, "routines", FAST_INTERVAL);
MovieClip.prototype.drawChart = function (array, max, min) {
bgLines = this.area.createEmptyMovieClip("lines", 10);
lines = this.area.createEmptyMovieClip("lines", 11);
dots = this.area.createEmptyMovieClip("dots", 12);
stepX = this.area._width / array.length;
stepY = this.area._height / (max - min);
lines.lineStyle(2, "0xBD2C24", 100);
lines.moveTo(0, (-stepY) * (array[0] - min));
bgLines.lineStyle(1, "0xDDDDDD", 100);
l = min;
while (l < max) {
pY = (-stepY) * (l - min);
bgLines.moveTo(0, pY);
bgLines.lineTo(this.area._width, pY);
l++;
}
d = 0;
while (d < oilPrices.length) {
pX = stepX * d;
pY = (-stepY) * (array[d] - min);
lines.lineTo(pX, pY);
dots.attachMovie("dot", "dot" + d, d, {_x:pX, _y:pY});
d++;
}
};
MovieClip.prototype.moveNeedle = function (part, tot) {
perc = Math.round(100 / (tot / part));
this.gotoAndStop(perc + 1);
this.helpText.text = ((this.tit + "") + perc) + "%";
};
MovieClip.prototype.barChart = function (arr) {
tot = 0;
i = 0;
while (i < arr.length) {
tot = tot + arr[i].q;
i++;
}
cursor = 0;
if (tot > 0) {
i = 0;
while (i < arr.length) {
item = arr[i];
mc = this.bg.attachMovie("bar", item.n, i + 10, {_x:cursor, _y:0.5});
perc = Math.round(100 / (tot / item.q));
mc._xscale = perc;
mc.perc = perc;
cursor = cursor + mc._width;
var _local2 = new flash.geom.ColorTransform();
_local2.rgb = item.c;
var _local4 = new flash.geom.Transform(mc);
_local4.colorTransform = _local2;
mc.onRollOver = function () {
this._parent._parent.helpText.text = ((this._name + "") + this.perc) + "%";
this._alpha = 80;
};
mc.onRollOut = function () {
this._parent._parent.helpText.text = this._parent._parent.tit;
this._alpha = 100;
};
i++;
}
}
};
var myListener = new Object();
myListener.onKeyDown = myOnKeyDown;
Key.addListener(myListener);
Accessibility.updateProperties();
initGame();
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 16
stop();
Symbol 133 MovieClip Frame 1
stop();
Symbol 133 MovieClip Frame 7
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 6
stop();
Symbol 145 MovieClip Frame 1
stop();
Symbol 145 MovieClip Frame 6
stop();
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 5
stop();
Symbol 165 MovieClip Frame 7
gotoAndStop ("running");
Symbol 169 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 5
stop();
Symbol 169 MovieClip Frame 7
gotoAndStop ("running");
Symbol 173 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 5
stop();
Symbol 173 MovieClip Frame 7
gotoAndStop ("running");
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 5
stop();
Symbol 177 MovieClip Frame 7
gotoAndStop ("running");
Symbol 181 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 5
stop();
Symbol 181 MovieClip Frame 7
gotoAndStop ("running");
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 5
stop();
Symbol 184 MovieClip Frame 7
gotoAndStop ("running");
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 5
stop();
Symbol 187 MovieClip Frame 7
gotoAndStop ("running");
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 5
stop();
Symbol 196 MovieClip Frame 1
stop();
Symbol 196 MovieClip Frame 5
stop();
Symbol 201 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 5
stop();
Symbol 240 MovieClip Frame 1
stop();
Symbol 240 MovieClip Frame 4
stop();
Symbol 247 MovieClip Frame 1
stop();
Symbol 247 MovieClip Frame 5
stop();
Symbol 277 MovieClip Frame 1
stop();
Symbol 409 MovieClip Frame 1
description._visible = false;
title._visible = false;
Symbol 409 MovieClip Frame 6
stop();
description._visible = true;
title._visible = true;
Symbol 418 Button
on (release) {
ROOT.playSound("click");
this._parent.gotoAndStop("difficulty");
}
Symbol 421 Button
on (release) {
ROOT.playSound("click");
ROOT.menuAbout();
}
Symbol 426 Button
on (release) {
ROOT.playSound("click");
ROOT.tutorial._visible = true;
ROOT.tutorial.pages.gotoAndStop(1);
}
Symbol 433 Button
on (release) {
ROOT.playSound("click");
ROOT.playSound("scroll");
ROOT.menuPlay("easy");
}
Symbol 438 Button
on (release) {
ROOT.playSound("click");
ROOT.playSound("scroll");
ROOT.menuPlay("medium");
}
Symbol 443 Button
on (release) {
ROOT.playSound("click");
ROOT.playSound("scroll");
ROOT.menuPlay("hard");
}
Symbol 444 MovieClip Frame 1
Symbol 444 MovieClip Frame 37
stop();
Symbol 449 Button
on (release) {
ROOT.playSound("click");
nextFrame();
}
Symbol 450 Button
on (release) {
ROOT.playSound("click");
prevFrame();
}
Symbol 457 Button
on (release) {
this._parent._visible = false;
ROOT.playSound("click");
}
Symbol 499 MovieClip Frame 1
stop();
Symbol 500 MovieClip Frame 6
stop();
Symbol 507 Button
on (release) {
getURL ("http://www.vinyl2010.org/", "_blank");
}
Symbol 508 Button
on (release) {
this._visible = false;
ROOT.playSound("click");
}
Symbol 509 MovieClip Frame 6
stop();
Symbol 523 MovieClip Frame 6
stop();
Symbol 527 MovieClip Frame 6
stop();
Symbol 537 MovieClip Frame 6
stop();
Symbol 543 MovieClip Frame 1
stop();
Symbol 552 MovieClip Frame 1
stop();