From e234816c1381a02bf63913ddc711bf25528099a6 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 1 Feb 2011 17:11:17 +1300 Subject: [PATCH] Extract parameters into Info for mods to tweak. --- OpenRA.Mods.Cnc/AttackPopupTurreted.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Cnc/AttackPopupTurreted.cs b/OpenRA.Mods.Cnc/AttackPopupTurreted.cs index 835d2d7610..2651cdfdcb 100644 --- a/OpenRA.Mods.Cnc/AttackPopupTurreted.cs +++ b/OpenRA.Mods.Cnc/AttackPopupTurreted.cs @@ -24,6 +24,8 @@ namespace OpenRA.Mods.Cnc class AttackPopupTurretedInfo : AttackBaseInfo { public int CloseDelay = 125; + public int DefaultFacing = 0; + public float ClosedDamageMultiplier = 0.5f; public override object Create(ActorInitializer init) { return new AttackPopupTurreted( init.self, this ); } } @@ -90,10 +92,10 @@ namespace OpenRA.Mods.Cnc { if (State == PopupState.Open && IdleTicks++ > Info.CloseDelay) { - Turret.desiredFacing = 0; + Turret.desiredFacing = Info.DefaultFacing; State = PopupState.Rotating; } - else if (State == PopupState.Rotating && Turret.turretFacing == 0) + else if (State == PopupState.Rotating && Turret.turretFacing == Info.DefaultFacing) { State = PopupState.Transitioning; var rb = self.Trait(); @@ -124,7 +126,7 @@ namespace OpenRA.Mods.Cnc public float GetDamageModifier(Actor attacker, WarheadInfo warhead) { - return State == PopupState.Closed ? 0.5f : 1; + return State == PopupState.Closed ? Info.ClosedDamageMultiplier : 1f; } class AttackActivity : CancelableActivity