removed ProjectileInfo; WeaponValidForTarget is borked as a result, but nothing else
This commit is contained in:
@@ -97,7 +97,9 @@ namespace OpenRA
|
|||||||
|
|
||||||
public static bool WeaponValidForTarget(WeaponInfo weapon, Actor target)
|
public static bool WeaponValidForTarget(WeaponInfo weapon, Actor target)
|
||||||
{
|
{
|
||||||
var projectile = Rules.ProjectileInfo[weapon.Projectile];
|
return true; // massive hack, and very wrong.
|
||||||
|
|
||||||
|
/*var projectile = Rules.ProjectileInfo[weapon.Projectile];
|
||||||
var warhead = Rules.WarheadInfo[weapon.Warhead];
|
var warhead = Rules.WarheadInfo[weapon.Warhead];
|
||||||
var unit = target.traits.GetOrDefault<Unit>();
|
var unit = target.traits.GetOrDefault<Unit>();
|
||||||
|
|
||||||
@@ -113,7 +115,7 @@ namespace OpenRA
|
|||||||
if (projectile.UnderWater && !target.Info.Traits.Get<OwnedActorInfo>().WaterBound)
|
if (projectile.UnderWater && !target.Info.Traits.Get<OwnedActorInfo>().WaterBound)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return projectile.AG;
|
return projectile.AG;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool HasAnyValidWeapons(Actor self, Actor target)
|
public static bool HasAnyValidWeapons(Actor self, Actor target)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ namespace OpenRA.Effects
|
|||||||
|
|
||||||
class NukeLaunch : IEffect
|
class NukeLaunch : IEffect
|
||||||
{
|
{
|
||||||
readonly ProjectileInfo projectileUp, projectileDown;
|
|
||||||
readonly Actor silo;
|
readonly Actor silo;
|
||||||
Animation anim;
|
Animation anim;
|
||||||
float2 pos;
|
float2 pos;
|
||||||
@@ -48,11 +47,8 @@ namespace OpenRA.Effects
|
|||||||
this.silo = silo;
|
this.silo = silo;
|
||||||
this.targetLocation = targetLocation;
|
this.targetLocation = targetLocation;
|
||||||
this.weapon = Rules.WeaponInfo[weapon];
|
this.weapon = Rules.WeaponInfo[weapon];
|
||||||
projectileUp = Rules.ProjectileInfo["NukeUp"];
|
anim = new Animation("nuke");
|
||||||
projectileDown = Rules.ProjectileInfo["NukeDown"];
|
anim.PlayRepeating("up");
|
||||||
|
|
||||||
anim = new Animation(projectileUp.Image);
|
|
||||||
anim.PlayRepeating("idle");
|
|
||||||
pos = silo.CenterLocation;
|
pos = silo.CenterLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,8 +62,8 @@ namespace OpenRA.Effects
|
|||||||
if (altitude >= targetAltitude)
|
if (altitude >= targetAltitude)
|
||||||
{
|
{
|
||||||
pos = OpenRA.Traits.Util.CenterOfCell(targetLocation);
|
pos = OpenRA.Traits.Util.CenterOfCell(targetLocation);
|
||||||
anim = new Animation(projectileDown.Image);
|
anim = new Animation("nuke");
|
||||||
anim.PlayRepeating("idle");
|
anim.PlayRepeating("down");
|
||||||
goingUp = false;
|
goingUp = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +78,7 @@ namespace OpenRA.Effects
|
|||||||
void Explode(World world)
|
void Explode(World world)
|
||||||
{
|
{
|
||||||
world.AddFrameEndTask(w => w.Remove(this));
|
world.AddFrameEndTask(w => w.Remove(this));
|
||||||
var warhead = Rules.WarheadInfo[weapon.Warhead];
|
//var warhead = Rules.WarheadInfo[weapon.Warhead];
|
||||||
//Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, Rules.ProjectileInfo[weapon.Projectile], warhead, silo, true);
|
//Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, Rules.ProjectileInfo[weapon.Projectile], warhead, silo, true);
|
||||||
world.WorldActor.traits.Get<ScreenShaker>().AddEffect(20, pos, 5);
|
world.WorldActor.traits.Get<ScreenShaker>().AddEffect(20, pos, 5);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
#region Copyright & License Information
|
|
||||||
/*
|
|
||||||
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
|
|
||||||
* This file is part of OpenRA.
|
|
||||||
*
|
|
||||||
* OpenRA is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* OpenRA is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with OpenRA. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
namespace OpenRA.GameRules
|
|
||||||
{
|
|
||||||
public class ProjectileInfo
|
|
||||||
{
|
|
||||||
public readonly bool AA = false;
|
|
||||||
public readonly bool AG = true;
|
|
||||||
public readonly bool ASW = false;
|
|
||||||
public readonly bool Arcing = false;
|
|
||||||
public readonly int Arm = 0;
|
|
||||||
public readonly bool Degenerates = false;
|
|
||||||
public readonly bool High = false;
|
|
||||||
public readonly string Image = null;
|
|
||||||
public readonly bool Inaccurate = false;
|
|
||||||
public readonly bool Parachuted = false;
|
|
||||||
public readonly bool Proximity = false;
|
|
||||||
public readonly int ROT = 0;
|
|
||||||
public readonly bool Shadow = true;
|
|
||||||
public readonly bool UnderWater = false;
|
|
||||||
public readonly int RangeLimit = 0;
|
|
||||||
|
|
||||||
// OpenRA-specific:
|
|
||||||
public readonly string Trail = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,6 @@ namespace OpenRA
|
|||||||
public static Dictionary<string, List<string>> Categories = new Dictionary<string, List<string>>();
|
public static Dictionary<string, List<string>> Categories = new Dictionary<string, List<string>>();
|
||||||
public static InfoLoader<WeaponInfo> WeaponInfo;
|
public static InfoLoader<WeaponInfo> WeaponInfo;
|
||||||
public static InfoLoader<WarheadInfo> WarheadInfo;
|
public static InfoLoader<WarheadInfo> WarheadInfo;
|
||||||
public static InfoLoader<ProjectileInfo> ProjectileInfo;
|
|
||||||
public static InfoLoader<VoiceInfo> VoiceInfo;
|
public static InfoLoader<VoiceInfo> VoiceInfo;
|
||||||
public static TechTree TechTree;
|
public static TechTree TechTree;
|
||||||
|
|
||||||
@@ -55,8 +54,6 @@ namespace OpenRA
|
|||||||
Pair.New<string, Func<string, WeaponInfo>>("Weapon", _ => new WeaponInfo()));
|
Pair.New<string, Func<string, WeaponInfo>>("Weapon", _ => new WeaponInfo()));
|
||||||
WarheadInfo = new InfoLoader<WarheadInfo>(
|
WarheadInfo = new InfoLoader<WarheadInfo>(
|
||||||
Pair.New<string, Func<string, WarheadInfo>>("Warhead", _ => new WarheadInfo()));
|
Pair.New<string, Func<string, WarheadInfo>>("Warhead", _ => new WarheadInfo()));
|
||||||
ProjectileInfo = new InfoLoader<ProjectileInfo>(
|
|
||||||
Pair.New<string, Func<string, ProjectileInfo>>("Projectile", _ => new ProjectileInfo()));
|
|
||||||
VoiceInfo = new InfoLoader<VoiceInfo>(
|
VoiceInfo = new InfoLoader<VoiceInfo>(
|
||||||
Pair.New<string, Func<string, VoiceInfo>>("Voice", _ => new VoiceInfo()));
|
Pair.New<string, Func<string, VoiceInfo>>("Voice", _ => new VoiceInfo()));
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,6 @@
|
|||||||
<Compile Include="Effects\Explosion.cs" />
|
<Compile Include="Effects\Explosion.cs" />
|
||||||
<Compile Include="GameRules\Footprint.cs" />
|
<Compile Include="GameRules\Footprint.cs" />
|
||||||
<Compile Include="GameRules\InfoLoader.cs" />
|
<Compile Include="GameRules\InfoLoader.cs" />
|
||||||
<Compile Include="GameRules\ProjectileInfo.cs" />
|
|
||||||
<Compile Include="GameRules\Rules.cs" />
|
<Compile Include="GameRules\Rules.cs" />
|
||||||
<Compile Include="GameRules\WarheadInfo.cs" />
|
<Compile Include="GameRules\WarheadInfo.cs" />
|
||||||
<Compile Include="GameRules\WeaponInfo.cs" />
|
<Compile Include="GameRules\WeaponInfo.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user