176 Commits

Author SHA1 Message Date
Justin Marshall 6685b5d51a Revert "Merge branch 'Isometric-Dev' into master"
This reverts commit ae0648fccc, reversing
changes made to d7243e8265.
2020-08-06 15:50:30 -07:00
jmarshall23 ae0648fccc Merge branch 'Isometric-Dev' into master 2020-08-06 15:44:55 -07:00
Justin Marshall d7243e8265 August patch integration: Merge branch 'master' of https://github.com/electronicarts/CnC_Remastered_Collection 2020-08-06 15:35:00 -07:00
PG-SteveT ae72fce5dd August 6th Patch Update
Accumulated DLL source code changes since June 22nd patch
2020-08-06 09:44:54 -07:00
Justin Marshall 902d8381cb Removed another accidental checkin of fastbuild enabled. 2020-08-05 19:24:14 -07:00
Justin Marshall 6ad9ef2571 AI will now build radar. 2020-08-05 19:13:37 -07:00
Justin Marshall e592847172 AI will now build prism towers. 2020-08-05 18:29:50 -07:00
Justin Marshall c91fdd6dfc Fixed a bug were shapes that were partially off screen would get clipped. 2020-08-05 17:23:37 -07:00
Justin Marshall 4b8246506f Added render offset for the Construction yard, width/height for buildings is now based on width/height of the first frame of the image. 2020-08-05 14:59:30 -07:00
Justin Marshall a150ec5e29 Disabled accidental checkin of fastbuild. 2020-08-05 13:44:33 -07:00
Justin Marshall d983592f2e Fixed a bug were nonremappable buildings were getting team colors assigned. 2020-08-05 13:36:11 -07:00
Justin Marshall dcd40b2018 Switched civilian building anims over to the TS SHP pipeline(from PNG) so the shadows work and such but for some reason these three civi buildings are more yellow need to look into that. 2020-08-05 12:55:32 -07:00
Justin Marshall 9ca02bef6e Added RA2 pillbox and added missing IdleAnimIgnorePowerState in Read_INI. 2020-08-05 11:52:11 -07:00
Justin Marshall 50024e0125 Temp fix for shroud gaps, units no longer will draw in shroud neighbor tiles. 2020-08-04 21:26:37 -07:00
Justin Marshall ee069c90bb Added Tiberian Sun shroud borders for fog of war. 2020-08-04 18:42:30 -07:00
Justin Marshall 2c445ae910 Radar dome will still render idle animation on low power. 2020-08-04 14:55:33 -07:00
Justin Marshall cfe934e8db Fixed a bug were HD images would draw broken shadows. 2020-08-04 14:44:50 -07:00
Justin Marshall 72f75b1872 Added tesla coil side bar icon, added fastbuild option in rules.ini. 2020-08-04 14:14:40 -07:00
Justin Marshall f8699651b4 Fixed a bug from previous CL that broke shadows. 2020-08-04 14:02:21 -07:00
Justin Marshall 0e3ccf4bcf Re-enabled preq and cost for tesla coil. 2020-08-04 13:47:43 -07:00
Justin Marshall 1d79c5ddd8 Added RA2 tesla coil graphics, cleaned up Image_CreateImageFrom8Bit. 2020-08-04 13:45:53 -07:00
Justin Marshall 5481bd1e7d Checked in gameplay rules for Prism Tower. 2020-08-04 12:08:19 -07:00
Justin Marshall cbd359e387 Initial Prism zap support. 2020-08-04 10:49:25 -07:00
Justin Marshall 6ee6c84777 Tesla attack now works with active shp's. 2020-08-04 07:30:32 -07:00
Justin Marshall 978a1f6a05 Fixed a bug were the briefing screen would trigger for skirmish games. 2020-08-03 14:33:24 -07:00
Justin Marshall 0717d93deb Added RA2 radar dome. 2020-08-03 13:38:31 -07:00
Justin Marshall 2d6681465f Added HD image support for sidebar unit/building icons. Icons but 32bit and 8bit for sidebar unit/building icons are now loaded at startup rather then when requested. 2020-08-03 11:35:01 -07:00
Justin Marshall 65ebb17489 TS/RA2 SHP shadow support. 2020-08-03 08:36:06 -07:00
Justin Marshall 19b9cb16f8 Added anim frame range support for buildings in rules.ini. Added prism tower. 2020-08-02 18:26:40 -07:00
Justin Marshall dff22b0d9f Added author tags for GetHSVHouseColor thanks tomson26! 2020-08-02 15:54:43 -07:00
Justin Marshall 63b1529c25 Tiberian Sun SHP are now HSV color shifted. 2020-08-02 13:52:05 -07:00
Justin Marshall d7270bccc9 Fixed a bug in the original RA code were the make animation wouldn't play if there was too many frames. TS make building animations now load. 2020-08-01 19:00:39 -07:00
Justin Marshall 56eadd7086 Added building faction colors. 2020-08-01 15:36:03 -07:00
Justin Marshall 3763e9e2ed Added support for separate active animation SHP. 2020-08-01 13:17:17 -07:00
Justin Marshall 857f0b7f60 RA2/TS idle animation support. TS uncompressed tile support. Smaller shapes then the main image now blit to a correctly sized buffer. 2020-08-01 12:22:29 -07:00
Justin Marshall 8e4a9a019c Added custom theater palette support in Rules.ini. Fixed a crash bug in TS/RA2 SHP were referenced frames can exceed total SHP frames. 2020-08-01 10:27:11 -07:00
Justin Marshall 93a0819fe9 Missing file from previous CL. 2020-08-01 09:07:22 -07:00
Justin Marshall 32a81a0174 Added Tiberian Sun/Red Alert SHP file support. Added EXPAND3.MIX for Allied Force data. 2020-07-31 21:52:32 -07:00
Justin Marshall 1d8cd100b0 Removed legacy "bigbuffer" and "compressed" rendering code. 2020-07-31 19:12:38 -07:00
Justin Marshall 53e7eb3a61 Cleaned up shape.cpp, all legacy rendering functions removed. 2020-07-31 18:40:47 -07:00
Justin Marshall 25eaf35842 Added isometric placement tiles from snmiglight. 2020-07-31 10:36:52 -07:00
Justin Marshall 3965b5c366 Increased LEPTON_Y to 256. 2020-07-29 15:08:49 -07:00
Justin Marshall 0c9d026780 Fixed a crash in release were PlayerPtr->ActLike references HOUSE_MULTI%N% houses and crashes. 2020-07-28 20:11:58 -07:00
Justin Marshall aa6d4f18d7 Pressing H will now bring you to your MCV/Con_Yard(temp solution). H will no longer put you out of bounds. 2020-07-28 20:02:02 -07:00
Justin Marshall 0c2a72ed9d Map editor unit selection now goes down the same pixel accurate system as the main game. 2020-07-28 18:23:06 -07:00
Justin Marshall ebbce748ee Fixed unit selection and cursor actions not being pixel accurate. Visible Cells/Visible Cell Render world positions are now cached. 2020-07-28 16:40:48 -07:00
Justin Marshall a97502f650 Zoom level now capped at 7, tiles outside the zoomed area shouldn't render anymore. 2020-07-28 09:40:30 -07:00
Justin Marshall c28f4d0cfa Viewport zoom, adjust in redalert.ini(ZoomLevel) F5/F6 to zoom in and out. 2020-07-27 10:52:41 -07:00
Justin Marshall 364659e640 You can now remove big overlays in the editor. 2020-07-25 14:04:12 -07:00
Justin Marshall 21a7ea57ea Skirmish map added and works. 2020-07-25 12:06:41 -07:00
Justin Marshall ef2f046714 Added new multiplayer test map(missing starting points). 2020-07-25 11:59:56 -07:00
Justin Marshall 8426284973 Added bigoverlay Cliff01-Cliff40 tiles(restricted assets!). 2020-07-25 10:06:54 -07:00
Justin Marshall ea4d95860a Fixed a bug were bigoverlay wouldn't show in editor due to fog of war. Debug bigoverlay tiles are now disabled. 2020-07-24 20:37:46 -07:00
Justin Marshall 06ab957c18 BigOverlays is now affected by Fog of War. 2020-07-24 20:31:57 -07:00
Justin Marshall 618a31fb8c BigOverlays will now affect pathfinding. 2020-07-24 20:25:54 -07:00
Justin Marshall 908f6c9c3e Added new big overlay system. 2020-07-24 15:00:19 -07:00
Justin Marshall b72170fd11 Cleaned up cdata. 2020-07-23 13:37:21 -07:00
Justin Marshall 2c94154079 Removed RenderedFrameObjects and replaced with lastFrameRendered. 2020-07-23 11:26:08 -07:00
Justin Marshall e55af30b13 Display tile cache is now complete for render icons. External code now compiles with optimizations. 2020-07-23 11:14:51 -07:00
Justin Marshall 8e6e539bd2 Visible and shadowed cells are now cached at the start of the frame(cuts down processing by 30%). 2020-07-23 09:56:40 -07:00
Justin Marshall 753f1b4752 Optimization: Removed legacy code in GraphicViewPortClass::Lock/Unlock 2020-07-23 09:29:13 -07:00
Justin Marshall 3e0357f29b Fixed sync_delay so it doesn't render during stalls, but still processes windows messaging. 2020-07-23 09:01:15 -07:00
Justin Marshall 4fdcf960d5 Revert "Added Doom 3 BFG timestep code."
This reverts commit fb51ac1a1f.
2020-07-22 16:47:13 -07:00
Justin Marshall fb51ac1a1f Added Doom 3 BFG timestep code. 2020-07-22 16:07:54 -07:00
Justin Marshall 3f697a2509 DisplayTacticalCoord will now store the result instead of recalc everytime its needed. 2020-07-22 13:34:21 -07:00
Justin Marshall c123e39770 Build_Frame for CC_Draw_Techno is no longer called every frame, removed unneeded LCW_Uncomp_CS 2020-07-22 13:09:21 -07:00
Justin Marshall 265e59e62f Added missing file from previous checkin. 2020-07-22 12:16:47 -07:00
Justin Marshall 7eef7efe8a Game code moved to RedAlertx64.dll, launcher created to launch previous WinMain entry point which has been renamed to CnCMain 2020-07-22 12:09:30 -07:00
Justin Marshall fbf8263ba2 Internal editor can now save out multiplayer maps. 2020-07-21 21:04:46 -07:00
Justin Marshall 02013c9c82 Soviet Mission 1 video changed to Emergency Broadcast Warning. 2020-07-21 12:25:55 -07:00
Justin Marshall 77b03a8b8e Soviet1: If USSR has no engineers AND doesn't have two radar domes, then mission is lost. 2020-07-20 15:09:04 -07:00
Justin Marshall e30fe11a96 Soviet01: If there aren't two radar domes on the map the mission is fail. Success happens when USSR owns two radar domes. 2020-07-20 14:19:48 -07:00
Justin Marshall b7f234b300 Fixed bug were numRadarDomes win condition would trigger because USSR house wasn't specified for CountBuildings. Fixed spelling mistake. 2020-07-20 12:50:00 -07:00
Justin Marshall a21baa6891 FireSale can be toggled via lua script, the AI in soviet 1 won't do a fire sale, and the allied radar dome is no longer a fake dome. 2020-07-20 12:15:27 -07:00
Justin Marshall 9fcc2d286d Soviets will now have paratroopers at the start of soviet mission 1, modified lua GiveSpecialWeapon and super code to allow perputual usage of script granted super weapons even if the prereq requirements aren't met. 2020-07-20 11:27:06 -07:00
Justin Marshall e721d781e5 Single selection and action should be more accurate. 2020-07-19 14:30:36 -07:00
Justin Marshall 9f31118e03 Aircraft rubberband now goes down the same screen coordinate selection system. 2020-07-19 14:11:49 -07:00
Justin Marshall f09caa46da Rubber band selection now works. 2020-07-19 14:07:37 -07:00
Justin Marshall 24704c9ad8 Fixed a bug were TacViewportRect wasn't always updated on map load/new scenerio in the editor. 2020-07-19 11:08:49 -07:00
Justin Marshall dbc6cd4087 Map files now have the "map" extension. 2020-07-19 11:05:12 -07:00
Justin Marshall 603b6c13db Initial size of the map set to initial size on new scenerio. 2020-07-19 10:52:45 -07:00
Justin Marshall ce830ee21d Initial start position for initial new scenerio now should work correctly. 2020-07-19 10:48:29 -07:00
Justin Marshall 0ceb87a4d4 Switched TacticalCoordinate to new DisplayTacticalCoord struct that manages XY to Coord and vice versa conversion. Temp disabled scroll inertia. 2020-07-19 10:39:36 -07:00
Justin Marshall 8a2bf274c9 Fixed display scrolling in map view not working correct. 2020-07-18 18:26:54 -07:00
Justin Marshall 8353b2c1dd Refactored scroll dimensions, fixed a crash were you would click on non existent tiles, editor now displays splash initially until you do new scenario or load a existing one. 2020-07-17 20:17:49 -07:00
Justin Marshall c48fc9723a Unit lost vox audio now plays. 2020-07-16 21:25:19 -07:00
Justin Marshall 268f6592d2 Temp new wallpapers for Allied Force. 2020-07-16 21:07:02 -07:00
Justin Marshall c928c1c052 Removed counterstrike and aftermath mission select. 2020-07-16 20:25:39 -07:00
Justin Marshall 16c72a0305 Updated briefing screen to show objectives and mission name, with a temp background. 2020-07-16 17:14:16 -07:00
Justin Marshall b87f462d5f Added initial audio support for movies. External wav files are going to be used for multilang videos. 2020-07-16 12:45:32 -07:00
Justin Marshall 2099c00bd3 Added ffmpeg back script. 2020-07-16 11:14:59 -07:00
Justin Marshall 3d93b0a556 Added ffmpeg convert script. 2020-07-16 11:13:47 -07:00
Justin Marshall 7a1bd0fbb0 Fixed a bug were videos would not play initially. 2020-07-16 11:11:29 -07:00
Justin Marshall 8dd21f5b25 Added H.264 movie codec support. 2020-07-16 11:07:17 -07:00
Justin Marshall 0824dfbcdb Enemy units are no longer selectable. 2020-07-15 22:14:13 -07:00
Justin Marshall d37e740d19 Added test video for soviet mission 1 and red intro. 2020-07-15 22:06:16 -07:00
Justin Marshall 95f5cecc48 SMK video playback now works again. 2020-07-15 21:47:45 -07:00
Justin Marshall 43cb23b81a Fixed a bug with mission 1 were engineers weren't assigned to USSR and now a mammoth tank spawns for reinforcements. 2020-07-15 17:06:20 -07:00
Justin Marshall 5d441ca39e Added soviet mission 1 script, expanded _global with more vehicle types and CreateVehicle/CreateInfrantry now support coordinate input. 2020-07-14 15:05:25 -07:00
Justin Marshall e5544d2fc2 New flagship map. 2020-07-13 14:11:28 -07:00
Justin Marshall 97dddb4d20 Removed soviet buildings. 2020-07-12 17:31:37 -07:00
Justin Marshall b5fd70a200 Added clear tile variation(this will be break some maps and may require them to be redone). 2020-07-12 17:25:50 -07:00
Justin Marshall fbcd9e4bba Tesla lightning now renders correctly in isometric. 2020-07-12 13:36:39 -07:00
Justin Marshall a9028cb525 Smudges are now positioned properly. 2020-07-12 13:21:20 -07:00
Justin Marshall dc20ebb4c0 Added more data, fixed abandoned buildings not being assigned to neutral. 2020-07-12 13:00:51 -07:00
Justin Marshall a33f7bfa25 Added new blend types, added lighting to first soviet mission. 2020-07-12 09:01:36 -07:00
Justin Marshall 52869ac0e9 Initial light rendering code, doesn't render correct in all situations yet. 2020-07-11 22:24:19 -07:00
Justin Marshall 98ff70f6ef Added new rendertexture class for FBO's. 2020-07-11 19:35:18 -07:00
Justin Marshall 3185e48ccd Added the ability to place new light objects in the world, lights don't work yet. 2020-07-11 14:19:34 -07:00
Justin Marshall 37b8b475c9 Fixed a bug were isometric units were placed at the wrong coords in the editor. 2020-07-11 12:58:18 -07:00
Justin Marshall 289e319db9 Centered Add Object dialog. 2020-07-09 09:54:41 -07:00
Justin Marshall c7ba544c94 Disabled scroll in editor when user is interacting with the top menu. 2020-07-09 08:46:17 -07:00
jmarshall23 31e868bb54 Merge pull request #29 from jmarshall23/master
Internal Editor: Right click main menu moved to top down main menu.
2020-07-08 17:32:36 -07:00
jmarshall23 771ba7b87a Merge pull request #28 from nev6502/Nev6502_Isometric
Nev6502 isometric
2020-07-08 08:24:09 -07:00
nev6502 a2e4e7a8f1 Improved adjustment of scrolling direction with emphasis on cardinal directions like the original. 2020-07-08 01:56:21 -06:00
nev6502 f362bda53a Merge branch 'Isometric-Dev' into Nev6502_Isometric 2020-07-08 00:58:34 -06:00
nev6502 cd6446d58a Improved Scrolling, Large Map Handling
- Bugfix in MapClass::Overpass when placing objects while scrolled all the way up / left on a larger map
- Disabled a check in DisplayClass::Set_Cursor_Pos preventing mouse cell coordinates from being updated while scrolled all the way up / left on a larger map
- Added (disabled) function to display mouse/cell position
- Improved mouse scroll region (but still work to be done)
2020-07-08 00:58:13 -06:00
Justin Marshall ace3df0d94 Added two more abandoned buildings from Tiberian Sun(restricted assets). 2020-07-07 16:46:05 -07:00
Justin Marshall 44e16fb0d8 Damaged version of ABAN04 works. 2020-07-07 14:19:07 -07:00
Justin Marshall 8a04d5fca9 Added first enviro prop building(restricted asset from Tiberian Sun). 2020-07-07 13:53:42 -07:00
Justin Marshall 9d3525aa71 Added isotemp support from Tiberian Sun 2020-07-07 09:29:52 -07:00
jmarshall23 6944eb0b86 Merge pull request #27 from nev6502/Nev6502_Isometric
Realigned Facing32 lookup table to better orientate units
2020-07-06 22:09:34 -07:00
nev6502 c3ba2033ca Realigned Facing16 lookup table to better orientate 16 direction units 2020-07-06 23:01:45 -06:00
nev6502 7a67674d42 Realigned Facing32 lookup table to better orientate units 2020-07-06 22:33:20 -06:00
Justin Marshall 8f08fd61ce Removed accidental check in of debug print. 2020-07-06 16:27:35 -07:00
Justin Marshall f4964c83e9 Ruberband selection now works better. 2020-07-06 16:20:36 -07:00
Justin Marshall f1e75e4a63 Added missing files from previous CL. 2020-07-05 20:26:23 -07:00
Justin Marshall 318cfe0cfc Iso tiles now render into the radar view. 2020-07-05 19:55:03 -07:00
Justin Marshall 226ce77ee2 Fixed incorrect credit settings. 2020-07-05 16:58:58 -07:00
jmarshall23 4e637bfbb3 Merge pull request #26 from jmarshall23/master
Mainline to Branch
2020-07-05 14:34:18 -07:00
Justin Marshall f8e30d6e0d Water and road is properly marked. 2020-07-05 10:19:33 -07:00
Justin Marshall 4b8349de33 Moved tesla coils to front of base. 2020-07-05 09:39:41 -07:00
Justin Marshall 6b6db0c6e4 Removed legacy cdcheck for Read_Scenario_INI. 2020-07-05 09:30:00 -07:00
Justin Marshall b3bc7ae3f0 If IQ is too high it no longer sets to 1, instead IQ gets set to max IQ. 2020-07-05 09:23:55 -07:00
Justin Marshall e298a30992 Shroud now renders with a circle alpha image, shrouded terrain no longer renders and is no longer simply covered with a black rectangle. Creating skirmish maps in multiplayer no longer causes a crash. 2020-07-04 22:10:04 -07:00
jmarshall23 80f19de543 Merge pull request #24 from jmarshall23/master
Fix for crash related to the power bar rendering with the fading table.
2020-07-04 20:07:36 -07:00
Justin Marshall df725471d5 Moved trans hash mark icons to PNG's and now render properly. 2020-07-04 17:29:28 -07:00
Justin Marshall 0384e3fd42 Setup shroud isometric coordinates. 2020-07-04 14:49:40 -07:00
jmarshall23 ac87cda55b Merge pull request #23 from jmarshall23/master
Switched new sidebar graphics to HD graphics pipeline.
2020-07-04 09:49:45 -07:00
jmarshall23 27b68d51f1 Merge pull request #22 from jmarshall23/master
Mainline to Branch Integration
2020-07-04 08:19:51 -07:00
Justin Marshall 11f86ffe57 Overlays now render correctly. 2020-07-03 21:31:14 -07:00
Justin Marshall b8547b0519 Added 2nd iso test map(Soviet 2) 2020-07-03 21:19:32 -07:00
jmarshall23 258f81b039 Merge pull request #20 from jmarshall23/master
Mainline to Branch
2020-07-03 18:57:54 -07:00
Justin Marshall 985e90a7e3 Fix for pixel holes in icons/sidebar. 2020-07-03 13:58:42 -07:00
Justin Marshall 8d3b994a29 Out of bounds tiles are now darkened. 2020-07-03 13:15:08 -07:00
Justin Marshall f4bc742cd3 Temp hack for pathfinding problems with TS assets. 2020-07-03 10:51:09 -07:00
Justin Marshall 52b5c8870f Disabled scissor rect for tile rendering. 2020-07-03 10:11:49 -07:00
Justin Marshall 1ae367ef3b ConvertCoordsToIsometric no longer snaps to nearest tile. 2020-07-03 09:42:46 -07:00
Justin Marshall e2fcb059ec Isometric tiles now render the entire screen. Off screen tiles will not be rendered. 2020-07-02 21:10:52 -07:00
Justin Marshall a1687554cc Prep_For_Add now checks for the hdimage. 2020-07-02 18:02:36 -07:00
Justin Marshall 61a0c58d3e Added proad tile from Tiberian Sun. 2020-07-02 17:57:30 -07:00
Justin Marshall 212b15521d Ensured tiles are in the right order. 2020-07-02 17:07:17 -07:00
Justin Marshall 6101c8c8f0 Terrain templates with hidden tiles now work correctly. 2020-07-02 15:23:41 -07:00
Justin Marshall 16bca743d7 Added new Tiberian Sun tiles. 2020-07-02 15:09:42 -07:00
jmarshall23 cb69d314ca Merge pull request #18 from jmarshall23/master
Revert "Merge branch 'master' into master"
2020-07-02 13:47:58 -07:00
Justin Marshall b33c844d3c Backout previous changelist. 2020-07-02 13:00:07 -07:00
Justin Marshall f1b5269d73 keydown/mousedown events that get processed by imgui will no longer be processed by the engine. 2020-07-02 12:51:08 -07:00
Justin Marshall 20a5c42f3a Terrain data can now be placed again. 2020-07-02 12:40:46 -07:00
jmarshall23 30efdc9689 Merge pull request #17 from jmarshall23/master
Mainline To Branch
2020-07-02 08:16:15 -07:00
Justin Marshall d141e5ee53 Fixed the lepton size being incorrect. 2020-07-01 19:17:09 -07:00
Justin Marshall 681ab2fa9c Added missing 4 bit flag in IsoTilImageHeader, border alignment is correct. 2020-07-01 16:53:25 -07:00
Justin Marshall ede9d518bf Isometric tiles will no longer render on top of each other. 2020-07-01 14:13:28 -07:00
Justin Marshall c7748a616d Fixed templatetypeclass land_type. Template's can be placed but only the first tile seems to work. 2020-07-01 11:14:03 -07:00
Justin Marshall f6beb9b4ee Tiberian Sun Iso tiles now load into the placement dialog editor. 2020-06-30 12:17:42 -07:00
Justin Marshall 9808598a07 Tiberian Sun tiles are now loaded. 2020-06-30 11:52:05 -07:00
Justin Marshall 4844f4eaa7 Added tiberian sun mix file support, can't play game until iconset format is ironed yet. 2020-06-29 15:22:06 -07:00
Justin Marshall 37b4f227e6 Units/Objects now render correctly and are selectable. 2020-06-27 16:24:45 -07:00
Justin Marshall db21f9ad7d Mouse click and rubber band now work in game. 2020-06-27 15:24:29 -07:00
Justin Marshall b474ea55b3 Object selection now works in the map editor. 2020-06-27 15:02:08 -07:00
Justin Marshall 2101728255 Hash mark cursor now render correctly in isometric. 2020-06-27 14:24:23 -07:00
Justin Marshall 132071e39b Placement Dialog now places objects in proper isometric space. 2020-06-27 14:00:13 -07:00
Justin Marshall 0189929957 Increased tile size. 2020-06-27 10:01:29 -07:00
Justin Marshall 4e1be3e1cb Isometric coordinate conversion is now only applied to rendering the tiles. 2020-06-27 09:49:41 -07:00
Justin Marshall 2a74c0750e Initial test code to render isometric tiles, including test art and test map. 2020-06-26 20:07:36 -07:00
Justin Marshall d3fca9b7d2 Empty txt 2020-06-26 15:07:45 -07:00
Justin Marshall 960bdc5403 Missing file from previous checkin. 2020-06-26 15:05:44 -07:00
33 changed files with 473 additions and 93 deletions
+2 -2
View File
@@ -359,7 +359,7 @@ static AnimTypeClass const LZSmoke(
72, // Loop start frame number.
91, // Ending frame of loop back.
-1, // Number of animation stages.
255, // Number of times the animation loops.
127, // Number of times the animation loops.
VOC_NONE, // Sound effect to play.
ANIM_NONE
);
@@ -1127,7 +1127,7 @@ static AnimTypeClass const OilFieldBurn(
33, // Loop start frame number.
99, // Ending frame of loop back.
66, // Number of animation stages.
65535, // Number of times the animation loops.
127, // Number of times the animation loops.
VOC_NONE, // Sound effect to play.
ANIM_NONE
);
+14 -5
View File
@@ -1955,9 +1955,17 @@ void AircraftClass::Enter_Idle_Mode(bool )
/*
** Normal aircraft try to find a good landing spot to rest.
*/
BuildingClass * building = Find_Docking_Bay(Class->Building, false);
BuildingClass * building = NULL;
if (In_Radio_Contact() && Contact_With_Whom()->What_Am_I() == RTTI_BUILDING) {
building = (BuildingClass *)Contact_With_Whom();
} else {
building = Find_Docking_Bay(Class->Building, false);
if (Transmit_Message(RADIO_HELLO, building) != RADIO_ROGER) {
building = NULL;
}
}
Assign_Destination(TARGET_NONE);
if (building != NULL && Transmit_Message(RADIO_HELLO, building) == RADIO_ROGER) {
if (building != NULL) {
if (Class->IsFixedWing) {
Status = 0; //BG - reset the mission status to avoid landing on the ground next to the airstrip
if (IsLanding) {
@@ -2374,7 +2382,7 @@ ActionType AircraftClass::What_Action(CELL cell) const
ActionType action = FootClass::What_Action(cell);
//using function for IsVisible so we have different results for different players - JAS 2019/09/30
if (action == ACTION_MOVE && !Map[cell].Is_Visible(PlayerPtr)) {
if ((action == ACTION_MOVE || action == ACTION_ATTACK) && !Map[cell].Is_Visible(PlayerPtr)) {
action = ACTION_NOMOVE;
}
@@ -3075,7 +3083,7 @@ MoveType AircraftClass::Can_Enter_Cell(CELL cell, FacingType ) const
if (occupier == NULL ||
!occupier->Is_Techno() ||
((TechnoClass *)occupier)->House->Is_Ally(House) ||
(((TechnoClass *)occupier)->Cloak != CLOAKED &&
(!((TechnoClass *)occupier)->Is_Cloaked(this) &&
(ScenarioInit == 0 && (occupier->What_Am_I() != RTTI_BUILDING || !((BuildingClass*)occupier)->Class->IsInvisible)) )
) {
@@ -3135,9 +3143,10 @@ TARGET AircraftClass::Good_Fire_Location(TARGET target) const
for (int face = 0; face < 255; face += 16) {
COORDINATE newcoord = Coord_Move(tcoord, (DirType)face, r);
CELL newcell = Coord_Cell(newcoord);
CELL actualcell = Coord_Cell(Coord_Sub(newcoord, XY_Coord(0, FLIGHT_LEVEL)));
//using function for IsVisible so we have different results for different players - JAS 2019/09/30
if (Map.In_Radar(newcell) && (Session.Type != GAME_NORMAL || Map[newcell].Is_Visible(PlayerPtr)) && Cell_Seems_Ok(newcell, true)) {
if (Map.In_Radar(actualcell) && (Session.Type != GAME_NORMAL || Map[newcell].Is_Visible(PlayerPtr)) && Cell_Seems_Ok(newcell, true)) {
int dist;
if (altcoord != 0) {
dist = ::Distance(newcoord, altcoord);
+7 -3
View File
@@ -578,7 +578,7 @@ IsTheaterShape = false;
AnimClass::Unlimbo(coord);
VisibleFlags = 0xffff;
VisibleFlags = static_cast<unsigned int>(-1);
/*
** Drop zone smoke always reveals the map around itself.
@@ -817,10 +817,10 @@ void AnimClass::AI(void)
int damage = Accum;
Accum -= damage;
if (As_Object(xObject)->Take_Damage(damage, 0, WARHEAD_FIRE) == RESULT_DESTROYED) {
delete this;
if (Target_Legal(VirtualAnimTarget)) {
delete As_Animation(VirtualAnimTarget);
}
delete this;
return;
}
}
@@ -1177,8 +1177,12 @@ void AnimClass::Detach(TARGET target, bool all)
assert(IsActive);
if (all) {
if (VirtualAnimTarget && VirtualAnimTarget == target) {
if (Target_Legal(VirtualAnimTarget) && VirtualAnimTarget == target) {
VirtualAnimTarget = TARGET_NONE;
if (IsInvisible) {
IsToDelete = true;
Mark(MARK_UP);
}
}
if (xObject == target) {
Map.Remove(this, In_Which_Layer());
+21 -6
View File
@@ -173,7 +173,7 @@ RadioMessageType BuildingClass::Receive_Message(RadioClass * from, RadioMessageT
case RADIO_CAN_LOAD:
TechnoClass::Receive_Message(from, message, param);
if (!House->Is_Ally(from)) return(RADIO_STATIC);
if (Mission == MISSION_CONSTRUCTION || Mission == MISSION_DECONSTRUCTION || BState == BSTATE_CONSTRUCTION || (!ScenarioInit && In_Radio_Contact() && Contact_With_Whom() != from)) return(RADIO_NEGATIVE);
if (Mission == MISSION_CONSTRUCTION || Mission == MISSION_DECONSTRUCTION || BState == BSTATE_CONSTRUCTION || (!ScenarioInit && Class->Type != STRUCT_REFINERY && In_Radio_Contact())) return(RADIO_NEGATIVE);
switch (Class->Type) {
case STRUCT_AIRSTRIP:
if (from->What_Am_I() == RTTI_AIRCRAFT && ((AircraftClass const *)from)->Class->IsFixedWing) {
@@ -200,7 +200,7 @@ RadioMessageType BuildingClass::Receive_Message(RadioClass * from, RadioMessageT
*((UnitClass *)from) == UNIT_HARVESTER &&
(ScenarioInit || !Is_Something_Attached())) {
return(RADIO_ROGER);
return((Contact_With_Whom() != from) ? RADIO_ROGER : RADIO_NEGATIVE);
}
break;
@@ -2588,13 +2588,21 @@ void BuildingClass::Grand_Opening(bool captured)
** to place it in a nearby location.
*/
if (!unit->Unlimbo(Cell_Coord(cell), DIR_W)) {
cell = unit->Nearby_Location(this);
/*
** Check multiple times for clear locations.
*/
for (int i = 0; i < 10; i++) {
cell = unit->Nearby_Location(this, i);
if (unit->Unlimbo(Cell_Coord(cell), DIR_SW)) {
break;
}
}
/*
** If the harvester could still not be placed, then refund the money
** to the owner and then bail.
*/
if (!unit->Unlimbo(Cell_Coord(cell), DIR_SW)) {
if (unit->IsInLimbo) {
House->Refund_Money(unit->Class->Cost_Of());
delete unit;
}
@@ -3742,9 +3750,16 @@ int BuildingClass::Mission_Deconstruction(void)
}
}
if (House->IsPlayerControl) {
// MBL 07.10.2020 - In 1v1, sometimes both players will hear this SFX, or neither player will hear it
// Making it so all players hear it positionally in the map; Per thread discussion in https://jaas.ea.com/browse/TDRA-7245
//
#if 0
if (House->IsPlayerControl) {
Sound_Effect(VOC_CASHTURN, Coord);
}
#else
Sound_Effect(VOC_CASHTURN, Coord);
}
#endif
/*
** Destroy all attached objects. ST - 4/24/2020 9:38PM
+11 -2
View File
@@ -2818,9 +2818,18 @@ void CellClass::Flag_Create(void)
{
if (!CTFFlag) {
CTFFlag = new AnimClass(ANIM_FLAG, Cell_Coord());
if (CTFFlag) {
CTFFlag->OwnerHouse = Owner;
if (CTFFlag == NULL) {
for (int i = 0; i < Anims.Count(); ++i) {
AnimClass* anim = Anims.Ptr(i);
if (*anim != ANIM_FLAG) {
delete anim;
break;
}
}
CTFFlag = new AnimClass(ANIM_FLAG, Cell_Coord());
}
assert(CTFFlag != NULL);
CTFFlag->OwnerHouse = Owner;
}
}
+9
View File
@@ -3618,6 +3618,15 @@ typedef enum OptionControlType : char {
} OptionControlType;
/****************************************************************************
** Used to store firing data for a unit.
*/
typedef struct {
COORDINATE Center;
int Distance;
} FireDataType;
#define size_of(typ,id) sizeof(((typ*)0)->id)
+2 -2
View File
@@ -3122,9 +3122,9 @@ int DisplayClass::TacticalClass::Action(unsigned flags, KeyNumType & key)
object = Map.Close_Object(coord);
/*
** Special case check to ignore cloaked object if not owned by the player.
** Special case check to ignore cloaked object if not allied with the player.
*/
if (object != NULL && object->Is_Techno() && !((TechnoClass *)object)->IsOwnedByPlayer && (((TechnoClass *)object)->Cloak == CLOAKED || ((TechnoClass *)object)->Techno_Type_Class()->IsInvisible)) {
if (object != NULL && object->Is_Techno() && ((TechnoClass *)object)->Is_Cloaked(PlayerPtr, true)) {
object = NULL;
}
}
+78 -4
View File
@@ -384,6 +384,8 @@ bool MPSuperWeaponDisable = false;
bool ShareAllyVisibility = true;
bool UseGlyphXStartLocations = true;
SpecialClass* SpecialBackup = NULL;
int GetRandSeed()
{
@@ -670,6 +672,8 @@ extern "C" __declspec(dllexport) bool __cdecl CNC_Set_Multiplayer_Data(int scena
Special.IsEarlyWin = game_options.DestroyStructures;
Special.ModernBalance = game_options.ModernBalance;
/*
** Enable Counterstrike/Aftermath units
*/
@@ -714,6 +718,13 @@ extern "C" __declspec(dllexport) bool __cdecl CNC_Set_Multiplayer_Data(int scena
*/
Rule.IsSmartDefense = true;
/*
** Backup special
*/
if (SpecialBackup != NULL) {
memcpy(SpecialBackup, &Special, sizeof(SpecialClass));
}
return true;
}
@@ -1538,6 +1549,13 @@ extern "C" __declspec(dllexport) bool __cdecl CNC_Advance_Instance(uint64 player
DLLExportClass::Set_Player_Context(DLLExportClass::GlyphxPlayerIDs[0]);
}
/*
** Restore special from backup
*/
if (SpecialBackup != NULL) {
memcpy(&Special, SpecialBackup, sizeof(SpecialClass));
}
#ifdef FIXIT_CSII // checked - ajw 9/28/98
TimeQuake = PendingTimeQuake;
PendingTimeQuake = false;
@@ -1730,6 +1748,15 @@ extern "C" __declspec(dllexport) bool __cdecl CNC_Advance_Instance(uint64 player
//Sync_Delay();
//DLLExportClass::Set_Event_Callback(NULL);
Color_Cycle();
/*
** Don't respect GameActive. Game will end in multiplayer on win/loss
*/
if (GAME_TO_PLAY == GAME_GLYPHX_MULTIPLAYER) {
return true;
}
return(GameActive);
}
@@ -1776,6 +1803,12 @@ extern "C" __declspec(dllexport) bool __cdecl CNC_Save_Load(bool save, const cha
result = Load_Game(file_path_and_name);
// MBL 07.21.2020
if (result == false)
{
return false;
}
DLLExportClass::Set_Player_Context(DLLExportClass::GlyphxPlayerIDs[0], true);
Set_Logic_Page(SeenBuff);
VisiblePage.Clear();
@@ -1995,6 +2028,11 @@ void DLLExportClass::Init(void)
CurrentLocalPlayerIndex = 0;
MessagesSent.clear();
if (SpecialBackup == NULL) {
SpecialBackup = new SpecialClass;
}
memcpy(SpecialBackup, &Special, sizeof(SpecialClass));
}
@@ -2011,6 +2049,9 @@ void DLLExportClass::Init(void)
**************************************************************************************************/
void DLLExportClass::Shutdown(void)
{
delete SpecialBackup;
SpecialBackup = NULL;
for (int i=0 ; i<ModSearchPaths.Count() ; i++) {
delete [] ModSearchPaths[i];
}
@@ -3117,6 +3158,7 @@ void DLL_Draw_Pip_Intercept(const ObjectClass* object, int pip)
void DLLExportClass::DLL_Draw_Intercept(int shape_number, int x, int y, int width, int height, int flags, const ObjectClass *object, DirType rotation, long scale, const char *shape_file_name, char override_owner)
{
CNCObjectStruct& new_object = ObjectList->Objects[TotalObjectCount + CurrentDrawCount];
memset(&new_object, 0, sizeof(new_object));
Convert_Type(object, new_object);
if (new_object.Type == UNKNOWN) {
return;
@@ -4259,6 +4301,8 @@ bool DLLExportClass::Get_Sidebar_State(uint64 player_id, unsigned char *buffer_i
return false;
}
memset(&sidebar_entry, 0, sizeof(sidebar_entry));
sidebar_entry.AssetName[0] = 0;
sidebar_entry.Type = UNKNOWN;
sidebar_entry.BuildableID = Map.Column[c].Buildables[b].BuildableID;
@@ -4271,7 +4315,7 @@ bool DLLExportClass::Get_Sidebar_State(uint64 player_id, unsigned char *buffer_i
sidebar_entry.SuperWeaponType = SW_NONE;
if (tech) {
sidebar_entry.Cost = tech->Cost * PlayerPtr->CostBias;
sidebar_entry.Cost = tech->Cost * PlayerPtr->CostBias; // MBL: If this gets modified, also modify below for skirmish and multiplayer
sidebar_entry.PowerProvided = 0;
sidebar_entry.BuildTime = tech->Time_To_Build(PlayerPtr->Class->House); // sidebar_entry.BuildTime = tech->Time_To_Build() / 60;
strncpy(sidebar_entry.AssetName, tech->IniName, CNC_OBJECT_ASSET_NAME_LENGTH);
@@ -4414,6 +4458,8 @@ bool DLLExportClass::Get_Sidebar_State(uint64 player_id, unsigned char *buffer_i
return false;
}
memset(&sidebar_entry, 0, sizeof(sidebar_entry));
sidebar_entry.AssetName[0] = 0;
sidebar_entry.Type = UNKNOWN;
sidebar_entry.BuildableID = context_sidebar->Column[c].Buildables[b].BuildableID;
@@ -4426,7 +4472,13 @@ bool DLLExportClass::Get_Sidebar_State(uint64 player_id, unsigned char *buffer_i
sidebar_entry.SuperWeaponType = SW_NONE;
if (tech) {
sidebar_entry.Cost = tech->Cost;
// MBL 06.22.2020 - Updated to apply and difficulty abd/or faction price modifier; See https://jaas.ea.com/browse/TDRA-6864
// If this gets modified, also modify above for non-skirmish / non-multiplayer
//
// sidebar_entry.Cost = tech->Cost;
sidebar_entry.Cost = tech->Cost * PlayerPtr->CostBias;
sidebar_entry.PowerProvided = 0;
sidebar_entry.BuildTime = tech->Time_To_Build(PlayerPtr->Class->House); // sidebar_entry.BuildTime = tech->Time_To_Build() / 60;
strncpy(sidebar_entry.AssetName, tech->IniName, CNC_OBJECT_ASSET_NAME_LENGTH);
@@ -8345,10 +8397,16 @@ bool DLLExportClass::Save(Pipe & pipe)
pipe.Put(&Special, sizeof(Special));
/*
** Special case for MPSuperWeaponDisable - store negated value so it defaults to enabled
*/
bool not_allow_super_weapons = !MPSuperWeaponDisable;
pipe.Put(&not_allow_super_weapons, sizeof(not_allow_super_weapons));
/*
** Room for save game expansion
*/
unsigned char padding[4096];
unsigned char padding[4095];
memset(padding, 0, sizeof(padding));
pipe.Put(padding, sizeof(padding));
@@ -8431,7 +8489,23 @@ bool DLLExportClass::Load(Straw & file)
return false;
}
unsigned char padding[4096];
/*
** Restore backup
*/
if (SpecialBackup != NULL) {
memcpy(SpecialBackup, &Special, sizeof(SpecialClass));
}
/*
** Special case for MPSuperWeaponDisable - store negated value so it defaults to enabled
*/
bool not_allow_super_weapons = false;
if (file.Get(&not_allow_super_weapons, sizeof(not_allow_super_weapons)) != sizeof(not_allow_super_weapons)) {
return false;
}
MPSuperWeaponDisable = !not_allow_super_weapons;
unsigned char padding[4095];
if (file.Get(padding, sizeof(padding)) != sizeof(padding)) {
return false;
+2 -1
View File
@@ -732,7 +732,7 @@ struct CNCMultiplayerOptionsStruct {
int MPlayerCount; // # of human players in this game
int MPlayerBases; // 1 = bases are on for this scenario
int MPlayerCredits; // # credits everyone gets
int MPlayerTiberium; // 1 = tiberium enabled for this scenario
int MPlayerTiberium; // >0 = tiberium enabled for this scenario
int MPlayerGoodies; // 1 = goodies enabled for this scenario
int MPlayerGhosts; // 1 = houses with no players will still play
int MPlayerSolo; // 1 = allows a single-player net game
@@ -744,6 +744,7 @@ struct CNCMultiplayerOptionsStruct {
bool MPlayerAftermathUnits;
bool CaptureTheFlag;
bool DestroyStructures; // New early win condition via destroying all a player's structures
bool ModernBalance;
};
+7 -1
View File
@@ -603,7 +603,7 @@ void EventClass::Execute(void)
//2019/09/19 JAS - Visibility needs to be determined per player
if (Data.Anim.Owner == HOUSE_NONE || Data.Anim.What != ANIM_MOVE_FLASH)
{
anim->Set_Visible_Flags(0xffff);
anim->Set_Visible_Flags(static_cast<unsigned int>(-1));
}
else
{
@@ -761,6 +761,12 @@ void EventClass::Execute(void)
techno->Assign_Target(TARGET_NONE);
techno->Assign_Destination(Data.MegaMission.Target.As_TARGET());
techno->ArchiveTarget = Data.MegaMission.Target.As_TARGET();
} else if (Data.MegaMission.Mission == MISSION_ENTER &&
object != NULL &&
object->What_Am_I() == RTTI_BUILDING &&
*((BuildingClass*)object) == STRUCT_REFINERY) {
techno->Transmit_Message(RADIO_HELLO, (BuildingClass*)object);
techno->Assign_Destination(TARGET_NONE);
} else {
if (q && techno->Is_Foot()) {
((FootClass *)techno)->Queue_Navigation_List(Data.MegaMission.Destination.As_TARGET());
+13 -1
View File
@@ -1741,7 +1741,19 @@ int FootClass::Mission_Enter(void)
** Since there is no potential object to enter, then abort this
** mission with some default standby mission.
*/
Enter_Idle_Mode();
if (MissionQueue == MISSION_NONE) {
/*
** If this is a harvester, then return to harvesting.
** Set a hacky target so we know to skip to the proper state.
*/
if (What_Am_I() == RTTI_UNIT && ((UnitClass*)this)->Class->IsToHarvest) {
Assign_Mission(MISSION_HARVEST);
Assign_Target(As_Target());
Assign_Destination(TARGET_NONE);
} else {
Enter_Idle_Mode();
}
}
}
return(MissionControl[Mission].Normal_Delay() + Random_Pick(0, 2));
+86 -12
View File
@@ -923,7 +923,7 @@ void HouseClass::AI(void)
** production and team creation as well. This is also true if the IQ is high enough to
** being base building.
*/
if (IsBaseBuilding || IQ >= Rule.IQProduction) {
if (!IsHuman && (IsBaseBuilding || IQ >= Rule.IQProduction)) {
IsBaseBuilding = true;
IsStarted = true;
IsAlerted = true;
@@ -959,6 +959,9 @@ void HouseClass::AI(void)
if (IsToDie && BorrowedTime == 0) {
IsToDie = false;
Blowup_All();
if (Session.Type == GAME_GLYPHX_MULTIPLAYER) {
MPlayer_Defeated();
}
}
/*
@@ -1153,7 +1156,7 @@ void HouseClass::AI(void)
}
#ifdef FIXIT_VERSION_3 // For endgame auto-sonar pulse.
if( Scen.AutoSonarTimer == 0 )
if( (Session.Type != GAME_NORMAL || !IsHuman) && Scen.AutoSonarTimer == 0 )
{
// If house has nothing but subs left, do an automatic sonar pulse to reveal them.
if( VQuantity[ VESSEL_SS ] > 0 ) // Includes count of VESSEL_MISSILESUBs. ajw
@@ -1820,12 +1823,18 @@ void HouseClass::Attacked(BuildingClass* source)
{
assert(Houses.ID(this) == ID);
bool expired = SpeakAttackDelay == 0;
bool spoke = false;
#ifdef FIXIT_BASE_ANNOUNCE
if (SpeakAttackDelay == 0 && ((Session.Type == GAME_NORMAL && IsPlayerControl) || PlayerPtr->Class->House == Class->House)) {
// if (SpeakAttackDelay == 0 && ((Session.Type == GAME_NORMAL && IsPlayerControl) || PlayerPtr->Class->House == Class->House)) {
if (expired && ((Session.Type == GAME_NORMAL && IsPlayerControl) || PlayerPtr->Class->House == Class->House)) {
#else
if (SpeakAttackDelay == 0 && PlayerPtr->Class->House == Class->House) {
// if (SpeakAttackDelay == 0 && PlayerPtr->Class->House == Class->House) {
if (expired && PlayerPtr->Class->House == Class->House) {
#endif
Speak(VOX_BASE_UNDER_ATTACK, NULL, source ? source->Center_Coord() : 0);
spoke = true;
// MBL 06.13.2020 - Timing change from 2 minute cooldown, per https://jaas.ea.com/browse/TDRA-6784
// SpeakAttackDelay = Options.Normalize_Delay(TICKS_PER_MINUTE * Rule.SpeakDelay); // 2 minutes
@@ -1840,6 +1849,22 @@ void HouseClass::Attacked(BuildingClass* source)
HouseTriggers[Class->House][index]->Spring(TEVENT_ATTACKED);
}
}
// MBL 07.07.2020 - CNC Patch 3, fix for not working for all players in MP, per https://jaas.ea.com/browse/TDRA-7249
// Separated to here as did not want to change any logic around the HouseTriggers[] Spring events
//
if (expired == true && spoke == false)
{
if (Session.Type != GAME_NORMAL) // Multiplayer
{
Speak(VOX_BASE_UNDER_ATTACK, this);
spoke = true;
// SpeakAttackDelay = Options.Normalize_Delay(TICKS_PER_MINUTE * Rule.SpeakDelay); // 2 minutes
// SpeakAttackDelay = Options.Normalize_Delay(TICKS_PER_MINUTE/2); // 30 seconds as requested
SpeakAttackDelay = Options.Normalize_Delay( (TICKS_PER_MINUTE/2)+(TICKS_PER_SECOND*5) ); // Tweaked for accuracy
}
}
}
@@ -3760,6 +3785,13 @@ void HouseClass::MPlayer_Defeated(void)
}
}
/*
** Remove any one-time superweapons the player might have.
*/
for (i = SPC_FIRST; i < SPC_COUNT; i++) {
SuperWeapon[i].Remove(true);
}
/*
** If this is me:
** - Set MPlayerObiWan, so I can only send messages to all players, and
@@ -4101,7 +4133,14 @@ void HouseClass::Blowup_All(void)
*/
count = 0;
while (::Units.Ptr(i)==uptr && uptr->Strength) {
damage = uptr->Strength;
// MBL 06.22.2020 RA: Not all aircraft die in this case; See https://jaas.ea.com/browse/TDRA-6840
// Likely due to damage biasing based on RA factions and/or difficulty settings
// Applying this to units (vehicles), ships, buildings, and infantry, too
//
// damage = uptr->Strength; // Original
damage = 0x7fff; // Copied from TD
uptr->Take_Damage(damage, 0, WARHEAD_HE, NULL, true);
count++;
if (count > 5 && uptr->IsActive) {
@@ -4120,7 +4159,13 @@ void HouseClass::Blowup_All(void)
if (::Aircraft.Ptr(i)->House == this && !::Aircraft.Ptr(i)->IsInLimbo) {
AircraftClass * aptr = ::Aircraft.Ptr(i);
damage = aptr->Strength;
// MBL 06.22.2020 RA: Not all aircraft die in this case; See https://jaas.ea.com/browse/TDRA-6840
// Likely due to damage biasing based on RA factions and/or difficulty settings
// Applying this to units (vehicles), ships, buildings, and infantry, too
//
// damage = aptr->Strength; // Original
damage = 0x7fff; // Copied from TD
aptr->Take_Damage(damage, 0, WARHEAD_HE, NULL, true);
if (!aptr->IsActive) {
i--;
@@ -4135,7 +4180,13 @@ void HouseClass::Blowup_All(void)
if (::Vessels.Ptr(i)->House == this && !::Vessels.Ptr(i)->IsInLimbo) {
VesselClass * vptr = ::Vessels.Ptr(i);
damage = vptr->Strength;
// MBL 06.22.2020 RA: Not all aircraft die in this case; See https://jaas.ea.com/browse/TDRA-6840
// Likely due to damage biasing based on RA factions and/or difficulty settings
// Applying this to units (vehicles), ships, buildings, and infantry, too
//
// damage = vptr->Strength; // Original
damage = 0x7fff; // Copied from TD
vptr->Take_Damage(damage, 0, WARHEAD_HE, NULL, true);
if (!vptr->IsActive) {
i--;
@@ -4153,7 +4204,14 @@ void HouseClass::Blowup_All(void)
count = 0;
while (Buildings.Ptr(i)==bptr && bptr->Strength) {
damage = bptr->Strength;
// MBL 06.22.2020 RA: Not all aircraft die in this case; See https://jaas.ea.com/browse/TDRA-6840
// Likely due to damage biasing based on RA factions and/or difficulty settings
// Applying this to units (vehicles), ships, buildings, and infantry, too
//
// damage = bptr->Strength; // Original
damage = 0x7fff; // Copied from TD
bptr->Take_Damage(damage, 0, WARHEAD_HE, NULL, true);
count++;
if (count > 5) {
@@ -4176,7 +4234,14 @@ void HouseClass::Blowup_All(void)
count = 0;
while (Infantry.Ptr(i)==iptr && iptr->Strength) {
damage = iptr->Strength;
// MBL 06.22.2020 RA: Not all aircraft die in this case; See https://jaas.ea.com/browse/TDRA-6840
// Likely due to damage biasing based on RA factions and/or difficulty settings
// Applying this to units (vehicles), ships, buildings, and infantry, too
//
// damage = iptr->Strength; // Original
damage = 0x7fff; // Copied from TD
warhead = Random_Pick(WARHEAD_SA, WARHEAD_FIRE);
iptr->Take_Damage(damage, 0, warhead, NULL, true);
@@ -8015,6 +8080,13 @@ void HouseClass::Check_Pertinent_Structures(void)
return;
}
// MBL 07.15.2020 - Prevention of recent issue with constant "player defeated logic" and message to client spamming
// Per https://jaas.ea.com/browse/TDRA-7433
//
if (IsDefeated) {
return;
}
bool any_good_buildings = false;
for (int index = 0; index < Buildings.Count(); index++) {
@@ -8022,9 +8094,11 @@ void HouseClass::Check_Pertinent_Structures(void)
if (b && b->IsActive && b->House == this) {
if (!b->Class->IsWall && *b != STRUCT_APMINE && *b != STRUCT_AVMINE) {
if (!b->IsInLimbo && b->Strength > 0) {
any_good_buildings = true;
break;
if (!Special.ModernBalance || (*b != STRUCT_SHIP_YARD && *b != STRUCT_FAKE_YARD && *b != STRUCT_SUB_PEN && *b != STRUCT_FAKE_PEN)) {
if (!b->IsInLimbo && b->Strength > 0) {
any_good_buildings = true;
break;
}
}
}
}
+12 -2
View File
@@ -511,6 +511,9 @@ int InfantryClass::Shape_Number(WindowNumberType window) const
** The animation frame numbers may be different when rendering in legacy mode vs. exporting for render in GlyphX. ST - 9/5/2019 12:34PM
*/
const DoInfoStruct *do_controls = (window == WINDOW_VIRTUAL) ? Class->DoControlsVirtual : Class->DoControls;
if (window != WINDOW_VIRTUAL && !IsOwnedByPlayer && *this == INFANTRY_SPY) {
do_controls = InfantryTypeClass::As_Reference(INFANTRY_E1).DoControls;
}
/*
** The infantry shape is always modulo the number of animation frames
@@ -698,7 +701,7 @@ void InfantryClass::Per_Cell_Process(PCPType why)
// If they're spying on a sub pen, give 'em a sonar pulse
if (build == STRUCT_SUB_PEN) {
House->SuperWeapon[SPC_SONAR_PULSE].Enable(true, true, false);
House->SuperWeapon[SPC_SONAR_PULSE].Enable(false, true, false);
// Add to Glyphx multiplayer sidebar. ST - 8/7/2019 10:13AM
if (Session.Type == GAME_GLYPHX_MULTIPLAYER) {
if (House->IsHuman) {
@@ -1486,7 +1489,7 @@ MoveType InfantryClass::Can_Enter_Cell(CELL cell, FacingType ) const
** Cloaked enemy objects are not considered if this is a Find_Path()
** call.
*/
if (!obj->Is_Techno() || ((TechnoClass *)obj)->Cloak != CLOAKED) {
if (!obj->Is_Techno() || !((TechnoClass *)obj)->Is_Cloaked(this)) {
/*
** Any non-allied blockage is considered impassible if the infantry
@@ -3964,6 +3967,13 @@ void InfantryClass::Movement_AI(void)
// if (IsTethered) Scatter(0, true);
}
/*
** Scatter infantry off buildings in guard modes.
*/
if (!IsTethered && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord].Cell_Building() != NULL) {
Scatter(0, true, true);
}
/*
** Double check to make sure it doesn't have a movement destination into a zone
** that it can't travel to. In such a case, abort the movement process by clearing
+3
View File
@@ -286,6 +286,9 @@ bool Read_Scenario_INI_Write_INB( char *root, bool fresh)
UnitClass::Read_INI(buffer);
Call_Back();
AircraftClass::Read_INI(buffer);
Call_Back();
VesselClass::Read_INI(buffer);
Call_Back();
+10
View File
@@ -435,6 +435,16 @@ bool Init_Game(int , char * [])
ChronalVortex.Stop();
ChronalVortex.Setup_Remap_Tables(Scen.Theater);
/*
** Clear out name overrides array
*/
#ifdef FIXIT_NAME_OVERRIDE
for (int index = 0; index < ARRAY_SIZE(NameOverride); index++) {
NameOverride[index] = NULL;
NameIDOverride[index] = 0;
}
#endif //FIXIT_NAME_OVERRIDE
return(true);
}
+4 -2
View File
@@ -316,6 +316,7 @@ void LogicClass::AI(void)
*/
for (index = 0; index < Count(); index++) {
ObjectClass * obj = (*this)[index];
int count = Count();
BStart(BENCH_AI);
obj->AI();
@@ -354,8 +355,9 @@ void LogicClass::AI(void)
** If the object was destroyed in the process of performing its AI, then
** adjust the index so that no object gets skipped.
*/
if (obj != (*this)[index]) {
index--;
int count_diff = Count() - count;
if (count_diff < 0) {
index += count_diff;
}
}
HouseClass::Recalc_Attributes();
+15 -5
View File
@@ -1026,6 +1026,16 @@ void MapClass::Logic(void)
** Tiberium cells that can grow or spread.
*/
int subcount = MAP_CELL_TOTAL / (Rule.GrowthRate * TICKS_PER_MINUTE);
/*
** Use the Tiberium setting as a multiplier on growth rate. ST - 7/1/2020 3:05PM
*/
if (Session.Type == GAME_GLYPHX_MULTIPLAYER) {
if (Session.Options.Tiberium > 1) {
subcount *= Session.Options.Tiberium;
}
}
subcount = max(subcount, 1);
int index;
for (index = TiberiumScan; index < MAP_CELL_TOTAL; index++) {
@@ -1416,11 +1426,11 @@ ObjectClass * MapClass::Close_Object(COORDINATE coord) const
while (o != NULL) {
/*
** Special case check to ignore cloaked object if not owned by the player.
** Special case check to ignore cloaked object if not allied with the player.
*/
// Change for client/server multiplayer. ST - 8/7/2019 10:35AM
//if (!o->Is_Techno() || ((TechnoClass *)o)->IsOwnedByPlayer || ((TechnoClass *)o)->Cloak != CLOAKED) {
if (!o->Is_Techno() || ((TechnoClass *)o)->Is_Owned_By_Player() || ((TechnoClass *)o)->Cloak != CLOAKED) {
if (!o->Is_Techno() || !((TechnoClass *)o)->Is_Cloaked(PlayerPtr)) {
int d=-1;
if (o->What_Am_I() == RTTI_BUILDING) {
d = Distance(coord, Cell_Coord(newcell));
@@ -1445,7 +1455,7 @@ ObjectClass * MapClass::Close_Object(COORDINATE coord) const
AircraftClass * aircraft = Aircraft.Ptr(index);
if (aircraft->In_Which_Layer() != LAYER_GROUND) {
if (aircraft->Is_Owned_By_Player() || (aircraft->Cloak != CLOAKED)) {
if (!aircraft->Is_Cloaked(PlayerPtr)) {
int d = Distance(coord, Coord_Add(aircraft->Center_Coord(), XY_Coord(0, -aircraft->Height)));
if (d >= 0 && (!object || d < distance)) {
distance = d;
@@ -1683,7 +1693,7 @@ int MapClass::Zone_Span(CELL cell, int zone, MZoneType check)
* HISTORY: *
* 10/05/1995 JLB : Created. *
*=============================================================================================*/
CELL MapClass::Nearby_Location(CELL cell, SpeedType speed, int zone, MZoneType check, bool checkflagged) const
CELL MapClass::Nearby_Location(CELL cell, SpeedType speed, int zone, MZoneType check, bool checkflagged, int locationmod) const
{
CELL topten[10];
int count = 0;
@@ -1767,7 +1777,7 @@ CELL MapClass::Nearby_Location(CELL cell, SpeedType speed, int zone, MZoneType c
}
if (count > 0) {
return(topten[Frame % count]);
return(topten[(Frame+locationmod) % count]);
}
return(0);
}
+1 -1
View File
@@ -61,7 +61,7 @@ class MapClass: public GScreenClass
CELL Pick_Random_Location(void) const;
int Intact_Bridge_Count(void) const;
bool Base_Region(CELL cell, HousesType & house, ZoneType & zone) const;
CELL Nearby_Location(CELL cell, SpeedType speed, int zone=-1, MZoneType check=MZONE_NORMAL, bool checkflagged=false) const;
CELL Nearby_Location(CELL cell, SpeedType speed, int zone=-1, MZoneType check=MZONE_NORMAL, bool checkflagged=false, int locationmod=0) const;
ObjectClass * Close_Object(COORDINATE coord) const;
virtual void Detach(ObjectClass * ) {};
int Cell_Region(CELL cell);
+8
View File
@@ -632,6 +632,14 @@ COORDINATE ObjectClass::Sort_Y(void) const
* HISTORY: *
* 09/21/1995 JLB : Created. *
*=============================================================================================*/
FireDataType ObjectClass::Fire_Data(int which) const
{
assert(this != 0);
assert(IsActive);
return{Fire_Coord(which),0};
}
COORDINATE ObjectClass::Fire_Coord(int ) const
{
assert(this != 0);
+1
View File
@@ -178,6 +178,7 @@ class ObjectClass : public AbstractClass
virtual COORDINATE Center_Coord(void) const;
virtual COORDINATE Render_Coord(void) const;
virtual COORDINATE Sort_Y(void) const;
virtual FireDataType Fire_Data(int which) const;
virtual COORDINATE Fire_Coord(int which) const;
virtual COORDINATE Exit_Coord(void) const;
+2 -2
View File
@@ -255,7 +255,7 @@ bool RadarClass::Radar_Activate(int control)
case 0:
if (Map.IsSidebarActive) {
if (IsRadarActive && !IsRadarDeactivating) {
Sound_Effect(VOC_RADAR_OFF);
// Sound_Effect(VOC_RADAR_OFF); // MBL 07.20.2020: These are never being sent to the client, so handled there; Disabling here for good measure.
IsRadarDeactivating = true;
IsRadarActive = false;
if (IsRadarActivating == true) {
@@ -272,7 +272,7 @@ bool RadarClass::Radar_Activate(int control)
case 1:
if (Map.IsSidebarActive) {
if (!IsRadarActivating && !IsRadarActive) {
Sound_Effect(VOC_RADAR_ON);
// Sound_Effect(VOC_RADAR_ON); // MBL 07.20.2020: These are never being sent to the client, so handled there; Disabling here for good measure.
IsRadarActivating = true;
if (IsRadarDeactivating == true) {
IsRadarDeactivating = false;
+4 -1
View File
@@ -2477,7 +2477,10 @@ bool Read_Scenario_INI(char * fname, bool )
UnitClass::Read_INI(ini);
Call_Back();
VesselClass::Read_INI(ini);
AircraftClass::Read_INI(ini);
Call_Back();
VesselClass::Read_INI(ini);
Call_Back();
/*
+1
View File
@@ -82,6 +82,7 @@ void SpecialClass::Init(void)
UseMCVDeploy = false;
IsMCVDeploy = false;
IsEarlyWin = false;
ModernBalance = false;
}
+13 -1
View File
@@ -105,10 +105,22 @@ class SpecialClass
*/
unsigned IsEarlyWin:1;
/*
** New modern balance setting.
*/
unsigned ModernBalance:1;
/*
** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load
*/
unsigned char SaveLoadPadding[128];
// MBL 07.21.2020 - https://jaas.ea.com/browse/TDRA-7537
// Loading save files from Live and July Patch 3 Beta versions results in a crash
// Fixes issue from Change 738397 2020/07/17 14:06:03
//
// unsigned char SaveLoadPadding[128]; // Note: Never changed to 127 like TD did
//
// unsigned char SaveLoadPadding[124]; // Trying 124 like we did with TD - Failed
unsigned char SaveLoadPadding[128]; // Works with With last weeks saves (7/16/2020) and newest saves; Skyler says go with this.
};
+4
View File
@@ -769,6 +769,10 @@ void __cdecl Prog_End(const char *why, bool fatal)
*((int*)0) = 0;
}
if (Session.Type == GAME_GLYPHX_MULTIPLAYER) {
return;
}
Sound_End();
if (WWMouse) {
delete WWMouse;
+2 -2
View File
@@ -168,9 +168,9 @@ bool SuperClass::Enable(bool onetime, bool player, bool quiet)
* HISTORY: *
* 07/28/1995 JLB : Created. *
*=============================================================================================*/
bool SuperClass::Remove(void)
bool SuperClass::Remove(bool forced)
{
if (IsPresent && !IsOneTime) {
if (IsPresent && (!IsOneTime || forced)) {
IsReady = false;
IsPresent = false;
return(true);
+1 -1
View File
@@ -47,7 +47,7 @@ class SuperClass {
bool Enable(bool onetime = false, bool player=false, bool quiet=false);
void Forced_Charge(bool player=false);
bool AI(bool player=false);
bool Remove(void);
bool Remove(bool forced=false);
void Impatient_Click(void) const;
int Anim_Stage(void) const;
bool Discharged(bool player);
+65 -24
View File
@@ -484,6 +484,25 @@ bool TechnoClass::Is_Allowed_To_Recloak(void) const
* HISTORY: *
* 07/29/1996 JLB : Created. *
*=============================================================================================*/
FireDataType TechnoClass::Fire_Data(int which) const
{
assert(IsActive);
TechnoTypeClass const * tclass = Techno_Type_Class();
int dist = 0;
if (which == 0) {
dist = tclass->PrimaryOffset;
} else {
dist = tclass->SecondaryOffset;
}
COORDINATE coord = Coord_Move(Center_Coord(), DIR_N, tclass->VerticalOffset + Height);
coord = Coord_Move(coord, DIR_E, tclass->HorizontalOffset);
return{coord,dist};
}
COORDINATE TechnoClass::Fire_Coord(int which) const
{
assert(IsActive);
@@ -662,7 +681,7 @@ bool TechnoClass::Is_Visible_On_Radar(void) const
}
}
}
if (!Techno_Type_Class()->IsInvisible && (Cloak != CLOAKED || House->Is_Ally(PlayerPtr))) {
if (!Is_Cloaked(PlayerPtr, true)) {
return(true);
}
return(false);
@@ -968,9 +987,14 @@ RadioMessageType TechnoClass::Receive_Message(RadioClass * from, RadioMessageTyp
/*
** If there is sufficient money to repair the unit one step, then do so.
** Otherwise return with a "can't complete" radio response.
** Special case: in single-player campaigns, also try to use the repair pad house's money.
*/
if (House->Available_Money() >= cost) {
House->Spend_Money(cost);
HouseClass* house = House;
if (Session.Type == GAME_NORMAL && house->Available_Money() < cost) {
house = HouseClass::As_Pointer(from->Owner());
}
if (house != NULL && house->Available_Money() >= cost) {
house->Spend_Money(cost);
Strength += step;
/*
@@ -1083,7 +1107,7 @@ void TechnoClass::Draw_It(int x, int y, WindowNumberType window) const
int width, height;
Class_Of().Dimensions(width, height);
const bool show_health_bar = (Strength > 0) && (Is_Selected_By_Player() ||
const bool show_health_bar = (Strength > 0) && !Is_Cloaked(PlayerPtr) && (Is_Selected_By_Player() ||
((Rule.HealthBarDisplayMode == RulesClass::HB_DAMAGED) && (Strength < Techno_Type_Class()->MaxStrength)) ||
(Rule.HealthBarDisplayMode == RulesClass::HB_ALWAYS));
@@ -1248,8 +1272,8 @@ bool TechnoClass::In_Range(TARGET target, int which, bool reciprocal_check) cons
if (building != NULL) {
range += ((building->Class->Width() + building->Class->Height()) * (ICON_LEPTON_W / 4));
}
if (::Distance(Fire_Coord(which), As_Coord(target)) <= range) {
FireDataType data = Fire_Data(which);
if (MAX(0, ::Distance(data.Center, As_Coord(target)) - data.Distance) <= range) {
return(true);
}
@@ -1304,8 +1328,8 @@ bool TechnoClass::In_Range(ObjectClass const * target, int which, bool reciproca
BuildingClass const * building = (BuildingClass const *)target;
range += ((building->Class->Width() + building->Class->Height()) * (ICON_LEPTON_W / 4));
}
if (::Distance(Fire_Coord(which), target->Center_Coord()) <= range) {
FireDataType data = Fire_Data(which);
if (MAX(0, ::Distance(data.Center, target->Center_Coord()) - data.Distance) <= range) {
return(true);
}
@@ -1501,7 +1525,7 @@ bool TechnoClass::Evaluate_Object(ThreatType method, int mask, int range, Techno
/*
** If the object is cloaked, then it isn't a legal target.
*/
if (object->Cloak == CLOAKED) {
if (object->Is_Cloaked(this)) {
BEnd(BENCH_EVAL_OBJECT);
return(false);
}
@@ -1530,16 +1554,12 @@ bool TechnoClass::Evaluate_Object(ThreatType method, int mask, int range, Techno
** object is a friend. Unless we're a medic, of course. But then,
** only consider it a target if it's injured.
*/
if (House->Is_Ally(object)) {
if (Combat_Damage() < 0) {
if (object->Health_Ratio() == Rule.ConditionGreen) {
BEnd(BENCH_EVAL_OBJECT);
return(false);
}
} else {
BEnd(BENCH_EVAL_OBJECT);
return(false);
}
bool is_ally = House->Is_Ally(object);
bool is_medic = Combat_Damage() < 0;
bool green_health = object->Health_Ratio() == Rule.ConditionGreen;
if ((is_ally && (!is_medic || green_health)) || (!is_ally && is_medic)) {
BEnd(BENCH_EVAL_OBJECT);
return(false);
}
/*
@@ -2011,6 +2031,27 @@ int TechnoClass::Evaluate_Just_Cell(CELL cell) const
}
bool TechnoClass::Is_Cloaked(HousesType house, bool check_invisible) const
{
const bool is_invisible = check_invisible && Techno_Type_Class()->IsInvisible;
return !House->Is_Ally(house) && ((Cloak == CLOAKED) || is_invisible);
}
bool TechnoClass::Is_Cloaked(HouseClass const * house, bool check_invisible) const
{
const bool is_invisible = check_invisible && Techno_Type_Class()->IsInvisible;
return !House->Is_Ally(house) && ((Cloak == CLOAKED) || is_invisible);
}
bool TechnoClass::Is_Cloaked(ObjectClass const * object, bool check_invisible) const
{
const bool is_invisible = check_invisible && Techno_Type_Class()->IsInvisible;
return !House->Is_Ally(object) && ((Cloak == CLOAKED) || is_invisible);
}
/***********************************************************************************************
* TechnoClass::Greatest_Threat -- Determines best target given search criteria. *
* *
@@ -2443,7 +2484,7 @@ void TechnoClass::AI(void)
** If for some strange reason, the computer is firing upon itself, then
** tell it not to.
*/
if (!House->IsHuman && As_Techno(TarCom) && As_Techno(TarCom)->House->Is_Ally(this)) {
if (!House->IsHuman && As_Techno(TarCom) && As_Techno(TarCom)->House->Is_Ally(this) && Combat_Damage() >= 0) {
//#ifdef FIXIT_CSII // checked - ajw 9/28/98 (commented out)
//if(What_Am_I() == RTTI_INFANTRY && *(InfantryClass *)this==INFANTRY_GENERAL && Session.Type==GAME_NORMAL && House->Class->House==HOUSE_UKRAINE) {
//} else
@@ -2768,9 +2809,9 @@ FireErrorType TechnoClass::Can_Fire(TARGET target, int which) const
ObjectClass * object = As_Object(target);
/*
** If the object is completely cloaked, then you can't fire on it.
** If an enemy object is completely cloaked, then you can't fire on it.
*/
if (object != NULL && object->Is_Techno() && ((TechnoClass *)object)->Cloak == CLOAKED) {
if (object != NULL && object->Is_Techno() && ((TechnoClass *)object)->Is_Cloaked(this)) {
return(FIRE_CANT);
}
@@ -4172,7 +4213,7 @@ void TechnoClass::Record_The_Kill(TechnoClass * source)
* 07/06/1995 JLB : Created. *
* 09/28/1995 JLB : Uses map scan function. *
*=============================================================================================*/
CELL TechnoClass::Nearby_Location(TechnoClass const * techno) const
CELL TechnoClass::Nearby_Location(TechnoClass const * techno, int locationmod) const
{
assert(IsActive);
@@ -4188,7 +4229,7 @@ CELL TechnoClass::Nearby_Location(TechnoClass const * techno) const
cell = Coord_Cell(Center_Coord());
}
return(Map.Nearby_Location(cell, speed, Map[cell].Zones[Techno_Type_Class()->MZone], Techno_Type_Class()->MZone));
return(Map.Nearby_Location(cell, speed, Map[cell].Zones[Techno_Type_Class()->MZone], Techno_Type_Class()->MZone, false, locationmod));
}
+5 -1
View File
@@ -271,7 +271,7 @@ class TechnoClass : public RadioClass,
bool Is_Ready_To_Cloak(void) const;
virtual int How_Many_Survivors(void) const;
virtual DirType Turret_Facing(void) const {return(PrimaryFacing.Current());}
CELL Nearby_Location(TechnoClass const * from=NULL) const;
CELL Nearby_Location(TechnoClass const * from=NULL, int locationmod=0) const;
TechnoTypeClass * Techno_Type_Class(void) const {return((TechnoTypeClass *)&Class_Of());};
bool Is_Visible_On_Radar(void) const;
int Anti_Air(void) const;
@@ -282,6 +282,7 @@ class TechnoClass : public RadioClass,
virtual ActionType What_Action(ObjectClass const * target) const;
virtual BuildingClass * Find_Docking_Bay(StructType b, bool friendly) const;
virtual CELL Find_Exit_Cell(TechnoClass const * techno) const;
virtual FireDataType Fire_Data(int) const;
virtual COORDINATE Fire_Coord(int which) const;
virtual DirType Desired_Load_Dir(ObjectClass * , CELL & moveto) const;
virtual DirType Fire_Direction(void) const;
@@ -338,6 +339,9 @@ class TechnoClass : public RadioClass,
bool Evaluate_Object(ThreatType method, int mask, int range, TechnoClass const * object, int & value, int zone=-1) const;
int Evaluate_Just_Cell(CELL cell) const;
virtual bool Electric_Zap (COORDINATE target_coord, int which, WindowNumberType window, COORDINATE source_coord=0L, unsigned char * remap=NULL) const;
bool Is_Cloaked(HousesType house, bool check_invisible=false) const;
bool Is_Cloaked(HouseClass const * house, bool check_invisible=false) const;
bool Is_Cloaked(ObjectClass const * object, bool check_invisible=false) const;
/*
** AI.
+40 -9
View File
@@ -433,6 +433,13 @@ void UnitClass::AI(void)
*/
Rotation_AI();
/*
** Scatter units off buildings in guard modes.
*/
if (!IsTethered && !IsFiring && !IsDriving && !IsRotating && (Mission == MISSION_GUARD || Mission == MISSION_GUARD_AREA) && MissionQueue == MISSION_NONE && Map[Coord].Cell_Building() != NULL) {
Scatter(0, true, true);
}
/*
** Delete this unit if it finds itself off the edge of the map and it is in
** guard or other static mission mode.
@@ -1283,6 +1290,11 @@ void UnitClass::Player_Assign_Mission(MissionType mission, TARGET target, TARGET
if (mission == MISSION_HARVEST) {
ArchiveTarget = TARGET_NONE;
} else if (mission == MISSION_ENTER) {
BuildingClass* building = As_Building(destination);
if (building != NULL && *building == STRUCT_REFINERY && building->In_Radio_Contact()) {
building->Transmit_Message(RADIO_OVER_OUT);
}
}
DriveClass::Player_Assign_Mission(mission, target, destination);
}
@@ -1707,7 +1719,7 @@ void UnitClass::Per_Cell_Process(PCPType why)
} else {
TechnoClass * contact = Contact_With_Whom();
if (Transmit_Message(RADIO_UNLOADED) == RADIO_RUN_AWAY) {
if (*this == UNIT_HARVESTER && contact && contact->What_Am_I() == RTTI_BUILDING) {
if (*this == UNIT_HARVESTER && contact && contact->What_Am_I() == RTTI_BUILDING && *((BuildingClass*)contact) != STRUCT_REPAIR) {
Assign_Mission(MISSION_HARVEST);
} else if (!Target_Legal(NavCom)) {
Scatter(0, true);
@@ -2231,10 +2243,25 @@ int UnitClass::Tiberium_Check(CELL & center, int x, int y)
center = XY_Cell(Cell_X(center)+x, Cell_Y(center)+y);
if ((Session.Type != GAME_NORMAL || (!IsOwnedByPlayer || Map[center].IsMapped))) {
if ((Session.Type != GAME_NORMAL || (!IsOwnedByPlayer || Map[center].Is_Mapped(PlayerPtr)))) {
if (Map[Coord].Zones[Class->MZone] != Map[center].Zones[Class->MZone]) return(0);
if (!Map[center].Cell_Techno() && Map[center].Land_Type() == LAND_TIBERIUM) {
return(Map[center].OverlayData);
int value = 0;
switch (Map[center].Overlay) {
case OVERLAY_GOLD1:
case OVERLAY_GOLD2:
case OVERLAY_GOLD3:
case OVERLAY_GOLD4:
value = Rule.GoldValue;
break;
case OVERLAY_GEMS1:
case OVERLAY_GEMS2:
case OVERLAY_GEMS3:
case OVERLAY_GEMS4:
value = Rule.GemValue*4;
break;
}
return((Map[center].OverlayData+1)*value);
}
}
return(0);
@@ -2278,6 +2305,7 @@ bool UnitClass::Goto_Tiberium(int rad)
int tiberium = 0;
int besttiberium = 0;
for (int x = -radius; x <= radius; x++) {
cell = center;
tiberium = Tiberium_Check(cell, x, -radius);
if (tiberium > besttiberium) {
bestcell = cell;
@@ -2862,10 +2890,10 @@ int UnitClass::Mission_Harvest(void)
*/
case LOOKING:
/*
** When full of tiberium, just skip to finding a free refinery
** to unload at.
** Slightly hacky; if TarCom is set then skip to finding home state.
*/
if (Tiberium_Load() == 1) {
if (Target_Legal(TarCom)) {
Assign_Target(TARGET_NONE);
Status = FINDHOME;
return(1);
}
@@ -3282,7 +3310,7 @@ MoveType UnitClass::Can_Enter_Cell(CELL cell, FacingType ) const
** Cloaked enemy objects are not considered if this is a Find_Path()
** call.
*/
if (!obj->Is_Techno() || ((TechnoClass *)obj)->Cloak != CLOAKED) {
if (!obj->Is_Techno() || !((TechnoClass *)obj)->Is_Cloaked(this)) {
/*
** If this unit can crush infantry, and there is an enemy infantry in the
@@ -3560,14 +3588,17 @@ ActionType UnitClass::What_Action(ObjectClass const * object) const
/*
** Special return to friendly refinery action.
*/
if (Is_Owned_By_Player() && House->Class->House == object->Owner() && object->What_Am_I() == RTTI_BUILDING && ((UnitClass *)this)->Transmit_Message(RADIO_CAN_LOAD, (TechnoClass*)object) == RADIO_ROGER) {
bool is_player_controlled = (Session.Type == GAME_NORMAL)
? (House->IsPlayerControl && object->Owner() != HOUSE_NONE && HouseClass::As_Pointer(object->Owner())->IsPlayerControl)
: (Is_Owned_By_Player() && House->Class->House == object->Owner());
if (is_player_controlled && object->What_Am_I() == RTTI_BUILDING && ((UnitClass *)this)->Transmit_Message(RADIO_CAN_LOAD, (TechnoClass*)object) == RADIO_ROGER) {
action = ACTION_ENTER;
}
/*
** Special return to friendly repair factory action.
*/
if (Is_Owned_By_Player() && House->Class->House == object->Owner() && action == ACTION_SELECT && object->What_Am_I() == RTTI_BUILDING) {
if (is_player_controlled && action == ACTION_SELECT && object->What_Am_I() == RTTI_BUILDING) {
BuildingClass * building = (BuildingClass *)object;
if (building->Class->Type == STRUCT_REPAIR && ((UnitClass *)this)->Transmit_Message(RADIO_CAN_LOAD, building) == RADIO_ROGER && !building->In_Radio_Contact() && !building->Is_Something_Attached()) {
action = ACTION_MOVE;
+1 -1
View File
@@ -728,7 +728,7 @@ unsigned long VersionClass::Max_Version(void)
char const * Version_Name(void) {
// jmarshall
#define AF_BUILDNUMBER 0 // Patch number for allied force.
#define EA_REMASTER_PATCH 2 // What version of the remaster source we are integrated with.
#define EA_REMASTER_PATCH 3 // What version of the remaster source we are integrated with.
static char tmp[512];
#ifdef _DEBUG
+27 -1
View File
@@ -299,7 +299,7 @@ MoveType VesselClass::Can_Enter_Cell(CELL cell, FacingType ) const
}
TechnoClass * techno = cellptr->Cell_Techno();
if (techno != NULL && techno->Cloak == CLOAKED && !House->Is_Ally(techno)) {
if (techno != NULL && techno->Is_Cloaked(this)) {
return(MOVE_CLOAK);
}
@@ -1183,6 +1183,32 @@ Mono_Set_Cursor(0,0);
* HISTORY: *
* 05/13/1996 JLB : Created. *
*=============================================================================================*/
FireDataType VesselClass::Fire_Data(int which) const
{
assert(Vessels.ID(this) == ID);
assert(IsActive);
COORDINATE coord = Center_Coord();
if (*this == VESSEL_CA) {
if (IsSecondShot) {
coord = Coord_Move(coord, PrimaryFacing + DIR_S, 0x0100);
} else {
coord = Coord_Move(coord, PrimaryFacing, 0x0100);
}
coord = Coord_Move(coord, DIR_N, 0x0030);
return{coord,0x0040};
}
if (*this == VESSEL_PT) {
coord = Coord_Move(coord, PrimaryFacing, 0x0080);
coord = Coord_Move(coord, DIR_N, 0x0020);
return{coord,0x0010};
}
return(DriveClass::Fire_Data(which));
}
COORDINATE VesselClass::Fire_Coord(int which) const
{
assert(Vessels.ID(this) == ID);
+1
View File
@@ -97,6 +97,7 @@ class VesselClass : public DriveClass
virtual int Mission_Unload(void);
void LST_Open_Door(void);
void LST_Close_Door(void);
virtual FireDataType Fire_Data(int) const;
virtual COORDINATE Fire_Coord(int which) const;
virtual MoveType Can_Enter_Cell(CELL cell, FacingType from=FACING_NONE) const;
virtual void Draw_It(int x, int y, WindowNumberType window) const;