--- a/QTfrontend/pages.cpp Thu Sep 23 01:29:20 2010 +0200
+++ b/QTfrontend/pages.cpp Thu Sep 23 01:30:35 2010 +0200
@@ -1567,7 +1567,7 @@
glBSLayout->addWidget(l,1,1,1,1);
SB_TurnTime = new QSpinBox(gbBasicSettings);
- SB_TurnTime->setRange(1, 99);
+ SB_TurnTime->setRange(1, 9999);
SB_TurnTime->setValue(45);
SB_TurnTime->setSingleStep(15);
glBSLayout->addWidget(SB_TurnTime,1,2,1,1);
--- a/hedgewars/CCHandlers.inc Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/CCHandlers.inc Thu Sep 23 01:30:35 2010 +0200
@@ -294,7 +294,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_Left
+ Message:= Message or gmLeft
end;
procedure chLeft_m(var s: shortstring);
@@ -303,7 +303,7 @@
if CheckNoTeamOrHH then exit;
if not CurrentTeam^.ExtDriven then SendIPC('l');
with CurrentHedgehog^.Gear^ do
- Message:= Message and not gm_Left
+ Message:= Message and not gmLeft
end;
procedure chRight_p(var s: shortstring);
@@ -314,7 +314,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_Right
+ Message:= Message or gmRight
end;
procedure chRight_m(var s: shortstring);
@@ -323,7 +323,7 @@
if CheckNoTeamOrHH then exit;
if not CurrentTeam^.ExtDriven then SendIPC('r');
with CurrentHedgehog^.Gear^ do
- Message:= Message and not gm_Right
+ Message:= Message and not gmRight
end;
procedure chUp_p(var s: shortstring);
@@ -334,7 +334,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_Up
+ Message:= Message or gmUp
end;
procedure chUp_m(var s: shortstring);
@@ -343,7 +343,7 @@
if CheckNoTeamOrHH then exit;
if not CurrentTeam^.ExtDriven then SendIPC('u');
with CurrentHedgehog^.Gear^ do
- Message:= Message and not gm_Up
+ Message:= Message and not gmUp
end;
procedure chDown_p(var s: shortstring);
@@ -354,7 +354,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_Down
+ Message:= Message or gmDown
end;
procedure chDown_m(var s: shortstring);
@@ -363,7 +363,7 @@
if CheckNoTeamOrHH then exit;
if not CurrentTeam^.ExtDriven then SendIPC('d');
with CurrentHedgehog^.Gear^ do
- Message:= Message and not gm_Down
+ Message:= Message and not gmDown
end;
procedure chPrecise_p(var s: shortstring);
@@ -374,7 +374,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_Precise
+ Message:= Message or gmPrecise
end;
procedure chPrecise_m(var s: shortstring);
@@ -383,7 +383,7 @@
if CheckNoTeamOrHH then exit;
if not CurrentTeam^.ExtDriven then SendIPC('z');
with CurrentHedgehog^.Gear^ do
- Message:= Message and not gm_Precise
+ Message:= Message and not gmPrecise
end;
procedure chLJump(var s: shortstring);
@@ -394,7 +394,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_LJump
+ Message:= Message or gmLJump
end;
procedure chHJump(var s: shortstring);
@@ -405,7 +405,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_HJump
+ Message:= Message or gmHJump
end;
procedure chAttack_p(var s: shortstring);
@@ -421,7 +421,7 @@
begin
FollowGear:= CurrentHedgehog^.Gear;
if not CurrentTeam^.ExtDriven then SendIPC('A');
- Message:= Message or gm_Attack
+ Message:= Message or gmAttack
end
end
end;
@@ -433,8 +433,8 @@
with CurrentHedgehog^.Gear^ do
begin
if not CurrentTeam^.ExtDriven and
- ((Message and gm_Attack) <> 0) then SendIPC('a');
- Message:= Message and not gm_Attack
+ ((Message and gmAttack) <> 0) then SendIPC('a');
+ Message:= Message and not gmAttack
end
end;
@@ -446,7 +446,7 @@
if ReadyTimeLeft > 1 then ReadyTimeLeft:= 1;
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
- Message:= Message or gm_Switch
+ Message:= Message or gmSwitch
end;
procedure chNextTurn(var s: shortstring);
@@ -493,7 +493,7 @@
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
begin
- Message:= Message or gm_Timer;
+ Message:= Message or gmTimer;
MsgParam:= byte(s[1]) - ord('0')
end
end;
@@ -509,7 +509,7 @@
bShowFinger:= false;
with CurrentHedgehog^.Gear^ do
begin
- Message:= Message or gm_Slot;
+ Message:= Message or gmSlot;
MsgParam:= slot
end
end;
@@ -524,7 +524,7 @@
with CurrentHedgehog^.Gear^ do
begin
- Message:= Message or gm_Weapon;
+ Message:= Message or gmWeapon;
MsgParam:= byte(s[1]);
end;
end;
@@ -539,7 +539,7 @@
with CurrentHedgehog^.Gear^ do
begin
- Message:= Message or gm_Animate;
+ Message:= Message or gmAnimate;
MsgParam:= byte(s[1])
end
end;
@@ -624,7 +624,7 @@
{$IFDEF DEBUGFILE}AddFilelog('put: ' + inttostr(TargetPoint.X) + ', ' + inttostr(TargetPoint.Y));{$ENDIF}
State:= State and not gstHHChooseTarget;
if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackingPut) <> 0 then
- Message:= Message or gm_Attack;
+ Message:= Message or gmAttack;
end
else
if CurrentTeam^.ExtDriven then
--- a/hedgewars/GSHandlers.inc Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/GSHandlers.inc Thu Sep 23 01:30:35 2010 +0200
@@ -757,7 +757,7 @@
if (HHGear^.Angle - 32 >= 0) then dec(HHGear^.Angle,32)
end;
- if (HHGear^.Message and gm_Attack) <> 0 then
+ if (HHGear^.Message and gmAttack) <> 0 then
begin
shell := AddVisualGear(hwRound(Gear^.x), hwRound(Gear^.y), vgtShell);
if shell <> nil then
@@ -841,7 +841,7 @@
AllInactive := false;
HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
dec(Gear^.Timer);
- if (Gear^.Timer = 0)or((Gear^.Message and gm_Destroy) <> 0)or((HHGear^.State and gstHHDriven) =
+ if (Gear^.Timer = 0)or((Gear^.Message and gmDestroy) <> 0)or((HHGear^.State and gstHHDriven) =
0) then
begin
StopSound(Gear^.SoundChannel);
@@ -894,14 +894,14 @@
HHGear^.X := Gear^.X;
HHGear^.Y := Gear^.Y - int2hwFloat(cHHRadius);
- if (Gear^.Message and gm_Attack) <> 0 then
+ if (Gear^.Message and gmAttack) <> 0 then
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.Timer := 1
else
else
if (Gear^.State and gsttmpFlag) = 0 then Gear^.State := Gear^.State or gsttmpFlag;
- if ((Gear^.Message and gm_Left) <> 0) then Gear^.dX := - _0_3
+ if ((Gear^.Message and gmLeft) <> 0) then Gear^.dX := - _0_3
else
- if ((Gear^.Message and gm_Right) <> 0) then Gear^.dX := _0_3
+ if ((Gear^.Message and gmRight) <> 0) then Gear^.dX := _0_3
else Gear^.dX := _0;
end;
@@ -968,9 +968,9 @@
begin
b := true;
if Gear^.dX.isNegative then
- HHGear^.Message := (HHGear^.Message and (gm_Attack or gm_Up or gm_Down)) or gm_Left
+ HHGear^.Message := (HHGear^.Message and (gmAttack or gmUp or gmDown)) or gmLeft
else
- HHGear^.Message := (HHGear^.Message and (gm_Attack or gm_Up or gm_Down)) or gm_Right;
+ HHGear^.Message := (HHGear^.Message and (gmAttack or gmUp or gmDown)) or gmRight;
if ((HHGear^.State and gstMoving) = 0) then
begin
@@ -1011,7 +1011,7 @@
Gear^.dX, Gear^.dY,
cHHRadius * 5, cHHRadius * 2 + 7);
- if (Gear^.Timer = 0) or ((HHGear^.Message and gm_Attack) <> 0) then
+ if (Gear^.Timer = 0) or ((HHGear^.Message and gmAttack) <> 0) then
begin
HHGear^.Message := 0;
HHGear^.State := HHGear^.State and (not gstNotKickable);
@@ -1061,7 +1061,7 @@
HHGear^.Y := HHGear^.Y + HHGear^.dY;
HHGear^.dY := HHGear^.dY + cGravity;
- if (Gear^.Message and gm_Attack) <> 0 then
+ if (Gear^.Message and gmAttack) <> 0 then
begin
Gear^.X := HHGear^.X;
Gear^.Y := HHGear^.Y;
@@ -1089,7 +1089,7 @@
begin
with HHGear^ do
begin
- Message := Message and not gm_Attack;
+ Message := Message and not gmAttack;
State := (State or gstMoving) and not gstWinner;
end;
DeleteGear(Gear)
@@ -1099,7 +1099,7 @@
begin
with HHGear^ do
begin
- Message := Message and not gm_Attack;
+ Message := Message and not gmAttack;
State := State or gstMoving;
end;
RopePoints.Count := 0;
@@ -1118,9 +1118,9 @@
exit
end;
- if (Gear^.Message and gm_Left <> 0) then HHGear^.dX := HHGear^.dX - _0_0002
+ if (Gear^.Message and gmLeft <> 0) then HHGear^.dX := HHGear^.dX - _0_0002
else
- if (Gear^.Message and gm_Right <> 0) then HHGear^.dX := HHGear^.dX + _0_0002;
+ if (Gear^.Message and gmRight <> 0) then HHGear^.dX := HHGear^.dX + _0_0002;
if not TestCollisionYwithGear(HHGear, 1) then HHGear^.dY := HHGear^.dY + cGravity;
@@ -1143,12 +1143,12 @@
tx := HHGear^.X;
ty := HHGear^.Y;
- if ((Gear^.Message and gm_Down) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
+ if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
or TestCollisionYwithGear(HHGear, hwSign(ropeDy))) then
Gear^.Elasticity := Gear^.Elasticity + _0_3;
- if ((Gear^.Message and gm_Up) <> 0) and (Gear^.Elasticity > _30) then
+ if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
or TestCollisionYwithGear(HHGear, -hwSign(ropeDy))) then
Gear^.Elasticity := Gear^.Elasticity - _0_3;
@@ -1250,8 +1250,8 @@
end;
if haveCollision
- and (Gear^.Message and (gm_Left or gm_Right) <> 0)
- and (Gear^.Message and (gm_Up or gm_Down) <> 0) then
+ and (Gear^.Message and (gmLeft or gmRight) <> 0)
+ and (Gear^.Message and (gmUp or gmDown) <> 0) then
begin
HHGear^.dX := SignAs(hwAbs(HHGear^.dX) + _0_2, HHGear^.dX);
HHGear^.dY := SignAs(hwAbs(HHGear^.dY) + _0_2, HHGear^.dY)
@@ -1266,7 +1266,7 @@
end;
- if (Gear^.Message and gm_Attack) <> 0 then
+ if (Gear^.Message and gmAttack) <> 0 then
if (Gear^.State and gsttmpFlag) <> 0 then
with PHedgehog(Gear^.Hedgehog)^ do
begin
@@ -1371,14 +1371,14 @@
end;
if (Gear^.Elasticity > Gear^.Friction)
- or ((Gear^.Message and gm_Attack) = 0)
+ or ((Gear^.Message and gmAttack) = 0)
or ((HHGear^.State and gstHHDriven) = 0)
or (HHGear^.Damage > 0) then
begin
with PHedgehog(Gear^.Hedgehog)^.Gear^ do
begin
State := State and not gstAttacking;
- Message := Message and not gm_Attack
+ Message := Message and not gmAttack
end;
DeleteGear(Gear)
end
@@ -1597,14 +1597,14 @@
k := Gear^.Kind;
exBoom := false;
- if (Gear^.Message and gm_Destroy) > 0 then
+ if (Gear^.Message and gmDestroy) > 0 then
begin
DeleteGear(Gear);
FreeActionsList;
SetAllToActive;
// something (hh, mine, etc...) could be on top of the case
with CurrentHedgehog^ do
- if Gear <> nil then Gear^.Message := Gear^.Message and not (gm_LJump or gm_HJump);
+ if Gear <> nil then Gear^.Message := Gear^.Message and not (gmLJump or gmHJump);
exit
end;
@@ -1898,7 +1898,7 @@
HHGear: PGear;
begin
AllInactive := false;
- if ((Gear^.Message and gm_Destroy) <> 0) then
+ if ((Gear^.Message and gmDestroy) <> 0) then
begin
DeleteGear(Gear);
AfterAttack;
@@ -1965,7 +1965,7 @@
if TestCollisionYwithGear(HHGear, 1)
or ((HHGear^.State and gstHHDriven) = 0)
or CheckGearDrowning(HHGear)
- or ((Gear^.Message and gm_Attack) <> 0) then
+ or ((Gear^.Message and gmAttack) <> 0) then
begin
with HHGear^ do
begin
@@ -1983,10 +1983,10 @@
if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
HHGear^.X := HHGear^.X + cWindSpeed * 200;
- if (Gear^.Message and gm_Left) <> 0 then HHGear^.X := HHGear^.X - cMaxWindSpeed * 80
- else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X := HHGear^.X + cMaxWindSpeed * 80;
- if (Gear^.Message and gm_Up) <> 0 then HHGear^.Y := HHGear^.Y - cGravity * 40
- else if (Gear^.Message and gm_Down) <> 0 then HHGear^.Y := HHGear^.Y + cGravity * 40;
+ if (Gear^.Message and gmLeft) <> 0 then HHGear^.X := HHGear^.X - cMaxWindSpeed * 80
+ else if (Gear^.Message and gmRight) <> 0 then HHGear^.X := HHGear^.X + cMaxWindSpeed * 80;
+ if (Gear^.Message and gmUp) <> 0 then HHGear^.Y := HHGear^.Y - cGravity * 40
+ else if (Gear^.Message and gmDown) <> 0 then HHGear^.Y := HHGear^.Y + cGravity * 40;
HHGear^.Y := HHGear^.Y + cGravity * 100;
Gear^.X := HHGear^.X;
@@ -2004,7 +2004,7 @@
AfterAttack;
HHGear^.State := HHGear^.State and not (gstAttacking or gstAttacked or gstMoving);
- HHGear^.Message := HHGear^.Message and not gm_Attack;
+ HHGear^.Message := HHGear^.Message and not gmAttack;
Gear^.doStep := @doStepParachuteWork;
@@ -2104,7 +2104,7 @@
sprAmGirder, Gear^.State, true) then
begin
PlaySound(sndDenied);
- HHGear^.Message := HHGear^.Message and not gm_Attack;
+ HHGear^.Message := HHGear^.Message and not gmAttack;
HHGear^.State := HHGear^.State and not gstAttacking;
HHGear^.State := HHGear^.State or gstHHChooseTarget;
isCursorVisible := true;
@@ -2118,7 +2118,7 @@
end;
HHGear^.State := HHGear^.State and not (gstAttacking or gstAttacked);
- HHGear^.Message := HHGear^.Message and not gm_Attack;
+ HHGear^.Message := HHGear^.Message and not gmAttack;
TargetPoint.X := NoPointX
end;
@@ -2163,7 +2163,7 @@
TargetPoint.Y - SpritesData[sprHHTelepMask].Height div 2,
sprHHTelepMask, 0, false) then
begin
- HHGear^.Message := HHGear^.Message and not gm_Attack;
+ HHGear^.Message := HHGear^.Message and not gmAttack;
HHGear^.State := HHGear^.State and not gstAttacking;
HHGear^.State := HHGear^.State or gstHHChooseTarget;
DeleteGear(Gear);
@@ -2198,10 +2198,10 @@
begin
AllInactive := false;
- if ((Gear^.Message and not gm_Switch) <> 0) or (TurnTimeLeft = 0) then
+ if ((Gear^.Message and not gmSwitch) <> 0) or (TurnTimeLeft = 0) then
begin
HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
- Msg := Gear^.Message and not gm_Switch;
+ Msg := Gear^.Message and not gmSwitch;
DeleteGear(Gear);
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^);
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^);
@@ -2212,11 +2212,11 @@
exit
end;
- if (Gear^.Message and gm_Switch) <> 0 then
+ if (Gear^.Message and gmSwitch) <> 0 then
begin
HHGear := CurrentHedgehog^.Gear;
- HHGear^.Message := HHGear^.Message and not gm_Switch;
- Gear^.Message := Gear^.Message and not gm_Switch;
+ HHGear^.Message := HHGear^.Message and not gmSwitch;
+ Gear^.Message := Gear^.Message and not gmSwitch;
State := HHGear^.State;
HHGear^.State := 0;
HHGear^.Active := false;
@@ -2255,7 +2255,7 @@
with HHGear^ do
begin
State := State and not gstAttacking;
- Message := Message and not gm_Attack
+ Message := Message and not gmAttack
end
end;
@@ -2511,7 +2511,7 @@
Gear^.Timer := Gear^.Health*10;
Gear^.PortalCounter:= 0;
// This is not seconds, but at least it is *some* feedback
- if (Gear^.Health = 0) or ((Gear^.Message and gm_Attack) <> 0) then
+ if (Gear^.Health = 0) or ((Gear^.Message and gmAttack) <> 0) then
begin
FollowGear := Gear;
Gear^.RenderTimer := false;
@@ -2563,7 +2563,7 @@
AllInactive := false;
HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
- HHGear^.Message := HHGear^.Message and (not gm_Attack);
+ HHGear^.Message := HHGear^.Message and (not gmAttack);
DeleteCI(HHGear);
Gear^.IntersectGear:= nil;
@@ -2776,7 +2776,7 @@
HHGear: PGear;
begin
HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
- HHGear^.Message := HHGear^.Message and not (gm_Up or gm_Down);
+ HHGear^.Message := HHGear^.Message and not (gmUp or gmDown);
HHGear^.State := HHGear^.State or gstNotKickable;
Gear^.doStep := @doStepBallgunWork
end;
@@ -2814,13 +2814,13 @@
end
else
begin
- if ((Gear^.Message and gm_Left) <> 0) then
+ if ((Gear^.Message and gmLeft) <> 0) then
begin
fChanged := true;
Gear^.Angle := (Gear^.Angle + (4096 - cAngleSpeed)) mod 4096
end;
- if ((Gear^.Message and gm_Right) <> 0) then
+ if ((Gear^.Message and gmRight) <> 0) then
begin
fChanged := true;
Gear^.Angle := (Gear^.Angle + cAngleSpeed) mod 4096
@@ -2850,15 +2850,15 @@
else
AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
- if ((HHGear^.Message and gm_Attack) <> 0) and (Gear^.Health <> 0) then
+ if ((HHGear^.Message and gmAttack) <> 0) and (Gear^.Health <> 0) then
begin
- HHGear^.Message := HHGear^.Message and not gm_Attack;
+ HHGear^.Message := HHGear^.Message and not gmAttack;
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY *
_0_5, 0);
dec(Gear^.Health)
end;
- if ((HHGear^.Message and gm_LJump) <> 0)
+ if ((HHGear^.Message and gmLJump) <> 0)
and ((Gear^.State and gsttmpFlag) = 0) then
begin
Gear^.State := Gear^.State or gsttmpFlag;
@@ -2956,27 +2956,27 @@
//dec(Gear^.Timer);
move := _0_1;
fuel := 50;
-(*if (HHGear^.Message and gm_Precise) <> 0 then
+(*if (HHGear^.Message and gmPrecise) <> 0 then
begin
move:= _0_02;
fuel:= 5;
end;*)
- if (HHGear^.Message and gm_Up) <> 0 then
+ if (HHGear^.Message and gmUp) <> 0 then
begin
if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then
HHGear^.dY := HHGear^.dY - move;
HHGear^.dY := HHGear^.dY - move;
dec(Gear^.Health, fuel);
- Gear^.MsgParam := Gear^.MsgParam or gm_Up;
+ Gear^.MsgParam := Gear^.MsgParam or gmUp;
Gear^.Timer := GameTicks
end;
- if (HHGear^.Message and gm_Left) <> 0 then move.isNegative := true;
- if (HHGear^.Message and (gm_Left or gm_Right)) <> 0 then
+ if (HHGear^.Message and gmLeft) <> 0 then move.isNegative := true;
+ if (HHGear^.Message and (gmLeft or gmRight)) <> 0 then
begin
HHGear^.dX := HHGear^.dX + (move * _0_2);
dec(Gear^.Health, fuel div 5);
- Gear^.MsgParam := Gear^.MsgParam or (HHGear^.Message and (gm_Left or gm_Right));
+ Gear^.MsgParam := Gear^.MsgParam or (HHGear^.Message and (gmLeft or gmRight));
Gear^.Timer := GameTicks
end;
@@ -2996,9 +2996,9 @@
'%', cWhiteColor, fntSmall)
end;
- if HHGear^.Message and (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right) <> 0 then Gear^
+ if HHGear^.Message and (gmAttack or gmUp or gmPrecise or gmLeft or gmRight) <> 0 then Gear^
.State := Gear^.State and not gsttmpFlag;
- HHGear^.Message := HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
+ HHGear^.Message := HHGear^.Message and not (gmUp or gmPrecise or gmLeft or gmRight);
HHGear^.State := HHGear^.State or gstMoving;
Gear^.X := HHGear^.X;
@@ -3015,7 +3015,7 @@
// allow brief ground touches - to be fair on this, might need another counter
or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and TestCollisionYwithGear(
HHGear, 1))
- or ((Gear^.Message and gm_Attack) <> 0) then
+ or ((Gear^.Message and gmAttack) <> 0) then
begin
with HHGear^ do
begin
@@ -3047,7 +3047,7 @@
with HHGear^ do
begin
State := State and not gstAttacking;
- Message := Message and not (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right);
+ Message := Message and not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight);
if (dY < _0_1) and (dY > -_0_1) then
begin
Gear^.State := Gear^.State or gsttmpFlag;
@@ -3083,7 +3083,7 @@
if Gear^.Pos > 0 then
dec(Gear^.Pos, 1)
- else if (HHGear^.Message and (gm_Left or gm_Right or gm_Up)) <> 0 then
+ else if (HHGear^.Message and (gmLeft or gmRight or gmUp)) <> 0 then
Gear^.Pos := 500;
if HHGear^.dX.isNegative then
@@ -3091,20 +3091,20 @@
else
Gear^.Tag := 1;
- if (HHGear^.Message and gm_Up) <> 0 then
+ if (HHGear^.Message and gmUp) <> 0 then
begin
if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then
HHGear^.dY := HHGear^.dY - move;
HHGear^.dY := HHGear^.dY - move;
dec(Gear^.Health, fuel);
- Gear^.MsgParam := Gear^.MsgParam or gm_Up;
+ Gear^.MsgParam := Gear^.MsgParam or gmUp;
end;
- if (HHGear^.Message and gm_Left) <> 0 then move.isNegative := true;
- if (HHGear^.Message and (gm_Left or gm_Right)) <> 0 then
+ if (HHGear^.Message and gmLeft) <> 0 then move.isNegative := true;
+ if (HHGear^.Message and (gmLeft or gmRight)) <> 0 then
begin
HHGear^.dX := HHGear^.dX + (move * _0_2);
dec(Gear^.Health, fuel div 5);
- Gear^.MsgParam := Gear^.MsgParam or (HHGear^.Message and (gm_Left or gm_Right));
+ Gear^.MsgParam := Gear^.MsgParam or (HHGear^.Message and (gmLeft or gmRight));
end;
if Gear^.Health < 0 then Gear^.Health := 0;
@@ -3112,9 +3112,9 @@
for i:= ((500-Gear^.Health) div 250) downto 0 do
AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFeather);
- if (HHGear^.Message and gm_Attack <> 0) then
+ if (HHGear^.Message and gmAttack <> 0) then
begin
- HHGear^.Message := HHGear^.Message and not gm_Attack;
+ HHGear^.Message := HHGear^.Message and not gmAttack;
if Gear^.FlightTime > 0 then
begin
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) + 32, gtEgg, 0, Gear^.dX * _0_5, Gear^.dY, 0)
@@ -3124,9 +3124,9 @@
end;
end;
- if HHGear^.Message and (gm_Up or gm_Precise or gm_Left or gm_Right) <> 0 then
+ if HHGear^.Message and (gmUp or gmPrecise or gmLeft or gmRight) <> 0 then
Gear^.State := Gear^.State and not gsttmpFlag;
- HHGear^.Message := HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
+ HHGear^.Message := HHGear^.Message and not (gmUp or gmPrecise or gmLeft or gmRight);
HHGear^.State := HHGear^.State or gstMoving;
Gear^.X := HHGear^.X;
@@ -3143,7 +3143,7 @@
// allow brief ground touches - to be fair on this, might need another counter
or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and TestCollisionYwithGear(
HHGear, 1))
- or ((Gear^.Message and gm_Attack) <> 0) then
+ or ((Gear^.Message and gmAttack) <> 0) then
begin
with HHGear^ do
begin
@@ -3179,7 +3179,7 @@
exit
end;
HHGear := CurrentHedgehog^.Gear;
- HHGear^.Message := HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
+ HHGear^.Message := HHGear^.Message and not (gmUp or gmPrecise or gmLeft or gmRight);
if abs(hwRound(HHGear^.Y - Gear^.Y)) > 32 then
begin
if Gear^.Timer = 0 then
@@ -3232,7 +3232,7 @@
with HHGear^ do
begin
State := State and not gstAttacking;
- Message := Message and not (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right)
+ Message := Message and not (gmAttack or gmUp or gmPrecise or gmLeft or gmRight)
end
end;
@@ -3275,11 +3275,11 @@
begin
if (CurrentHedgehog <> nil)
and (CurrentHedgehog^.Gear <> nil)
- and ((CurrentHedgehog^.Gear^.Message and gm_Switch) <> 0) then
+ and ((CurrentHedgehog^.Gear^.Message and gmSwitch) <> 0) then
With CurrentHedgehog^ do
if (CurAmmoType = amPortalGun) then
begin
- CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gm_Switch;
+ CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gmSwitch;
CurWeapon:= GetAmmoEntry(CurrentHedgehog^);
flags := CurWeapon^.Timer and not 2;
@@ -3616,7 +3616,7 @@
begin
AllInactive := false;
if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and ((CurrentHedgehog^.Gear^.
- Message and gm_Slot) <> 0) then
+ Message and gmSlot) <> 0) then
begin
case CurrentHedgehog^.Gear^.MsgParam of
0: PlaySound(sndPiano0);
@@ -3631,7 +3631,7 @@
end;
AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtNote);
CurrentHedgehog^.Gear^.MsgParam := 0;
- CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gm_Slot;
+ CurrentHedgehog^.Gear^.Message := CurrentHedgehog^.Gear^.Message and not gmSlot;
end;
if (*((Gear^.Pos = 3) and ((GameFlags and gfSolidLand) <> 0)) or*) (Gear^.Pos = 5) then
@@ -3840,12 +3840,12 @@
if (GameTicks and $FF) = 0 then
begin
- if (HHGear^.Message and gm_Right) <> 0 then
+ if (HHGear^.Message and gmRight) <> 0 then
begin
if HHGear^.dX.isNegative and (Gear^.Tag < 20) then inc(Gear^.Tag)
else if Gear^.Tag > 5 then dec(Gear^.Tag);
end
- else if (HHGear^.Message and gm_Left) <> 0 then
+ else if (HHGear^.Message and gmLeft) <> 0 then
begin
if HHGear^.dX.isNegative and (Gear^.Tag > 5) then dec(Gear^.Tag)
else if Gear^.Tag < 20 then inc(Gear^.Tag);
@@ -3893,7 +3893,7 @@
HHGear: PGear;
begin
HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
- HHGear^.Message := HHGear^.Message and not (gm_Up or gm_Down or gm_Left or gm_Right);
+ HHGear^.Message := HHGear^.Message and not (gmUp or gmDown or gmLeft or gmRight);
HHGear^.State := HHGear^.State or gstNotKickable;
Gear^.doStep := @doStepFlamethrowerWork
end;
@@ -3964,7 +3964,7 @@
AllInactive := false;
HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
dec(Gear^.Timer);
- if (HHGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gm_Destroy) <> 0) then
+ if (HHGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gmDestroy) <> 0) then
begin
DeleteGear(Gear);
exit
--- a/hedgewars/GearDrawing.inc Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/GearDrawing.inc Thu Sep 23 01:30:35 2010 +0200
@@ -345,7 +345,7 @@
defaultPos:= false
end else
- if (Gear^.Message and (gm_Left or gm_Right) <> 0) and (not isCursorVisible) then
+ if (Gear^.Message and (gmLeft or gmRight) <> 0) and (not isCursorVisible) then
begin
DrawHedgehog(sx, sy,
hwSign(Gear^.dX),
@@ -599,9 +599,9 @@
case CurAmmoGear^.Kind of
gtJetpack: begin
DrawSprite(sprJetpack, sx-32, sy-32, 0);
- if (CurAmmoGear^.MsgParam and gm_Up) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 1);
- if (CurAmmoGear^.MsgParam and gm_Left) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 2);
- if (CurAmmoGear^.MsgParam and gm_Right) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 3);
+ if (CurAmmoGear^.MsgParam and gmUp) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 1);
+ if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 2);
+ if (CurAmmoGear^.MsgParam and gmRight) <> 0 then DrawSprite(sprJetpack, sx-32, sy-32, 3);
if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex);
DrawAltWeapon(Gear, sx, sy)
end;
--- a/hedgewars/HHHandlers.inc Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/HHHandlers.inc Thu Sep 23 01:30:35 2010 +0200
@@ -48,7 +48,7 @@
with PHedgehog(Gear^.Hedgehog)^ do
begin
- Gear^.Message:= Gear^.Message and not gm_Slot;
+ Gear^.Message:= Gear^.Message and not gmSlot;
ammoidx:= 0;
while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do inc(ammoidx);
@@ -59,7 +59,7 @@
if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0) and (MultiShootAttacks > 0) then OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^);
MultiShootAttacks:= 0;
- Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);
+ Gear^.Message:= Gear^.Message and not (gmLJump or gmHJump);
if Ammoz[CurAmmoType].Slot = slot then
begin
@@ -101,7 +101,7 @@
t:= cMaxSlotAmmoIndex;
-Gear^.Message:= Gear^.Message and not gm_Weapon;
+Gear^.Message:= Gear^.Message and not gmWeapon;
with Hedgehog^ do
while (CurAmmoType <> weap) and (t >= 0) do
@@ -116,7 +116,7 @@
procedure HHSetTimer(Gear: PGear);
var CurWeapon: PAmmo;
begin
-Gear^.Message:= Gear^.Message and not gm_Timer;
+Gear^.Message:= Gear^.Message and not gmTimer;
CurWeapon:= GetAmmoEntry(PHedgehog(Gear^.Hedgehog)^);
with PHedgehog(Gear^.Hedgehog)^ do
if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then
@@ -147,8 +147,8 @@
((TargetPoint.X <> NoPointX) or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) = 0)) then
begin
State:= State or gstAttacking;
- if Power = cMaxPower then Message:= Message and not gm_Attack
- else if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) = 0 then Message:= Message and not gm_Attack
+ if Power = cMaxPower then Message:= Message and not gmAttack
+ else if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) = 0 then Message:= Message and not gmAttack
else begin
if Power = 0 then
begin
@@ -157,7 +157,7 @@
end;
inc(Power)
end;
- if ((Message and gm_Attack) <> 0) then exit;
+ if ((Message and gmAttack) <> 0) then exit;
if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0 then
begin
@@ -285,14 +285,14 @@
and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) = 0){check for dropping ammo from rope} then
begin
CurAmmoGear^.AmmoType:= CurAmmoType;
- Message:= Message or gm_Attack;
+ Message:= Message or gmAttack;
CurAmmoGear^.Message:= Message
end else begin
if not CurrentTeam^.ExtDriven and
((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0) then SendIPC('a');
AfterAttack;
end
- end else Message:= Message and not gm_Attack;
+ end else Message:= Message and not gmAttack;
end
end;
@@ -409,7 +409,7 @@
i: LongInt;
vga: PVisualGear;
begin
-Gear^.Message:= gm_Destroy;
+Gear^.Message:= gmDestroy;
PlaySound(sndShotgunReload);
case Gear^.Pos of
posCaseUtility,
@@ -465,17 +465,17 @@
with PHedgehog(Gear^.Hedgehog)^ do
with CurWeapon^ do
begin
- if (Gear^.Message and gm_Left ) <> 0 then
+ if (Gear^.Message and gmLeft ) <> 0 then
Pos:= (Pos - 1 + Ammoz[AmmoType].PosCount) mod Ammoz[AmmoType].PosCount
else
- if (Gear^.Message and gm_Right ) <> 0 then
+ if (Gear^.Message and gmRight ) <> 0 then
Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount
else exit;
StepTicks:= 200;
exit
end;
- if ((Gear^.Message and gm_Animate) <> 0) then
+ if ((Gear^.Message and gmAnimate) <> 0) then
begin
Gear^.Message:= 0;
Gear^.State:= Gear^.State or gstAnimation;
@@ -484,9 +484,9 @@
Gear^.Pos:= 0
end;
- if ((Gear^.Message and gm_LJump ) <> 0) then
+ if ((Gear^.Message and gmLJump ) <> 0) then
begin
- Gear^.Message:= Gear^.Message and not gm_LJump;
+ Gear^.Message:= Gear^.Message and not gmLJump;
DeleteCI(Gear);
if not TestCollisionYwithGear(Gear, -1) then
if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then Gear^.Y:= Gear^.Y - _2 else
@@ -502,10 +502,10 @@
end;
end;
- if ((Gear^.Message and gm_HJump ) <> 0) then
+ if ((Gear^.Message and gmHJump ) <> 0) then
begin
DeleteCI(Gear);
- Gear^.Message:= Gear^.Message and not gm_HJump;
+ Gear^.Message:= Gear^.Message and not gmHJump;
Gear^.dY:= -_0_2;
SetLittle(Gear^.dX);
@@ -515,10 +515,10 @@
end;
PrevdX:= hwSign(Gear^.dX);
- if (Gear^.Message and gm_Left )<>0 then Gear^.dX:= -cLittle else
- if (Gear^.Message and gm_Right )<>0 then Gear^.dX:= cLittle else exit;
+ if (Gear^.Message and gmLeft )<>0 then Gear^.dX:= -cLittle else
+ if (Gear^.Message and gmRight )<>0 then Gear^.dX:= cLittle else exit;
- if (Gear^.Message and (gm_Left or gm_Right)) <> 0 then
+ if (Gear^.Message and (gmLeft or gmRight)) <> 0 then
begin
StepSoundTimer:= cHHStepTicks;
end;
@@ -548,7 +548,7 @@
or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1;
end;
- if (not cArtillery) and ((Gear^.Message and gm_Precise) = 0) and (not TestCollisionXwithGear(Gear, hwSign(Gear^.dX))) then
+ if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) and (not TestCollisionXwithGear(Gear, hwSign(Gear^.dX))) then
Gear^.X:= Gear^.X + SignAs(_1, Gear^.dX);
SetAllHHToActive;
@@ -595,10 +595,10 @@
if (CurAmmoType = amRope)
and ((Gear^.State and (gstMoving or gstHHJumping)) = gstMoving) then da:= 2 else da:= 1;
-if (((Gear^.Message and gm_Precise) = 0) or ((GameTicks mod 5) = 1)) then
- if ((Gear^.Message and gm_Up) <> 0) and (Gear^.Angle >= CurMinAngle + da) then dec(Gear^.Angle, da)
+if (((Gear^.Message and gmPrecise) = 0) or ((GameTicks mod 5) = 1)) then
+ if ((Gear^.Message and gmUp) <> 0) and (Gear^.Angle >= CurMinAngle + da) then dec(Gear^.Angle, da)
else
- if ((Gear^.Message and gm_Down) <> 0) and (Gear^.Angle + da <= CurMaxAngle) then inc(Gear^.Angle, da)
+ if ((Gear^.Message and gmDown) <> 0) and (Gear^.Angle + da <= CurMaxAngle) then inc(Gear^.Angle, da)
end;
procedure doStepHedgehog(Gear: PGear); forward;
@@ -752,7 +752,7 @@
with Hedgehog^ do
if (CurAmmoGear = nil)
and (Gear^.dY > _0_39)
- and (CurAmmoType = amParachute) then Gear^.Message:= Gear^.Message or gm_Attack;
+ and (CurAmmoType = amParachute) then Gear^.Message:= Gear^.Message or gmAttack;
// check for case with ammo
t:= CheckGearNear(Gear, gtCase, 36, 36);
if t <> nil then
@@ -760,17 +760,17 @@
end;
if (CurAmmoGear = nil) then
- if (((Gear^.Message and gm_Attack) <> 0)
+ if (((Gear^.Message and gmAttack) <> 0)
or ((Gear^.State and gstAttacking) <> 0)) then
Attack(Gear) // should be before others to avoid desync with '/put' msg and changing weapon msgs
else
else
with Hedgehog^ do
if ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
- and ((Gear^.Message and gm_LJump) <> 0)
+ and ((Gear^.Message and gmLJump) <> 0)
and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
begin
- Gear^.Message:= Gear^.Message and not gm_LJump;
+ Gear^.Message:= Gear^.Message and not gmLJump;
Attack(Gear)
end;
@@ -778,15 +778,15 @@
or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0) then
begin
- if ((Gear^.Message and gm_Slot) <> 0) then
+ if ((Gear^.Message and gmSlot) <> 0) then
begin
ChangeAmmo(Gear);
ApplyAmmoChanges(Hedgehog^)
end;
- if ((Gear^.Message and gm_Weapon) <> 0) then HHSetWeapon(Gear);
+ if ((Gear^.Message and gmWeapon) <> 0) then HHSetWeapon(Gear);
- if ((Gear^.Message and gm_Timer) <> 0) then HHSetTimer(Gear);
+ if ((Gear^.Message and gmTimer) <> 0) then HHSetTimer(Gear);
end;
if CurAmmoGear <> nil then
@@ -802,7 +802,7 @@
begin
wasJumping:= ((Gear^.State and gstHHJumping) <> 0);
- if ((Gear^.Message and gm_HJump) <> 0) and
+ if ((Gear^.Message and gmHJump) <> 0) and
wasJumping and
((Gear^.State and gstHHHJump) = 0) then
if (not (hwAbs(Gear^.dX) > cLittle)) and (Gear^.dY < -_0_02) then
@@ -813,7 +813,7 @@
PlaySound(sndJump2, Hedgehog^.Team^.voicepack)
end;
- Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);
+ Gear^.Message:= Gear^.Message and not (gmLJump or gmHJump);
if (not cArtillery) and wasJumping and
TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then SetLittle(Gear^.dX);
@@ -906,7 +906,7 @@
////////////////////////////////////////////////////////////////////////////////
procedure doStepHedgehog(Gear: PGear);
begin
-if (Gear^.Message and gm_Destroy) <> 0 then
+if (Gear^.Message and gmDestroy) <> 0 then
begin
DeleteGear(Gear);
exit
--- a/hedgewars/uAI.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uAI.pas Thu Sep 23 01:30:35 2010 +0200
@@ -212,7 +212,7 @@
Pop(ticks, Actions, Me^);
AddAction(Actions, Me^.Message, aim_push, 250, 0, 0);
- if (Me^.Message and gm_Left) <> 0 then AddAction(Actions, aia_WaitXL, hwRound(Me^.X), 0, 0, 0)
+ if (Me^.Message and gmLeft) <> 0 then AddAction(Actions, aia_WaitXL, hwRound(Me^.X), 0, 0, 0)
else AddAction(Actions, aia_WaitXR, hwRound(Me^.X), 0, 0, 0);
steps:= 0;
--- a/hedgewars/uAIMisc.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uAIMisc.pas Thu Sep 23 01:30:35 2010 +0200
@@ -404,8 +404,8 @@
end;
continue
end;
- if (Gear^.Message and gm_Left )<>0 then Gear^.dX:= -cLittle else
- if (Gear^.Message and gm_Right )<>0 then Gear^.dX:= cLittle else exit(bRes);
+ if (Gear^.Message and gmLeft )<>0 then Gear^.dX:= -cLittle else
+ if (Gear^.Message and gmRight )<>0 then Gear^.dX:= cLittle else exit(bRes);
if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
begin
if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX))
--- a/hedgewars/uConsole.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uConsole.pas Thu Sep 23 01:30:35 2010 +0200
@@ -194,11 +194,11 @@
procedure StopMessages(Message: Longword);
begin
-if (Message and gm_Left) <> 0 then ParseCommand('/-left', true) else
-if (Message and gm_Right) <> 0 then ParseCommand('/-right', true) else
-if (Message and gm_Up) <> 0 then ParseCommand('/-up', true) else
-if (Message and gm_Down) <> 0 then ParseCommand('/-down', true) else
-if (Message and gm_Attack) <> 0 then ParseCommand('/-attack', true)
+if (Message and gmLeft) <> 0 then ParseCommand('/-left', true) else
+if (Message and gmRight) <> 0 then ParseCommand('/-right', true) else
+if (Message and gmUp) <> 0 then ParseCommand('/-up', true) else
+if (Message and gmDown) <> 0 then ParseCommand('/-down', true) else
+if (Message and gmAttack) <> 0 then ParseCommand('/-attack', true)
end;
{$INCLUDE "CCHandlers.inc"}
--- a/hedgewars/uConsts.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uConsts.pas Thu Sep 23 01:30:35 2010 +0200
@@ -377,21 +377,21 @@
gstLoser = $00080000;
gstHHGone = $00100000;
- gm_Left = $00000001;
- gm_Right = $00000002;
- gm_Up = $00000004;
- gm_Down = $00000008;
- gm_Switch = $00000010;
- gm_Attack = $00000020;
- gm_LJump = $00000040;
- gm_HJump = $00000080;
- gm_Destroy= $00000100;
- gm_Slot = $00000200; // with param
- gm_Weapon = $00000400; // with param
- gm_Timer = $00000800; // with param
- gm_Animate= $00001000; // with param
- gm_Precise= $00002000;
- gmAllStoppable = gm_Left or gm_Right or gm_Up or gm_Down or gm_Attack or gm_Precise;
+ gmLeft = $00000001;
+ gmRight = $00000002;
+ gmUp = $00000004;
+ gmDown = $00000008;
+ gmSwitch = $00000010;
+ gmAttack = $00000020;
+ gmLJump = $00000040;
+ gmHJump = $00000080;
+ gmDestroy= $00000100;
+ gmSlot = $00000200; // with param
+ gmWeapon = $00000400; // with param
+ gmTimer = $00000800; // with param
+ gmAnimate= $00001000; // with param
+ gmPrecise= $00002000;
+ gmAllStoppable = gmLeft or gmRight or gmUp or gmDown or gmAttack or gmPrecise;
cMaxSlotIndex = 9;
cMaxSlotAmmoIndex = 5;
--- a/hedgewars/uGears.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uGears.pas Thu Sep 23 01:30:35 2010 +0200
@@ -566,8 +566,8 @@
else if Gear^.Kind = gtHedgehog then
if (CurAmmoGear <> nil) and (CurrentHedgehog^.Gear = Gear) then
begin
- Gear^.Message:= gm_Destroy;
- CurAmmoGear^.Message:= gm_Destroy;
+ Gear^.Message:= gmDestroy;
+ CurAmmoGear^.Message:= gmDestroy;
exit
end
else
--- a/hedgewars/uScript.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uScript.pas Thu Sep 23 01:30:35 2010 +0200
@@ -246,6 +246,39 @@
lc_getgeartype:= 1
end;
+function lc_getgearmessage(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+ if lua_gettop(L) <> 1 then
+ begin
+ LuaError('Lua: Wrong number of parameters passed to GetGearMessage!');
+ lua_pushnil(L); // return value on stack (nil)
+ end
+ else
+ begin
+ gear:= GearByUID(lua_tointeger(L, 1));
+ if gear <> nil then
+ lua_pushinteger(L, gear^.message)
+ else
+ lua_pushnil(L);
+ end;
+ lc_getgearmessage:= 1
+end;
+
+function lc_setgearmessage(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+ if lua_gettop(L) <> 2 then
+ LuaError('Lua: Wrong number of parameters passed to SetGearMessage!')
+ else
+ begin
+ gear:= GearByUID(lua_tointeger(L, 1));
+ if gear <> nil then
+ gear^.message:= lua_tointeger(L, 2);
+ end;
+ lc_setgearmessage:= 0
+end;
+
function lc_gethoglevel(L : Plua_State): LongInt; Cdecl;
var gear : PGear;
begin
@@ -1019,6 +1052,23 @@
ScriptSetInteger('gfDisableGirders', gfDisableGirders);
ScriptSetInteger('gfExplosives', gfExplosives);
+ScriptSetInteger('gmLeft', gmLeft);
+ScriptSetInteger('gmRight', gmRight);
+ScriptSetInteger('gmUp', gmUp);
+ScriptSetInteger('gmDown', gmDown);
+ScriptSetInteger('gmSwitch', gmSwitch);
+ScriptSetInteger('gmAttack', gmAttack);
+ScriptSetInteger('gmLJump', gmLJump);
+ScriptSetInteger('gmHJump', gmHJump);
+ScriptSetInteger('gmDestroy', gmDestroy);
+ScriptSetInteger('gmSlot', gmSlot);
+ScriptSetInteger('gmWeapon', gmWeapon);
+ScriptSetInteger('gmTimer', gmTimer);
+ScriptSetInteger('gmAnimate', gmAnimate);
+ScriptSetInteger('gmPrecise', gmPrecise);
+ScriptSetInteger('gmAllStoppable', gmAllStoppable);
+
+
// speech bubbles
ScriptSetInteger('SAY_SAY', 1);
ScriptSetInteger('SAY_THINK', 2);
@@ -1080,6 +1130,8 @@
lua_register(luaState, 'HogTurnLeft', @lc_hogturnleft);
lua_register(luaState, 'CampaignLock', @lc_campaignlock);
lua_register(luaState, 'CampaignUnlock', @lc_campaignunlock);
+lua_register(luaState, 'GetGearMessage', @lc_getgearmessage);
+lua_register(luaState, 'SetGearMessage', @lc_setgearmessage);
ScriptClearStack; // just to be sure stack is empty
--- a/hedgewars/uTeams.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uTeams.pas Thu Sep 23 01:30:35 2010 +0200
@@ -288,7 +288,7 @@
PlaySound(sndIllGetYou, CurrentTeam^.voicepack)
else
PlaySound(sndYesSir, CurrentTeam^.voicepack);
- ReadyTimeLeft:= cReadyDelay;
+ if PlacingHogs or (cHedgehogTurnTime < 1000000) then ReadyTimeLeft:= cReadyDelay;
AddCaption(Format(shortstring(trmsg[sidReady]), CurrentTeam^.TeamName), cWhiteColor, capgrpGameState)
end
else
--- a/hedgewars/uWorld.pas Thu Sep 23 01:29:20 2010 +0200
+++ b/hedgewars/uWorld.pas Thu Sep 23 01:30:35 2010 +0200
@@ -668,7 +668,7 @@
offsetX:= 48;
{$ENDIF}
offsetY:= cOffsetY;
-if (TurnTimeLeft <> 0) or (ReadyTimeLeft <> 0) then
+if ((TurnTimeLeft <> 0) and (TurnTimeLeft < 1000000)) or (ReadyTimeLeft <> 0) then
begin
if ReadyTimeLeft <> 0 then
i:= Succ(Pred(ReadyTimeLeft) div 1000)