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 override void CreateReferences() { base.CreateReferences(); int upgradeLevelCount = this.GetUpgradeLevelCount(); this.m_attackerItemData = new LogicAttackerItemData[upgradeLevelCount]; this.m_specialAbilityEffectData = new LogicEffectData[upgradeLevelCount]; this.m_auraSpellData = new LogicSpellData[upgradeLevelCount]; this.m_retributionSpellData = new LogicSpellData[upgradeLevelCount]; this.m_deployEffectData = new LogicEffectData[upgradeLevelCount]; this.m_dieEffectData = new LogicEffectData[upgradeLevelCount]; this.m_dieEffect2Data = new LogicEffectData[upgradeLevelCount]; this.m_dieDamageEffectData = new LogicEffectData[upgradeLevelCount]; this.m_moveTrailEffectData = new LogicEffectData[upgradeLevelCount]; this.m_hitpoints = new int[upgradeLevelCount]; this.m_secondaryTroopCount = new int[upgradeLevelCount]; this.m_unitsInCamp = new int[upgradeLevelCount]; this.m_strengthWeight = new int[upgradeLevelCount]; this.m_specialAbilityLevel = new int[upgradeLevelCount]; this.m_specialAbilityAttribute = new int[upgradeLevelCount]; this.m_specialAbilityAttribute2 = new int[upgradeLevelCount]; this.m_specialAbilityAttribute3 = new int[upgradeLevelCount]; this.m_scale = new int[upgradeLevelCount]; this.m_attackCount = new int[upgradeLevelCount]; this.m_abilityAttackCount = new int[upgradeLevelCount]; this.m_dieDamage = new int[upgradeLevelCount]; this.m_auraSpellLevel = new int[upgradeLevelCount]; this.m_retributionSpellLevel = new int[upgradeLevelCount]; this.m_retributionSpellTriggerHealth = new int[upgradeLevelCount]; this.m_childTroopX = new int[3]; this.m_childTroopY = new int[3]; for (int i = 0; i < this.m_hitpoints.Length; i++) { this.m_attackerItemData[i] = new LogicAttackerItemData(); this.m_attackerItemData[i].CreateReferences(this.m_row, this, i); this.m_hitpoints[i] = this.GetClampedIntegerValue("Hitpoints", i); this.m_secondaryTroopCount[i] = this.GetClampedIntegerValue("SecondaryTroopCnt", i); this.m_unitsInCamp[i] = this.GetClampedIntegerValue("UnitsInCamp", i); this.m_specialAbilityLevel[i] = this.GetClampedIntegerValue("SpecialAbilityLevel", i); this.m_specialAbilityEffectData[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("SpecialAbilityEffect", i), this); this.m_deployEffectData[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("DeployEffect", i), this); this.m_dieEffectData[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("DieEffect", i), this); this.m_dieEffect2Data[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("DieEffect2", i), this); this.m_dieDamageEffectData[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("DieDamageEffect", i), this); this.m_moveTrailEffectData[i] = LogicDataTables.GetEffectByName(this.GetClampedValue("MoveTrailEffect", i), this); this.m_attackCount[i] = this.GetClampedIntegerValue("AttackCount", i); this.m_abilityAttackCount[i] = this.GetClampedIntegerValue("AbilityAttackCount", i); this.m_dieDamage[i] = this.GetClampedIntegerValue("DieDamage", i); this.m_strengthWeight[i] = this.GetClampedIntegerValue("StrengthWeight", i); this.m_scale[i] = this.GetClampedIntegerValue("Scale", i); if (this.m_scale[i] == 0) { this.m_scale[i] = 100; } this.m_auraSpellData[i] = LogicDataTables.GetSpellByName(this.GetClampedValue("AuraSpell", i), this); this.m_auraSpellLevel[i] = this.GetClampedIntegerValue("AuraSpellLevel", i); this.m_retributionSpellData[i] = LogicDataTables.GetSpellByName(this.GetClampedValue("RetributionSpell", i), this); this.m_retributionSpellLevel[i] = this.GetClampedIntegerValue("RetributionSpellLevel", i); this.m_retributionSpellTriggerHealth[i] = this.GetClampedIntegerValue("RetributionSpellTriggerHealth", i); this.m_specialAbilityAttribute[i] = this.GetClampedIntegerValue("SpecialAbilityAttribute", i); this.m_specialAbilityAttribute2[i] = this.GetClampedIntegerValue("SpecialAbilityAttribute2", i); this.m_specialAbilityAttribute3[i] = this.GetClampedIntegerValue("SpecialAbilityAttribute3", i); } this.m_moveStartsEffect = LogicDataTables.GetEffectByName(this.GetValue("MoveStartsEffect", 0), this); this.m_specialAbilityType = this.GetSpecialAbilityTypeFromCSV(); string specialAbilitySpell = this.GetValue("SpecialAbilitySpell", 0); if (specialAbilitySpell.Length > 0) { this.m_specialAbilitySpellData = LogicDataTables.GetSpellByName(specialAbilitySpell, this); } this.m_swf = this.GetValue("SWF", 0); this.m_specialAbilityName = this.GetValue("SpecialAbilityName", 0); this.m_specialAbilityInfo = this.GetValue("SpecialAbilityInfo", 0); this.m_bigPictureSWF = this.GetValue("BigPictureSWF", 0); this.m_dieDamageRadius = (this.GetIntegerValue("DieDamageRadius", 0) << 9) / 100; this.m_dieDamageDelay = this.GetIntegerValue("DieDamageDelay", 0); if (this.m_dieDamageDelay > 4000) { Debugger.Warning("m_dieDamageDelay too big"); this.m_dieDamageDelay = 4000; } this.m_secondaryTroopData = LogicDataTables.GetCharacterByName(this.GetValue("SecondaryTroop", 0), this); this.m_isSecondaryTroop = this.GetBooleanValue("IsSecondaryTroop", 0); this.m_secondarySpawnDistance = (this.GetIntegerValue("SecondarySpawnDist", 0) << 9) / 100; this.m_secondarySpawnOffset = (this.GetIntegerValue("SecondarySpawnOffset", 0) << 9) / 100; this.m_tombstoneData = LogicDataTables.GetObstacleByName(this.GetValue("TombStone", 0), this); this.m_maxTrainingCount = this.GetIntegerValue("MaxTrainingCount", 0); this.m_unlockedBarrackLevel = this.GetIntegerValue("BarrackLevel", 0) - 1; this.m_flying = this.GetBooleanValue("IsFlying", 0); this.m_jumper = this.GetBooleanValue("IsJumper", 0); this.m_movementOffsetAmount = this.GetIntegerValue("MovementOffsetAmount", 0); this.m_movementOffsetSpeed = this.GetIntegerValue("MovementOffsetSpeed", 0); this.m_balloonGoblin = this.GetName().Equals("Balloon Goblin"); this.m_spawnIdle = this.GetIntegerValue("SpawnIdle", 0); this.m_childTroopData = LogicDataTables.GetCharacterByName(this.GetValue("ChildTroop", 0), this); this.m_childTroopCount = this.GetIntegerValue("ChildTroopCount", 0); for (int i = 0; i < 3; i++) { this.m_childTroopX[i] = this.GetIntegerValue(string.Format("ChildTroop{0}_X", i), 0); this.m_childTroopY[i] = this.GetIntegerValue(string.Format("ChildTroop{0}_Y", i), 0); } this.m_attackMultipleBuildings = this.GetBooleanValue("AttackMultipleBuildings", 0); if (!this.m_attackerItemData[0].IsSelfAsAoeCenter()) { this.m_attackMultipleBuildings = false; } this.m_speed = (this.GetIntegerValue("Speed", 0) << 9) / 100; this.m_speedDecreasePerChildTroopLost = (this.GetIntegerValue("SpeedDecreasePerChildTroopLost", 0) << 9) / 100; this.m_pickNewTargetAfterPushback = this.GetBooleanValue("PickNewTargetAfterPushback", 0); this.m_pushbackSpeed = this.GetIntegerValue("PushbackSpeed", 0); this.m_hitEffectOffset = this.GetIntegerValue("HitEffectOffset", 0); this.m_targetedEffectOffset = (this.GetIntegerValue("TargetedEffectOffset", 0) << 9) / 100; this.m_randomizeSecSpawnDist = this.GetBooleanValue("RandomizeSecSpawnDist", 0); this.m_customDefenderIcon = this.GetValue("CustonDefenderIcon", 0); this.m_autoMergeDistance = (this.GetIntegerValue("AutoMergeDistance", 0) << 9) / 100; this.m_autoMergeGroupSize = this.GetIntegerValue("AutoMergeGroupSize", 0); this.m_invisibilityRadius = (this.GetIntegerValue("InvisibilityRadius", 0) << 9) / 100; this.m_healthReductionPerSecond = this.GetIntegerValue("HealthReductionPerSecond", 0); this.m_isUnderground = this.GetBooleanValue("IsUnderground", 0); this.m_attackOverWalls = this.GetBooleanValue("NoAttackOverWalls", 0) ^ true; this.m_smoothJump = this.GetBooleanValue("SmoothJump", 0); this.m_auraTID = this.GetValue("AuraTID", 0); this.m_auraDescTID = this.GetValue("AuraDescTID", 0); this.m_auraBigPictureExportName = this.GetValue("AuraBigPictureExportName", 0); this.m_friendlyGroupWeight = this.GetIntegerValue("FriendlyGroupWeight", 0); this.m_enemyGroupWeight = this.GetIntegerValue("EnemyGroupWeight", 0); this.m_scaleByTH = this.GetBooleanValue("ScaleByTH", 0); this.m_disableDonate = this.GetBooleanValue("DisableDonate", 0); this.m_loseHpPerTick = this.GetIntegerValue("LoseHpPerTick", 0); this.m_loseHpInterval = this.GetIntegerValue("LoseHpInterval", 0); this.m_triggersTraps = this.GetBooleanValue("TriggersTraps", 0); this.m_chainShootingDistance = this.GetIntegerValue("ChainShootingDistance", 0); this.m_boostedIfAlone = this.GetBooleanValue("BoostedIfAlone", 0); this.m_boostRadius = (this.GetIntegerValue("BoostRadius", 0) << 9) / 100; this.m_boostDamagePerfect = this.GetIntegerValue("BoostDmgPerfect", 0); this.m_boostAttackSpeed = this.GetIntegerValue("BoostAttackSpeed", 0); }
public override void CreateReferences() { base.CreateReferences(); this.m_exportName = this.GetValue("ExportName", 0); this.m_exportNameBase = this.GetValue("ExportNameBase", 0); this.m_width = this.GetIntegerValue("Width", 0); this.m_height = this.GetIntegerValue("Height", 0); this.m_passable = this.GetBooleanValue("Passable", 0); this.m_clearEffect = LogicDataTables.GetEffectByName(this.GetValue("ClearEffect", 0), this); this.m_pickUpEffect = LogicDataTables.GetEffectByName(this.GetValue("PickUpEffect", 0), this); this.m_isTombstone = this.GetBooleanValue("IsTombstone", 0); this.m_tombGroup = this.GetIntegerValue("TombGroup", 0); this.m_appearancePeriodHours = this.GetIntegerValue("AppearancePeriodHours", 0); this.m_minRespawnTimeHours = this.GetIntegerValue("MinRespawnTimeHours", 0); this.m_lootDefensePercentage = this.GetIntegerValue("LootDefensePercentage", 0); this.m_redMul = this.GetIntegerValue("RedMul", 0); this.m_greenMul = this.GetIntegerValue("GreenMul", 0); this.m_blueMul = this.GetIntegerValue("BlueMul", 0); this.m_redAdd = this.GetIntegerValue("RedAdd", 0); this.m_greenAdd = this.GetIntegerValue("GreenAdd", 0); this.m_blueAdd = this.GetIntegerValue("BlueAdd", 0); this.m_lightsOn = this.GetBooleanValue("LightsOn", 0); this.m_village2RespawnCount = this.GetIntegerValue("Village2RespawnCount", 0); this.m_variationCount = this.GetIntegerValue("VariationCount", 0); this.m_tallGrass = this.GetBooleanValue("TallGrass", 0); this.m_tallGrassSpawnPoint = this.GetBooleanValue("TallGrassSpawnPoint", 0); this.m_lootHighlightPercentage = this.GetIntegerValue("LootHighlightPercentage", 0); this.m_highlightExportName = this.GetValue("HighlightExportName", 0); this.m_clearResourceData = LogicDataTables.GetResourceByName(this.GetValue("ClearResource", 0), this); if (this.m_clearResourceData == null) { Debugger.Error("Clear resource is not defined for obstacle: " + this.GetName()); } this.m_clearCost = this.GetIntegerValue("ClearCost", 0); this.m_clearTimeSecs = this.GetIntegerValue("ClearTimeSeconds", 0); this.m_respawnWeight = this.GetIntegerValue("RespawnWeight", 0); string lootResourceName = this.GetValue("LootResource", 0); if (lootResourceName.Length <= 0) { this.m_respawnWeight = 0; } else { this.m_lootResourceData = LogicDataTables.GetResourceByName(lootResourceName, this); this.m_lootCount = this.GetIntegerValue("LootCount", 0); } this.m_lootMultiplierVersion2 = this.GetIntegerValue("LootMultiplierForVersion2", 0); if (this.m_lootMultiplierVersion2 == 0) { this.m_lootMultiplierVersion2 = 1; } string spawnObstacle = this.GetValue("SpawnObstacle", 0); if (spawnObstacle.Length > 0) { this.m_spawnObstacle = LogicDataTables.GetObstacleByName(spawnObstacle, this); this.m_spawnRadius = this.GetIntegerValue("SpawnRadius", 0); this.m_spawnIntervalSeconds = this.GetIntegerValue("SpawnIntervalSeconds", 0); this.m_spawnCount = this.GetIntegerValue("SpawnCount", 0); this.m_maxSpawned = this.GetIntegerValue("MaxSpawned", 0); this.m_maxLifetimeSpawns = this.GetIntegerValue("MaxLifetimeSpawns", 0); } }