⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snowwar_s.gml

📁 在线游戏最新服务器端源代码
💻 GML
字号:
<sys nameformat=S>

<style>
.Man_Normal{
	hit_kind=255;
	healthone="5,25,50,100";
	health=125;
	weapon="snowball";
	ifchged(curw)={<: weapon=*weapons[curw];ammo=*ammos[curw]>};
	OnWeapon={<: curw=*ep;neteventToG=wgroup,weapon,$[ep]>};

	OnSendfight={<$[weapon] user=$[id];fly=line($[xpos]+$[dx],$[ypos]+$[dy],$[objpos],speed,1)></$[weapon]>};
	OnFire={<: netcreatecmd=netcmdbase;walk=null;bGo=0;anikind=fight;autoanicmd=1;forwordto=$[ep];
		objpos=*pid.nearcangopoint($[pos],$[ep],18);
		paramCtrl#tr=loopt(1,anisteps,0,4,1,70,Endfight);
		neteventToG=wgroup,fire,(objpos)>};
	OnHit={<: hit=*eventfrom.hit;health=(health-hit);eventfrom.eve=hited;if=(health<1)?{eventfrom.eve=win,$[id];eve=dead}>};

	OnHealth={<: h_k=*eventfrom.p;h_o=*healthone[h_k];if=(health<200)?{health=(health+h_o);if=(health>200)?{health=200};eventfrom.eve=hited}>};
}
.Man_Dead{
	hit_kind=0;
	OnRun=null;
	OnFire=null;
	OnHit=null;
	OnSendfight=null;
	OnEndfight=null;
	paramCtrl=loopt(1,anisteps,0,6,1,170,waitrestart);
	OnReMake={<: eve=pos;eve=reset>};
}
.Man{
	fen=0;
	mutisrc=stand($.\..\imgs\ani\m_sn_r.ale,8)walk($.\..\imgs\ani\m_sn_r.ale,8)fight($.\..\imgs\ani\m_sn_f.ale,8)death($.\..\imgs\ani\m_sn_d.ale,4)snow($.\..\imgs\ani\m_sn_s.ale,8)bump($.\..\imgs\ani\m_sn_b.ale,8);
	NetParam=health,fen;
	OnCreate={<: ownername.man=*id>};
	OnPos={<: pos=$[&mymapbk.randpoint(4,"雪地","洼地")];>};
	OnWin={<: switch(ep){case $[id]:fen=(fen-1);break;default:fen=(fen+1);}>};
}
.weapon:div{
	pid=mymap;
	anishow=1;
	zorder=top;
	size=3,3;
	al=170;
	speed=2000;
	far=200;
	delay=1000;
	&mymap.bf=0;
	OnCreate={<:mymap paramCtrl#w=loopcmd(1,$[delay],10,{<: bf=1;paramCtrl#w=null>})>};
	OnFlyend#h={<: HitTest=mutipoint(hit_kind,255,point(0,0),hitok,hit);paramctrl=timer(100,del)>};
	OnHited={<: del=1>};
	Onwin={<: user.eve=win,$[ep];del=1>};
}
.snowball:weapon{
	speed=2400;
	delay=50;
	hit=30;
}
.item{
	pid=mymap;
	size=16,16;
	anishow=1;
	autozorder=1;
	p=0;
	OnCreate={<:cpu $[kind]=($[kind]+1)>};
	OnDestroy={<:cpu $[kind]=($[kind]-1)>};
	paramCtrl=timer(120000,del);

	WebObj=wgroup,player;
	NetParam=pos,p;
	ownername="";
	netcreatecmd="#($[net],$[name],$[pos],$[p])";

	HitTest=mutipoint(eat_kind,255,point(0,0),hitit,$[kind]);
	Onhitit={};
	OnHited={<: del=1>};
}
.health:img{
	kind=health;
	net=HL;
	src=$.\imgs\misc\health.ale;
	class=item;
	HitTest=mutipoint(eat_kind,255,point(0,0),hitit,health);
}
.cpu{
	health=0;
	ammo=0;
	armor=0;
	draw=7:{TextOut(0,0,health=$[health],#FFFFFF)};
	paramCtrl#bottle=loopcmd(-1,100,6000,{<: if=(health<6)?{<: eve=health>}});
	Onhealth={<health pos=$[&mymapbk.randpoint(4,"雪地","洼地")];p=(rand(4));c=*color[kind]>};
}
</style>

<sys import=desktop,$.\..\rts_s.gml>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -