hedgewars/uGears.pas
changeset 3734 304a83637eb4
parent 3730 aecea9aa53dc
child 3749 d0920e92008e
equal deleted inserted replaced
3733:447860ec0093 3734:304a83637eb4
    79     StepSoundChannel: LongInt;
    79     StepSoundChannel: LongInt;
    80 
    80 
    81 procedure initModule;
    81 procedure initModule;
    82 procedure freeModule;
    82 procedure freeModule;
    83 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    83 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
    84 procedure SpawnHealthCrate(x, y: LongInt);
    84 procedure SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword );
    85 procedure ProcessGears;
    85 procedure ProcessGears;
    86 procedure EndTurnCleanup;
    86 procedure EndTurnCleanup;
    87 procedure ApplyDamage(Gear: PGear; Damage: Longword; Source: TDamageSource);
    87 procedure ApplyDamage(Gear: PGear; Damage: Longword; Source: TDamageSource);
    88 procedure SetAllToActive;
    88 procedure SetAllToActive;
    89 procedure SetAllHHToActive;
    89 procedure SetAllHHToActive;
  1537     t:= t^.NextGear
  1537     t:= t^.NextGear
  1538     end;
  1538     end;
  1539 CountGears:= count;
  1539 CountGears:= count;
  1540 end;
  1540 end;
  1541 
  1541 
  1542 procedure SpawnHealthCrate(x, y: LongInt);
  1542 procedure SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword);
  1543 begin
  1543 begin
  1544     FollowGear:= AddGear(x, y, gtCase, 0, _0, _0, 0);
  1544     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);
  1545     FollowGear^.Health:= 25;
  1545     cCaseFactor := 0;
  1546     FollowGear^.Pos:= posCaseHealth;
  1546 
  1547     AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);
  1547     if (content < ord(Low(TAmmoType))) then content := 0;
       
  1548     if (content > ord(High(TAmmoType))) then content := ord(High(TAmmoType));
       
  1549 
       
  1550     case crate of
       
  1551         HealthCrate: begin
       
  1552             FollowGear^.Health := 25;
       
  1553             FollowGear^.Pos := posCaseHealth;
       
  1554             AddCaption(GetEventString(eidNewHealthPack), cWhiteColor, capgrpAmmoInfo);
       
  1555             end;
       
  1556         AmmoCrate: begin
       
  1557             FollowGear^.Pos := posCaseAmmo;
       
  1558             FollowGear^.State := content;
       
  1559             AddCaption(GetEventString(eidNewAmmoPack), cWhiteColor, capgrpAmmoInfo);
       
  1560             end;
       
  1561         UtilityCrate: begin
       
  1562             FollowGear^.Pos := posCaseUtility;
       
  1563             FollowGear^.State := content;
       
  1564             AddCaption(GetEventString(eidNewUtilityPack), cWhiteColor, capgrpAmmoInfo);
       
  1565             end;
       
  1566     end;
  1548 end;
  1567 end;
  1549 
  1568 
  1550 procedure SpawnBoxOfSmth;
  1569 procedure SpawnBoxOfSmth;
  1551 var t, aTot, uTot, a, h: LongInt;
  1570 var t, aTot, uTot, a, h: LongInt;
  1552     i: TAmmoType;
  1571     i: TAmmoType;