Merge pull request #6667 from steelphase-forks/common-effects
Mods.Common effects
This commit is contained in:
@@ -13,7 +13,7 @@ using System.Collections.Generic;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
public class Beacon : IEffect
|
||||
{
|
||||
7
OpenRA.Mods.RA/Effects/Bullet.cs → OpenRA.Mods.Common/Effects/Bullet.cs
Executable file → Normal file
7
OpenRA.Mods.RA/Effects/Bullet.cs → OpenRA.Mods.Common/Effects/Bullet.cs
Executable file → Normal file
@@ -15,11 +15,10 @@ using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
public class BulletInfo : IProjectileInfo
|
||||
{
|
||||
@@ -83,12 +82,12 @@ namespace OpenRA.Mods.RA.Effects
|
||||
target = args.PassiveTarget;
|
||||
if (info.Inaccuracy.Range > 0)
|
||||
{
|
||||
var inaccuracy = Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, args.InaccuracyModifiers);
|
||||
var inaccuracy = OpenRA.Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, args.InaccuracyModifiers);
|
||||
var maxOffset = inaccuracy * (target - pos).Length / args.Weapon.Range.Range;
|
||||
target += WVec.FromPDF(world.SharedRandom, 2) * maxOffset / 1024;
|
||||
}
|
||||
|
||||
facing = Traits.Util.GetFacing(target - pos, 0);
|
||||
facing = OpenRA.Traits.Util.GetFacing(target - pos, 0);
|
||||
length = Math.Max((target - pos).Length / speed.Range, 1);
|
||||
|
||||
if (info.Image != null)
|
||||
3
OpenRA.Mods.RA/Effects/Contrail.cs → OpenRA.Mods.Common/Effects/Contrail.cs
Executable file → Normal file
3
OpenRA.Mods.RA/Effects/Contrail.cs → OpenRA.Mods.Common/Effects/Contrail.cs
Executable file → Normal file
@@ -11,11 +11,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
[Desc("Draw a colored contrail behind this actor when they move.")]
|
||||
class ContrailInfo : ITraitInfo, Requires<IBodyOrientationInfo>
|
||||
@@ -12,7 +12,7 @@ using System.Collections.Generic;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
public class Corpse : IEffect
|
||||
{
|
||||
@@ -12,9 +12,9 @@ using System.Collections.Generic;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
class CrateEffect : IEffect
|
||||
public class CrateEffect : IEffect
|
||||
{
|
||||
readonly string palette;
|
||||
readonly Actor a;
|
||||
@@ -14,7 +14,7 @@ using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
public class GravityBombInfo : IProjectileInfo
|
||||
{
|
||||
@@ -13,10 +13,11 @@ using System.Drawing;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
[Desc("Not a sprite, but an engine effect.")]
|
||||
class LaserZapInfo : IProjectileInfo
|
||||
10
OpenRA.Mods.RA/Effects/Missile.cs → OpenRA.Mods.Common/Effects/Missile.cs
Executable file → Normal file
10
OpenRA.Mods.RA/Effects/Missile.cs → OpenRA.Mods.Common/Effects/Missile.cs
Executable file → Normal file
@@ -14,11 +14,11 @@ using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
class MissileInfo : IProjectileInfo
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
if (info.Inaccuracy.Range > 0)
|
||||
{
|
||||
var inaccuracy = Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, args.InaccuracyModifiers);
|
||||
var inaccuracy = OpenRA.Traits.Util.ApplyPercentageModifiers(info.Inaccuracy.Range, args.InaccuracyModifiers);
|
||||
offset = WVec.FromPDF(world.SharedRandom, 2) * inaccuracy / 1024;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
targetPosition = args.GuidedTarget.CenterPosition;
|
||||
|
||||
var dist = targetPosition + offset - pos;
|
||||
var desiredFacing = Traits.Util.GetFacing(dist, facing);
|
||||
var desiredFacing = OpenRA.Traits.Util.GetFacing(dist, facing);
|
||||
var desiredAltitude = targetPosition.Z;
|
||||
var jammed = info.Jammable && world.ActorsWithTrait<JamsMissiles>().Any(JammedBy);
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
else if (!args.GuidedTarget.IsValidFor(args.SourceActor))
|
||||
desiredFacing = facing;
|
||||
|
||||
facing = Traits.Util.TickFacing(facing, desiredFacing, info.ROT);
|
||||
facing = OpenRA.Traits.Util.TickFacing(facing, desiredFacing, info.ROT);
|
||||
var move = new WVec(0, -1024, 0).Rotate(WRot.FromFacing(facing)) * info.Speed.Range / 1024;
|
||||
if (targetPosition.Z > 0 && info.TurboBoost)
|
||||
move = (move * 3) / 2;
|
||||
@@ -13,12 +13,12 @@ using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Graphics;
|
||||
|
||||
namespace OpenRA.Mods.RA.Effects
|
||||
namespace OpenRA.Mods.Common.Effects
|
||||
{
|
||||
class RallyPoint : IEffect
|
||||
{
|
||||
readonly Actor building;
|
||||
readonly RA.RallyPoint rp;
|
||||
readonly Common.RallyPoint rp;
|
||||
readonly string palettePrefix;
|
||||
readonly Animation flag;
|
||||
readonly Animation circles;
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
this.building = building;
|
||||
this.palettePrefix = palettePrefix;
|
||||
|
||||
rp = building.Trait<RA.RallyPoint>();
|
||||
rp = building.Trait<Common.RallyPoint>();
|
||||
|
||||
flag = new Animation(building.World, "rallypoint");
|
||||
circles = new Animation(building.World, "rallypoint");
|
||||
@@ -42,9 +42,18 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CommonTraitsInterfaces.cs" />
|
||||
<Compile Include="Effects\Beacon.cs" />
|
||||
<Compile Include="Effects\Bullet.cs" />
|
||||
<Compile Include="Effects\Contrail.cs" />
|
||||
<Compile Include="Effects\ContrailFader.cs" />
|
||||
<Compile Include="Effects\Corpse.cs" />
|
||||
<Compile Include="Effects\CrateEffect.cs" />
|
||||
<Compile Include="Effects\Explosion.cs" />
|
||||
<Compile Include="Effects\FloatingText.cs" />
|
||||
<Compile Include="Effects\GravityBomb.cs" />
|
||||
<Compile Include="Effects\LaserZap.cs" />
|
||||
<Compile Include="Effects\Missile.cs" />
|
||||
<Compile Include="Effects\RallyPoint.cs" />
|
||||
<Compile Include="Effects\Smoke.cs" />
|
||||
<Compile Include="Console\ChatCommands.cs" />
|
||||
<Compile Include="Console\DevCommands.cs" />
|
||||
@@ -60,9 +69,11 @@
|
||||
<Compile Include="Graphics\VoxelRenderable.cs" />
|
||||
<Compile Include="ModChooserLoadScreen.cs" />
|
||||
<Compile Include="PaletteFromFile.cs" />
|
||||
<Compile Include="RallyPoint.cs" />
|
||||
<Compile Include="ServerTraits\ColorValidator.cs" />
|
||||
<Compile Include="ServerTraits\MasterServerPinger.cs" />
|
||||
<Compile Include="ServerTraits\PlayerPinger.cs" />
|
||||
<Compile Include="Traits\JamsMissiles.cs" />
|
||||
<Compile Include="Traits\ProvidesRadar.cs" />
|
||||
<Compile Include="UtilityCommands\ConvertPngToShpCommand.cs" />
|
||||
<Compile Include="UtilityCommands\ConvertSpriteToPngCommand.cs" />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
namespace OpenRA.Mods.Common
|
||||
{
|
||||
[Desc("Used to waypoint units after production or repair is finished.")]
|
||||
public class RallyPointInfo : ITraitInfo
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
class JamsMissilesInfo : ITraitInfo
|
||||
public class JamsMissilesInfo : ITraitInfo
|
||||
{
|
||||
public readonly int Range = 0;
|
||||
public readonly bool AlliedMissiles = true;
|
||||
@@ -11,6 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Mods.Common;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Air
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.GameRules;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -120,10 +120,15 @@
|
||||
<Compile Include="Air\AttackPlane.cs" />
|
||||
<Compile Include="AI\SupportPowerDecision.cs" />
|
||||
<Compile Include="Crates\DuplicateUnitCrateAction.cs" />
|
||||
<Compile Include="Effects\GpsSatellite.cs" />
|
||||
<Compile Include="Effects\Rank.cs" />
|
||||
<Compile Include="Effects\SatelliteLaunch.cs" />
|
||||
<Compile Include="Effects\TeslaZap.cs" />
|
||||
<Compile Include="TeslaZapRenderable.cs" />
|
||||
<Compile Include="GainsExperience.cs" />
|
||||
<Compile Include="Infiltration\InfiltrateForPowerOutage.cs" />
|
||||
<Compile Include="Power\AffectedByPowerOutage.cs" />
|
||||
<Compile Include="Power\Power.cs" />
|
||||
<Compile Include="Effects\Beacon.cs" />
|
||||
<Compile Include="Player\PlaceBeacon.cs" />
|
||||
<Compile Include="MenuPaletteEffect.cs" />
|
||||
<Compile Include="EjectOnDeath.cs" />
|
||||
@@ -210,28 +215,16 @@
|
||||
<Compile Include="DeathSounds.cs" />
|
||||
<Compile Include="DemoTruck.cs" />
|
||||
<Compile Include="DetectCloaked.cs" />
|
||||
<Compile Include="Effects\Bullet.cs" />
|
||||
<Compile Include="Effects\Contrail.cs" />
|
||||
<Compile Include="Effects\Corpse.cs" />
|
||||
<Compile Include="Effects\CrateEffect.cs" />
|
||||
<Compile Include="Effects\GpsDot.cs" />
|
||||
<Compile Include="Effects\GpsSatellite.cs" />
|
||||
<Compile Include="Effects\GravityBomb.cs" />
|
||||
<Compile Include="Effects\LaserZap.cs" />
|
||||
<Compile Include="Effects\Missile.cs" />
|
||||
<Compile Include="Effects\NukeLaunch.cs" />
|
||||
<Compile Include="Effects\Parachute.cs" />
|
||||
<Compile Include="Effects\PowerdownIndicator.cs" />
|
||||
<Compile Include="Effects\RallyPoint.cs" />
|
||||
<Compile Include="Effects\RepairIndicator.cs" />
|
||||
<Compile Include="Effects\SatelliteLaunch.cs" />
|
||||
<Compile Include="Effects\TeslaZap.cs" />
|
||||
<Compile Include="EmitInfantryOnSell.cs" />
|
||||
<Compile Include="EngineerRepair.cs" />
|
||||
<Compile Include="Explodes.cs" />
|
||||
<Compile Include="Fake.cs" />
|
||||
<Compile Include="FreeActor.cs" />
|
||||
<Compile Include="GainsExperience.cs" />
|
||||
<Compile Include="GivesBounty.cs" />
|
||||
<Compile Include="GivesExperience.cs" />
|
||||
<Compile Include="Guard.cs" />
|
||||
@@ -240,7 +233,6 @@
|
||||
<Compile Include="Husk.cs" />
|
||||
<Compile Include="Infiltration\InfiltrateForSupportPower.cs" />
|
||||
<Compile Include="Invulnerable.cs" />
|
||||
<Compile Include="JamsMissiles.cs" />
|
||||
<Compile Include="LeavesHusk.cs" />
|
||||
<Compile Include="Captures.cs" />
|
||||
<Compile Include="LightPaletteRotator.cs" />
|
||||
@@ -298,7 +290,6 @@
|
||||
<Compile Include="ProximityCapturable.cs" />
|
||||
<Compile Include="DefaultLoadScreen.cs" />
|
||||
<Compile Include="RadarColorFromTerrain.cs" />
|
||||
<Compile Include="RallyPoint.cs" />
|
||||
<Compile Include="Reloads.cs" />
|
||||
<Compile Include="RenderDetectionCircle.cs" />
|
||||
<Compile Include="RenderJammerCircle.cs" />
|
||||
@@ -426,7 +417,6 @@
|
||||
<Compile Include="World\DomainIndex.cs" />
|
||||
<Compile Include="MPStartUnits.cs" />
|
||||
<Compile Include="Widgets\Logic\WorldTooltipLogic.cs" />
|
||||
<Compile Include="TeslaZapRenderable.cs" />
|
||||
<Compile Include="Buildings\Bib.cs" />
|
||||
<Compile Include="Orders\EnterAlliedActorTargeter.cs" />
|
||||
<Compile Include="Render\WithIdleOverlay.cs" />
|
||||
@@ -441,7 +431,6 @@
|
||||
<Compile Include="World\PathfinderDebugOverlay.cs" />
|
||||
<Compile Include="Widgets\Logic\SettingsLogic.cs" />
|
||||
<Compile Include="AttackBomber.cs" />
|
||||
<Compile Include="Effects\Rank.cs" />
|
||||
<Compile Include="ShroudRenderer.cs" />
|
||||
<Compile Include="Render\WithCrateBody.cs" />
|
||||
<Compile Include="Buildings\Demolishable.cs" />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using OpenRA.Mods.Common;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Mods.RA.Render;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Render
|
||||
|
||||
@@ -15,6 +15,7 @@ using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Mods.RA.Orders;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Mods.Common;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Mods.RA.Render;
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.Common.Effects;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Effects;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user