Skip to content

Commit

Permalink
增加中英对照
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhu committed Nov 15, 2024
1 parent c599f40 commit 2ac72dd
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 28 deletions.
45 changes: 44 additions & 1 deletion assets/configs/duolingo.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,47 @@ Made by,开发组,Made by,参与开发
Developer,开发者,CloudHu - Developer & CEO of CloudGames Studio,胡良云
logo,商标,Bevy logo - All rights reserved by the Bevy Foundation. Permission granted for splash screen use when unmodified.,引擎商标所有权归Bevy基金会所有
Assets,资源列表,Assets,美术资产
points,积分,points,分
points,积分,points,分
Armor,防御属性,Armor,护甲
Shield,防护盾,Shield,护盾
Level,玩家等级,Level,等级
Speed,移动速度,Speed,速度
Time,计时单位,Time,时间
Weapon,武器,Weapon,武器
Passive,被动,Passive,被动效果
Consumable,消耗,Consumable,消耗品
AutoCannonDes,自动炮描述,Rapidly fires bullets towards the target.,自动向目标快速发射子弹
BlastLaserDes,镭射炮,Always hits. Deals low damage.,镭射光子炮可以百分百命中目标,但是伤害较低。
ChainLaser,链击镭射光,ChainLaser,链式镭射炮
AutoCannon,自动炮描述,AutoCannon,自动追踪炮
BlastLaser,镭射炮,BlastLaser,镭射光子炮
ChainLaserDes,链击镭射光,Shoots a laser that jumps to nearby enemies.,发射激光,命中后跳向目标附近的敌人,对群体目标造成少量伤害。
Emp,电磁脉冲(electromagnetic pulse),Emp,电磁脉冲
EmpDes,电磁脉冲(electromagnetic pulse),Creates a shockwave around you that deals damage to enemies.,在你周围制造冲击波,对敌人造成伤害。
MineLauncher,地雷陷阱,MineLauncher,太空地雷
MineLauncherDes,地雷陷阱,Drops mines that explode when enemies are in close proximity.,投下地雷,当敌人靠近时爆炸。
PierceLaser,Pierce Laser,PierceLaser,激光镭射
PierceLaserDes,穿透攻击镭射激光,Shoots a heavy damaging laser that pierces through enemies.,发射强烈的破坏性激光穿透敌人。
RocketLauncher,火箭攻击,RocketLauncher,火箭导弹
RocketLauncherDes,火箭攻击,Shoots a seeking missile that explodes on impact.,发射一枚追踪导弹并在撞击时爆炸。
ShrapnelCannon,Shrapnel Cannon,ShrapnelCannon,弹片加农炮
ShrapnelCannonDes,Shrapnel Cannon,Shoots a spray of bullets in a cone towards the target.,向目标射出锥形的子弹喷雾。
ArmorDes,描述,Increase armor by 25.,增加25护甲。
Crit,暴击率属性,Crit,暴击率
CritDes,描述,Increase chance to deal double damage by 12.5%.,增加12.5%的暴击率。
Experience,经验属性,Experience,经验
ExperienceDes,描述,Increase chance to triple experience by 10%.,增加10%获得三倍经验的几率。
FireRate,属性,FireRate,发射频率
FireRateDes,描述,Increase turret fire rate by 10%.,增加炮塔射速:10%。
Magnet,属性,Magnet,磁吸
MagnetDes,描述,Increase range and speed of experience magnetism.,增加磁力吸收经验的范围和速度。
ShieldRecharge,属性,ShieldRecharge,护盾充能
ShieldRechargeDes,描述,Decrease shield hit and regeneration cooldown.,减少护盾充能回复冷却时间。
SpeedDes,移动速度,Increase engine power and max speed.,增加发动机功率和最大转速。
HealDes,描述,Restore 50 armor or shields.,恢复50个护甲或护盾。
Heal,属性,Heal,治疗
Shield Boost,属性,Shield Boost,护盾充能
Reinforced Armor,描述,Reinforced Armor,护甲增强
Rapid Fire,属性,Rapid Fire,超频射击
Critical Strikes,描述,Critical Strikes,致命一击
Experience Booster,描述,Experience Booster,经验加速器
12 changes: 7 additions & 5 deletions src/gameplay/hud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::ship::engine::Engine;
use crate::ship::turret::{FireRate, TurretClass};
use crate::util::Colour;
use bevy::prelude::*;
use crate::theme::localize::Localize;

pub(super) fn plugin(app: &mut App) {
app.add_systems(OnEnter(AppState::InGame), setup_hud)
Expand Down Expand Up @@ -172,6 +173,7 @@ pub fn hud_system(
mut q_child: Query<&mut Text>,
level: Res<PlayerLevel>,
game_time: Res<GameTime>,
localize: Res<Localize>
) {
if let Ok((engine, health, cargo, turrets)) = player_query.get_single() {
// Loop over children and update display values
Expand All @@ -180,30 +182,30 @@ pub fn hud_system(
UINode::Status => vec![
format!(
"{:<8} {} {}",
"Armor",
localize.get("Armor"),
bar(health.health, health.max_health, 10),
health.health
),
format!(
"{:<8} {} {}",
"Shield",
localize.get("Shield"),
bar(health.shield, health.max_shield, 10),
health.shield
),
format!(
"{:<8} {} {:0>2}",
"Level",
localize.get("Level"),
bar(
cargo.amount as i32,
level.required_cargo_to_level() as i32,
10
),
level.value
),
format!("{:<8} {} m/s", "Speed", engine.speed.round()),
format!("{:<8} {} m/s", localize.get("Speed"), engine.speed.round()),
format!(
"{:<8} {:0>2}:{:0>2}",
"Time",
localize.get("Time"),
game_time.0.elapsed().as_secs() / 60,
game_time.0.elapsed().as_secs() % 60
),
Expand Down
15 changes: 9 additions & 6 deletions src/gameplay/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::ship::turret::TurretClass;
use crate::util::Colour;
use bevy::prelude::*;
use rand::Rng;
use crate::theme::localize::Localize;

#[derive(Resource)]
struct SelectionData(pub Vec<Entity>);
Expand Down Expand Up @@ -89,6 +90,7 @@ fn setup_selection(
mut menu_data: ResMut<SelectionData>,
player_level: Res<PlayerLevel>,
upgrades: Res<PlayerUpgrades>,
localize: Res<Localize>
) {
// Roll for options
let options = match player_level.value {
Expand All @@ -112,7 +114,7 @@ fn setup_selection(
})
.with_children(|parent| {
for option in options {
button(parent, &fonts, option);
button(parent, &fonts, option,&localize);
}
})
.id();
Expand Down Expand Up @@ -152,17 +154,18 @@ fn cleanup(mut commands: Commands, mut menu_data: ResMut<SelectionData>) {
menu_data.0.clear();
}

fn button(parent: &mut ChildBuilder, fonts: &Res<Fonts>, upgrade: UpgradeEvent) {
fn button(parent: &mut ChildBuilder, fonts: &Res<Fonts>, upgrade: UpgradeEvent,localize:&Res<Localize>) {
let type_text = match upgrade {
UpgradeEvent::Weapon(_) => "Weapon".to_string(),
UpgradeEvent::Passive(_) => "Passive".to_string(),
UpgradeEvent::Heal => "Consumable".to_string(),
UpgradeEvent::Weapon(_) => localize.get("Weapon"),
UpgradeEvent::Passive(_) => localize.get("Passive"),
UpgradeEvent::Heal => localize.get("Consumable"),
};
let type_color = match upgrade {
UpgradeEvent::Weapon(_) => Colour::RED,
UpgradeEvent::Passive(_) => Colour::SHIELD,
UpgradeEvent::Heal => Colour::GREEN,
};
println!(format!("{}", upgrade));
parent
.spawn((
ButtonBundle {
Expand Down Expand Up @@ -216,7 +219,7 @@ fn button(parent: &mut ChildBuilder, fonts: &Res<Fonts>, upgrade: UpgradeEvent)
});
parent.spawn(TextBundle {
text: Text::from_section(
upgrade.describe().to_string(),
localize.get(&*upgrade.describe()),
TextStyle {
font: fonts.primary.clone(),
font_size: 14.0,
Expand Down
32 changes: 16 additions & 16 deletions src/gameplay/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,43 +76,43 @@ impl UpgradeEvent {
pub fn describe(&self) -> String {
match self {
UpgradeEvent::Weapon(TurretClass::AutoCannon) => {
"Rapidly fires bullets towards the target"
"AutoCannonDes"
}
UpgradeEvent::Weapon(TurretClass::BlastLaser) => "Always hits. Deals low damage",
UpgradeEvent::Weapon(TurretClass::BlastLaser) => "BlastLaserDes",
UpgradeEvent::Weapon(TurretClass::ChainLaser) => {
"Shoots a laser that jumps to nearby enemies"
"ChainLaserDes"
}
UpgradeEvent::Weapon(TurretClass::Emp) => {
"Creates a shockwave around you that deals damage to enemies"
"EmpDes"
}
UpgradeEvent::Weapon(TurretClass::MineLauncher) => {
"Drops mines that explode when enemies are in close proximity"
"MineLauncherDes"
}
UpgradeEvent::Weapon(TurretClass::PierceLaser) => {
"Shoots a heavy damaging laser that pierces through enemies"
"PierceLaserDes"
}
UpgradeEvent::Weapon(TurretClass::RocketLauncher) => {
"Shoots a seeking missile that explodes on impact"
"RocketLauncherDes"
}
UpgradeEvent::Weapon(TurretClass::ShrapnelCannon) => {
"Shoots a spray of bullets in a cone towards the target"
"ShrapnelCannonDes"
}
UpgradeEvent::Passive(Passive::Armor) => "Increase armor by 25",
UpgradeEvent::Passive(Passive::Armor) => "ArmorDes",
UpgradeEvent::Passive(Passive::Crit) => {
"Increase chance to deal double damage by 12.5%"
"CritDes"
}
UpgradeEvent::Passive(Passive::Experience) => {
"Increase chance to triple experience by 10%"
"ExperienceDes"
}
UpgradeEvent::Passive(Passive::FireRate) => "Increase turret fire rate by 10%",
UpgradeEvent::Passive(Passive::FireRate) => "FireRateDes",
UpgradeEvent::Passive(Passive::Magnet) => {
"Increase range and speed of experience magnetism"
"MagnetDes"
}
UpgradeEvent::Passive(Passive::ShieldRecharge) => {
"Decrease shield hit and regeneration cooldown"
"ShieldRechargeDes"
}
UpgradeEvent::Passive(Passive::Speed) => "Increase engine power and max speed",
UpgradeEvent::Heal => "Restore 50 armor or shields",
UpgradeEvent::Passive(Passive::Speed) => "SpeedDes",
UpgradeEvent::Heal => "HealDes",
}
.to_string()
}
Expand Down

0 comments on commit 2ac72dd

Please sign in to comment.