99 end; |
99 end; |
100 end; |
100 end; |
101 end; |
101 end; |
102 gi := gi^.NextGear |
102 gi := gi^.NextGear |
103 end; |
103 end; |
|
104 end; |
|
105 |
|
106 procedure HideHog(HH: PHedgehog); |
|
107 begin |
|
108 ScriptCall('onHogHide', HH^.Gear^.Uid); |
|
109 DeleteCI(HH^.Gear); |
|
110 if FollowGear = HH^.Gear then FollowGear:= nil; |
|
111 if lastGearByUID = HH^.Gear then lastGearByUID := nil; |
|
112 RemoveGearFromList(HH^.Gear); |
|
113 with HH^.Gear^ do |
|
114 begin |
|
115 Z := cHHZ; |
|
116 Active := false; |
|
117 State:= State and not (gstHHDriven or gstAttacking or gstAttacked); |
|
118 Message := Message and not gmAttack; |
|
119 end; |
|
120 HH^.GearHidden:= HH^.Gear; |
|
121 HH^.Gear:= nil; |
|
122 end; |
|
123 |
|
124 procedure RestoreHog(HH: PHedgehog); |
|
125 begin |
|
126 HH^.Gear:=HH^.GearHidden; |
|
127 HH^.GearHidden:= nil; |
|
128 InsertGearToList(HH^.Gear); |
|
129 HH^.Gear^.State:= (HH^.Gear^.State and not (gstHHDriven or gstInvisible or gstAttacking)) or gstAttacked; |
|
130 AddGearCI(HH^.Gear); |
|
131 HH^.Gear^.Active:= true; |
|
132 ScriptCall('onHogRestore', HH^.Gear^.Uid) |
104 end; |
133 end; |
105 |
134 |
106 //////////////////////////////////////////////////////////////////////////////// |
135 //////////////////////////////////////////////////////////////////////////////// |
107 procedure doStepDrowningGear(Gear: PGear); |
136 procedure doStepDrowningGear(Gear: PGear); |
108 forward; |
137 forward; |
4943 StopSound(Gear^.SoundChannel); |
4972 StopSound(Gear^.SoundChannel); |
4944 if (Gear^.Timer = 0) then |
4973 if (Gear^.Timer = 0) then |
4945 begin |
4974 begin |
4946 if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then |
4975 if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible = 0) then |
4947 begin |
4976 begin |
4948 AfterAttack; |
4977 AfterAttack; |
4949 if Gear = CurAmmoGear then CurAmmoGear := nil; |
4978 if Gear = CurAmmoGear then CurAmmoGear := nil; |
4950 DeleteCI(HH^.Gear); |
4979 HideHog(HH) |
4951 if FollowGear = HH^.Gear then FollowGear:= nil; |
|
4952 if lastGearByUID = HH^.Gear then lastGearByUID := nil; |
|
4953 RemoveGearFromList(HH^.Gear); |
|
4954 with HH^.Gear^ do |
|
4955 begin |
|
4956 Z := cHHZ; |
|
4957 Active := false; |
|
4958 State:= State and not (gstHHDriven or gstAttacking or gstAttacked); |
|
4959 Message := Message and not gmAttack; |
|
4960 end; |
|
4961 HH^.GearHidden:= HH^.Gear; |
|
4962 HH^.Gear:= nil |
|
4963 end |
4980 end |
4964 //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then |
4981 //else if (HH^.Gear <> nil) and (HH^.Gear^.State and gstInvisible <> 0) then |
4965 else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then |
4982 else if (HH^.GearHidden <> nil) then// and (HH^.Gear^.State and gstInvisible <> 0) then |
4966 begin |
4983 RestoreHog(HH) |
4967 HH^.Gear:=HH^.GearHidden; |
|
4968 HH^.GearHidden:= nil; |
|
4969 InsertGearToList(HH^.Gear); |
|
4970 HH^.Gear^.State:= (HH^.Gear^.State and not (gstHHDriven or gstInvisible or gstAttacking)) or gstAttacked; |
|
4971 AddGearCI(HH^.Gear); |
|
4972 HH^.Gear^.Active:= true |
|
4973 end; |
|
4974 end; |
4984 end; |
4975 |
4985 |
4976 inc(Gear^.Timer); |
4986 inc(Gear^.Timer); |
4977 if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then |
4987 if (Gear^.Timer > 2000) and ((GameTicks mod 2000) = 1000) then |
4978 begin |
4988 begin |