/// <summary> /// Returns the distance per second for a running animation /// </summary> public static float GetRunSpeed(uint motionTableID) { if (RunSpeed.TryGetValue(motionTableID, out float runSpeed)) { return(runSpeed); } uint runMotion = (uint)MotionCommand.RunForward; var motionData = GetMotionData(motionTableID, runMotion); if (motionData == null) { return(0.0f); } var speed = GetAnimDist(motionData); RunSpeed[motionTableID] = speed; return(speed); }
public ActorProperties(ActorProperties other) { Accuracy = other.Accuracy; Activation = other.Activation; ActiveSound = other.ActiveSound.Copy(); Alpha = other.Alpha; AmmoBackpackAmount = other.AmmoBackpackAmount; AmmoBackpackMaxAmount = other.AmmoBackpackMaxAmount; AmmoDropAmount = other.AmmoDropAmount; ArmorMaxAbsorb = other.ArmorMaxAbsorb; ArmorMaxBonus = other.ArmorMaxBonus; ArmorMaxBonusMax = other.ArmorMaxBonusMax; ArmorMaxSaveAmount = other.ArmorMaxSaveAmount; ArmorMaxFullAbsorb = other.ArmorMaxFullAbsorb; ArmorSaveAmount = other.ArmorSaveAmount; ArmorSavePercent = other.ArmorSavePercent; Args = new SpecialArgs(other.Args); AttackSound = other.AttackSound.Copy(); BloodColor = other.BloodColor; BloodType = new List <UpperString>(other.BloodType); BounceCount = other.BounceCount; BounceFactor = other.BounceFactor; BounceSound = other.BounceSound.Copy(); BounceType = other.BounceType; BurnHeight = other.BurnHeight; CameraHeight = other.CameraHeight; ConversationID = other.ConversationID; CrushPainSound = other.CrushPainSound.Copy(); Damage = other.Damage; DamageFactor = new DamageFactor(other.DamageFactor); DamageType = other.DamageType.Copy(); DeathHeight = other.DeathHeight; DeathSound = other.DeathSound.Copy(); DeathType = other.DeathType.Copy(); Decal = other.Decal.Copy(); DefThreshold = other.DefThreshold; DesignatedTeam = other.DesignatedTeam; DistanceCheck = other.DistanceCheck.Copy(); DropItem = other.DropItem.Select(val => new DropItem(val)).ToList(); ExplosionDamage = other.ExplosionDamage; ExplosionRadius = other.ExplosionRadius; FakeInventoryRespawns = other.FakeInventoryRespawns; FastSpeed = other.FastSpeed; FloatBobPhase = other.FloatBobPhase; FloatBobStrength = other.FloatBobStrength; FloatSpeed = other.FloatSpeed; Friction = other.Friction; FriendlySeeBlocks = other.FriendlySeeBlocks; Game = new List <UpperString>(Game); GibHealth = other.GibHealth; Gravity = other.Gravity; Health = other.Health; HealthLowMessage = new HealthLowMessage(other.HealthLowMessage); HealthPickupAutoUse = other.HealthPickupAutoUse; Height = other.Height; HitObituary = other.HitObituary.Copy(); HowlSound = other.HowlSound.Copy(); InventoryAltHUDIcon = other.InventoryAltHUDIcon.Copy(); InventoryAmount = other.InventoryAmount; InventoryDefMaxAmount = other.InventoryDefMaxAmount; InventoryForbiddenTo = new List <UpperString>(other.InventoryForbiddenTo); InventoryGiveQuest = other.InventoryGiveQuest; InventoryIcon = other.InventoryIcon.Copy(); InventoryInterHubAmount = other.InventoryInterHubAmount; InventoryMaxAmount = other.InventoryMaxAmount; InventoryPickupFlash = other.InventoryPickupFlash.Copy(); InventoryPickupMessage = other.InventoryPickupMessage.Copy(); InventoryPickupSound = other.InventoryPickupSound.Copy(); InventoryRespawnTics = other.InventoryRespawnTics; InventoryRestrictedTo = new List <UpperString>(other.InventoryRestrictedTo); InventoryUseSound = other.InventoryUseSound.Copy(); Mass = other.Mass; MaxStepHeight = other.MaxStepHeight; MaxDropOffHeight = other.MaxDropOffHeight; MaxTargetRange = other.MaxTargetRange; MeleeDamage = other.MeleeDamage; MeleeRange = other.MeleeRange; MeleeSound = other.MeleeSound.Copy(); MeleeThreshold = other.MeleeThreshold; MinMissileChance = other.MinMissileChance; MissileHeight = other.MissileHeight; MissileType = other.MissileType.Copy(); MorphProjectileDuration = other.MorphProjectileDuration; MorphProjectileMonsterClass = other.MorphProjectileMonsterClass.Copy(); MorphProjectileMorphFlash = other.MorphProjectileMorphFlash.Copy(); MorphProjectileMorphStyle = other.MorphProjectileMorphStyle; MorphProjectilePlayerClass = other.MorphProjectilePlayerClass.Copy(); MorphProjectileUnMorphFlash = other.MorphProjectileUnMorphFlash.Copy(); Obituary = other.Obituary.Copy(); PainChance = new PainChance(other.PainChance); PainSound = other.PainSound.Copy(); PainThreshold = other.PainThreshold; PainType = other.PainType.Copy(); PlayerAirCapacity = other.PlayerAirCapacity; PlayerAttackZOffset = other.PlayerAttackZOffset; PlayerColorRange = other.PlayerColorRange; PlayerCrouchSprite = other.PlayerCrouchSprite.Copy(); PlayerDamageScreenColor = new DamageScreenColor(other.PlayerDamageScreenColor); PlayerDisplayName = other.PlayerDisplayName.Copy(); PlayerFace = other.PlayerFace.Copy(); PlayerFallingScreamSpeed = other.PlayerFallingScreamSpeed; PlayerFlechetteType = other.PlayerFlechetteType.Copy(); PlayerForwardMove = other.PlayerForwardMove; PlayerGruntSpeed = other.PlayerGruntSpeed; PlayerHealRadiusType = other.PlayerHealRadiusType.Copy(); PlayerHexenArmor = other.PlayerHexenArmor; PlayerJumpZ = other.PlayerJumpZ; PlayerMaxHealth = other.PlayerMaxHealth; PlayerMorphWeapon = other.PlayerMorphWeapon.Copy(); PlayerMugShotMaxHealth = other.PlayerMugShotMaxHealth; PlayerPortrait = other.PlayerPortrait.Copy(); PlayerRunHealth = other.PlayerRunHealth; PlayerScoreIcon = other.PlayerScoreIcon.Copy(); PlayerSideMove = other.PlayerSideMove; PlayerSoundClass = other.PlayerSoundClass.Copy(); PlayerSpawnClass = other.PlayerSpawnClass.Copy(); PlayerStartItem = new Dictionary <UpperString, int>(other.PlayerStartItem); PlayerTeleportFreezeTime = other.PlayerTeleportFreezeTime; PlayerUseRange = other.PlayerUseRange; PlayerWeaponSlot = CopyWeaponSlot(other.PlayerWeaponSlot); PlayerViewBob = other.PlayerViewBob; PlayerViewHeight = other.PlayerViewHeight; PoisonDamage = other.PoisonDamage; PoisonDamageType = other.PoisonDamageType.Copy(); PowerupColor = other.PowerupColor; PowerupColormap = other.PowerupColormap; PowerupDuration = other.PowerupDuration; PowerupMode = other.PowerupMode; PowerupStrength = other.PowerupStrength; PowerupType = other.PowerupType.Copy(); PowerSpeedNoTrail = other.PowerSpeedNoTrail; ProjectileKickBack = other.ProjectileKickBack; ProjectilePassHeight = other.ProjectilePassHeight; PushFactor = other.PushFactor; PuzzleItemNumber = other.PuzzleItemNumber; PuzzleItemFailMessage = other.PuzzleItemFailMessage.Copy(); Radius = other.Radius; RadiusDamageFactor = other.RadiusDamageFactor; ReactionTime = other.ReactionTime; RenderRadius = other.RenderRadius; RenderStyle = other.RenderStyle; RipLevelMax = other.RipLevelMax; RipLevelMin = other.RipLevelMin; RipperLevel = other.RipperLevel; Scale = other.Scale; SeeSound = other.SeeSound.Copy(); SelfDamageFactor = other.SelfDamageFactor; SpawnID = other.SpawnID; SpawnInfo = other.SpawnInfo.Map(si => new SpawnInfo(si)); Species = other.Species.Copy(); Speed = other.Speed; SpriteAngle = other.SpriteAngle; SpriteRotation = other.SpriteRotation; Stamina = other.Stamina; StealthAlpha = other.StealthAlpha; StencilColor = other.StencilColor; Tag = other.Tag.Copy(); DecorateTranslation = new DecorateTranslation(DecorateTranslation); Threshold = other.Threshold; TeleFogDestType = other.TeleFogDestType; TeleFogSourceType = other.TeleFogSourceType; VisibleAngles = other.VisibleAngles; VisiblePitch = other.VisiblePitch; VisibleToPlayerClass = new List <UpperString>(other.VisibleToPlayerClass); VisibleToTeam = other.VisibleToTeam; VSpeed = other.VSpeed; WallBounceFactor = other.WallBounceFactor; WallBounceSound = other.WallBounceSound.Copy(); WeaponAmmoGive = other.WeaponAmmoGive; WeaponAmmoGive1 = other.WeaponAmmoGive1; WeaponAmmoGive2 = other.WeaponAmmoGive2; WeaponAmmoType = other.WeaponAmmoType.Copy(); WeaponAmmoType1 = other.WeaponAmmoType1.Copy(); WeaponAmmoType2 = other.WeaponAmmoType2.Copy(); WeaponAmmoUse = other.WeaponAmmoUse; WeaponAmmoUse1 = other.WeaponAmmoUse1; WeaponAmmoUse2 = other.WeaponAmmoUse2; WeaponBobRangeX = other.WeaponBobRangeX; WeaponBobRangeY = other.WeaponBobRangeY; WeaponBobSpeed = other.WeaponBobSpeed; WeaponBobStyle = other.WeaponBobStyle; WeaponDefaultKickBack = other.WeaponDefaultKickBack; WeaponKickBack = other.WeaponKickBack; WeaponLookScale = other.WeaponLookScale; WeaponMinSelectionAmmo1 = other.WeaponMinSelectionAmmo1; WeaponMinSelectionAmmo2 = other.WeaponMinSelectionAmmo2; WeaponReadySound = other.WeaponReadySound.Copy(); WeaponSelectionOrder = other.WeaponSelectionOrder; WeaponSisterWeapon = other.WeaponSisterWeapon.Copy(); WeaponSlotNumber = other.WeaponSlotNumber; WeaponSlotPriority = other.WeaponSlotPriority; WeaponUpSound = other.WeaponUpSound.Copy(); WeaponYAdjust = other.WeaponYAdjust; WeaponPieceNumber = other.WeaponPieceNumber; WeaponPieceWeapon = other.WeaponPieceWeapon.Copy(); WeaveIndexXY = other.WeaveIndexXY; WeaveIndexZ = other.WeaveIndexZ; WoundHealth = other.WoundHealth; XScale = other.XScale; YScale = other.YScale; }