Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Rules are executed from top to bottom for each key-value from a KV file
- // Once some rule is applicable to a key-value, all other rules below it are ignored, the matched rule is applied
- // So it makes sense to place exclusion or the most specific rules at the top, and the "Always" rule at the bottom
- // Rules can be put as "Rule when Condition" or "Condition perform Rule"
- // For example:
- // Multiply when FileName.is("my_file.txt")
- // FileDir("/my-dir") perform Ease(0.5)
- //
- // Conditions may be combined with "and" and "or", rules of parenthesis apply, left-right rule applies ("and" is not stronger than "or")
- // Rules:
- //
- // Skip - does not change the matched key-values
- //
- // Multiply - multiplies by set multiplier (see value above)
- //
- // Ease - multiplies by a fraction of multiplies
- //
- // For example, for multiplier 10.0:
- // Ease(0.5) will multiply by 5.0
- // Ease(0.3) will multiply by 3.0
- //
- // For multiplier 0.5:
- // Ease(0.5) will multiply by 0.75
- // Ease(0.3) will multiply by 0.85
- // Conditions:
- //
- // FileName - the name of the file including "extension", for example, "antimage_blink.txt"
- //
- // FileDir - the path to file starting from source directory, separated with "/"
- // For example, for source dir is "C:/oaa" and file located at "C:/oaa/my-dir/my-file.txt", this property is:
- // "my-dir" - note that there is no leading "/" or file name
- //
- // KeyName - the key in the KV file, for example, "range" or "AbilityManaCost"
- //
- // KvPath - hierarchical path to key excluding the key name itself
- //
- // For example, path to AM Blink range is:
- // DOTAAbilities.antimage_blink.AbilitySpecial.01.blink_range
- //
- // You can have path patterns containing ** or * to replace path parts:
- // * - matches one or more path parts, e.g. "a.b.c" will match "*", "*.c", "*.b.c", "*.a.b.c", "a.*.c"
- // ? - matches exactly one path part, e.g. "a.b.c" will match "?.b.c", "a.?.c", "a.b.?"
- val rules = Seq[RuleWithCondition](
- // special rare cases:
- // when damage is not under AbilitySpecial
- Multiply(forceType = Some(KvType.Integer)) when KeyName.is("AbilityDamage"),
- // chaos_knight_phantasm would not be fun with default illusion count
- Ease(0.33) when FileName.startsWith("chaos_knight_phantasm") and KeyName.is("images_count"),
- // enchantress_impetus distance damage should be increased, otherwise no fun
- Ease(0.33) when FileName.startsWith("enchantress_impetus") and KeyName.is("distance_damage_pct"),
- // skip all numbers that are not in AbilitySpecial
- Skip when KvPath.doesNotMatch("*.AbilitySpecial.*"),
- // percents, chances, ranges, speeds, etc.
- Skip when KeyName.contains("percent") or KeyName.contains("pct") or KeyName.contains("chance") or KeyName.contains("conversion"),
- Skip when KeyName.contains("crit"),
- Skip when KeyName.contains("multiplier") or KeyName.contains("reduction") or KeyName.contains("resistance"),
- Skip when KeyName.contains("range") or KeyName.contains("radius") or KeyName.contains("distance") or KeyName.contains("aoe") or KeyName.contains("area_of_effect"),
- Skip when KeyName.contains("cooldown"),
- Skip when KeyName.contains("duration") or KeyName.contains("stun"),
- Skip when KeyName.contains("rate") or KeyName.contains("delay") or KeyName.contains("interval") or KeyName.contains("time"),
- Skip when KeyName.contains("speed") or KeyName.contains("slow"),
- Skip when KeyName.contains("angle"),
- Skip when KeyName.contains("vision"),
- Skip when KeyName.contains("count") or KeyName.contains("charges"),
- Ease(0.2) when (KeyName.contains("height") or KeyName.contains("width")),
- // bosses
- Skip when FileName.startsWith("boss_"),
- // ability fields with weird names:
- // abaddon_borrowed_time heal
- Skip when FileName.startsWith("abaddon_borrowed_time") and KeyName.is("redirect"),
- // alchemist_unstable_concoction when explosion happens
- Skip when FileName.startsWith("alchemist_unstable_concoction") and KeyName.is("brew_explosion"),
- // antimage damages per mana burnt or lost + resistance
- 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")),
- // beastmaster_hawk_invisibility fade
- Skip when FileName.startsWith("beastmaster_hawk_invisibility") and KeyName.is("fade_tooltip"),
- // beastmaster_wild_axes damage amplification and spread
- Skip when FileName.startsWith("beastmaster_wild_axes") and (KeyName.is("apread") or KeyName.is("damage_amp")),
- // brewmaster_drunken_brawler cooldown
- Skip when FileName.startsWith("brewmaster_drunken_brawler") and KeyName.is("last_proc"),
- // centaur_stampede damage multiplier
- Skip when FileName.startsWith("centaur_stampede") and KeyName.is("strength_damage"),
- // chaos_knight_chaos_strike crit
- Skip when FileName.startsWith("chaos_knight_chaos_strike") and KeyName.is("lifesteal"),
- // chaos_knight_phantasm damage dealt or gained, and images count
- Skip when FileName.startsWith("chaos_knight_phantasm") and KeyName.contains("damage"),
- // chen_hand_of_god creep counts
- Ease(0.33) when FileName.startsWith("chen_hand_of_god") and KeyName.is("ancient_creeps_scepter"),
- Ease(0.33) when FileName.startsWith("chen_holy_persuasion") and KeyName.is("max_units"),
- // chen_penitence bonus damage
- Skip when FileName.startsWith("chen_penitence") and KeyName.is("bonus_damage_taken"),
- // crystal_maiden_freezing_field when it's hard to type "distance"
- Skip when FileName.startsWith("crystal_maiden_freezing_field") and KeyName.endsWith("dist"),
- // dark_seer_wall_of_replica illusion damages
- Skip when FileName.startsWith("dark_seer_wall_of_replica") and (KeyName.contains("damage") or KeyName.contains("tooltip_outgoing")),
- // dark_willow_bedlam and dark_willow_terrorize: did you know these fields even exist?
- Skip when FileName.startsWith("dark_willow_bedlam") and (KeyName.is("attack_targets") or KeyName.is("roaming_seconds_per_rotation")),
- // death_prophet_exorcism spirit count
- Ease(0.2) when FileName.startsWith("death_prophet_exorcism") and KeyName.is("spirits"),
- // disruptor_ pulses and strikes count
- Skip when FileName.startsWith("disruptor_") and (KeyName.contains("pulses") or KeyName.contains("strikes")),
- // earth_spirit_geomagnetic_grip speed
- Skip when FileName.startsWith("earth_spirit_geomagnetic_grip") and KeyName.contains("pull_units_per_second"),
- // elder_titan_earth_splitter steps?
- Skip when FileName.startsWith("elder_titan_earth_splitter") and KeyName.is("total_steps"),
- // electrician mana cost and break has no percents in name
- Skip when FileName.startsWith("electrician_") and (KeyName.is("mana_cost") or KeyName.is("mana_break")),
- // ember_spirit_sleight_of_fist creep damage reduction
- Skip when FileName.startsWith("ember_spirit_sleight_of_fist") and KeyName.is("creep_damage_penalty"),
- // furion_force_of_nature count
- Ease(0.33) when FileName.startsWith("furion_force_of_nature") and KeyName.is("max_treants"),
- // furion_wrath_of_nature jumps and debuff duration
- Skip when FileName.startsWith("furion_wrath_of_nature") and (KeyName.is("max_targets") or KeyName.contains("buffer")),
- // gyrocopter_flak_cannon attacks count
- Skip when FileName.startsWith("gyrocopter_flak_cannon") and KeyName.is("max_attacks"),
- // gyrocopter_homing_missile hits count and acceleration
- Skip when FileName.startsWith("gyrocopter_homing_missile") and (KeyName.is("acceleration") or KeyName.contains("hits_to_kill")),
- // gyrocopter_rocket_barrage count
- Skip when FileName.startsWith("gyrocopter_rocket_barrage") and KeyName.is("rockets_per_second"),
- // huskar_berserkers_blood threshold
- Skip when FileName.startsWith("huskar_berserkers_blood") and KeyName.is("hp_threshold_max"),
- // huskar_inner_vitality heal per attribute
- Skip when FileName.startsWith("huskar_inner_vitality") and KeyName.contains("bonus"),
- // huskar_life_break percentage damage
- Skip when FileName.startsWith("huskar_life_break"),
- // invoker_ice_wall count and spacing
- Skip when FileName.startsWith("invoker_ice_wall") and KeyName.contains("wall_element"),
- // invoker_invoke spell count
- Skip when FileName.startsWith("invoker_invoke") and KeyName.is("max_invoked_spells"),
- // necronomicon_archer_aoe ms and as bonuses
- Skip when FileName.startsWith("necronomicon_archer_aoe") and (KeyName.is("ms_bonus") or KeyName.is("as_bonus")),
- // necronomicon_archer_mana_burn tooltip
- Skip when FileName.startsWith("necronomicon_archer_mana_burn") and KeyName.is("burn_as_damage_tooltip"),
- // juggernaut_blade_fury tick
- Skip when FileName.startsWith("juggernaut_blade_fury") and KeyName.is("blade_fury_damage_tick"),
- // juggernaut_healing_ward heal
- Skip when FileName.startsWith("juggernaut_healing_ward") and KeyName.is("healing_ward_heal_amount"),
- // juggernaut_omni_slash jumps count and tick
- Skip when FileName.startsWith("juggernaut_omni_slash") and (KeyName.is("omni_slash_bounce_tick") or KeyName.contains("jumps")),
- // kunkka_ghostship absorb
- Skip when FileName.startsWith("kunkka_ghostship") and KeyName.is("ghostship_absorb"),
- // kunkka_tidebringer absorb
- Skip when FileName.startsWith("kunkka_tidebringer") and KeyName.is("cleave_damage"),
- // leshrac_diabolic_edict counts and bonus
- Skip when FileName.startsWith("leshrac_diabolic_edict") and (KeyName.is("num_explosions") or KeyName.is("tower_bonus")),
- // leshrac_pulse_nova mana cost
- Skip when FileName.startsWith("leshrac_pulse_nova") and KeyName.is("mana_cost_per_second"),
- // lich_chain_frost jumps
- Skip when FileName.startsWith("lich_chain_frost") and KeyName.is("jumps"),
- // multiply by default
- Always perform Multiply()
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement