cheats = new Object(); cheats.viewUnderground = false; cheats.noElections = false; cheats.noShareholders=false; cheats.noMoney=false; stop(); ELECTION_FREQUENCY=10; INITIAL_MONEY=4000; INITIAL_ADDICTION=30; INITIAL_GDP=400; INITIAL_YEAR=1945; TAXES=30; MAX_DEBT=-1000; MIN_OIL_ADDICTION=25; //price recovery speed (divider) K_$BBL_POSTCRISIS=2; //K demand barrels f GDP K_OIL=.3; //how fast they get pissed SH_TRUST=20; SH_TRUST_RECOVER=20; BIG_RESERVOIRS_CAPACITY=5000; MED_RESERVOIRS_CAPACITY=3000; SMA_RESERVOIRS_CAPACITY=1000; CATASTROPHES_PROBABILITY=15; GRASSROOT_PROBABILITY=20; EVENT_PROBABILITY=30; //% active event happen every year BILL_PROBABILITY=30; INIT_$BBL=10; MAX_$BBL=300; MAX_$BBL_PRE=20; GDP_INERTIA=30; REPS=11; //10+president BALOON_FRAMES=60; //before disappear DEM_X=20; DEM_Y=140; REP_X=20; REP_Y=240; GREENNESS_CATASTROPHE=10; MAX_DEMONSTRATORS=15; HOMELAND_CONFLICTUALITY=10; ANIMALS_SPEED=4; // the popularity of the administration is added to this ELECTION_SCROLL_SPEED=20; ELECTION_SPEED=20; ELECTION_X_OFFSET=100; ELECTION_LENGTH=3000; //pix PREDICTABILITY=100; BOOST_DURATION=40; BUCKS_BOOST=8; //how many buck for total sellout of a party? SELL_OUT_BUCKS=10; //great name uh? DOLLARS_PER_BUCK=100; //elections gets more expensive $_p_buck + (e_c_i * year) ELECTION_COST_INCREMENT=1; //10% every election //dissent(%) = years of occupation * ANTI_IMPERIALIST_TENSION ANTI_IMPERIALIST_TENSION=2; VEN_OCCUPATION_LIMIT=40; VEN_OCCUPATION_PROBABILITY=20; NIG_OCCUPATION_LIMIT=20; NIG_OCCUPATION_PROBABILITY=20; //prob IRQ_WELL_ATTACK=20; IRQ_PALACE_ATTACK=20; MAX_IRQ_INSURGENT=6; MAX_NIG_REBELS=5; VEN_OCCUPATION_PEOPLE=4; NIG_OCCUPATION_PEOPLE=4; IRQ_PALACE_GUARDS=5; IRQ_ATTACK_SOLDIERS=5; //varname color unit label CHART_ITEMS = { oilDemand: ["0x990000", "BBL", STR.oil_demand], maxRecovery: ["0x999999", "BBL", STR.max_recovery], oilAddiction: ["0x000000", "%", STR.oil_addiction], GDP: ["0xFFCC00", "M $", STR.gross_domestic_product], $BBL: ["0x41738B", "$", STR.price_per_barrel], moneyK: ["0xD58000", "K $", STR.money] } CHART_X_MULTIPLIER=10; function resetModel() { BILLS = { lastIndex:0, //keep the new first oil_income_tax: { tit:"Dignity for Dinosaurs Act", des:"To commemorate the dead dinosaurs and fallen forests that made todays oil reserves by cutting the taxes on oil.", eff:"taxes-10", shamelessness:2 }, //http://www.ucsusa.org/clean_vehicles/fuel_economy/subsidizing-big-oil.html reduce_gas_taxes: { tit:"Greasing the Brakes Act", des:"To cut gas sales taxes in order to defend the citizens' right to a neverending motorized vacations.", eff:"oilAddiction+5;consent+10", shamelessness:2 }, //http://www.taxfoundation.org/research/show/1689.html no_windfall_tax: { tit:"God's Will Is Not Windfall Act", des:"To repeal the outrageous, anti-competitive windfall tax and give back the profit to the oil companies.", eff:"taxes-10", dep:"ACTS.windfall_tax", shamelessness:2 }, //windfall tax repealed by ronald reagan and never reenacted //http://en.wikipedia.org/wiki/Windfall_profits_tax tex_royalties: { tit:"The Bottom Of The Barrel Act", des:"To reduce foreign oil dependency by supporting the exploitation of untapped domestic resources in Alaska and Texas.", eff:"tex_royalties-10;ala_royalties-10", shamelessness:2, dep:"EVENTS.world_peaked" }, //Reference to McCain's Lexington Project: Expanding Domestic Oil And Natural Gas Exploration And Production //http://www.cfr.org/publication/16917/mccains_lexington_project.html interstate: { tit:"Heil Highway!", des:"To develop an interstate system inspired by the Nazis' Autobahn in order to give everyone the freedom to drive faster.", eff:"oilAddiction+10", shamelessness:1 }, //reference //http://en.wikipedia.org/wiki/Interstate_Highway_System kill_electric: { tit:"Kill the Electric Car Act", des:"To shut down all the efforts toward the mass production of cheap, efficient and cool electric cars.", eff:"oilAddiction+6;special", //avoid any development dep:"ACTS.electric_car_1", //electric car shamelessness:4 }, //counteact to electric_car_1 plane_subside: { tit:"The Equal Flights Act", des:"To enable subsidies for airports and planes that will ensure that even wage-poor women and minorities can afford to fly once in a while.", eff:"oilAddiction+8", cond:"GDP>2000", //middle class boom shamelessness:1 }, //many ways to subsidize airlines //http://www.hasbrouck.org/blog/archives/001001.html //http://www.usatoday.com/travel/flights/2007-03-23-eu-boeing-subsidy-ap_N.htm //http://www.usatoday.com/news/washington/2007-12-30-cheap-flights_N.htm //http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B6VGP-423RH95-5&_user=10&_rdoc=1&_fmt=&_orig=search&_sort=d&view=c&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=24acd8d3e4310d3a615cbddf821558e1 // dismantle_trains: { tit:"Freedom to Travel Autonomously Act", des:"To dismantle train tracks to free passengers from the tyranny of the rails and put them in freer forms of transportation.", eff:"oilAddiction+8", shamelessness:4 }, //Cut subsidies //In 2005, President Bush proposed cutting Amtrak’s entire $1.2-billion federal subsidy //http://www.goodmagazine.com/section/Features/train_in_vain dismantle_trolley: { tit:"Trolley Preservation Act", des:"To dismantle tramway transportation in big cities, so that historic trolleys can be preserved in museums.", eff:"oilAddiction+5", shamelessness:3 }, //http://en.wikipedia.org/wiki/General_Motors_streetcar_conspiracy tax_cut_cars: { tit:"Driving is Patriotic Act", des:"To subsidize car transportation by any means necessary, from free parking to infrastructure maintenance.", eff:"oilAddiction+6", shamelessness:1 }, //Indirect subsidies from infrastructures to parking to costs related to congestion //Road Transportation pp.95 //Perverse Subsidies By Norman Myers, Jennifer Kent, International Institute for Sustainable Development //http://books.google.com/books?id=mA-t1xAJDDUC&pg=PA95&vq=road+transportation&dq=Perverse+Subsidies&source=gbs_search_s&sig=ACfU3U2f8MshLwDcU1I6kascNGBp5mXc_Q tax_cut_big_cars: { tit:"Bigger is Better Act", des:"To cut taxes on the purchase of SUVs and promote big cars as the optimal vehicles for surviving in the asphalt jungle.", eff:"oilAddiction+4", dep:"EVENTS.suv_craze", shamelessness:2 }, //reference to the suv tax break loophole //in the Bush administration's 2003 economic stimulus package //http://www.usatoday.com/money/autos/2002-12-18-suv-tax-break_x.htm //http://abcnews.go.com/Technology/Hybrid/Story?id=97505&page=1 //debunking the myth of SUV as safer vehicles //http://www.sourcewatch.org/index.php?title=Fuel_efficiency_standards_and_the_laws_of_physics //http://eetd.lbl.gov/ea/teepa/pdf/TRB_Safety_1-03.pdf dismiss_solar: { tit:"Solar Eyesore Act", des:"To halt subsidies for solar panels that ruin the historical urban landscapes.", eff:"oilAddiction+3;greenness+10", dep:"ACTS.solar_power", //solar activated shamelessness:3 }, //It's a reference to Ronald Reagan's dismissal of the federal solar energy program intruduced by the Carter administration //The change of policy was symbolized by Reagans' order to take over the White House solar panels in 1986 //http://digital.library.unt.edu/govdocs/crs/permalink/meta-crs-8799:1 //http://www.jimmycarterlibrary.org/newsreleases/2007/07-18.pdf dismiss_wind: { tit:"No Bird Left Behind Act", des:"To stop all the wind energy activities in the nation in order to save the dozens of cute birds that could be diced by the dangerous spinning windmill blades.", eff:"oilAddiction+3;greenness+10", dep:"ACTS.wind_power", //wind activated shamelessness:3 }, //It's a reference to the urban legend commonly promoted by lobbies opposing alternative energies //http://www.treehugger.com/files/2006/04/common_misconce.php ven_royalties: { tit:"We Drink Your Milkshake Act", des:"To pressure the Venezuelan Government to reduce royalties and block its influence on the region.", eff:"ven_royalties-10", cond:"ven_production>0", shamelessness:1 }, //The royalties on oil extraction are a prime source of tension between US and Venezuela //In 2007 royalties were raised from 1% of the sale price to 16.6% that led ExxonMobil and ConocoPhillips to end exploration ventures in the region //http://www.abc.net.au/news/stories/2007/06/27/1963092.htm //Massive aids to other countries in the region (Colombia in a prominent way) are meant to contrast Venezuela's self determination //proposal by the right wing think tank heritage foundation //http://www.heritage.org/Research/LatinAmerica/bg1787.cfm ala_activation: { tit:"New Jobs for Caribous Act", des:"To create job opportunities for the poor animals in the Arctic National Wildlife Refuge by establishing an oil extraction industry.", eff:"special:greenness+20;", //special: enable scenario shamelessness:4 }, //http://en.wikipedia.org/wiki/Arctic_Refuge_drilling_controversy patriot_act: { tit:"Patriots or Else Act", des:"To deter and punish terrorist acts in the United States and around the world, to enhance law enforcement investigatory tools, and for other purposes.", eff:"consent+20", dep:"EVENTS.terrorist_attack", shamelessness:1, sts:"inactive"}, //this enables some oth //http://www.aclu.org/safefree/resources/17343res20031114.html //http://en.wikipedia.org/wiki/Controversial_invocations_of_the_USA_PATRIOT_Act oil_incentives: { tit:"Drill Baby Drill", des:"To create incentives for tapping new oil sources by assuming the legal risks of exploration and development in a company's stead.", eff:"special", //exploration cost to 0 exp:"The exploration activities will be free from now on", shamelessness:2, dep:"EVENTS.tex_peaked" }, //Tax breaks for exploration have been constant in past decade's energy bills //http://www.nytimes.com/2006/03/27/business/27royalties.html?hp&ex=1143 //http://www.citizen.org/cmep/energy_enviro_nuclear/electricity/energybill/2005/articles.cfm?ID=13980 no_carbon_tax: { tit:"Endless Summer Act", des:"To repeal the Carbon Tax so that it can not harm the tourism industry's projected profit derived from a warmer climate.", eff:"oilAddiction-10;greenness+10", dep:"ACTS.carbon_tax", shamelessness:3 }, //counter act to carbon tax carbon_sequestration: { tit:"Sweep Under the Carpet Act", des:"To calm down global warming conspiracy theorist by marketing carbon sequestration as solution to climate change.", eff:"greenness-20", dep:"EVENTS.global_warming_2", shamelessness:3 }, //for an overview on why carbon sequestration is unlikely to work: //http://www.treehugger.com/files/2006/07/carbon_sequestration.php remove_city_limitation: { tit:"Car Sex in the City Act", des:"To restore the smoggy vitality of city centers by removing all the traffic congestion limitations.", eff:"oilAddiction+6;greenness+10", dep:"ACTS.no_traffic", shamelessness:3 }, //counter act to "Livable Cities Act" (no_traffic) remove_bike_lanes: { tit:"Reclaim the Streets Act", des:"To stop the invasion of bicycle hippies in the city centers by removing all the bike lanes", eff:"oilAddiction+5;greenness+10", dep:"ACTS.bike_lanes", shamelessness:4 } //counteract to Bike "Lanes Act" (bike_lanes) }; ACTS = { gas_tax: { tit:"Gas Tax Act", des:"To increase sale taxes on gas and invert the tendency to artificially low fuel prices.", eff:"oilAddiction-1;consent-10", boldness:1 }, windfall_tax: { tit:"Windfall Profits Tax Act", des:"To recover and redistribute the profits earned by oil producers as a result of the increase in oil prices.", eff:"taxes+10", dep:"EVENTS.tex_peaked", boldness:2 }, //http://en.wikipedia.org/wiki/Windfall_profits_tax no_traffic: { tit:"Livable Cities Act", des:"To limit car circulation in city centers that causes congestion and health problems.", eff:"oilAddiction-1", boldness:1 }, // no_oil_subsidies: { tit:"Fair Taxes Act", des:"To repeal taxes breaks and subsidies that privilege the oil industry.", eff:"taxes+10", boldness:1 }, //tax benefits //http://www.ucsusa.org/clean_vehicles/fuel_economy/subsidizing-big-oil.html clean_plants: {tit:"Clean Plants Act", des:"To increase standards in oil production in order to prevent spills and reduce environmental costs.", eff:"maintenanceMultiplier+20", boldness:2 }, carbon_tax: {tit:"Carbon Tax Act", des:"To fight climate change by introducing a tax on emission of carbon dioxide and other greenhouse gasses.", eff:"oilAddiction-10", boldness:2 }, //http://en.wikipedia.org/wiki/Carbon_tax //http://www.carbontax.org/ gas_emergency: {tit:"Fuel Emergency Act", des:"To temporarily reduce consumption by rationing gas sales.", eff:"oilAddiction-10;consent-10", boldness:1, timer:1 }, //http://en.wikipedia.org/wiki/1973_oil_crisis energy_awareness: {tit:"Energy Awareness Campaign", des:"To promote energy conservation on an individual level by a broad communication campaign.", eff:"oilAddiction-1", boldness:1 }, //reference to the campaign "don't be fuelish" by the Advertising Council //http://en.wikipedia.org/wiki/1973_oil_crisis energy_efficiency: {tit:"Energy Efficient Building Act", des:"To promote the construction of energy efficient buildings for civil use.", eff:"oilAddiction-1", boldness:2 }, electric_car_1: {tit:"Electric Car Pilot Program", des:"To analyze the costs and benefits of mass produced electric cars for individual mobility.", eff:"", cond:"year>1970", boldness:4 }, electric_car_2: {tit:"Electric Car Program Act", des:"To promote sustainable mobility by subsidizing the production of electric cars.", eff:"oilAddiction-4", dep:"ACTS.electric_car_1", boldness:2 }, electric_car_3: {tit:"Gas Cars Ban Act", des:"To gradually ban all the cars powered by internal combustion engine.", eff:"oilAddiction-6", dep:"ACTS.electric_car_2", boldness:4 }, hybrid_car: {tit:"Hybrid Car Act", des:"To promote slightly less oil-dependent mobility by subsidizing the production of hybrid electric vehicles.", eff:"oilAddiction-1", cond:"year>1990", boldness:1 }, //info about electric cars and //why hybrid electric vehicles are a not a good solution //http://www.imdb.com/title/tt0489037/ train_detax: {tit:"Train is Better Act", des:"To promote railroad transit by reducing the taxes on tikets.", eff:"oilAddiction-3;consent+5", boldness:1 }, speed_limits: {tit:"Slow the Insanity Act", des:"To reduce gas consumption by reducing speed limit on roads to 55 mph (88 km/h).", eff:"oilAddiction-1;consent-3", boldness:1 }, big_car_tax: {tit:"Big Car Special Tax", des:"To introduce a tax for highpowered cars in order to invert the trend that lead the market toward big gas guzzling vehicles.", eff:"oilAddiction-2;consent-1", boldness:1 }, fuel_efficency_corporate: {tit:"Corporate Fuel Efficiency Act", des:"To impose an incremental mile per gallon fuel-efficiency standard for trucks, vans, and SUVs", eff:"oilAddiction-1", boldness:1 }, //http://en.wikipedia.org/wiki/Corporate_Average_Fuel_Economy fuel_efficency_general: {tit:"General Fuel Efficiency", des:"To impose an incremental mile-per-gallon fuel-efficiency standard for every vehicle.", eff:"oilAddiction-2", boldness:2 }, suv_ban: {tit:"SUV Ban Act", des:"To ban Sport Utility Vehicles in the major cities.", eff:"oilAddiction-3;consent-5", dep:"EVENTS.suv_craze", boldness:3 }, //a similar proposal has been considered by Paris and London //http://www.guardian.co.uk/news/2004/jun/10/france.motoring plane_regulation: {tit:"Plane Regulation Act", des:"To reduce fuel consumption in aviation by imposing taxes, optimizing lines and restricting plane sizes and flight frequency.", eff:"oilAddiction-6;consent-5", dep:"BILLS.plane_subside", boldness:2 }, //studies on the environmental impact of plane transportation dem //http://www.transportenvironment.org/docs/Publications/2006/2006-06_aviation_clearing_the_air_myths_reality.pdf //http://www.climatesciencewatch.org/file-uploads/NextGen_final_18jul07.pdf //energy saving //http://europe.theoildrum.com/node/2858 alt_research: {tit:"Alternative Energy Act", des:"To promote the research and development of alternative energy technologies.", eff:"", //enables innovations dep:"EVENTS.tex_peaked", boldness:1 }, //happens after the domestic production starts to decline //reference to Jimmy Carter's alternative energy initiative //http://www.cartercenter.org/news/editorials_speeches/crisis_of_confidence.html wind_power: {tit:"Wind Power Act", des:"To promote the extensive use of eolic energy and improve the efficiency of wind turbines.", eff:"oilAddiction-3", dep:"BILLS.alt_research", boldness:2 }, solar_power: {tit:"Solar Power Act", des:"To kickstart a solar energy program subsidizing households panels and funding researches on solar cell technology.", eff:"oilAddiction-3", dep:"BILLS.alt_research", boldness:2 }, lightweight_car: {tit:"Lightweight Car Act", des:"To improve the car industry efficiency standards by imposing weight limits and developing carbon fiber car bodies", eff:"oilAddiction-1", dep:"BILLS.alt_research", boldness:1 }, //an report on carbon fiber car bodies in the documentary "Addicted to oil" by T. Friedman //http://dsc.discovery.com/convergence/addictedtooil/addictedtooil.html energy_efficiency_corporate: {tit:"Sustainable Factories Act", des:"To introduce tax breaks for companies that operate in energy efficient, low emission facilities.", eff:"oilAddiction-1", boldness:1 }, //ibidem //http://dsc.discovery.com/convergence/addictedtooil/addictedtooil.html desuburbanization: {tit:"Back to the City Act", des:"To implement policies aimed at inverting the suburbanization trend, promoting high density settlements and re-designing urban sprawl.", eff:"oilAddiction-6;consent-20", boldness:4 }, //For relations between suburbanization and peak oil //The End of Suburbia //http://www.endofsuburbia.com/ //http://www.youtube.com/watch?v=Q3uvzcY2Xug //for peak oil and transition to sustainable communities //http://escapefromsuburbia.com/ //http://www.transitiontowns.org/ railroad_restoration: {tit:"Railways Plan Act", des:"To improve and optimize the railroad system and make freight trains a convenient alternative to motorized transportation.", eff:"oilAddiction-6;consent+5", dep:"BILLS.dismantle_trains", boldness:4 }, //for a proposal about the improvement of electric freight train system in the US //http://www.theoildrum.com/node/4301 public_transportation: {tit:"Urban Mass Transit Act", des:"To restore and improve public mass transit in cities and suburbs.", eff:"oilAddiction-5;consent+3", boldness:3 }, hydrogen_car: {tit:"Hydrogen Century Act", des:"To stimulate the production of hydrogen fuel based on renewable sources of energy.", eff:"oilAddiction-1", dep:"ACT.solar_power", boldness:1 }, //this act is dependent to the solar power act //the production of hydrogen fuel hydrogen cars may be effective only after a switch to alternative energies //http://www.motherjones.com/news/outfront/2003/05/ma_375_01.html //http://www.nytimes.com/2004/02/06/politics/06HYDR.html?ex=1219291200&en=396a34bcbd4063cd&ei=5070 biofuel_subside_1: {tit:"Biofuel Act", des:"To reduce dependency on foreign oil and promoting national economy by subsidizing ethanol biofuel production.", eff:"oilAddiction-1", dep:"BILLS.alt_research", boldness:1 }, //relatively ineffective and likely to trigger the food crisis event //for the role of 1st generation biofuel subsides in the 2007-2008 world food prices crisis //http://en.wikipedia.org/wiki/Food_vs_fuel biofuel_subside_2: {tit:"Second Generation Biofuel Act", des:"To stimulate the production of biofuel derived from non-food crops and waste biomasses to avoid spikes in food prices.", eff:"oilAddiction-1", dep:"ACTS.biofuel_subside_1", boldness:1 }, //http://en.wikipedia.org/wiki/Second_generation_biofuels biofuel_subside_3: {tit:"Third Generation Biofuel Act", des:"To support the production of biofuel derived from algae that may guarantee high-yields and low environmental impact.", eff:"oilAddiction-4", dep:"ACTS.biofuel_subside_2", boldness:2 }, //At the present moment, august 2008 the mass-production of algae fuel is still theoretical //we just want to bet on it //http://en.wikipedia.org/wiki/Algae_fuel bike_lanes: {tit:"Bike Lanes Act", des:"To implement a plan of off-road and on road segregated bike paths in every city to promote utility cycling.", eff:"oilAddiction-2", boldness:2 }, public_bikes: {tit:"Bike Sharing Act", des:"To implement a cheap bike sharing system in every major city in order to reduce pollution and traffic congestion.", eff:"oilAddiction-1", dep:"ACTS.bike_lanes", boldness:2 }, //http://en.wikipedia.org/wiki/Community_bicycle_program //http://en.wikipedia.org/wiki/Bicing public_car_sharing: {tit:"New Mobility Act", des:"To implement a energy savvy public transportation system involving carpooling, high occupancy vehicle incentives, pedestrianization or incentive parking.", eff:"oilAddiction-3", cond:"year>2000", boldness:2 } //reference to //http://en.wikipedia.org/wiki/New_Mobility_Agenda }; GRASSROOT = { bike_mania: { tit:"Bike Mania", des:"It's clean, it's cheap and it's cool. More and more people switching to two wheels", eff:"oilAddiction-3", greenness:1 }, car_pooling: { tit:"Hitchhiking 2.0", des:"Thanks to the ubiquitous communication technologies, car pooling networks are booming", eff:"oilAddiction-2", greenness:1 }, go_organic: { tit:"Organic Generation", des:"It's not just about health: non oil-dependent food production is the prime choice for young people", eff:"oilAddiction-4", greenness:1 }, go_veggie: { tit:"Go veggie", des:"Started as a personal lifestyle, vegetarianism is becoming a mass movement aiming to redefine world food production", eff:"oilAddiction-2", greenness:3 }, go_local: { tit:"The Invasion of the Localvores", des:"Locally grown products, farmers markets and community supported agriculture are the grassroots answer to rising oil prices", eff:"oilAddiction-5", greenness:2 }, no_shopping: { tit:"The Church of no shopping grows", des:"Since few years ago it was just an anti-consumerist joke, now it's the fastest growing religion", eff:"oilAddiction-4", greenness:3 } }; EVENTS = { //pseudo historical events //not strictly related to players action, mostly affecting oil addiction green_revolution_1: { tit:"The Green revolution", des:"Nitrogen fertilizers based on fossil fuels are predicted to boost world grain production by 250%", eff:"oilAddiction+7;consent+10" }, green_revolution_2: { tit:"Winning the war on pests", des:"Petrochemical-derived pesticides and herbicides are stabilizing food production and increasing yields", eff:"oilAddiction+5;consent+5" }, suburbia: { tit:"The Birth of Suburbia", des:"City dwellers are increasingly moving to suburbs in search of a quiet county life surrogate", eff:"oilAddiction+8", cond:"GDP>500" }, suv_craze: { tit:"The SUV Craze", des:"Despite emerging energy and environmental issues gas-guzzling Sport Utility Vehicles are becoming the symbol of the new middle class", eff:"oilAddiction+6", cond:"GDP>3000" }, cina_wto: { tit:"Made in China", des:"Your goods are coming from far away. East Asia is becoming the center of world manufacturing", eff:"oilAddiction+6", cond:"GDP>4000" }, opec: { tit:"OPEC Founded", des:"The petroleum exporting countries are establishing an alliance to coordinate policies and protect the profitability of their natural resources", eff:"ven_royalties+10;nig_royalties+10;irq_royalties+10", cond:"ven_production>0", timer:1 }, kuwait_war: { tit:"Iraq Invades Kuwait", des:"More than 100,000 Iraqi soldiers backed up by 700 tanks invaded the Gulf state of Kuwait in the early hours of this morning.", dep:"UNDERCOVER.block_irq_economy" }, //environmental uprising global_warming_1: { tit:"The Greenhouse Effect", des:"Scientists found that certain gasses released in the atmosphere are likely to produce dramatic climate changes", cond:"globalWarming>4000", eff:"greenness+10" }, global_warming_2: { tit:"The Earth is Warming", des:"Environmentalist claim that CO2 emissions are responsible for global warming and ask for regulations", dep:"EVENTS.global_warming_1", cond:"globalWarming>5500", eff:"greenness+30" }, global_warming_3: { tit:"Climate Crisis", des:"According to a recent poll, 80% of citizens mention Global Warming as a maximum priority issue", dep:"EVENTS.global_warming_2", cond:"globalWarming>10000", exp:"Green is the new black", eff:"greenness+30;consent-10" }, //sold barrels>x global_warming_4: { tit:"Climate Catastrophe", des:"Climate change related disasters are seriously damaging the world economy", dep:"EVENTS.global_warming_3", cond:"globalWarming>25000", eff:"GDPGrowth-1;potentialGrowth-1;greenness+30" }, //sold barrels>x food_crisis_bio: { tit:"Fuel vs oil", des:"Massive governmental subsidies to ethanol production are causing a dramatic spike in global food prices", eff:"consent-5", dep:"ACTS.biofuel_subside_1" }, oil_spill: { tit:"Black Tide", des:"A major oil spill occurred in Alaska. It might be the most devastating man-made environmental disaster ever", eff:"money-1000;greenness+30", cond:"ala_production>100" }, //exxon valdez reference human_burning_plants: { tit:"Turning humans into oil", des:"It's time to reconsider our rigid ethical frames. Human derived fuel is the ultimate solution to overpopulation and oil depletion", eff:"special", cond:"$BBL>200", //special activate unit dep:"EVENTS.world_peaked" }, /* hybrid_car: { tit:"Hybrid car Invented", des:"It's a good investment for manifacturers and it may help to reduce our dependency on oil", eff:"", cond:"year>1998" }, */ //ACTIVATION HARDCODED tex_peaked: { tit:"Texas Oil Production peaked?", des:"The extraction of crude in the state will start to decline from now on. Oil producer must find untapped national and foreign resources", eff:"", sts:"ingame"}, //triggered in economy routine world_peaked: { tit:"World Oil peaked?", des:"Global oil production will decline soon. The rising oil prices may have catastrophic effects on western society", eff:"", sts:"ingame"}, //triggered in economy routine mission_accomplished: { tit:"Mission Accomplished!", des:"Iraq is now controlled by allied forces. Democracy and the free market will soon reign on the ashes of the old regime", eff:"", sts:"ingame"}, //triggered in game routine (statue) terrorist_attack: { tit:"U.S. Attacked", des:"Hijacked jets killed thousands of civilians in a day of terror. The president vows revenge", exp:"Nothing Will Ever Be the Same", eff:"consent+60", cond:"year>2000" }, ogoni_movement: { tit:"Troubles in Ogoniland", des:"Niger Delta natives are reclaiming royalties and reparation for the environmental damage caused by the drilling", eff:"special", //special, protests cond:"nig_dissent>10" }, //detailed timeline of the ogoni crisis //http://www.hrw.org/reports/1995/Nigeria.htm nig_liberation: { tit:"Oil, Blood and Guns", des:"After years of pacific demostrations and violent repressions, Niger Delta people are threatening direct military actions", eff:"special", //special military against the government cond:"nig_dissent>80" }, //it's a reference of the development in the niger delta conflicts in the late '90 //http://en.wikipedia.org/wiki/Niger_Delta_conflicts //video doc //http://video.google.com/videoplay?docid=-3627251054805843098&q=nigeria&ei=wzFpSPbXD6S-rAKx7ry4Aw ven_democracy: { tit:"Wind of Change in Venezuela", des:"The New president promises a new constitution, radical reforms and more redistribution of the oil revenues", eff:"", //just an alarm cond:"ven_dissent>50" }, //reference to Chavez ven_autonomy: { tit:"Venezuela raises drilling tax", des:"Venezuelan Government raises royalties on oil extraction. The revenues will be invested in social programs", eff:"ven_royalties+10", cond:"ven_dissent>70" }, //reference to the 2001 hydrocarbon law that raised extraction tax from 1% to 16% //http://www.venezuelanalysis.com/news/730 //doc about Chavez's social reforms //http://www.nuamerica.org/thefilm.html ven_nationalization: { tit:"Venezuela nationalizes oil", des:"The country moves away from the Western sphere of influence. Foreign companies are stopping all the enterprises in the Bolivarian republic", eff:"special", //special:no production in ven anymore exp:"All the plants will be confiscated", cond:"ven_dissent>90" //90 } , //for chronology of Venezuela's moves toward oil industry nationalization //http://www.pinr.com/report.php?ac=view_report&report_id=492&language_id=1 usa_fail: { tit:"Retreat!", des:"The Iraq invasion is a military defeat. The regime change miserably failed.", eff:"consent-10", sts:"ingame", exp:"President's popularity dropped" }, recession: { tit:"Recession", des:"High oil prices are playing a central role in the negative economy growth", eff:"", sts:"ingame" }, irq_anarchy: { tit:"Anarchy in Iraq", des:"Wild privatizations, unemployement and predatory management are fueling fundamentalism in the \"liberated\" Iraq", eff:"", sts:"ingame" } } //oil price extraordinary effects CATASTROPHES = [ { id:"gas_raid", tit:"Gas stations raided", des:"Turmoil all around the nation. Street gangs are taking control of thousands of gas stations", eff:"consent-10", prices:180}, { id:"food_crisis_1", tit:"Grocery stores raided", des:"As a dramatic result of raising food prices Big box stores are being stormed by groups of starving people", eff:"consent-10", prices:190}, { id:"food_crisis_2", tit:"Big Food distribution collapses", des:"Walmart grocery department goes under: \"Increasing food costs and constant raids erase profit margins\"", eff:"consent-10", prices:200}, { id:"financial_1", tit:"The Crisis is structural", des:"People stop getting loans, investors expectations fall, financial markets are in panic", eff:"GDPGrowth-2", prices:210}, { id:"food_crisis_3", tit:"Welcome to the Jungle", des:"Deer hunting is spreading all over the country. Corn Fields are patrolled by the army. Rumors of cannibalism in the southern states", eff:"consent-15", prices:220}, { id:"food_crisis_4", tit:"Compulsory Birth Control", des:"The act sponsored by the Neo-Malthusian Party will allow a tradable quota of 1.3 children per family", eff:"GDPGrowth-1", prices:240}, // { id:"mass_relocations", tit:"Human migrations", des:"Heating costs are forcing millions of people to relocate in warmer places.", eff:"consent-20;GDPGrowth-2", prices:250}, { id:"financial_2", tit:"Farewell Dow Jones", des:"World's most notable Economists are meeting today to redesign the financial system from scratch", eff:"GDPGrowth-2", prices:260}, { id:"famine", tit:"Famine!", des:"After centuries, Death by starvation is back in western countries", eff:"GDPGrowth-3;consent-30", prices:270}, { id:"apocalypse", tit:"Apocalypse Now?", des:"The global termonuclear war for the remaining resources is about to begin", eff:"", prices:290} ]; //Covert operations UNDERCOVER = { help_irq_enemies: { tit:"The enemy of the enemy", des:"Finance Shi'a opposition for a regime change in Iraq.", loc:"irq", eff:"irq_dissent+30", sts:"active" }, //irq not free //reference to 1998 Iraq liberation act //http://en.wikipedia.org/wiki/Iraq_Liberation_Act //cronology of relations between US and the Supreme Council for the Islamic Revolution in Iraq (SCIRI) //http://www.ploughshares.ca/libraries/ACRText/ACR-IraqS.html block_irq_economy: { tit:"Messing Iraq economy", des:"Use our ally Kuwait to damage Iraq's economy. This may provoke a conflict and provide a justification for an intervention in the area.", loc:"irq", eff:"irq_dissent+30", dep:"UNDERCOVER.help_irq_enemies" }, //irq not free //reference to the economic moves that lead to the kuwait invasion //http://en.wikipedia.org/wiki/Gulf_War#Tensions_with_Kuwait wmd: { tit:"WMD", des:"Link Iraq to the War on Terror by manifacturing evidences of Weapons of Mass Destruction.", loc:"irq", eff:"irq_dissent+30", dep:"EVENTS.terrorist_attack" }, //there is a lot of material debunking the WMD scum //http://www.salon.com/opinion/blumenthal/2007/09/06/bush_wmd/ desert_storm: { tit:"Operation Desert Scorn", des:"We have to defend our allies in the Persian Gulf, declare war to Iraq.", loc:"irq", dep:"EVENTS.kuwait_war" }, enduring_freedom: { tit:"Operation Super Duper Freedom", des:"Taxpayers are buying the WMD story, it's time to invade Iraq.", loc:"irq", dep:"UNDERCOVER.wmd" }, enduring_freedom_retry: { tit:"Operation Unlimited Divine Justice", des:"Our interests in Middle East are still strong. Another war may be unpopular but we have to take back Iraq.", loc:"irq", eff:"consent-20", dep:"special", sts:"inactive" }, more_troops: { tit:"Operation The New Way Forward", des:"The job is not done in Iraq and we may need to send more troops. Needless to say that people don't like body bags coming from Iraq.", dep:"special", eff:"consent-10", loc:"irq", sts:"inactive" }, create_monster: { tit:"Create-a-monster", des:"Internal dissent is rising? Create a long-bearded Muslim villain to scare the citizen and reinvigorate unity.", eff:"consent+10;greenness-20", cond:"year>1990", loc:"afg" }, torture: { tit:"The dark side", des:"Insurgency is rising in Middle East, we need to collect informations to dismantle terrorist networks. Authorize the use of torture in our secret prisons.", eff:"consent-30", dep:"EVENTS.irq_anarchy", loc:"afg" }, pearl_harbour: { tit:"A New Pearl Harbor", des:"For a new American century we need a new Pearl Harbor to awake the sleeping giant. Provoke and facilitate a major and spectacular terrorist attack in the homeland.", loc:"ny", cond:"year>1980", sts:"inactive" }, //various conspiracy theories based //we don't want to exclude the possibility //the reference to pearl harbor is advance knowledge controversy //Day Of Deceit By Robert B. Stinnett //http://books.google.com/books?hl=en&id=Q2UKN5daNHYC&dq=Stinnett+harbor&printsec=frontcover&source=web&ots=UJ-IoH4zLl&sig=i0G45ffjD6XnVbzn3408-vb2eec&sa=X&oi=book_result&resnum=1&ct=result terror_alarm: { tit:"Homeland Security Advisory System", des:"It works like a remote control for mass anxiety. If you want scaried and obedient citizens you only have set it to red.", eff:"consent+20;greenness-30", dep:"EVENTS.terrorist_attack", loc:"dc" }, //study linking terror alerts to JW Bush approval ratings //http://www.washingtonpost.com/wp-dyn/articles/A28037-2004Oct12.html anthrax: { tit:"Anthrax Everywhere!", des:"Unrelash a wave of hysteria with fake biological attacks targeting media and politicians. If we get caught we can blame one of the many mad scientists on our payroll. ", eff:"consent+20;greenness-40", dep:"EVENTS.terrorist_attack", loc:"dc" }, //reconstruction of the anthrax "attacks" and unresolved questions about the role of mainstream media //http://www.salon.com/opinion/greenwald/2008/08/01/anthrax/ infiltrate_eco: { tit:"Hugging Trees", des:"Thanks to the \"Patriot or Else Act\" we can infiltrate the major environmental organizations and mess up their activities.", eff:"greenness-40", loc:"sf", dep:"BILLS.patriot_act" }, //http://www.washingtonpost.com/wp-dyn/content/article/2005/12/19/AR2005121901777.html repress_eco: { tit:"Ungreening US", des:"Arrest the most active eco-activist, create a shitstorm on the radical green movement.", eff:"greenness-60", loc:"sf", dep:"UNDERCOVER.infiltrate_eco" }, infiltrate_dissenters: {tit:"United we stand", des:"Thanks to the \"Patriot or Else Act\" we can infiltrate anti-war groups, consumer associations and social justice movements threatening the unity of our nation.", eff:"consent+40", loc:"ny", dep:"BILLS.patriot_act" }, repress_dissenters: {tit:"Divided we fall", des:"Arrest the most active members of quasi-subversive groups such as anti-war groups, consumer associations and social justice organizations.", eff:"consent+60", loc:"ny", dep:"UNDERCOVER.infiltrate_dissenters" }, ven_paramilitary: {tit:"AIDing democracy", des:"Found right wing opposition parties in Venezuela in order to obstruct socialist reforms.", eff:"ven_dissent-30", cond:"ven_dissent>0", loc:"ven" }, //http://www.venezuelanalysis.com/analysis/1015 infiltrate_ven: {tit:"An eye on the courtyard", des:"Infiltrate Venezuela's secret services and establish connections with military high officiers.", eff:"ven_dissent-60", // cond:"ven_dissent>0", loc:"ven", dep:"UNDERCOVER.ven_paramilitary" }, //http://www.greenleft.org.au/2006/656/7455 coup: {tit:"The coup", des:"Promote a coup against the Venezuela's democratic government and create a friendlier environment for the foreign investors.", eff:"ven_dissent-80", // cond:"ven_dissent>0", loc:"ven", dep:"UNDERCOVER.infiltrate_ven" } //http://www.guardian.co.uk/world/2002/apr/21/usa.venezuela }; AFRICA = { //http://www.hrw.org/reports/1995/Nigeria.htm raid_tribe: { tit:"Raid the tribe", des:"Ogoni may be troublemakers. A delicious raid is the solution.", price:1000, sts:"active" }, //http://www.hrw.org/reports/1995/Nigeria.htm execute_dissenters: { tit:"Kill the activists", des:"Too many demonstrations? Eradicate the problem with a public execution.", price:2000, sts:"inactive" }, //http://en.wikipedia.org/wiki/Ken_Saro-Wiwa corrupt_gang: { tit:"Corrupt the gang", des:"Let the Niger Delta Rebels steal some oil to avoid troubles for a year.", price:1000, sts:"inactive" }, // patrol_station: { tit:"Defend Wells", des:"Bribe & deploy nigerian soldiers on your wells.", price:100, sts:"inactive" }, pollution_discount: { tit:"Ignore Pollution", des:"Reduce maintenance costs by ignoring environmental standards.", price:800, sts:"active" }, reduce_royalties: { tit:"Special Royalties", des:"Why giving all that money to the government when you can corrupt just few functionaries?", price:1000, sts:"inactive" } } for(o in ACTS) ACTS[o].friendly=false; for(o in BILLS) BILLS[o].friendly=true; //assign a id that can be passed as parameter for(o in ACTS) ACTS[o].id=o; for(o in BILLS) BILLS[o].id=o; for(o in EVENTS) EVENTS[o].id=o; for(o in GRASSROOT) GRASSROOT[o].id=o; for(o in UNDERCOVER) UNDERCOVER[o].id=o; for(e in EVENTS) if(EVENTS[e].tit.length>30) trace("error "+EVENTS[e].tit+" title too long"); } function initVars() { currentScId=""; dystopia=false; //game vars (to be saved) vars = new Object(); vars.maxRecovery=0; //economy //M dollars vars.GDP=INITIAL_GDP; //% vars.potentialGrowth=4; vars.GDPgrowth=vars.potentialGrowth; //% vars.oilAddiction=INITIAL_ADDICTION; vars.maintenanceMultiplier=100; //%income vars.taxes=TAXES; //initial money vars.money=INITIAL_MONEY; //$ per barrels vars.$BBL=INIT_$BBL; //politics vars.greenness=0; vars.repPercentage=60; vars.demPercentage=40; vars.repFounding=0; vars.demFounding=0; //local production vars.ven_production=0; vars.nig_production=0; vars.tex_production=0; vars.ala_production=0; vars.irq_production=0; //before or after the coup vars.ven_democracy=true; //nationalized or nor vars.ven_nationalized=false; //before after the armed escalation vars.nig_pacific=true; //before and after the "liberation" vars.irq_liberated=false; //% taxation (25% poor %50 fair) vars.ven_royalties=25; vars.nig_royalties=25; vars.irq_royalties=5; vars.ala_royalties=25; vars.tex_royalties=25; //% years of occupation * ANTI_IMPERIALIST_TENSION vars.ven_dissent=0; vars.nig_dissent=0; vars.irq_dissent=0; vars.globalWarming=0; //cumulative sold barrels vars.ultimateReserve=0; vars.tex_ultimateReserve=0; vars.ven_ultimateReserve=0; vars.nig_ultimateReserve=0; vars.ala_ultimateReserve=0; vars.irq_ultimateReserve=0; vars.tex_maxCapacity=0; vars.ven_maxCapacity=0; vars.nig_maxCapacity=0; vars.ala_maxCapacity=0; vars.irq_maxCapacity=0; //calculate local max and ultimate reserve for(r=0; r100) this._xscale=this._yscale=100; } function initElections() { if(options.sounds) { soundBox.electionIntro.stop(); soundBox.electionLoop = new Sound(soundBox); soundBox.electionLoop.attachSound("democracyLoop"); soundBox.electionLoop.start(0, 99); } elections = ROOT.createEmptyMovieClip("electionLayer", 2000); animals = elections.createEmptyMovieClip("animals", 40); dem=animals.attachMovie("donkey", "donkey", 20, {_x:DEM_X, _y:DEM_Y}); outline(dem, 0x13233E); rep=animals.attachMovie("elephant", "elephant", 30, {_x:REP_X, _y:REP_Y}); outline(rep, 0x480000); elections.attachMovie("electionInterface", "inter", 100); demSpot=elections.inter.bar.attachMovie("demSpot", "dem", 10); repSpot=elections.inter.bar.attachMovie("repSpot", "rep", 20); bucksMouth=elections.attachMovie("bucksMouth", "bucksMouth", 130, {_x:STAGE_W}); bucks=elections.createEmptyMovieClip("bucks", "bucks", 20); outline(bucks, 0x1C511D, "thin"); electionBg=elections.attachMovie("election_bg", "bg", -10); elections.inter.money_field.text= Math.round(vars.money); electionBg.onEnterFrame = function() { sd=this.stars.getNextHighestDepth() scale=random(50)+50; newS=this.stars.attachMovie("raceStar","s"+sd, sd, {_x:STAGE_W, _y:random(160), _xscale:scale, _yscale:scale}); } rep.bucks=0; dem.bucks=0; rep.fire.gotoAndPlay("off"); dem.fire.gotoAndPlay("off"); bucksTimer=0; bucksMouth.onEnterFrame = function() { //150 if(_ymouse>150) this.dest=REP_Y+20; else this.dest=DEM_Y+20; this._y-=(this._y-this.dest)/2; if(Math.abs(this._y-(DEM_Y+20))<10) { if(founding!=dem) { dem.head.gotoAndPlay("open"); rep.head.gotoAndPlay("close"); this.gotoAndStop("dem"); } founding=dem; } else if(Math.abs(this._y-(REP_Y+20))<10) { if(founding!=rep) { rep.head.gotoAndPlay("open"); dem.head.gotoAndPlay("close"); this.gotoAndStop("rep"); } founding=rep; } else founding=undefined; if(mouseIsDown && founding!=undefined && bucksTimer<=0 && vars.money-DOLLARS_PER_BUCK>MAX_DEBT) { d=bucks.getNextHighestDepth(); newBucks=bucks.attachMovie("bucks", "b_"+d, d, {_y:bucksMouth._y, _x:bucksMouth._x}); newBucks.speed=-40; newBucks.beneficiary=founding; this.play(); vars.money-=DOLLARS_PER_BUCK+(ELECTION_COST_INCREMENT*vars.yearCount); elections.inter.money_field.text= Math.round(vars.money); newBucks.onEnterFrame = function() { this._x+=this.speed; if(this.beneficiary == rep && (this.hitTest(rep.area) || this._x<100) ) { if(options.sounds) { soundBox.electionSound = new Sound(soundBox); soundBox.electionSound.attachSound("fire"); soundBox.electionSound.start(); } rep.bucks++; rep.boost+=BUCKS_BOOST; rep.fire.gotoAndPlay("on"); removeMovieClip(this); } if(this.beneficiary == dem && (this.hitTest(dem.area) || this._x<100) ) { if(options.sounds) { soundBox.electionSound = new Sound(soundBox); soundBox.electionSound.attachSound("fire"); soundBox.electionSound.start(); } dem.bucks++; dem.boost+=BUCKS_BOOST; dem.fire.gotoAndPlay("on"); removeMovieClip(this); } } bucksTimer=5; } bucksTimer--; } //end onenterf electionTime=0; //the consent is referred to the previous administration popularity //the advantage / disadvantage of the prev admininstration in percentage momentum = ANIMALS_SPEED/100*( vars.consent-50 )*ANIMALS_SPEED; if(momentum<0) { oppositionMomentum=-momentum; momentum=0; } else oppositionMomentum=0; if(vars.administrationParty=="rep") { dem.speed=ANIMALS_SPEED+oppositionMomentum; rep.speed=ANIMALS_SPEED+momentum; } else { dem.speed=ANIMALS_SPEED+momentum; rep.speed=ANIMALS_SPEED+oppositionMomentum; } dem.boost=0; rep.boost=0; dem.randomBoost=0; rep.randomBoost=0; BAR_W=elections.inter.bar._width; /////////////////// elections.routine = function() { if(random(PREDICTABILITY)==0 && rep.randomBoost==0) { rep.randomBoost=BOOST_DURATION; rep.fire.gotoAndPlay("on"); } if(random(PREDICTABILITY)==0 && dem.randomBoost==0) { dem.randomBoost=BOOST_DURATION; dem.fire.gotoAndPlay("on"); } rep._x+=rep.speed+rep.boost/2+rep.randomBoost/2; dem._x+=dem.speed+dem.boost/2+dem.randomBoost/2; if(rep.boost>0) { rep.boost--; if(rep.boost==1) rep.fire.gotoAndPlay("shut"); } if(rep.randomBoost>0) { rep.randomBoost--; if(rep.randomBoost==1) rep.fire.gotoAndPlay("shut"); } if(dem.boost>0) { dem.boost--; if(dem.boost==1) dem.fire.gotoAndPlay("shut"); } if(dem.randomBoost>0) { dem.randomBoost--; if(dem.randomBoost==1) dem.fire.gotoAndPlay("shut"); } repSpot._x=(BAR_W/ELECTION_LENGTH)*rep._x; demSpot._x=(BAR_W/ELECTION_LENGTH)*dem._x; if(repSpot._x>BAR_W-repSpot._width) repSpot._x=BAR_W-repSpot._width; if(demSpot._x>BAR_W-demSpot._width) demSpot._x=BAR_W-demSpot._width; if(rep._x>ELECTION_LENGTH || dem._x>ELECTION_LENGTH) { if(rep._x>dem._x) { deltaPerc=100-(dem._x/ELECTION_LENGTH*100); repPerc=Math.ceil(50+deltaPerc/2); demPerc=100-repPerc; } if(dem._x>rep._x) { deltaPerc=100-(rep._x/ELECTION_LENGTH*100); demPerc=Math.ceil(50+deltaPerc/2); repPerc=100-demPerc; } vars.demPercentage=demPerc; vars.repPercentage=repPerc; vars.repFounding=Math.round(rep.bucks/SELL_OUT_BUCKS*100); vars.demFounding=Math.round(dem.bucks/SELL_OUT_BUCKS*100); demBucks = dem.bucks; repBucks = rep.bucks; if(vars.repFounding>100) vars.repFounding=100; if(vars.demFounding>100) vars.demFounding=100; createAdministration(vars.repPercentage, vars.repFounding, vars.demFounding, vars.greenness); removeMovieClip(elections); clearInterval(electionID); soundBox.electionLoop.stop(); electionOutro=ROOT.attachMovie("election_outroScreen", "election_outroScreen", 1000); //strings electionOutro.results_field.text=STR.results.toUpperCase(); electionOutro.rep_support_field.text=STR.rep_support.toUpperCase(); electionOutro.president_title_field.text=STR.president.toUpperCase(); electionOutro.oiled_field.text=STR.oiled_str; electionOutro.gray_field.text=STR.gray_str; electionOutro.eco_field.text=STR.eco_str; electionOutro.votes_field.text=STR.votes.toUpperCase(); electionOutro.your_donations_field.text=STR.donations.toUpperCase(); electionOutro.reps_field.text=STR.rep_short.toUpperCase(); electionOutro.dems_field.text=STR.dem_short.toUpperCase(); // create the Pie as a MovieClip called "myPie" inside_root, at coordinates (10,10) with width 450 and height 250 var myPie:Pie = new Pie("myPie", electionOutro, electionOutro.pieArea._x, electionOutro.pieArea._y, electionOutro.pieArea._width, electionOutro.pieArea._height); //function Pie(name:String, owner:MovieClip, x:Number, y:Number, w:Number, h:Number) electionOutro.pieArea._visible=false; // set the Pie title, a radius of 250, radio between witdh and height 1.5, thickness 20 // display the legend on the right and show labels as percent myPie.setPieAspect(250, 1.5, 20, ""); //public function setPieAspect(r:Number, s:Number, t:Number, title:String, legend:Number, labels:Number):Void // assign values and sort them descending myPie.setValues([ {value:repPerc, label:STR.reps, color:0xCC0000}, {value:demPerc, label:STR.dems,color:0x0066CC} //{value:80.89, label:"Widget B", color:0x0000FF} ], myPie.SORT_DESCENDING); electionOutro.reps_text.text = repPerc+"%"; electionOutro.dems_text.text = demPerc+"%"; electionOutro.reps_fundings.text = repBucks*DOLLARS_PER_BUCK+(ELECTION_COST_INCREMENT*vars.yearCount)+"$"; electionOutro.dems_fundings.text = demBucks*DOLLARS_PER_BUCK+(ELECTION_COST_INCREMENT*vars.yearCount)+"$"; fr=vars.oiledReps+vars.oiledDems+1; if(fr>0 && fr!=undefined && !isNaN(fr)) electionOutro.oiled.gotoAndStop(fr); else electionOutro.oiled.gotoAndStop(1); fr=vars.greenReps+vars.greenDems+1; if(fr>0 && fr!=undefined && !isNaN(fr)) electionOutro.green.gotoAndStop(fr); else electionOutro.green.gotoAndStop(1); fr=vars.grayReps+vars.grayDems+1; if(fr>0 && fr!=undefined && !isNaN(fr)) electionOutro.gray.gotoAndStop(fr); else electionOutro.gray.gotoAndStop(1); if(president.pos=="oiled") electionOutro.president_field.text = STR.pres_oiled; else electionOutro.president_field.text = STR.pres_not_oiled; electionOutro.presidentLine.gotoAndStop(president.pos); electionOutro.continueBtn.onRelease = function() { screen._visible=true; createActionMenu(scenarios[currentScId].actions); step(); updateLoop(); changeScenario("was"); playAmbient("was_loop"); removeMovieClip(electionOutro); } } } clearInterval(electionID); electionID = setInterval(elections, "routine", ELECTION_SPEED); //////////////////// animals.scrolling = function() { //center on the middle if(dem._x 50/100*10 = 5 on 10 demReps=(REPS-1)-repReps; //STEP 2: calculate oiled representatives //repFound or demFound at 100% represent the complete buy off of the party //they are not percentages of the same whole vars.oiledReps = oiledReps =Math.ceil(repReps/100*repFound); //repFound 50% -> 5/100*50 = 2.4 rounded 3 vars.oiledDems = oiledDems=Math.floor(demReps/100*demFound); //demFound 50% -> 5/100*50 = 2.4 rounded 2 //STEP 3: calculate green and grays //greenness represents the public opinion pressure about environmental issues //on 100% all the unbribed politicians are green //on 0% all the unbribed politicians are gray vars.greenReps = greenReps= Math.floor((repReps-oiledReps)/100*vars.greenness); //greenness 50% -> 5-3 / 100 * 50 = 1 vars.greenDems = greenDems= Math.ceil((demReps-oiledDems)/100*vars.greenness); //greenness 50% -> 5-2 /100 * 50 = 1.5 rounded 2 (intrinsic progressiveness) //STEP 4: calculate grays //grays representatives have no particular belief on environmental issues and tend to follow the society's greenness vars.grayReps = grayReps = repReps-oiledReps-greenReps; // 5-3-1=1 vars.grayDems = grayDems = demReps-oiledDems-greenDems; // 5-2-2=1 //STEP 5: president //the president doesn't vote but activates certain laws (war) and give access to the hidden room //the president follows the same trend //if repReps==demReps republicans win (assuming electoral fraud) //small variations in conditions >= instead of > are due to the intrinsic progressiveness/conservativeness of the party if(repReps>=demReps) { president.party="rep"; if(oiledReps>=greenReps && oiledReps>=grayReps) president.pos="oiled"; else if(greenReps>oiledReps && greenReps>grayReps) president.pos="green"; else president.pos="gray"; } else { president.party="dem"; if(oiledDems>greenDems && oiledDems>grayDems) president.pos="oiled"; else if(greenDems>=oiledDems && greenDems>=grayDems) president.pos="green"; else president.pos="gray"; } if(president.pos=="oiled") washington.undercover.activated=true; else washington.undercover.activated=false; //STEP 6: initialize reps //use the previous vars as counters for(i=0; i<(REPS-1);i++) { thisRep=washington.congress["p"+i]; if(repReps>0) { //party thisRep.party="rep"; //position if(oiledReps>0) { thisRep.pos="oiled"; oiledReps--; } else if(greenReps>0) { thisRep.pos="green"; greenReps--; } else thisRep.pos="gray"; repReps--; } else if(demReps>0) { //party thisRep.party="dem"; //position if(oiledDems>0) { thisRep.pos="oiled"; oiledDems--; } else if(greenDems>0) { thisRep.pos="green"; greenDems--; } else thisRep.pos="gray"; demReps--; } } //change appearance for(i=0; i=50) ? repPerc : 100-repPerc; vars.administrationParty = (repPerc>=50) ? "rep" : "dem"; } function voteAct(currentAct) { trace("voting act "+currentAct.tit); ayes=0; for(i=0; i<(REPS-1);i++) { if(washington.congress["p"+i].pos=="green") ayes++; else if(washington.congress["p"+i].pos=="gray") { grayAye=random(100) > currentAct.boldness*20; if(grayAye) ayes++; } }//for if(ayes>(REPS-1)/2) { currentAct.sts="disabled"; applyModifiers(currentAct.eff); special(currentAct.id); //timed event if(currentAct.timer!=undefined) createTimedEvent(currentAct); newMessage(currentAct.tit+" approved", "act_pic", currentAct, "act"); //showAct(currentAct); } } function voteBill(currentBill) { trace("voting bill "+currentBill.tit); ayes=0; for(i=0; i<(REPS-1);i++) { if(washington.congress["p"+i].pos=="oiled") ayes++; else if(washington.congress["p"+i].pos=="gray") { if(random(100)>currentBill.shamelessness*20) ayes++; } // }//for if(ayes>(REPS-1)/2) { trace("bill approved"); currentBill.sts="disabled"; applyModifiers(currentBill.eff); special(currentBill.id); newMessage(currentBill.tit+" approved", "act_pic", currentBill, "act"); //showAct(currentBill, true); //refreshBills() } else trace("bill rejected"); buildBillIndex(); } function refreshUndercover() { for(u in UNDERCOVER) if(UNDERCOVER[u].sts!="disabled" && UNDERCOVER[u].dep!="special") UNDERCOVER[u].sts = (checkCondition(UNDERCOVER[u].cond) && checkDependency(UNDERCOVER[u].dep) ) ? "active" : "inactive"; } //parse effects syntax function applyModifiers(effectsStr, negative) { if(negative==undefined) negative=false; //add timed act effectsArr = new Array(); effectsArr=effectsStr.split(";"); for(i=0; i=50) ? "rep" : "dem"; electionIntro.elements.participateBtn.onRelease = function() { removeMovieClip(electionIntro); initElections(); } electionIntro.elements.skipBtn.onRelease = function() { soundBox.electionIntro.stop(); removeMovieClip(electionIntro); changeScenario("was"); updateLoop(); playAmbient("was_loop"); screen._visible=true; repPop = (vars.administrationParty=="rep")? vars.consent : 100-vars.consent; createAdministration(repPop, 0, 0, vars.greenness); step(); } lastElections=vars.year; } //normal economy step else { //reset messages //iFace.communicator._y=STAGE_H; //iFace.communicator.count=0; vars.year++; iFace.gizmo.year_field.text=vars.year; //step vars stepRecovery=0; vars.maxRecovery=0; vars.ven_production=0; vars.nig_production=0; vars.tex_production=0; vars.ala_production=0; vars.irq_production=0; royaltiesBBL=0; mainteinanceCost=0; //1: demand f(GDP, growth, addiction) //economy growth % vars.GDP+=vars.GDP/100*(vars.GDPgrowth); vars.oilDemand=vars.GDP/100*vars.oilAddiction*K_OIL; //2: maximum recovery based on the previous step state for(i=0; i0 && w.enabled) { //single well - before the peak //decline if(w.reservoir.reserve0) plantsUsage= vars.oilDemand / vars.maxRecovery * 100; else plantsUsage=0; if(plantsUsage>100) plantsUsage=100; if(plantsUsage<0) plantsUsage=0; //4: real recovery, costs for(i=0; i0) { w.recovery=w.maxRecovery/100*plantsUsage; w.reservoir.reserve-=w.recovery; vars.ultimateReserve-=w.recovery; stepRecovery+=w.recovery; //save the local prod value locId=w._parent._parent._name; vars[locId+"_production"]+=w.recovery; vars[locId+"_ultimateReserve"]-=w.recovery; royaltiesBBL += w.recovery/100 * vars[locId+"_royalties"]; } } for(i=0; i0 && oilDeficit>0) { //conjunctural crisis: the price will tend to recover to the previous value //save the price before the crisis if(!vars.crisis && vars.prePeak) { old$BBL=vars.$BBL; vars.crisis=true; } //if pre-peak price are slower if(vars.prePeak) vars.$BBL+=oilDeficit/PRICE_DIVIDER_PRE_PEAK; else if(!vars.prePeak && vars.GDPgrowth<0) vars.$BBL+=oilDeficit/PRICE_DIVIDER_RECESSION; else vars.$BBL+=oilDeficit/PRICE_DIVIDER; //price ceiling if(vars.$BBL>MAX_$BBL) vars.$BBL=MAX_$BBL; } else if(oilDeficit==0) { //no more crisis, recover to the previous value vars.crisis=false; vars.$BBL-=Math.round((vars.$BBL-old$BBL)/K_$BBL_POSTCRISIS); if(vars.$BBLvars.potentialGrowth) vars.GDPgrowth=vars.potentialGrowth; if(vars.GDPgrowth<0 && EVENTS.recession.sts=="active") newEvent(EVENTS.recession); if(vars.GDPgrowth>0 && EVENTS.recession.sts=="disabled") EVENTS.recession.sts="active"; /* trace(""); trace("GDPgrowth "+vars.GDP) trace("prices growth "+pricesGrowth) trace("GDPgrowth "+vars.GDPgrowth) */ //income if(soldBarrels>0) { income=soldBarrels*vars.$BBL; royalties=royaltiesBBL*vars.$BBL; taxes = income/100 * vars.taxes; } else income=royalties=taxes=0; //balance yearBalance= income - mainteinanceCost - royalties - taxes; vars.money+=yearBalance; //bills activeEvents = new Array(); for(e in EVENTS) if(EVENTS[e].sts=="active") activeEvents.push(EVENTS[e]); //bills activeBills = new Array(); for(b in BILLS) if(BILLS[b].sts=="active") activeBills.push(BILLS[b]); /////////////////////////////////// // 8: economy response to crisis // /////////////////////////////////// lastOilAddiction=vars.oilAddiction; if(oilDeficit>0) { //try government //create index of available acts sortedActs = new Array(); for(a in ACTS) if(ACTS[a].sts=="active") sortedActs.push(ACTS[a]); if(sortedActs.length>0) //!voting { rndAct=sortedActs[random(sortedActs.length)]; voteAct(rndAct); } //check next adjusted deficit projectedDemand=vars.GDP/100*vars.oilAddiction*K_OIL; projectedDeficit=100-vars.maxRecovery/vars.oilDemand*100; //was it ineffetive? go social if(projectedDeficit>0) { sortedGrassroot = new Array(); for(g in GRASSROOT) if(GRASSROOT[g].sts=="active") sortedGrassroot.push(GRASSROOT[g]); sortedGrassroot.sortOn("greenness"); if(sortedGrassroot.length>0) { gEvent=sortedGrassroot[0]; //probability if(random(vars.greenness)>gEvent.greenness*20 && random(100)0) { //reduce consent vars.consent-=HOMELAND_CONFLICTUALITY/2; //if not movements grow vars.greenness+=GREENNESS_CATASTROPHE; if(vars.greenness>100) vars.greenness=100; activeCatastrophes = new Array(); for(c in CATASTROPHES) if(CATASTROPHES[c].sts!="disabled" && vars.$BBL>CATASTROPHES[c].prices && random(100)0) newEvent(activeCatastrophes[0]); } } //no crisis time, government is supportive else if(activeBills.length>0 && random(100)0 && random(100)0) vars.nig_dissent+=ANTI_IMPERIALIST_TENSION; if(vars.nig_production>30 && screen.nig.ground.river.dead!=true && vars.gang_corrupted!=true) { screen.nig.ground.river.gotoAndStop("dead"); screen.nig.ground.river.dead=true; screen.nig.units.pigs._visible=false; screen.nig.ground.river.onRollOver = function() { setInfo(STR.river_clean); }; screen.nig.ground.river.onRollOut = function() { clearInfo(); }; screen.nig.ground.river.onRelease = function() { showHelp(STR.river_polluted); }; } //reset vars.gang_corrupted=false; //pacific demonstrations if(EVENTS.ogoni_movement.sts=="disabled" && random(100)0) { //form a group group=[{unit:"angryAfrican", number:NIG_OCCUPATION_PEOPLE}]; target=targets[random(targets.length)]; //non violent attack attack(group, target, false); newMessage(STR.plant_occupation, "worker_comm", target, "unit"); group.createEmptyMovieClip("dummy", 999); group.dummy.playSound("ogoni_demo", 100, true); } //after the rebellion else if(targets.length>0 && !vars.nig_pacific) { //form a group group=[{unit:"rebel", number:MAX_NIG_REBELS}]; target=targets[random(targets.length)] //violent attack attack(group, target, true); newMessage(STR.plant_attack, "worker_comm", target, "unit"); } } //trace("ven dissent"+vars.ven_dissent); //venezuela dissent if(vars.ven_production>0 && vars.ven_democracy) vars.ven_dissent+=ANTI_IMPERIALIST_TENSION; //ven demos //no coup + before the nationalization + after the limit + random if(vars.ven_democracy==true && vars.ven_nationalized==false && vars.ven_democracy && vars.ven_dissent>VEN_OCCUPATION_LIMIT && random(100)0) { //form a group group=[{unit:"angryIndio", number:VEN_OCCUPATION_PEOPLE}]; target=targets[random(targets.length)]; //non violent attack attack(group, target, false); newMessage(STR.plant_occupation, "worker_comm", target, "unit"); } } //trace("irq dissent"+vars.irq_dissent); //iraq dissent if(vars.irq_liberated) { vars.irq_dissent+=ANTI_IMPERIALIST_TENSION; if(vars.irq_dissent>=100) { if(EVENTS.irq_anarchy.sts!="disabled") newEvent(EVENTS.irq_anarchy); //attack well if(random(100) < IRQ_WELL_ATTACK) { targets=new Array(); for(mc in screen.irq.structures) if( (screen.irq.structures[mc].well || screen.irq.structures[mc].id=="humanBurner") && screen.irq.structures[mc].enabled) targets.push(screen.irq.structures[mc]); if(targets.length>0) { //form a group group=[{unit:"insurgent", number:random(MAX_IRQ_INSURGENT)+1}]; target=targets[random(targets.length)]; //violent attack attack(group, target, true); if(target.group.people>0) newMessage(STR.plant_attack, "mercenary_comm", target, "unit"); else newMessage(STR.plant_attack, "worker_comm", target, "unit"); } } else if(random(100) < IRQ_PALACE_ATTACK) { //form a group group=[{unit:"insurgent", number:random(MAX_IRQ_INSURGENT)+1}]; target=screen.irq.structures.palace; //non violent attack attack(group, target, true); newMessage(STR.palace_attack, "soldier_comm", target, "unit"); } //attack palace } } /////////////////////////////////// //countdown timed events for(i=0; i0) { timedEvents[i].years--; if(timedEvents[i].years==0) applyModifiers(timedEvents[i].eff, true); } //countdown occupations for(i=0; i0) { occupations[i].years--; if(occupations[i].years==0) { if(occupations[i].grp.mission=="party") removeGroup(occupations[i].grp); else { clearInterval(occupations[i].intervalId); occupations[i].grp.mission="completed"; occupations[i].tgt.enabled=true; occupations[i].tgt.animation.play(); removeGroup(occupations[i].grp); } } } //start from less addiction //case 1 no deficit and good money or investments = happiness if(oilDeficit==0 && vars.prePeak) vars.shareholdersSupport+= SH_TRUST_RECOVER; //case 2 >90 % else if(oilDeficit>0 && vars.ultimateReserve > vars.WORLD_CAPACITY/1.1) { vars.shareholdersSupport-= SH_TRUST; } //case 3 >83 % else if(oilDeficit>0 && vars.ultimateReserve > vars.WORLD_CAPACITY/1.2) { vars.shareholdersSupport-= SH_TRUST/2; } //case 4 >71 % else if(oilDeficit>0 && vars.ultimateReserve > vars.WORLD_CAPACITY/1.4) { vars.shareholdersSupport-= SH_TRUST/4; } //case 2 >66 % else if(oilDeficit>0 && vars.ultimateReserve > vars.WORLD_CAPACITY/1.5) { vars.shareholdersSupport-= SH_TRUST/6; } //case 3 addiction = anger else if(!vars.prePeak) { vars.shareholdersSupport=vars.oilAddiction; } if(vars.shareholdersSupport<=40) { if(!warningSH) newMessage(STR.share_first+STR.unsatisfied, "executive_pic", undefined, "board"); warningSH=true; } else warningSH=false; if(vars.shareholdersSupport<=20) { if(!warningSHTerminal) showHelp("Warning: you are not meeting the demand and the shareholders are really unsatisfied. They are considering to fire you."); warningSHTerminal=true; } else warningSHTerminal=false; //limit variables //limit it shouldn't happen if(vars.consent<0) vars.consent=0; if(vars.consent>100) vars.consent=100; if(vars.oilAddiction>100) vars.oilAddiction=100; if(vars.oilAddiction<0) vars.oilAddiction=0; if(vars.greenness>100) vars.greenness=100; if(vars.greenness<0) vars.greenness=0; if(vars.shareholdersSupport>100) vars.shareholdersSupport=100; if(vars.shareholdersSupport<0) vars.shareholdersSupport=0; //trace("share holders: "+vars.shareholdersSupport); /////////////////////////////////// //VISUALIZATION //internal dissent //30 (MAX_DEMONSTRATORS) demonstrators available //15 for environment 15 for dissent (triggered by war, oil prices and external reasons) //trace("consent "+vars.consent) politicalDemonstrators=0; //dissent is visible if consent goes below 50 //limit case: consent 0% = 15 demonstrators if(vars.consent<50) politicalDemonstrators = MAX_DEMONSTRATORS/100 * ((50-vars.consent)*2); if(politicalDemonstrators>MAX_DEMONSTRATORS) politicalDemonstrators=MAX_DEMONSTRATORS; washington.congress.infoBox.pop_field.text=STR.popularity.toUpperCase()+": "+Math.round(vars.consent)+"%"; washington.congress.infoBox.election_field.text=STR.lastElections.toUpperCase()+": "+(lastElections+ELECTION_FREQUENCY); washington.congress.dissentInfo.value_field.text=STR.dissent.toUpperCase()+": "+Math.round(100-vars.consent)+"%"; washington.congress.greenInfo.value_field.text=STR.greenness.toUpperCase()+": "+Math.round((vars.greenness*vars.oilAddiction/100))+"%"; for(i=0; i0) { demonstration_admin["d_"+i].play(); demonstration_admin["d_"+i]._visible=true; } else demonstration_admin["d_"+i]._visible=false; politicalDemonstrators-- } //environmental dissent doesn't vary with the government //but is f(addiction, greenness) greenDissent = vars.greenness*vars.oilAddiction/100; greenDemonstrators = Math.round(MAX_DEMONSTRATORS/100*greenDissent); //trace("green demo "+greenDemonstrators); for(i=0; i0) { demonstration_eco["d_"+i].play(); demonstration_eco["d_"+i]._visible=true; } else demonstration_eco["d_"+i]._visible=false; greenDemonstrators-- } printVars(); for(i in CHART_ITEMS) chart(i, vars[i], CHART_ITEMS[i][0], CHART_ITEMS[i][1], CHART_ITEMS[i][2]); //shareholders support SHAREHOLDERS=8; if(vars.shareholdersSupport==0) happyShareholders=0; else if(vars.shareholdersSupport==100) happyShareholders=SHAREHOLDERS; else happyShareholders = Math.round(SHAREHOLDERS / (100/vars.shareholdersSupport)); for(s=0; s0) windows.economy.board["dir"+s].gotoAndStop("happy"); else windows.economy.board["dir"+s].gotoAndStop("unhappy"); /* angry < 20 unsatisfied < 40 perplexed < 60 satisfied <80 happy >80 The shareholders are happy, satisfied, perplexed, unsatisfied, angry */ shareTxt = STR.share_first; if(vars.shareholdersSupport<20) shareTxt+=STR.angry; else if(vars.shareholdersSupport<40) shareTxt+=STR.unsatisfied; else if(vars.shareholdersSupport<60) shareTxt+=STR.perplexed; else if(vars.shareholdersSupport<80) shareTxt+=STR.satisfied; else if(vars.shareholdersSupport>=80) shareTxt+=STR.happy; windows.economy.shareholders_field.text= shareTxt; //balance summary windows.economy.balance_year_field.text= (vars.year-1)+" "+STR.balance; windows.economy.values_field.text= trimMoney(income)+" $\n"; windows.economy.values_field.text+= -trimMoney(stepInvestments)+" $\n"; windows.economy.values_field.text+= -trimMoney(mainteinanceCost)+" $\n"; windows.economy.values_field.text+= -trimMoney(royalties+taxes)+" $\n"; windows.economy.year_balance_field.text= trimMoney(yearBalance)+" $\n"; windows.economy.money_field.text= trimMoney(vars.money)+" $\n"; //reset operation screen resetUndercover(); //foreing dissent area=windows.undercover.map.nig_stability.level; if(vars.nig_dissent<25) area.gotoAndStop("low"); else if(vars.nig_dissent<50) area.gotoAndStop("medium"); else if(vars.nig_dissent<75) area.gotoAndStop("high"); else if(vars.nig_dissent>=75) area.gotoAndStop("critical"); area=windows.undercover.map.irq_stability.level; if(vars.irq_dissent<25) area.gotoAndStop("low"); else if(vars.irq_dissent<50) area.gotoAndStop("medium"); else if(vars.irq_dissent<75) area.gotoAndStop("high"); else if(vars.irq_dissent>=75) area.gotoAndStop("critical"); area=windows.undercover.map.ven_stability.level; if(vars.ven_dissent<25) area.gotoAndStop("low"); else if(vars.ven_dissent<50) area.gotoAndStop("medium"); else if(vars.ven_dissent<75) area.gotoAndStop("high"); else if(vars.ven_dissent>=75) area.gotoAndStop("critical"); area=windows.undercover.map.usa_stability.level; stab= (vars.consent+(100-(vars.greenness*vars.oilAddiction/100)) )/2; if(stab>40) area.gotoAndStop("low"); else if(stab>30) area.gotoAndStop("medium"); else if(stab>20) area.gotoAndStop("high"); else area.gotoAndStop("critical"); normalizeCharts(); vars.yearCount++; }//end elections / normal space //reset at the end stepInvestments=0; //End states //a: lack shareholders support -> fired if( (vars.shareholdersSupport<=0 || vars.money end of the petroleum era else if(vars.oilAddiction<=MIN_OIL_ADDICTION && vars.yearCount>30) { end("retire"); } //c: prices over 290 -> global war else if(dystopia==true) { end("mad"); } //d: GDP < initial gdp -> decline else if(vars.GDPvars.maxRecovery) { this._alpha = (this.blink) ? 80 : 100; this.blink = !this.blink; } else this._alpha=100; } iFace.gizmo.histogram.intervalId = setInterval(iFace.gizmo.histogram, "interval", 200); iFace.gizmo.trust_field.text=output; //viz for(i=0; imaxValue) maxValue=histoData[i].val; for(i=0; i iFace.gizmo.mask._height) iFace.gizmo.histogram._height = iFace.gizmo.mask._height-10; } function chart(line:String, val:Number, col:String, unit:String) { if(graph[line]==undefined) { layer=graph.createEmptyMovieClip(line, graph.getNextHighestDepth()); //line=layer.createEmptyMovieClip("lines", 10); layer.paintIt(col); layer.moveTo(0,0); layer.lineStyle(2, col, 100, false, "none"); //data array, every var is a pixel/month layer.lineData= new Array(); layer.unit=unit; layer.lineColor=col; //layer._visible=false; } else layer=graph[line]; //save the data layer.lineData.push([val, vars.year, vars.yearCount*CHART_X_MULTIPLIER]); xPos=vars.yearCount*CHART_X_MULTIPLIER; yPos=-val*2; if(yPos>0) yPos=0; //save the max value and the layer if(val>unitMaxValue[unit][1] || unitMaxValue[unit][1]==undefined) unitMaxValue[unit]=[layer, val]; pt={x:xPos, y:yPos}; layer.localToGlobal(pt); graphBG.globalToLocal(pt); if(pt.x>graphBG._width) graph[line]._width=graphBG._width; layer.lineTo(xPos, yPos); mouseListener.onMouseMove(); } //adjusts different graphs according to their unit of measure function normalizeCharts() { for(u in unitMaxValue) { if(unitMaxValue[u][0]._height>graphBG._height/2 || unitMaxValue[u][0]._height <= >= == !=] [value] if(condition!=undefined) { index=undefined; if(condition.indexOf("<=")!=-1) index=condition.indexOf("<="); if(condition.indexOf(">=")!=-1) index=condition.indexOf(">="); if(condition.indexOf("!=")!=-1) index=condition.indexOf("!="); if(condition.indexOf("==")!=-1) index=condition.indexOf("=="); if(index!=undefined) { operandVar=condition.slice(0, index); operandVal=condition.slice(index+2, condition.length); operator=condition.slice(index, index+2); } if(condition.indexOf("<")!=-1) index=condition.indexOf("<"); if(condition.indexOf(">")!=-1) index=condition.indexOf(">"); if(index!=undefined) { operandVar=condition.slice(0, index); operandVal=condition.slice(index+1, condition.length); if(operandVal=="true" || operandVal=="false") operandVal=operandVal=="true"; else operandVal=Number(operandVal); operator=condition.slice(index, index+1); } res=false; if(index!=undefined) { switch(operator) { case ">": res=vars[operandVar]>operandVal; break; case "<": res=vars[operandVar]=": res=vars[operandVar]>=operandVal; break; case "<=": res=vars[operandVar]<=operandVal; break; case "!=": res=vars[operandVar]!=operandVal; break; } } else { trace("error in condition "+condition); res=true; } } else res=true; return res } function checkDependency(dependency) { res = true; if(dependency!=undefined) { obj=eval(dependency); //if dependent on act has to be approved res = (obj.sts=="disabled") ? true: false; } return res } //special function activated by events function special(eventId) { switch(eventId) { //events case "world_peaked": vars.prePeak=false; break; case "tex_peaked": break; case "oil_incentives": actions.inspect.cost=0; actions.inspectSea.cost=0; createActionMenu(scenarios[currentScId].actions); break; case "ala_activation": for(a=0; a