embed the previously manually edited outdated documentation

from https://github.com/OpenRA/OpenRA/wiki/Trait-Documentation
This commit is contained in:
Matthias Mailänder
2013-03-20 21:19:15 +01:00
parent 8226fd21f9
commit c731a7960e
38 changed files with 178 additions and 35 deletions

View File

@@ -16,8 +16,15 @@ using OpenRA.Traits;
namespace OpenRA
{
//TODO: This is not exported into the documentation yet.
[Desc("A unit/building inside the game. Every rules starts with one and adds trait to it.\n" +
"\t# Special actors like world or player are usually defined in system.yaml and effect everything.")]
public class ActorInfo
{
[Desc("The actor name can be anything, but the sprites used in the Render*: traits default to this one.\n" +
"\t# Also if you add an ^ in front of the name, the engine will recognize this as a collection of traits\n" +
"\t# that can be inherited by others (using Inherits:) and not a real unit." +
"\t# You can remove inherited traits by adding a - infront of them as in -TraitName: to inherit everything, but this trait.")]
public readonly string Name;
public readonly TypeDictionary Traits = new TypeDictionary();

View File

@@ -18,21 +18,35 @@ namespace OpenRA.GameRules
{
public class WarheadInfo
{
public readonly int Spread = 1; // distance (in pixels) from the explosion center at which damage is 1/2.
[Desc("Distance (in pixels) from the explosion center at which damage is 1/2.")]
public readonly int Spread = 1;
[FieldLoader.LoadUsing( "LoadVersus" )]
public readonly Dictionary<string, float> Versus; // damage vs each armortype
public readonly bool Ore = false; // can this damage ore?
public readonly string Explosion = null; // explosion effect to use
public readonly string WaterExplosion = null; // explosion effect on hitting water (usually a splash)
public readonly string[] SmudgeType = { }; // type of smudge to apply
public readonly int[] Size = { 0, 0 }; // size of the explosion. provide 2 values for a ring effect (outer/inner)
public readonly int InfDeath = 1; // infantry death animation to use
public readonly string ImpactSound = null; // sound to play on impact
public readonly string WaterImpactSound = null; // sound to play on impact with water
public readonly int Damage = 0; // how much (raw) damage to deal
public readonly int Delay = 0; // delay in ticks before dealing the damage. 0=instant (old model)
public readonly DamageModel DamageModel = DamageModel.Normal; // which damage model to use
public readonly bool PreventProne = false; // whether we should prevent prone response in infantry.
[Desc("Damage vs each armortype. 0% = can't target.")]
public readonly Dictionary<string, float> Versus;
[Desc("Can this damage ore?")]
public readonly bool Ore = false;
[Desc("Explosion effect to use.")]
public readonly string Explosion = null;
[Desc("Explosion effect on hitting water (usually a splash).")]
public readonly string WaterExplosion = null;
[Desc("Type of smudge to apply to terrain.")]
public readonly string[] SmudgeType = { };
[Desc("Size of the explosion. provide 2 values for a ring effect (outer/inner).")]
public readonly int[] Size = { 0, 0 };
[Desc("Infantry death animation to use")]
public readonly int InfDeath = 1;
[Desc("Sound to play on impact.")]
public readonly string ImpactSound = null;
[Desc("Sound to play on impact with water")]
public readonly string WaterImpactSound = null;
[Desc("How much (raw) damage to deal")]
public readonly int Damage = 0;
[Desc("Delay in ticks before dealing the damage, 0 = instant (old model).")]
public readonly int Delay = 0;
[Desc("Which damage model to use.")]
public readonly DamageModel DamageModel = DamageModel.Normal;
[Desc("Whether we should prevent prone response for infantry.")]
public readonly bool PreventProne = false;
public float EffectivenessAgainst(Actor self)
{
@@ -87,6 +101,7 @@ namespace OpenRA.GameRules
{
public readonly float Range = 0;
public readonly string[] Report = null;
[Desc("Rate of Fire")]
public readonly int ROF = 1;
public readonly int Burst = 1;
public readonly bool Charges = false;

View File

@@ -50,7 +50,7 @@ namespace OpenRA.Graphics
nv += 4;
if (tileMapping[map.MapTiles.Value[i, j]].sheet != terrainSheet)
throw new InvalidOperationException("Terrain sprites span multiple sheets");
throw new InvalidOperationException("Terrain sprites span multiple sheets. Try increasing Game.Settings.Graphics.SheetSize.");
}
vertexBuffer = Game.Renderer.Device.CreateVertexBuffer( vertices.Length );

View File

@@ -12,11 +12,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.FileFormats;
namespace OpenRA.Traits
{
public class RenderSimpleInfo : ITraitInfo
{
[Desc("Defaults to the actor name.")]
public readonly string Image = null;
public readonly string Palette = null;
public readonly string PlayerPalette = "player";