Skip to content

Commit

Permalink
Change numbers in farming cave to be more sane (#574)
Browse files Browse the repository at this point in the history
* Change numbers in farming cave to be more sane

* Add magic resistance to farming cave
  • Loading branch information
chrisinajar authored Apr 16, 2017
1 parent 4453d22 commit 1ae6985
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 59 deletions.
5 changes: 5 additions & 0 deletions game/scripts/vscripts/components/cave/cave.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ function CaveHandler:GetCreepProperties (creep, multiplier, k)
armour = round(multiplier.armour(k) * creep[5]),
gold = round(multiplier.gold(k) * creep[6]),
exp = round(multiplier.exp(k) * creep[7]),
magicResist = round(multiplier.magicResist(k) * creep[8]),
}
end

Expand Down Expand Up @@ -118,6 +119,10 @@ function CaveHandler:SpawnCreepInRoom (room, properties, lastRoom)
creep:SetMinimumGoldBounty(properties.gold)
creep:SetMaximumGoldBounty(properties.gold)

if properties.magicResist ~= nil then
creep:SetBaseMagicalResistanceValue(properties.magicResist)
end

--EXP BOUNTY
local minutes = math.floor(GameRules:GetGameTime() / 60)
if minutes > 60 then
Expand Down
131 changes: 72 additions & 59 deletions game/scripts/vscripts/components/cave/cave_types.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@

function MakeKFunctionForIndexPowerOffset (index, power, offset)
return function (k)
return CreepPower:GetPowerForMinute(k * power + offset)[index]
end
end

local BaseCreepPowerMultiplier = 12
local BaseCreepXPGOLDMultiplier = 8

local BaseMultipliers = {
-- CreepPower:GetPowerForMinute

Expand All @@ -9,99 +18,103 @@ local BaseMultipliers = {
-- minute ^ 0.5, -- armor
-- (minute / 2) + 1, -- gold
-- ((21 * minute^2 - 19 * minute + 3002) / 3002) * self.numPlayersXPFactor * multFactor -- xp
mana = function (k) return CreepPower:GetPowerForMinute(k * 8)[3] end,
hp = function (k) return CreepPower:GetPowerForMinute(k * 8)[2] end,
damage = function (k) return CreepPower:GetPowerForMinute(k * 8)[4] end,
armour = function (k) return CreepPower:GetPowerForMinute(k * 8)[5] end,
gold = function (k) return CreepPower:GetPowerForMinute(k * 8)[5] end,
exp = function (k) return CreepPower:GetPowerForMinute(k * 8)[6] end
mana = partial(MakeKFunctionForIndexPowerOffset, 3),
hp = partial(MakeKFunctionForIndexPowerOffset, 2),
damage = partial(MakeKFunctionForIndexPowerOffset, 4),
armour = partial(MakeKFunctionForIndexPowerOffset, 5),
gold = partial(MakeKFunctionForIndexPowerOffset, 5),
exp = partial(MakeKFunctionForIndexPowerOffset, 6)
}

-- "creep name", Health, Mana, Damage, Armor, Gold Bounty, Exp Bounty
CaveTypes = {
[1] = { -- 1 "Howl's it Going?"
{ --HP MANA DMG ARM GOLD EXP
units = {
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 0, 28, 120},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
{"npc_dota_neutral_alpha_wolf", 240, 0, 33, 1, 19, 60, 10},
},
multiplier = {
mana = BaseMultipliers.mana, -- function (k) return 1 end,
hp = BaseMultipliers.hp, -- function (k) return 1 end,
damage = BaseMultipliers.damage, -- function (k) return 1 end,
armour = BaseMultipliers.armour, -- function (k) return 1 end,
gold = BaseMultipliers.gold, -- function (k) return (16 * k + 9) / 9 end,
exp = BaseMultipliers.exp, -- function (k) return (168 * k^2 + 2 * k + 15) / 15 end,
mana = BaseMultipliers.mana(BaseCreepPowerMultiplier, 0), -- function (k) return 1 end,
hp = BaseMultipliers.hp(BaseCreepPowerMultiplier, 0), -- function (k) return 1 end,
damage = BaseMultipliers.damage(BaseCreepPowerMultiplier, 0), -- function (k) return 1 end,
armour = BaseMultipliers.armour(BaseCreepPowerMultiplier, 0), -- function (k) return 1 end,
gold = BaseMultipliers.gold(BaseCreepXPGOLDMultiplier, 0), -- function (k) return (16 * k + 9) / 9 end,
exp = BaseMultipliers.exp(BaseCreepXPGOLDMultiplier, 0), -- function (k) return (168 * k^2 + 2 * k + 15) / 15 end,
magicResist = function(k) return 1 end,
}
}
},
[2] = { -- 2 "Horse Tomatina"
{ --HP MANA DMG ARM GOLD EXP
units = {
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 0, 68.4, 123.5},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_polar_furbolg_ursa_warrior", 950, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 1, 19, 60, 30},
{"npc_dota_neutral_centaur_khan", 1100, 0, 55, 1, 19, 60, 30},
},
multiplier = {
mana = BaseMultipliers.mana, -- function (k) return 1 end,
hp = BaseMultipliers.hp, -- function (k) return 1 end,
damage = BaseMultipliers.damage, -- function (k) return 1 end,
armour = BaseMultipliers.armour, -- function (k) return 1 end,
gold = BaseMultipliers.gold, -- function (k) return (16 * k + 9) / 9 end,
exp = BaseMultipliers.exp, -- function (k) return (84 * k^2 + 43 * k + 13) / 13 end,
mana = BaseMultipliers.mana(BaseCreepPowerMultiplier, 2), -- function (k) return 1 end,
hp = BaseMultipliers.hp(BaseCreepPowerMultiplier, 2), -- function (k) return 1 end,
damage = BaseMultipliers.damage(BaseCreepPowerMultiplier, 2), -- function (k) return 1 end,
armour = BaseMultipliers.armour(BaseCreepPowerMultiplier, 2), -- function (k) return 1 end,
gold = BaseMultipliers.gold(BaseCreepXPGOLDMultiplier, 2), -- function (k) return (16 * k + 9) / 9 end,
exp = BaseMultipliers.exp(BaseCreepXPGOLDMultiplier, 2), -- function (k) return (84 * k^2 + 43 * k + 13) / 13 end,
magicResist = function(k) return 1 end,
}
}
},
[3] = { -- 3 "Draggin' it Around"
{ --HP MANA DMG ARM GOLD EXP
units = {
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 950, 0, 45, -1, 136.5, 167.25},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
{"npc_dota_neutral_black_drake", 1600, 0, 65, 1, 24, 75, 50},
},
multiplier = {
mana = BaseMultipliers.mana, -- function (k) return 1 end,
hp = BaseMultipliers.hp, -- function (k) return 1 end,
damage = BaseMultipliers.damage, -- function (k) return 1 end,
armour = BaseMultipliers.armour, -- function (k) return 1 end,
gold = BaseMultipliers.gold, -- function (k) return (16 * k + 13) / 13 end,
exp = BaseMultipliers.exp, -- function (k) return (84 * k^2 + 85 * k + 29) / 29 end,
mana = BaseMultipliers.mana(BaseCreepPowerMultiplier, 4), -- function (k) return 1 end,
hp = BaseMultipliers.hp(BaseCreepPowerMultiplier, 4), -- function (k) return 1 end,
damage = BaseMultipliers.damage(BaseCreepPowerMultiplier, 4), -- function (k) return 1 end,
armour = BaseMultipliers.armour(BaseCreepPowerMultiplier, 4), -- function (k) return 1 end,
gold = BaseMultipliers.gold(BaseCreepXPGOLDMultiplier, 4), -- function (k) return (16 * k + 13) / 13 end,
exp = BaseMultipliers.exp(BaseCreepXPGOLDMultiplier, 4), -- function (k) return (84 * k^2 + 85 * k + 29) / 29 end,
magicResist = function(k) return 1 end,
}
}
},
[4] = { -- 4 "Roashes Everywhere"
{ --HP MANA DMG ARM GOLD EXP
units = {
{"npc_dota_mini_roshan", 5500, 0, 65, 15, 646, 753.5},
{"npc_dota_mini_roshan", 5500, 0, 65, 15, 646, 753.5},
{"npc_dota_mini_roshan", 5500, 0, 65, 15, 95, 300, 70},
{"npc_dota_mini_roshan", 5500, 0, 65, 15, 95, 300, 70},
},
multiplier = {
mana = BaseMultipliers.mana, -- function (k) return 1 end,
hp = BaseMultipliers.hp, -- function (k) return 1 end,
damage = BaseMultipliers.damage, -- function (k) return 1 end,
armour = BaseMultipliers.armour, -- function (k) return 1 end,
mana = BaseMultipliers.mana(BaseCreepPowerMultiplier, 6), -- function (k) return 1 end,
hp = BaseMultipliers.hp(BaseCreepPowerMultiplier, 6), -- function (k) return 1 end,
damage = BaseMultipliers.damage(BaseCreepPowerMultiplier, 6), -- function (k) return 1 end,
armour = BaseMultipliers.armour(BaseCreepPowerMultiplier, 6), -- function (k) return 1 end,
gold = function (k) return 0 end,
exp = BaseMultipliers.exp, -- function (k) return (56 * k^2 + 85 * k + 37) / 37 end,
exp = BaseMultipliers.exp(BaseCreepXPGOLDMultiplier, 6), -- function (k) return (56 * k^2 + 85 * k + 37) / 37 end,
magicResist = function(k) return 1 end,
}
}
}
Expand Down

0 comments on commit 1ae6985

Please sign in to comment.