310 lines
26 KiB
Plaintext
310 lines
26 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">
|
||
|
.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=cF1>U0</span><span class=cF0> AttackHeader(Unit *tmpu,</span><span class=cF1>U8</span><span class=cF0> *st,Unit *target)
|
||
|
<a name="l2"></a>{
|
||
|
<a name="l3"></a> </span><span class=cF9>I64</span><span class=cF0> i=9+</span><span class=cF5>StrLen</span><span class=cF0>(st);
|
||
|
<a name="l4"></a> </span><span class=cF1>if</span><span class=cF0> (target) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l5"></a> i+=9;
|
||
|
<a name="l6"></a> </span><span class=cF1>if</span><span class=cF0> (target->armor)
|
||
|
<a name="l7"></a> i+=8;
|
||
|
<a name="l8"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l9"></a> i+=10;
|
||
|
<a name="l10"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l11"></a> </span><span class=cF6>'\n\n'</span><span class=cF0>;
|
||
|
<a name="l12"></a> </span><span class=cF6>"$BLACK$%h*c$FG$\n"</span><span class=cF0>,i,</span><span class=cF6>'-'</span><span class=cF0>;
|
||
|
<a name="l13"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->player)
|
||
|
<a name="l14"></a> </span><span class=cF6>"$PURPLE$Player 2$FG$ "</span><span class=cF0>;
|
||
|
<a name="l15"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l16"></a> </span><span class=cF6>"$CYAN$Player 1$FG$ "</span><span class=cF0>;
|
||
|
<a name="l17"></a> </span><span class=cF6>"%s"</span><span class=cF0>,st;
|
||
|
<a name="l18"></a> </span><span class=cF1>if</span><span class=cF0> (target) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (target->player)
|
||
|
<a name="l20"></a> </span><span class=cF6>" $PURPLE$Player 2"</span><span class=cF0>;
|
||
|
<a name="l21"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l22"></a> </span><span class=cF6>" $CYAN$Player 1"</span><span class=cF0>;
|
||
|
<a name="l23"></a> </span><span class=cF1>if</span><span class=cF0> (target->armor)
|
||
|
<a name="l24"></a> </span><span class=cF6>" Armored"</span><span class=cF0>;
|
||
|
<a name="l25"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l26"></a> </span><span class=cF6>" Unarmored"</span><span class=cF0>;
|
||
|
<a name="l27"></a> </span><span class=cF6>'$FG$'</span><span class=cF0>;
|
||
|
<a name="l28"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l29"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l30"></a> </span><span class=cF6>"$BLACK$%h*c$FG$\n"</span><span class=cF0>,i,</span><span class=cF6>'-'</span><span class=cF0>;
|
||
|
<a name="l31"></a>}
|
||
|
<a name="l32"></a>
|
||
|
<a name="l33"></a></span><span class=cF1>F64</span><span class=cF0> HitDamage(Unit *tmpu,Unit *target,</span><span class=cF9>I64</span><span class=cF0> facing=1,</span><span class=cF1>F64</span><span class=cF0> range_factor=0)
|
||
|
<a name="l34"></a>{
|
||
|
<a name="l35"></a> </span><span class=cF1>F64</span><span class=cF0> d,res=200.0*</span><span class=cF5>Rand</span><span class=cF0>;
|
||
|
<a name="l36"></a> </span><span class=cF6>"\nRoll Out of 200\t\t:%6.2f Damage\n"</span><span class=cF0>,res;
|
||
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (target->armor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l38"></a> d=target->armor/100.0*(5-facing)/5.0;
|
||
|
<a name="l39"></a> </span><span class=cF1>if</span><span class=cF0> (d>=0) {
|
||
|
<a name="l40"></a> </span><span class=cF6>"Armor Attack\t\t:%6.2f\n"</span><span class=cF0>,</span><span class=cF5>ToF64</span><span class=cF0>(tmpu->armored_attack);
|
||
|
<a name="l41"></a> res*=(tmpu->armored_attack/100.0)/d;
|
||
|
<a name="l42"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l43"></a> res=0;
|
||
|
<a name="l44"></a> </span><span class=cF6>"Armor(%z) Defense\t:%6.2f\n"</span><span class=cF0>,facing,
|
||
|
<a name="l45"></a> </span><span class=cF6>"Front\0FrontSide\0RearSide\0Rear\0"</span><span class=cF0>,100*d;
|
||
|
<a name="l46"></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="l47"></a> d=1.0-range_factor;
|
||
|
<a name="l48"></a> </span><span class=cF1>if</span><span class=cF0> (d>0) {
|
||
|
<a name="l49"></a> </span><span class=cF6>"Unarmored Attack\t:%6.2f\n"</span><span class=cF0>,</span><span class=cF5>ToF64</span><span class=cF0>(tmpu->unarmored_attack);
|
||
|
<a name="l50"></a> </span><span class=cF6>"Range Adjust\t\t:%6.2f%%\n"</span><span class=cF0>,100*d;
|
||
|
<a name="l51"></a> res*=(tmpu->unarmored_attack/100.0)*d;
|
||
|
<a name="l52"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l53"></a> res=0;
|
||
|
<a name="l54"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l55"></a> </span><span class=cF6>"Attack/Defense Adjusted\t:%6.2f Damage\n"</span><span class=cF0>,res;
|
||
|
<a name="l56"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Round</span><span class=cF0>(res);
|
||
|
<a name="l57"></a>}
|
||
|
<a name="l58"></a>
|
||
|
<a name="l59"></a></span><span class=cF1>Bool</span><span class=cF0> DamageDo(Unit *target,</span><span class=cF1>F64</span><span class=cF0> damage)
|
||
|
<a name="l60"></a>{
|
||
|
<a name="l61"></a> </span><span class=cF1>if</span><span class=cF0> (damage>0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (target->armor)
|
||
|
<a name="l63"></a> </span><span class=cF6>"Armor Hit Score %6.2f\t:"</span><span class=cF0>,damage;
|
||
|
<a name="l64"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l65"></a> </span><span class=cF6>"%3d Life - %3f Damage\t="</span><span class=cF0>,target->life,damage;
|
||
|
<a name="l66"></a> </span><span class=cF1>if</span><span class=cF0> (damage>=target->life) {
|
||
|
<a name="l67"></a> </span><span class=cF6>"$RED$Killed$FG$\n"</span><span class=cF0>;
|
||
|
<a name="l68"></a> </span><span class=cF5>Noise</span><span class=cF0>(1000*animation_delay,74,98);
|
||
|
<a name="l69"></a> </span><span class=cF5>Sleep</span><span class=cF0>(1000*animation_delay);
|
||
|
<a name="l70"></a> target->life=0;
|
||
|
<a name="l71"></a> VisRecalc(VR_FRIENDLY_UNIT_DIED,target);
|
||
|
<a name="l72"></a> alive_cnt[target->player]--;
|
||
|
<a name="l73"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l74"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (target->armor) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l76"></a> </span><span class=cF1>if</span><span class=cF0> (damage>0.6*target->life) {
|
||
|
<a name="l77"></a> target->movement=0;
|
||
|
<a name="l78"></a> </span><span class=cF6>"$RED$Immobilized$FG$\n"</span><span class=cF0>;
|
||
|
<a name="l79"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l80"></a> </span><span class=cF6>"$GREEN$No Penetration$FG$\n"</span><span class=cF0>;
|
||
|
<a name="l81"></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="l82"></a> target->life-=damage;
|
||
|
<a name="l83"></a> </span><span class=cF6>"$RED$%6.2f Life$FG$\n"</span><span class=cF0>,</span><span class=cF5>ToF64</span><span class=cF0>(target->life);
|
||
|
<a name="l84"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l85"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l86"></a> }
|
||
|
<a name="l87"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l88"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l89"></a>}
|
||
|
<a name="l90"></a>
|
||
|
<a name="l91"></a></span><span class=cF1>U0</span><span class=cF0> IndirectAdd(Unit *tmpu,</span><span class=cF9>I64</span><span class=cF0> row,</span><span class=cF9>I64</span><span class=cF0> col)
|
||
|
<a name="l92"></a>{
|
||
|
<a name="l93"></a> IndirectOrders *tmpi;
|
||
|
<a name="l94"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->life<=0 || tmpu->range<=0)
|
||
|
<a name="l95"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l96"></a> tmpu->fired=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l97"></a> tmpi=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>IndirectOrders</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l98"></a> tmpi->attacker=tmpu;
|
||
|
<a name="l99"></a> tmpi->row=row;
|
||
|
<a name="l100"></a> tmpi->col=col;
|
||
|
<a name="l101"></a> </span><span class=cF5>QueIns</span><span class=cF0>(tmpi,indirect_head.last);
|
||
|
<a name="l102"></a>}
|
||
|
<a name="l103"></a>
|
||
|
<a name="l104"></a></span><span class=cF1>Bool</span><span class=cF0> BulletPlot(</span><span class=cF1>U0</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> x,</span><span class=cF9>I64</span><span class=cF0> y,</span><span class=cF9>I64</span><span class=cF0>)
|
||
|
<a name="l105"></a>{
|
||
|
<a name="l106"></a> fire_x=x; fire_y=y;
|
||
|
<a name="l107"></a> firing=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l108"></a> </span><span class=cF5>Sleep</span><span class=cF0>(3*animation_delay);
|
||
|
<a name="l109"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l110"></a>}
|
||
|
<a name="l111"></a>
|
||
|
<a name="l112"></a></span><span class=cF1>U0</span><span class=cF0> UnitDirectFire(Unit *tmpu,Unit *target)
|
||
|
<a name="l113"></a>{
|
||
|
<a name="l114"></a> </span><span class=cF9>I64</span><span class=cF0> r,c,facing,
|
||
|
<a name="l115"></a> t1=terrain[tmpu->row][tmpu->col],t2=terrain[target->row][target->col];
|
||
|
<a name="l116"></a> </span><span class=cF1>F64</span><span class=cF0> x1,y1,x2,y2,d,a,range_factor;
|
||
|
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->life<=0 || target->life<=0 || tmpu->range<=0)
|
||
|
<a name="l118"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l119"></a> AttackHeader(tmpu,</span><span class=cF6>"DirectFire"</span><span class=cF0>,target);
|
||
|
<a name="l120"></a> RowCol2XY(&x1,&y1,tmpu->row,tmpu->col);
|
||
|
<a name="l121"></a> RowCol2XY(&x2,&y2,target->row,target->col);
|
||
|
<a name="l122"></a> d=100*</span><span class=cF5>Rand</span><span class=cF0>;
|
||
|
<a name="l123"></a> </span><span class=cF6>"+%5.2f Roll\n"</span><span class=cF0>,d;
|
||
|
<a name="l124"></a> d+=tmpu->accuracy;
|
||
|
<a name="l125"></a> </span><span class=cF6>"+%2d.00 Accuracy\n"</span><span class=cF0>,tmpu->accuracy;
|
||
|
<a name="l126"></a>
|
||
|
<a name="l127"></a> range_factor=</span><span class=cF5>Sqrt</span><span class=cF0>(</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>x2-x1</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>y2-y1</span><span class=cF7>)</span><span class=cF0>)/(tmpu->range*2*DSIN);
|
||
|
<a name="l128"></a> </span><span class=cF6>"-%5.2f%% of Range\n"</span><span class=cF0>,100*range_factor;
|
||
|
<a name="l129"></a> d-=100*range_factor;
|
||
|
<a name="l130"></a> </span><span class=cF1>if</span><span class=cF0> (t2==TREES) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l131"></a> </span><span class=cF6>"-30.00 Target in Trees Penalty\n"</span><span class=cF0>;
|
||
|
<a name="l132"></a> d-=30;
|
||
|
<a name="l133"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l134"></a> </span><span class=cF1>if</span><span class=cF0> (t1==MOUNTAINS && t2!=MOUNTAINS) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l135"></a> </span><span class=cF6>"+30.00 High Ground Bonus\n"</span><span class=cF0>;
|
||
|
<a name="l136"></a> d+=30;
|
||
|
<a name="l137"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l138"></a> </span><span class=cF6>"_______\n"</span><span class=cF0>;
|
||
|
<a name="l139"></a> target_unit=target;
|
||
|
<a name="l140"></a> </span><span class=cF1>if</span><span class=cF0> (d>=0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l141"></a> </span><span class=cF6>"+%5.2f Hit\n"</span><span class=cF0>,d;
|
||
|
<a name="l142"></a> target_hit=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l143"></a> </span><span class=cF5>Noise</span><span class=cF0>(500*animation_delay,34,41);
|
||
|
<a name="l144"></a> </span><span class=cF5>Sleep</span><span class=cF0>(500*animation_delay);
|
||
|
<a name="l145"></a> </span><span class=cF5>Line</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,x1,y1,0,x2,y2,0,&BulletPlot);
|
||
|
<a name="l146"></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="l147"></a> </span><span class=cF6>"-%5.2f Miss\n"</span><span class=cF0>,-d;
|
||
|
<a name="l148"></a> target_hit=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l149"></a> </span><span class=cF5>Noise</span><span class=cF0>(1000*animation_delay,69,74);
|
||
|
<a name="l150"></a> </span><span class=cF5>Sleep</span><span class=cF0>(1000*animation_delay);
|
||
|
<a name="l151"></a> a=</span><span class=cF3>pi</span><span class=cF0>*2*</span><span class=cF5>Rand</span><span class=cF0>;
|
||
|
<a name="l152"></a> d=(0.5-d/100)*HEX_SIDE;
|
||
|
<a name="l153"></a> </span><span class=cF5>Line</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,x1,y1,0,x2+d*</span><span class=cF5>Cos</span><span class=cF7>(</span><span class=cF0>a</span><span class=cF7>)</span><span class=cF0>,y2+d*</span><span class=cF5>Sin</span><span class=cF7>(</span><span class=cF0>a</span><span class=cF7>)</span><span class=cF0>,0,&BulletPlot);
|
||
|
<a name="l154"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l155"></a> firing=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l156"></a> tmpu->fired=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l157"></a> </span><span class=cF1>if</span><span class=cF0> (target_hit) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l158"></a> r=target->row;c=target->col;
|
||
|
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>facing=HexMoveOne(&r,&c,x1,y1)</span><span class=cF7>)</span><span class=cF0>>=0)
|
||
|
<a name="l160"></a> facing=FacingChg(facing,target->facing);
|
||
|
<a name="l161"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l162"></a> facing=0;
|
||
|
<a name="l163"></a> DamageDo(target,HitDamage</span><span class=cF7>(</span><span class=cF0>tmpu,target,facing,range_factor</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l164"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l165"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>scrncast</span><span class=cF0>.ona) </span><span class=cF2>//see </span><a href="/Wb/Kernel/KMisc.HC.HTML#l179"><span class=cF4>Snd</span></a><span class=cF2>()</span><span class=cF0>
|
||
|
<a name="l166"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l167"></a> target_unit=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l168"></a>}
|
||
|
<a name="l169"></a>
|
||
|
<a name="l170"></a></span><span class=cF1>Bool</span><span class=cF0> HexOccupy(</span><span class=cF1>Bool</span><span class=cF0> overrun,Unit *tmpu,Unit *target)
|
||
|
<a name="l171"></a>{
|
||
|
<a name="l172"></a> </span><span class=cF9>I64</span><span class=cF0> t2=terrain[target->row][target->col];
|
||
|
<a name="l173"></a> </span><span class=cF1>F64</span><span class=cF0> damage;
|
||
|
<a name="l174"></a> </span><span class=cF1>if</span><span class=cF0> (tmpu->life<=0 || target->life<=0)
|
||
|
<a name="l175"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l176"></a> </span><span class=cF1>if</span><span class=cF0> (overrun)
|
||
|
<a name="l177"></a> AttackHeader(tmpu,</span><span class=cF6>"OverRun"</span><span class=cF0>,target);
|
||
|
<a name="l178"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l179"></a> AttackHeader(tmpu,</span><span class=cF6>"CloseAssault"</span><span class=cF0>,target);
|
||
|
<a name="l180"></a> </span><span class=cF5>Noise</span><span class=cF0>(500*animation_delay,34,41);
|
||
|
<a name="l181"></a> </span><span class=cF5>Sleep</span><span class=cF0>(500*animation_delay);
|
||
|
<a name="l182"></a> tmpu->fired=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l183"></a> target->fired=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l184"></a> damage=HitDamage(tmpu,target);
|
||
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (overrun) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l186"></a> damage*=2.0;
|
||
|
<a name="l187"></a> </span><span class=cF6>"x2 OverRun Bonus\t=%6.2f Damage\n"</span><span class=cF0>,damage;
|
||
|
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (t2!=PLAINS) {
|
||
|
<a name="l189"></a> damage/=2.0;
|
||
|
<a name="l190"></a> </span><span class=cF6>"/2 Terrain Penalty\t=%6.2f Damage\n"</span><span class=cF0>,damage;
|
||
|
<a name="l191"></a> }
|
||
|
<a name="l192"></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="l193"></a> damage*=3.0;
|
||
|
<a name="l194"></a> </span><span class=cF6>"x3 CloseAssault Bonus\t=%6.2f Damage\n"</span><span class=cF0>,damage;
|
||
|
<a name="l195"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (DamageDo</span><span class=cF7>(</span><span class=cF0>target,</span><span class=cF5>Round</span><span class=cF0>(damage)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l197"></a> </span><span class=cF6>"$RED$Success$FG$\n"</span><span class=cF0>;
|
||
|
<a name="l198"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>scrncast</span><span class=cF0>.ona) </span><span class=cF2>//see </span><a href="/Wb/Kernel/KMisc.HC.HTML#l179"><span class=cF4>Snd</span></a><span class=cF2>()</span><span class=cF0>
|
||
|
<a name="l199"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l200"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l201"></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="l202"></a> tmpu->life=0;
|
||
|
<a name="l203"></a> VisRecalc(VR_FRIENDLY_UNIT_DIED,tmpu);
|
||
|
<a name="l204"></a> alive_cnt[tmpu->player]--;
|
||
|
<a name="l205"></a> </span><span class=cF6>"$RED$Failure$FG$\n"</span><span class=cF0>;
|
||
|
<a name="l206"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>scrncast</span><span class=cF0>.ona) </span><span class=cF2>//see </span><a href="/Wb/Kernel/KMisc.HC.HTML#l179"><span class=cF4>Snd</span></a><span class=cF2>()</span><span class=cF0>
|
||
|
<a name="l207"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l208"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l209"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l210"></a>}
|
||
|
<a name="l211"></a>
|
||
|
<a name="l212"></a></span><span class=cF1>U0</span><span class=cF0> IndirectResolveAll()
|
||
|
<a name="l213"></a>{
|
||
|
<a name="l214"></a> </span><span class=cF9>I64</span><span class=cF0> i,r,c;
|
||
|
<a name="l215"></a> </span><span class=cF1>F64</span><span class=cF0> x1,y1,x2,y2,d,range_factor;
|
||
|
<a name="l216"></a> Unit *tmpu,*target;
|
||
|
<a name="l217"></a> IndirectOrders *tmpi=indirect_head.next,*tmpi1;
|
||
|
<a name="l218"></a> </span><span class=cF1>while</span><span class=cF0> (tmpi!=*indirect_head) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l219"></a> tmpi1=tmpi->next;
|
||
|
<a name="l220"></a> tmpu=tmpi->attacker;
|
||
|
<a name="l221"></a> AttackHeader(tmpu,</span><span class=cF6>"IndirectFire"</span><span class=cF0>,</span><span class=cF3>NULL</span><span class=cF0>);
|
||
|
<a name="l222"></a> RowCol2XY(&x1,&y1,tmpu->row,tmpu->col);
|
||
|
<a name="l223"></a> RowCol2XY(&x2,&y2,tmpi->row,tmpi->col);
|
||
|
<a name="l224"></a> d=100*</span><span class=cF5>Rand</span><span class=cF0>;
|
||
|
<a name="l225"></a> </span><span class=cF6>"+%5.2f Roll\n"</span><span class=cF0>,d;
|
||
|
<a name="l226"></a> d+=tmpu->accuracy;
|
||
|
<a name="l227"></a> </span><span class=cF6>"+%2d.00 Accuracy\n"</span><span class=cF0>,tmpu->accuracy;
|
||
|
<a name="l228"></a> range_factor=</span><span class=cF5>Sqrt</span><span class=cF0>(</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>x2-x1</span><span class=cF7>)</span><span class=cF0>+</span><span class=cF5>Sqr</span><span class=cF7>(</span><span class=cF0>y2-y1</span><span class=cF7>)</span><span class=cF0>)/(tmpu->range*2*DSIN);
|
||
|
<a name="l229"></a> </span><span class=cF6>"-%5.2f%% of Range\n"</span><span class=cF0>,100*range_factor;
|
||
|
<a name="l230"></a> d-=100*range_factor;
|
||
|
<a name="l231"></a> </span><span class=cF6>'_______\n'</span><span class=cF0>;
|
||
|
<a name="l232"></a>
|
||
|
<a name="l233"></a>
|
||
|
<a name="l234"></a> </span><span class=cF1>if</span><span class=cF0> (d>=0) {
|
||
|
<a name="l235"></a> </span><span class=cF6>"+%5.2f Hit\n"</span><span class=cF0>,d;
|
||
|
<a name="l236"></a> </span><span class=cF5>Noise</span><span class=cF0>(500*animation_delay,34,41);
|
||
|
<a name="l237"></a> </span><span class=cF5>Sleep</span><span class=cF0>(500*animation_delay);
|
||
|
<a name="l238"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l239"></a> </span><span class=cF6>"-%5.2f Miss\n"</span><span class=cF0>,-d;
|
||
|
<a name="l240"></a> </span><span class=cF5>Noise</span><span class=cF0>(1000*animation_delay,69,74);
|
||
|
<a name="l241"></a> </span><span class=cF5>Sleep</span><span class=cF0>(1000*animation_delay);
|
||
|
<a name="l242"></a> i=</span><span class=cF5>RandU16</span><span class=cF0>%6;
|
||
|
<a name="l243"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->row&1)
|
||
|
<a name="l244"></a> tmpi->col+=col_offsets_odd[i];
|
||
|
<a name="l245"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l246"></a> tmpi->col+=col_offsets_even[i];
|
||
|
<a name="l247"></a> tmpi->row+=row_offsets[i];
|
||
|
<a name="l248"></a> RowCol2XY(&x2,&y2,tmpi->row,tmpi->col);
|
||
|
<a name="l249"></a> }
|
||
|
<a name="l250"></a>
|
||
|
<a name="l251"></a> </span><span class=cF5>Line</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,x1,y1,0,x2,y2,0,&BulletPlot);
|
||
|
<a name="l252"></a> firing=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l253"></a> tmpu->fired=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l254"></a> indirect_row=tmpi->row;
|
||
|
<a name="l255"></a> indirect_col=tmpi->col;
|
||
|
<a name="l256"></a> indirect_explosion=</span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l257"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<7;i++) {
|
||
|
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->row&1)
|
||
|
<a name="l259"></a> c=tmpi->col+col_offsets_odd[i];
|
||
|
<a name="l260"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l261"></a> c=tmpi->col+col_offsets_even[i];
|
||
|
<a name="l262"></a> r=tmpi->row+row_offsets[i];
|
||
|
<a name="l263"></a> </span><span class=cF1>if</span><span class=cF0> (0<=r<map_rows && 0<=c<map_cols && </span><span class=cF7>(</span><span class=cF0>target=UnitFind(r,c)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l264"></a> AttackHeader(tmpu,</span><span class=cF6>"IndirectFire"</span><span class=cF0>,target);
|
||
|
<a name="l265"></a> DamageDo(target,HitDamage</span><span class=cF7>(</span><span class=cF0>tmpu,target</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l266"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l267"></a> }
|
||
|
<a name="l268"></a> </span><span class=cF5>Noise</span><span class=cF0>(2000*animation_delay,70,74);
|
||
|
<a name="l269"></a> </span><span class=cF5>Sleep</span><span class=cF0>(2000*animation_delay);
|
||
|
<a name="l270"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cFB>scrncast</span><span class=cF0>.ona) </span><span class=cF2>//see </span><a href="/Wb/Kernel/KMisc.HC.HTML#l179"><span class=cF4>Snd</span></a><span class=cF2>()</span><span class=cF0>
|
||
|
<a name="l271"></a> </span><span class=cF5>Yield</span><span class=cF0>;
|
||
|
<a name="l272"></a> indirect_explosion=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l273"></a>
|
||
|
<a name="l274"></a> </span><span class=cF5>QueRem</span><span class=cF0>(tmpi);
|
||
|
<a name="l275"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpi);
|
||
|
<a name="l276"></a> tmpi=tmpi1;
|
||
|
<a name="l277"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l278"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|