remove theme.cfg from CMakeLists too
authorHenek
Tue, 21 Jun 2011 22:47:12 +0200
changeset 5279 66969e7494c5
parent 5278 1aadb3312828
child 5280 612527a48cd1
remove theme.cfg from CMakeLists too
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uGears.pas
hedgewars/uVariables.pas
share/hedgewars/Data/Themes/CMakeLists.txt
--- a/hedgewars/GSHandlers.inc	Tue Jun 21 20:51:51 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Tue Jun 21 22:47:12 2011 +0200
@@ -4813,89 +4813,52 @@
     x, y: LongInt;
     hog: PHedgehog;
 begin
-    if (Gear^.Hedgehog <> nil) and (Gear^.Tag = TotalRounds) then
+    if CurAmmoGear = Gear then
         begin
-            hog:= Gear^.Hedgehog;
-            hog^.Gear:= hog^.GearHidden;
-            hog^.Gear^.X:= Gear^.X;
-            hog^.Gear^.Y:= Gear^.Y - Int2hwFloat(Gear^.Radius);
-            hog^.Gear^.Active:= false;
-            hog^.Gear^.State:= hog^.Gear^.State And not gstHHdriven;
-            InsertGearToList(hog^.Gear);
-            hog^.GearHidden:= nil;
-            Gear^.Hedgehog:= nil;
+        if (CurrentHedgehog = nil) or (CurrentHedgehog^.Gear = nil) then 
+            begin
+            DeleteGear(Gear);
+            exit
+            end;
+        if Gear = CurAmmoGear then CurAmmoGear := nil;
+        Gear^.Hedgehog:= CurrentHedgehog;
+        RemoveGearFromList(CurrentHedgehog^.Gear);
+        CurrentHedgehog^.Gear^.Z := cHHZ;
+        CurrentHedgehog^.Gear^.Active := false;
+        CurrentHedgehog^.Gear^.State:= CurrentHedgehog^.Gear^.State and not gstHHDriven;
+        CurrentHedgehog^.GearHidden:= CurrentHedgehog^.Gear;
+        CurrentHedgehog^.Gear:= nil;
+        Gear^.Tag:= TotalRounds + Gear^.Tag;
+        AddGearCI(Gear);
         end;
 
     dec(Gear^.Health, Gear^.Damage);
     Gear^.Damage := 0;
-
-    if Gear^.Health <= 0 then
-    begin
-        if Gear^.Hedgehog <> nil then
+        
+    if (Gear^.Tag = TotalRounds) or (Gear^.Health <= 0) then
         begin
-            hog:= Gear^.Hedgehog;
-            hog^.Gear:= hog^.GearHidden;
-            hog^.Gear^.X:= Gear^.X;
-            hog^.Gear^.Y:= Gear^.Y;
-            InsertGearToList(hog^.Gear);
-            hog^.GearHidden:= nil;
+        if Gear^.Hedgehog <> nil then
+            begin
+            Gear^.Hedgehog^.Gear:= Gear^.Hedgehog^.GearHidden;
+            Gear^.Hedgehog^.GearHidden:= nil;
+            Gear^.Hedgehog^.Gear^.X:= Gear^.X;
+            Gear^.Hedgehog^.Gear^.Y:= Gear^.Y - int2hwFloat(Gear^.Radius + cHHRadius);
+            InsertGearToList(Gear^.Hedgehog^.Gear);
             Gear^.Hedgehog:= nil;
+            SetAllHHToActive;
+            end;
         end;
-
+        
+    if Gear^.Health <= 0 then
+        begin
         x := hwRound(Gear^.X);
         y := hwRound(Gear^.Y);
 
+        DeleteCI(Gear);
         DeleteGear(Gear);
 
         doMakeExplosion(x, y, 50, CurrentHedgehog, EXPLAutoSound);
-    end;
-end;
-
-procedure doStepPlaceStructure(Gear: PGear);
-var 
-    hog: PHedgehog;
-    HHGear: PGear;
-    x, y, tx, ty: hwFloat;
-begin
-    AllInactive := false;
-
-    HHGear := Gear^.Hedgehog^.Gear;
-    tx := int2hwFloat(TargetPoint.X);
-    ty := int2hwFloat(TargetPoint.Y);
-    x := HHGear^.X;
-    y := HHGear^.Y;
-
-    HHGear := Gear^.Hedgehog^.Gear;
-    if (Distance(tx - x, ty - y) > _256) or
-       not TryPlaceOnLand(TargetPoint.X - SpritesData[sprHHTelepMask].Width div 2,
-       TargetPoint.Y - SpritesData[sprHHTelepMask].Height div 2,
-       sprHHTelepMask, 0, false, false) then
-        begin
-        HHGear^.Message := HHGear^.Message and not gmAttack;
-        HHGear^.State := HHGear^.State and not gstAttacking;
-        HHGear^.State := HHGear^.State or gstHHChooseTarget;
-        DeleteGear(Gear);
-        isCursorVisible := true;
-        PlaySound(sndDenied)
-        end
-    else
-        begin
-        DeleteCI(HHGear);
-        SetAllHHToActive;
-        PlaySound(sndPlaced);
-        CurAmmoGear:= nil;
-        AfterAttack;
-        Gear^.X := tx;
-        Gear^.Y := ty;
-        Gear^.Tag := TotalRounds + Gear^.Tag;
-        hog:= CurrentHedgehog;
-        hog^.GearHidden:= hog^.Gear;
-        RemoveGearFromList(hog^.Gear);
-        hog^.Gear:= nil;
-        Gear^.Hedgehog := hog;
-        Gear^.doStep := @doStepStructure;
         end;
-    TargetPoint.X := NoPointX;
 end;
 
 procedure doStepTardis(Gear: PGear);
--- a/hedgewars/HHHandlers.inc	Tue Jun 21 20:51:51 2011 +0200
+++ b/hedgewars/HHHandlers.inc	Tue Jun 21 22:47:12 2011 +0200
@@ -316,7 +316,7 @@
                     end;
                    amDrillStrike: AddGear(CurWeapon^.Pos, 0, gtAirAttack, 3, _0, _0, CurWeapon^.Timer);
                    //amMelonStrike: AddGear(CurWeapon^.Pos, 0, gtAirAttack, 4, _0, _0, 0);
-                     amStructure: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtStructure, 0, _0, _0, 0);
+                     amStructure: CurAmmoGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
                         amTardis: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
                   end;
 
--- a/hedgewars/uGears.pas	Tue Jun 21 20:51:51 2011 +0200
+++ b/hedgewars/uGears.pas	Tue Jun 21 22:47:12 2011 +0200
@@ -147,7 +147,7 @@
             @doStepNapalmBomb,
             @doStepSnowball,
             @doStepSnowflake,
-            @doStepPlaceStructure,
+            @doStepStructure,
             @doStepLandGun,
             @doStepTardis);
 
--- a/hedgewars/uVariables.pas	Tue Jun 21 20:51:51 2011 +0200
+++ b/hedgewars/uVariables.pas	Tue Jun 21 22:47:12 2011 +0200
@@ -2036,7 +2036,7 @@
             ejectX: 0; 
             ejectY: 0),
 
-// Tardis (just a copy of teleport til nemo arives)
+// Tardis
             (NameId: sidTardis;
             NameTex: nil;
             Probability: 200;
@@ -2062,15 +2062,13 @@
             ejectX: 0;
             ejectY: 0),
 
-// Structure
+// Structure      
             (NameId: sidStructure;
             NameTex: nil;
             Probability: 0;
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_ForwMsgs or
                           ammoprop_NoCrosshair or
-                          ammoprop_NeedTarget or
-                          ammoprop_AttackingPut or
                           ammoprop_Utility or
                           ammoprop_DontHold;
                 Count: 1;
@@ -2085,10 +2083,11 @@
             maxAngle: 0;
             isDamaging: false;
             SkipTurns: 0;
-            PosCount: 2;
-            PosSprite: sprAmTeleport;
+            PosCount: 1;
+            PosSprite: sprWater;
             ejectX: 0;
             ejectY: 0),
+            
 // Land Gun
             (NameId: sidLandGun;
             NameTex: nil;
--- a/share/hedgewars/Data/Themes/CMakeLists.txt	Tue Jun 21 20:51:51 2011 +0200
+++ b/share/hedgewars/Data/Themes/CMakeLists.txt	Tue Jun 21 22:47:12 2011 +0200
@@ -30,5 +30,3 @@
 	)
 	add_subdirectory(${dir})
 endforeach(dir)
-
-install(FILES themes.cfg DESTINATION ${SHAREPATH}Data/Themes)