function doFirst(){ BodyPrice=Array(300,400,600,800,800,900,1000) BodyWeight=Array(1000,1300,1600,1800,1800,2100,2000) BodyMaxLoad=Array(2300,3700,4800,5500,5500,6500,6000) BodySpace=Array(7,10,13,19,14,13,24) BodyName=Array("Subcompact","Compact","Mid-Sized","Luxury","Station Wagon","Pickup","Van") BodyCargo=Array(0,0,0,0,7,11,6) ChassisWeight=Array(.9,1,1.1,1.2) ChassisPrice=Array(0.8,1,1.5,2) ChassisName=Array("Light","Standard","Heavy","Extra Heavy") SuspensionPrice=Array(0,1,1.5,5) SuspensionHC=Array(1,2,3,2) SuspensionName=Array("Light","Improved","Heavy","Off-road") PlantPrice=Array(500,1000,2000,3000,12000) PlantWeight=Array(500,700,900,1100,2000) PlantSpace=Array(3,4,5,6,8) PlantDP=Array(5,8,10,12,15) PlantPower=Array(800,1400,2000,2600,6700) PlantName=Array("Small","Medium","Large","Super","ThunderCat") PlantMaxSpeed=Array(80,90,100,100,120) TireNumber=Array(4,6) TirePrice=Array(50,100,200,500,500,600) TireWeight=Array(30,40,50,60,75,80) TireDP=Array(4,6,9,8,12,12) TireName=Array("Standard","Heavy-Duty","Puncture Resistant","PR-Radials","Solid","Off-Road Solid") TurretSpace=Array(0,1,2,3,4,2,5,2,5) TurretWeight=Array(0, 150, 200, 300, 350, 300, 550, 450, 750) TurretPrice=Array(0, 1000,1500,2000,2500,2500,3500,3500,4500) TurretSpaceMade=Array(0,1, 2, 1, 2, 3,1,3,1) TurretName=Array("No Turret","One Space Turret","Two Space Turret","One Space Pop-Up Turret","Two Space Pop-Up Turret","Three Space Turret","Three Space Cupola","Three Space Pop-Up Turret","Three Space Pop-Up Cupola") ArmorPrice=Array(11,13,16,20,20,22,30) ArmorWeight=Array(5,6,8,10,10,11,14) ArmorPriceMod=Array(1,2,1.1,2.5) ArmorWeightMod=Array(1,1,1.1,1.1) ArmorName=Array("Normal","Fireproof (FP)","Reflective (LR)","LRFP") WeaponPrice=Array(0,1000,2000,6500,500,1250,1000,750,5000,2500,1500,2000,3000,8000,12000,10000,500,750,100,250,500,400,800,250,500,1000,300,550,1000,500,200,140,75,50,450,100,200) WeaponWeight=Array(0,150,350,500,450,650,200,100,200,200,300,600,200,500,1000,1200,150,150,25,25,50,25,50,25,50,250,30,60,200,100,100,50,25,20,150,100,150) WeaponAmmo=Array(0,20,20,10,10,10,10,10,2,2,10,10,0,0,0,10,10,5,10,10,10,25,10,25,10,10,25,10,10,5,1,1,1,1,1,1,1) WeaponCPS=Array(0,25,35,75,25,50,35,20,1000,400,35,50,0,0,0,100,50,100,20,10,40,10,40,10,40,25,35,140,25,50,0,0,0,0,0,0,0) WeaponLPrice=Array(0,1500,2700,7250,750,1750,1350,950,7000,3300,1850,2500,3000,8000,12000,11000,1000,1250,300,350,900,650,1200,500,900,1250,1175,1950,0,750,200,140,75,50,450,100,200) WeaponWPS=Array(0,2.5,5,10,5,10,5,2.5,100,15,5,10,0,0,0,20,5,10,5,5,20,2,8,2,8,5,2,8,4,5,0,0,0,0,0,0,0) WeaponLWeight=Array(0,200,450,600,500,750,250,125,400,230,350,700,200,500,1000,1400,200,200,75,75,250,75,130,75,130,300,80,140,0,125,100,50,25,20,150,100,150) WeaponSpace=Array(0,1,2,3,2,3,2,1,2,2,2,3,1,2,3,10,2,2,1,1,2,1,2,2,3,3,2,3,2,1,1,1,.5,.33,2,1,1) WeaponDamage=Array(0,1,2,3,1,2,2,1,3,3,2,3,1,3,4,6,"Mine","Mine","Spike","Smoke","Smoke","Paint","Paint","Slick","Slick","Blind/slick","d-2","d-2","1-1/2","Starshell",3,2,1,"d-1",1,4,2) WeaponDP=Array(0,3,3,4,2,3,2,2,1,2,4,5,2,2,2,10,2,2,4,4,4,2,3,3,4,3,3,4,2,2,2,2,1,1,3,2,2) WeaponToHit=Array(0,7,6,6,6,6,8,8,7,6,7,8,6,6,6,7,0,0,0,0,0,0,0,0,0,"5/7",0,0,7,0,9,9,9,9,9,9,9) WeaponEffect=Array("None","Area","Area","Burst 2","Area","Area","Burst 2","Burst 1","Burst 2","Burst 2","Burst 2","Burst 2","Area","Area","Area","Burst 2","Dropped","Dropped","Dropped","Paint/Smoke","Paint/Smoke","Paint/Smoke","Paint/Smoke","Dropped","Dropped","PLOPPED","Dropped","Dropped","GRENADE","LIGHT","Burst 2","Burst 1","Burst 1","Burst 1/2","Burst 2","Burst 2","Burst 3") WeaponName=Array("No Weapon","Machine Gun","Vulcan Machine Gun","AutoCannon","FlameThrower","HD FlameThrower","Rocket Launcher","Micro-Missile Launcher","Radar-Guided Missile","Wire-Guided Missile","Recoilless Rifle","Anti-Tank Gun","Light Laser","Laser","Heavy Laser","Tank Gun","Mine Dropper","Spear 1000 Mine Dropper","SpikeDropper","SmokeScreen","HD Smoke Screen","Paint Spray","HD Paint Spray","Oil Jet","Heavy Duty Oil Jet","Oil Gun","Flaming Oil Jet","HD Flaming Oil Jet","Grenade Launcher","Starshell Launcher","Heavy Rocket","Medium Rocket","Light Rocket","Mini Rocket","Six Shooter","Bomb","Cluster Bomb") ItemName=Array("No Item","Targeting Computer","Hi Res Targeting Computer","CyberLink","Weapons Linkage","Anti-personnel Flechette Grenade","Fake Blades","Fire Extinguisher","Improved Fire Extinguisher","Wheelguard Armor Point","FP Wheelguard Armor Point","LR Wheelguard Armor Point","LRFP Wheelguard Armor Point","Whelguard Retractor (Per Wheel Position)","Tool Kit","Portable Shop (Per 1/4 kit)","Tire Chain (Per Tire)","Stealth Mode","Infrared Targeting and Driving Aid","Sound Enhancement","Sound System","Side Door","Radar","SearchLight","Remote Control (Sending or Receiving Set)") ItemSpace=Array(0,0,0,1,0,0,0,1,1,0,0,0,0,1,1,1,0,2,1,1,1,0,0,1,0) ItemWeight=Array(0,0,0,100,0,0,0,150,200,4,4,4.4,4.4,50,40,75,0,200,100,150,100,500,0,50,0) ItemPrice=Array(0,1000,4000,16000,50,50,20,300,500,10,20,11,25,250,600,1000,20,16000,4000,6000,1000,1000,2500,200,2000) ItemNote=Array("","+1 to hit using any weapon from one crew position","+2 to hit using any weapon from one crew position","1 DP, +3 to hit for one weapon from one crew position","Connects two weapons of the same type to fire together","Destroyed with Armor or Roll. Allowed up to four.","Destroyed with Armor or roll","Destroyed with Power Plant. Extinguishes on 1-3","Destroyed with Power Plant. Extinguishes on 1-4","1 DP. Take up to 10 times your number of tires.","1 DP Take up to 10 times your number of tires.","1 DP Take up to 10 times your number of tires.","1 DP Take up to 10 times your number of tires.","Recommended for front tires (-1 HC otherwise)","2 DP Allows unmodified Mechanic checks","2 DP. Take FOUR to have the whole shop. +1 Mechanic Check","0 DP. Take ONE for EACH tire. Reduce Ice Penalty from +D4 to +D1","2 DP. Baffling system for helicopters, cars; move 1/2 speed,acceleration","2 DP. No penalty to maneuvers in total darkness","2 DP. Crew may listen through walls of one car or one building","0 DP. Public address system."," Requires Van. Usually a device for helicopters","0 DP. Reduces visibility penalties by 1. Objects appear as blips.","1 DP. To-Hit 3, Damage: 'Blind' Firing -10, maneuvers +D3","0 DP Controlling a car requires at least two.") } function lightGrey(iBox){ window.document.bgColor="EEEEEE" window.status='Please enter the new value in the box. Then hit TAB or click anywhere on the page.' iBox.select() } function checkKey(iBox){ if (event.keyCode==13){ goNext(iBox) } } function goNext(iBox){ nextForm=formNumber(iBox)*1+1 if (nextForm == document.forms.length){nextForm=0} document.forms[nextForm].elements[elementNumber(iBox)].focus() } function goNext2(iBox){ nextForm=formNumber(iBox)*1+1 if (nextForm == document.forms.length){nextForm=0} document.forms[nextForm].elements[0].focus() document.forms[nextForm].elements[0].select() } function formNumber(iBox){ var formName=iBox.form.name for (n=0;document.forms[n].name != formName;n++){} return n } function elementNumber(iBox){ var elementName=iBox.name for (n=0;iBox.form.elements[n].name != elementName;n++){} return n } function errorMessage(m){ window.errMsg=m; window.document.bgColor="999999"; window.status=m; window.staticStatus=true; setTimeout("window.staticStatus=false",5*1000); } function minValue(x1,x2){ if (x1= maxLoad){carPlantLoadedAcc.value=10} if (PlantPower[carPlant.value] >= maxLoad){carPlantLoadedAcc.value=15} carWeight.value=BodyWeight[carBody.value]+PlantWeight[carPlant.value]+x5*TireWeight[carTires.value]+carCrew.value*150+TurretWeight[carTurret.value]+(carArmor.value*carArmorWPP.value) + (carRamPlateArmor.value*carRamPlateWPP.value) + ((1*carSpoiler.checked+1*carAirDam.checked)*carSpoilerWeight)+totalWeaponWeight+totalItemWeight+carBladeWeight carPlantCurrentAcc.value=0 if (carWeight.value<=3*PlantPower[carPlant.value]) {carPlantCurrentAcc.value=5} if (carWeight.value<=2*PlantPower[carPlant.value]) {carPlantCurrentAcc.value=10} if (carWeight.value<=1*PlantPower[carPlant.value]) {carPlantCurrentAcc.value=15} carTireDP.value=TireDP[carTires.value] carBodySpace.value=BodySpace[carBody.value]-PlantSpace[carPlant.value]-carCrew.value*2-TurretSpace[carTurret.value]-totalWeaponSpace*1-totalItemSpace*1 carBodyCargo.value=BodyCargo[carBody.value] carBodyTurretSpace.value=TurretSpaceMade[carTurret.value]-totalWeaponTurretSpace*1 carSuspensionHC.value=SuspensionHC[carSuspension.value] if (carBody.value==6){ carSuspensionHC.value=carSuspensionHC.value-1 } if (carTires.value==3){ if (carSuspensionHC.value<3){ carSuspensionHC.value=carSuspensionHC.value-1+2 } else{ alert('PR radials cannot bring HC above 3.') } } carCargoWeight.value=carBodyMaxLoad.value-carWeight.value; if (carWeight.value > carBodyMaxLoad.value){ possibles="Too Heavy: Try "; if (carChassis.value<3 && maxLoadStructure < carWeight.value){ possibles+=" a stronger chassis," } if (carWeight.value>3*PlantPower[carPlant.value]){ possibles+=" a better power plant,"; } if (maxLoadPlant>maxLoadStructure){ possibles+=" a lighter power plant,"; } if (carArmor.value>30 || carRamPlateArmor>0){ possibles+=" less armor,"; } // alert ("carChassis.value="+carChassis.value); // alert ("PlantPower[carPlant.value]="+PlantPower[carPlant.value]); // alert ("carWeight.value="+carWeight.value); errorMessage(possibles)} if (carBodySpace.value < 0) { errorMessage('Not enough space.') if (carBodyTurretSpace.value>0){ errorMessage('Not enough space. Put your weapons in a turret.'); } } if ((carTurret.value>4) && (carBody.value<6)) { errorMessage('Van required for 3 space turret.')} if ((carNumTires.value==1) && (carBody.value<5)){ errorMessage('Too many tires for this size car.')} if ((carNumTires.value==0) && (carBody.value>4) && (carChassis.value==3)){ errorMessage('Trucks and vans with Extra-Heavy suspension require 6 wheels')} if (carBodyTurretSpace.value<0){ errorMessage('Not enough space in turret.')} if ((carSuspension.value==3)&&(carAirDam.checked)){ errorMessage('AirDams cannot be used with Off-Road Suspension.')} }//ends with(main) for (n=0;nmaxAmmo){ errorMessage('Ammo does not fit in weapon') } } } function addRow(it,pr,wt,sp,dp){ return (""+it+""+pr+""+wt+""+sp+""+dp+"") } function spreadSheet(){ with(window.document.forms[0]){ z="Car Wars Spread sheet

" z+=carName.value+"

" } z+=window.document.forms[1*numItems+1*numWeapons+1].carConcept.value with (window.document.forms[0]){ z+="" z+=addRow("Item","Price","Weight","Space","DP / Notes") zn=carBody.value z+=addRow(BodyName[zn],BodyPrice[zn],BodyWeight[zn],"--","--") zn=carChassis.value zm=BodyPrice[carBody.value] z+=addRow(ChassisName[zn]+" Chassis",Math.floor((ChassisPrice[zn]-1)*(zm)),"--","--","--") zn=carSuspension.value zm=BodyPrice[carBody.value] z+=addRow(SuspensionName[zn]+" Suspension",Math.floor(SuspensionPrice[zn]*(zm)),"--","--","--") zn=carPlant.value z+=addRow(PlantName[zn]+" Powerplant",PlantPrice[zn],PlantWeight[zn],PlantSpace[zn],PlantDP[zn]) zn=carCrew.value ztext="" if ((carTurret.value==6) || (carTurret.value==8)){ztext=" + Turret Gunner";} z+=addRow("Crew: "+zn+ztext,0,zn*150,zn*2,"3+Body Armor") zn=carTurret.value zm=turretUniversal.checked zt="" if (zm){zt="Universal "} z+=addRow(zt+TurretName[zn],TurretPrice[zn]+zm*1000,TurretWeight[zn],TurretSpace[zn],"--") zn=4+carNumTires.value*2 zm=carTires.value z+=addRow(zn+" "+TireName[zm]+" Tires",zn*TirePrice[zm],zn*TireWeight[zm],"--",TireDP[zm]) if (carBlades.checked){ z+=addRow("Car Blades",carBladePrice,carBladeWeight,"--","Destroyed w/ Armor") } if (carSpoiler.checked){ z+=addRow("Spoiler",carSpoilerPrice,carSpoilerWeight,"--","Destroyed w/ Armor") } if (carAirDam.checked){ z+=addRow("Air Dam",carSpoilerPrice,carSpoilerWeight,"--","Destroyed w/ Armor") } zn=carRamPlateArmor.value zm=carRamPlatePPP.value zt=carRamPlateWPP.value if (zn !=0){ z+=addRow(zn+" point Ram Plate",zn*zm,zn*zt,"--",zn) } zn=carArmor.value zm=carArmorPPP.value zt=carArmorWPP.value zx=carArmorType.value z+=addRow(zn+" points of "+ArmorName[zx]+" Armor",zn*zm,zn*zt,"--",zn) zlen=document.forms.length-1//Form indexing }//End with(main) for (n=1;n0){z+=addRow(ztext,zq*zt.Pricexx.value,zq*zt.Weightxx.value,zq*zt.Spacexx.value,ItemNote[zn])} } if (zt.name.substr(0,4)=="Weap"){ zMags=zt.Magazinexx.value*1 zA=zt.Ammoxx.value zP=zq*(WeaponPrice[zn]+zA*WeaponCPS[zn]+zMags*50) zW=zq*(WeaponWeight[zn]+zA*WeaponWPS[zn]+zMags*15) zS=zq*(zMags+WeaponSpace[zn]) if (zq==1){ztext=zq+" "+WeaponName[zn]+" with "} else{ztext=zq+" "+WeaponName[zn]+"s with "} if (zMags==1){ztext+=zMags+" Magazine and "} if (zMags>1){ztext+=zMags+" Magazines and "} if (zA==1){ztext+=zA+" shot"} else{ztext+=zA+" shots"} if (zq>1){ztext+=" each"} if (zn>0){z+=addRow(ztext,zP,zW,zS,zt.DPxx.value)} } } z+="
" with(document.forms[0]){ z+="
Total Price: "+carBodyPrice.value z+="
Total Weight: "+carWeight.value x=carBodyMaxLoad.value-carWeight.value z+="
Cargo: "+ x +" lbs. " + carBodySpace.value +" spaces" z+="
Acceleration: "+carPlantCurrentAcc.value z+="
Loaded Acceleration: "+carPlantLoadedAcc.value z+="" }//end with(main) SpreadWindow=window.open('','mywindow','width=400,height=800,resizable=yes,scrollbars=yes') SpreadWindow.document.write(z) } function display(text){ if (!window.staticStatus){ window.status=text; } }