# HG changeset patch # User sheepluva # Date 1475361749 -7200 # Node ID 38fd32724a61d302755c197b502338e1c5076474 # Parent cb137eb715564775b90a08aacf0a1678705ce951 and while I'm at it, fix seduction... kinda ♥ diff -r cb137eb71556 -r 38fd32724a61 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Sat Oct 01 22:48:00 2016 +0200 +++ b/hedgewars/uGearsHandlersMess.pas Sun Oct 02 00:42:29 2016 +0200 @@ -3416,18 +3416,47 @@ PlaySound(sndYoohoo); end; - if (Gear^.Pos = 14) and (RealTicks and $3 = 0) then + + // note: use GameTicks, not RealTicks, otherwise amount can vary greatly + if (Gear^.Pos = 14) and (GameTicks and $3 = 0) then begin heart:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtStraightShot); if heart <> nil then with heart^ do begin + { // old calcs dx:= 0.001 * (random(200)); dy:= 0.001 * (random(200)); if random(2) = 0 then dx := -dx; if random(2) = 0 then dy := -dy; + } + + // randomize speed in both directions + dx:= 0.001 * (random(201)); + dy:= 0.001 * (random(201)); + + // half of hearts go down + if random(2) = 0 then + begin + // create a pointy shape + if 0.2 < dx + dy then + begin + dy:= 0.2 - dy; + dx:= 0.2 - dx; + end; + // sin bulge it out a little to avoid corners on the side + dx:= dx + (dx/0.2) * ((0.2 * sin(pi * ((0.2 - dy) / 0.4))) - (0.2 - dy)); + // change sign + dy:= -dy; + end + else // shape hearts on top into 2 arcs + dy:= dy * (0.3 + 0.7 * sin(pi * dx / 0.2)); + + // half of the hearts go left + if random(2) = 0 then + dx := -dx; FrameTicks:= random(750) + 1000; State:= ord(sprSeduction) end;