You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
autohero/backend/migrations/000011_armor_base_tighten.sql

22 lines
657 B
SQL

-- Slightly lower armor bases so end-of-fight hero HP% stays within gear-check (75% cap) when
-- Legendary primary is +40% vs Common; weapon primaries unchanged.
UPDATE public.armor SET defense = CASE type
WHEN 'light' THEN 2
WHEN 'medium' THEN 4
WHEN 'heavy' THEN 10
END;
UPDATE public.gear AS g
SET
base_primary = a.defense,
primary_stat = ROUND(a.defense * CASE a.rarity
WHEN 'common' THEN 1.0
WHEN 'uncommon' THEN 1.0877573
WHEN 'rare' THEN 1.1832160
WHEN 'epic' THEN 1.2870518
WHEN 'legendary' THEN 1.40
END)::integer
FROM public.armor AS a
WHERE g.slot = 'chest'
AND g.name = a.name;