920 lines
77 KiB
Plaintext
920 lines
77 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.c10{color:#000000;background-color:#0000aa;}
|
||
|
.c1A{color:#55ff55;background-color:#0000aa;}
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>define</span><span class=cF0> GAME_SPEED_SCALE 0.1
|
||
|
<a name="l2"></a>
|
||
|
<a name="l3"></a></span><span class=cF1>F64</span><span class=cF0> game_speed,
|
||
|
<a name="l4"></a> launch_unit_x1,launch_unit_y1,launch_unit_x2,launch_unit_y2,launch_t,
|
||
|
<a name="l5"></a> return_unit_x1,return_unit_y1,return_unit_x2,return_unit_y2,return_t,
|
||
|
<a name="l6"></a> set_theta_unit_x1,set_theta_unit_y1,set_theta_unit_x2,set_theta_unit_y2,set_theta_t,
|
||
|
<a name="l7"></a> next_noise;
|
||
|
<a name="l8"></a></span><span class=cF9>CTask</span><span class=cF0> *main_task;
|
||
|
<a name="l9"></a>
|
||
|
<a name="l10"></a>#</span><span class=cF1>define</span><span class=cF0> OT_CARRIER 0
|
||
|
<a name="l11"></a>#</span><span class=cF1>define</span><span class=cF0> OT_CRUISER 1
|
||
|
<a name="l12"></a>#</span><span class=cF1>define</span><span class=cF0> OT_FIGHTER 2
|
||
|
<a name="l13"></a>#</span><span class=cF1>define</span><span class=cF0> OT_TYPES_NUM 3
|
||
|
<a name="l14"></a>
|
||
|
<a name="l15"></a>#</span><span class=cF1>define</span><span class=cF0> OF_SHIP 1
|
||
|
<a name="l16"></a>#</span><span class=cF1>define</span><span class=cF0> OF_ACTIVE 2
|
||
|
<a name="l17"></a>#</span><span class=cF1>define</span><span class=cF0> OF_RETURNING 4
|
||
|
<a name="l18"></a>#</span><span class=cF1>define</span><span class=cF0> OF_SHOOTING 8
|
||
|
<a name="l19"></a>
|
||
|
<a name="l20"></a>#</span><span class=cF1>define</span><span class=cF0> FIRE_WIDTH 56
|
||
|
<a name="l21"></a>#</span><span class=cF1>define</span><span class=cF0> FIRE_HEIGHT 16
|
||
|
<a name="l22"></a>#</span><span class=cF1>define</span><span class=cF0> FIRE_X_SCALE 0.5
|
||
|
<a name="l23"></a>#</span><span class=cF1>define</span><span class=cF0> FIRE_Y_SCALE 0.5
|
||
|
<a name="l24"></a>
|
||
|
<a name="l25"></a>#</span><span class=cF1>define</span><span class=cF0> FIRE_COLORS 16
|
||
|
<a name="l26"></a></span><span class=cF1>U8</span><span class=cF0> fire_colors[FIRE_COLORS]={
|
||
|
<a name="l27"></a></span><span class=cF3>YELLOW</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>,</span><span class=cF3>LTRED</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>, </span><span class=cF3>BLACK</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>,</span><span class=cF3>RED</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>,
|
||
|
<a name="l28"></a></span><span class=cF3>YELLOW</span><span class=cF0>,</span><span class=cF3>BLACK</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>,</span><span class=cF3>LTRED</span><span class=cF0>, </span><span class=cF3>RED</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>,</span><span class=cF3>DKGRAY</span><span class=cF0>,</span><span class=cF3>YELLOW</span><span class=cF0>};
|
||
|
<a name="l29"></a>
|
||
|
<a name="l30"></a></span><span class=cF1>class</span><span class=cF0> Obj
|
||
|
<a name="l31"></a>{
|
||
|
<a name="l32"></a> Obj *next,*last;
|
||
|
<a name="l33"></a> Obj *next_in_squadron,*last_in_squadron;
|
||
|
<a name="l34"></a> Obj *host;
|
||
|
<a name="l35"></a> </span><span class=cF1>U8</span><span class=cF0> player,type;
|
||
|
<a name="l36"></a> </span><span class=cF9>U16</span><span class=cF0> flags;
|
||
|
<a name="l37"></a> </span><span class=cF9>I16</span><span class=cF0> squadron,member_num;
|
||
|
<a name="l38"></a> </span><span class=cF1>F64</span><span class=cF0> x,y,theta,dtheta,
|
||
|
<a name="l39"></a> speed,turn_rate,
|
||
|
<a name="l40"></a> life_percent,
|
||
|
<a name="l41"></a> target_x,target_y,
|
||
|
<a name="l42"></a> ship_guns,ship_guns_range,
|
||
|
<a name="l43"></a> air_guns,air_guns_range,
|
||
|
<a name="l44"></a> fuel,max_fuel,fuel_burn_rate,
|
||
|
<a name="l45"></a> death_time,next_action_time;
|
||
|
<a name="l46"></a> </span><span class=cF9>I32</span><span class=cF0> torpedos,max_torpedos;
|
||
|
<a name="l47"></a> </span><span class=cF1>F64</span><span class=cF0> torpedos_range;
|
||
|
<a name="l48"></a> </span><span class=cF1>U8</span><span class=cF0> fire[(FIRE_WIDTH*FIRE_HEIGHT+7)/8];
|
||
|
<a name="l49"></a>} obj_head;
|
||
|
<a name="l50"></a>
|
||
|
<a name="l51"></a></span><span class=cF1>class</span><span class=cF0> Torpedo
|
||
|
<a name="l52"></a>{
|
||
|
<a name="l53"></a> Torpedo *next,*last;
|
||
|
<a name="l54"></a> Obj *target;
|
||
|
<a name="l55"></a> </span><span class=cF1>F64</span><span class=cF0> x,y,theta,speed,timeout;
|
||
|
<a name="l56"></a>} torpedo_head;
|
||
|
<a name="l57"></a>
|
||
|
<a name="l58"></a>#</span><span class=cF1>define</span><span class=cF0> SA_PARKED 0
|
||
|
<a name="l59"></a>#</span><span class=cF1>define</span><span class=cF0> SA_LAUNCHING 1
|
||
|
<a name="l60"></a>#</span><span class=cF1>define</span><span class=cF0> SA_FLYING 2
|
||
|
<a name="l61"></a>#</span><span class=cF1>define</span><span class=cF0> SA_SET_theta 3
|
||
|
<a name="l62"></a>#</span><span class=cF1>define</span><span class=cF0> SA_RETURNING 4
|
||
|
<a name="l63"></a>#</span><span class=cF1>define</span><span class=cF0> SA_DEAD 5
|
||
|
<a name="l64"></a>
|
||
|
<a name="l65"></a></span><span class=cF1>class</span><span class=cF0> Squadron : Obj
|
||
|
<a name="l66"></a>{
|
||
|
<a name="l67"></a> </span><span class=cF9>I64</span><span class=cF0> action,dead_mask,total_mask;
|
||
|
<a name="l68"></a>} *squadrons;
|
||
|
<a name="l69"></a>
|
||
|
<a name="l70"></a></span><span class=cF1>U0</span><span class=cF0> SquadronIns(Obj *o,Obj *pred)
|
||
|
<a name="l71"></a>{
|
||
|
<a name="l72"></a> Obj *succ=pred->next_in_squadron;
|
||
|
<a name="l73"></a> o->next_in_squadron=succ;
|
||
|
<a name="l74"></a> o->last_in_squadron=pred;
|
||
|
<a name="l75"></a> pred->next_in_squadron=o;
|
||
|
<a name="l76"></a> succ->last_in_squadron=o;
|
||
|
<a name="l77"></a>}
|
||
|
<a name="l78"></a>
|
||
|
<a name="l79"></a></span><span class=cF1>U0</span><span class=cF0> SquadronRem(Obj *o)
|
||
|
<a name="l80"></a>{
|
||
|
<a name="l81"></a> Obj *pred=o->last_in_squadron,*succ=o->next_in_squadron;
|
||
|
<a name="l82"></a> pred->next_in_squadron=succ;
|
||
|
<a name="l83"></a> succ->last_in_squadron=pred;
|
||
|
<a name="l84"></a>}
|
||
|
<a name="l85"></a>
|
||
|
<a name="l86"></a>#</span><span class=cF1>define</span><span class=cF0> PLAYERS_NUM 2
|
||
|
<a name="l87"></a>
|
||
|
<a name="l88"></a></span><span class=cF9>I64</span><span class=cF0> num_carriers[PLAYERS_NUM]={2,3},
|
||
|
<a name="l89"></a> num_cruisers[PLAYERS_NUM]={2,3},
|
||
|
<a name="l90"></a> num_planes_per_squadron[PLAYERS_NUM]={6,5},
|
||
|
<a name="l91"></a> num_squadrons_per_carrier[PLAYERS_NUM]={2,3},
|
||
|
<a name="l92"></a> num_alive[PLAYERS_NUM],
|
||
|
<a name="l93"></a> num_squadrons;
|
||
|
<a name="l94"></a>
|
||
|
<a name="l95"></a>Obj *ObjFind(</span><span class=cF1>F64</span><span class=cF0> x,</span><span class=cF1>F64</span><span class=cF0> y,
|
||
|
<a name="l96"></a> </span><span class=cF9>I64</span><span class=cF0> flag_mask=OF_ACTIVE|OF_RETURNING,</span><span class=cF9>I64</span><span class=cF0> flag_val=OF_ACTIVE,
|
||
|
<a name="l97"></a> </span><span class=cF9>I64</span><span class=cF0> type_mask=-1,</span><span class=cF9>I64</span><span class=cF0> player_mask=-1,</span><span class=cF1>F64</span><span class=cF0> *_d=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l98"></a>{
|
||
|
<a name="l99"></a> Obj *tmpo=obj_head.next,*best=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l100"></a> </span><span class=cF1>F64</span><span class=cF0> dd,best_dd=</span><span class=cF3>F64_MAX</span><span class=cF0>;
|
||
|
<a name="l101"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l102"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&flag_mask==flag_val &&
|
||
|
<a name="l103"></a> </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&type_mask,tmpo->type</span><span class=cF7>)</span><span class=cF0>&&</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&player_mask,tmpo->player</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l104"></a> dd=</span><span class=cF5>Sqr</span><span class=cF0>(tmpo->x-x)+</span><span class=cF5>Sqr</span><span class=cF0>(tmpo->y-y);
|
||
|
<a name="l105"></a> </span><span class=cF1>if</span><span class=cF0> (dd<best_dd) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l106"></a> best=tmpo;
|
||
|
<a name="l107"></a> best_dd=dd;
|
||
|
<a name="l108"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l109"></a> }
|
||
|
<a name="l110"></a> tmpo=tmpo->next;
|
||
|
<a name="l111"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l112"></a> </span><span class=cF1>if</span><span class=cF0> (_d) *_d=</span><span class=cF5>Sqrt</span><span class=cF0>(best_dd);
|
||
|
<a name="l113"></a> </span><span class=cF1>return</span><span class=cF0> best;
|
||
|
<a name="l114"></a>}
|
||
|
<a name="l115"></a>
|
||
|
<a name="l116"></a></span><span class=cF1>U0</span><span class=cF0> ObjDel(Obj *tmpo)
|
||
|
<a name="l117"></a>{
|
||
|
<a name="l118"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l119"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>tS</span><span class=cF0><tmpo->death_time)
|
||
|
<a name="l120"></a> tmpo->flags&=~OF_ACTIVE;
|
||
|
<a name="l121"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->squadron>=0)
|
||
|
<a name="l123"></a> SquadronRem(tmpo);
|
||
|
<a name="l124"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpo);
|
||
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->squadron>=0)
|
||
|
<a name="l126"></a> </span><span class=cF5>LBts</span><span class=cF0>(&squadrons[tmpo->squadron].dead_mask,tmpo->member_num);
|
||
|
<a name="l127"></a> num_alive[tmpo->player]--;
|
||
|
<a name="l128"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpo);
|
||
|
<a name="l129"></a> }
|
||
|
<a name="l130"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l131"></a>}
|
||
|
<a name="l132"></a></span><span class=c10>
|
||
|
<a name="l133"></a>
|
||
|
<a name="l134"></a></span><span class=c1A>
|
||
|
<a name="l135"></a><1>/* Graphics Not Rendered in HTML */</span><span class=c10>
|
||
|
<a name="l136"></a>
|
||
|
<a name="l137"></a>
|
||
|
<a name="l138"></a>
|
||
|
<a name="l139"></a></span><span class=c1A>
|
||
|
<a name="l140"></a><2>/* Graphics Not Rendered in HTML */</span><span class=c10>
|
||
|
<a name="l141"></a>
|
||
|
<a name="l142"></a></span><span class=c1A>
|
||
|
<a name="l143"></a><3>/* Graphics Not Rendered in HTML */</span><span class=c10>
|
||
|
<a name="l144"></a>
|
||
|
<a name="l145"></a>
|
||
|
<a name="l146"></a></span><span class=c1A>
|
||
|
<a name="l147"></a><4>/* Graphics Not Rendered in HTML */</span><span class=c10>
|
||
|
<a name="l148"></a>
|
||
|
<a name="l149"></a>
|
||
|
<a name="l150"></a>
|
||
|
<a name="l151"></a></span><span class=c1A>
|
||
|
<a name="l152"></a><5>/* Graphics Not Rendered in HTML */</span><span class=c10>
|
||
|
<a name="l153"></a>
|
||
|
<a name="l154"></a></span><span class=c1A>
|
||
|
<a name="l155"></a><6>/* Graphics Not Rendered in HTML */</span><span class=c10>
|
||
|
<a name="l156"></a></span><span class=cF0>
|
||
|
<a name="l157"></a></span><span class=cF1>U8</span><span class=cF0> *imgs[PLAYERS_NUM][OT_TYPES_NUM]={</span><span class=cF7>{</span><span class=cFA><1></span><span class=cF0>,</span><span class=cFA><2></span><span class=cF0>,</span><span class=cFA><3></span><span class=cF7>}</span><span class=cF0>,</span><span class=cF7>{</span><span class=cFA><4></span><span class=cF0>,</span><span class=cFA><5></span><span class=cF0>,</span><span class=cFA><6></span><span class=cF7>}</span><span class=cF0>};
|
||
|
<a name="l158"></a>
|
||
|
<a name="l159"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DrawIt</span><span class=cF0>(</span><span class=cF9>CTask</span><span class=cF0> *task,</span><span class=cF9>CDC</span><span class=cF0> *dc)
|
||
|
<a name="l160"></a>{
|
||
|
<a name="l161"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,k;
|
||
|
<a name="l162"></a> </span><span class=cF1>F64</span><span class=cF0> d,cur_time=</span><span class=cF5>tS</span><span class=cF0>;
|
||
|
<a name="l163"></a> Obj *tmpo;
|
||
|
<a name="l164"></a> Torpedo *tmpt;
|
||
|
<a name="l165"></a>
|
||
|
<a name="l166"></a> tmpt=torpedo_head.next;
|
||
|
<a name="l167"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&torpedo_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l168"></a> dc->color=</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l169"></a> </span><span class=cF5>GrPlot</span><span class=cF0>(dc,tmpt->x,tmpt->y);
|
||
|
<a name="l170"></a> tmpt=tmpt->next;
|
||
|
<a name="l171"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l172"></a>
|
||
|
<a name="l173"></a> tmpo=obj_head.next;
|
||
|
<a name="l174"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l175"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_ACTIVE && tmpo->flags&OF_SHIP) {
|
||
|
<a name="l176"></a> </span><span class=cF5>Sprite3ZB</span><span class=cF0>(dc,tmpo->x,tmpo->y,0,
|
||
|
<a name="l177"></a> imgs[tmpo->player][tmpo->type],tmpo->theta+</span><span class=cF3>pi</span><span class=cF0>/2);
|
||
|
<a name="l178"></a>
|
||
|
<a name="l179"></a> k=0;
|
||
|
<a name="l180"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<FIRE_HEIGHT;j++)
|
||
|
<a name="l181"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<FIRE_WIDTH;i++)
|
||
|
<a name="l182"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>tmpo->fire,k++</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l183"></a> dc->color=fire_colors[</span><span class=cF5>ToI64</span><span class=cF0>(k+10*</span><span class=cF5>tS</span><span class=cF0>)&(FIRE_COLORS-1)];
|
||
|
<a name="l184"></a> </span><span class=cF5>GrPlot</span><span class=cF0>(dc,
|
||
|
<a name="l185"></a> tmpo->x+FIRE_X_SCALE*</span><span class=cF7>(</span><span class=cF0>i-FIRE_WIDTH /2+(11*</span><span class=cF5>tS</span><span class=cF0>+i)%1.7</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l186"></a> *</span><span class=cF5>Cos</span><span class=cF7>(</span><span class=cF0>tmpo->theta</span><span class=cF7>)</span><span class=cF0>-
|
||
|
<a name="l187"></a> FIRE_Y_SCALE*</span><span class=cF7>(</span><span class=cF0>j-FIRE_HEIGHT/2+(12*</span><span class=cF5>tS</span><span class=cF0>+j)%1.7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF5>Sin</span><span class=cF7>(</span><span class=cF0>tmpo->theta</span><span class=cF7>)</span><span class=cF0>,
|
||
|
<a name="l188"></a> tmpo->y+FIRE_Y_SCALE*</span><span class=cF7>(</span><span class=cF0>j-FIRE_HEIGHT/2+(19*</span><span class=cF5>tS</span><span class=cF0>+j)%1.7</span><span class=cF7>)</span><span class=cF0>
|
||
|
<a name="l189"></a> *</span><span class=cF5>Cos</span><span class=cF7>(</span><span class=cF0>tmpo->theta</span><span class=cF7>)</span><span class=cF0>+
|
||
|
<a name="l190"></a> FIRE_X_SCALE*</span><span class=cF7>(</span><span class=cF0>i-FIRE_WIDTH /2+(13*</span><span class=cF5>tS</span><span class=cF0>+i)%1.7</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF5>Sin</span><span class=cF7>(</span><span class=cF0>tmpo->theta</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l191"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l192"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Blink</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l193"></a> dc->color=</span><span class=cF3>BLACK</span><span class=cF0>;
|
||
|
<a name="l194"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,tmpo->x+5,tmpo->y,tmpo->x+5+10,tmpo->y);
|
||
|
<a name="l195"></a>
|
||
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->life_percent>0) {
|
||
|
<a name="l197"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->life_percent<33)
|
||
|
<a name="l198"></a> dc->color=</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l199"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpo->life_percent<66)
|
||
|
<a name="l200"></a> dc->color=</span><span class=cF3>YELLOW</span><span class=cF0>;
|
||
|
<a name="l201"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l202"></a> dc->color=</span><span class=cF3>GREEN</span><span class=cF0>;
|
||
|
<a name="l203"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,tmpo->x+5,tmpo->y,
|
||
|
<a name="l204"></a> tmpo->x+5+10*tmpo->life_percent/100,tmpo->y);
|
||
|
<a name="l205"></a> }
|
||
|
<a name="l206"></a>
|
||
|
<a name="l207"></a> dc->color=</span><span class=cF3>BLACK</span><span class=cF0>;
|
||
|
<a name="l208"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,tmpo->x+5,tmpo->y+2,tmpo->x+5+10,tmpo->y+2);
|
||
|
<a name="l209"></a> d=tmpo->fuel*100/tmpo->max_fuel;
|
||
|
<a name="l210"></a> </span><span class=cF1>if</span><span class=cF0> (d>0) {
|
||
|
<a name="l211"></a> </span><span class=cF1>if</span><span class=cF0> (d<33)
|
||
|
<a name="l212"></a> dc->color=</span><span class=cF3>RED</span><span class=cF0>;
|
||
|
<a name="l213"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (d<66)
|
||
|
<a name="l214"></a> dc->color=</span><span class=cF3>YELLOW</span><span class=cF0>;
|
||
|
<a name="l215"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l216"></a> dc->color=</span><span class=cF3>GREEN</span><span class=cF0>;
|
||
|
<a name="l217"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,tmpo->x+5,tmpo->y+2,tmpo->x+5+10*d/100,tmpo->y+2);
|
||
|
<a name="l218"></a> }
|
||
|
<a name="l219"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l220"></a> }
|
||
|
<a name="l221"></a> tmpo=tmpo->next;
|
||
|
<a name="l222"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l223"></a>
|
||
|
<a name="l224"></a> tmpo=obj_head.next;
|
||
|
<a name="l225"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l226"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_ACTIVE && !</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_SHIP</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l227"></a> </span><span class=cF5>Sprite3ZB</span><span class=cF0>(dc,tmpo->x,tmpo->y,0,
|
||
|
<a name="l228"></a> imgs[tmpo->player][tmpo->type],tmpo->theta+</span><span class=cF3>pi</span><span class=cF0>/2);
|
||
|
<a name="l229"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_SHOOTING) {
|
||
|
<a name="l230"></a> dc->color=</span><span class=cF3>LTRED</span><span class=cF0>;
|
||
|
<a name="l231"></a> </span><span class=cF5>GrLine</span><span class=cF0>(dc,tmpo->x,tmpo->y,tmpo->target_x,tmpo->target_y,3);
|
||
|
<a name="l232"></a> }
|
||
|
<a name="l233"></a> tmpo=tmpo->next;
|
||
|
<a name="l234"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l235"></a>
|
||
|
<a name="l236"></a> dc->flags|=</span><span class=cF3>DCF_TRANSFORMATION</span><span class=cF0>;
|
||
|
<a name="l237"></a> </span><span class=cF1>if</span><span class=cF0> (cur_time<launch_t) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l238"></a> dc->color=</span><span class=cF3>LTGREEN</span><span class=cF0>;
|
||
|
<a name="l239"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,launch_unit_x1,launch_unit_y1,0,
|
||
|
<a name="l240"></a> launch_unit_x2,launch_unit_y2,0);
|
||
|
<a name="l241"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l242"></a> </span><span class=cF1>if</span><span class=cF0> (cur_time<return_t) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l243"></a> dc->color=</span><span class=cF3>LTRED</span><span class=cF0>;
|
||
|
<a name="l244"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,return_unit_x1,return_unit_y1,0,
|
||
|
<a name="l245"></a> return_unit_x2,return_unit_y2,0);
|
||
|
<a name="l246"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l247"></a> </span><span class=cF1>if</span><span class=cF0> (cur_time<set_theta_t) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l248"></a> dc->color=</span><span class=cF3>YELLOW</span><span class=cF0>;
|
||
|
<a name="l249"></a> </span><span class=cF5>GrArrow3</span><span class=cF0>(dc,set_theta_unit_x1,set_theta_unit_y1,0,
|
||
|
<a name="l250"></a> set_theta_unit_x2,set_theta_unit_y2,0);
|
||
|
<a name="l251"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l252"></a>
|
||
|
<a name="l253"></a> dc->color=</span><span class=cF3>YELLOW</span><span class=cF0>;
|
||
|
<a name="l254"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,-task->scroll_x,-task->scroll_y,
|
||
|
<a name="l255"></a> </span><span class=cF6>"Game Speed: %5.2f"</span><span class=cF0>,game_speed);
|
||
|
<a name="l256"></a> dc->color=</span><span class=cF3>LTCYAN</span><span class=cF0>;
|
||
|
<a name="l257"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,-task->scroll_x,-task->scroll_y+</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>,
|
||
|
<a name="l258"></a> </span><span class=cF6>"Player 1: %d"</span><span class=cF0>,num_alive[0]);
|
||
|
<a name="l259"></a> dc->color=</span><span class=cF3>LTPURPLE</span><span class=cF0>;
|
||
|
<a name="l260"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,-task->scroll_x,-task->scroll_y+2*</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>,
|
||
|
<a name="l261"></a> </span><span class=cF6>"Player 2: %d"</span><span class=cF0>,num_alive[1]);
|
||
|
<a name="l262"></a>
|
||
|
<a name="l263"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>!num_alive[0]||!num_alive[1]</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF5>Blink</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l264"></a> </span><span class=cF1>if</span><span class=cF0> (!num_alive[1]) {
|
||
|
<a name="l265"></a> dc->color=</span><span class=cF3>LTGREEN</span><span class=cF0>;
|
||
|
<a name="l266"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,task->pix_width>>1 -</span><span class=cF7>(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*14</span><span class=cF7>)</span><span class=cF0>/2-task->scroll_x,
|
||
|
<a name="l267"></a> task->pix_height>>1-</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>/2-task->scroll_y,</span><span class=cF6>"Game Completed"</span><span class=cF0>);
|
||
|
<a name="l268"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l269"></a> dc->color=</span><span class=cF3>LTRED</span><span class=cF0>;
|
||
|
<a name="l270"></a> </span><span class=cF5>GrPrint</span><span class=cF0>(dc,task->pix_width>>1 -</span><span class=cF7>(</span><span class=cF3>FONT_WIDTH</span><span class=cF0>*9</span><span class=cF7>)</span><span class=cF0>/2-task->scroll_x,
|
||
|
<a name="l271"></a> task->pix_height>>1-</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>/2-task->scroll_y,</span><span class=cF6>"Game Over"</span><span class=cF0>);
|
||
|
<a name="l272"></a> }
|
||
|
<a name="l273"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l274"></a>}
|
||
|
<a name="l275"></a>
|
||
|
<a name="l276"></a></span><span class=cF1>U0</span><span class=cF0> Init()
|
||
|
<a name="l277"></a>{
|
||
|
<a name="l278"></a> </span><span class=cF9>I64</span><span class=cF0> i,fighter,ship,player,squadron,
|
||
|
<a name="l279"></a> w=</span><span class=cF5>Fs</span><span class=cF0>->pix_width,h=</span><span class=cF5>Fs</span><span class=cF0>->pix_height;
|
||
|
<a name="l280"></a> Squadron *tmps;
|
||
|
<a name="l281"></a> Obj *tmpo,*tmpo1;
|
||
|
<a name="l282"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&obj_head);
|
||
|
<a name="l283"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&torpedo_head);
|
||
|
<a name="l284"></a>
|
||
|
<a name="l285"></a> next_noise=</span><span class=cF5>tS</span><span class=cF0>;
|
||
|
<a name="l286"></a> </span><span class=cF5>Fs</span><span class=cF0>->scroll_x=0;
|
||
|
<a name="l287"></a> </span><span class=cF5>Fs</span><span class=cF0>->scroll_y=0;
|
||
|
<a name="l288"></a> game_speed=1.0;
|
||
|
<a name="l289"></a> launch_t=return_t=set_theta_t=0;
|
||
|
<a name="l290"></a> main_task=</span><span class=cF5>Fs</span><span class=cF0>;
|
||
|
<a name="l291"></a> num_squadrons=0;
|
||
|
<a name="l292"></a> </span><span class=cF1>for</span><span class=cF0> (player=0;player<PLAYERS_NUM;player++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l293"></a> num_alive[player]=0;
|
||
|
<a name="l294"></a> </span><span class=cF1>for</span><span class=cF0> (ship=0;ship<num_cruisers[player];ship++) {
|
||
|
<a name="l295"></a> tmpo1=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>Obj</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l296"></a> num_alive[player]++;
|
||
|
<a name="l297"></a> tmpo1->type=OT_CRUISER; tmpo1->player=player;
|
||
|
<a name="l298"></a> tmpo1->squadron=-1; tmpo1->member_num=ship;
|
||
|
<a name="l299"></a> tmpo1->flags=OF_ACTIVE|OF_SHIP;
|
||
|
<a name="l300"></a> tmpo1->x=0.8*w*(</span><span class=cF5>Rand</span><span class=cF0>-0.5)+w>>1; tmpo1->y=0.8*h*(</span><span class=cF5>Rand</span><span class=cF0>-0.5)+h>>1;
|
||
|
<a name="l301"></a> tmpo1->host=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l302"></a> tmpo1->speed=35.0; tmpo1->turn_rate=2.5;
|
||
|
<a name="l303"></a> tmpo1->theta=2*</span><span class=cF3>pi</span><span class=cF0>*(</span><span class=cF5>Rand</span><span class=cF0>-0.5); tmpo1->dtheta=0;
|
||
|
<a name="l304"></a> tmpo1->life_percent=100.0;
|
||
|
<a name="l305"></a> tmpo1->fuel=tmpo1->max_fuel=100000;
|
||
|
<a name="l306"></a> tmpo1->fuel_burn_rate=100.0;
|
||
|
<a name="l307"></a> tmpo1->air_guns =5000; tmpo1->air_guns_range =30.0;
|
||
|
<a name="l308"></a> tmpo1->ship_guns=10000; tmpo1->ship_guns_range=30.0;
|
||
|
<a name="l309"></a> tmpo1->torpedos =tmpo1->max_torpedos=0;
|
||
|
<a name="l310"></a> tmpo1->torpedos_range =0.0;
|
||
|
<a name="l311"></a> tmpo1->next_action_time=0;
|
||
|
<a name="l312"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpo1,obj_head.last);
|
||
|
<a name="l313"></a> }
|
||
|
<a name="l314"></a>
|
||
|
<a name="l315"></a> </span><span class=cF1>for</span><span class=cF0> (ship=0;ship<num_carriers[player];ship++) {
|
||
|
<a name="l316"></a> tmpo1=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>Obj</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l317"></a> num_alive[player]++;
|
||
|
<a name="l318"></a> tmpo1->type=OT_CARRIER; tmpo1->player=player;
|
||
|
<a name="l319"></a> tmpo1->squadron=-1; tmpo1->member_num=ship;
|
||
|
<a name="l320"></a> tmpo1->flags=OF_ACTIVE|OF_SHIP;
|
||
|
<a name="l321"></a> tmpo1->x=0.8*w*(</span><span class=cF5>Rand</span><span class=cF0>-0.5)+w>>1; tmpo1->y=0.8*h*(</span><span class=cF5>Rand</span><span class=cF0>-0.5)+h>>1;
|
||
|
<a name="l322"></a> tmpo1->host=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l323"></a> tmpo1->speed=28.0; tmpo1->turn_rate=1.0;
|
||
|
<a name="l324"></a> tmpo1->theta=2*</span><span class=cF3>pi</span><span class=cF0>*(</span><span class=cF5>Rand</span><span class=cF0>-0.5); tmpo1->dtheta=0;
|
||
|
<a name="l325"></a> tmpo1->life_percent=100.0;
|
||
|
<a name="l326"></a> tmpo1->fuel=tmpo1->max_fuel=750000;
|
||
|
<a name="l327"></a> tmpo1->fuel_burn_rate=500.0;
|
||
|
<a name="l328"></a> tmpo1->air_guns =5000; tmpo1->air_guns_range =20.0;
|
||
|
<a name="l329"></a> tmpo1->ship_guns=2000; tmpo1->ship_guns_range=30.0;
|
||
|
<a name="l330"></a> tmpo1->torpedos =tmpo1->max_torpedos=0;
|
||
|
<a name="l331"></a> tmpo1->torpedos_range =0.0;
|
||
|
<a name="l332"></a> tmpo1->next_action_time=0;
|
||
|
<a name="l333"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpo1,obj_head.last);
|
||
|
<a name="l334"></a>
|
||
|
<a name="l335"></a> </span><span class=cF1>for</span><span class=cF0> (squadron=0;squadron<num_squadrons_per_carrier[player];
|
||
|
<a name="l336"></a> squadron++,num_squadrons++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l337"></a> </span><span class=cF1>for</span><span class=cF0> (fighter=0;fighter<num_planes_per_squadron[player];fighter++) {
|
||
|
<a name="l338"></a> tmpo=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>Obj</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l339"></a> num_alive[player]++;
|
||
|
<a name="l340"></a> tmpo->type=OT_FIGHTER; tmpo->player=player;
|
||
|
<a name="l341"></a> tmpo->squadron=num_squadrons; tmpo->member_num=fighter;
|
||
|
<a name="l342"></a> tmpo->flags=0;
|
||
|
<a name="l343"></a> tmpo->host=tmpo1;
|
||
|
<a name="l344"></a> tmpo->speed=300.0; tmpo->turn_rate=25.0;
|
||
|
<a name="l345"></a> tmpo->life_percent=100.0;
|
||
|
<a name="l346"></a> tmpo->fuel=tmpo->max_fuel=1000;
|
||
|
<a name="l347"></a> tmpo->fuel_burn_rate=1.0;
|
||
|
<a name="l348"></a> tmpo->air_guns =35000; tmpo->air_guns_range =8.0;
|
||
|
<a name="l349"></a> tmpo->ship_guns=0; tmpo->ship_guns_range=0.0;
|
||
|
<a name="l350"></a> tmpo->torpedos =tmpo->max_torpedos=1;
|
||
|
<a name="l351"></a> tmpo->torpedos_range =20.0;
|
||
|
<a name="l352"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpo,obj_head.last);
|
||
|
<a name="l353"></a> }
|
||
|
<a name="l354"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l355"></a> }
|
||
|
<a name="l356"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l357"></a> squadrons=</span><span class=cF5>CAlloc</span><span class=cF0>(num_squadrons*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>Squadron</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l358"></a> </span><span class=cF1>for</span><span class=cF0> (i=0,tmps=squadrons;i<num_squadrons;i++,tmps++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l359"></a> tmps->next_in_squadron=tmps->last_in_squadron=tmps;
|
||
|
<a name="l360"></a> tmps->squadron=i;
|
||
|
<a name="l361"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l362"></a> tmpo=obj_head.next;
|
||
|
<a name="l363"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l364"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->squadron>=0) {
|
||
|
<a name="l365"></a> tmps=&squadrons[tmpo->squadron];
|
||
|
<a name="l366"></a> tmps->host =tmpo->host;
|
||
|
<a name="l367"></a> tmps->player=tmpo->player;
|
||
|
<a name="l368"></a> tmps->total_mask=1<<num_planes_per_squadron[tmpo->player]-1;
|
||
|
<a name="l369"></a> SquadronIns(tmpo,tmps->last_in_squadron);
|
||
|
<a name="l370"></a> }
|
||
|
<a name="l371"></a> tmpo=tmpo->next;
|
||
|
<a name="l372"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l373"></a>}
|
||
|
<a name="l374"></a>
|
||
|
<a name="l375"></a></span><span class=cF1>U0</span><span class=cF0> CleanUp()
|
||
|
<a name="l376"></a>{
|
||
|
<a name="l377"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&obj_head,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l378"></a> </span><span class=cF5>QueDel</span><span class=cF0>(&torpedo_head,</span><span class=cF3>TRUE</span><span class=cF0>);
|
||
|
<a name="l379"></a> </span><span class=cF5>Free</span><span class=cF0>(squadrons);
|
||
|
<a name="l380"></a>}
|
||
|
<a name="l381"></a>
|
||
|
<a name="l382"></a>Obj *ObjLaunch(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF9>I64</span><span class=cF0> squadron=-1,
|
||
|
<a name="l383"></a> Obj *host=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> x=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> y=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> theta=</span><span class=cF3>F64_MAX</span><span class=cF0>)
|
||
|
<a name="l384"></a>{
|
||
|
<a name="l385"></a> Obj *tmpo;
|
||
|
<a name="l386"></a> </span><span class=cF1>F64</span><span class=cF0> cur_time=</span><span class=cF5>tS</span><span class=cF0>;
|
||
|
<a name="l387"></a> </span><span class=cF1>if</span><span class=cF0> (!host)
|
||
|
<a name="l388"></a> host=ObjFind(x,y,,,1<<OT_CARRIER,1<<player);
|
||
|
<a name="l389"></a> </span><span class=cF1>if</span><span class=cF0> (host && cur_time>host->next_action_time) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l390"></a> </span><span class=cF1>if</span><span class=cF0> (theta==</span><span class=cF3>F64_MAX</span><span class=cF0>)
|
||
|
<a name="l391"></a> theta=</span><span class=cF5>Arg</span><span class=cF0>(x-host->x,y-host->y);
|
||
|
<a name="l392"></a> tmpo=obj_head.next;
|
||
|
<a name="l393"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) {
|
||
|
<a name="l394"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->host==host && </span><span class=cF7>(</span><span class=cF0>squadron<0||tmpo->squadron==squadron</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l395"></a> !</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_ACTIVE</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l396"></a> </span><span class=cF7>(</span><span class=cF0>tmpo->squadron<0||squadrons[tmpo->squadron].action==SA_PARKED||
|
||
|
<a name="l397"></a> squadrons[tmpo->squadron].action==SA_LAUNCHING</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l398"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->fuel<=0.0)
|
||
|
<a name="l399"></a></span><span class=cF2>//When low on fuel, not zero, gets launched and captured.</span><span class=cF0>
|
||
|
<a name="l400"></a> </span><span class=cF5>LBts</span><span class=cF0>(&squadrons[tmpo->squadron].dead_mask,tmpo->member_num);
|
||
|
<a name="l401"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l402"></a> tmpo->flags=tmpo->flags&~OF_RETURNING|OF_ACTIVE;
|
||
|
<a name="l403"></a> tmpo->theta=host->theta;
|
||
|
<a name="l404"></a> </span><span class=cF1>if</span><span class=cF0> (x==</span><span class=cF3>F64_MAX</span><span class=cF0> || y==</span><span class=cF3>F64_MAX</span><span class=cF0> || </span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>x-host->x</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>y-host->y</span><span class=cF7>)</span><span class=cF0>>3*3)
|
||
|
<a name="l405"></a> tmpo->dtheta=</span><span class=cF5>Wrap</span><span class=cF0>(theta-tmpo->theta,-</span><span class=cF3>pi</span><span class=cF0>);
|
||
|
<a name="l406"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l407"></a> tmpo->dtheta=0;
|
||
|
<a name="l408"></a> tmpo->x=host->x;
|
||
|
<a name="l409"></a> tmpo->y=host->y;
|
||
|
<a name="l410"></a> host->next_action_time=cur_time+0.25/game_speed;
|
||
|
<a name="l411"></a> </span><span class=cF1>return</span><span class=cF0> tmpo;
|
||
|
<a name="l412"></a> }
|
||
|
<a name="l413"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l414"></a> tmpo=tmpo->next;
|
||
|
<a name="l415"></a> }
|
||
|
<a name="l416"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l417"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l418"></a>}
|
||
|
<a name="l419"></a>
|
||
|
<a name="l420"></a>Squadron *SquadronLaunch(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF1>F64</span><span class=cF0> x=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> y=</span><span class=cF3>F64_MAX</span><span class=cF0>)
|
||
|
<a name="l421"></a>{
|
||
|
<a name="l422"></a> Squadron *tmps;
|
||
|
<a name="l423"></a> Obj *tmpo;
|
||
|
<a name="l424"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo=ObjLaunch</span><span class=cF7>(</span><span class=cF0>player,,,x,y</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l425"></a> </span><span class=cF1>if</span><span class=cF0> (player==0) {
|
||
|
<a name="l426"></a> launch_unit_x1=tmpo->x;
|
||
|
<a name="l427"></a> launch_unit_y1=tmpo->y;
|
||
|
<a name="l428"></a> launch_unit_x2=</span><span class=cFB>ms</span><span class=cF0>.pos.x-main_task->pix_left-main_task->scroll_x;
|
||
|
<a name="l429"></a> launch_unit_y2=</span><span class=cFB>ms</span><span class=cF0>.pos.y-main_task->pix_top -main_task->scroll_y;
|
||
|
<a name="l430"></a> launch_t=</span><span class=cF5>tS</span><span class=cF0>+0.5;
|
||
|
<a name="l431"></a> }
|
||
|
<a name="l432"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->squadron>=0) {
|
||
|
<a name="l433"></a> tmps=&squadrons[tmpo->squadron];
|
||
|
<a name="l434"></a> </span><span class=cF1>if</span><span class=cF0> (tmps->action==SA_PARKED) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l435"></a> tmps->action=SA_LAUNCHING;
|
||
|
<a name="l436"></a> tmps->theta=tmpo->theta+tmpo->dtheta;
|
||
|
<a name="l437"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l438"></a> </span><span class=cF1>return</span><span class=cF0> tmps;
|
||
|
<a name="l439"></a> }
|
||
|
<a name="l440"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l441"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l442"></a>}
|
||
|
<a name="l443"></a>
|
||
|
<a name="l444"></a>Obj *ObjReturn(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF1>F64</span><span class=cF0> x,</span><span class=cF1>F64</span><span class=cF0> y)
|
||
|
<a name="l445"></a>{
|
||
|
<a name="l446"></a> Obj *tmpo;
|
||
|
<a name="l447"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo=ObjFind</span><span class=cF7>(</span><span class=cF0>x,y,OF_ACTIVE,OF_ACTIVE,1<<OT_FIGHTER,1<<player</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l448"></a> tmpo->flags|=OF_RETURNING;
|
||
|
<a name="l449"></a> </span><span class=cF1>return</span><span class=cF0> tmpo;
|
||
|
<a name="l450"></a>}
|
||
|
<a name="l451"></a>
|
||
|
<a name="l452"></a>Squadron *SquadronReturn(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF1>F64</span><span class=cF0> x,</span><span class=cF1>F64</span><span class=cF0> y)
|
||
|
<a name="l453"></a>{
|
||
|
<a name="l454"></a> Squadron *tmps;
|
||
|
<a name="l455"></a> Obj *tmpo;
|
||
|
<a name="l456"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo=ObjReturn</span><span class=cF7>(</span><span class=cF0>player,x,y</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l457"></a> </span><span class=cF1>if</span><span class=cF0> (player==0) {
|
||
|
<a name="l458"></a> return_unit_x1=tmpo->x;
|
||
|
<a name="l459"></a> return_unit_y1=tmpo->y;
|
||
|
<a name="l460"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->host) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l461"></a> return_unit_x2=tmpo->host->x;
|
||
|
<a name="l462"></a> return_unit_y2=tmpo->host->y;
|
||
|
<a name="l463"></a> return_t=</span><span class=cF5>tS</span><span class=cF0>+0.5;
|
||
|
<a name="l464"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l465"></a> }
|
||
|
<a name="l466"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->squadron>=0) {
|
||
|
<a name="l467"></a> tmps=&squadrons[tmpo->squadron];
|
||
|
<a name="l468"></a> </span><span class=cF1>if</span><span class=cF0> (tmps->action==SA_FLYING)
|
||
|
<a name="l469"></a> tmps->action=SA_RETURNING;
|
||
|
<a name="l470"></a> </span><span class=cF1>return</span><span class=cF0> tmps;
|
||
|
<a name="l471"></a> }
|
||
|
<a name="l472"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l473"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l474"></a>}
|
||
|
<a name="l475"></a>
|
||
|
<a name="l476"></a>Obj *ObjSettheta(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF1>F64</span><span class=cF0> x=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> y=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> theta=</span><span class=cF3>F64_MAX</span><span class=cF0>)
|
||
|
<a name="l477"></a>{
|
||
|
<a name="l478"></a> Obj *tmpo;
|
||
|
<a name="l479"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmpo=ObjFind(x,y,,,,1<<player)</span><span class=cF7>)</span><span class=cF0> && tmpo->flags&OF_ACTIVE &&
|
||
|
<a name="l480"></a> !</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_RETURNING</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l481"></a> </span><span class=cF1>if</span><span class=cF0> (theta==</span><span class=cF3>F64_MAX</span><span class=cF0>)
|
||
|
<a name="l482"></a> theta=</span><span class=cF5>Arg</span><span class=cF0>(x-tmpo->x,y-tmpo->y);
|
||
|
<a name="l483"></a> tmpo->dtheta+=</span><span class=cF5>Wrap</span><span class=cF0>(theta-</span><span class=cF7>(</span><span class=cF0>tmpo->theta+tmpo->dtheta</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF3>pi</span><span class=cF0>);
|
||
|
<a name="l484"></a> </span><span class=cF1>return</span><span class=cF0> tmpo;
|
||
|
<a name="l485"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l486"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l487"></a>}
|
||
|
<a name="l488"></a>
|
||
|
<a name="l489"></a>Squadron *SquadronSettheta(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF1>F64</span><span class=cF0> x=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> y=</span><span class=cF3>F64_MAX</span><span class=cF0>,</span><span class=cF1>F64</span><span class=cF0> theta=</span><span class=cF3>F64_MAX</span><span class=cF0>)
|
||
|
<a name="l490"></a>{
|
||
|
<a name="l491"></a> Squadron *tmps;
|
||
|
<a name="l492"></a> Obj *tmpo;
|
||
|
<a name="l493"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo=ObjSettheta</span><span class=cF7>(</span><span class=cF0>player,x,y,theta</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l494"></a> </span><span class=cF1>if</span><span class=cF0> (player==0) {
|
||
|
<a name="l495"></a> set_theta_unit_x1=tmpo->x;
|
||
|
<a name="l496"></a> set_theta_unit_y1=tmpo->y;
|
||
|
<a name="l497"></a> set_theta_unit_x2=</span><span class=cFB>ms</span><span class=cF0>.pos.x-main_task->pix_left-main_task->scroll_x;
|
||
|
<a name="l498"></a> set_theta_unit_y2=</span><span class=cFB>ms</span><span class=cF0>.pos.y-main_task->pix_top -main_task->scroll_y;
|
||
|
<a name="l499"></a> set_theta_t=</span><span class=cF5>tS</span><span class=cF0>+0.5;
|
||
|
<a name="l500"></a> }
|
||
|
<a name="l501"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->squadron>=0) {
|
||
|
<a name="l502"></a> tmps=&squadrons[tmpo->squadron];
|
||
|
<a name="l503"></a> </span><span class=cF1>if</span><span class=cF0> (tmps->action==SA_FLYING) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l504"></a> tmps->action=SA_SET_theta;
|
||
|
<a name="l505"></a> tmps->theta=tmpo->theta+tmpo->dtheta;
|
||
|
<a name="l506"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l507"></a> </span><span class=cF1>return</span><span class=cF0> tmps;
|
||
|
<a name="l508"></a> }
|
||
|
<a name="l509"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l510"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l511"></a>}
|
||
|
<a name="l512"></a>
|
||
|
<a name="l513"></a></span><span class=cF1>U0</span><span class=cF0> SquadronActions()
|
||
|
<a name="l514"></a>{
|
||
|
<a name="l515"></a> </span><span class=cF9>I64</span><span class=cF0> i,completed_mask;
|
||
|
<a name="l516"></a> Obj *tmpo;
|
||
|
<a name="l517"></a> Squadron *tmps;
|
||
|
<a name="l518"></a> </span><span class=cF1>for</span><span class=cF0> (i=0,tmps=squadrons;i<num_squadrons;i++,tmps++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l519"></a> completed_mask=0;
|
||
|
<a name="l520"></a> </span><span class=cF1>switch</span><span class=cF0> (tmps->action) {
|
||
|
<a name="l521"></a> </span><span class=cF1>case</span><span class=cF0> SA_LAUNCHING:
|
||
|
<a name="l522"></a> ObjLaunch(tmps->player,i,tmps->host,,,tmps->theta);
|
||
|
<a name="l523"></a> tmpo=tmps->next_in_squadron;
|
||
|
<a name="l524"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=tmps) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l525"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&completed_mask,tmpo->member_num,tmpo->flags&OF_ACTIVE);
|
||
|
<a name="l526"></a> tmpo=tmpo->next_in_squadron;
|
||
|
<a name="l527"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l528"></a> </span><span class=cF1>if</span><span class=cF0> (completed_mask|tmps->dead_mask==tmps->total_mask)
|
||
|
<a name="l529"></a> tmps->action=SA_FLYING;
|
||
|
<a name="l530"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l531"></a> </span><span class=cF1>case</span><span class=cF0> SA_FLYING:
|
||
|
<a name="l532"></a> tmpo=tmps->next_in_squadron;
|
||
|
<a name="l533"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=tmps) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l534"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&completed_mask,tmpo->member_num,!</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_ACTIVE</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l535"></a> tmpo=tmpo->next_in_squadron;
|
||
|
<a name="l536"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l537"></a> </span><span class=cF1>if</span><span class=cF0> (completed_mask|tmps->dead_mask==tmps->total_mask)
|
||
|
<a name="l538"></a> tmps->action=SA_PARKED;
|
||
|
<a name="l539"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l540"></a> </span><span class=cF1>case</span><span class=cF0> SA_SET_theta:
|
||
|
<a name="l541"></a> tmpo=tmps->next_in_squadron;
|
||
|
<a name="l542"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=tmps) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l543"></a> tmpo->dtheta+=</span><span class=cF5>Wrap</span><span class=cF0>(tmps->theta-</span><span class=cF7>(</span><span class=cF0>tmpo->theta+tmpo->dtheta</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF3>pi</span><span class=cF0>);
|
||
|
<a name="l544"></a> tmpo=tmpo->next_in_squadron;
|
||
|
<a name="l545"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l546"></a> tmps->action=SA_FLYING;
|
||
|
<a name="l547"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l548"></a> </span><span class=cF1>case</span><span class=cF0> SA_RETURNING:
|
||
|
<a name="l549"></a> tmpo=tmps->next_in_squadron;
|
||
|
<a name="l550"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=tmps) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l551"></a> tmpo->flags|=OF_RETURNING;
|
||
|
<a name="l552"></a> </span><span class=cF5>LBEqu</span><span class=cF0>(&completed_mask,tmpo->member_num,!</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_ACTIVE</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l553"></a> tmpo=tmpo->next_in_squadron;
|
||
|
<a name="l554"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l555"></a> </span><span class=cF1>if</span><span class=cF0> (completed_mask|tmps->dead_mask==tmps->total_mask)
|
||
|
<a name="l556"></a> tmps->action=SA_PARKED;
|
||
|
<a name="l557"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l558"></a> }
|
||
|
<a name="l559"></a> </span><span class=cF1>if</span><span class=cF0> (tmps->dead_mask==tmps->total_mask)
|
||
|
<a name="l560"></a> tmps->action=SA_DEAD;
|
||
|
<a name="l561"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l562"></a>}
|
||
|
<a name="l563"></a>
|
||
|
<a name="l564"></a></span><span class=cF1>U0</span><span class=cF0> AI(</span><span class=cF9>I64</span><span class=cF0> player,</span><span class=cF1>F64</span><span class=cF0> period)
|
||
|
<a name="l565"></a>{
|
||
|
<a name="l566"></a> Obj *tmpo;
|
||
|
<a name="l567"></a> tmpo=obj_head.next;
|
||
|
<a name="l568"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l569"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->player==player) {
|
||
|
<a name="l570"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->type==OT_CARRIER && </span><span class=cF5>Rand</span><span class=cF0><5*period)
|
||
|
<a name="l571"></a> SquadronLaunch(player,tmpo->x,tmpo->y);
|
||
|
<a name="l572"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_ACTIVE && !</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_RETURNING</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l573"></a> </span><span class=cF5>Rand</span><span class=cF0><10.0*period)
|
||
|
<a name="l574"></a> SquadronSettheta(player,tmpo->x,tmpo->y,tmpo->theta+</span><span class=cF3>pi</span><span class=cF0>/2*</span><span class=cF7>(</span><span class=cF5>Rand</span><span class=cF0>-0.5</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l575"></a> }
|
||
|
<a name="l576"></a> tmpo=tmpo->next;
|
||
|
<a name="l577"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l578"></a>}
|
||
|
<a name="l579"></a>
|
||
|
<a name="l580"></a></span><span class=cF1>U0</span><span class=cF0> ShipDamage(Obj *tmpo,</span><span class=cF1>F64</span><span class=cF0> d)
|
||
|
<a name="l581"></a>{
|
||
|
<a name="l582"></a> </span><span class=cF9>I64</span><span class=cF0> i,x=</span><span class=cF5>Rand</span><span class=cF0>*FIRE_WIDTH,y=</span><span class=cF5>Rand</span><span class=cF0>*FIRE_HEIGHT;
|
||
|
<a name="l583"></a> tmpo->life_percent-=d;
|
||
|
<a name="l584"></a> </span><span class=cF1>while</span><span class=cF0> (d>0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l585"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>tmpo->fire,y*FIRE_WIDTH+x</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l586"></a> d-=500.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||
|
<a name="l587"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l588"></a> d-=25.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||
|
<a name="l589"></a> i=</span><span class=cF5>RandI16</span><span class=cF0>&7;
|
||
|
<a name="l590"></a> x+=</span><span class=cFB>gr_x_offsets</span><span class=cF0>[i];
|
||
|
<a name="l591"></a> y+=</span><span class=cFB>gr_y_offsets</span><span class=cF0>[i];
|
||
|
<a name="l592"></a> </span><span class=cF1>while</span><span class=cF0> (x>=FIRE_WIDTH)
|
||
|
<a name="l593"></a> x-=FIRE_WIDTH;
|
||
|
<a name="l594"></a> </span><span class=cF1>while</span><span class=cF0> (x<0)
|
||
|
<a name="l595"></a> x+=FIRE_WIDTH;
|
||
|
<a name="l596"></a> </span><span class=cF1>while</span><span class=cF0> (y>=FIRE_HEIGHT)
|
||
|
<a name="l597"></a> y-=FIRE_HEIGHT;
|
||
|
<a name="l598"></a> </span><span class=cF1>while</span><span class=cF0> (y<0)
|
||
|
<a name="l599"></a> y+=FIRE_HEIGHT;
|
||
|
<a name="l600"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l601"></a>}
|
||
|
<a name="l602"></a>
|
||
|
<a name="l603"></a></span><span class=cF1>U0</span><span class=cF0> ShipFix(Obj *tmpo,</span><span class=cF1>F64</span><span class=cF0> d)
|
||
|
<a name="l604"></a>{
|
||
|
<a name="l605"></a> tmpo->life_percent+=d;
|
||
|
<a name="l606"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->life_percent>=100.0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l607"></a> tmpo->life_percent=100.0;
|
||
|
<a name="l608"></a> </span><span class=cF5>MemSet</span><span class=cF0>(tmpo->fire,0,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>Obj.fire</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l609"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l610"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l611"></a> </span><span class=cF1>while</span><span class=cF0> (d>0)
|
||
|
<a name="l612"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Btr</span><span class=cF7>(</span><span class=cF0>tmpo->fire,FIRE_WIDTH*FIRE_HEIGHT*</span><span class=cF5>Rand</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l613"></a> d-=400.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||
|
<a name="l614"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l615"></a> d-=20.0/(FIRE_WIDTH*FIRE_HEIGHT);
|
||
|
<a name="l616"></a>}
|
||
|
<a name="l617"></a>
|
||
|
<a name="l618"></a></span><span class=cF1>U0</span><span class=cF0> Combat(</span><span class=cF1>F64</span><span class=cF0> period)
|
||
|
<a name="l619"></a>{
|
||
|
<a name="l620"></a> </span><span class=cF1>F64</span><span class=cF0> d;
|
||
|
<a name="l621"></a> Obj *tmpo,*tmpo1;
|
||
|
<a name="l622"></a> Torpedo *tmpt;
|
||
|
<a name="l623"></a> tmpo=obj_head.next;
|
||
|
<a name="l624"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l625"></a> tmpo->flags&=~OF_SHOOTING;
|
||
|
<a name="l626"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_ACTIVE &&
|
||
|
<a name="l627"></a> </span><span class=cF7>(</span><span class=cF0>tmpo1=ObjFind(tmpo->x,tmpo->y,OF_ACTIVE,OF_ACTIVE,,
|
||
|
<a name="l628"></a> 1<<</span><span class=cF7>(</span><span class=cF0>tmpo->player^1</span><span class=cF7>)</span><span class=cF0>,&d)</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l629"></a> tmpo->target_x=tmpo1->x;
|
||
|
<a name="l630"></a> tmpo->target_y=tmpo1->y;
|
||
|
<a name="l631"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo1->flags&OF_SHIP) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l632"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->torpedos && d<tmpo->torpedos_range && </span><span class=cF5>Rand</span><span class=cF0><125*period) {
|
||
|
<a name="l633"></a> tmpo->torpedos--;
|
||
|
<a name="l634"></a> tmpt=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>Torpedo</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l635"></a> tmpt->x=tmpo->x;
|
||
|
<a name="l636"></a> tmpt->y=tmpo->y;
|
||
|
<a name="l637"></a> tmpt->speed=100;
|
||
|
<a name="l638"></a> d/=tmpt->speed*(GAME_SPEED_SCALE*game_speed);
|
||
|
<a name="l639"></a> tmpo1->death_time=tmpt->timeout=</span><span class=cF5>tS</span><span class=cF0>+d;
|
||
|
<a name="l640"></a> tmpt->target=tmpo1;
|
||
|
<a name="l641"></a> tmpt->theta=</span><span class=cF5>Arg</span><span class=cF0>(tmpo1->x-tmpo->x,tmpo1->y-tmpo->y);
|
||
|
<a name="l642"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpt,torpedo_head.last);
|
||
|
<a name="l643"></a> </span><span class=cF5>Sweep</span><span class=cF0>(2000,86,53);
|
||
|
<a name="l644"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpo->ship_guns>0 && d<tmpo->ship_guns_range) {
|
||
|
<a name="l645"></a> tmpo->flags|=OF_SHOOTING;
|
||
|
<a name="l646"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Rand</span><span class=cF0><125.0*period) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l647"></a> ShipDamage(tmpo1,tmpo->ship_guns*</span><span class=cF5>Rand</span><span class=cF0>*period);
|
||
|
<a name="l648"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Rand</span><span class=cF0><10.0*period)
|
||
|
<a name="l649"></a> tmpo1->fuel*=0.75*</span><span class=cF5>Rand</span><span class=cF0>+0.25;
|
||
|
<a name="l650"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l651"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>tS</span><span class=cF0>>next_noise) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l652"></a> </span><span class=cF5>Noise</span><span class=cF0>(100,29,46);
|
||
|
<a name="l653"></a> next_noise=</span><span class=cF5>tS</span><span class=cF0>+0.1;
|
||
|
<a name="l654"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l655"></a> }
|
||
|
<a name="l656"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l657"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->air_guns>0 && d<tmpo->air_guns_range) {
|
||
|
<a name="l658"></a> tmpo->flags|=OF_SHOOTING;
|
||
|
<a name="l659"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Rand</span><span class=cF0><125.0*period) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l660"></a> tmpo1->life_percent-=tmpo->air_guns*</span><span class=cF5>Rand</span><span class=cF0>*period;
|
||
|
<a name="l661"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Rand</span><span class=cF0><10.0*period)
|
||
|
<a name="l662"></a> tmpo1->fuel*=0.75*</span><span class=cF5>Rand</span><span class=cF0>+0.25;
|
||
|
<a name="l663"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l664"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>tS</span><span class=cF0>>next_noise) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l665"></a> </span><span class=cF5>Noise</span><span class=cF0>(25,62,86);
|
||
|
<a name="l666"></a> next_noise=</span><span class=cF5>tS</span><span class=cF0>+0.025;
|
||
|
<a name="l667"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l668"></a> }
|
||
|
<a name="l669"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l670"></a> }
|
||
|
<a name="l671"></a> tmpo=tmpo->next;
|
||
|
<a name="l672"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l673"></a> tmpo=obj_head.next;
|
||
|
<a name="l674"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l675"></a> tmpo1=tmpo->next;
|
||
|
<a name="l676"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->type==OT_FIGHTER &&
|
||
|
<a name="l677"></a> </span><span class=cF7>(</span><span class=cF0>tmpo->life_percent<=0.0 || tmpo->flags&OF_ACTIVE &&
|
||
|
<a name="l678"></a> tmpo->fuel<=0.0 || tmpo->host &&
|
||
|
<a name="l679"></a> !(tmpo->flags&OF_ACTIVE) && tmpo->host->life_percent<=0.0</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l680"></a> ObjDel(tmpo);
|
||
|
<a name="l681"></a> tmpo=tmpo1;
|
||
|
<a name="l682"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l683"></a> tmpo=obj_head.next;
|
||
|
<a name="l684"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l685"></a> tmpo1=tmpo->next;
|
||
|
<a name="l686"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->life_percent<=0.0)
|
||
|
<a name="l687"></a> ObjDel(tmpo);
|
||
|
<a name="l688"></a> tmpo=tmpo1;
|
||
|
<a name="l689"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l690"></a>}
|
||
|
<a name="l691"></a>
|
||
|
<a name="l692"></a>#</span><span class=cF1>define</span><span class=cF0> ANIMATE_FREQ 50
|
||
|
<a name="l693"></a></span><span class=cF1>U0</span><span class=cF0> AnimateTask(</span><span class=cF9>I64</span><span class=cF0>)
|
||
|
<a name="l694"></a>{
|
||
|
<a name="l695"></a> Obj *tmpo;
|
||
|
<a name="l696"></a> Torpedo *tmpt,*tmpt1;
|
||
|
<a name="l697"></a> </span><span class=cF1>F64</span><span class=cF0> d,period;
|
||
|
<a name="l698"></a>
|
||
|
<a name="l699"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l700"></a> period=GAME_SPEED_SCALE*game_speed/ANIMATE_FREQ;
|
||
|
<a name="l701"></a> SquadronActions;
|
||
|
<a name="l702"></a>
|
||
|
<a name="l703"></a> tmpo=obj_head.next;
|
||
|
<a name="l704"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) {
|
||
|
<a name="l705"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_ACTIVE && tmpo->fuel>0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l706"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->dtheta) {
|
||
|
<a name="l707"></a> d=tmpo->dtheta;
|
||
|
<a name="l708"></a> </span><span class=cF1>if</span><span class=cF0> (d> tmpo->turn_rate*period) d= tmpo->turn_rate*period;
|
||
|
<a name="l709"></a> </span><span class=cF1>if</span><span class=cF0> (d<-tmpo->turn_rate*period) d=-tmpo->turn_rate*period;
|
||
|
<a name="l710"></a> tmpo->theta +=d;
|
||
|
<a name="l711"></a> tmpo->dtheta-=d;
|
||
|
<a name="l712"></a> }
|
||
|
<a name="l713"></a> tmpo->x+=tmpo->speed*</span><span class=cF5>Cos</span><span class=cF0>(tmpo->theta)*period*tmpo->life_percent/100.0;
|
||
|
<a name="l714"></a> tmpo->y+=tmpo->speed*</span><span class=cF5>Sin</span><span class=cF0>(tmpo->theta)*period*tmpo->life_percent/100.0;
|
||
|
<a name="l715"></a> tmpo->fuel-=tmpo->speed*tmpo->fuel_burn_rate*period;
|
||
|
<a name="l716"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l717"></a> tmpo=tmpo->next;
|
||
|
<a name="l718"></a> }
|
||
|
<a name="l719"></a>
|
||
|
<a name="l720"></a> tmpt=torpedo_head.next;
|
||
|
<a name="l721"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt!=&torpedo_head) {
|
||
|
<a name="l722"></a> tmpt1=tmpt->next;
|
||
|
<a name="l723"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>tS</span><span class=cF0>>tmpt->timeout) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l724"></a> tmpo=tmpt->target;
|
||
|
<a name="l725"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Rand</span><span class=cF0><0.333333) {
|
||
|
<a name="l726"></a> ShipDamage(tmpo,150*</span><span class=cF5>Rand</span><span class=cF0>*</span><span class=cF5>Rand</span><span class=cF0>);
|
||
|
<a name="l727"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Rand</span><span class=cF0><0.333333)
|
||
|
<a name="l728"></a> tmpo->fuel*=0.75*</span><span class=cF5>Rand</span><span class=cF0>+0.25;
|
||
|
<a name="l729"></a> }
|
||
|
<a name="l730"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpt);
|
||
|
<a name="l731"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpt);
|
||
|
<a name="l732"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l733"></a> tmpt->x+=tmpt->speed*</span><span class=cF5>Cos</span><span class=cF0>(tmpt->theta)*period;
|
||
|
<a name="l734"></a> tmpt->y+=tmpt->speed*</span><span class=cF5>Sin</span><span class=cF0>(tmpt->theta)*period;
|
||
|
<a name="l735"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l736"></a> tmpt=tmpt1;
|
||
|
<a name="l737"></a> }
|
||
|
<a name="l738"></a>
|
||
|
<a name="l739"></a> tmpo=obj_head.next;
|
||
|
<a name="l740"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) {
|
||
|
<a name="l741"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->host && !</span><span class=cF7>(</span><span class=cF0>tmpo->flags&OF_ACTIVE</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l742"></a> tmpo->x=tmpo->host->x;
|
||
|
<a name="l743"></a> tmpo->y=tmpo->host->y;
|
||
|
<a name="l744"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l745"></a> tmpo=tmpo->next;
|
||
|
<a name="l746"></a> }
|
||
|
<a name="l747"></a>
|
||
|
<a name="l748"></a> tmpo=obj_head.next;
|
||
|
<a name="l749"></a> </span><span class=cF1>while</span><span class=cF0> (tmpo!=&obj_head) {
|
||
|
<a name="l750"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_ACTIVE) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l751"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->host) {
|
||
|
<a name="l752"></a> d=</span><span class=cF5>Sqrt</span><span class=cF0>(</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>tmpo->x-tmpo->host->x</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>tmpo->y-tmpo->host->y</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l753"></a> </span><span class=cF1>if</span><span class=cF0> (d<8 && tmpo->max_fuel-tmpo->fuel>30) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l754"></a> tmpo->life_percent=100.0;
|
||
|
<a name="l755"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->host->fuel>0) {
|
||
|
<a name="l756"></a> d=tmpo->max_fuel-tmpo->fuel;
|
||
|
<a name="l757"></a> </span><span class=cF1>if</span><span class=cF0> (d>tmpo->host->fuel) d=tmpo->host->fuel;
|
||
|
<a name="l758"></a> tmpo->host->fuel-=d;
|
||
|
<a name="l759"></a> tmpo->fuel+=d;
|
||
|
<a name="l760"></a> }
|
||
|
<a name="l761"></a> tmpo->torpedos=tmpo->max_torpedos;
|
||
|
<a name="l762"></a> tmpo->x=tmpo->host->x;
|
||
|
<a name="l763"></a> tmpo->y=tmpo->host->y;
|
||
|
<a name="l764"></a> tmpo->flags&=~OF_ACTIVE;
|
||
|
<a name="l765"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (d>tmpo->fuel-250)
|
||
|
<a name="l766"></a> tmpo->flags|=OF_RETURNING;
|
||
|
<a name="l767"></a> </span><span class=cF1>if</span><span class=cF0> (tmpo->flags&OF_RETURNING)
|
||
|
<a name="l768"></a> tmpo->dtheta+=</span><span class=cF5>Wrap</span><span class=cF0>(</span><span class=cF5>Arg</span><span class=cF7>(</span><span class=cF0>tmpo->host->x-tmpo->x,
|
||
|
<a name="l769"></a> tmpo->host->y-tmpo->y</span><span class=cF7>)</span><span class=cF0>-</span><span class=cF7>(</span><span class=cF0>tmpo->theta+tmpo->dtheta</span><span class=cF7>)</span><span class=cF0>,-</span><span class=cF3>pi</span><span class=cF0>);
|
||
|
<a name="l770"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpo->type==OT_CARRIER)
|
||
|
<a name="l771"></a> ShipFix(tmpo,2.5*period);
|
||
|
<a name="l772"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l773"></a> tmpo=tmpo->next;
|
||
|
<a name="l774"></a> }
|
||
|
<a name="l775"></a>
|
||
|
<a name="l776"></a> AI(1,period);
|
||
|
<a name="l777"></a> Combat(period);
|
||
|
<a name="l778"></a> </span><span class=cF5>Sleep</span><span class=cF0>(1000/ANIMATE_FREQ);
|
||
|
<a name="l779"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l780"></a>}
|
||
|
<a name="l781"></a>
|
||
|
<a name="l782"></a></span><span class=cF1>U0</span><span class=cF0> FlatTops()
|
||
|
<a name="l783"></a>{
|
||
|
<a name="l784"></a> </span><span class=cF9>I64</span><span class=cF0> arg1,arg2;
|
||
|
<a name="l785"></a>
|
||
|
<a name="l786"></a> </span><span class=cF5>SettingsPush</span><span class=cF0>; </span><span class=cF2>//See </span><a href="/Wb/Adam/TaskSettings.HC.HTML#l3"><span class=cF4>SettingsPush</span></a><span class=cF0>
|
||
|
<a name="l787"></a> </span><span class=cF5>Fs</span><span class=cF0>->text_attr=</span><span class=cF3>BLUE</span><span class=cF0><<4+</span><span class=cF3>WHITE</span><span class=cF0>;
|
||
|
<a name="l788"></a> </span><span class=cF5>AutoComplete</span><span class=cF0>;
|
||
|
<a name="l789"></a> </span><span class=cF5>WinBorder</span><span class=cF0>;
|
||
|
<a name="l790"></a> </span><span class=cF5>WinMax</span><span class=cF0>;
|
||
|
<a name="l791"></a> </span><span class=cF5>DocCursor</span><span class=cF0>;
|
||
|
<a name="l792"></a> </span><span class=cF5>DocClear</span><span class=cF0>;
|
||
|
<a name="l793"></a> </span><span class=cF5>PopUpOk</span><span class=cF0>(</span><span class=cF6>"$GREEN${Left-Mouse}$FG$\t\tChange Course\n"</span><span class=cF0>
|
||
|
<a name="l794"></a> </span><span class=cF6>"$GREEN${Right-Mouse}$FG$\t\tLaunch Squadron\n"</span><span class=cF0>
|
||
|
<a name="l795"></a> </span><span class=cF6>"$GREEN${Right-Double-Mouse}$FG$\tReturn Squadron\n"</span><span class=cF0>
|
||
|
<a name="l796"></a> </span><span class=cF6>"$GREEN${Ctrl-Left Grab}$FG$\tScroll Scrn\n"</span><span class=cF0>);
|
||
|
<a name="l797"></a> </span><span class=cF5>MenuPush</span><span class=cF0>(
|
||
|
<a name="l798"></a> </span><span class=cF6>"File {"</span><span class=cF0>
|
||
|
<a name="l799"></a> </span><span class=cF6>" Abort(,CH_SHIFT_ESC);"</span><span class=cF0>
|
||
|
<a name="l800"></a> </span><span class=cF6>" Exit(,CH_ESC);"</span><span class=cF0>
|
||
|
<a name="l801"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l802"></a> </span><span class=cF6>"Play {"</span><span class=cF0>
|
||
|
<a name="l803"></a> </span><span class=cF6>" Restart(,'\n');"</span><span class=cF0>
|
||
|
<a name="l804"></a> </span><span class=cF6>" Faster(,'+');"</span><span class=cF0>
|
||
|
<a name="l805"></a> </span><span class=cF6>" Slower(,'-');"</span><span class=cF0>
|
||
|
<a name="l806"></a> </span><span class=cF6>"}"</span><span class=cF0>
|
||
|
<a name="l807"></a> );
|
||
|
<a name="l808"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_inhibit|=</span><span class=cF3>WIF_SELF_MS_L</span><span class=cF0>|</span><span class=cF3>WIF_SELF_MS_R</span><span class=cF0>;
|
||
|
<a name="l809"></a> Init;
|
||
|
<a name="l810"></a> </span><span class=cF5>Fs</span><span class=cF0>->draw_it=&</span><span class=cF5>DrawIt</span><span class=cF0>;
|
||
|
<a name="l811"></a> </span><span class=cF5>Fs</span><span class=cF0>->animate_task=</span><span class=cF5>Spawn</span><span class=cF0>(&AnimateTask,</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF6>"Animate"</span><span class=cF0>,,</span><span class=cF5>Fs</span><span class=cF0>);
|
||
|
<a name="l812"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l813"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
||
|
<a name="l814"></a> </span><span class=cF1>switch</span><span class=cF0> (</span><span class=cF5>GetMsg</span><span class=cF7>(</span><span class=cF0>&arg1,&arg2,
|
||
|
<a name="l815"></a> 1<<</span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>|1<<</span><span class=cF3>MSG_MS_R_D_UP</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l816"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_KEY_DOWN</span><span class=cF0>:
|
||
|
<a name="l817"></a> </span><span class=cF1>switch</span><span class=cF0> (arg1) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l818"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'\n'</span><span class=cF0>:
|
||
|
<a name="l819"></a> CleanUp;
|
||
|
<a name="l820"></a> Init;
|
||
|
<a name="l821"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l822"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_ESC</span><span class=cF0>:
|
||
|
<a name="l823"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>CH_SHIFT_ESC</span><span class=cF0>:
|
||
|
<a name="l824"></a> </span><span class=cF1>goto</span><span class=cF0> nv_done;
|
||
|
<a name="l825"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'+'</span><span class=cF0>:
|
||
|
<a name="l826"></a> game_speed*=1.5;
|
||
|
<a name="l827"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l828"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF6>'-'</span><span class=cF0>:
|
||
|
<a name="l829"></a> game_speed/=1.5;
|
||
|
<a name="l830"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l831"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l832"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l833"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_L_UP</span><span class=cF0>:
|
||
|
<a name="l834"></a> SquadronSettheta(0,arg1,arg2);
|
||
|
<a name="l835"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l836"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_R_UP</span><span class=cF0>:
|
||
|
<a name="l837"></a> SquadronLaunch(0,arg1,arg2);
|
||
|
<a name="l838"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l839"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MSG_MS_R_D_UP</span><span class=cF0>:
|
||
|
<a name="l840"></a> SquadronReturn(0,arg1,arg2);
|
||
|
<a name="l841"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l842"></a> }
|
||
|
<a name="l843"></a>nv_done:
|
||
|
<a name="l844"></a> </span><span class=cF5>GetMsg</span><span class=cF0>(,,1<<</span><span class=cF3>MSG_KEY_UP</span><span class=cF0>);
|
||
|
<a name="l845"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0>
|
||
|
<a name="l846"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
||
|
<a name="l847"></a> </span><span class=cF5>SettingsPop</span><span class=cF0>;
|
||
|
<a name="l848"></a> CleanUp;
|
||
|
<a name="l849"></a> </span><span class=cF5>MenuPop</span><span class=cF0>;
|
||
|
<a name="l850"></a>}
|
||
|
<a name="l851"></a>
|
||
|
<a name="l852"></a>FlatTops;
|
||
|
<a name="l853"></a>
|
||
|
<a name="l854"></a>
|
||
|
<a name="l855"></a>
|
||
|
<a name="l856"></a>
|
||
|
<a name="l857"></a>
|
||
|
<a name="l858"></a>
|
||
|
<a name="l859"></a>
|
||
|
<a name="l860"></a>
|
||
|
<a name="l861"></a>
|
||
|
<a name="l862"></a>
|
||
|
<a name="l863"></a>
|
||
|
<a name="l864"></a>
|
||
|
<a name="l865"></a>
|
||
|
<a name="l866"></a>
|
||
|
<a name="l867"></a>
|
||
|
<a name="l868"></a>
|
||
|
<a name="l869"></a>
|
||
|
<a name="l870"></a></span><span class=cF2>//Maybe use this in the future</span><span class=cF0> </span><span class=cFA><7>/* Graphics Not Rendered in HTML */</span><span class=cF0>
|
||
|
<a name="l871"></a>
|
||
|
<a name="l872"></a>
|
||
|
<a name="l873"></a>
|
||
|
<a name="l874"></a>
|
||
|
<a name="l875"></a>
|
||
|
<a name="l876"></a>
|
||
|
<a name="l877"></a>
|
||
|
<a name="l878"></a>
|
||
|
<a name="l879"></a>
|
||
|
<a name="l880"></a>
|
||
|
<a name="l881"></a>
|
||
|
<a name="l882"></a>
|
||
|
<a name="l883"></a>
|
||
|
<a name="l884"></a>
|
||
|
<a name="l885"></a>
|
||
|
<a name="l886"></a>
|
||
|
</span></pre></body>
|
||
|
</html>
|