local mod = get_mod("DisableScreenEffects")
local MoodSettings = require("scripts/settings/camera/mood/mood_settings")
local mood_types = MoodSettings.mood_types

local BuffTemplates = require("scripts/settings/buff/buff_templates")

mod.screenspace_effects = {
	"corruptor_ambience",
	"content/fx/particles/screenspace/screen_stunned_light",
	"content/fx/particles/screenspace/screen_stunned_heavy",
	"content/fx/particles/screenspace/screen_blood_splatter",
}

local localization_for_generated_effects = {
	psyker_empowered_grenades_passive_visual_buff_increased = "灵能者楔石「" .. Localize("loc_talent_psyker_empowered_ability") .. "」闪击被动增益提升",
	zealot_channel_toughness_damage_reduction = "狂信徒主动技能「" .. Localize("loc_talent_zealot_bolstering_prayer") .. "」韧性伤害减免",
	beast_of_nurgle_in_slime = "在纳垢兽黏液中",
	in_toxic_gas = "在剧毒气体中",
	chaos_beast_of_nurgle_being_eaten = "被纳垢兽吞噬",
	in_smoke_fog = "在烟雾中",
	chaos_beast_of_nurgle_hit_by_vomit = "被纳垢兽呕吐",
	veteran_allies_kills_damage_buff = "老兵被动「" .. Localize("loc_talent_veteran_ally_kills_increase_damage") .. "」队友杀敌伤害增益",
	zealot_invisibility = "狂信徒隐身",
	zealot_preacher_ally_defensive_buff = "狂信徒被动「" .. Localize("loc_talent_zealot_3_tier_4_ability_3") .. "」队友减伤增益",
	zealot_dash_buff = "狂信徒冲锋增益",
	zealot_fanatic_rage_major = "狂信徒楔石修正「" .. Localize("loc_talent_zealot_shared_fanatic_rage") .. "」增益（强）",
	zealot_fanatic_rage_minor = "狂信徒楔石修正「" .. Localize("loc_talent_zealot_shared_fanatic_rage") .. "」增益（弱）",
	zealot_invisibility_increased_duration = "狂信徒隐身持续时间提升",
	psyker_empowered_grenades_passive_visual_buff = "灵能者楔石「" .. Localize("loc_talent_psyker_empowered_ability") .. "」闪击被动增益",
	psyker_overcharge_stance_damage = "灵能者主动技能「" .. Localize("loc_talent_psyker_combat_ability_overcharge_stance") .. "」伤害",
	veteran_improved_tag_effect = "老兵楔石「" .. Localize("loc_talent_veteran_improved_tag") .. "」效果",
	veteran_combat_ability_stance_master = "老兵主动技能「" .. Localize("loc_talent_veteran_2_combat_ability") .. "/" .. Localize("loc_talent_veteran_combat_ability_elite_and_special_outlines") .. "」增益",
	veteran_snipers_focus_effect = "老兵楔石「" .. Localize("loc_talent_veteran_snipers_focus") .. "」效果",
	netted_damage_tick = "被网住持续伤害",
	veteran_invisibility = "老兵隐身",
	psyker_overcharge_stance = "灵能者主动技能「" .. Localize("loc_talent_psyker_combat_ability_overcharge_stance") .. "」",
	psyker_overcharge_stance_finesse_damage = "灵能者主动技能「" .. Localize("loc_talent_psyker_combat_ability_overcharge_stance") .. "」灵巧伤害",
	psyker_force_field_buff = "灵能者主动技能「" .. Localize("loc_talent_psyker_combat_ability_shield") .. "」增益",
	zealot_fanatic_rage_buff = "狂信徒楔石「" .. Localize("loc_talent_zealot_fanatic_rage") .. "」增益",
	left_toxic_gas = "离开剧毒气体",
	psyker_efficient_smites = "灵能者闪击「" .. Localize("loc_talent_psyker_brain_burst_improved") .. "」加速",
	ogryn_combat_ability_charge = "欧格林主动技能冲刺",
	damage_taken = "受到伤害",
	corruption = "腐化",
	suppression_high = "压制（高）",
	toughness_broken = "失去韧性",
	suppression_low = "压制（低）",
	zealot_combat_ability_dash = "狂信徒主动技能冲锋",
	knocked_down = "被击倒",
	veteran_stealth_and_stance = "老兵潜行和远程姿态",
	veteran_combat_ability_stance = "老兵主动技能「" .. Localize("loc_talent_veteran_2_combat_ability") .. "/" .. Localize("loc_talent_veteran_combat_ability_elite_and_special_outlines") .. "」",
	stealth = "潜行",
	corruptor_proximity = "接近腐化物",
	toughness_absorbed = "吸收韧性",
	toughness_absorbed_melee = "吸收韧性（近战）",
	warped_low_to_high = "危机值（从低到高）",
	veteran_stealth = "老兵潜行姿态",
	last_wound = "最后一个生命格",
	psyker_combat_ability_shout = "灵能者主动技能「" .. Localize("loc_talent_psyker_2_combat") .. "/" .. Localize("loc_talent_psyker_shout_vent_warp_charge") .. "」",
	no_toughness = "无韧性",
	ogryn_combat_ability_stance = "欧格林主动技能远程姿态",
	ogryn_combat_ability_shout = "欧格林主动技能嘲讽",
	warped_critical = "临界危机值",
	suppression_ongoing = "压制（提升）",
	corruption_taken = "受到腐化",
	critical_health = "临界生命值",
	in_twin_toxic_gas = "在双胞胎剧毒气体中",
	in_buildup_twin_toxic_gas = "在组队双胞胎剧毒气体中",
	in_cultist_grenadier_gas = "在渣滓轰炸者气体中",
	syringe_speed = "敏捷兴奋剂",
	syringe_power = "作战兴奋剂",
	syringe_ability = "专注兴奋剂",
	cm_habs_tree_in_slime = "在德雷克居住区的纳垢兽黏液中",
}

local function localize_generated_effects(name)
	if localization_for_generated_effects[name] ~= nil then
		return localization_for_generated_effects[name]
	end
	return string.gsub(name, "_", " ")
end

local function localize(name)
	return {
		en = string.format("Disable %s", string.gsub(name, "_", " ")),
		["zh-cn"] = string.format("禁用效果：%s", localize_generated_effects(name)),
		ru = string.format("Отключение %s", string.gsub(name, "_", " ")),
	}
end

local localization = {
	mod_name = {
		en = "Disable Screen Effects",
		["zh-cn"] = "禁用屏幕特效",
		ru = "Отключение экранных эффектов",
	},
	mod_description = {
		en = "Makes all screen effects toggleable",
		["zh-cn"] = "允许开关所有屏幕特效",
		ru = "Позволяет переключать видимость экранных эффектов",
	},
	disable_plasmagun = {
		en = "Disable plasmagun overheat",
		["zh-cn"] = "禁用等离子枪过热效果",
		ru = "Отключение перегрева плазмомёта",
	},
	chaos_daemonhost_ambience = {
		en = "Disable Daemonhost effects",
		["zh-cn"] = "禁用恶魔宿主效果",
		ru = "Отключение эффекта от Демонхоста",
	},
	[mod.screenspace_effects[4]] = {
		en = "Disable corruptor effects",
		["zh-cn"] = "禁用腐化效果",
		ru = "Отключение эффекта порчи",
	},
	[mod.screenspace_effects[1]] = {
		en = "Disable player stun distortion light",
		["zh-cn"] = "禁用玩家轻度眩晕效果",
		ru = "Отключение искажения света при оглушении игрока",
	},
	[mod.screenspace_effects[2]] = {
		en = "Disable player stun distortion heavy",
		["zh-cn"] = "禁用玩家重度眩晕效果",
		ru = "Отключение сильного искажения при оглушении игрока",
	},
	[mod.screenspace_effects[3]] = {
		en = "Disable blood splatter",
		["zh-cn"] = "禁用血液飞溅",
		ru = "Отключение брызг крови",
	},
}

for buff_name, template in pairs(BuffTemplates) do
	if template.player_effects then
		localization[buff_name] = localize(buff_name)
	end
end

for mood_type, _ in pairs(mood_types) do
	localization[mood_type] = localize(mood_type)
end

return localization
