Remove slot overcrowding, disable angle detection which isn't doing what I want.
authornemo
Mon, 15 Oct 2012 22:07:37 -0400
changeset 7758 a225cc45513e
parent 7757 c20e6c80e249
child 7759 b64afd109cf7
Remove slot overcrowding, disable angle detection which isn't doing what I want.
hedgewars/GSHandlers.inc
hedgewars/uVariables.pas
share/hedgewars/Data/Graphics/cleaver.svg
--- a/hedgewars/GSHandlers.inc	Tue Oct 16 00:05:58 2012 +0400
+++ b/hedgewars/GSHandlers.inc	Mon Oct 15 22:07:37 2012 -0400
@@ -5259,22 +5259,27 @@
     else if Gear^.CollisionIndex = -1 then
         begin
         ox:= 0; oy:= 0;
-        if      TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1
-        else if TestCollisionXwithGear(Gear, 1)       then ox:=  1
-        else if TestCollisionXwithGear(Gear, -1)      then ox:= -1
-        else if TestCollisionYwithGear(Gear, 1) <> 0  then oy:=  1;
+        if TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1;
+        if TestCollisionXwithGear(Gear, 1)       then ox:=  1;
+        if TestCollisionXwithGear(Gear, -1)      then ox:= -1;
+        if TestCollisionYwithGear(Gear, 1) <> 0  then oy:=  1;
         if Gear^.Health > 0 then
             PlaySound(sndRopeAttach);
-        la:= _0;
+(*
+        la:= _10000;
         if (ox <> 0) or (oy <> 0) then
             la:= CalcSlopeNearGear(Gear, ox, oy);
-        if la = _0 then
+        if la = _10000 then
             begin
             // debug for when we couldn't get an angle
             //AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite);
-            Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY)*hwSign(Gear^.dX) + (random(20)-10)
-            end
-        else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent?
+*)
+            Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY) + (random(20)-10);
+            if (Gear^.dX.isNegative and Gear^.dY.isNegative) or
+             ((not Gear^.dX.isNegative) and (not Gear^.dY.isNegative)) then Gear^.DirAngle:= Gear^.DirAngle-90;
+ //           end
+ //       else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent?
+ //       AddFileLog('la: '+floattostr(la)+' DirAngle: '+inttostr(round(Gear^.DirAngle)));
         Gear^.dX:= _0;
         Gear^.dY:= _0;
         Gear^.State:= Gear^.State and (not gstMoving) or gstCollision;
--- a/hedgewars/uVariables.pas	Tue Oct 16 00:05:58 2012 +0400
+++ b/hedgewars/uVariables.pas	Mon Oct 15 22:07:37 2012 -0400
@@ -2322,7 +2322,7 @@
                 AmmoType: amIceGun;
                 AttackVoice: sndNone;
                 Bounciness: 1000);
-            Slot: 6;
+            Slot: 9;
             TimeAfterTurn: 0;
             minAngle: 0;
             maxAngle: 0;
--- a/share/hedgewars/Data/Graphics/cleaver.svg	Tue Oct 16 00:05:58 2012 +0400
+++ b/share/hedgewars/Data/Graphics/cleaver.svg	Mon Oct 15 22:07:37 2012 -0400
@@ -12,7 +12,7 @@
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    id="svg2"
    version="1.1"
-   inkscape:version="0.48.3.1 r9886"
+   inkscape:version="0.48.1 "
    width="450"
    height="470"
    sodipodi:docname="cleaver.svg">
@@ -24,7 +24,7 @@
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
@@ -74,9 +74,9 @@
      inkscape:window-height="868"
      id="namedview4"
      showgrid="false"
-     inkscape:zoom="1.0042553"
-     inkscape:cx="205.71997"
-     inkscape:cy="192.5461"
+     inkscape:zoom="2.0085106"
+     inkscape:cx="209.47607"
+     inkscape:cy="261.39935"
      inkscape:window-x="0"
      inkscape:window-y="25"
      inkscape:window-maximized="0"
@@ -91,14 +91,6 @@
      inkscape:export-xdpi="21.549999"
      inkscape:export-ydpi="21.549999" />
   <path
-     inkscape:connector-curvature="0"
-     style="fill:#cfcfcf;fill-opacity:1;stroke:#222222;stroke-width:5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
-     d="M 225.97408,109.10867 205.09299,122.71718 C 210.13058,125.22056 214.88743,127.7568 219.39088,130.31983 224.01197,128.93641 229.11177,128.83531 233.3459,130.39132 239.7278,132.73663 242.08226,138.06415 239.58622,143.18952 290.70676,179.79427 298.47819,221.3 311.00711,262.82996 316.92444,259.29111 323.72772,254.63048 329.28235,249.57895 322.93255,198.81501 291.29561,132.47714 225.97408,109.10867 z"
-     id="path3759"
-     inkscape:export-filename="/tmp/path3817-7.png"
-     inkscape:export-xdpi="21.549999"
-     inkscape:export-ydpi="21.549999" />
-  <path
      transform="matrix(1.090887,0.40089412,-0.66619266,0.73984055,45.886101,-17.883965)"
      d="M 233.7647,95.061127 A 12.67399,14.434267 0 1 1 208.41672,95.061127 12.67399,14.434267 0 1 1 233.7647,95.061127 z"
      sodipodi:ry="14.434267"
@@ -154,4 +146,27 @@
      sodipodi:nodetypes="cc"
      inkscape:export-xdpi="21.549999"
      inkscape:export-ydpi="21.549999" />
+  <path
+     style="fill:#808080;fill-opacity:1;stroke:#333333;stroke-width:1.41000009;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none"
+     d="m 221.79837,113.95961 c -21.75946,13.05498 -41.31898,29.53781 -58.441,48.23222 -9.86016,10.62761 -19.01968,21.91187 -27.24127,33.85597 21.44098,9.1359 43.44539,21.04019 55.91257,41.56455 9.46361,14.98751 11.79385,32.99706 13.97753,50.15453 11.40101,0.37915 22.84258,-1.01125 34.19504,-2.09442 27.93191,-3.21887 55.91365,-11.96932 78.24584,-29.55025 2.88165,-2.3967 6.19261,-4.4927 8.46649,-7.48569 -2.36955,-17.66221 -7.90037,-34.85387 -15.16499,-51.09771 -13.76178,-30.09689 -34.61955,-57.99042 -63.11129,-75.50419 -7.14974,-4.33722 -14.8115,-7.77049 -22.68472,-10.56442 -1.38473,0.8298 -2.76946,1.65961 -4.1542,2.48941 z m 4.96326,13.33388 c 6.92786,-0.18017 15.95374,4.08288 15.69881,12.04251 0.0296,8.58261 -8.66637,13.92682 -16.19669,15.52767 -7.71639,1.69714 -17.98233,-0.11705 -21.28443,-8.2306 -2.60175,-7.96643 4.57224,-15.10751 11.5913,-17.48808 3.24621,-1.22318 6.7144,-1.92242 10.19101,-1.8515 z"
+     id="path3042"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:#999999;fill-opacity:1;stroke:#333333;stroke-width:1.41000009;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none"
+     d="m 184.72177,141.68538 c -7.04816,6.02341 -13.67238,12.70313 -20.10196,19.41737 11.08722,8.12224 21.93196,16.67468 31.78963,26.29896 13.96904,12.81464 23.21706,29.74191 31.57528,46.51558 6.9716,14.36807 9.80641,30.24397 13.18435,45.7279 0.72814,1.68644 -0.0957,4.21026 1.22914,5.49225 8.59993,-1.14295 17.2702,-2.70254 25.57865,-5.1344 -1.48385,-14.7308 -4.63759,-29.31515 -8.27278,-43.6701 -4.34702,-17.04486 -13.37374,-32.42971 -22.6612,-47.20026 -9.84038,-15.31404 -24.25699,-26.89158 -38.2929,-38.16645 -4.57974,-3.12111 -8.74957,-7.30261 -13.93486,-9.29641 l -0.0933,0.0156 z"
+     id="path3076"
+     inkscape:connector-curvature="0" />
+  <path
+     style="fill:#b3b3b3;fill-opacity:1;stroke:#333333;stroke-width:1.41000009;stroke-miterlimit:4;stroke-opacity:0;stroke-dasharray:none"
+     d="m 225.68807,112.18591 c -5.92512,2.65358 -11.16099,6.91284 -16.71014,10.34659 -8.31649,5.86403 -16.43569,12.06633 -24.00722,18.87282 11.93009,6.55981 22.02037,15.92218 32.24191,24.8031 10.55351,9.24568 19.31488,20.36884 26.04132,32.67108 7.65459,13.14787 14.53726,26.93399 17.7837,41.89983 3.31322,12.94904 5.40772,26.19944 7.37487,39.3793 18.61835,-5.22168 36.65473,-13.40061 51.68631,-25.68757 2.35028,-1.97812 5.55487,-3.83814 6.44134,-6.92366 -1.86457,-11.62675 -4.52164,-23.12372 -8.83705,-34.10578 -5.82729,-16.86203 -14.35358,-32.64948 -24.08535,-47.54676 -2.24209,-3.19836 -5.0169,-6.38514 -7.34901,-9.65397 -7.94085,-9.50331 -16.48873,-18.56881 -26.36039,-26.08192 -7.56515,-5.85454 -15.90196,-10.78183 -24.65164,-14.69016 -3.08288,-1.28523 -6.17749,-3.08293 -9.56865,-3.2829 z m 0.56012,15.18538 c 7.0065,-0.60697 15.54072,3.27911 16.30561,11.03118 0.67466,7.39744 -5.62903,12.89817 -11.97389,15.29716 -7.52887,2.9229 -17.53617,3.01251 -23.42236,-3.25465 -5.23034,-5.67163 -2.26244,-14.80264 3.79634,-18.5772 4.37608,-3.23642 9.91486,-4.54942 15.2943,-4.49649 z"
+     id="path3078"
+     inkscape:connector-curvature="0" />
+  <path
+     inkscape:connector-curvature="0"
+     style="fill:#cfcfcf;fill-opacity:1;stroke:#222222;stroke-width:5;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+     d="m 226.64659,108.8491 -20.88109,13.60851 c 5.03759,2.50338 9.79444,5.03962 14.29789,7.60265 4.62109,-1.38342 9.72089,-1.48452 13.95502,0.0715 6.3819,2.34531 8.73636,7.67283 6.24032,12.7982 51.12054,36.60475 58.89197,78.11048 71.42089,119.64044 5.91733,-3.53885 12.72061,-8.19948 18.27524,-13.25101 -6.3498,-50.76394 -37.98674,-117.10181 -103.30827,-140.47028 z"
+     id="path3759-4"
+     inkscape:export-filename="/tmp/path3817-7.png"
+     inkscape:export-xdpi="21.549999"
+     inkscape:export-ydpi="21.549999" />
 </svg>