diff --git a/OpenRA.Utility/Command.cs b/OpenRA.Utility/Command.cs index 51ebff6a9d..660f32a993 100644 --- a/OpenRA.Utility/Command.cs +++ b/OpenRA.Utility/Command.cs @@ -151,13 +151,41 @@ namespace OpenRA.Utility frame = srcImage[f]; } } + else if (args.Contains("--wall")) //complex resorting to RA/CnC compatible frame order + { + int[] D2kBrikFrameOrder = {1, 4, 2, 12, 5, 6, 16, 9, 3, 13, 7, 8, 14, 10, 11, 15, 17, 20, 18, 28, 21, 22, 32, 25, 19, 29, 23, 24, 30, 26, 27, 31}; + foreach (int o in D2kBrikFrameOrder) + { + int f = startFrame -1 + o; + + frame = srcImage[f]; + + if (frame.OffsetX < 0) { frame.OffsetX = 0 - frame.OffsetX; } + if (frame.OffsetY < 0) { frame.OffsetY = 0 - frame.OffsetY; } + OffsetX = 0 + frame.OffsetX; + OffsetY = frame.FrameHeight - frame.OffsetY; + Console.WriteLine("calculated OffsetX: {0}", OffsetX); + Console.WriteLine("calculated OffsetY: {0}", OffsetY); + + var data = bitmap.LockBits(new Rectangle(x+OffsetX, 0+OffsetY, frame.Width, frame.Height), ImageLockMode.WriteOnly, + PixelFormat.Format8bppIndexed); + + for (var i = 0; i < frame.Height; i++) + Marshal.Copy(frame.Image, i * frame.Width, + new IntPtr(data.Scan0.ToInt64() + i * data.Stride), frame.Width); + + bitmap.UnlockBits(data); + + x += frame.FrameWidth; + } + } else { for (int f = startFrame; f < endFrame; f++) { frame = srcImage[f]; - if (args.Contains("--infrantry")) + if (args.Contains("--infantry")) { OffsetX = frame.FrameWidth/2 - frame.Width/2; OffsetY = frame.FrameHeight/2 - frame.Height/2; diff --git a/mods/d2k/TODO b/mods/d2k/TODO index 3a45d82bf7..b2586a6edc 100644 --- a/mods/d2k/TODO +++ b/mods/d2k/TODO @@ -1,8 +1,6 @@ -# make R8Reader not always scan the whole file on load # brick walls don't fit, requires updated RenderBuildingWall # factories and refinery require overlays (something like RenderWeaponFactory) # make structures appear earlier when errecting from ground -# silo frames don't fit, requires updated RenderSilo # harvester unload frames missing (too few DATA.R8 frames in general) # carryalls should automatically transport harvesters (needs complex logic) # windtrap animations missing @@ -11,15 +9,15 @@ # Arrakis tileset crashes the game # create a tileset extractor for gamefiles to remove copyrighted content from distribution # replace ore with spice and mines with spice blooms -# add game logic for concrete plates +# add game logic for concrete plates (use terrain overlay from bridges/ressources) # allow placing turrets on walls # support separate turret sequence with RenderBuildingTurreted -# repair bay should repair vehicles -# add ornithocopter (might need new RenderOrni code) +# repair bay should really repair vehicles +# ornithocopter should flap (might need new RenderOrni code for proper animation) +# R8 converter needs infantry frame resorter # add infantry -# add tanks # add sandworm -# add thumper +# add thumper which really attracts sandworms # allow upgrades # add ordos/harkonnen (avoid redundancy using inheritances) # add voices (Dune 2000/DATA/SFX folder contains .aud files) @@ -28,4 +26,5 @@ # create a shellmap # rework chrome UI, dialoges, tabs # add install rules to makefile (once more polished) -# idea: frame 2998 (looks like hole) could become a tunnel to make Ordos really insidious (similiar mechanism to paratroopers powerproxy) \ No newline at end of file +# idea: frame 2998 (fremen siech) could become a tunnel to make Ordos really insidious (similiar mechanism to paratroopers powerproxy) +# add sonic tank weapon (currently uses tesla) \ No newline at end of file diff --git a/mods/d2k/maps/blank.oramap b/mods/d2k/maps/blank.oramap new file mode 100644 index 0000000000..c826e5a14e Binary files /dev/null and b/mods/d2k/maps/blank.oramap differ diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 12c793955e..900e0cd16c 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -17,6 +17,7 @@ Packages: Rules: mods/d2k/rules/system.yaml + mods/d2k/rules/defaults.yaml mods/d2k/rules/vehicles.yaml mods/d2k/rules/structures.yaml mods/d2k/rules/aircraft.yaml diff --git a/mods/d2k/rules/aircraft.yaml b/mods/d2k/rules/aircraft.yaml index fa38554b87..8c8c3fffa3 100644 --- a/mods/d2k/rules/aircraft.yaml +++ b/mods/d2k/rules/aircraft.yaml @@ -58,4 +58,42 @@ C17: Invulnerable: -Selectable: -GainsExperience: - FlyAwayOnIdle: \ No newline at end of file + FlyAwayOnIdle: + +ORNI: + Inherits: ^Helicopter + Buildable: + Queue: Plane + BuildPaletteOrder: 90 + Prerequisites: hightecha + BuiltAt: hightecha + Owner: atreides + Valued: + Cost: 1000 + Tooltip: + Name: Ornithocopter + Description: Helicopter Gunship with Chainguns.\n Strong vs Infantry, Light Vehicles.\n Weak vs Tanks + Health: + HP: 150 + Armor: + Type: Light + RevealsShroud: + Range: 10 + AttackHeli: + PrimaryWeapon: ChainGun + PrimaryOffset: -5,-2,0,2 + FacingTolerance: 20 + Helicopter: + LandWhenIdle: false + InitialFacing: 20 + ROT: 4 + Speed: 12 + RenderUnit: + PlayerPalette: d2kplayer + WithShadow: + Selectable: + Bounds: 38,32,0,0 + FallsToEarth: + Explosion: UnitExplode + SmokeTrailWhenDamaged: + Offset: 0,-10 \ No newline at end of file diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml new file mode 100644 index 0000000000..93386afa85 --- /dev/null +++ b/mods/d2k/rules/defaults.yaml @@ -0,0 +1,310 @@ +^Vehicle: + AppearsOnRadar: + Mobile: + Crushes: atmine, crate, apmine + TerrainSpeeds: + Clear: 80 + Rough: 40 + Road: 100 + Ore: 70 + Beach: 40 + ROT: 5 + SelectionDecorations: + Selectable: + Voice: VehicleVoice + TargetableUnit: + TargetTypes: Ground + Repairable: + Chronoshiftable: + Passenger: + CargoType: Vehicle + IronCurtainable: + AttackMove: + HiddenUnderFog: + GainsExperience: + GivesExperience: + DrawLineToTarget: + ActorLostNotification: + Notification: unitlst1.aud + ProximityCaptor: + Types:Vehicle + GivesBounty: + GpsDot: + String:Vehicle + WithSmoke: + +^Tank: + AppearsOnRadar: + Mobile: + Crushes: wall, atmine, crate, apmine + TerrainSpeeds: + Clear: 80 + Rough: 70 + Road: 100 + Ore: 70 + Beach: 70 + ROT: 5 + SelectionDecorations: + Selectable: + Voice: VehicleVoice + TargetableUnit: + TargetTypes: Ground + Repairable: + Chronoshiftable: + Passenger: + CargoType: Vehicle + IronCurtainable: + AttackMove: + HiddenUnderFog: + GainsExperience: + GivesExperience: + DrawLineToTarget: + ActorLostNotification: + Notification: unitlst1.aud + ProximityCaptor: + Types:Tank + GivesBounty: + GpsDot: + String:Vehicle + WithSmoke: + +^Infantry: + AppearsOnRadar: + Health: + Radius: 3 + Armor: + Type: None + RevealsShroud: + Range: 4 + Mobile: + Crushes: apmine, crate + SharesCell: true + TerrainSpeeds: + Clear: 90 + Rough: 80 + Road: 100 + Ore: 80 + Beach: 80 + SelectionDecorations: + Selectable: + Voice: GenericVoice + TargetableUnit: + TargetTypes: Ground + RenderInfantry: + AutoTarget: + AttackMove: + Passenger: + CargoType: Infantry + HiddenUnderFog: + TeslaInstantKills: + GainsExperience: + GivesExperience: + DrawLineToTarget: + ActorLostNotification: + Notification: unitlst1.aud + ProximityCaptor: + Types:Infantry + GivesBounty: + GpsDot: + String:Infantry + ParachuteAttachment: + Offset: 0,-10 + CrushableInfantry: + CrushSound: squishy2.aud + +^Ship: + AppearsOnRadar: + Mobile: + Crushes: crate + TerrainSpeeds: + Water: 100 + SelectionDecorations: + Selectable: + Voice: ShipVoice + TargetableUnit: + TargetTypes: Ground, Water + DetectCloaked: + Range: 3 + HiddenUnderFog: + AttackMove: + GainsExperience: + GivesExperience: + DrawLineToTarget: + ActorLostNotification: + Notification: navylst1.aud + ProximityCaptor: + Types:Ship + GivesBounty: + GpsDot: + String:Ship + WithSmoke: + +^Plane: + AppearsOnRadar: + UseLocation: yes + SelectionDecorations: + Selectable: + Voice: GenericVoice + TargetableAircraft: + TargetTypes: Air + GroundedTargetTypes: Ground + HiddenUnderFog: + GainsExperience: + GivesExperience: + DrawLineToTarget: + ActorLostNotification: + Notification: aunitl1.aud + DebugAircraftFacing: + DebugAircraftSubPxX: + DebugAircraftSubPxY: + DebugAircraftAltitude: + ProximityCaptor: + Types:Plane + EjectOnDeath: + PilotActor: E1 + SuccessRate: 50 + GivesBounty: + GpsDot: + String:Plane + +^Helicopter: + Inherits: ^Plane + GpsDot: + String:Helicopter + +^Building: + AppearsOnRadar: + SelectionDecorations: + Selectable: + Priority: 3 + TargetableBuilding: + TargetTypes: Ground + Building: + Dimensions: 1,1 + Footprint: x + TerrainTypes: Clear,Road + GivesBuildableArea: + Capturable: + CapturableBar: + SoundOnDamageTransition: + DamagedSound: kaboom1.aud + DestroyedSound: kaboom22.aud + RenderBuilding: + WithBuildingExplosion: + RepairableBuilding: + EmitInfantryOnSell: + ActorTypes: e1,e1,e1,c1,c2,e6 + MustBeDestroyed: + GivesExperience: +# FrozenUnderFog: + CaptureNotification: + Notification: strucap1.aud + EditorAppearance: + RelativeToTopLeft: yes + ShakeOnDeath: + ProximityCaptor: + Types:Building + Sellable: + AcceptsSupplies: + GivesBounty: + +^Wall: + AppearsOnRadar: + Building: + Dimensions: 1,1 + Footprint: x + BuildSounds: placbldg.aud + Adjacent: 7 + TerrainTypes: Clear,Road + SoundOnDamageTransition: + DamagedSound: sandbag2.aud + DestroyedSound: sandbag2.aud + Wall: + CrushClasses: wall + LineBuild: + Range: 8 + SelectionDecorations: + Selectable: + Priority: 1 + TargetableBuilding: + TargetTypes: Ground + RenderBuildingWall: + HasMakeAnimation: false + Palette: terrain + GivesExperience: + EditorAppearance: + RelativeToTopLeft: yes + AutoTargetIgnore: + ProximityCaptor: + Types:Wall + Sellable: + +^CivBuilding: + Inherits: ^Building + -RepairableBuilding: + Health: + HP: 400 + Armor: + Type: Wood + Tooltip: + Name: Civilian Building + ProximityCaptor: + Types:CivilianBuilding + -AcceptsSupplies: + -GivesBuildableArea: + -Sellable: + -Capturable: + -CapturableBar: + +^CivField: + Inherits: ^CivBuilding + -Selectable: + Tooltip: + Name: Field + -ProximityCaptor: + ProximityCaptor: + Types:CivilianField + +^Tree: + Tooltip: + Name: Tree + RenderBuilding: + Palette: terrain + Building: + Footprint: x + Dimensions: 1,1 + AppearsOnRadar: + RadarColorFromTerrain: + Terrain: Tree + EditorAppearance: + RelativeToTopLeft: yes + ProximityCaptor: + Types:Tree + +^Husk: + Husk: + RenderUnit: + Health: + HP: 140 + Armor: + Type: Heavy + HiddenUnderFog: + AppearsOnRadar: + Burns: + ProximityCaptor: + Types:Husk + +^Bridge: + Tooltip: + Name: Bridge + BelowUnits: + TargetableBuilding: + TargetTypes: Ground, Water + Building: + Footprint: ____ ____ + Dimensions: 4,2 + Health: + HP: 1000 + ProximityCaptor: + Types:Bridge + AutoTargetIgnore: diff --git a/mods/d2k/rules/infantry.yaml b/mods/d2k/rules/infantry.yaml index 9162f020cf..009385f4ba 100644 --- a/mods/d2k/rules/infantry.yaml +++ b/mods/d2k/rules/infantry.yaml @@ -1,23 +1,23 @@ -#RIFLE: -# Inherits: ^Infantry -# Buildable: -# Queue: Infantry -# BuildPaletteOrder: 10 -# Owner: atreides -# Valued: -# Cost: 100 -# Tooltip: -# Name: Rifle Infantry -# Description: General-purpose infantry.\n Strong vs Infantry\n Weak vs Vehicles -# Selectable: -# Bounds: 12,17,0,-9 -# Health: -# HP: 50 -# Mobile: -# Speed: 4 -# AttackFrontal: -# PrimaryWeapon: M1Carbine -# TakeCover: -# -RenderInfantry: -# RenderInfantryProne: -# IdleAnimations: idle1,idle2 \ No newline at end of file +RIFLE: + Inherits: ^Infantry + Buildable: + Queue: Infantry + BuildPaletteOrder: 10 + Owner: atreides + Valued: + Cost: 100 + Tooltip: + Name: Rifle Infantry + Description: General-purpose infantry.\n Strong vs Infantry\n Weak vs Vehicles + Selectable: + Bounds: 12,17,0,-9 + Health: + HP: 50 + Mobile: + Speed: 4 + AttackFrontal: + PrimaryWeapon: M1Carbine + TakeCover: + -RenderInfantry: + RenderInfantryProne: + PlayerPalette: d2kplayer \ No newline at end of file diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index d0f99461bc..5d148e90da 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -242,12 +242,12 @@ SILOA: Type: Wood RevealsShroud: Range: 4 -# RenderBuildingSilo: + RenderBuildingSilo: + PlayerPalette: d2kplayer StoresOre: PipCount: 5 Capacity: 1500 - RenderBuilding: - PlayerPalette: d2kplayer + -RenderBuilding: -EmitInfantryOnSell: LIGHTA: @@ -476,6 +476,5 @@ REPAIRA: PlayerPalette: d2kplayer BelowUnits: Reservable: - RallyPoint: RepairsUnits: - Interval: 10 \ No newline at end of file + RallyPoint: \ No newline at end of file diff --git a/mods/d2k/rules/vehicles.yaml b/mods/d2k/rules/vehicles.yaml index 7fc4a71a7a..696c6bc4aa 100644 --- a/mods/d2k/rules/vehicles.yaml +++ b/mods/d2k/rules/vehicles.yaml @@ -224,4 +224,33 @@ Missile: PrimaryLocalOffset: 3,-5,0,0,0, -3,-5,0,0,0 RenderUnit: PlayerPalette: d2kplayer + AutoTarget: + +SONIC: + Inherits: ^Vehicle + Buildable: + Queue: Vehicle + BuildPaletteOrder: 15 + Prerequisites: heavya,researcha + Owner: atreides + Valued: + Cost: 1500 + Tooltip: + Name: Sonic Tank + Description: Fires a sound wave\n Strong vs Infantry.\n Weak vs Tanks + Selectable: + Bounds: 24,24 + Health: + HP: 150 + Armor: + Type: Light + Mobile: + Speed: 8 + RevealsShroud: + Range: 7 + RenderUnit: + PlayerPalette: d2kplayer + AttackFrontal: + PrimaryWeapon: TTankZap + PrimaryOffset: 0,0,0,-5 AutoTarget: \ No newline at end of file diff --git a/mods/d2k/sequences.yaml b/mods/d2k/sequences.yaml index 32c77eb9fc..f7fcc7f730 100644 --- a/mods/d2k/sequences.yaml +++ b/mods/d2k/sequences.yaml @@ -103,8 +103,7 @@ refa: siloa: idle: Start: 0 -# Length: 3 - Length: 1 + Length: 4 damaged-idle: Start: 4 Length: 1 @@ -166,6 +165,11 @@ carryall: Start: 0 Facings: 32 +orni: + idle: + Start: 0 + Facings: 32 + trike: idle: Start: 0 @@ -197,6 +201,11 @@ missile: Start: 0 Facings: 32 +sonic: + idle: + Start: 0 + Facings: 32 + guntowera: idle: Start: 0 @@ -222,46 +231,38 @@ frigate: Start: 0 Facings: 1 -#rifle: -# stand: -# Start: 0 -# Facings: 8 -# run: -# Start: 8 -# Length: 6 -# Facings: 8 -# shoot: -# Start: 56 -# Length: 8 -# Facings: 8 -# prone-stand: -# Start: 136 -# Length: 4 -# Facings: 8 -# prone-run: -# Start: 136 -# Length: 4 -# Facings: 8 -# standup-0: -# Start: 176 -# Length: 2 -# Facings: 8 -# prone-shoot: -# Start: 168 -# Length: 8 -# Facings: 8 -# die1: -# Start: 288 -# Length: 8 -# die2: -# Start: 296 -# Length: 8 -# die3: -# Start: 304 -# Length: 8 -# die4: -# Start: 312 -# Length: 12 -# die5: -# Start: 324 -# Length: 18 \ No newline at end of file +#TODO: This is wrong. +rifle: + stand: + Start: 0 + Facings: 8 + stand2: + Start: 8 + Length: 8 + stand3: + Start: 128 + Length: 16 + run: + Start: 16 + Length: 6 + Facings: 8 + shoot: + Start: 64 + Length: 6 + Facings: 8 + prone-stand: + Start: 112 + Length: 4 + Facings: 8 + prone-run: + Start: 144 + Length: 4 + Facings: 8 + standup-0: + Start: 176 + Length: 2 + Facings: 8 + prone-shoot: + Start: 192 + Length: 6 + Facings: 8 \ No newline at end of file diff --git a/ripD2kGameFiles.sh b/ripD2kGameFiles.sh index afed7b29df..09a606d38d 100755 --- a/ripD2kGameFiles.sh +++ b/ripD2kGameFiles.sh @@ -71,7 +71,7 @@ mono OpenRA.Utility.exe --r8 $R8 $PAL 2523 2524 "pwra" --building mono OpenRA.Utility.exe --shp pwra.png 64 mono OpenRA.Utility.exe --r8 $R8 $PAL 2525 2526 "barra" --building mono OpenRA.Utility.exe --shp barra.png 80 -mono OpenRA.Utility.exe --r8 $R8 $PAL 2527 2558 "walla" --building +mono OpenRA.Utility.exe --r8 $R8 $PAL 2527 2558 "walla" --wall mono OpenRA.Utility.exe --shp walla.png 32 mono OpenRA.Utility.exe --r8 $R8 $PAL 2559 2560 "conyarda" --building mono OpenRA.Utility.exe --shp conyarda.png 96