Update copyright header. Normalize line endings to LF.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2011 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 LICENSE.
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
@@ -22,28 +22,28 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
class CncShellmapScript: IWorldLoaded, ITick
|
||||
{
|
||||
Dictionary<string, Actor> Actors;
|
||||
Dictionary<string, Actor> Actors;
|
||||
static int2 ViewportOrigin;
|
||||
Map Map;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
{
|
||||
{
|
||||
Map = w.Map;
|
||||
var b = w.Map.Bounds;
|
||||
ViewportOrigin = new int2(b.Left + b.Width/2, b.Top + b.Height/2);
|
||||
Game.MoveViewport(ViewportOrigin);
|
||||
Game.MoveViewport(ViewportOrigin);
|
||||
|
||||
Actors = w.WorldActor.Trait<SpawnMapActors>().Actors;
|
||||
Sound.SoundVolumeModifier = 0.25f;
|
||||
}
|
||||
|
||||
int ticks = 0;
|
||||
int ticks = 0;
|
||||
float speed = 4f;
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
var loc = new float2(
|
||||
(float)(-System.Math.Sin((ticks + 45) % (360f * speed) * (Math.PI / 180) * 1f / speed) * 15f + ViewportOrigin.X),
|
||||
(float)(0.4f*System.Math.Cos((ticks + 45) % (360f * speed) * (Math.PI / 180) * 1f / speed) * 10f + ViewportOrigin.Y));
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
var loc = new float2(
|
||||
(float)(-System.Math.Sin((ticks + 45) % (360f * speed) * (Math.PI / 180) * 1f / speed) * 15f + ViewportOrigin.X),
|
||||
(float)(0.4f*System.Math.Cos((ticks + 45) % (360f * speed) * (Math.PI / 180) * 1f / speed) * 10f + ViewportOrigin.Y));
|
||||
Game.MoveViewport(loc);
|
||||
|
||||
if (ticks == 0)
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2011 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 LICENSE.
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.Cnc
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Cnc
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
{
|
||||
Map = w.Map;
|
||||
Map = w.Map;
|
||||
Players = w.players.Values.ToDictionary(p => p.InternalName);
|
||||
Actors = w.WorldActor.Trait<SpawnMapActors>().Actors;
|
||||
var b = w.Map.Bounds;
|
||||
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Cnc
|
||||
new OwnerInit( Players["BadGuy"] ),
|
||||
new FacingInit( 0 ),
|
||||
new LocationInit ( Actors["nod0"].Location ),
|
||||
});
|
||||
});
|
||||
var mobile = a.Trait<Mobile>();
|
||||
a.QueueActivity( mobile.MoveTo( Actors["nod1"].Location, 2 ) );
|
||||
a.QueueActivity( mobile.MoveTo( Actors["nod2"].Location, 2 ) );
|
||||
@@ -164,8 +164,8 @@ namespace OpenRA.Mods.Cnc
|
||||
}
|
||||
|
||||
void SetGunboatPath()
|
||||
{
|
||||
var self = Actors[ "Gunboat" ];
|
||||
{
|
||||
var self = Actors[ "Gunboat" ];
|
||||
var mobile = self.Trait<Mobile>();
|
||||
self.QueueActivity(mobile.ScriptedMove( Actors["gunboatLeft"].Location ));
|
||||
self.QueueActivity(mobile.ScriptedMove( Actors["gunboatRight"].Location ));
|
||||
@@ -183,8 +183,8 @@ namespace OpenRA.Mods.Cnc
|
||||
new LocationInit( startPos ),
|
||||
new OwnerInit( Players["GoodGuy"] ),
|
||||
new FacingInit( 0 ),
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var mobile = a.Trait<Mobile>();
|
||||
var cargo = a.Trait<Cargo>();
|
||||
foreach (var i in items)
|
||||
@@ -202,7 +202,7 @@ namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
var b = cargo.Unload(a);
|
||||
world.AddFrameEndTask(w2 =>
|
||||
{
|
||||
{
|
||||
if (b.Destroyed) return;
|
||||
w2.Add(b);
|
||||
b.TraitsImplementing<IMove>().FirstOrDefault().SetPosition(b, a.Location);
|
||||
|
||||
Reference in New Issue
Block a user