function obj_wea(input)
{
switch(input.weapon)
{
case 0:
this.id=0;
this.version="reset_dummy";
this.name="";
this.dam=0;
this.dist_factor=0;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0;
this.wired_factor=0;
break;
case 24:
this.id=24;
this.version="v1.6";
this.pic="small_usp";
this.name_accu="usp";
this.name_short="usp";
this.name_long="USP .45 Tactical";
this.height_frequence=0.0116;
this.move_accle=-2.2085;
this.r=132.35;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.5;
this.wired_factor=0.5;
break;
case 25:
this.id=25;
this.version="v1.6";
this.pic="small_usp_sil";
this.name_accu="usp";
this.name_short="usp (sil)";
this.name_long="USP .45 Tactical (supr)";
this.dam=116;
this.height_frequence=0.0099;
this.move_accle=-1.9247;
this.r=116.64;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.5;
this.wired_factor=0.5;
break;
case 26:
this.id=26;
this.version="v1.6";
this.pic="small_glock18";
this.name_accu="glock18";
this.name_short="glock";
this.name_long="Glock18 Select Fire";
this.dam=96;
this.height_frequence=0.0106;
this.move_accle=-1.8417;
this.r=95.51;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.47;
this.wired_factor=0.48;
break;
case 27:
this.id=27;
this.version="v1.6";
this.pic="small_deagle";
this.name_accu="deagle";
this.name_short="deagle";
this.name_long="Desert Eagle .50AE";
this.dam=212;
this.height_frequence=0.0157;
this.move_accle=-3.1921;
this.r=212.67;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.17;
this.wired_factor=0.25;
break;
case 28:
this.id=28;
this.version="v1.6";
this.pic="small_p228";
this.name_accu="p228";
this.name_short="p228";
this.name_long="SIG Sauer P228";
this.dam=124;
this.height_frequence=0.0105;
this.move_accle=-2.0226;
this.r=125.06;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.30;
this.wired_factor=0.38;
break;
case 29:
this.id=29;
this.version="v1.6";
this.pic="small_96g";
this.name_accu="96g";
this.name_short="beretta";
this.name_long="Dual Beretta 96G Elite";
this.dam=140;
this.height_frequence=0.0156;
this.move_accle=-2.7056;
this.r=140.19;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.46;
this.wired_factor=0.48;
break;
case 31:
this.id=31;
this.version="v1.6";
this.pic="small_5seven";
this.name_accu="5seven";
this.name_short="5seven";
this.name_long="FN Five-Seven";
this.dam=76;
this.height_frequence=0.0028;
this.move_accle=-0.751;
this.r=77.908;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.17;
this.wired_factor=0.25;
break;
case 32:
this.id=32;
this.version="v1.6";
this.pic="small_tmp";
this.name_accu="tmp";
this.name_short="tmp";
this.name_long="Steyr TMP";
this.dam=76;
this.height_frequence=0.0033;
this.move_accle=-0.9094;
this.r=77.154;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.5;
this.wired_factor=0.5;
break;
case 33:
this.id=33;
this.version="v1.6";
this.pic="small_mac10";
this.name_accu="mac10";
this.name_short="mac10";
this.name_long="Ingram MAC-10";
this.dam=112;
this.height_frequence=0.0074;
this.move_accle=-1.6114;
this.r=113.33;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.56;
this.wired_factor=0.53;
break;
case 34:
this.id=34;
this.version="v1.6";
this.pic="small_p90";
this.name_accu="p90";
this.name_short="p90";
this.name_long="FN P90";
this.dam=80;
this.height_frequence=0.0018;
this.move_accle=-0.7092;
this.r=80.992;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.33;
this.wired_factor=0.33;
break;
case 35:
this.id=35;
this.version="v1.6";
this.pic="small_mp5";
this.name_accu="mp5";
this.name_short="mp5";
this.name_long="H&K MP5-Navy";
this.dam=100;
this.height_frequence=0.0066;
this.move_accle=-1.367;
this.r=101.33;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.50;
this.wired_factor=0.47;
break;
case 36:
this.id=36;
this.version="v1.6";
this.pic="small_ump45";
this.name_accu="ump45";
this.name_short="ump45";
this.name_long="H&K UMP 45";
this.dam=116;
this.height_frequence=0.0086;
this.move_accle=-1.7213;
this.r=117.21;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.34;
this.wired_factor=0.44;
break;
case 37:
this.id=37;
this.version="v1.6";
this.pic="small_galil";
this.name_accu="galil";
this.name_short="galil";
this.name_long="IMI Gali";
this.dam=116;
this.height_frequence=-0.0003;
this.move_accle=-0.1417;
this.r=116.97;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.15;
this.wired_factor=0.23;
break;
case 38:
this.id=38;
this.version="v1.6";
this.pic="small_famas";
this.name_accu="famas";
this.name_short="famas";
this.name_long="GIAT Famas";
this.dam=116;
this.height_frequence=0.0002;
this.move_accle=-0.3251;
this.r=116.6;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.22;
this.wired_factor=0.30;
break;
case 39:
this.id=39;
this.version="v1.6";
this.pic="small_ak47";
this.name_accu="ak47";
this.name_short="ak47";
this.name_long="Kalashnikov AK-47";
this.dam=140;
this.height_frequence=-0.0003;
this.move_accle=-0.1972;
this.r=141.53;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.15;
this.wired_factor=0.23;
break;
case 40:
this.id=40;
this.version="v1.6";
this.pic="small_m4a1";
this.name_accu="m4a1";
this.name_short="m4a1";
this.name_long=" Colt M4A1 Carbine";
this.dam=124;
this.height_frequence=0.0004;
this.move_accle=-0.3057;
this.r=125.73;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.22;
this.wired_factor=0.30;
break;
case 41:
this.id=41;
this.version="v1.6";
this.pic="small_m4a1_sil";
this.name_accu="m4a1";
this.name_short="m4a1 (sil)";
this.name_long="M4A1 Carbine (supr)";
this.dam=128;
this.height_frequence=0.0008;
this.move_accle=-0.5162;
this.r=129.24;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.21;
this.wired_factor=0.30;
break;
case 42:
this.id=42;
this.version="v1.6";
this.pic="small_sg552";
this.name_accu="sg552";
this.name_short="sg552";
this.name_long="SG-552 Commando";
this.dam=128;
this.height_frequence=0.0007;
this.move_accle=-0.4639;
this.r=129.74;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.21;
this.wired_factor=0.30;
break;
case 43:
this.id=43;
this.version="v1.6";
this.pic="small_aug";
this.name_accu="aug";
this.name_short="aug";
this.name_long="Steyr Aug";
this.dam=124;
this.height_frequence=0.00008;
this.move_accle=-0.3525;
this.r=124.94;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.22;
this.wired_factor=0.30;
break;
case 44:
this.id=44;
this.version="v1.6";
this.pic="small_scout";
this.name_accu="scout";
this.name_short="scout";
this.name_long="Steyr Scout";
this.dam=296;
this.height_frequence=-0.0005;
this.move_accle=-0.406;
this.r=296.76;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.09;
this.wired_factor=0.15;
break;
case 45:
this.id=45;
this.version="v1.6";
this.pic="small_awp";
this.name_accu="awp";
this.name_short="awp";
this.name_long="AI Arctic Warfare";
this.dam=456;
this.height_frequence=-0.0005;
this.move_accle=-0.3107;
this.r=457.5;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.01;
this.wired_factor=0.03;
break;
case 46:
this.id=46;
this.version="v1.6";
this.pic="small_g3sg1";
this.name_accu="g3sg1";
this.name_short="g3sg1";
this.name_long="H&K G3/SG-1";
this.dam=316;
this.height_frequence=0.00001;
this.move_accle=-0.4732;
this.r=317.38;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.11;
this.wired_factor=0.18;
break;
case 47:
this.id=47;
this.version="v1.6";
this.pic="small_sg550";
this.name_accu="sg550";
this.name_short="sg550";
this.name_long=" SIG SG-550";
this.dam=276;
this.height_frequence=0.0007;
this.move_accle=-0.4368;
this.r=277.52;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.19;
this.wired_factor=0.28;
break;
case 48:
this.id=48;
this.version="v1.6";
this.pic="small_m249";
this.name_accu="m249";
this.name_short="m249";
this.name_long="FN M249 Para";
this.dam=124;
this.height_frequence=0.0004;
this.move_accle=-0.3072;
this.r=125.7;
this.aquidradiant=0;
this.shotsquare=0;
this.e=0.17;
this.wired_factor=0.25;
break;
default:
break;
}
}
function obj_input()
{
this.display_mode="basic";
this.display_damage=false;
this.play_sound=false;
this.reset_on_weaponswitch=false;
this.distance=0;
this.get_distance=validate_distance;
this.resetvalue=0;
this.get_resetvalue=100;
this.weapon=0;
this.helmet=true;
this.ab=true;
}
function obj_victim(input,wea)
{
this.j=new obj_zone;
this.chest=new obj_zone;
this.p=new obj_zone;
this.aa=new obj_zone;
this.q=new obj_zone;
this.j.factor=1.00;
this.chest.factor=0.25;
this.p.factor=0.31;
this.aa.factor=0.18;
this.m=0;
this.o=0;
this.n=0;
this.f=0;
this.g=0;
this.h=0;
this.dist_factor=1;
this.calc_basis=calc_basis;
}
function obj_zone()
{
this.l=new obj_data;
this.OO=new obj_data;
this.calc=calc;
this.td_code;
this.td_code;
}
function obj_data()
{
this.ave=0;
this.y=0;
this.z=0;
this.ae=0;
this.af=0;
this.ag=0;
this.w=false;
this.v=false;
this.u=false;
this.trim_bars=trim_bars;
this.reset=reset;
this.td_code;
}
function obj_html(input)
{
this.c=new obj_data_layout;
this.d=new obj_data_layout;
this.convert_numeric=convert_numeric;
this.convert_graphic=convert_graphic;
this.log_distance=0;
this.log_distance_dim="m";
}
function obj_data_layout()
{
this.j=new obj_zone;
this.chest=new obj_zone;
this.p=new obj_zone;
this.aa=new obj_zone;
this.q=new obj_zone;
this.log=new obj_zone;
this.table_code;
this.ad=152;
this.ac=this.ad/100;
this.ai=240;
this.al=this.ai/100;
this.ah=168;
this.ak=this.ah/100;
}
function reset()
{
this.ave=input.resetvalue;
this.y=input.resetvalue;
this.z=input.resetvalue;
}
function calc_basis(t)
{
actual_dam=weapon.height_frequence*input.distance*input.distance+weapon.move_accle*input.distance+weapon.r;
actual_head_dam=4*Math.round(actual_dam/4);
victim.protec_factor=0;
if((t=="h")&&(input.helmet))victim.protec_factor=weapon.wired_factor;
if((t=="c")&&(input.ab))victim.protec_factor=weapon.wired_factor;
if((t=="s")&&(input.ab))victim.protec_factor=weapon.wired_factor;
victim.m=actual_head_dam*(1-victim.protec_factor);
victim.o=victim.m*(1-weapon.aquidradiant);
victim.n=victim.m*(1+weapon.aquidradiant);
victim.f=victim.m*weapon.e;
victim.g=victim.f*(1-weapon.shotsquare);
victim.h=victim.f*(1+weapon.shotsquare);
if(victim.m<0)victim.m=0;
if(victim.o<0)victim.o=0;
if(victim.n<0)victim.n=0;
if(victim.f<0)victim.f=0;
if(victim.g<0)victim.g=0;
if(victim.h<0)victim.h=0;
if(victim.protec_factor==0)victim.f=0;
if(victim.protec_factor==0)victim.g=0;
if(victim.protec_factor==0)victim.h=0;
}
function calc()
{
this.l.ave=this.l.ave+this.factor*victim.m;
this.l.y=this.l.y+this.factor*victim.o;
this.l.z=this.l.z+this.factor*victim.n;
victim.q.l.ave+=this.factor*victim.m;
victim.q.l.y+=this.factor*victim.o;
victim.q.l.z+=this.factor*victim.n;
html.d.log.l.ave=Math.round(this.factor*victim.m);
html.d.log.l.y=Math.round(this.factor*victim.o);
html.d.log.l.z=Math.round(this.factor*victim.n);
this.OO.ave=this.OO.ave+this.factor*victim.f;
this.OO.y=this.OO.y+this.factor*victim.g;
this.OO.z=this.OO.z+this.factor*victim.h;
victim.q.OO.ave+=this.factor*victim.f;
victim.q.OO.y+=this.factor*victim.g;
victim.q.OO.z+=this.factor*victim.h;
html.d.log.OO.ave=Math.round(this.factor*victim.f);
html.d.log.OO.y=Math.round(this.factor*victim.g);
html.d.log.OO.z=Math.round(this.factor*victim.h);
}
function convert_graphic()
{
this.c.j.l.ae=Math.round(victim.j.l.y*html.c.ac);
this.c.j.l.af=Math.round((victim.j.l.z-victim.j.l.y)*html.c.ac);
this.c.j.l.trim_bars();
this.c.j.OO.ae=Math.round(victim.j.OO.y*html.c.ac);
this.c.j.OO.af=Math.round((victim.j.OO.z-victim.j.OO.y)*html.c.ac);
this.c.j.OO.trim_bars();
this.c.chest.l.ae=Math.round(victim.chest.l.y*html.c.ac);
this.c.chest.l.af=Math.round((victim.chest.l.z-victim.chest.l.y)*html.c.ac);
this.c.chest.l.trim_bars();
this.c.chest.OO.ae=Math.round(victim.chest.OO.y*html.c.ac);
this.c.chest.OO.af=Math.round((victim.chest.OO.z-victim.chest.OO.y)*html.c.ac);
this.c.chest.OO.trim_bars();
this.c.p.l.ae=Math.round(victim.p.l.y*html.c.ac);
this.c.p.l.af=Math.round((victim.p.l.z-victim.p.l.y)*html.c.ac);
this.c.p.l.trim_bars();
this.c.p.OO.ae=Math.round(victim.p.OO.y*html.c.ac);
this.c.p.OO.af=Math.round((victim.p.OO.z-victim.p.OO.y)*html.c.ac);
this.c.p.OO.trim_bars();
this.c.aa.l.ae=Math.round(victim.aa.l.y*html.c.ac);
this.c.aa.l.af=Math.round((victim.aa.l.z-victim.aa.l.y)*html.c.ac);
this.c.aa.l.trim_bars();
bar_factor_backup=html.c.ac;
bar_length_backup=html.c.ad;
if(input.display_mode=="basic")
{
html.c.ac=html.c.al;
html.c.ad=html.c.ai;
}
if(input.display_mode=="advanced")
{
html.c.ac=html.c.ak;
html.c.ad=html.c.ah;
}
this.c.q.l.ae=Math.round(victim.q.l.y*html.c.ac);
this.c.q.l.af=Math.round((victim.q.l.z-victim.q.l.y)*html.c.ac);
this.c.q.l.trim_bars();
this.c.q.OO.ae=Math.round(victim.q.OO.y*html.c.ac);
this.c.q.OO.af=Math.round((victim.q.OO.z-victim.q.OO.y)*html.c.ac);
this.c.q.OO.trim_bars();
html.c.ac=bar_factor_backup;
html.c.ad=bar_length_backup;
if(input.display_damage)
{
file_1a="bar2_red.gif";file_1b="bar2_redlight.gif";file_1c="bar2_background.gif";
file_2a="bar2_blue.gif";file_2b="bar2_bluelight.gif";file_2c="bar2_background.gif";
file_3a="bar2_yellow.gif";file_3b="bar2_yellowlight.gif";file_3c="bar2_background.gif";
file_4a="bar2_green.gif";file_4b="bar2_greenlight.gif";file_4c="bar2_background.gif";
file_0a="bar3_black.gif";file_0b="bar3_blacklight.gif";file_0c="bar3_background.gif";
file_large_1a="bar4_red.gif";file_large_1b="bar4_redlight.gif";file_large_1c="bar4_background.gif";
file_large_0a="bar4_black.gif";file_large_0b="bar4_blacklight.gif";file_large_0c="bar4_background.gif";
}
else
{
file_1a="bar2_background.gif";file_1b="bar2_redlight.gif";file_1c="bar2_red.gif";
file_2a="bar2_background.gif";file_2b="bar2_bluelight.gif";file_2c="bar2_blue.gif";
file_3a="bar2_background.gif";file_3b="bar2_yellowlight.gif";file_3c="bar2_yellow.gif";
file_4a="bar2_background.gif";file_4b="bar2_greenlight.gif";file_4c="bar2_green.gif";
file_0a="bar3_background.gif";file_0b="bar3_blacklight.gif";file_0c="bar3_black.gif";
file_large_1a="bar4_background.gif";file_large_1b="bar4_redlight.gif";file_large_1c="bar4_red.gif";
file_large_0a="bar4_background.gif";file_large_0b="bar4_blacklight.gif";file_large_0c="bar4_black.gif";
}
this.c.j.l.bar="<img src=\"../gfx/bar2_left.gif\" width=1 height=10>";
if(this.c.j.l.w==true)this.c.j.l.bar+="<img src=\"../gfx/"+file_1a+"\" height=10 width="+this.c.j.l.ae+">";
if(this.c.j.l.v==true)this.c.j.l.bar+="<img src=\"../gfx/"+file_1b+"\" height=10 width="+this.c.j.l.af+">";
if(this.c.j.l.u==true)this.c.j.l.bar+="<img src=\"../gfx/"+file_1c+"\" height=10 width="+this.c.j.l.ag+">";
this.c.j.l.bar+="<img src=\"../gfx/bar2_right.gif\" width=1 height=10><br><img src=\"../gfx/transparent.gif\" width=1 height=2><br>";
this.c.j.OO.bar="<img src=\"../gfx/bar3_left.gif\" width=1 height=5>";
if(this.c.j.OO.w==true)this.c.j.OO.bar+="<img src=\"../gfx/"+file_0a+"\" height=5 width="+this.c.j.OO.ae+">";
if(this.c.j.OO.v==true)this.c.j.OO.bar+="<img src=\"../gfx/"+file_0b+"\" height=5 width="+this.c.j.OO.af+">";
if(this.c.j.OO.u==true)this.c.j.OO.bar+="<img src=\"../gfx/"+file_0c+"\" height=5 width="+this.c.j.OO.ag+">";
this.c.j.OO.bar+="<img src=\"../gfx/bar3_right.gif\" width=1 height=5>";
this.c.j.td_code="<td>"+this.c.j.l.bar+this.c.j.OO.bar+"</td>";
this.c.chest.l.bar="<img src=\"../gfx/bar2_left.gif\" width=1 height=10>";
if(this.c.chest.l.w==true)this.c.chest.l.bar+="<img src=\"../gfx/"+file_2a+"\" height=10 width="+this.c.chest.l.ae+">";
if(this.c.chest.l.v==true)this.c.chest.l.bar+="<img src=\"../gfx/"+file_2b+"\" height=10 width="+this.c.chest.l.af+">";
if(this.c.chest.l.u==true)this.c.chest.l.bar+="<img src=\"../gfx/"+file_2c+"\" height=10 width="+this.c.chest.l.ag+">";
this.c.chest.l.bar+="<img src=\"../gfx/bar2_right.gif\" width=1 height=10><br><img src=\"../gfx/transparent.gif\" width=1 height=2><br>";
this.c.chest.OO.bar="<img src=\"../gfx/bar3_left.gif\" width=1 height=5>";
if(this.c.chest.OO.w==true)this.c.chest.OO.bar+="<img src=\"../gfx/"+file_0a+"\" height=5 width="+this.c.chest.OO.ae+">";
if(this.c.chest.OO.v==true)this.c.chest.OO.bar+="<img src=\"../gfx/"+file_0b+"\" height=5 width="+this.c.chest.OO.af+">";
if(this.c.chest.OO.u==true)this.c.chest.OO.bar+="<img src=\"../gfx/"+file_0c+"\" height=5 width="+this.c.chest.OO.ag+">";
this.c.chest.OO.bar+="<img src=\"../gfx/bar3_right.gif\" width=1 height=5>";
this.c.chest.td_code="<td>"+this.c.chest.l.bar+this.c.chest.OO.bar+"</td>";
this.c.p.l.bar="<img src=\"../gfx/bar2_left.gif\" width=1 height=10>";
if(this.c.p.l.w==true)this.c.p.l.bar+="<img src=\"../gfx/"+file_3a+"\" height=10 width="+this.c.p.l.ae+">";
if(this.c.p.l.v==true)this.c.p.l.bar+="<img src=\"../gfx/"+file_3b+"\" height=10 width="+this.c.p.l.af+">";
if(this.c.p.l.u==true)this.c.p.l.bar+="<img src=\"../gfx/"+file_3c+"\" height=10 width="+this.c.p.l.ag+">";
this.c.p.l.bar+="<img src=\"../gfx/bar2_right.gif\" width=1 height=10><br><img src=\"../gfx/transparent.gif\" width=1 height=2><br>";
this.c.p.OO.bar="<img src=\"../gfx/bar3_left.gif\" width=1 height=5>";
if(this.c.p.OO.w==true)this.c.p.OO.bar+="<img src=\"../gfx/"+file_0a+"\" height=5 width="+this.c.p.OO.ae+">";
if(this.c.p.OO.v==true)this.c.p.OO.bar+="<img src=\"../gfx/"+file_0b+"\" height=5 width="+this.c.p.OO.af+">";
if(this.c.p.OO.u==true)this.c.p.OO.bar+="<img src=\"../gfx/"+file_0c+"\" height=5 width="+this.c.p.OO.ag+">";
this.c.p.OO.bar+="<img src=\"../gfx/bar3_right.gif\" width=1 height=5>";
this.c.p.td_code="<td>"+this.c.p.l.bar+this.c.p.OO.bar+"</td>";
this.c.aa.l.bar="<img src=\"../gfx/bar2_left.gif\" width=1 height=10>";
if(this.c.aa.l.w==true)this.c.aa.l.bar+="<img src=\"../gfx/"+file_4a+"\" height=10 width="+this.c.aa.l.ae+">";
if(this.c.aa.l.v==true)this.c.aa.l.bar+="<img src=\"../gfx/"+file_4b+"\" height=10 width="+this.c.aa.l.af+">";
if(this.c.aa.l.u==true)this.c.aa.l.bar+="<img src=\"../gfx/"+file_4c+"\" height=10 width="+this.c.aa.l.ag+">";
this.c.aa.l.bar+="<img src=\"../gfx/bar2_right.gif\" width=1 height=10><br>";
this.c.aa.td_code="<td>"+this.c.aa.l.bar+"</td>";
this.c.j.l.bar="<img src=\"../gfx/bar2_left.gif\" width=1 height=10>";
this.c.q.l.bar="<img src=\"../gfx/bar4_left.gif\" width=1 height=20>";
if(this.c.q.l.w==true)this.c.q.l.bar+="<img src=\"../gfx/"+file_large_1a+"\" height=20 width="+this.c.q.l.ae+">";
if(this.c.q.l.v==true)this.c.q.l.bar+="<img src=\"../gfx/"+file_large_1b+"\" height=20 width="+this.c.q.l.af+">";
if(this.c.q.l.u==true)this.c.q.l.bar+="<img src=\"../gfx/"+file_large_1c+"\" height=20 width="+this.c.q.l.ag+">";
this.c.q.l.bar+="<img src=\"../gfx/bar4_right.gif\" width=1 height=20><br>";
this.c.q.OO.bar="<img src=\"../gfx/bar4_left.gif\" width=1 height=20>";
if(this.c.q.OO.w==true)this.c.q.OO.bar+="<img src=\"../gfx/"+file_large_0a+"\" height=20 width="+this.c.q.OO.ae+">";
if(this.c.q.OO.v==true)this.c.q.OO.bar+="<img src=\"../gfx/"+file_large_0b+"\" height=20 width="+this.c.q.OO.af+">";
if(this.c.q.OO.u==true)this.c.q.OO.bar+="<img src=\"../gfx/"+file_large_0c+"\" height=20 width="+this.c.q.OO.ag+">";
this.c.q.OO.bar+="<img src=\"../gfx/bar4_right.gif\" width=1 height=20>";
this.c.q.l.td_code="<td>"+this.c.q.l.bar+"</td>";
this.c.q.OO.td_code="<td>"+this.c.q.OO.bar+"</td>";
}
function trim_bars()
{
if((this.ae+this.af)<html.c.ad)
{
this.ag=html.c.ad-this.af-this.ae;
this.w=true;
this.v=true;
this.u=true;
}
if((this.ae+this.af)>=html.c.ad)
{
this.af=html.c.ad-this.ae;
this.w=true;
this.v=true;
this.u=false;
}
if((this.ae)>=html.c.ad)
{
this.ae=html.c.ad;
this.w=true;
this.v=false;
this.u=false;
}
if((this.ae+this.af)==0)
{
this.ag=html.c.ad;
this.w=false;
this.v=false;
this.u=true;
}
}
function convert_numeric()
{
var html_18="<span style=\"font-size:18px;\">";
var html_13="<span style=\"font-size:13px;\">";
var html_10="<span style=\"font-size:10px;\">";
var html_red="<font color=#D70000>";
var html_blue="<font color=#0000DF>";
var html_yellow="<font color=#C1C100>";
var html_green="<font color=#009F00>";
var html_black="<font color=#000000>";
if(input.display_damage)
{
var b=0;
var a=1;
}
else
{
var b=-100;
var a=-1;
}
this.d.j.l.ave=html_13+html_red+"<nobr><b>"+a*Math.round(victim.j.l.ave+b)+"</b></nobr></font></span>";
this.d.j.l.y=html_13+html_red+"<nobr>&nbsp;"+a*Math.round(victim.j.l.y+b)+"&nbsp;</nobr></font></span>";
this.d.j.l.z=html_13+html_red+"<nobr>&nbsp;"+a*Math.round(victim.j.l.z+b)+"&nbsp;</nobr></font></span>";
this.d.j.OO.ave=html_13+html_black+"<nobr><b>"+a*Math.round(victim.j.OO.ave+b)+"</b></nobr></font></span>";
this.d.j.OO.y=html_13+html_black+"<nobr>&nbsp;"+a*Math.round(victim.j.OO.y+b)+"&nbsp;</nobr></font></span>";
this.d.j.OO.z=html_13+html_black+"<nobr>&nbsp;"+a*Math.round(victim.j.OO.z+b)+"&nbsp;</nobr></font></span>";
html.d.j.td_code="<td style=\"width:35px\">"+html.d.j.l.ave+"</td><td style=\"width:35px\">"+html.d.j.OO.ave+"</td>";
this.d.chest.l.ave=html_13+html_blue+"<nobr><b>"+a*Math.round(victim.chest.l.ave+b)+"</b></nobr></font></span>";
this.d.chest.l.y=html_13+html_blue+"<nobr>&nbsp;"+a*Math.round(victim.chest.l.y+b)+"&nbsp;</nobr></font></span>";
this.d.chest.l.z=html_13+html_blue+"<nobr>&nbsp;"+a*Math.round(victim.chest.l.z+b)+"&nbsp;</nobr></font></span>";
this.d.chest.OO.ave=html_13+html_black+"<nobr><b>"+a*Math.round(victim.chest.OO.ave+b)+"</b></nobr></font></span>";
this.d.chest.OO.y=html_13+html_black+"<nobr>&nbsp;"+a*Math.round(victim.chest.OO.y+b)+"&nbsp;</nobr></font></span>";
this.d.chest.OO.z=html_13+html_black+"<nobr>&nbsp;"+a*Math.round(victim.chest.OO.z+b)+"&nbsp;</nobr></font></span>";
html.d.chest.td_code="<td>"+html.d.chest.l.ave+"</td><td>"+html.d.chest.OO.ave+"</td>";
this.d.p.l.ave=html_13+html_yellow+"<nobr><b>"+a*Math.round(victim.p.l.ave+b)+"</b></nobr></font></span>";
this.d.p.l.y=html_13+html_yellow+"<nobr>&nbsp;"+a*Math.round(victim.p.l.y+b)+"&nbsp;</nobr></font></span>";
this.d.p.l.z=html_13+html_yellow+"<nobr>&nbsp;"+a*Math.round(victim.p.l.z+b)+"&nbsp;</nobr></font></span>";
this.d.p.OO.ave=html_13+html_black+"<nobr><b>"+a*Math.round(victim.p.OO.ave+b)+"</b></nobr></font></span>";
this.d.p.OO.y=html_13+html_black+"<nobr>&nbsp;"+a*Math.round(victim.p.OO.y+b)+"&nbsp;</nobr></font></span>";
this.d.p.OO.z=html_13+html_black+"<nobr>&nbsp;"+a*Math.round(victim.p.OO.z+b)+"&nbsp;</nobr></font></span>";
html.d.p.td_code="<td>"+html.d.p.l.ave+"</td><td>"+html.d.p.OO.ave+"</td>";
this.d.aa.l.ave=html_13+html_green+"<nobr><b>"+a*Math.round(victim.aa.l.ave+b)+"</b></font></span>";
this.d.aa.l.y=html_13+html_green+"<nobr>&nbsp;"+a*Math.round(victim.aa.l.y+b)+"&nbsp;</font></span>";
this.d.aa.l.z=html_13+html_green+"<nobr>&nbsp;"+a*Math.round(victim.aa.l.z+b)+"&nbsp;</font></span>";
html.d.aa.td_code="<td>"+html.d.aa.l.ave+"</td><td>&nbsp;</td>";
this.d.q.l.ave=html_18+html_red+"<nobr><b>"+a*Math.round(victim.q.l.ave+b)+"</b></nobr></font></span>";
this.d.q.l.y=html_10+html_red+"<nobr>&nbsp;"+a*Math.round(victim.q.l.y+b)+"&nbsp;</nobr></font></span>";
this.d.q.l.z=html_10+html_red+"<nobr>&nbsp;"+a*Math.round(victim.q.l.z+b)+"&nbsp;</nobr></font></span>";
this.d.q.OO.ave=html_18+html_black+"<nobr><b>"+a*Math.round(victim.q.OO.ave+b)+"</b></nobr></font></span>";
this.d.q.OO.y=html_10+html_black+"<nobr>&nbsp;"+a*Math.round(victim.q.OO.y+b)+"&nbsp;</nobr></font></span>";
this.d.q.OO.z=html_10+html_black+"<nobr>&nbsp;"+a*Math.round(victim.q.OO.z+b)+"&nbsp;</nobr></font></span>";
html.d.q.l.code=html.d.q.l.ave;
html.d.q.OO.code=html.d.q.OO.ave;
}
function print_weapon()
{
k="<img vspace=\"5\" src=\"gfx/"+weapon.pic+".gif\">";
document.all.weapon_pic.innerHTML=k;
}
function print_weapon_name()
{
document.all.weapon_name.innerHTML=weapon.name_long;
}
function print_accuracy()
{
var accu_img=weapon.name_accu+"_s_e_"+weapon.version.replace(".","")+".gif";
k="<table class=\"std_l\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">";
k+="  <tr>";
k+="    <td>";
k+="      <b>&raquo;</b> take a look at the <a href=\"dc_"+weapon.name_accu+"_"+weapon.version.replace(".","")+".php\">accuracy</a><br /><b>&raquo;</b> of the "+weapon.name_short;
k+="    </td>";
k+="    <td><a href=\"dc_"+weapon.name_accu+"_"+weapon.version.replace(".","")+".php\"><img src=\"gfx/"+accu_img+"\" border=\"0\" width=\"30\" height=\"42\" hspace=\"8\"></a></td>";
k+="  </tr>";
k+="  <tr>";
k+="    <td colspan=\"2\">";
k+="      <b>&raquo;</b> use <a href=\"dc_version2.php\">damage calculator II</a> for v1.5";
k+="    </td>";
k+="  </tr>";
k+="  <tr>";
k+="    <td colspan=\"2\">";
k+="      <b>&raquo;</b> use <a href=\"dc_calc_form.php\">damage calculator I</a> for betas";
k+="    </td>";
k+="  </tr>";
k+="  <tr>";
k+="    <td colspan=\"2\">";
k+="      <b>&raquo;</b> usage <a href=\"dc_stats_user.php?sort=use_last+desc\">statistics</a>";
k+="    <td>";
k+="  </tr>";
k+="  <tr>";
k+="    <td colspan=\"2\">";
k+="      <b>&raquo;</b> weaponguide <a href=\"dc_faq.php\">f.a.q.</a>";
k+="    <td>";
k+="  </tr>";
k+="</table>";
document.all.accuracy_info.innerHTML=k;
}
function print_logbox()
{
if(input.display_mode=="basic")
{
k="<img src=\"gfx/dc3_border_bottom.jpg\" width=\"600\" height=\"69\" alt=\"gfx\" />";
document.all.logbox.innerHTML=k;
}
if(input.display_mode=="advanced")
{
switch(log_count)
{
case 1:
logbox_head_text="<div class=\"desc_r_p10\" style=\"padding-bottom:3px\">"+log_count+" entry</div>";
break;
case log_max:
logbox_head_text="<div class=\"desc_r_p10\" style=\"padding-bottom:3px\"><span style=\"color:#D20000\">logbox is full</span> ("+log_count+" entries max.)</div>";
break;
default:
logbox_head_text="<div class=\"desc_r_p10\" style=\"padding-bottom:3px\">"+log_count+" entries</div>";
break;
}
k="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:1px\">";
k+="  <tr>";
k+="    <td colspan=\"3\"><img src=\"gfx/dc3_border_html_generate.jpg\" width=\"600\" height=\"57\" alt=\"gfx\" /></td>";
k+="  </tr>";
k+="  <tr>";
k+="    <td style=\"width:1px\"><img src=\"gfx/dc3_border_lower_left.jpg\" width=\"73\" height=\"205\" alt=\"gfx\" /></td>";
k+="    <td style=\"width:454px\">";
k+=logbox_head_text;
k+="      <textarea class=\"CodePhrase\" style=\"width:450px; height:150px; padding:0px 10px 0px 10px\" name=\"txtarea_logbox\" wrap=\"physical\">";
k+=logbox_text;
k+="      </textarea><br/ >";
k+="      <a href=\"javascript:generate_log2html()\"><img src=\"gfx/dc3_button_generate.gif\" width=\"164\" height=\"31\" alt=\"generate a webpage\"  align=\"right\"/></a>";
k+="      <a href=\"javascript:clear_log()\"><img src=\"gfx/dc3_button_clear.gif\" width=\"97\" height=\"31\" alt=\"clear logbox\" /></a>";
k+="    </td>";
k+="    <td style=\"width:1px\"><img src=\"gfx/dc3_border_lower_right.jpg\" width=\"73\" height=\"205\" alt=\"gfx\" /></td>";
k+="  </tr>";
k+="  <tr>";
k+="    <td colspan=\"3\"><img src=\"gfx/dc3_border_bottom.jpg\" width=\"600\" height=\"69\" alt=\"gfx\" /></td>";
k+="  </tr>";
k+="</table>";
document.all.logbox.innerHTML=k;
}
}
function print_out()
{
switch(input.display_mode)
{
case"basic":
red_string=input.display_damage?"damage taken: ":"health left: ";
aj=input.display_damage?"damage taken: ":"armor left: ";
k="";
k+="<div>"+html.c.q.l.bar+"</div>";
k+="<div style=\"padding:4px 0px 10px 0px\">"+html.c.q.OO.bar+"</div>";
k+="<table class=\"std_r\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">";
k+="<tr><td width=\"140\" style=\"color=#D70000; font-weight:bold; \">"+red_string+"</td><td width=\"70\">"+html.d.q.l.code+"&nbsp;</td></tr>";
k+="<tr><td style=\"color=#000000; font-weight:bold; \">"+aj+"</td><td>"+html.d.q.OO.code+"&nbsp;</td></tr>";
k+="</table>";
document.all.res_value.innerHTML=k;
break;
case"advanced":
k="<table class=BasisFontRight padding=0 cellspacing=0 border=0>";
k+="<tr>"+html.c.q.l.td_code+"<td style=\"width:60px\">"+html.d.q.l.code+"</td></tr>";
k+="<tr>"+html.c.q.OO.td_code+"<td>"+html.d.q.OO.code+"</td></tr>";
k+="</table>";
if(input.display_damage)subheadline="damage";else subheadline="health";
k+="<span class=desc>"+subheadline+"</span><img src=\"../gfx/transparent.gif\" width=1 height=13>";// spacer
k+="<table class=BasisFontRight padding=0 cellspacing=0 border=0>";
k+="<tr>"+html.c.j.td_code+"<td>"+html.d.j.td_code+"</td></tr>";
k+="<tr>"+html.c.chest.td_code+"<td>"+html.d.chest.td_code+"</td></tr>";
k+="<tr>"+html.c.p.td_code+"<td>"+html.d.p.td_code+"</td></tr>";
k+="<tr>"+html.c.aa.td_code+"<td>"+html.d.aa.td_code+"</td></tr>";
k+="</table>";
document.all.res_value.innerHTML=k;
break;
default:
break;
}
}
function go(t)
{
victim.calc_basis(t);
final_calc();
if(t=="h")victim.j.calc();
if(t=="c")victim.chest.calc();
if(t=="s")victim.p.calc();
if(t=="l")victim.aa.calc();
html.convert_graphic();
html.convert_numeric();
print_out();
if(input.display_mode=="advanced")check_log(t);
print_logbox();
play_sound(t);
}
function final_calc()
{
document.all.dc2_obj.innerHTML='<object name="dc2_calc" data="dc2_calculation.php?random='+Math.random()+'" width="0" height="0"></object>';
}
function play_sound(t)
{
if(input.play_sound)
{
if(input.display_damage)
{
if(t=="h")document.all.swf_source.innerHTML="<object><param name=movie value=dc2_"+weapon.name_accu+".swf><param name=quality value=high><embed src=dc2_"+weapon.name_accu+".swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
if(t=="c")document.all.swf_source.innerHTML="<object><param name=movie value=dc2_"+weapon.name_accu+".swf><param name=quality value=high><embed src=dc2_"+weapon.name_accu+".swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
if(t=="s")document.all.swf_source.innerHTML="<object><param name=movie value=dc2_"+weapon.name_accu+".swf><param name=quality value=high><embed src=dc2_"+weapon.name_accu+".swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
if(t=="l")document.all.swf_source.innerHTML="<object><param name=movie value=dc2_"+weapon.name_accu+".swf><param name=quality value=high><embed src=dc2_"+weapon.name_accu+".swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
}
else
{
if(t=="h")
{
if(input.helmet)
{
document.all.swf_source.innerHTML="<object><param name=movie value=dc2_helmet.swf><param name=quality value=high><embed src=dc2_helmet.swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
}
else
document.all.swf_source.innerHTML="<object><param name=movie value=dc2_head.swf><param name=quality value=high><embed src=dc2_head.swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
}
if(t=="c"||t=="s")
{
if(input.ab)
document.all.swf_source.innerHTML="<object><param name=movie value=dc2_vest.swf><param name=quality value=high><embed src=dc2_vest.swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
else
document.all.swf_source.innerHTML="<object><param name=movie value=dc2_flesh.swf><param name=quality value=high><embed src=dc2_flesh.swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
}
if(t=="l")document.all.swf_source.innerHTML="<object><param name=movie value=dc2_flesh.swf><param name=quality value=high><embed src=dc2_flesh.swf quality=high type=\"application/x-shockwave-flash\"></embed></object>";
}
}
}
function validate_distance(s,x)
{
if(x=="m")
{
if(isNaN(s))s=0;
if(s<0)s=0;
if(s>99)s=99;
this.distance=Math.round(s);
distance_slider.setMaximum(99);
}
if(x=="ft")
{
if(isNaN(s))s=0;
if(s<0)s=0;
if(s>299)s=299;
this.distance=Math.round(s*0.3048);
distance_slider.setMaximum(299);
}
if(x=="yd")
{
if(isNaN(s))s=0;
if(s<0)s=0;
if(s>109)s=109;
this.distance=Math.round(s*0.9144);
distance_slider.setMaximum(109);
}
document.all.dist.value=Math.round(s);// den ggf. korrigierten wert zurückschreiben
html.log_distance=Math.round(s);
html.log_distance_dim=x;
}
function set_weapon()
{
input.weapon=eval(document.all.cmb_weapon.value);
weapon=new obj_wea(input);
reset_data();
print_weapon();
print_weapon_name();
print_accuracy();
}
function health_mode()
{
input.display_damage=(input.display_damage==true)?false:true;
if(input.display_damage==true)
{
document.all.health_button.src="gfx/dc3_button_damage.gif";
}
else
{
document.all.health_button.src="gfx/dc3_button_health.gif";
}
html.convert_graphic();
html.convert_numeric();
print_out();
}
function set_vest()
{
input.ab=(input.ab==true)?false:true;
if(input.ab==true)
{
document.all.vest_button.src="gfx/dc3_button_vest_on.gif";
document.all.body_zones_pic.src="gfx/dc3_body_zones_vest.gif";
}
else
{
document.all.vest_button.src="gfx/dc3_button_vest_off.gif";
document.all.helmet_button.src="gfx/dc3_button_helmet_off.gif";
document.all.body_zones_pic.src="gfx/dc3_body_zones.gif";
input.helmet=false;
}
}
function set_helmet()
{
input.helmet=(input.helmet==true)?false:true;
if(input.helmet==true)
{
document.all.vest_button.src="gfx/dc3_button_vest_on.gif";
document.all.helmet_button.src="gfx/dc3_button_helmet_on.gif";
document.all.body_zones_pic.src="gfx/dc3_body_zones_helmet.gif";
input.ab=true;
}
else
{
document.all.helmet_button.src="gfx/dc3_button_helmet_off.gif";
document.all.body_zones_pic.src="gfx/dc3_body_zones_vest.gif";
}
}
function set_sound()
{
img_ico_yes=new Image();
img_ico_yes.src="../gfx/ico_yes.gif";
if(document.all.sound_ico.src==img_ico_yes.src)
{
document.all.sound_ico.src="../gfx/ico_no.gif";
input.play_sound=false;
}
else
{
document.all.sound_ico.src="../gfx/ico_yes.gif";
input.play_sound=true;
}
}
function reset_data()
{
victim.j.l.reset();
victim.j.OO.reset();
victim.chest.l.reset();
victim.chest.OO.reset();
victim.p.l.reset();
victim.p.OO.reset();
victim.aa.l.reset();
victim.q.l.reset();
victim.q.OO.reset();
html.convert_graphic();
html.convert_numeric();
print_out();
}
function display_mode()
{
input.display_mode=(input.display_mode=="advanced")?"basic":"advanced";
if(input.display_mode=="advanced")
{
document.all.mode_button.src="gfx/dc3_button_basic_mode.gif";
}
else
{
document.all.mode_button.src="gfx/dc3_button_advanced_mode.gif";
}
input.resetvalue=0;
input.reset_on_weaponswitch=false;
input.display_damage=false;
reset_data();
html.convert_graphic();
html.convert_numeric();
print_weapon();
print_out();
print_logbox();
}
function clear_log()
{
log=new Array();
log_max=25;
log_count=0;
uri_length=0;// init
logbox_text=" weapon       zone     distance    damage    armor\n";
logbox_text+=" -------------------------------------------------\n";
print_logbox();
}
function add_to_log(t,log_compact)
{
var tmp_life_ave="      "+html.d.log.l.ave+" hp";
var tmp_armor_ave="      "+html.d.log.OO.ave+" ap";
var tmp_distance="      "+html.log_distance+" "+html.log_distance_dim;
log[log_count]=new Array();
log[log_count]["weapon"]=(weapon.name_short+"           ").slice(0,12);
if(t=="h")log[log_count]["zone"]="head    ";
if(t=="c")log[log_count]["zone"]="chest   ";
if(t=="s")log[log_count]["zone"]="stomach ";
if(t=="l")log[log_count]["zone"]="leg     ";
log[log_count]["distance"]=tmp_distance.slice(tmp_distance.length-8,tmp_distance.length);
log[log_count]["damage_ave"]=tmp_life_ave.slice(tmp_life_ave.length-9,tmp_life_ave.length);
log[log_count]["armor_ave"]=tmp_armor_ave.slice(tmp_armor_ave.length-8,tmp_armor_ave.length);
log[log_count]["compact"]=log_compact;
logbox_text+=" "+log[log_count]["weapon"]+" "+log[log_count]["zone"]+" "+log[log_count]["distance"]+" "+log[log_count]["damage_ave"]+" "+log[log_count]["armor_ave"]+"\n";
log_count++;
}
function check_log(t)
{
var log_w=weapon.id;
var log_z=t;
var log_d=html.log_distance+html.log_distance_dim.slice(0,1);
var log_have=html.d.log.l.ave;
var log_hmax=html.d.log.l.z;
var log_hmin=html.d.log.l.y;
var log_aave=html.d.log.OO.ave;
var log_amax=html.d.log.OO.z;
var log_amin=html.d.log.OO.y;
var log_compact="w[]="+log_w+","+log_z+","+log_d+","+log_hmin+","+log_have+","+log_hmax+","+log_amin+","+log_aave+","+log_amax+"&";
var is_already_logged=false;
for(var i=0;i<(log.length);i++)
{
if((log[i]["compact"])==log_compact)is_already_logged=true;
}
if((!is_already_logged)&(uri_length<2000)&(log_count<log_max))
{
uri_length+=log_compact.length;
add_to_log(t,log_compact);
}
}
function generate_log2html()
{
var uri="log2html/dc3_log2html.php?";
if(log_count==0)
{
alert('No data found!\nYour logbox is empty. Fill it by some shots first');
}
else
{
for(var i=0;i<(log.length);i++)
{
uri+=log[i]["compact"];
}
window.open(uri,"log2html_wind","toolbar=yes,resizable=yes,scrollbars=yes,width=800");
}
}
