hedgewars/uGears.pas
changeset 5366 bfdd925e89a5
parent 5357 ec36f3d53f3c
parent 5343 ff7ecf483759
child 5476 649d35cf95ff
equal deleted inserted replaced
5357:ec36f3d53f3c 5366:bfdd925e89a5
    37 
    37 
    38 procedure initModule;
    38 procedure initModule;
    39 procedure freeModule;
    39 procedure freeModule;
    40 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    40 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    41 function  SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword ): PGear;
    41 function  SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword ): PGear;
    42 function  SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; trap: boolean ): PGear;
    42 function  SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; explode: boolean; poison: boolean ): PGear;
    43 procedure ResurrectHedgehog(gear: PGear);
    43 procedure ResurrectHedgehog(gear: PGear);
    44 procedure ProcessGears;
    44 procedure ProcessGears;
    45 procedure EndTurnCleanup;
    45 procedure EndTurnCleanup;
    46 procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
    46 procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
    47 procedure SetAllToActive;
    47 procedure SetAllToActive;
  1636     if ( (x = 0) and (y = 0) ) then FindPlace(FollowGear, true, 0, LAND_WIDTH);
  1636     if ( (x = 0) and (y = 0) ) then FindPlace(FollowGear, true, 0, LAND_WIDTH);
  1637 
  1637 
  1638     SpawnCustomCrateAt := FollowGear;
  1638     SpawnCustomCrateAt := FollowGear;
  1639 end;
  1639 end;
  1640 
  1640 
  1641 function SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; trap: boolean): PGear;
  1641 function SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; explode: boolean; poison: boolean): PGear;
  1642 begin
  1642 begin
  1643     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);
  1643     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);
  1644     cCaseFactor := 0;
  1644     cCaseFactor := 0;
       
  1645     FollowGear^.Pos := posCaseDummy;
  1645     
  1646     
  1646     if trap then FollowGear^.Pos := posCaseTrap
  1647     if explode then FollowGear^.Pos := FollowGear^.Pos + posCaseExplode;
  1647     else FollowGear^.Pos := posCaseDummy;
  1648     if poison then FollowGear^.Pos := FollowGear^.Pos + posCasePoison;
  1648 
  1649 
  1649     case crate of
  1650     case crate of
  1650         HealthCrate: begin
  1651         HealthCrate: begin
  1651             FollowGear^.Pos := FollowGear^.Pos + posCaseHealth;
  1652             FollowGear^.Pos := FollowGear^.Pos + posCaseHealth;
  1652             AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);
  1653             AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);