hack hack hack... working dog
This commit is contained in:
@@ -23,8 +23,19 @@ namespace OpenRA.Traits.Activities
|
|||||||
class Leap : IActivity
|
class Leap : IActivity
|
||||||
{
|
{
|
||||||
Actor target;
|
Actor target;
|
||||||
|
float2 initialLocation;
|
||||||
|
float t;
|
||||||
|
|
||||||
public Leap(Actor target) { this.target = target; }
|
const int delay = 6;
|
||||||
|
|
||||||
|
public Leap(Actor self, Actor target)
|
||||||
|
{
|
||||||
|
this.target = target;
|
||||||
|
initialLocation = self.CenterLocation;
|
||||||
|
|
||||||
|
self.traits.Get<RenderInfantry>().Attacking(self);
|
||||||
|
Sound.Play("dogg5p.aud");
|
||||||
|
}
|
||||||
|
|
||||||
public IActivity NextActivity { get; set; }
|
public IActivity NextActivity { get; set; }
|
||||||
|
|
||||||
@@ -33,6 +44,17 @@ namespace OpenRA.Traits.Activities
|
|||||||
if (target == null || !target.IsInWorld)
|
if (target == null || !target.IsInWorld)
|
||||||
return NextActivity;
|
return NextActivity;
|
||||||
|
|
||||||
|
t += (1f / delay);
|
||||||
|
|
||||||
|
self.CenterLocation = float2.Lerp(initialLocation, target.CenterLocation, t);
|
||||||
|
|
||||||
|
if (t >= 1f)
|
||||||
|
{
|
||||||
|
self.traits.Get<Mobile>().TeleportTo(self, target.Location);
|
||||||
|
target.InflictDamage(self, target.Health, null); // kill it
|
||||||
|
return NextActivity;
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,12 +187,15 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
ScheduleDelayedAction( FireDelay( self, self.Info.Traits.Get<AttackBaseInfo>() ), () =>
|
ScheduleDelayedAction( FireDelay( self, self.Info.Traits.Get<AttackBaseInfo>() ), () =>
|
||||||
{
|
{
|
||||||
var projectile = args.weapon.Projectile.Create(args);
|
if (args.weapon.Projectile != null)
|
||||||
if (projectile != null)
|
{
|
||||||
self.World.Add(projectile);
|
var projectile = args.weapon.Projectile.Create(args);
|
||||||
|
if (projectile != null)
|
||||||
|
self.World.Add(projectile);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(args.weapon.Report))
|
if (!string.IsNullOrEmpty(args.weapon.Report))
|
||||||
Sound.Play(args.weapon.Report + ".aud");
|
Sound.Play(args.weapon.Report + ".aud");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (var na in self.traits.WithInterface<INotifyAttack>())
|
foreach (var na in self.traits.WithInterface<INotifyAttack>())
|
||||||
|
|||||||
@@ -37,12 +37,13 @@ namespace OpenRA.Traits
|
|||||||
base.Tick(self);
|
base.Tick(self);
|
||||||
|
|
||||||
if (target == null || !target.IsInWorld) return;
|
if (target == null || !target.IsInWorld) return;
|
||||||
|
if (self.GetCurrentActivity() is Leap) return;
|
||||||
|
|
||||||
var weapon = self.GetPrimaryWeapon();
|
var weapon = self.GetPrimaryWeapon();
|
||||||
if (weapon.Range * weapon.Range < (target.Location - self.Location).LengthSquared) return;
|
if (weapon.Range * weapon.Range < (target.Location - self.Location).LengthSquared) return;
|
||||||
|
|
||||||
self.CancelActivity();
|
self.CancelActivity();
|
||||||
self.QueueActivity(new Leap(target));
|
self.QueueActivity(new Leap(self, target));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ DOG:
|
|||||||
Speed: 4
|
Speed: 4
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
AttackLeap:
|
AttackLeap:
|
||||||
|
PrimaryWeapon: DogJaw
|
||||||
|
|
||||||
E1:
|
E1:
|
||||||
Inherits: ^Infantry
|
Inherits: ^Infantry
|
||||||
|
|||||||
@@ -639,7 +639,7 @@
|
|||||||
<sequence name="die4" start="242" length="9" />
|
<sequence name="die4" start="242" length="9" />
|
||||||
<sequence name="die5" start="251" length="14" />
|
<sequence name="die5" start="251" length="14" />
|
||||||
<sequence name="die6" start="0" length="17" src="electdog" />
|
<sequence name="die6" start="0" length="17" src="electdog" />
|
||||||
<sequence name="attack" start="0" length="4" facings="8" src="dogbullt" />
|
<sequence name="shoot" start="0" length="4" facings="8" src="dogbullt" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="missile">
|
<unit name="missile">
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
|
|||||||
@@ -849,11 +849,11 @@ BRIK:
|
|||||||
Description: Concrete Wall
|
Description: Concrete Wall
|
||||||
LongDesc: Stop units and blocks enemy fire.
|
LongDesc: Stop units and blocks enemy fire.
|
||||||
BuildPaletteOrder: 100
|
BuildPaletteOrder: 100
|
||||||
DamagedSound: crmble2.aud
|
|
||||||
DestroyedSound: kaboom30.aud
|
|
||||||
Building:
|
Building:
|
||||||
HP: 100
|
HP: 100
|
||||||
Armor: none
|
Armor: none
|
||||||
|
DamagedSound: crmble2.aud
|
||||||
|
DestroyedSound: kaboom30.aud
|
||||||
RenderBuildingWall:
|
RenderBuildingWall:
|
||||||
DamageStates: 4
|
DamageStates: 4
|
||||||
|
|
||||||
|
|||||||
@@ -581,13 +581,8 @@ ParaBomb:
|
|||||||
|
|
||||||
DogJaw:
|
DogJaw:
|
||||||
ROF: 10
|
ROF: 10
|
||||||
Range: 2.2
|
Range: 5
|
||||||
Report: DOGG5P
|
Report: DOGG5P
|
||||||
Missile:
|
|
||||||
Image: DOGBULLT
|
|
||||||
Proximity: yes
|
|
||||||
ROT: 20
|
|
||||||
Speed: 20
|
|
||||||
Warhead:
|
Warhead:
|
||||||
Spread: 5
|
Spread: 5
|
||||||
Verses: 100%,0%,0%,0%,0%
|
Verses: 100%,0%,0%,0%,0%
|
||||||
|
|||||||
@@ -2,3 +2,5 @@
|
|||||||
NetworkHost=localhost
|
NetworkHost=localhost
|
||||||
NetworkPort=1234
|
NetworkPort=1234
|
||||||
InitialMods=ra
|
InitialMods=ra
|
||||||
|
Width=1024
|
||||||
|
Height=768
|
||||||
Reference in New Issue
Block a user