📄 main.gml
字号:
<style>
.showtext:text{
showstyle=3;
color=white;
pos=0,5;
align=center;
zorder=1;
clip=0;
}
.RtsPlay{
show=1;
pid.viewfollow=*id;
walkquik=0;
anikind=stand;
OnGo={<: paramCtrl=null;walk=path(#(SPEED),25,$[ep])>};
}
.RtsLook{
show=0;
// pid.viewfollow=mouse;
pos=-100,-100;
}
.ManNormal{
class=RtsPlay;
health=125;
weapon="sword";
OnSendfight={<: puser.eve=fireout><$[weapon] me=$[me];fly=line($[xpos]+$[dx],$[ypos]+$[dy],$[objpos],speed,1)>};
OnEndfight={<: autoanicmd=0;anikind=stand>};
OnFired={<: walk=null;anikind=fight;autoanicmd=1;forwordto=$[ep0],$[ep1];objpos=$[ep0],$[ep1];
paramCtrl=loopt(1,anisteps,0,7,1,70,endfight)>};
OnNoammo={<: walk=null;anikind=fight;autoanicmd=0;forwordto=$[ep0],$[ep1];
paramCtrl=loopt(1,anisteps,0,7,1,70)>};
OnWeapon={<: weapon=*ep><sys playsnd=$.\sound\weapons\change.gsm>};
OnTeled={<: pos=*ep;playsnd=$.\sound\world\teleout.gsm;eve=Teleing>};
OnTeleing={<teleing pos=$[pos]></teleing>};
paramCtrl#begin=loopt(1,alpha,0,255,10,10);
paramCtrl#in=loopcmd(1,50,1,{<: playsnd=$.\sound\world\telein.gsm>};);
OnWalkend={<: ParamCtrl#ws=null;pid.viewfollow=mouse>};
OnDeath={<: anikind=death>};
}
.ManDie{
OnGo=null;
walk=null;
anikind=death;
health=0;
OnFired=null;
OnSendfight=null;
OnEndfight=null;
paramCtrl=loopt(1,anisteps,0,7,1,170,CanRestart);
}
.UserMan:human{
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=$.\sound\world\teleout.gsm>};
puser=*pid;
pid.pman=*id;
pid=*pid.pid.pid.pid.map;
anishow=1;
autozorder=1;
class=RtsLook;
class=ManNormal;
OnCreate={<showtext src=$[man]>};
OnSide={<: switch(ep){
case 0:class=RtsLook;break;
case 1:class=RtsPlay;break;
case 2:class=RtsPlay;break;
case 3:palette=null;class=RtsPlay;break;
};
>};
}
.UserManM:UserMan{
me=1;
draw#health=9:{wv();rect(-16,-52,16,-48,0);bar(-15,-51,-15+health*3/20,-49,red);TextOut(-20,-50,'$[fen]',0);
ellipse(0,0,22,12,R230G220B100,0);};
OnDie={<: playsnd=$.\..\sound\die.adm;class=ManDie>};
ifchg(health)={<: if=($[health]>$[_new_health])?{paramCtrl#flash=loopt(1,alpha,20,255,40,0);playsnd=$.\sound\hit.gsm}>};
OnLButtonDown={};
OnGo#s={<: pid.viewfollow=*id>};
OnFired#m={<: pid.viewfollow=*id>};
OnWait={<: pid.viewfollow=*id;paramCtrl#w=loopcmd(1,$[ep],1000,{<: pid.viewfollow=*id>});>};
OnCanRestart={<: puser.eve=CanRestart>};
OnRestart={<: class=ManNormal;pos=$[ep];pid.viewfollow=*id>};
}
.UserManO:UserMan{
me=0;
draw#health=9:{wv();rect(-16,-52,16,-48,0);bar(-15,-51,-15+health*3/20,-49,red);TextOut(-20,-50,'$[fen]',0)};
OnDie={<: kill=$[ep];playsnd=$.\sound\die.adm;class=ManDie>};
ifchg(health)={<: if=($[health]>$[_new_health])?{paramCtrl#flash=loopt(1,alpha,0,255,10,0);playsnd=$.\sound\hit2.gsm}>};
OnRestart={<: class=ManNormal;pos=$[ep]>};
}
.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:img{
pid=*pid.pid;
anishow=1;
autozorder=1;
src=$.\imgs\misc\bullet.gif;
size=4,4;
alpha=170;
speed=2000;
far=200;
delay=1000;
// pid.bf=0;
automask=1;
OnCreate={<: if=(me==1)?{<:$[pid] bf=0;paramCtrl#w=loopcmd(1,$[delay],10,{<: bf=1;paramCtrl#w=null>})>}>};
OnFlyend#s={<: paramctrl#d=loopt(1,alpha,170,50,20,50,del)>};
}
.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);
}
.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);
}
.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=优秀($[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;
}
.hud:div{
pid.phud=*id;
size=710,80;
pos=0,0;width=pid.width;
zorder=top;
clip=0;
mid=0;
mname="";
amnum=30;
health=100;
ar=20;
OnCreate={<am_i pos=30,5;pid.am_i=*id><info_txt pos=100,5;pid.am_t=*id;src="10"><gun_i pos=170,0;pid.gun_i=*id>
<man_i pos=(pid.width-width)/2,0;pid.hi_i=*id><info_txt pos=pid.width/2+40,5;pid.life_t=*id;src="125">
<ar_i pos=pid.width-150,5;pid.ar_i=*id><info_txt pos=pid.width-80,5;pid.ar_t=*id;src="0">};
OnSize={<: pos=0,0;width=pid.width;
hi_i.xpos=(width-hi_i.width)/2;life_t.xpos=pid.width/2+40;
ar_i.xpos=pid.width-150;ar_t.xpos=pid.width-80;>};
Onammo={<: am=*ep;am_t.src=*am>};
OnWeapon={<: if=(ep==0)?{am_i.show=0;}:{am_i.show=1;am_i.frame=(ep-1);};gun_i.frame=*ep>};
OnHealth={<: health=*ep;if=(health<25)?{life_t.color=#FF0000}:{life_t.color=#FFCC00};life_t.src=*health>};
Onarmor={<: ar=*ep;ar_t.src=*ar>};
// ifchged(ping)={<:info_ping if=($[ping]<100)?{src=优秀($[ping])}:{if=($[ping]<400)?{src=良好($[ping])}:{if=($[ping]<800)?{src=中等($[ping])}:{<: src=差($[ping])><:mysocket event=info,网速太慢!,5000>}}}>};
}
</style>
<hud show=0></hud>
#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 <machinegun name=%1;pos=%2,%3;p=%4>
#define SG <shotgun name=%1;pos=%2,%3;p=%4>
#define GL <grenade name=%1;pos=%2,%3;p=%4>
#define RL <rocket name=%1;pos=%2,%3;p=%4>
#define LG <lightting name=%1;pos=%2,%3;p=%4>
#define RG <railgun name=%1;pos=%2,%3;p=%4>
#define PG <plusma name=%1;pos=%2,%3;p=%4>
#define BG <bfg name=%1;pos=%2,%3;p=%4>
//<: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 + -