From 42bd51f2b0adccb0dce294f6e5acae5160f3ffa2 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 13 Dec 2009 12:26:49 +1300 Subject: [PATCH] moved weapon report from bullet/missile to attackbase --- OpenRa.Game/Actor.cs | 2 +- OpenRa.Game/Effects/Bullet.cs | 4 ---- OpenRa.Game/Effects/Missile.cs | 3 --- OpenRa.Game/Traits/AttackBase.cs | 3 +++ rules.ini | 2 -- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index da9204fe25..397c02f422 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -25,7 +25,7 @@ namespace OpenRa.Game ActorID = Game.world.NextAID(); Info = (UnitInfo)info; // temporary Location = location; - CenterLocation = new float2( 12, 12 ) + Game.CellSize * (float2)Location; + CenterLocation = Traits.Util.CenterOfCell(Location); Owner = owner; Health = Info.Strength; /* todo: handle cases where this is not true! */ diff --git a/OpenRa.Game/Effects/Bullet.cs b/OpenRa.Game/Effects/Bullet.cs index fab47ac7ac..a33e549980 100644 --- a/OpenRa.Game/Effects/Bullet.cs +++ b/OpenRa.Game/Effects/Bullet.cs @@ -50,10 +50,6 @@ namespace OpenRa.Game.Effects public void Tick() { - if (t == 0) - if (!string.IsNullOrEmpty(Weapon.Report)) - Sound.Play(Weapon.Report + ".aud"); - t += 40; if (t > TotalTime()) /* remove finished bullets */ diff --git a/OpenRa.Game/Effects/Missile.cs b/OpenRa.Game/Effects/Missile.cs index c4a69710bc..d34a86954d 100644 --- a/OpenRa.Game/Effects/Missile.cs +++ b/OpenRa.Game/Effects/Missile.cs @@ -50,9 +50,6 @@ namespace OpenRa.Game.Effects public void Tick() { - if (t == 0) - Sound.Play(Weapon.Report + ".aud"); - t += 40; Traits.Util.TickFacing(ref Facing, diff --git a/OpenRa.Game/Traits/AttackBase.cs b/OpenRa.Game/Traits/AttackBase.cs index a90214711f..4524a0dae9 100644 --- a/OpenRa.Game/Traits/AttackBase.cs +++ b/OpenRa.Game/Traits/AttackBase.cs @@ -94,6 +94,9 @@ namespace OpenRa.Game.Traits Game.world.Add(new Bullet(weaponName, self.Owner, self, firePos, target.CenterLocation.ToInt2())); + if (!string.IsNullOrEmpty(weapon.Report)) + Sound.Play(weapon.Report + ".aud"); + foreach (var na in self.traits.WithInterface()) na.Attacking(self); diff --git a/rules.ini b/rules.ini index c14b33dddf..217658ca75 100644 --- a/rules.ini +++ b/rules.ini @@ -713,7 +713,6 @@ Cost=950 Points=45 ROT=7 Cloakable=yes -Passengers=10 ; cjf hax ; destroyer [DD] @@ -782,7 +781,6 @@ Sensors=Yes Prerequisite=kenn Primary=DogJaw Strength=12 -;Strength=5 Armor=none TechLevel=3 Sight=5