1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-28 03:57:22 +02:00

rename one punch to aoe punch

This commit is contained in:
Gerkiz 2022-04-05 20:02:13 +02:00
parent 061f6a3d15
commit 29b865fe3b
12 changed files with 90 additions and 101 deletions

View File

@ -2,7 +2,7 @@
no_valid_surface=No surface name given
flame_boots_worn_out=Your flame boots have worn out.
flame_mana_remaining=Mana remaining: __1__
one_punch_text=ONE PUNCH
aoe_punch_text=AOE PUNCH
mana_casting_too_fast=There was a lot more to magic, as __1__ quickly found out, than waving their wand and saying a few funny words.
low_level=You lack the level to cast this spell.
not_inside_pos=You wave your wand but realize that it´s out of reach.
@ -59,8 +59,8 @@ mana_max=This is your max mana. You can increase the regen by increasing your ma
mining_name=MINING\nSPEED
slot_name=SLOT\nBONUS
melee_name=MELEE\nDAMAGE
one_punch_chance=Life on-hit: __1__\nOne punch chance: __2__ % \n+__3__ [img=recipe.defender-capsule]
one_punch_disabled=One Punch is disabled.
aoe_punch_chance=Life on-hit: __1__\nAOE punch chance: __2__ % \n+__3__ [img=recipe.defender-capsule]
aoe_punch_disabled=AOE punch is disabled.
bonus_tooltip=Reach distance bonus: __1__\nBuild distance bonus: __2__\nItem drop distance bonus: __3__\nLoot pickup distance bonus: __4__\nItem pickup distance bonus: __5__\nResource reach distance bonus: __6__\nRepair speed: __7__
reach_distance=REACH\nDISTANCE
crafting_speed=CRAFTING\nSPEED
@ -96,9 +96,9 @@ movement_text_label=Enable movement speed bonus?
movement_text_tooltip=Don´t feeling like running like the flash?\nYou can toggle it here.
stone_path_label=Enable stone-path when mining?
stone_path_tooltip=Enabling this will automatically create stone-path when you mine.
one_punch_label=Enable one-punch?
one_punch_tooltip=Enabling this will have a chance of one-punching biters.\nOne-Punch only works if both ammo AND gun is unequipped.
one_punch_globally=Enabled globally.\nOne-Punch only works if both ammo AND gun is unequipped.
aoe_punch_label=Enable AOE punch?
aoe_punch_tooltip=Enabling this will have a chance of creating a AOE punch against biters.\nAOE-Punch only works if both ammo AND gun is unequipped.
aoe_punch_globally=Enabled globally.\nAOE-Punch only works if both ammo AND gun is unequipped.
flameboots_label=Enable flame boots?
flameboots_tooltip=When the bullets simply don´t bite.
explosive_bullets_label=Enable explosive bullets?

View File

@ -2,7 +2,6 @@
no_valid_surface=Название поверхности не указано
flame_boots_worn_out=Ваши огненные сапоги износились.
flame_mana_remaining=Маны осталось: __1__
one_punch_text=ОДИН УДАР
mana_casting_too_fast=Как быстро выяснил __1__, в магии было гораздо больше, чем просто взмахнуть палочкой и произнести несколько забавных слов.
low_level=Вам не хватает уровня для произнесения этого заклинания.
not_inside_pos=Вы машете палочкой, но понимаете, что это вне досягаемости.
@ -59,8 +58,6 @@ mana_max=Это ваша максимальная мана. Вы можете у
mining_name=СКОРОСТЬ\nДОБЫЧИ
slot_name=БОНУС\nЯЧЕЕК
melee_name=УРОН\nРУКАМИ
one_punch_chance=Жизни за удар: __1__\nШанс "с одного удара": __2__%\n+__3__ [img=recipe.defender-capsule]
one_punch_disabled="С одного удара" отключено.
bonus_tooltip=Бонус дальности досягаемости: __1__\nБонус дистанции строительства: __2__\nБонус дальности выпадения предметов: __3__\nБонус дальности подбора добычи: __4__\nБонус дальности подбора предметов: __5__\nБонус дальности досягаемости ресурсов: __6__\nСкорость ремонта: __7__
reach_distance=РАДИУС\nДЕЙСТВИЙ
crafting_speed=СКОРОСТЬ\nКРАФТА
@ -95,9 +92,6 @@ movement_text_label=Включить бонус скорости передви
movement_text_tooltip=Хотите бегать, как Флэш?\nВы можете переключить это здесь.
stone_path_label=Включить каменную тропу при добыче?
stone_path_tooltip=Включение этого автоматически создаст тропу из камня при добыче.
one_punch_label=Включить "С одного удара"?
one_punch_tooltip=Включив это, вы будете иметь шанс убить кусаку с одного удара.\n"С одного удара" работает только в том случае, если не экипированы и боеприпасы, и оружие.
one_punch_globally=Включить глобально.\n"С одного удара" работает только в том случае, если не экипированы и боеприпасы, и оружие.
flameboots_label=Включить огненные сапоги?
flameboots_tooltip=Когда пуль просто недостаточно.
explosive_bullets_label=Включить разрывные пули?

View File

@ -2,7 +2,7 @@
no_valid_surface=无效图层!
flame_boots_worn_out=你的火焰鞋穿坏了.
flame_mana_remaining=剩余魔法:__1__
one_punch_text=暴击
mana_casting_too_fast= __1__ 魔法还有很多, 像 __2__ 迅速创建出, 然后挥舞着他们的魔杖,说一些难以理解的词.
low_level=等级不够.
not_inside_pos=你挥动你的魔杖, 但意识到它不能达到.
@ -60,8 +60,6 @@ mana_max=这是你的最大魔力值。你可以通过增加你的魔法技能
mining_name=挖掘\n速度
slot_name=背包\n加成
melee_name=近战\n伤害
one_punch_chance=命中生命: __1__\n暴击几率: __2__ %\n +__3__ [img=recipe.defender-capsule]
one_punch_disabled=暴击被禁用
bonus_tooltip=到达距离加成: __1__\n建筑距离加成: __2__\n物品投掷距离加成: __3__\n拾取战利品距离加成: __4__\n物品拾取距离加成: __5__\n资源到达距离加成: __6__\n修理速度: __7__
reach_distance=到达\n距离
crafting_speed=制作\n速度
@ -95,9 +93,6 @@ movement_text_label=启用移动速度加成?
movement_text_tooltip=不想像闪电一样奔跑吗?\n你可以在这里切换。
stone_path_label=采矿时启用石路?
stone_path_tooltip=启用此选项将在您挖掘时,自动铺石砖
one_punch_label=启用暴击?
one_punch_tooltip=启用此选项将有一次击打敌人的机会,不能装备枪和子弹!
one_punch_globally=启用全局。
flameboots_label=启用火焰靴?
flameboots_tooltip=当子弹未击中。
magic_label=启用魔法(通过吃鱼施法)

View File

@ -195,7 +195,7 @@ local function teleport_player_out(arena, player)
local surface = arenatable.previous_position[arena].surface
local position = arenatable.previous_position[arena].position
local rpg = RPG.get('rpg_t')
rpg[player.index].one_punch = true
rpg[player.index].aoe_punch = true
hide_rpg(player, true)
player.teleport(surface.find_non_colliding_position('character', position, 20, 0.5), surface)
arenatable.previous_position[arena].position = nil
@ -212,7 +212,7 @@ local function teleport_player_in(arena, player)
arenatable.previous_position[arena].surface = player.surface
arenatable.timer[arena] = game.tick
local rpg = RPG.get('rpg_t')
rpg[player.index].one_punch = false
rpg[player.index].aoe_punch = false
rpg[player.index].enable_entity_spawn = false
hide_rpg(player, false)

View File

@ -123,7 +123,7 @@ commands.add_command(
commands.add_command(
'disable_biters',
'Usable only for admins - sets the queue speed of this map!',
'Usable only for admins - disables wave defense!',
function()
local player = game.player

View File

@ -174,8 +174,8 @@ function Public.reset_map()
RPG.enable_flame_boots(true)
RPG.personal_tax_rate(0.4)
RPG.enable_stone_path(true)
RPG.enable_one_punch(true)
RPG.enable_one_punch_globally(false)
RPG.enable_aoe_punch(true)
RPG.enable_aoe_punch_globally(false)
RPG.enable_range_buffs(true)
RPG.enable_auto_allocate(true)
RPG.disable_cooldowns_on_spells()

View File

@ -171,7 +171,7 @@ if _DEBUG then
)
commands.add_command(
'rpg_debug_one_punch',
'rpg_debug_aoe_punch',
'',
function()
local player = game.player
@ -184,7 +184,7 @@ if _DEBUG then
return
end
Public.toggle_debug_one_punch()
Public.toggle_debug_aoe_punch()
end
)
@ -212,7 +212,7 @@ if _DEBUG then
data[k].mana = 50000
data[k].mana_max = 50000
data[k].debug_mode = true
data[k].one_punch = true
data[k].aoe_punch = true
data[k].stone_path = true
data[k].strength = 3000
data[k].vitality = 3000

View File

@ -119,12 +119,12 @@ local function level_up(player)
return
end
-- automatically enable one_punch and stone_path,
-- automatically enable aoe_punch and stone_path,
-- but do so only once.
if rpg_t.level >= settings_level['one_punch_label'] then
if not rpg_t.auto_toggle_features.one_punch then
rpg_t.auto_toggle_features.one_punch = true
rpg_t.one_punch = true
if rpg_t.level >= settings_level['aoe_punch_label'] then
if not rpg_t.auto_toggle_features.aoe_punch then
rpg_t.auto_toggle_features.aoe_punch = true
rpg_t.aoe_punch = true
end
end
if rpg_t.level >= settings_level['stone_path_label'] then
@ -694,7 +694,7 @@ function Public.get_life_on_hit(player)
return (rpg_t.vitality - 10) * 0.4
end
function Public.get_one_punch_chance(player)
function Public.get_aoe_punch_chance(player)
local rpg_t = Public.get_value_from_player(player.index)
if rpg_t.strength < 100 then
return 0
@ -782,10 +782,10 @@ function Public.rpg_reset_player(player, one_time_reset)
last_mined_entity_position = {x = 0, y = 0},
show_bars = false,
stone_path = false,
one_punch = false,
aoe_punch = false,
auto_toggle_features = {
stone_path = false,
one_punch = false
aoe_punch = false
}
}
)
@ -824,10 +824,10 @@ function Public.rpg_reset_player(player, one_time_reset)
last_mined_entity_position = {x = 0, y = 0},
show_bars = false,
stone_path = false,
one_punch = false,
aoe_punch = false,
auto_toggle_features = {
stone_path = false,
one_punch = false
aoe_punch = false
}
}
)

View File

@ -314,15 +314,15 @@ local function draw_main_frame(player, location)
add_gui_description(right_bottom_table, ({'rpg_gui.melee_name'}), w1)
local melee_damage_value = round(100 * (1 + Public.get_melee_modifier(player))) .. '%'
local melee_damage_tooltip
if rpg_extra.enable_one_punch then
if rpg_extra.enable_aoe_punch then
melee_damage_tooltip = ({
'rpg_gui.one_punch_chance',
'rpg_gui.aoe_punch_chance',
Public.get_life_on_hit(player),
Public.get_one_punch_chance(player),
Public.get_aoe_punch_chance(player),
Public.get_extra_following_robots(player)
})
else
melee_damage_tooltip = ({'rpg_gui.one_punch_disabled'})
melee_damage_tooltip = ({'rpg_gui.aoe_punch_disabled'})
end
add_gui_stat(right_bottom_table, melee_damage_value, w2, melee_damage_tooltip)
@ -505,7 +505,7 @@ Gui.on_click(
local explosive_bullets_gui_input = data.explosive_bullets_gui_input
local enable_entity_gui_input = data.enable_entity_gui_input
local stone_path_gui_input = data.stone_path_gui_input
local one_punch_gui_input = data.one_punch_gui_input
local aoe_punch_gui_input = data.aoe_punch_gui_input
local auto_allocate_gui_input = data.auto_allocate_gui_input
local rpg_t = Public.get_value_from_player(player.index)
@ -515,11 +515,11 @@ Gui.on_click(
rpg_t.allocate_index = auto_allocate_gui_input.selected_index
end
if one_punch_gui_input and one_punch_gui_input.valid then
if not one_punch_gui_input.state then
rpg_t.one_punch = false
elseif one_punch_gui_input.state then
rpg_t.one_punch = true
if aoe_punch_gui_input and aoe_punch_gui_input.valid then
if not aoe_punch_gui_input.state then
rpg_t.aoe_punch = false
elseif aoe_punch_gui_input.state then
rpg_t.aoe_punch = true
end
end

View File

@ -26,8 +26,8 @@ local random = math.random
local sqrt = math.sqrt
local abs = math.abs
local function log_one_punch(callback)
local debug = Public.get('rpg_extra').debug_one_punch
local function log_aoe_punch(callback)
local debug = Public.get('rpg_extra').debug_aoe_punch
if not debug then
return
end
@ -541,7 +541,7 @@ local function set_health_boost(entity, damage, cause)
end
--Melee damage modifier
local function one_punch(character, target, damage, get_health_pool)
local function aoe_punch(character, target, damage, get_health_pool)
if not (target and target.valid) then
return
end
@ -556,7 +556,7 @@ local function one_punch(character, target, damage, get_health_pool)
{
name = 'flying-text',
position = {character.position.x + base_vector[1] * 0.5, character.position.y + base_vector[2] * 0.5},
text = ({'rpg_main.one_punch_text'}),
text = ({'rpg_main.aoe_punch_text'}),
color = {255, 0, 0}
}
)
@ -727,7 +727,7 @@ local function on_entity_damaged(event)
--Calculate modified damage.
local damage = Public.get_final_damage(cause.player, entity, original_damage_amount)
local enable_one_punch = Public.get('rpg_extra').enable_one_punch
local enable_aoe_punch = Public.get('rpg_extra').enable_aoe_punch
local rpg_t = Public.get_value_from_player(cause.player.index)
--Floating messages and particle effects.
@ -758,12 +758,12 @@ local function on_entity_damaged(event)
local get_health_pool = has_health_boost(entity, damage, final_damage_amount, cause)
--Cause a one punch.
if enable_one_punch then
if rpg_t.one_punch then
local chance = Public.get_one_punch_chance(cause.player) * 10
if enable_aoe_punch then
if rpg_t.aoe_punch then
local chance = Public.get_aoe_punch_chance(cause.player) * 10
local chance_to_hit = random(0, 999)
local success = chance_to_hit < chance
log_one_punch(
log_aoe_punch(
function()
if success then
print('[OnePunch]: Chance: ' .. chance .. ' Chance to hit: ' .. chance_to_hit .. ' Success: true' .. ' Damage: ' .. damage)
@ -773,7 +773,7 @@ local function on_entity_damaged(event)
end
)
if success then
one_punch(cause, entity, damage, get_health_pool) -- only kill the biters if their health is below or equal to zero
aoe_punch(cause, entity, damage, get_health_pool) -- only kill the biters if their health is below or equal to zero
return
end
end

View File

@ -330,7 +330,7 @@ function Public.extra_settings(player)
local flame_boots_gui_input
local explosive_bullets_gui_input
local stone_path_gui_input
local one_punch_gui_input
local aoe_punch_gui_input
local auto_allocate_gui_input
if rpg_extra.enable_stone_path then
@ -370,44 +370,44 @@ function Public.extra_settings(player)
end
end
if rpg_extra.enable_one_punch then
local one_punch_label =
if rpg_extra.enable_aoe_punch then
local aoe_punch_label =
setting_grid.add(
{
type = 'label',
caption = ({'rpg_settings.one_punch_label'}),
tooltip = ({'rpg_settings.one_punch_tooltip'})
caption = ({'rpg_settings.aoe_punch_label'}),
tooltip = ({'rpg_settings.aoe_punch_tooltip'})
}
)
local one_punch_label_style = one_punch_label.style
one_punch_label_style.horizontally_stretchable = true
one_punch_label_style.height = 35
one_punch_label_style.vertical_align = 'center'
local aoe_punch_label_style = aoe_punch_label.style
aoe_punch_label_style.horizontally_stretchable = true
aoe_punch_label_style.height = 35
aoe_punch_label_style.vertical_align = 'center'
local one_punch_input = setting_grid.add({type = 'flow'})
local one_punch_input_style = one_punch_input.style
one_punch_input_style.height = 35
one_punch_input_style.vertical_align = 'center'
local one_punch
if rpg_t.one_punch then
one_punch = rpg_t.one_punch
local aoe_punch_input = setting_grid.add({type = 'flow'})
local aoe_punch_input_style = aoe_punch_input.style
aoe_punch_input_style.height = 35
aoe_punch_input_style.vertical_align = 'center'
local aoe_punch
if rpg_t.aoe_punch then
aoe_punch = rpg_t.aoe_punch
else
one_punch = false
aoe_punch = false
end
one_punch_gui_input = create_input_element(one_punch_input, 'boolean', one_punch)
aoe_punch_gui_input = create_input_element(aoe_punch_input, 'boolean', aoe_punch)
if rpg_extra.enable_one_punch_globally then
one_punch_gui_input.state = true
one_punch_gui_input.enabled = false
one_punch_gui_input.tooltip = ({'rpg_settings.one_punch_globally'})
if rpg_extra.enable_aoe_punch_globally then
aoe_punch_gui_input.state = true
aoe_punch_gui_input.enabled = false
aoe_punch_gui_input.tooltip = ({'rpg_settings.aoe_punch_globally'})
else
if rpg_t.level < settings_level['one_punch_label'] then
one_punch_gui_input.enabled = false
one_punch_gui_input.tooltip = ({'rpg_settings.low_level', 30})
if rpg_t.level < settings_level['aoe_punch_label'] then
aoe_punch_gui_input.enabled = false
aoe_punch_gui_input.tooltip = ({'rpg_settings.low_level', 30})
else
one_punch_gui_input.enabled = true
one_punch_gui_input.tooltip = ({'rpg_settings.tooltip_check'})
aoe_punch_gui_input.enabled = true
aoe_punch_gui_input.tooltip = ({'rpg_settings.tooltip_check'})
end
end
end
@ -698,8 +698,8 @@ function Public.extra_settings(player)
data.stone_path_gui_input = stone_path_gui_input
end
if rpg_extra.enable_one_punch then
data.one_punch_gui_input = one_punch_gui_input
if rpg_extra.enable_aoe_punch then
data.aoe_punch_gui_input = aoe_punch_gui_input
end
if rpg_extra.enable_auto_allocate then

View File

@ -44,7 +44,7 @@ end
Public.gui_settings_levels = {
['reset_text_label'] = 50,
['stone_path_label'] = 20,
['one_punch_label'] = 30,
['aoe_punch_label'] = 30,
['flameboots_label'] = 100,
['explosive_bullets_label'] = 50
}
@ -114,8 +114,8 @@ function Public.reset_table()
this.rpg_extra.force_mana_per_tick = false
this.rpg_extra.enable_stone_path = false
this.rpg_extra.enable_auto_allocate = false
this.rpg_extra.enable_one_punch = true
this.rpg_extra.enable_one_punch_globally = false
this.rpg_extra.enable_aoe_punch = true
this.rpg_extra.enable_aoe_punch_globally = false
this.rpg_extra.disable_get_heal_modifier_from_using_fish = false
this.rpg_extra.tweaked_crafting_items = {
['red-wire'] = true,
@ -239,14 +239,14 @@ function Public.toggle_debug()
end
--- Toggle debug - when you need to troubleshoot.
function Public.toggle_debug_one_punch()
if this.rpg_extra.debug_one_punch then
this.rpg_extra.debug_one_punch = false
function Public.toggle_debug_aoe_punch()
if this.rpg_extra.debug_aoe_punch then
this.rpg_extra.debug_aoe_punch = false
else
this.rpg_extra.debug_one_punch = true
this.rpg_extra.debug_aoe_punch = true
end
return this.rpg_extra.debug_one_punch
return this.rpg_extra.debug_aoe_punch
end
--- Debug only - when you need to troubleshoot.
@ -367,20 +367,20 @@ function Public.enable_auto_allocate(value)
return this.rpg_extra.enable_auto_allocate
end
--- Enables/disabled stone-path-tile creation on mined.
--- Enables/disabled aoe_punch.
---@param value <boolean>
function Public.enable_one_punch(value)
this.rpg_extra.enable_one_punch = value or false
function Public.enable_aoe_punch(value)
this.rpg_extra.enable_aoe_punch = value or false
return this.rpg_extra.enable_one_punch
return this.rpg_extra.enable_aoe_punch
end
--- Enables/disabled stone-path-tile creation on mined.
--- Enables/disabled aoe_punch.
---@param value <boolean>
function Public.enable_one_punch_globally(value)
this.rpg_extra.enable_one_punch_globally = value or false
function Public.enable_aoe_punch_globally(value)
this.rpg_extra.enable_aoe_punch_globally = value or false
return this.rpg_extra.enable_one_punch_globally
return this.rpg_extra.enable_aoe_punch_globally
end
--- Retrieves the spells table or a given spell.