public override void CreateReferences() { base.CreateReferences(); this.m_width = this.GetIntegerValue("Width", 0); this.m_height = this.GetIntegerValue("Height", 0); this.m_upgradeLevelCount = this.m_row.GetBiggestArraySize(); this.m_buildCost = new int[this.m_upgradeLevelCount]; this.m_rearmCost = new int[this.m_upgradeLevelCount]; this.m_townHallLevel = new int[this.m_upgradeLevelCount]; this.m_strenghtWeight = new int[this.m_upgradeLevelCount]; this.m_damage = new int[this.m_upgradeLevelCount]; this.m_damageRadius = new int[this.m_upgradeLevelCount]; this.m_ejectHousingLimit = new int[this.m_upgradeLevelCount]; this.m_numSpawns = new int[this.m_upgradeLevelCount]; this.m_constructionTimes = new int[this.m_upgradeLevelCount]; this.m_projectileData = new LogicProjectileData[this.m_upgradeLevelCount]; for (int i = 0; i < this.m_upgradeLevelCount; i++) { this.m_buildCost[i] = this.GetClampedIntegerValue("BuildCost", i); this.m_rearmCost[i] = this.GetClampedIntegerValue("RearmCost", i); this.m_townHallLevel[i] = LogicMath.Max(this.GetClampedIntegerValue("TownHallLevel", i) - 1, 0); this.m_strenghtWeight[i] = this.GetClampedIntegerValue("StrengthWeight", i); this.m_damage[i] = LogicGamePlayUtil.DPSToSingleHit(this.GetClampedIntegerValue("Damage", i), 1000); this.m_damageRadius[i] = (this.GetClampedIntegerValue("DamageRadius", i) << 9) / 100; this.m_ejectHousingLimit[i] = this.GetIntegerValue("EjectHousingLimit", i); this.m_numSpawns[i] = this.GetClampedIntegerValue("NumSpawns", i); this.m_constructionTimes[i] = 86400 * this.GetClampedIntegerValue("BuildTimeD", i) + 3600 * this.GetClampedIntegerValue("BuildTimeH", i) + 60 * this.GetClampedIntegerValue("BuildTimeM", i) + this.GetClampedIntegerValue("BuildTimeS", i); this.m_projectileData[i] = LogicDataTables.GetProjectileByName(this.GetValue("Projectile", i), this); } this.m_preferredTargetData = LogicDataTables.GetCharacterByName(this.GetValue("PreferredTarget", 0), this); this.m_preferredTargetDamageMod = this.GetIntegerValue("PreferredTargetDamageMod", 0); if (this.m_preferredTargetDamageMod == 0) { this.m_preferredTargetDamageMod = 100; } this.m_buildResourceData = LogicDataTables.GetResourceByName(this.GetValue("BuildResource", 0), this); if (this.m_buildResourceData == null) { Debugger.Error("build resource is not defined for trap: " + this.GetName()); } this.m_ejectVictims = this.GetBooleanValue("EjectVictims", 0); this.m_actionFrame = 1000 * this.GetIntegerValue("ActionFrame", 0) / 24; this.m_pushback = this.GetIntegerValue("Pushback", 0); this.m_doNotScalePushByDamage = this.GetBooleanValue("DoNotScalePushByDamage", 0); this.m_effectData = LogicDataTables.GetEffectByName(this.GetValue("Effect", 0), this); this.m_effect2Data = LogicDataTables.GetEffectByName(this.GetValue("Effect2", 0), this); this.m_effectBrokenData = LogicDataTables.GetEffectByName(this.GetValue("EffectBroken", 0), this); this.m_damageEffectData = LogicDataTables.GetEffectByName(this.GetValue("DamageEffect", 0), this); this.m_pickUpEffectData = LogicDataTables.GetEffectByName(this.GetValue("PickUpEffect", 0), this); this.m_placingEffectData = LogicDataTables.GetEffectByName(this.GetValue("PlacingEffect", 0), this); this.m_appearEffectData = LogicDataTables.GetEffectByName(this.GetValue("AppearEffect", 0), this); this.m_toggleAttackModeEffectData = LogicDataTables.GetEffectByName(this.GetValue("ToggleAttackModeEffect", 0), this); this.m_triggerRadius = (this.GetIntegerValue("TriggerRadius", 0) << 9) / 100; this.m_directionCount = this.GetIntegerValue("DirectionCount", 0); this.m_spell = LogicDataTables.GetSpellByName(this.GetValue("Spell", 0), this); this.m_airTrigger = this.GetBooleanValue("AirTrigger", 0); this.m_groundTrigger = this.GetBooleanValue("GroundTrigger", 0); this.m_healerTrigger = this.GetBooleanValue("HealerTrigger", 0); this.m_speedMod = this.GetIntegerValue("SpeedMod", 0); this.m_damageMod = this.GetIntegerValue("DamageMod", 0); this.m_durationMS = this.GetIntegerValue("DurationMS", 0); this.m_hitDelayMS = this.GetIntegerValue("HitDelayMS", 0); this.m_hitCount = this.GetIntegerValue("HitCnt", 0); this.m_minTriggerHousingLimit = this.GetIntegerValue("MinTriggerHousingLimit", 0); this.m_spawnedCharGroundData = LogicDataTables.GetCharacterByName(this.GetValue("SpawnedCharGround", 0), this); this.m_spawnedCharAirData = LogicDataTables.GetCharacterByName(this.GetValue("SpawnedCharAir", 0), this); this.m_timeBetweenSpawnsMS = this.GetIntegerValue("TimeBetweenSpawnsMs", 0); this.m_spawnInitialDelayMS = this.GetIntegerValue("SpawnInitialDelayMs", 0); this.m_throwDistance = this.GetIntegerValue("ThrowDistance", 0); this.m_hasAltMode = this.GetBooleanValue("HasAltMode", 0); this.m_enableByCalendar = this.GetBooleanValue("EnabledByCalendar", 0); if (this.m_enableByCalendar) { if (this.m_upgradeLevelCount > 1) { Debugger.Error("Temporary traps should not have upgrade levels!"); } } }
public override void CreateReferences() { base.CreateReferences(); this.m_damage = new int[this.m_upgradeLevelCount]; this.m_troopDamagePermil = new int[this.m_upgradeLevelCount]; this.m_buildingDamagePermil = new int[this.m_upgradeLevelCount]; this.m_executeHealthPermil = new int[this.m_upgradeLevelCount]; this.m_damagePermilMin = new int[this.m_upgradeLevelCount]; this.m_preferredDamagePermilMin = new int[this.m_upgradeLevelCount]; this.m_boostTimeMS = new int[this.m_upgradeLevelCount]; this.m_speedBoost = new int[this.m_upgradeLevelCount]; this.m_speedBoost2 = new int[this.m_upgradeLevelCount]; this.m_damageBoostPercent = new int[this.m_upgradeLevelCount]; this.m_duplicateLifetime = new int[this.m_upgradeLevelCount]; this.m_duplicateHousing = new int[this.m_upgradeLevelCount]; this.m_radius = new int[this.m_upgradeLevelCount]; this.m_numberOfHits = new int[this.m_upgradeLevelCount]; this.m_randomRadius = new int[this.m_upgradeLevelCount]; this.m_timeBetweenHitsMS = new int[this.m_upgradeLevelCount]; this.m_jumpBoostMS = new int[this.m_upgradeLevelCount]; this.m_jumpHousingLimit = new int[this.m_upgradeLevelCount]; this.m_freezeTimeMS = new int[this.m_upgradeLevelCount]; this.m_strengthWeight = new int[this.m_upgradeLevelCount]; this.m_buildingDamageBoostPercent = new int[this.m_upgradeLevelCount]; this.m_shieldProjectileSpeed = new int[this.m_upgradeLevelCount]; this.m_shieldProjectileDamageMod = new int[this.m_upgradeLevelCount]; this.m_extraHealthPermil = new int[this.m_upgradeLevelCount]; this.m_extraHealthMin = new int[this.m_upgradeLevelCount]; this.m_extraHealthMax = new int[this.m_upgradeLevelCount]; this.m_poisonDamage = new int[this.m_upgradeLevelCount]; this.m_attackSpeedBoost = new int[this.m_upgradeLevelCount]; this.m_invulnerabilityTime = new int[this.m_upgradeLevelCount]; this.m_maxUnitsHit = new int[this.m_upgradeLevelCount]; this.m_unitsToSpawn = new int[this.m_upgradeLevelCount]; this.m_spawnDuration = new int[this.m_upgradeLevelCount]; this.m_preDeployEffect = new LogicEffectData[this.m_upgradeLevelCount]; this.m_deployEffect = new LogicEffectData[this.m_upgradeLevelCount]; this.m_deployEffect2 = new LogicEffectData[this.m_upgradeLevelCount]; this.m_enemyDeployEffect = new LogicEffectData[this.m_upgradeLevelCount]; this.m_chargingEffect = new LogicEffectData[this.m_upgradeLevelCount]; this.m_hitEffect = new LogicEffectData[this.m_upgradeLevelCount]; for (int i = 0; i < this.m_upgradeLevelCount; i++) { this.m_damage[i] = LogicGamePlayUtil.DPSToSingleHit(this.GetClampedIntegerValue("Damage", i), 1000); this.m_troopDamagePermil[i] = this.GetClampedIntegerValue("TroopDamagePermil", i); this.m_buildingDamagePermil[i] = this.GetClampedIntegerValue("BuildingDamagePermil", i); this.m_executeHealthPermil[i] = this.GetClampedIntegerValue("ExecuteHealthPermil", i); this.m_damagePermilMin[i] = this.GetClampedIntegerValue("DamagePermilMin", i); this.m_preferredDamagePermilMin[i] = this.GetClampedIntegerValue("PreferredDamagePermilMin", i); this.m_boostTimeMS[i] = this.GetClampedIntegerValue("BoostTimeMS", i); this.m_speedBoost[i] = this.GetClampedIntegerValue("SpeedBoost", i); this.m_speedBoost2[i] = this.GetClampedIntegerValue("SpeedBoost2", i); this.m_damageBoostPercent[i] = this.GetClampedIntegerValue("DamageBoostPercent", i); this.m_duplicateLifetime[i] = this.GetClampedIntegerValue("DuplicateLifetime", i); this.m_duplicateHousing[i] = this.GetClampedIntegerValue("DuplicateHousing", i); this.m_radius[i] = (this.GetClampedIntegerValue("Radius", i) << 9) / 100; this.m_numberOfHits[i] = this.GetClampedIntegerValue("NumberOfHits", i); this.m_randomRadius[i] = (this.GetClampedIntegerValue("RandomRadius", i) << 9) / 100; this.m_timeBetweenHitsMS[i] = this.GetClampedIntegerValue("TimeBetweenHitsMS", i); this.m_jumpBoostMS[i] = this.GetClampedIntegerValue("JumpBoostMS", i); this.m_jumpHousingLimit[i] = this.GetClampedIntegerValue("JumpHousingLimit", i); this.m_hitEffect[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("HitEffect", i), this); this.m_chargingEffect[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("ChargingEffect", i), this); this.m_preDeployEffect[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("PreDeployEffect", i), this); this.m_deployEffect[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("DeployEffect", i), this); this.m_enemyDeployEffect[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("EnemyDeployEffect", i), this); this.m_deployEffect2[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("DeployEffect2", i), this); this.m_freezeTimeMS[i] = this.GetClampedIntegerValue("FreezeTimeMS", i); this.m_strengthWeight[i] = this.GetClampedIntegerValue("StrengthWeight", i); this.m_buildingDamageBoostPercent[i] = this.GetClampedIntegerValue("BuildingDamageBoostPercent", i); this.m_shieldProjectileSpeed[i] = this.GetClampedIntegerValue("ShieldProjectileSpeed", i); this.m_shieldProjectileDamageMod[i] = this.GetClampedIntegerValue("ShieldProjectileDamageMod", i); this.m_extraHealthPermil[i] = this.GetClampedIntegerValue("ExtraHealthPermil", i); this.m_extraHealthMin[i] = this.GetClampedIntegerValue("ExtraHealthMin", i); this.m_extraHealthMax[i] = this.GetClampedIntegerValue("ExtraHealthMax", i); this.m_poisonDamage[i] = LogicGamePlayUtil.DPSToSingleHit(this.GetClampedIntegerValue("PoisonDPS", i), 1000); this.m_attackSpeedBoost[i] = this.GetClampedIntegerValue("AttackSpeedBoost", i); this.m_invulnerabilityTime[i] = this.GetClampedIntegerValue("InvulnerabilityTime", i); this.m_maxUnitsHit[i] = this.GetClampedIntegerValue("MaxUnitsHit", i); this.m_unitsToSpawn[i] = this.GetClampedIntegerValue("UnitsToSpawn", i); this.m_spawnDuration[i] = this.GetClampedIntegerValue("SpawnDuration", i); } this.m_poisonIncreaseSlowly = this.GetBooleanValue("PoisonIncreaseSlowly", 0); this.m_poisonAffectAir = this.GetBooleanValue("PoisonAffectAir", 0); this.m_spawnFirstGroupSize = this.GetIntegerValue("SpawnFirstGroupSize", 0); this.m_scaleByTownHall = this.GetBooleanValue("ScaleByTH", 0); this.m_pauseCombatComponentMs = this.GetIntegerValue("PauseCombatComponentsMs", 0); this.m_damageTHPercent = this.GetIntegerValue("DamageTHPercent", 0); if (this.m_damageTHPercent <= 0) { this.m_damageTHPercent = 100; } this.m_shrinkReduceSpeedRatio = this.GetIntegerValue("ShrinkReduceSpeedRatio", 0); this.m_shrinkHitpointsRatio = this.GetIntegerValue("ShrinkHitpointsRatio", 0); this.m_deployEffect2Delay = this.GetIntegerValue("DeployEffect2Delay", 0); this.m_hitTimeMS = this.GetIntegerValue("HitTimeMS", 0); this.m_deployTimeMS = this.GetIntegerValue("DeployTimeMS", 0); this.m_chargingTimeMS = this.GetIntegerValue("ChargingTimeMS", 0); this.m_spellForgeLevel = this.GetIntegerValue("SpellForgeLevel", 0) - 1; this.m_randomRadiusAffectsOnlyGfx = this.GetBooleanValue("RandomRadiusAffectsOnlyGfx", 0); this.m_spawnObstacle = LogicDataTables.GetObstacleByName(this.GetValue("SpawnObstacle", 0), this); this.m_numObstacles = this.GetIntegerValue("NumObstacles", 0); this.m_troopsOnly = this.GetBooleanValue("TroopsOnly", 0); this.m_targetInfoString = this.GetValue("TargetInfoString", 0); string preferredTarget = this.GetValue("PreferredTarget", 0); if (preferredTarget.Length != 0) { this.m_preferredTarget = LogicDataTables.GetBuildingClassByName(preferredTarget, null); if (this.m_preferredTarget == null) { this.m_preferredTarget = LogicDataTables.GetBuildingByName(preferredTarget, null); if (this.m_preferredTarget == null) { this.m_preferredTarget = LogicDataTables.GetCharacterByName(preferredTarget, null); if (this.m_preferredTarget == null) { Debugger.Warning(string.Format("CSV row ({0}) has an invalid reference ({1})", this.GetName(), preferredTarget)); } } } } this.m_preferredTargetDamageMod = this.GetIntegerValue("PreferredTargetDamageMod", 0); if (this.m_preferredTargetDamageMod == 0) { this.m_preferredTargetDamageMod = 100; } this.m_heroDamageMultiplier = this.GetIntegerValue("HeroDamageMultiplier", 0); if (this.m_heroDamageMultiplier == 0) { this.m_heroDamageMultiplier = 100; } this.m_snapToGrid = this.GetBooleanValue("SnapToGrid", 0); this.m_boostDefenders = this.GetBooleanValue("BoostDefenders", 0); this.m_boostLinkedToPoison = this.GetBooleanValue("BoostLinkedToPoison", 0); this.m_scaleDeployEffects = this.GetBooleanValue("ScaleDeployEffects", 0); this.m_summonTroop = LogicDataTables.GetCharacterByName(this.GetValue("SummonTroop", 0), null); }
public int GetDieDamage(int upgLevel) { return(LogicGamePlayUtil.DPSToSingleHit(this.m_dieDamage[upgLevel], 1000)); }
public void CreateReferences(CSVRow row, LogicData data, int idx) { this.m_row = row; this.m_data = data; this.m_index = idx; this.m_pushBack = row.GetClampedIntegerValue("PushBack", idx); this.m_airTargets = row.GetClampedBooleanValue("AirTargets", idx); this.m_groundTargets = row.GetClampedBooleanValue("GroundTargets", idx); this.m_altAttackMode = row.GetClampedBooleanValue("AltAttackMode", idx); this.m_damage = 100 * row.GetClampedIntegerValue("Damage", idx); int dps = row.GetClampedIntegerValue("DPS", idx); int attackSpeed = row.GetClampedIntegerValue("AttackSpeed", idx); int altDps = row.GetClampedIntegerValue("AltDPS", idx); int altAttackSpeed = row.GetClampedIntegerValue("AltAttackSpeed", idx); if (this.m_altAttackMode && altAttackSpeed == 0) { altAttackSpeed = attackSpeed; } int cooldownOverride = row.GetClampedIntegerValue("CoolDownOverride", idx); if (cooldownOverride == 0) { int tmp = (int)(((dps | this.m_damage) >> 31) & 0xFFFFFAEC) + 1500; if (attackSpeed > tmp) { cooldownOverride = attackSpeed - tmp; } } this.m_prepareSpeed = row.GetClampedIntegerValue("PrepareSpeed", idx); this.m_attackSpeed = attackSpeed - cooldownOverride; this.m_altAttackSpeed = altAttackSpeed - cooldownOverride; this.m_cooldownOverride = cooldownOverride; this.m_damageMulti = 100 * row.GetClampedIntegerValue("DamageMulti", idx); this.m_damageLvl2 = 100 * row.GetClampedIntegerValue("DamageLv2", idx); this.m_damageLvl3 = 100 * row.GetClampedIntegerValue("DamageLv3", idx); this.m_altDamage = this.m_damage; if (dps != 0) { if (altDps == 0) { altDps = dps; } this.m_damage = LogicGamePlayUtil.DPSToSingleHit(dps, this.m_attackSpeed + this.m_cooldownOverride); this.m_altDamage = LogicGamePlayUtil.DPSToSingleHit(altDps, this.m_altAttackSpeed + this.m_cooldownOverride); this.m_damageMulti = LogicGamePlayUtil.DPSToSingleHit(row.GetClampedIntegerValue("DPSMulti", idx), this.m_attackSpeed + this.m_cooldownOverride); this.m_damageLvl2 = LogicGamePlayUtil.DPSToSingleHit(row.GetClampedIntegerValue("DPSLv2", idx), this.m_attackSpeed + this.m_cooldownOverride); this.m_damageLvl3 = LogicGamePlayUtil.DPSToSingleHit(row.GetClampedIntegerValue("DPSLv3", idx), this.m_attackSpeed + this.m_cooldownOverride); } this.m_hitEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("HitEffect", idx), data); this.m_hitEffect2Data = LogicDataTables.GetEffectByName(row.GetClampedValue("HitEffect2", idx), data); this.m_hitEffectActiveData = LogicDataTables.GetEffectByName(row.GetClampedValue("HitEffectActive", idx), data); this.m_attackRange = (row.GetClampedIntegerValue("AttackRange", idx) << 9) / 100; this.m_damageRadius = (row.GetClampedIntegerValue("DamageRadius", idx) << 9) / 100; this.m_attackEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("AttackEffect", idx), data); this.m_altAttackEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("AttackEffectAlt", idx), data); this.m_ammoCount = row.GetClampedIntegerValue("AmmoCount", idx); this.m_attackEffect2Data = LogicDataTables.GetEffectByName(row.GetClampedValue("AttackEffect2", idx), data); this.m_attackEffectLv2Data = LogicDataTables.GetEffectByName(row.GetClampedValue("AttackEffectLv2", idx), data); this.m_attackEffectLv3Data = LogicDataTables.GetEffectByName(row.GetClampedValue("AttackEffectLv3", idx), data); this.m_transitionEffectLv2Data = LogicDataTables.GetEffectByName(row.GetClampedValue("TransitionEffectLv2", idx), data); this.m_transitionEffectLv3Data = LogicDataTables.GetEffectByName(row.GetClampedValue("TransitionEffectLv3", idx), data); this.m_altNumMultiTargets = row.GetClampedIntegerValue("AltNumMultiTargets", idx); this.m_switchTimeLv2 = row.GetClampedIntegerValue("Lv2SwitchTime", idx); this.m_switchTimeLv3 = row.GetClampedIntegerValue("Lv3SwitchTime", idx); this.m_statusEffectTime = row.GetClampedIntegerValue("StatusEffectTime", idx); this.m_speedMod = row.GetClampedIntegerValue("SpeedMod", idx); this.m_altAttackRange = (row.GetClampedIntegerValue("AltAttackRange", idx) << 9) / 100; this.m_projectileData = LogicDataTables.GetProjectileByName(row.GetClampedValue("Projectile", idx), data); this.m_altProjectileData = LogicDataTables.GetProjectileByName(row.GetClampedValue("AltProjectile", idx), data); this.m_shockwavePushStrength = row.GetClampedIntegerValue("ShockwavePushStrength", idx); this.m_hitSpellData = LogicDataTables.GetSpellByName(row.GetClampedValue("HitSpell", idx), data); this.m_hitSpellLevel = row.GetClampedIntegerValue("HitSpellLevel", idx); this.m_damage2 = 100 * row.GetClampedIntegerValue("Damage2", idx); this.m_damage2Radius = (row.GetClampedIntegerValue("Damage2Radius", idx) << 9) / 100; this.m_damage2Delay = row.GetClampedIntegerValue("Damage2Delay", idx); this.m_damage2Min = 100 * row.GetClampedIntegerValue("Damage2Min", idx); this.m_damage2FalloffStart = (row.GetClampedIntegerValue("Damage2FalloffStart", idx) << 9) / 100; this.m_damage2FalloffEnd = (row.GetClampedIntegerValue("Damage2FalloffStart", idx) << 9) / 100; if (this.m_damage2FalloffEnd < this.m_damage2FalloffStart) { Debugger.Error("Building " + row.GetName() + " has falloff end less than falloff start!"); } if (this.m_damage2FalloffEnd > this.m_damage2Radius) { Debugger.Error("Building " + row.GetName() + " has falloff end greater than the damage radius!"); } this.m_preAttackEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("PreAttackEffect", idx), data); this.m_becomesTargetableEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("BecomesTargetableEffect", idx), data); this.m_increasingDamage = row.GetClampedBooleanValue("IncreasingDamage", idx); this.m_preventsHealing = row.GetClampedBooleanValue("PreventsHealing", idx); this.m_alternatePickNewTargetDelay = row.GetClampedIntegerValue("AlternatePickNewTargetDelay", idx); this.m_shockwaveArcLength = row.GetClampedIntegerValue("ShockwaveArcLength", idx); this.m_shockwaveExpandRadius = row.GetClampedIntegerValue("ShockwaveExpandRadius", idx); this.m_targetingConeAngle = row.GetClampedIntegerValue("TargetingConeAngle", idx); this.m_penetratingProjectile = row.GetClampedBooleanValue("PenetratingProjectile", idx); this.m_penetratingRadius = (row.GetClampedIntegerValue("PenetratingRadius", idx) << 9) / 100; this.m_penetratingExtraRange = (row.GetClampedIntegerValue("PenetratingExtraRange", idx) << 9) / 100; this.m_targetGroups = row.GetClampedBooleanValue("TargetGroups", idx); this.m_fightWithGroups = row.GetClampedBooleanValue("FightWithGroups", idx); this.m_targetGroupsRadius = (row.GetClampedIntegerValue("TargetGroupsRadius", idx) << 9) / 100; this.m_targetGroupsRange = (row.GetClampedIntegerValue("TargetGroupsRange", idx) << 9) / 100; this.m_targetGroupsMinWeight = row.GetClampedIntegerValue("TargetGroupsMinWeight", idx); this.m_wakeUpSpace = row.GetClampedIntegerValue("WakeUpSpace", idx); this.m_wakeUpSpeed = row.GetClampedIntegerValue("WakeUpSpeed", idx); this.m_preferredTargetData = LogicDataTables.GetCharacterByName(row.GetClampedValue("PreferredTarget", idx), data); this.m_preferredTargetDamageMod = row.GetClampedIntegerValue("PreferredTargetDamageMod", idx); this.m_preferredTargetNoTargeting = row.GetClampedBooleanValue("PreferredTargetNoTargeting", idx); this.m_altAirTargets = row.GetClampedBooleanValue("AltAirTargets", idx); this.m_altGroundTargets = row.GetClampedBooleanValue("AltGroundTargets", idx); this.m_altMultiTargets = row.GetClampedBooleanValue("AltMultiTargets", idx); this.m_minAttackRange = (row.GetClampedIntegerValue("MinAttackRange", idx) << 9) / 100; if (this.m_preferredTargetData == null) { this.m_preferredTargetData = LogicDataTables.GetBuildingClassByName(row.GetClampedValue("PreferedTargetBuildingClass", idx), data); if (this.m_preferredTargetData == null) { this.m_preferredTargetData = LogicDataTables.GetBuildingByName(row.GetClampedValue("PreferedTargetBuilding", idx), data); } this.m_preferredTargetDamageMod = row.GetClampedIntegerValue("PreferedTargetDamageMod", idx); if (this.m_preferredTargetDamageMod == 0) { this.m_preferredTargetDamageMod = 100; } } this.m_summonTroopCount = row.GetClampedIntegerValue("SummonTroopCount", idx); this.m_summonCooldown = row.GetClampedIntegerValue("SummonCooldown", idx); this.m_summonEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("SummonEffect", idx), data); this.m_summonLimit = row.GetClampedIntegerValue("SummonLimit", idx); this.m_summonTroopData = LogicDataTables.GetCharacterByName(row.GetClampedValue("SummonTroop", idx), data); this.m_spawnOnAttack = row.GetClampedBooleanValue("SpawnOnAttack", idx); this.m_hideEffectData = LogicDataTables.GetEffectByName(row.GetClampedValue("HideEffect", idx), data); this.m_rageProjectileData = LogicDataTables.GetProjectileByName(row.GetClampedValue("RageProjectile", idx), data); this.m_projectileBounces = row.GetClampedIntegerValue("ProjectileBounces", idx); this.m_selfAsAoeCenter = row.GetClampedBooleanValue("SelfAsAoeCenter", idx); if (this.m_damage2Delay > this.m_cooldownOverride + this.m_attackSpeed) { Debugger.Error(row.GetName() + " has Damage2Delay greater than the attack speed!"); } if (this.m_ammoCount > 0 && (this.m_attackSpeed & 63) != 0) { Debugger.Error(string.Format("Invalid attack speed {0} (must be multiple of 64)", this.m_attackSpeed)); } this.m_burstCount = row.GetClampedIntegerValue("BurstCount", idx); this.m_burstDelay = row.GetClampedIntegerValue("BurstDelay", idx); this.m_altBurstCount = row.GetClampedIntegerValue("AltBurstCount", idx); this.m_altBurstDelay = row.GetClampedIntegerValue("AltBurstDelay", idx); this.m_dummyProjectileCount = row.GetClampedIntegerValue("DummyProjectileCount", idx); this.m_attackEffectSharedData = LogicDataTables.GetEffectByName(row.GetClampedValue("AttackEffectShared", idx), data); this.m_chainAttackDistance = row.GetClampedIntegerValue("ChainAttackDistance", idx); this.m_newTargetAttackDelay = row.GetClampedIntegerValue("NewTargetAttackDelay", idx); if (this.m_newTargetAttackDelay > 0) { this.m_newTargetAttackDelay = LogicMath.Clamp(attackSpeed - this.m_newTargetAttackDelay, 0, attackSpeed); } }