261 HHGear^.Active:= true; |
261 HHGear^.Active:= true; |
262 end; |
262 end; |
263 |
263 |
264 procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource); |
264 procedure HHHurt(Hedgehog: PHedgehog; Source: TDamageSource); |
265 begin |
265 begin |
|
266 if Hedgehog^.Effects[heFrozen] <> 0 then exit; |
266 if (Source = dsFall) or (Source = dsExplosion) then |
267 if (Source = dsFall) or (Source = dsExplosion) then |
267 case random(3) of |
268 case random(3) of |
268 0: PlaySoundV(sndOoff1, Hedgehog^.Team^.voicepack); |
269 0: PlaySoundV(sndOoff1, Hedgehog^.Team^.voicepack); |
269 1: PlaySoundV(sndOoff2, Hedgehog^.Team^.voicepack); |
270 1: PlaySoundV(sndOoff2, Hedgehog^.Team^.voicepack); |
270 2: PlaySoundV(sndOoff3, Hedgehog^.Team^.voicepack); |
271 2: PlaySoundV(sndOoff3, Hedgehog^.Team^.voicepack); |
287 var |
288 var |
288 dmg: Longword; |
289 dmg: Longword; |
289 i: LongWord; |
290 i: LongWord; |
290 particle: PVisualGear; |
291 particle: PVisualGear; |
291 begin |
292 begin |
292 if _0_4 < Gear^.dY then |
293 if _0_4 < Gear^.dY then |
293 begin |
294 begin |
294 dmg := ModifyDamage(1 + hwRound((Gear^.dY - _0_4) * 70), Gear); |
295 dmg := ModifyDamage(1 + hwRound((Gear^.dY - _0_4) * 70), Gear); |
295 PlaySound(sndBump); |
296 if Gear^.Hedgehog^.Effects[heFrozen] = 0 then |
296 if dmg < 1 then |
297 PlaySound(sndBump) |
297 exit; |
298 else PlaySound(sndFrozenHogImpact); |
298 |
299 if dmg < 1 then |
299 for i:= min(12, (3 + dmg div 10)) downto 0 do |
300 exit; |
300 begin |
301 |
301 particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); |
302 for i:= min(12, (3 + dmg div 10)) downto 0 do |
302 if particle <> nil then |
303 begin |
303 particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480); |
304 particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust); |
304 end; |
305 if particle <> nil then |
305 |
306 particle^.dX := particle^.dX + (Gear^.dX.QWordValue / 21474836480); |
306 if (Gear^.Invulnerable) then |
307 end; |
307 exit; |
308 |
308 |
309 if (Gear^.Invulnerable) then |
309 //if _0_6 < Gear^.dY then |
310 exit; |
310 // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) |
311 |
311 //else |
312 //if _0_6 < Gear^.dY then |
312 // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); |
313 // PlaySound(sndOw4, Gear^.Hedgehog^.Team^.voicepack) |
313 |
314 //else |
314 if Gear^.LastDamage <> nil then |
315 // PlaySound(sndOw1, Gear^.Hedgehog^.Team^.voicepack); |
315 ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall) |
316 |
316 else |
317 if Gear^.LastDamage <> nil then |
317 ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); |
318 ApplyDamage(Gear, Gear^.LastDamage, dmg, dsFall) |
|
319 else |
|
320 ApplyDamage(Gear, CurrentHedgehog, dmg, dsFall); |
318 end |
321 end |
319 end; |
322 end; |
320 |
323 |
321 |
324 |
322 procedure CalcRotationDirAngle(Gear: PGear); |
325 procedure CalcRotationDirAngle(Gear: PGear); |