Changeset 319
- Timestamp:
- Mar 19, 2021, 3:31:53 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/AI.pas
r289 r319 2596 2596 if (iix >= 0) and (((Imp[iix].Kind in [ikNatLocal, ikNatGlobal]) and 2597 2597 (RO.NatBuilt[iix] > 0)) or ((Imp[iix].Kind = ikWonder) and 2598 (RO.Wonder[iix].CityID <> -1))) then2598 (RO.Wonder[iix].CityID <> WonderNotBuiltYet))) then 2599 2599 CheckProd := True; 2600 2600 end; -
trunk/AI/StdAI/Barbarina.pas
r289 r319 1328 1328 for iix := 0 to 27 do 1329 1329 if (Imp[iix].Preq <> preNA) and ((Imp[iix].Preq = preNone) or 1330 IsResearched(Imp[iix].Preq)) and (RO.Wonder[iix].CityID = -1) then1330 IsResearched(Imp[iix].Preq)) and (RO.Wonder[iix].CityID = WonderNotBuiltYet) then 1331 1331 Inc(WonderAvailable, 1 shl iix); 1332 1332 for cix := 0 to RO.nCity - 1 do … … 1500 1500 if ((RO.Government <> gDespotism) or (RO.nUn >= RO.nCity * 4)) and 1501 1501 not IsResearched(adMassProduction) and (Built[imPalace] > 0) and 1502 (RO.Wonder[woZeus].CityID = -1) and City_Improvable(cix, woZeus) then1502 (RO.Wonder[woZeus].CityID = WonderNotBuiltYet) and City_Improvable(cix, woZeus) then 1503 1503 City_StartImprovement(cix, woZeus) 1504 1504 else if (City_CurrentImprovementProject(cix) >= 0) and -
trunk/AI/StdAI/Protocol.pas
r289 r319 1265 1265 mcHospital = mcSupplyShip; 1266 1266 1267 // Wonders CityID constants 1268 WonderNotBuiltYet = -1; 1269 WonderDestroyed = -2; 1270 1267 1271 type 1268 1272 TServerCall = function (Command, Player, Subject: Integer; var Data) … … 1768 1772 procedure DelphiRandomize; 1769 1773 1774 1770 1775 implementation 1771 1776 -
trunk/CityProcessing.pas
r205 r319 972 972 // check if wonder already built 973 973 if (Project and cpImp <> 0) and (Project and cpIndex < 28) and 974 (GWonder[Project and cpIndex].CityID <> -1) then974 (GWonder[Project and cpIndex].CityID <> WonderNotBuiltYet) then 975 975 begin 976 976 inc(Flags, chOldWonder); -
trunk/Database.pas
r290 r319 3195 3195 for i := 0 to 27 do 3196 3196 if Built[i] > 0 then 3197 GWonder[i].CityID := -2; // wonder destroyed3197 GWonder[i].CityID := WonderDestroyed; 3198 3198 V21_to_Loc(Loc, Radius); 3199 3199 for V21 := 1 to 26 do -
trunk/GameServer.pas
r290 r319 4218 4218 result := eInvalid 4219 4219 else if (NewProject and cpIndex < 28) and 4220 (GWonder[NewProject and cpIndex].CityID <> -1) then4220 (GWonder[NewProject and cpIndex].CityID <> WonderNotBuiltYet) then 4221 4221 result := eViolation // wonder already exists 4222 4222 else if (NewProject and cpIndex = imSpacePort) and -
trunk/LocalPlayer/Term.pas
r318 r319 1362 1362 need := false; 1363 1363 for i := 0 to 27 do 1364 if MyRO.Wonder[i].CityID <> -1then1364 if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then 1365 1365 need := true; 1366 1366 if need then … … 2024 2024 if MyRO.Wonder[i].CityID <> MyData.ToldWonders[i].CityID then 2025 2025 begin 2026 if MyRO.Wonder[i].CityID = -2then2026 if MyRO.Wonder[i].CityID = WonderDestroyed then 2027 2027 with MessgExDlg do 2028 2028 begin { tell about destroyed wonders } … … 2076 2076 end 2077 2077 else if (MyRO.Wonder[i].EffectiveOwner <> MyData.ToldWonders[i] 2078 .EffectiveOwner) and (MyRO.Wonder[i].CityID > -2) then2078 .EffectiveOwner) and (MyRO.Wonder[i].CityID > WonderDestroyed) then 2079 2079 if MyRO.Wonder[i].EffectiveOwner < 0 then 2080 2080 begin … … 5907 5907 begin // city destroyed 5908 5908 for i := 0 to 27 do { tell about destroyed wonders } 5909 if (MyRO.Wonder[i].CityID = -2) and (MyData.ToldWonders[i].CityID <> -2)5909 if (MyRO.Wonder[i].CityID = WonderDestroyed) and (MyData.ToldWonders[i].CityID <> WonderDestroyed) 5910 5910 then 5911 5911 with MessgExDlg do … … 7316 7316 mEUnitStat.Enabled := MyRO.nEnemyModel > 0; 7317 7317 { mWonders.Enabled:= false; 7318 for i:=0 to 27 do if MyRO.Wonder[i].CityID <>-1then7318 for i:=0 to 27 do if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then 7319 7319 mWonders.Enabled:=true; } 7320 7320 mDiagram.Enabled := MyRO.Turn >= 2; -
trunk/LocalPlayer/Wonders.pas
r245 r319 100 100 ax: Integer; 101 101 R: Integer; 102 I: Integer;103 102 C: Integer; 104 103 Ch: Integer; … … 223 222 PaintBackgroundShape; 224 223 225 for I := 0 to 20 do 226 if Imp[I].Preq <> preNA then 227 begin 224 // Draw all bitmaps first 225 HaveWonder := False; 226 for I := 0 to 20 do begin 227 if Imp[I].Preq <> preNA then begin 228 228 case MyRO.Wonder[I].CityID of 229 - 1: // not built yet 230 begin 231 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 232 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 233 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 234 (hMaintexture - ClientHeight) div 2); 235 DarkIcon(I); 236 end; 237 -2: // destroyed 238 begin 239 Glow(I, $000000); 240 end; 241 else 242 begin 243 if MyRO.Wonder[I].EffectiveOwner >= 0 then 244 Glow(I, Tribe[MyRO.Wonder[I].EffectiveOwner].Color) 245 else 246 Glow(I, $000000); 247 end; 248 end; 249 end; 250 251 HaveWonder := False; 252 for I := 0 to 20 do 253 if Imp[I].Preq <> preNA then 254 begin 255 case MyRO.Wonder[I].CityID of 256 -1: // not built yet 257 begin 258 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 259 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 260 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 261 (hMaintexture - ClientHeight) div 2); 262 DarkIcon(I); 263 end; 264 -2: // destroyed 265 begin 266 HaveWonder := True; 267 BitBltCanvas(Offscreen.Canvas, 268 Center.X - xSizeBig div 2 + RingPosition[I].X, 269 Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, 270 ySizeBig, BigImp.Canvas, 0, (SystemIconLines + 3) * 271 ySizeBig); 272 end; 273 else 274 begin 229 WonderNotBuiltYet: begin 230 Fill(Offscreen.Canvas, Center.X - xSizeBig div 2 + RingPosition[I].X - 3, 231 Center.Y - ySizeBig div 2 + RingPosition[I].Y - 3, xSizeBig + 6, 232 ySizeBig + 6, (wMaintexture - ClientWidth) div 2, 233 (hMaintexture - ClientHeight) div 2); 234 end; 235 WonderDestroyed: begin 236 HaveWonder := True; 237 BitBltCanvas(Offscreen.Canvas, 238 Center.X - xSizeBig div 2 + RingPosition[I].X, 239 Center.Y - ySizeBig div 2 + RingPosition[I].Y, xSizeBig, 240 ySizeBig, BigImp.Canvas, 0, (SystemIconLines + 3) * 241 ySizeBig); 242 end; 243 else begin 275 244 HaveWonder := True; 276 245 BitBltCanvas(Offscreen.Canvas, … … 282 251 end; 283 252 end; 253 end; 254 255 // Do direct pixel postprocessing separately to avoid bitmap copying in memory 256 Offscreen.Canvas.FillRect(0, 0, 0, 0); 257 Offscreen.BeginUpdate; 258 for I := 0 to 20 do begin 259 if Imp[I].Preq <> preNA then begin 260 case MyRO.Wonder[I].CityID of 261 WonderNotBuiltYet: DarkIcon(I); 262 WonderDestroyed: Glow(I, $000000); 263 else begin 264 if MyRO.Wonder[I].EffectiveOwner >= 0 then 265 Glow(I, Tribe[MyRO.Wonder[I].EffectiveOwner].Color) 266 else Glow(I, $000000); 267 end; 268 end; 269 end; 270 end; 271 Offscreen.EndUpdate; 284 272 285 273 if not HaveWonder then … … 323 311 if Selection >= 0 then 324 312 begin 325 if MyRO.Wonder[Selection].CityID = -1then313 if MyRO.Wonder[Selection].CityID = WonderNotBuiltYet then 326 314 begin // not built yet 327 315 { S:=Phrases.Lookup('IMPROVEMENTS',Selection); … … 338 326 begin 339 327 S := Phrases.Lookup('IMPROVEMENTS', Selection); 340 if MyRO.Wonder[Selection].CityID <> -2then328 if MyRO.Wonder[Selection].CityID <> WonderDestroyed then 341 329 S := Format(Phrases.Lookup('WONDEROF'), 342 330 [S, CityName(MyRO.Wonder[Selection].CityID)]); … … 344 332 (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 345 333 ClientHeight - 3 - 36 - 10, S); 346 if MyRO.Wonder[Selection].CityID = -2then334 if MyRO.Wonder[Selection].CityID = WonderDestroyed then 347 335 S := Phrases.Lookup('DESTROYED') 348 336 else if MyRO.Wonder[Selection].EffectiveOwner < 0 then -
trunk/Protocol.pas
r187 r319 1265 1265 mcHospital = mcSupplyShip; 1266 1266 1267 // Wonders CityID constants 1268 WonderNotBuiltYet = -1; 1269 WonderDestroyed = -2; 1270 1267 1271 type 1268 1272 TServerCall = function (Command, Player, Subject: Integer; var Data) … … 1768 1772 procedure DelphiRandomize; 1769 1773 1774 1770 1775 implementation 1771 1776
Note:
See TracChangeset
for help on using the changeset viewer.