From c6663f75052317f4b89029d8e6508d32aa568423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 8 Nov 2013 22:53:08 +0100 Subject: [PATCH 1/3] add Tiberian Sun refinery --- mods/ts/mod.yaml | 1 + mods/ts/rules/structures.yaml | 35 +++++++++++++++++++++++++++++++ mods/ts/sequences/structures.yaml | 32 ++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index be67fd7cbb..2042f4a465 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -92,6 +92,7 @@ Chrome: Assemblies: mods/d2k/OpenRA.Mods.D2k.dll mods/ra/OpenRA.Mods.RA.dll + mods/cnc/OpenRA.Mods.Cnc.dll mods/ts/OpenRA.Mods.TS.dll ChromeLayout: diff --git a/mods/ts/rules/structures.yaml b/mods/ts/rules/structures.yaml index 135820928e..e23b3a9d2e 100644 --- a/mods/ts/rules/structures.yaml +++ b/mods/ts/rules/structures.yaml @@ -111,6 +111,41 @@ GAPILE: WithIdleOverlay@FLAG: Sequence: idle-flag +PROC: + Inherits: ^Building + Valued: + Cost: 2000 + Tooltip: + Name: Tiberium Refinery + Description: Processes raw Tiberium\ninto useable resources + Buildable: + Queue: Building + BuildPaletteOrder: 20 + Prerequisites: anypower + Owner: gdi,nod + Building: + Power: -30 + Footprint: xxx xxx x== + Dimensions: 3,3 + Health: + HP: 900 + RevealsShroud: + Range: 6 +# Bib: + TiberiumRefinery: + StoresOre: + PipColor: Green + PipCount: 15 + Capacity: 1500 + CustomSellValue: + Value: 600 + FreeActor: + Actor: HARV + SpawnOffset: 1,2 + Facing: 64 + WithIdleOverlay@REDLIGHTS: + Sequence: idle-redlights + GAWEAP: Inherits: ^Building Valued: diff --git a/mods/ts/sequences/structures.yaml b/mods/ts/sequences/structures.yaml index 1dc543c348..9f21d10f8b 100644 --- a/mods/ts/sequences/structures.yaml +++ b/mods/ts/sequences/structures.yaml @@ -613,4 +613,36 @@ nahpad: Length: 20 ShadowStart: 20 icon: nhpdicon + Start: 0 + +proc: # TODO: unused narefn_a, narefn_b + idle: narefn + Start: 0 + ShadowStart: 3 + damaged-idle: narefn + Start: 1 + ShadowStart: 4 + critical-idle: narefn + Start: 2 + ShadowStart: 5 + make: narefnmk + Start: 0 + Length: 20 + ShadowStart: 20 + idle-redlights: narefn_c + Start: 0 + Length: 16 + Tick: 120 + damaged-idle-redlights: narefn_c + Start: 0 + Length: 16 + Tick: 120 + critical-idle-redlights: narefn_c + Start: 16 + Length: 16 + Tick: 200 +# bib: narefnbb +# Start: 0 +# Length: * + icon: reficon Start: 0 \ No newline at end of file From fd4cb59799a72dc86d3b14fce2dab5e5fce26841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 20 Apr 2014 18:10:39 +0200 Subject: [PATCH 2/3] add Tiberium to Tiberian Sun --- mods/ts/maps/blank-conquest.oramap | Bin 734 -> 1309 bytes mods/ts/rules/defaults.yaml | 11 ++-- mods/ts/rules/world.yaml | 19 +++---- mods/ts/sequences/misc.yaml | 83 +++++++++++++++++++++++++++-- mods/ts/tilesets/interior.yaml | 5 ++ mods/ts/weapons.yaml | 7 +++ 6 files changed, 109 insertions(+), 16 deletions(-) diff --git a/mods/ts/maps/blank-conquest.oramap b/mods/ts/maps/blank-conquest.oramap index 53e2bef0f191055f4a0678ee50c6c4b28599fcf2..512fdbb8fb21182eb94d4f13d928dae1e73412ef 100644 GIT binary patch delta 766 zcmcb|I+x2gz?+#xgn@y9gTZLR6qotuf0{30Vqjo(U}RtiismL3=p|+5y}faB(q#hy z)_~LAd;Xf#^R1mWhcmz?c&Vj1`=g>~OSj&Bdi+cBFH6RWg%T4RIKhae{=k2AC9EJ` zv)J-f=rj9waj9Cj%~$->sNNst)%pMZk2M$7vbP)vT(&e^zs)-mTX=mi<*uezNU*o!YQDrDis-kIXPuSa&X`+dAEG?sxAq zjgubNXYcRd`FrpBxQoBN<%Nq^{@r){dz_a%>+y>0`Y)xizn9Hn%wAdi@5I-CFRBx7 zGryi;!M>*cwe4<~sl`{ST>qZGYo_$BrCS zynlYL`@FVuIa9Y@$tj&G@sVZ5)~RbgoiqJ#X6OC7+4Dp5FI@INIr-f+{~fhDU(^ro zl6rG~hWwX5_21I}YDYb)fAhLtmeafMxADH^3tz|o$~hl7!L~l-Y4*C`k^|0}9ZSUZXN z`u-=8``p F1^`Pob}Ik? delta 173 zcmbQsb&oYGz?+#xgn@y9gJE~T4CfV{`xR1wJXQxr26iBwn^>Til$rPTkf9)h0T08% z^`9;BQ&Jiq`(E}BB@Mi1o){?4zZKQG&DWVOGIAj-p1g@gn+3$3{E$V8sf%IqUlu90 JSSFxD7yuJ+HTnPm diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index 0e18444daf..48a87596e0 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -10,7 +10,7 @@ Dimensions: 1,1 Footprint: x BuildSounds: place2.aud - TerrainTypes: Clear,Road + TerrainTypes: Clear, Road GivesBuildableArea: Capturable: SoundOnDamageTransition: @@ -48,7 +48,7 @@ Footprint: x BuildSounds: place2.aud Adjacent: 7 - TerrainTypes: Clear,Road + TerrainTypes: Clear, Road SoundOnDamageTransition: DamagedSound: expnew01.aud DestroyedSound: crmble2.aud @@ -95,8 +95,7 @@ Clear: 90 Rough: 80 Road: 100 - Ore: 80 - Gems: 80 + Tiberium: 80 Beach: 80 SelectionDecorations: Palette: pips @@ -124,6 +123,9 @@ GivesBounty: CrushableInfantry: CrushSound: squish6.aud + PoisonedByTiberium: + SpawnViceroid: + ViceroidActor: vissml UpdatesPlayerStatistics: CombatDebugOverlay: Guard: @@ -170,6 +172,7 @@ Rough: 40 Road: 100 Beach: 40 + Tiberium: 40 ROT: 5 SelectionDecorations: Palette: pips diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index 13759eea64..1c2bc200e1 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -82,17 +82,18 @@ World: Race: nod ResourceLayer: ResourceClaimLayer: - ResourceType@gem: - ResourceType: 2 - Palette: player - EditorSprite: shadow - Variants: fake + ResourceType@Tiberium: + ResourceType: 1 + Palette: player # TODO: this has to remap to green + EditorSprite: waypoint # TODO: editor can't handle the real ones + Variants: tib01, tib02, tib03, tib04, tib05, tib06, tib07, tib08, tib09, tib10, tib11, tib12, tib13, tib14, tib15, tib16, tib17, tib18, tib19, tib20 + MaxDensity: 12 ValuePerUnit: 50 - Name: Gems - PipColor: Red - AllowedTerrainTypes: Clear,Road + Name: Tiberium + PipColor: Green + AllowedTerrainTypes: Clear AllowUnderActors: false - TerrainType: Gems + TerrainType: Tiberium PathfinderDebugOverlay: SpawnMapActors: CreateMPPlayers: diff --git a/mods/ts/sequences/misc.yaml b/mods/ts/sequences/misc.yaml index e5d763e0c0..d09e628123 100644 --- a/mods/ts/sequences/misc.yaml +++ b/mods/ts/sequences/misc.yaml @@ -268,10 +268,87 @@ moveflsh: Length: * Tick: 30 -# TODO: placeholder resources: - fake: shadow - Length: * + tib01: tib01 + Start: 0 + Length: 12 + ShadowStart: 12 + tib02: tib02 + Start: 0 + Length: 12 + ShadowStart: 12 + tib03: tib03 + Start: 0 + Length: 12 + ShadowStart: 12 + tib04: tib04 + Start: 0 + Length: 12 + ShadowStart: 12 + tib05: tib05 + Start: 0 + Length: 12 + ShadowStart: 12 + tib06: tib06 + Start: 0 + Length: 12 + ShadowStart: 12 + tib07: tib07 + Start: 0 + Length: 12 + ShadowStart: 12 + tib08: tib08 + Start: 0 + Length: 12 + ShadowStart: 12 + tib09: tib09 + Start: 0 + Length: 12 + ShadowStart: 12 + tib10: tib10 + Start: 0 + Length: 12 + ShadowStart: 12 + tib11: tib11 + Start: 0 + Length: 12 + ShadowStart: 12 + tib12: tib12 + Start: 0 + Length: 12 + ShadowStart: 12 + tib13: tib13 + Start: 0 + Length: 12 + ShadowStart: 12 + tib14: tib14 + Start: 0 + Length: 12 + ShadowStart: 12 + tib15: tib15 + Start: 0 + Length: 12 + ShadowStart: 12 + tib16: tib16 + Start: 0 + Length: 12 + ShadowStart: 12 + tib17: tib17 + Start: 0 + Length: 12 + ShadowStart: 12 + tib18: tib18 + Start: 0 + Length: 12 + ShadowStart: 12 + tib19: tib19 + Start: 0 + Length: 12 + ShadowStart: 12 + tib20: tib20 + Start: 0 + Length: 12 + ShadowStart: 12 shroud: shroud: shadow diff --git a/mods/ts/tilesets/interior.yaml b/mods/ts/tilesets/interior.yaml index 3c6184d0b9..a6ec53d092 100644 --- a/mods/ts/tilesets/interior.yaml +++ b/mods/ts/tilesets/interior.yaml @@ -11,6 +11,11 @@ Terrain: AcceptsSmudgeType: Crater, Scorch Color: 0, 0, 0 TargetTypes: Ground + TerrainType@Tiberium: + Type: Tiberium + AcceptsSmudgeType: Crater, Scorch + Color: 161, 226, 28 + TargetTypes: Ground Templates: Template@255: diff --git a/mods/ts/weapons.yaml b/mods/ts/weapons.yaml index e2bfdcba8d..868a31546f 100644 --- a/mods/ts/weapons.yaml +++ b/mods/ts/weapons.yaml @@ -693,3 +693,10 @@ Pistola: InfDeath: 1 Damage: 2 +Tiberium: + ROF: 16 + Warhead: + Spread: 42 + InfDeath: 6 + Damage: 2 + PreventProne: yes From 8b3f15155edcee03a06293a76e3994c5d25ce39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 3 May 2014 08:18:56 +0200 Subject: [PATCH 3/3] remappable resource types --- OpenRA.Game/Graphics/PlayerColorRemap.cs | 2 +- OpenRA.Game/OpenRA.Game.csproj | 1 + .../Traits/Player/FixedColorPalette.cs | 50 +++++++++++++++++++ OpenRA.Game/Traits/World/ResourceType.cs | 4 +- mods/ts/rules/world.yaml | 7 ++- 5 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 OpenRA.Game/Traits/Player/FixedColorPalette.cs diff --git a/OpenRA.Game/Graphics/PlayerColorRemap.cs b/OpenRA.Game/Graphics/PlayerColorRemap.cs index 2aa9ddda69..78cd48b9f3 100755 --- a/OpenRA.Game/Graphics/PlayerColorRemap.cs +++ b/OpenRA.Game/Graphics/PlayerColorRemap.cs @@ -41,7 +41,7 @@ namespace OpenRA.Graphics for (var i = 15; i > 0; i--) remapRamp = ramp.Select(r => r - ramp[15]).ToArray(); } - + remapColors = remapRamp.Select((x, i) => Pair.New(baseIndex + i, Exts.ColorLerp(x / 16f, c1, c2))) .ToDictionary(u => u.First, u => u.Second); } diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index 14e6702f1b..2216860c0f 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -246,6 +246,7 @@ + diff --git a/OpenRA.Game/Traits/Player/FixedColorPalette.cs b/OpenRA.Game/Traits/Player/FixedColorPalette.cs new file mode 100644 index 0000000000..dd2abc304d --- /dev/null +++ b/OpenRA.Game/Traits/Player/FixedColorPalette.cs @@ -0,0 +1,50 @@ +#region Copyright & License Information +/* + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using OpenRA.FileFormats; +using OpenRA.Graphics; + +namespace OpenRA.Traits +{ + [Desc("Add this to the World actor definition.")] + public class FixedColorPaletteInfo : ITraitInfo + { + [Desc("The name of the palette to base off.")] + public readonly string Base = "terrain"; + [Desc("The name of the resulting palette")] + public readonly string Name = "resources"; + [Desc("Remap these indices to pre-defined colors.")] + public readonly int[] RemapIndex = { }; + [Desc("The fixed color to remap.")] + public readonly HSLColor Color; + [Desc("Luminosity range to span.")] + public readonly float Ramp = 0.05f; + [Desc("Allow palette modifiers to change the palette.")] + public readonly bool AllowModifiers = true; + + public object Create(ActorInitializer init) { return new FixedColorPalette(this); } + } + + public class FixedColorPalette : IPalette + { + readonly FixedColorPaletteInfo info; + + public FixedColorPalette(FixedColorPaletteInfo info) + { + this.info = info; + } + + public void InitPalette(WorldRenderer wr) + { + var remap = new PlayerColorRemap(info.RemapIndex, info.Color, info.Ramp); + wr.AddPalette(info.Name, new Palette(wr.Palette(info.Base).Palette, remap), info.AllowModifiers); + } + } +} diff --git a/OpenRA.Game/Traits/World/ResourceType.cs b/OpenRA.Game/Traits/World/ResourceType.cs index d477f25c5e..fc41e476b3 100644 --- a/OpenRA.Game/Traits/World/ResourceType.cs +++ b/OpenRA.Game/Traits/World/ResourceType.cs @@ -1,6 +1,6 @@ #region Copyright & License Information /* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * Copyright 2007-2014 The OpenRA Developers (see AUTHORS) * This file is part of OpenRA, which is free software. It is made * available to you under the terms of the GNU General Public License * as published by the Free Software Foundation. For more information, @@ -16,7 +16,7 @@ namespace OpenRA.Traits { public class ResourceTypeInfo : ITraitInfo { - // Hack: The editor is getting really unmaintanable... + // HACK: The editor is getting really unmaintanable... public readonly string EditorSprite; public readonly string[] Variants = { }; public readonly string Palette = "terrain"; diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index 1c2bc200e1..3fe037c8ef 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -82,9 +82,14 @@ World: Race: nod ResourceLayer: ResourceClaimLayer: + FixedColorPalette@GreenTiberium: + Base: player + Name: greentiberium + Color: 57, 201, 128 + RemapIndex: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ResourceType@Tiberium: ResourceType: 1 - Palette: player # TODO: this has to remap to green + Palette: greentiberium EditorSprite: waypoint # TODO: editor can't handle the real ones Variants: tib01, tib02, tib03, tib04, tib05, tib06, tib07, tib08, tib09, tib10, tib11, tib12, tib13, tib14, tib15, tib16, tib17, tib18, tib19, tib20 MaxDensity: 12