public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { --charges; timeToRecharge = info.ReloadTime; }
// gets the screen-space position of a barrel. public static PVecInt GetBarrelPosition(Actor self, IFacing facing, Turret turret, Barrel barrel) { var turreted = self.TraitOrDefault<Turreted>(); if (turreted == null && facing == null) return PVecInt.Zero; var turretFacing = turreted != null ? turreted.turretFacing : facing.Facing; return GetTurretPosition(self, facing, turret) + barrel.ScreenSpaceOffset + (PVecInt)(PVecFloat)Util.RotateVectorByFacing(barrel.TurretSpaceOffset.ToFloat2(), turretFacing, .7f); }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { Uncloak(); }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { --charges; timeToRecharge = self.Info.Traits.Get <AttackTeslaInfo>().ReloadTime; }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { TakeAmmo(); }
/* lose our disguise if we attack anything */ public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { DropDisguise(); }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { DisguiseAs(self, null); }
// gets the screen-space position of a barrel. public static PVecInt GetBarrelPosition(Actor self, IFacing facing, Turret turret, Barrel barrel) { return GetTurretPosition(self, facing, turret) + barrel.ScreenSpaceOffset + GetUnitspaceBarrelOffset(self, facing, turret, barrel); }
static PVecInt GetUnitspaceBarrelOffset(Actor self, IFacing facing, Turret turret, Barrel barrel) { var turreted = self.TraitOrDefault<Turreted>(); if (turreted == null && facing == null) return PVecInt.Zero; var turretFacing = turreted != null ? turreted.turretFacing : facing.Facing; return (PVecInt)(PVecFloat)Util.RotateVectorByFacing(barrel.TurretSpaceOffset.ToFloat2(), turretFacing, .7f); }
// gets the screen-space position of a barrel. public static float2 GetBarrelPosition(Actor self, IFacing facing, Turret turret, Barrel barrel) { var turreted = self.TraitOrDefault <Turreted>(); if (turreted == null && facing == null) { return(float2.Zero); } var turretFacing = turreted != null ? turreted.turretFacing : facing.Facing; return(GetTurretPosition(self, facing, turret) + barrel.ScreenSpaceOffset + Util.RotateVectorByFacing(barrel.TurretSpaceOffset, turretFacing, .7f)); }
// gets the screen-space position of a barrel. public static PVecInt GetBarrelPosition(Actor self, IFacing facing, Turret turret, Barrel barrel) { return(GetTurretPosition(self, facing, turret) + barrel.ScreenSpaceOffset + GetUnitspaceBarrelOffset(self, facing, turret, barrel)); }
static PVecInt GetUnitspaceBarrelOffset(Actor self, IFacing facing, Turret turret, Barrel barrel) { var turreted = self.TraitOrDefault <Turreted>(); if (turreted == null && facing == null) { return(PVecInt.Zero); } var turretFacing = turreted != null ? turreted.turretFacing : facing.Facing; return((PVecInt)(PVecFloat)Util.RotateVectorByFacing(barrel.TurretSpaceOffset.ToFloat2(), turretFacing, .7f)); }
// gets the screen-space position of a barrel. public static float2 GetBarrelPosition(Actor self, IFacing facing, Turret turret, Barrel barrel) { var turreted = self.TraitOrDefault<Turreted>(); if (turreted == null && facing == null) return float2.Zero; var turretFacing = turreted != null ? turreted.turretFacing : facing.Facing; return Util.RotateVectorByFacing(barrel.Position, turretFacing, .7f); }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { if (Info.UncloakOnAttack) Uncloak(); }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { if (self.World.SharedRandom.Next(100 / Info.AttackPanicChance) == 0) Panic(); }
public void Attacking(Actor self, Target target, Armament a, Barrel barrel) { --charges; timeToRecharge = self.Info.Traits.Get<AttackTeslaInfo>().ReloadTime; }