Merge pull request #5155 from Mailaender/ts-tiberium

Added Tiberium crystals and refinery to Tiberian Sun
This commit is contained in:
Paul Chote
2014-05-07 18:30:27 +12:00
13 changed files with 236 additions and 19 deletions

View File

@@ -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);
}

View File

@@ -244,6 +244,7 @@
<Compile Include="Scripting\ScriptMemberWrapper.cs" />
<Compile Include="Scripting\ScriptMemberExts.cs" />
<Compile Include="Scripting\ScriptPlayerInterface.cs" />
<Compile Include="Traits\Player\FixedColorPalette.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="FileSystem\D2kSoundResources.cs" />

View File

@@ -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);
}
}
}

View File

@@ -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";

Binary file not shown.

View File

@@ -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:

View File

@@ -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:
@@ -172,6 +174,7 @@
Rough: 40
Road: 100
Beach: 40
Tiberium: 40
ROT: 5
SelectionDecorations:
Palette: pips

View File

@@ -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:

View File

@@ -82,17 +82,23 @@ World:
Race: nod
ResourceLayer:
ResourceClaimLayer:
ResourceType@gem:
ResourceType: 2
Palette: player
EditorSprite: shadow
Variants: fake
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: 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
ValuePerUnit: 50
Name: Gems
PipColor: Red
AllowedTerrainTypes: Clear,Road
Name: Tiberium
PipColor: Green
AllowedTerrainTypes: Clear
AllowUnderActors: false
TerrainType: Gems
TerrainType: Tiberium
PathfinderDebugOverlay:
SpawnMapActors:
CreateMPPlayers:

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -693,3 +693,10 @@ Pistola:
InfDeath: 1
Damage: 2
Tiberium:
ROF: 16
Warhead:
Spread: 42
InfDeath: 6
Damage: 2
PreventProne: yes