Advertisement
Guest User

Untitled

a guest
May 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 KB | None | 0 0
  1. // Rules are executed from top to bottom for each key-value from a KV file
  2. // Once some rule is applicable to a key-value, all other rules below it are ignored, the matched rule is applied
  3. // So it makes sense to place exclusion or the most specific rules at the top, and the "Always" rule at the bottom
  4.  
  5. // Rules can be put as "Rule when Condition" or "Condition perform Rule"
  6. // For example:
  7. // Multiply when FileName.is("my_file.txt")
  8. // FileDir("/my-dir") perform Ease(0.5)
  9. //
  10. // Conditions may be combined with "and" and "or", rules of parenthesis apply, left-right rule applies ("and" is not stronger than "or")
  11.  
  12. // Rules:
  13. //
  14. // Skip - does not change the matched key-values
  15. //
  16. // Multiply - multiplies by set multiplier (see value above)
  17. //
  18. // Ease - multiplies by a fraction of multiplies
  19. //
  20. // For example, for multiplier 10.0:
  21. // Ease(0.5) will multiply by 5.0
  22. // Ease(0.3) will multiply by 3.0
  23. //
  24. // For multiplier 0.5:
  25. // Ease(0.5) will multiply by 0.75
  26. // Ease(0.3) will multiply by 0.85
  27.  
  28. // Conditions:
  29. //
  30. // FileName - the name of the file including "extension", for example, "antimage_blink.txt"
  31. //
  32. // FileDir - the path to file starting from source directory, separated with "/"
  33. // For example, for source dir is "C:/oaa" and file located at "C:/oaa/my-dir/my-file.txt", this property is:
  34. // "my-dir" - note that there is no leading "/" or file name
  35. //
  36. // KeyName - the key in the KV file, for example, "range" or "AbilityManaCost"
  37. //
  38. // KvPath - hierarchical path to key excluding the key name itself
  39. //
  40. // For example, path to AM Blink range is:
  41. // DOTAAbilities.antimage_blink.AbilitySpecial.01.blink_range
  42. //
  43. // You can have path patterns containing ** or * to replace path parts:
  44. // * - matches one or more path parts, e.g. "a.b.c" will match "*", "*.c", "*.b.c", "*.a.b.c", "a.*.c"
  45. // ? - matches exactly one path part, e.g. "a.b.c" will match "?.b.c", "a.?.c", "a.b.?"
  46. val rules = Seq[RuleWithCondition](
  47. // special rare cases:
  48. // when damage is not under AbilitySpecial
  49. Multiply(forceType = Some(KvType.Integer)) when KeyName.is("AbilityDamage"),
  50. // chaos_knight_phantasm would not be fun with default illusion count
  51. Ease(0.33) when FileName.startsWith("chaos_knight_phantasm") and KeyName.is("images_count"),
  52. // enchantress_impetus distance damage should be increased, otherwise no fun
  53. Ease(0.33) when FileName.startsWith("enchantress_impetus") and KeyName.is("distance_damage_pct"),
  54.  
  55. // skip all numbers that are not in AbilitySpecial
  56. Skip when KvPath.doesNotMatch("*.AbilitySpecial.*"),
  57. // percents, chances, ranges, speeds, etc.
  58. Skip when KeyName.contains("percent") or KeyName.contains("pct") or KeyName.contains("chance") or KeyName.contains("conversion"),
  59. Skip when KeyName.contains("crit"),
  60. Skip when KeyName.contains("multiplier") or KeyName.contains("reduction") or KeyName.contains("resistance"),
  61. Skip when KeyName.contains("range") or KeyName.contains("radius") or KeyName.contains("distance") or KeyName.contains("aoe") or KeyName.contains("area_of_effect"),
  62. Skip when KeyName.contains("cooldown"),
  63. Skip when KeyName.contains("duration") or KeyName.contains("stun"),
  64. Skip when KeyName.contains("rate") or KeyName.contains("delay") or KeyName.contains("interval") or KeyName.contains("time"),
  65. Skip when KeyName.contains("speed") or KeyName.contains("slow"),
  66. Skip when KeyName.contains("angle"),
  67. Skip when KeyName.contains("vision"),
  68. Skip when KeyName.contains("count") or KeyName.contains("charges"),
  69. Ease(0.2) when (KeyName.contains("height") or KeyName.contains("width")),
  70.  
  71. // bosses
  72. Skip when FileName.startsWith("boss_"),
  73.  
  74. // ability fields with weird names:
  75. // abaddon_borrowed_time heal
  76. Skip when FileName.startsWith("abaddon_borrowed_time") and KeyName.is("redirect"),
  77. // alchemist_unstable_concoction when explosion happens
  78. Skip when FileName.startsWith("alchemist_unstable_concoction") and KeyName.is("brew_explosion"),
  79. // antimage damages per mana burnt or lost + resistance
  80. Skip when FileName.startsWith("antimage_") and (KeyName.is("damage_per_burn") or KeyName.is("mana_void_damage_per_mana") or KeyName.is("spell_shield_resistance")),
  81. // beastmaster_hawk_invisibility fade
  82. Skip when FileName.startsWith("beastmaster_hawk_invisibility") and KeyName.is("fade_tooltip"),
  83. // beastmaster_wild_axes damage amplification and spread
  84. Skip when FileName.startsWith("beastmaster_wild_axes") and (KeyName.is("apread") or KeyName.is("damage_amp")),
  85. // brewmaster_drunken_brawler cooldown
  86. Skip when FileName.startsWith("brewmaster_drunken_brawler") and KeyName.is("last_proc"),
  87. // centaur_stampede damage multiplier
  88. Skip when FileName.startsWith("centaur_stampede") and KeyName.is("strength_damage"),
  89. // chaos_knight_chaos_strike crit
  90. Skip when FileName.startsWith("chaos_knight_chaos_strike") and KeyName.is("lifesteal"),
  91. // chaos_knight_phantasm damage dealt or gained, and images count
  92. Skip when FileName.startsWith("chaos_knight_phantasm") and KeyName.contains("damage"),
  93. // chen_hand_of_god creep counts
  94. Ease(0.33) when FileName.startsWith("chen_hand_of_god") and KeyName.is("ancient_creeps_scepter"),
  95. Ease(0.33) when FileName.startsWith("chen_holy_persuasion") and KeyName.is("max_units"),
  96. // chen_penitence bonus damage
  97. Skip when FileName.startsWith("chen_penitence") and KeyName.is("bonus_damage_taken"),
  98. // crystal_maiden_freezing_field when it's hard to type "distance"
  99. Skip when FileName.startsWith("crystal_maiden_freezing_field") and KeyName.endsWith("dist"),
  100. // dark_seer_wall_of_replica illusion damages
  101. Skip when FileName.startsWith("dark_seer_wall_of_replica") and (KeyName.contains("damage") or KeyName.contains("tooltip_outgoing")),
  102. // dark_willow_bedlam and dark_willow_terrorize: did you know these fields even exist?
  103. Skip when FileName.startsWith("dark_willow_bedlam") and (KeyName.is("attack_targets") or KeyName.is("roaming_seconds_per_rotation")),
  104. // death_prophet_exorcism spirit count
  105. Ease(0.2) when FileName.startsWith("death_prophet_exorcism") and KeyName.is("spirits"),
  106. // disruptor_ pulses and strikes count
  107. Skip when FileName.startsWith("disruptor_") and (KeyName.contains("pulses") or KeyName.contains("strikes")),
  108. // earth_spirit_geomagnetic_grip speed
  109. Skip when FileName.startsWith("earth_spirit_geomagnetic_grip") and KeyName.contains("pull_units_per_second"),
  110. // elder_titan_earth_splitter steps?
  111. Skip when FileName.startsWith("elder_titan_earth_splitter") and KeyName.is("total_steps"),
  112. // electrician mana cost and break has no percents in name
  113. Skip when FileName.startsWith("electrician_") and (KeyName.is("mana_cost") or KeyName.is("mana_break")),
  114. // ember_spirit_sleight_of_fist creep damage reduction
  115. Skip when FileName.startsWith("ember_spirit_sleight_of_fist") and KeyName.is("creep_damage_penalty"),
  116. // furion_force_of_nature count
  117. Ease(0.33) when FileName.startsWith("furion_force_of_nature") and KeyName.is("max_treants"),
  118. // furion_wrath_of_nature jumps and debuff duration
  119. Skip when FileName.startsWith("furion_wrath_of_nature") and (KeyName.is("max_targets") or KeyName.contains("buffer")),
  120. // gyrocopter_flak_cannon attacks count
  121. Skip when FileName.startsWith("gyrocopter_flak_cannon") and KeyName.is("max_attacks"),
  122. // gyrocopter_homing_missile hits count and acceleration
  123. Skip when FileName.startsWith("gyrocopter_homing_missile") and (KeyName.is("acceleration") or KeyName.contains("hits_to_kill")),
  124. // gyrocopter_rocket_barrage count
  125. Skip when FileName.startsWith("gyrocopter_rocket_barrage") and KeyName.is("rockets_per_second"),
  126. // huskar_berserkers_blood threshold
  127. Skip when FileName.startsWith("huskar_berserkers_blood") and KeyName.is("hp_threshold_max"),
  128. // huskar_inner_vitality heal per attribute
  129. Skip when FileName.startsWith("huskar_inner_vitality") and KeyName.contains("bonus"),
  130. // huskar_life_break percentage damage
  131. Skip when FileName.startsWith("huskar_life_break"),
  132. // invoker_ice_wall count and spacing
  133. Skip when FileName.startsWith("invoker_ice_wall") and KeyName.contains("wall_element"),
  134. // invoker_invoke spell count
  135. Skip when FileName.startsWith("invoker_invoke") and KeyName.is("max_invoked_spells"),
  136. // necronomicon_archer_aoe ms and as bonuses
  137. Skip when FileName.startsWith("necronomicon_archer_aoe") and (KeyName.is("ms_bonus") or KeyName.is("as_bonus")),
  138. // necronomicon_archer_mana_burn tooltip
  139. Skip when FileName.startsWith("necronomicon_archer_mana_burn") and KeyName.is("burn_as_damage_tooltip"),
  140. // juggernaut_blade_fury tick
  141. Skip when FileName.startsWith("juggernaut_blade_fury") and KeyName.is("blade_fury_damage_tick"),
  142. // juggernaut_healing_ward heal
  143. Skip when FileName.startsWith("juggernaut_healing_ward") and KeyName.is("healing_ward_heal_amount"),
  144. // juggernaut_omni_slash jumps count and tick
  145. Skip when FileName.startsWith("juggernaut_omni_slash") and (KeyName.is("omni_slash_bounce_tick") or KeyName.contains("jumps")),
  146. // kunkka_ghostship absorb
  147. Skip when FileName.startsWith("kunkka_ghostship") and KeyName.is("ghostship_absorb"),
  148. // kunkka_tidebringer absorb
  149. Skip when FileName.startsWith("kunkka_tidebringer") and KeyName.is("cleave_damage"),
  150. // leshrac_diabolic_edict counts and bonus
  151. Skip when FileName.startsWith("leshrac_diabolic_edict") and (KeyName.is("num_explosions") or KeyName.is("tower_bonus")),
  152. // leshrac_pulse_nova mana cost
  153. Skip when FileName.startsWith("leshrac_pulse_nova") and KeyName.is("mana_cost_per_second"),
  154. // lich_chain_frost jumps
  155. Skip when FileName.startsWith("lich_chain_frost") and KeyName.is("jumps"),
  156.  
  157. // multiply by default
  158. Always perform Multiply()
  159. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement