Craters and scorches smoke.

This commit is contained in:
Paul Chote
2011-02-05 09:19:31 +13:00
parent afcb724793
commit 7693f3d16a
3 changed files with 11 additions and 3 deletions

View File

@@ -14,7 +14,8 @@ using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Traits;
using OpenRA.Traits;
using OpenRA.Mods.RA.Effects;
namespace OpenRA.Mods.RA
{
@@ -22,7 +23,9 @@ namespace OpenRA.Mods.RA
{
public readonly string Type = "Scorch";
public readonly string[] Types = {"sc1", "sc2", "sc3", "sc4", "sc5", "sc6"};
public readonly int[] Depths = {1,1,1,1,1,1};
public readonly int[] Depths = {1,1,1,1,1,1};
public readonly int SmokePercentage = 25;
public readonly string SmokeType = "smoke_m";
public object Create(ActorInitializer init) { return new SmudgeLayer(this); }
}
@@ -53,7 +56,10 @@ namespace OpenRA.Mods.RA
public void AddSmudge(int2 loc)
{
if (!world.GetTerrainInfo(loc).AcceptSmudge)
return;
return;
if (Game.CosmeticRandom.Next(0,100) <= Info.SmokePercentage)
world.AddFrameEndTask(w => w.Add(new Smoke(w, Traits.Util.CenterOfCell(loc), Info.SmokeType)));
// No smudge; create a new one
if (!tiles.ContainsKey(loc))

View File

@@ -119,6 +119,7 @@ World:
AllowUnderActors: false
SmudgeLayer@SCORCH:
Type:Scorch
SmokePercentage:50
Types:sc1,sc2,sc3,sc4,sc5,sc6
Depths:1,1,1,1,1,1
SmudgeLayer@CRATER:

View File

@@ -177,6 +177,7 @@ World:
AllowUnderActors: false
SmudgeLayer@SCORCH:
Type:Scorch
SmokePercentage:50
Types:sc1,sc2,sc3,sc4,sc5,sc6
Depths:1,1,1,1,1,1
SmudgeLayer@CRATER: