?? main2.gml
字號:
<style>
.ManNormal{
health=125;
weapons="melee,sword,firesword";
ammos="0,10,10";
curw=1;armour=0;
weapon=*weapons[curw];
ammo=*ammos[curw];
ammob=1;
curw=1;
armor=0;
OnSendfight={<: if=(ammob>0)?{<$[weapon] me=$[me];fly=line($[xpos]+$[dx],$[ypos]+$[dy],$[objpos],speed,0)></$[weapon]>
}:{<: if=(me==1)?{&mysocket.eve=Info,"沒彈藥啦!",2000}:{&mysocket.eve=Info,"$[ownername]沒彈藥啦!",2000}}>};
OnEndfight={<: autoanicmd=0;anikind=stand>};
OnFired={<: walk=null;pos=$[ep0],$[ep1];anikind=fight;autoanicmd=1;forwordto=$[ep2],$[ep3];objpos=$[ep2],$[ep3];
paramCtrl=loopt(1,anisteps,0,7,1,70,endfight);
if=(ammo>0)?{ammob=1}:{ammob=0};ammo=*ep[4];ammos[curw]=*ammo;>};
OnFireend={<: >};
OnTele={<: pos=*ep;playsnd=$.\..\quake\sound\world\telein.gsm;eve=Teleing>};
OnTeled={<: pos=*ep;playsnd=$.\..\quake\sound\world\teleout.gsm;eve=Teleing>};
OnTeleing={<teleing pos=$[pos]></teleing>};
//clear
paramCtrl#begin=loopt(1,alpha,0,255,10,10);
paramCtrl#in=loopcmd(1,50,1,{<: playsnd=$.\sound\world\telein.gsm>};);
}
.ManDie{
health=0;
OnFired=null;
OnSendfight=null;
OnEndfight=null;
paramCtrl=loopt(1,anisteps,0,5,1,170,CanRestart);
}
.Man{
mutisrc=stand($.\..\imgs\ani\m_ln_f.ale,8)walk($.\..\imgs\ani\m_ln_r.ale,8)fight($.\..\imgs\ani\m_ln_f.ale,8)death($.\..\imgs\ani\m_ln_d.ale,4)snarl($.\..\imgs\ani\m_ln_o.ale,4);
OnDestroy={<: playsnd=$.\..\quake\sound\world\teleout.gsm>};
}
.ManUser{
draw#main={wv();ellipse(0,0,22,12,R230G220B100,0);};
draw#health=9:{wv();rect(-16,-52,16,-48,0);bar(-15,-51,-15+health*3/20,-49,red);TextOut(-20,-50,$[fen],#FFFFFF)};
OnCreate#user={<: &mysocket.eve=HideInfo;&info.eve=name,(ownername);pid.man=*id;pid.pid.man=*id;pid.eve=life;
OnChar#w={<: eve=weapon,*ep>};
OnChar#end={<: if=(focus==0)?{<:charedit eve=can,1>}>};
>};
me=1;
OnDie={<: kill=$[ep];playsnd=$.\..\sound\die1.adm;&mymap.eve=dead;class=RtsDie>};
OnCanRestart={<: &mysocket.eve=showinfo,("你死了!按鼠標鍵繼續(xù)");&mymap.eve=canreset>};
ifchged(curw)={<: weapon=*weapons[curw];ammo=*ammos[curw]>};
ifchged(weapon)={<: &info.eve=weapon,(curw)>};
ifchged(ammo)={<: &info.eve=ammo,(ammo)>};
ifchged(armor)={<: &info.eve=armor,(armor)>};
ifchged(fen)={<: &info.eve=fen,(fen)>};
curw=1;
armor=0;
ifchg(health)={<: if=($[health]>$[_new_health])?{paramCtrl#flash=loopt(1,alpha,20,255,40,0)}>};
ifchged(health)={<: &info.eve=health,(health)>};
OnLButtonDown={};
OnGun={<: neteventToS=weapon,$[ep]>};
OnWeapon={<: if=(curw!=ep)?{<: curw=*ep><sys playsnd=$.\sound\weapons\change.gsm>}>};
OnAmmo={<: am_k=*ep[0];am_c=*ep[1];ammos[am_k]=*am_c;if=(curw==am_k)?{ammo=*am_c;if=(ammo>0)?{ammob=1}:{ammob=0}}>};
}
.ManOther{
draw#health=9:{wv();rect(-16,-52,16,-48,0);bar(-15,-51,-15+health*3/20,-49,red);TextOut(-20,-50,$[fen],#FFFFFF)};
me=0;
OnDie={<: kill=$[ep];playsnd=$.\..\sound\die.adm;class=RtsDie>};
ifchg(health)={<: if=($[health]>$[_new_health])?{playsnd=$.\..\sound\gothit.adm;paramCtrl#flash=loopt(1,alpha,0,255,10,0)}>};
}
.lifemake:div{
rect=-50,-50,50,50;
anishow=1;
autozorder=1;
pid=mymap;
draw={wv();ellipse(0,0,rd,3,#efefef,0);
ellipse(0,0,3,rd,#efefef,0);
torus(0,0,rd/2+2,3,R50G15B30);}
ParamCtrl#s=loopt(1,rd,50,1,2,10,del);
}
.lifedel:img{
pid=mymap;
src=$.\..\imgs\misc\lifebut.gif;
automask=1;
rect=-30,-30,30,30;
anishow=1;
zorder=top;
draw={wv();ellipse(7,12,rd*2,rd,#5f1f1f,0);}
ParamCtrl#s=loopt(2,rd,8,30,2,1,del);
ParamCtrl#a=loopt(1,alpha,125,1,6,1);
path=goto(0,-30,2);
}
.item{
pid=mymap;
size=16,16;
anishow=1;
autozorder=1;
ParamCtrl#s=loop(rd,15,20,1,100);
OnCreate#s={<: ParamCtrl#p=loop(ypos,ypos,ypos-3,1,100)><lifemake pos=$[pos]>};
OnDestroy#s={<lifedel pos=$[pos]>};
}
.health:img{
automask=1;
src=$.\imgs\misc\health.ale;
class=item;
ParamCtrl#f=loops(frame,0,4,1,100);
cc="#66FF00,#FFFF00,#FF0000,#3333FF";
p=0;
OnCreate={<: c=*cc[p];eve=cc><palette src=$.\imgs\misc\h$[p].act;pid.palette=*id>};
Oncc={<: draw=-1:{wv();CircleLight(0,0,rd,$[c])}>};
OnDestroy={<: playsnd=$.\..\quake\sound\items\n_health.gsm>};
}
.ammo:img{
automask=1;
src=$.\imgs\misc\ammos.gif;
class=item;
size=14,16;
// OnCreate={<: draw=-1:{wv();CircleLight(0,0,rd,#FF0000)};>};
OnDestroy={<: playsnd=$.\..\quake\sound\misc\am_pkup.gsm>};
}
.armor:img{
src=$.\imgs\misc\armor.ale;
class=item;
OnCreate={<: frame=*p;draw=-1:{wv();CircleLight(0,0,rd,#66FF00)}>};
OnDestroy={<: playsnd=$.\..\quake\sound\misc\ar2_pkup.gsm>};
}
.gun:img{
src=$.\imgs\misc\guns.ale;
class=item;
OnCreate={<: frame=*p;draw=-1:{wv();CircleLight(0,0,rd,#CC00FF)}>};
OnDestroy={<: playsnd=$.\..\quake\sound\misc\w_pkup.gsm>};
}
.weapon:div{
pid=mymap;
anishow=1;
zorder=top;
size=1,1;
alpha=170;
speed=2000;
far=200;
delay=1000;
&mymap.bf=0;
OnCreate={<:mymap paramCtrl#w=loopcmd(1,$[delay],10,{<: bf=1;paramCtrl#w=null>})>};
}
.melee:weapon{
far=10;
}
.sword:weapon{
OnCreate#s={<: playsnd=$.\sound\sword\fire.adm>};
speed=6000;
delay=400;
draw={wv();linemax(0,0,flysx-xpos,flysy-ypos,#CC6600,3);
lightline(0,0,flysx-xpos,flysy-ypos,#DFDFDF,alpha);
CircleLight(0,0,flash,R120G70B0);
ellipse(0,0,2,flash,#ef2fef,0)};
paramctrl#f=loop(flash,3,12,3,10);
OnFlyend={<: paramctrl#s=null;paramctrl=loopt(1,alpha,200,50,10,50,del)>};
}
.firesword:weapon{
OnCreate#s={<: playsnd=$.\sound\sword\fire.adm>};
speed=6000;
delay=600;
draw={wv();linemax(0,0,flysx-xpos,flysy-ypos,#0066FF,6);
lightline(0,0,flysx-xpos,flysy-ypos,#3366FF,alpha);
CircleLight(0,0,flash,R120G70B0);
ellipse(0,0,2,flash,#33FF00,0)};
paramctrl#f=loop(flash,6,18,4,10);
OnFlyend={<: paramctrl#s=null;paramctrl=loopt(1,alpha,170,50,20,50,del)>};
}
.Wolf:human{
pid=mymap;
anishow=1;
autozorder=1;
mutisrc=stand($.\..\imgs\ani\a_wolf_r.ale,8)walk($.\..\imgs\ani\a_wolf_r.ale,8)fight($.\..\imgs\ani\a_wolf_f.ale,8)death($.\..\imgs\ani\a_wolf_d.ale,4);
OnCreate={<lifemake pos=$[pos];offset=7,14>};
OnGo={<: walk=gotopos($[ep],50,12)>};
OnHit={<: paramCtrl=loopt(3,alpha,60,250,100,80)>};
OnDie={<: anikind=death;paramCtrl=loopt(1,anisteps,0,4,1,170);walk=null>};
}
.info:div{
size=710,200;
zorder=top;
clip=0;
OnCreate={<img name=lifebar;
size=90,200;
src=$.\..\imgs\face\lifebar.gif;
automask=1;
lifesy=38;
pos=0,0;
draw=8{bar(41,lifesy,54,160,R158G38B10);bar(48,lifesy,53,160,R222G12B19)};
OnClick={<:helper show=1>};
>
<img name=lifebut;size=14,16;src=$.\..\imgs\misc\lifebut.gif;automask=1;pos=34,180>
<img name=lifebow;size=16,21;src=$.\..\imgs\misc\bowbut.gif;automask=1;pos=60,179>
<text pos=130,184;src="姓名:">
<text pos=160,184;src="man";pid.name_t=*id>
<text pos=290,184;src="得分:">
<text pos=320,184;src="0";pid.fen=*id>
<text pos=360,184;src="網速:">
<text pos=390,184;src="88";pid.ping=*id;>
<text pos=470,184;src="在線人數:">
<text pos=530,184;src="1";pid.mans_t=*id;>
};
OnSize={<: pos=0,pid.height-height;width=pid.width>};
bottle_num=0;
ammo=20;
info_mannum=0;
draw#b={bar(89,180,width,height,R80G57B47);line(89,height-3,width,height-3,R150G120B90);}
draw#but=9{wv();TextOut(53,168,$[bottle_num],#FFFFFF);};
draw#ammo=9{wv();TextOut(74,168,$[ammo],#FFFFFF);};
OnHealth={<:lifebar lifesy=(160-$[ep]*122/200)>};
Onchgbut={<: bottle_num=$[ep];if=(bottle_num>0)?{<:lifebut show=1>}:{<:lifebut show=0>}>};
OnAmmo={<: ammo=$[ep];if=(ammo>0)?{<:lifebow show=1>}:{<:lifebow show=0>};>};
OnFen={<: fen.src=*ep>};
OnName={<: name_t.src=*ep>};
OnPing={<: if=(ep<100)?{ping.src=優(yōu)秀($[ep])}:{if=(ep<400)?{ping.src=良好($[ep])}:{if=(ping<800)?{ping.src=中等($[ep])}:{<: ping.src=差($[ep])><:mysocket eve=info,網速太慢!,5000>}}}>};
ifchged(mans)={<: mans_t.src=*mans>};
eve=size;
}
</style>
<info name=info></info>
<sys sethotkey=2,{<: man.eve=gun,1>}>
<sys sethotkey=3,{<: man.eve=gun,2>}>
#define HL <health name=%1;pos=%2,%3;p=%4>
#define AM <ammo name=%1;pos=%2,%3;p=%4>
#define AR <armor name=%1;pos=%2,%3;p=%4>
#define GN <gun name=%1;pos=%2,%3;p=%4>
#define MG <sword name=%1;pos=%2,%3;p=%4>
#define SG <firesword name=%1;pos=%2,%3;p=%4>
<: include=$.\..\rts_c.gml>
<:help eve=info,"鼠標右鍵行走,左鍵開火\r\n數字鍵換槍,有1-9號槍可以換\r\n各色血球可以補血\r\n各種彈藥可以補充\r\n各種武器可以揀\r\n需要走過去碰一下\r\n回車鍵可開關聊天功能">
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -