// [RCD] Val{ AB(default=0,max=33,step=5,disp=0) COL1(default=#303030,max=16777215,disp=0) COL1C(default=#202020,max=16777215,disp=0) FLP(default=0,max=12.5,step=2.5,disp=0) GUN1(default=0,max=3000000,step=10000000,disp=0) GUN2(default=0,max=3000000,step=10000000,disp=0) JAB(default=0,max=30,step=1,disp=0) JET(default=0,min=-40,max=100,disp=0) JL(default=0,min=-200000,max=550000,disp=0) JR(default=0,min=-200000,max=550000,disp=0) NLDL(default=0,min=-60,max=60,disp=0) NLDR(default=0,min=-60,max=60,disp=0) NLTL(default=0,min=-60,max=60,disp=0) NLTR(default=0,min=-60,max=60,disp=0) NRDL(default=0,min=-60,max=60,disp=0) NRDR(default=0,min=-60,max=60,disp=0) NRTL(default=0,min=-60,max=60,disp=0) NRTR(default=0,min=-60,max=60,disp=0) PI(default=0,min=-17.5,max=17.5,step=2.5,disp=0) RL(default=0,min=-60,max=60,disp=0) RO(default=0,min=-10,max=10,step=2,disp=0) RR(default=0,min=-60,max=60,disp=0) SMK(default=0,max=3,disp=0) VJF(default=0,min=-2000000,max=2000000,disp=0) VJRL(default=0,min=-2000000,max=2000000,disp=0) VJRR(default=0,min=-2000000,max=2000000,disp=0) XJ(default=0,min=-10,max=10,step=1,disp=0) XJF(default=0,min=-2000000,max=2000000,disp=0) XJR(default=0,min=-2000000,max=2000000,disp=0) YOI(default=0,min=-5,max=5,step=2,disp=0) YOL(default=0,min=-30,max=30,disp=0) YOR(default=0,min=-30,max=30,disp=0) BP1(default=0,min=0,max=800000,step=2000,disp=0) BP2(default=0,min=0,max=800000,step=2000,disp=0) BP3(default=0,min=0,max=800000,step=2000,disp=0) BP4(default=0,min=0,max=800000,step=2000,disp=0) BP5(default=0,min=0,max=800000,step=2000,disp=0) BP6(default=0,min=0,max=800000,step=2000,disp=0) BP7(default=0,min=0,max=800000,step=2000,disp=0) BP8(default=0,min=0,max=800000,step=2000,disp=0) } Key{ } Body{ Core(color=col1){ S:Chip(color=col1){ W:Chip(color=col1,angle=90){ N:Cowl(color=col1c,angle=5){ E:Cowl(color=col1c,angle=-105){ E:Cowl(color=col1c){ S:Cowl(color=col1c){ W:Cowl(color=col1c,angle=15){ N:Cowl(color=col1c,angle=-15){} } } N:Cowl(color=col1c,angle=-10,option=4){} } N:Cowl(angle=-12,option=5,color=col1c){} } W:Cowl(color=col1c,angle=-120){ N:Cowl(color=col1c,angle=-12,option=5){} } } N:Frame(color=col1,angle=63){ E:Cowl(color=col1c,angle=-120){ E:Cowl(color=col1c,angle=30){ E:Cowl(color=col1c){ E:Cowl(color=col1c,angle=172){ N:Cowl(color=col1c,option=0){} S:Cowl(color=col1c,angle=8,option=4){} } S:Cowl(color=col1c){ S:Cowl(color=col1c){ S:Cowl(color=col1c){ S:Cowl(color=col1c){ S:Cowl(color=col1c){} } } } } } } } S:Trim(color=col1,angle=90){ E:Rudder(color=col1,angle=90){ E:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){ E:Cowl(color=col1c,option=4){} } } } N:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){} } } } } } } } } E:Chip(color=col1,angle=90){ N:Cowl(color=col1c,angle=5){ W:Cowl(color=col1c,angle=-105){ W:Cowl(color=col1c){ S:Cowl(color=col1c){ E:Cowl(color=col1c,angle=15){ N:Cowl(color=col1c,angle=-15){} } } N:Cowl(color=col1c,angle=-10,option=3){} } N:Cowl(angle=-12,option=5,color=col1c){} } E:Cowl(color=col1c,angle=-120){ N:Cowl(color=col1c,angle=-12,option=5){} } } N:Frame(color=col1,angle=63){ W:Cowl(color=col1c,angle=-120){ W:Cowl(color=col1c,angle=30){ W:Cowl(color=col1c){ W:Cowl(color=col1c,angle=172){ S:Cowl(color=col1c,angle=8,option=3){} N:Cowl(color=col1c,option=0){} } S:Cowl(color=col1c){ S:Cowl(color=col1c){ S:Cowl(color=col1c){ S:Cowl(color=col1c){ S:Cowl(color=col1c){} } } } } } } } S:Trim(color=col1,angle=90){ E:Rudder(color=col1,angle=90){ E:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){ E:Cowl(color=col1c,option=4){} } } } N:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){ E:Chip(color=col1){} } } } } } } } } S:Cowl(color=col1c,angle=10,option=5){} } E:Chip(color=col1,angle=90){ S:Trim(color=col1,angle=90){ W:Chip(color=col1,angle=-135){ W:Chip(color=col1,angle=-90){ S:Chip(color=col1,angle=nrtr){ N:Jet(color=col1,angle=-90,power=-JR,effect=SMK){} } W:Chip(color=col1,angle=45){ S:Chip(color=col1,angle=RR){ W:Chip(color=col1){ W:Chip(color=col1){} } } S:Jet(color=col1,power=-VJRR,name=VRR){ S:Cowl(color=col1c,option=4){} } } } S:Chip(color=col1,angle=nrtl){} } W:Chip(color=col1,angle=135){ W:Chip(color=col1,angle=90){ S:Chip(color=col1,angle=nrdr){} } S:Chip(color=col1,angle=nrdl){} } } E:Cowl(color=col1c,angle=90){ N:Cowl(color=col1c,angle=15){ N:Cowl(color=col1c){} } S:Cowl(color=col1c){} } N:Trim(color=col1,angle=90){ N:Arm(color=col1,power=gun2,option=15000){} } N:Frame(color=col1,angle=30,option=1){ N:Jet(angle=150,power=-XJF){ N:Frame(color=col1){ N:Jet(color=col1,power=XJR){} } } } } W:Chip(color=col1,angle=90){ S:Trim(color=col1,angle=90){ W:Chip(color=col1,angle=-135){ W:Chip(color=col1,angle=-90){ S:Chip(color=col1,angle=nldl){} } S:Chip(color=col1,angle=nldr){} } W:Chip(color=col1,angle=135){ W:Chip(color=col1,angle=90){ S:Chip(color=col1,angle=nltl){ N:Jet(color=col1,angle=90,power=JL,effect=SMK){} } W:Chip(color=col1,angle=-45){ S:Chip(color=col1,angle=RL){ W:Chip(color=col1){ W:Chip(color=col1){} } } S:Jet(color=col1,power=VJRL,name=VRL){ S:Cowl(color=col1c,option=4){} } } } S:Chip(color=col1,angle=nltr){} } } N:Trim(color=col1,angle=90){ N:Arm(color=col1,power=gun1,option=15000){} } N:Frame(color=col1,angle=30,option=1){} } N:Frame(color=col1,angle=30){ N:Jet(color=col1,angle=150,power=-VJF,name=VF){} } N:Cowl(color=col1c){ N:Cowl(color=#808080,angle=28,option=5){} E:Cowl(angle=35,option=5,color=#808080){ N:Cowl(angle=35,option=4,color=#808080){} } W:Cowl(angle=35,option=5,color=#808080){ N:Cowl(angle=35,option=3,color=#808080){} } } S:Frame(angle=60){ S:Jet(angle=180,power=BP1,option=2,name=BOM1,color=#FF0000){} S:Jet(angle=180,power=BP2,option=2,name=BOM2,color=#FF0000){} S:Jet(angle=180,power=BP3,option=2,name=BOM3,color=#FF0000){} S:Jet(angle=180,power=BP4,option=2,name=BOM4,color=#FF0000){} S:Jet(angle=180,power=BP5,option=2,name=BOM5,color=#FF0000){} S:Jet(angle=180,power=BP6,option=2,name=BOM6,color=#FF0000){} S:Jet(angle=180,power=BP7,option=2,name=BOM7,color=#FF0000){} S:Jet(angle=180,power=BP8,option=2,name=BOM8,color=#FF0000){} } } } Lua{ jpow=1000 jout=0 function engine()--エンジン-------------------------- --エンジン入力制御 〜 0で一時停止編 〜 if( _KEY(5)==0 and _KEY(8)==0 )then EM=1 end if( JET==0 )then --エンジンが0のとき if( EM==2 )then EM=0 end end --エンジンが0以外のとき if( _KEY(5)==1 and EM==1 and JET==100 )then JAB=JAB+1 JAB=math.min(JAB,30) end if( SMK ~= 3 )then if JAB > 0 then SMK = 1 else SMK = 0 end end if( _KEY(5)==1 and EM>=1 and JET<=98 )then JET=JET+2 EM=2 end if( _KEY(8)==1 and EM>=1 and JET>=-38 )then JET=JET-2 EM=2 end --エンジン入力制御終わり --ジェット出力の最終決定 jout=JET*jpow end function plane() VJF=0 VJRL=0 VJRR=0 XJF=0 XJR=0 if inmode==0 then --ピッチ if( _KEY(0)==1 and _KEY(1)==0 )then PI=PI+2.5 end if( _KEY(0)==0 and _KEY(1)==1 )then PI=PI-2.5 end --ロール if( _KEY(2)==1 and _KEY(3)==0 )then RO=RO+1.2 end if( _KEY(2)==0 and _KEY(3)==1 )then RO=RO-1.2 end if( _KEY(2)==1 and _KEY(3)==1 )then FLP=FLP+2.5 end if _KEY(7)==1 then gun() end elseif inmode==1 then mx,my=m_input(0.015) PI=my*-40 RO=mx*-13 if _ML()==1 then gun() end if _MR()==1 then FLP=FLP+2.5 end _SETCOLOR(65281) _MOVE2D(0.05,0) _LINE2D(-0.05,0) _MOVE2D(0,0.05) _LINE2D(0,-0.05) end --ヨー if( _KEY(4)==1 and _KEY(6)==0 )then YOI=YOI+2 end if( _KEY(4)==0 and _KEY(6)==1 )then YOI=YOI-2 end if( YOI > 0 )then--右向き YOL = YOI * 1.5 YOR = YOI else YOL = YOI YOR = YOI * 1.5 end if( _KEY(6)==1 and _KEY(4)==1 )then AB=AB+5 end if AB>0 then jout=(jout+JAB*jpow)/AB*6 else jout=jout+JAB*jpow end if _KEYDOWN(12)==1 then SMK = math.mod(SMK/3+1,2)*3 end set=_Y(0) out(3," [Z: yaw L] [X: power +] [C: yaw R] [V: BOM]") end set=_Y(0)-1 yoi=0 function hov() JAB=0 if YOL~=0 and YOR~=0 then if math.abs(YOL)<3 then YOL=0 elseif YOL < 0 then YOL=YOL+3 elseif YOL > 0 then YOL=YOL-3 end if math.abs(YOR)<3 then YOR=0 elseif YOR < 0 then YOR=YOR+3 elseif YOR > 0 then YOR=YOR-3 end end --キー入力 if inmode==0 then if(_KEY(0)==1) then set=set-0.4 end if(_KEY(1)==1) then set=set+0.4 end if _KEYUP(0)==1 then set=_Y(0)-0.2 end if _KEYUP(1)==1 then set=_Y(0)+0.2 end if _KEY(7)==1 then gun() end yoi=_KEY(2)*-1+_KEY(3)*1 elseif inmode==1 then mx,my=m_input(0.02) yoi=mx*2 if my==0 then set=_Y() else set=set+my*0.8 end if _ML()==1 then gun() end _SETCOLOR(65281) _MOVE2D(0.05,0) _LINE2D(-0.05,0) _MOVE2D(0,0.05) _LINE2D(0,-0.05) end if(_KEY(4)==1) then XJ=XJ-1 end if(_KEY(6)==1) then XJ=XJ+1 end --エンジン出力制御 VJF=18000*(_VY(VF)-(_Y(VF)-set-2)-_AX()*6) VJRL=13000*(-_VY(VRL)-(_Y(VRL)-set-2)+_AZ()*4+_AX()*4) VJRR=13000*(_VY(VRR)-(_Y(VRR)-set-2)-_AZ()*4+_AX()*4) --out(7,_VY(VF)," ",-_VY(VRL)," ",_VY(VRR)) local zbrk=5000-math.abs(JET)*35 local xbrk=12000 zjet=_VZ()*zbrk if _WY(0)>0 then wy2=(_WY(0)+0.8)^2 else wy2=((_WY(0)-0.8)^2)*-1 end if yoi~=0 or math.abs(_WY(0))<0.4 then yojet=yoi*20000 else yojet=wy2*-10000 end if math.abs(_VX())<1 or XJ~=0 then xjet=XJ*10000 else xjet=_VX()*xbrk end --接地していて指定高度が0ならエンジン停止 if(_H(0)<1.0 and _H(0)>-100000 and set<_Y(0)) then VJF=0 VJRL=0 VJRR=0 XJF=0 XJR=0 if set < _Y(0)-1 then set = _Y(0)-1 end else jout=jout+zjet XJF=xjet*0.2+yojet XJR=-xjet+yojet end out(3," [Z: moveL] [X: power +] [C: moveR] [V: BOM]") end gtime=0 function gun()--火気制御------------------------------------------------ gtime=math.mod(gtime+1,4) if(gtime==0)then GUN1=200000 end if(gtime==2)then GUN2=200000 end end bcount=0 bb={ [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0 } function bom() if _KEYDOWN(10)==1 then bcount=bcount+1 end if bcount==1 then local d=_SPLIT(BOM1) elseif bcount==2 then local d=_SPLIT(BOM2) elseif bcount==3 then local d=_SPLIT(BOM3) elseif bcount==4 then local d=_SPLIT(BOM4) elseif bcount==5 then local d=_SPLIT(BOM5) elseif bcount==6 then local d=_SPLIT(BOM6) elseif bcount==7 then local d=_SPLIT(BOM7) elseif bcount==8 then local d=_SPLIT(BOM8) end if bb[1]+bb[2]+bb[3]+bb[4]+bb[5]+bb[6]+bb[7]+bb[8]<8 then if bcount>0 and _H(BOM1)<0.5 and _H(BOM1)>-1 and bb[1]==0 then BP1=10000000 bb[1]=1 end if bcount>1 and _H(BOM2)<0.5 and _H(BOM2)>-1 and bb[2]==0 then BP2=10000000 bb[2]=1 end if bcount>2 and _H(BOM3)<0.5 and _H(BOM3)>-1 and bb[3]==0 then BP3=10000000 bb[3]=1 end if bcount>3 and _H(BOM4)<0.5 and _H(BOM4)>-1 and bb[4]==0 then BP4=10000000 bb[4]=1 end if bcount>4 and _H(BOM5)<0.5 and _H(BOM5)>-1 and bb[5]==0 then BP5=10000000 bb[5]=1 end if bcount>5 and _H(BOM6)<0.5 and _H(BOM6)>-1 and bb[6]==0 then BP6=10000000 bb[6]=1 end if bcount>6 and _H(BOM7)<0.5 and _H(BOM7)>-1 and bb[7]==0 then BP7=10000000 bb[7]=1 end if bcount>7 and _H(BOM8)<0.5 and _H(BOM8)>-1 and bb[8]==0 then BP8=10000000 bb[8]=1 end end end function m_input(free) if free==nil then free=0 end local mx=(math.min(math.max(_MX(),0),_WIDTH()))/_WIDTH()-0.5 local my=(math.min(math.max(_MY(),0),_HEIGHT()))/_HEIGHT()-0.5 if math.abs(mx)<=free then mx=0 else mx=mx-free*(mx/math.abs(mx)) end if math.abs(my)<=free then my=0 else my=my-free*(my/math.abs(my)) end return mx,my end inmode=0 vmode=1 wmode=0 ins={} ins[0]="keybord" ins[1]="mouse " --main---------------------------------------------------------------- function main() if _KEYDOWN(14)==1 then inmode=math.mod(inmode+1,2) end instat=ins[inmode] engine() if _KEY(12)==0 and _KEYDOWN(9)==1 then vmode=math.mod(vmode+1,2) end if vmode==0 then vstat="flight" plane() else vstat=" vtol " SMK=0 hov() end bom() NLDL=PI+YOL+AB NLDR=PI-YOL+AB NLTL=PI-YOL-AB NLTR=PI+YOL-AB NRDL=-PI-YOR-AB NRDR=-PI+YOR-AB NRTL=-PI+YOR+AB NRTR=-PI-YOR+AB RL=-RO-FLP RR=-RO+FLP JR=jout*(1+YOI*0.05) JL=jout*(1-YOI*0.05) --常に表示するもの---------------------------------------------- zoom=_ZOOM(70) if(SMK==3)then sstat="on" else sstat="off" end ep="|" etmp=JET+9 for i=0,9 do if etmp>=10 then ep=ep.."■" else ep=ep.."□" end etmp=etmp-10 end if JAB>0 then abstat="[A/B on]" else abstat=" " end etmp=JET for i=0,3 do if etmp<-0 then ep="■"..ep else ep="□"..ep end etmp=etmp+10 end out(0,string.format(" FPS : %2.1f Chips : %d Weight : %.1f %3.1f km/h",_FPS(),_CHIPS(),_WEIGHT(),-(_VZ(0)*3.6))) out(1," [Q: input ( ",instat," )]") out(2," [A: gun] [S: power -] [D: ",vstat," ] [F: smoke ( ",sstat," )]") out(5,string.format(" %s 出力 %d %% %s",ep,JET+JAB,abstat)) end }