hedgewars/uGearsList.pas
changeset 10625 125e120165aa
parent 10589 98ea597e5cd9
child 10634 35d059bd0932
equal deleted inserted replaced
10624:05bb44f4d92f 10625:125e120165aa
   283                         dy.QWordValue:= QWord($3AD3) * GetRandom(7000) * 8;
   283                         dy.QWordValue:= QWord($3AD3) * GetRandom(7000) * 8;
   284                         if GetRandom(2) = 0 then
   284                         if GetRandom(2) = 0 then
   285                             dx := -dx
   285                             dx := -dx
   286                         end;
   286                         end;
   287                     State:= State or gstInvisible;
   287                     State:= State or gstInvisible;
   288                     Health:= random(vobFrameTicks);
   288                     // use health field to store current frameticks
       
   289                     if vobFrameTicks > 0 then
       
   290                         Health:= random(vobFrameTicks)
       
   291                     else
       
   292                         Health:= 0;
       
   293                     // use timer to store currently displayed frame index
   289                     if gear^.Timer = 0 then Timer:= random(vobFramesCount);
   294                     if gear^.Timer = 0 then Timer:= random(vobFramesCount);
   290                     Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8;
   295                     Damage:= (random(2) * 2 - 1) * (vobVelocity + random(vobVelocity)) * 8;
   291                     Tint:= ((ExplosionBorderColor and RMask) shl RShift) or
   296                     Tint:= ((ExplosionBorderColor and RMask) shl RShift) or
   292                            ((ExplosionBorderColor and GMask) shl GShift) or
   297                            ((ExplosionBorderColor and GMask) shl GShift) or
   293                            ((ExplosionBorderColor and BMask) shl BShift) or $FF;
   298                            ((ExplosionBorderColor and BMask) shl BShift) or $FF;