mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Address comments, clippy and minor adjustments
first bunch of comments addressed change order or scatter, paths and caves being applied in worldgen to avoid floating scatter objects campfire adjustments, reduced grass density due to FPS issues readded item descriptions to the crafting window, item desc for craftable armour address comments happy clippy, happy life clippy clippy more clippy fmt revert cargo.toml formatting remove "allow unreachable pattern" fmt
This commit is contained in:
parent
e3eb34085f
commit
ce929d2924
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -1309,15 +1309,6 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "format_num"
|
|
||||||
version = "0.1.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "14ac05eb8d2eb4ed1eeff847911deae077b0b53332465de9d6a26b0ea9961bc8"
|
|
||||||
dependencies = [
|
|
||||||
"regex",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fsevent"
|
name = "fsevent"
|
||||||
version = "2.0.2"
|
version = "2.0.2"
|
||||||
@ -4775,7 +4766,6 @@ dependencies = [
|
|||||||
"dot_vox",
|
"dot_vox",
|
||||||
"euc",
|
"euc",
|
||||||
"failure",
|
"failure",
|
||||||
"format_num",
|
|
||||||
"gfx",
|
"gfx",
|
||||||
"gfx_device_gl",
|
"gfx_device_gl",
|
||||||
"gfx_gl",
|
"gfx_gl",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Cape",
|
name: "Agile Cape",
|
||||||
description: "Keeps your shoulders warm.",
|
description: "'Tightly packed pieces of leather to endure all weather.'",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Back("Short2"),
|
kind: Back("Short2"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Belt",
|
name: "Agile Belt",
|
||||||
description: "",
|
description: "'Tightly packed pieces of leather to endure all weather.'",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Belt("Leather2"),
|
kind: Belt("Leather2"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Chest",
|
name: "Agile Chest",
|
||||||
description: " ",
|
description: "'Tightly packed pieces of leather to endure all weather.'",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Chest("Leather2"),
|
kind: Chest("Leather2"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Kickers",
|
name: "Agile Kickers",
|
||||||
description: "",
|
description: "'Tightly packed pieces of leather to endure all weather.",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Foot("Leather2"),
|
kind: Foot("Leather2"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Gauntlets",
|
name: "Agile Gauntlets",
|
||||||
description: "",
|
description: "'Tightly packed pieces of leather to endure all weather.'",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Hand("Leather2"),
|
kind: Hand("Leather2"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Pantalons",
|
name: "Agile Pantalons",
|
||||||
description: "",
|
description: "'Tightly packed pieces of leather to endure all weather.'",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Pants("Leather2"),
|
kind: Pants("Leather2"),
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Item(
|
Item(
|
||||||
name: "Agile Guards",
|
name: "Agile Guards",
|
||||||
description: "",
|
description: "'Tightly packed pieces of leather to endure all weather.'",
|
||||||
kind: Armor(
|
kind: Armor(
|
||||||
(
|
(
|
||||||
kind: Shoulder("Leather1"),
|
kind: Shoulder("Leather2"),
|
||||||
stats: (
|
stats: (
|
||||||
protection: Normal(6.0),
|
protection: Normal(6.0),
|
||||||
),
|
),
|
||||||
|
@ -65,11 +65,14 @@ VoxygenLocalization(
|
|||||||
"common.create": "Oluştur",
|
"common.create": "Oluştur",
|
||||||
"common.okay": "Tamam",
|
"common.okay": "Tamam",
|
||||||
"common.accept": "Kabul Et",
|
"common.accept": "Kabul Et",
|
||||||
|
"common.decline": "Reddet",
|
||||||
"common.disclaimer": "Uyarı",
|
"common.disclaimer": "Uyarı",
|
||||||
"common.cancel": "İptal Et",
|
"common.cancel": "İptal Et",
|
||||||
"common.none": "Yok",
|
"common.none": "Yok",
|
||||||
"common.error": "Hata",
|
"common.error": "Hata",
|
||||||
"common.fatal_error": "Ölümcül hata",
|
"common.fatal_error": "Ölümcül hata",
|
||||||
|
"common.you": "Sen",
|
||||||
|
"common.automatic": "Otomatik",
|
||||||
|
|
||||||
// Message when connection to the server is lost
|
// Message when connection to the server is lost
|
||||||
"common.connection_lost": r#"Bağlantı koptu!
|
"common.connection_lost": r#"Bağlantı koptu!
|
||||||
@ -302,23 +305,30 @@ edince kapat"#,
|
|||||||
"hud.settings.fluid_rendering_mode.cheap": "Basit",
|
"hud.settings.fluid_rendering_mode.cheap": "Basit",
|
||||||
"hud.settings.fluid_rendering_mode.shiny": "Güzel",
|
"hud.settings.fluid_rendering_mode.shiny": "Güzel",
|
||||||
"hud.settings.cloud_rendering_mode.regular": "Normal",
|
"hud.settings.cloud_rendering_mode.regular": "Normal",
|
||||||
|
"hud.settings.particles": "Partiküller",
|
||||||
|
"hud.settings.resolution": "Çözünürlük",
|
||||||
|
"hud.settings.bit_depth": "Bit Derinliği",
|
||||||
|
"hud.settings.refresh_rate": "Yenileme Hızı",
|
||||||
"hud.settings.fullscreen": "Tam ekran",
|
"hud.settings.fullscreen": "Tam ekran",
|
||||||
"hud.settings.save_window_size": "Pencere boyutunu kaydet",
|
"hud.settings.save_window_size": "Pencere boyutunu kaydet",
|
||||||
|
|
||||||
"hud.settings.awaitingkey": "Bir tuşa bas...",
|
|
||||||
"hud.settings.unbound": "Atanmamış",
|
|
||||||
"hud.settings.reset_keybinds": "Varsayılana döndür",
|
|
||||||
|
|
||||||
"hud.settings.music_volume": "Müzik Sesi",
|
"hud.settings.music_volume": "Müzik Sesi",
|
||||||
"hud.settings.sound_effect_volume": "Efekt Sesi",
|
"hud.settings.sound_effect_volume": "Efekt Sesi",
|
||||||
"hud.settings.audio_device": "Ses Aygıtı",
|
"hud.settings.audio_device": "Ses Aygıtı",
|
||||||
|
|
||||||
"hud.social": "Sosyal",
|
"hud.settings.awaitingkey": "Bir tuşa bas...",
|
||||||
"hud.social.online": "Çevrimiçi",
|
"hud.settings.unbound": "Atanmamış",
|
||||||
|
"hud.settings.reset_keybinds": "Varsayılana döndür",
|
||||||
|
|
||||||
|
"hud.social": "Diğer Oyuncular",
|
||||||
|
"hud.social.online": "Çevrimiçi:",
|
||||||
"hud.social.friends": "Arkadaşlar",
|
"hud.social.friends": "Arkadaşlar",
|
||||||
"hud.social.not_yet_available": "Şu anda kullanılabilir değil",
|
"hud.social.not_yet_available": "Şu anda kullanılabilir değil",
|
||||||
"hud.social.faction": "Klan",
|
"hud.social.faction": "Klan",
|
||||||
"hud.social.play_online_fmt": "{nb_player} oyuncu çevrimiçi",
|
"hud.social.play_online_fmt": "{nb_player} oyuncu çevrimiçi",
|
||||||
|
"hud.social.name": "İsim",
|
||||||
|
"hud.social.level": "Seviye",
|
||||||
|
"hud.social.zone": "Bölge",
|
||||||
|
|
||||||
"hud.crafting": "Üretim",
|
"hud.crafting": "Üretim",
|
||||||
"hud.crafting.recipes": "Tarifler",
|
"hud.crafting.recipes": "Tarifler",
|
||||||
@ -326,6 +336,19 @@ edince kapat"#,
|
|||||||
"hud.crafting.craft": "Üret",
|
"hud.crafting.craft": "Üret",
|
||||||
"hud.crafting.tool_cata": "Gerektiriyor:",
|
"hud.crafting.tool_cata": "Gerektiriyor:",
|
||||||
|
|
||||||
|
"hud.group": "Grup",
|
||||||
|
"hud.group.invite_to_join": "{name} seni grubuna davet etti!",
|
||||||
|
"hud.group.invite": "Davet Et",
|
||||||
|
"hud.group.kick": "Gruptan At",
|
||||||
|
"hud.group.assign_leader": "Lider Seç",
|
||||||
|
"hud.group.leave": "Gruptan Ayrıl",
|
||||||
|
"hud.group.dead" : "Ölü",
|
||||||
|
"hud.group.out_of_range": "Erişim dışı",
|
||||||
|
"hud.group.add_friend": "Arkadaşlara Ekle",
|
||||||
|
"hud.group.link_group": "Grupları Bağla",
|
||||||
|
"hud.group.in_menu": "Menüde",
|
||||||
|
"hud.group.members": "Grup Üyeleri",
|
||||||
|
|
||||||
"hud.spell": "Büyü",
|
"hud.spell": "Büyü",
|
||||||
|
|
||||||
"hud.free_look_indicator": "Serbest bakış açık",
|
"hud.free_look_indicator": "Serbest bakış açık",
|
||||||
@ -368,7 +391,7 @@ edince kapat"#,
|
|||||||
"gameinput.wallleap": "Duvar Sıçrayışı",
|
"gameinput.wallleap": "Duvar Sıçrayışı",
|
||||||
"gameinput.togglelantern": "Feneri yak/söndür",
|
"gameinput.togglelantern": "Feneri yak/söndür",
|
||||||
"gameinput.mount": "Bin",
|
"gameinput.mount": "Bin",
|
||||||
"gameinput.enter": "Sohbet",
|
"gameinput.chat": "Sohbet",
|
||||||
"gameinput.command": "Komut",
|
"gameinput.command": "Komut",
|
||||||
"gameinput.escape": "Oyunu Duraklat",
|
"gameinput.escape": "Oyunu Duraklat",
|
||||||
"gameinput.map": "Harita",
|
"gameinput.map": "Harita",
|
||||||
@ -384,6 +407,13 @@ edince kapat"#,
|
|||||||
"gameinput.freelook": "Serbest Bakış",
|
"gameinput.freelook": "Serbest Bakış",
|
||||||
"gameinput.autowalk": "Otomatik Yürüyüş",
|
"gameinput.autowalk": "Otomatik Yürüyüş",
|
||||||
"gameinput.dance": "Dans et",
|
"gameinput.dance": "Dans et",
|
||||||
|
"gameinput.select": "Varlık Seç",
|
||||||
|
"gameinput.acceptgroupinvite": "Grup Davetini Kabul Et",
|
||||||
|
"gameinput.declinegroupinvite": "Grup Davetini Reddet",
|
||||||
|
"gameinput.crafting": "Üretim",
|
||||||
|
"gameinput.sneak": "Eğil",
|
||||||
|
"gameinput.swimdown": "Aşağı Dal",
|
||||||
|
"gameinput.swimup": "Yüzeye çık",
|
||||||
|
|
||||||
/// End GameInput section
|
/// End GameInput section
|
||||||
|
|
||||||
@ -456,6 +486,8 @@ Koruma
|
|||||||
"'L-Shift'e basarak Planörünü aç ve gökyüzünü fethet.",
|
"'L-Shift'e basarak Planörünü aç ve gökyüzünü fethet.",
|
||||||
"Veloren hala Pre-Alpha'da. Onu geliştirmek için her gün elimizden geleni yapıyoruz!",
|
"Veloren hala Pre-Alpha'da. Onu geliştirmek için her gün elimizden geleni yapıyoruz!",
|
||||||
"Geliştirme Takımına katılmak istiyorsan veya sadece sohbet etmek istiyorsan Discord sunucumuza katıl.",
|
"Geliştirme Takımına katılmak istiyorsan veya sadece sohbet etmek istiyorsan Discord sunucumuza katıl.",
|
||||||
|
"Can barında canı sayı olarak görmek istiyorsan, bunu ayarlardan aktifleştirebilirsin.",
|
||||||
|
"Niteliklerini görmek için envanterindeki 'Nitelikler' düğmesine tıklayabilirsin.",
|
||||||
],
|
],
|
||||||
"npc.speech.villager_under_attack": [
|
"npc.speech.villager_under_attack": [
|
||||||
"Saldırı altındayım, yardım edin!",
|
"Saldırı altındayım, yardım edin!",
|
||||||
|
@ -109,10 +109,10 @@ void main() {
|
|||||||
attr = Attr(
|
attr = Attr(
|
||||||
linear_motion(
|
linear_motion(
|
||||||
vec3(0.0, 0.0, 0.0),
|
vec3(0.0, 0.0, 0.0),
|
||||||
vec3(rand2 * 0.02, rand3 * 0.02, 1.0 + rand4 * 0.1)
|
vec3(rand2 * 0.1, rand3 * 0.1, 1.0 + rand4 * 0.1)
|
||||||
),
|
),
|
||||||
linear_scale(0.5),
|
linear_scale(0.2),
|
||||||
vec4(1, 1, 1, start_end(1.0, 0.0)),
|
vec4(1, 1, 1, start_end(0.1, 0.0)),
|
||||||
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 0.5)
|
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 0.5)
|
||||||
);
|
);
|
||||||
} else if (inst_mode == FIRE) {
|
} else if (inst_mode == FIRE) {
|
||||||
@ -121,7 +121,7 @@ void main() {
|
|||||||
vec3(rand0 * 0.3, rand1 * 0.3, 0.2),
|
vec3(rand0 * 0.3, rand1 * 0.3, 0.2),
|
||||||
vec3(rand1 * 0.1, rand3 * 0.1, 3.0 + rand4 * 1.2)
|
vec3(rand1 * 0.1, rand3 * 0.1, 3.0 + rand4 * 1.2)
|
||||||
),
|
),
|
||||||
1.0,
|
1.3,
|
||||||
vec4(2, 0.8 + rand5 * 0.3, 0, 1),
|
vec4(2, 0.8 + rand5 * 0.3, 0, 1),
|
||||||
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3)
|
spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3)
|
||||||
);
|
);
|
||||||
|
@ -28,7 +28,6 @@ impl Alignment {
|
|||||||
match (self, other) {
|
match (self, other) {
|
||||||
(Alignment::Enemy, Alignment::Enemy) => false,
|
(Alignment::Enemy, Alignment::Enemy) => false,
|
||||||
(Alignment::Enemy, Alignment::Wild) => false,
|
(Alignment::Enemy, Alignment::Wild) => false,
|
||||||
(Alignment::Enemy, Alignment::Tame) => true,
|
|
||||||
(Alignment::Wild, Alignment::Enemy) => false,
|
(Alignment::Wild, Alignment::Enemy) => false,
|
||||||
(Alignment::Wild, Alignment::Wild) => false,
|
(Alignment::Wild, Alignment::Wild) => false,
|
||||||
(Alignment::Npc, Alignment::Wild) => false,
|
(Alignment::Npc, Alignment::Wild) => false,
|
||||||
@ -69,7 +68,6 @@ impl Component for Alignment {
|
|||||||
pub struct Psyche {
|
pub struct Psyche {
|
||||||
pub aggro: f32, // 0.0 = always flees, 1.0 = always attacks, 0.5 = flee at 50% health
|
pub aggro: f32, // 0.0 = always flees, 1.0 = always attacks, 0.5 = flee at 50% health
|
||||||
}
|
}
|
||||||
#[allow(unreachable_patterns)]
|
|
||||||
impl<'a> From<&'a Body> for Psyche {
|
impl<'a> From<&'a Body> for Psyche {
|
||||||
fn from(body: &'a Body) -> Self {
|
fn from(body: &'a Body) -> Self {
|
||||||
Self {
|
Self {
|
||||||
@ -81,7 +79,6 @@ impl<'a> From<&'a Body> for Psyche {
|
|||||||
humanoid::Species::Human => 0.95,
|
humanoid::Species::Human => 0.95,
|
||||||
humanoid::Species::Orc => 1.0,
|
humanoid::Species::Orc => 1.0,
|
||||||
humanoid::Species::Undead => 1.0,
|
humanoid::Species::Undead => 1.0,
|
||||||
_ => 1.0,
|
|
||||||
},
|
},
|
||||||
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
|
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
|
||||||
quadruped_small::Species::Pig => 0.5,
|
quadruped_small::Species::Pig => 0.5,
|
||||||
@ -100,7 +97,6 @@ impl<'a> From<&'a Body> for Psyche {
|
|||||||
quadruped_small::Species::Rabbit => 0.1,
|
quadruped_small::Species::Rabbit => 0.1,
|
||||||
quadruped_small::Species::Truffler => 0.8,
|
quadruped_small::Species::Truffler => 0.8,
|
||||||
quadruped_small::Species::Frog => 0.6,
|
quadruped_small::Species::Frog => 0.6,
|
||||||
_ => 1.0,
|
|
||||||
},
|
},
|
||||||
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
|
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
|
||||||
quadruped_medium::Species::Tuskram => 0.8,
|
quadruped_medium::Species::Tuskram => 0.8,
|
||||||
@ -119,7 +115,6 @@ impl<'a> From<&'a Body> for Psyche {
|
|||||||
quadruped_low::Species::Rocksnapper => 1.0,
|
quadruped_low::Species::Rocksnapper => 1.0,
|
||||||
quadruped_low::Species::Pangolin => 0.6,
|
quadruped_low::Species::Pangolin => 0.6,
|
||||||
quadruped_low::Species::Maneater => 1.0,
|
quadruped_low::Species::Maneater => 1.0,
|
||||||
_ => 1.0,
|
|
||||||
},
|
},
|
||||||
Body::BirdMedium(_) => 1.0,
|
Body::BirdMedium(_) => 1.0,
|
||||||
Body::BirdSmall(_) => 0.4,
|
Body::BirdSmall(_) => 0.4,
|
||||||
|
@ -217,9 +217,7 @@ impl Body {
|
|||||||
_ => 100,
|
_ => 100,
|
||||||
},
|
},
|
||||||
Body::FishMedium(_) => 50,
|
Body::FishMedium(_) => 50,
|
||||||
Body::Dragon(dragon) => match dragon.species {
|
Body::Dragon(_) => 5000,
|
||||||
_ => 5000,
|
|
||||||
},
|
|
||||||
Body::BirdSmall(_) => 50,
|
Body::BirdSmall(_) => 50,
|
||||||
Body::FishSmall(_) => 20,
|
Body::FishSmall(_) => 20,
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(biped_large) => match biped_large.species {
|
||||||
@ -231,12 +229,8 @@ impl Body {
|
|||||||
_ => 1000,
|
_ => 1000,
|
||||||
},
|
},
|
||||||
Body::Object(_) => 10000,
|
Body::Object(_) => 10000,
|
||||||
Body::Golem(golem) => match golem.species {
|
Body::Golem(_) => 1500,
|
||||||
_ => 1500,
|
Body::Critter(_) => 50,
|
||||||
},
|
|
||||||
Body::Critter(critter) => match critter.species {
|
|
||||||
_ => 50,
|
|
||||||
},
|
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
||||||
quadruped_low::Species::Crocodile => 600,
|
quadruped_low::Species::Crocodile => 600,
|
||||||
quadruped_low::Species::Alligator => 600,
|
quadruped_low::Species::Alligator => 600,
|
||||||
@ -290,9 +284,7 @@ impl Body {
|
|||||||
_ => 20,
|
_ => 20,
|
||||||
},
|
},
|
||||||
Body::FishMedium(_) => 10,
|
Body::FishMedium(_) => 10,
|
||||||
Body::Dragon(dragon) => match dragon.species {
|
Body::Dragon(_) => 500,
|
||||||
_ => 500,
|
|
||||||
},
|
|
||||||
Body::BirdSmall(_) => 10,
|
Body::BirdSmall(_) => 10,
|
||||||
Body::FishSmall(_) => 10,
|
Body::FishSmall(_) => 10,
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(biped_large) => match biped_large.species {
|
||||||
@ -304,12 +296,8 @@ impl Body {
|
|||||||
_ => 100,
|
_ => 100,
|
||||||
},
|
},
|
||||||
Body::Object(_) => 10,
|
Body::Object(_) => 10,
|
||||||
Body::Golem(golem) => match golem.species {
|
Body::Golem(_) => 150,
|
||||||
_ => 150,
|
Body::Critter(_) => 20,
|
||||||
},
|
|
||||||
Body::Critter(critter) => match critter.species {
|
|
||||||
_ => 20,
|
|
||||||
},
|
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
||||||
quadruped_low::Species::Crocodile => 20,
|
quadruped_low::Species::Crocodile => 20,
|
||||||
quadruped_low::Species::Alligator => 20,
|
quadruped_low::Species::Alligator => 20,
|
||||||
@ -361,9 +349,7 @@ impl Body {
|
|||||||
_ => 8,
|
_ => 8,
|
||||||
},
|
},
|
||||||
Body::FishMedium(_) => 2,
|
Body::FishMedium(_) => 2,
|
||||||
Body::Dragon(dragon) => match dragon.species {
|
Body::Dragon(_) => 1000,
|
||||||
_ => 1000,
|
|
||||||
},
|
|
||||||
Body::BirdSmall(_) => 2,
|
Body::BirdSmall(_) => 2,
|
||||||
Body::FishSmall(_) => 2,
|
Body::FishSmall(_) => 2,
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(biped_large) => match biped_large.species {
|
||||||
@ -375,12 +361,8 @@ impl Body {
|
|||||||
_ => 100,
|
_ => 100,
|
||||||
},
|
},
|
||||||
Body::Object(_) => 1,
|
Body::Object(_) => 1,
|
||||||
Body::Golem(golem) => match golem.species {
|
Body::Golem(_) => 75,
|
||||||
_ => 75,
|
Body::Critter(_) => 2,
|
||||||
},
|
|
||||||
Body::Critter(critter) => match critter.species {
|
|
||||||
_ => 2,
|
|
||||||
},
|
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
||||||
quadruped_low::Species::Crocodile => 10,
|
quadruped_low::Species::Crocodile => 10,
|
||||||
quadruped_low::Species::Alligator => 10,
|
quadruped_low::Species::Alligator => 10,
|
||||||
@ -400,34 +382,18 @@ impl Body {
|
|||||||
pub fn base_exp_increase(&self) -> u32 {
|
pub fn base_exp_increase(&self) -> u32 {
|
||||||
match self {
|
match self {
|
||||||
Body::Humanoid(_) => 2,
|
Body::Humanoid(_) => 2,
|
||||||
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
|
Body::QuadrupedSmall(_) => 1,
|
||||||
_ => 1,
|
Body::QuadrupedMedium(_) => 1,
|
||||||
},
|
Body::BirdMedium(_) => 1,
|
||||||
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
|
|
||||||
_ => 1,
|
|
||||||
},
|
|
||||||
Body::BirdMedium(bird_medium) => match bird_medium.species {
|
|
||||||
_ => 1,
|
|
||||||
},
|
|
||||||
Body::FishMedium(_) => 1,
|
Body::FishMedium(_) => 1,
|
||||||
Body::Dragon(dragon) => match dragon.species {
|
Body::Dragon(_) => 32,
|
||||||
_ => 32,
|
|
||||||
},
|
|
||||||
Body::BirdSmall(_) => 1,
|
Body::BirdSmall(_) => 1,
|
||||||
Body::FishSmall(_) => 1,
|
Body::FishSmall(_) => 1,
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(_) => 2,
|
||||||
_ => 2,
|
|
||||||
},
|
|
||||||
Body::Object(_) => 0,
|
Body::Object(_) => 0,
|
||||||
Body::Golem(golem) => match golem.species {
|
Body::Golem(_) => 5,
|
||||||
_ => 5,
|
Body::Critter(_) => 1,
|
||||||
},
|
Body::QuadrupedLow(_) => 1,
|
||||||
Body::Critter(critter) => match critter.species {
|
|
||||||
_ => 1,
|
|
||||||
},
|
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
|
||||||
_ => 1,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,9 +426,7 @@ impl Body {
|
|||||||
_ => 30,
|
_ => 30,
|
||||||
},
|
},
|
||||||
Body::FishMedium(_) => 10,
|
Body::FishMedium(_) => 10,
|
||||||
Body::Dragon(dragon) => match dragon.species {
|
Body::Dragon(_) => 5000,
|
||||||
_ => 5000,
|
|
||||||
},
|
|
||||||
Body::BirdSmall(_) => 10,
|
Body::BirdSmall(_) => 10,
|
||||||
Body::FishSmall(_) => 10,
|
Body::FishSmall(_) => 10,
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(biped_large) => match biped_large.species {
|
||||||
@ -474,12 +438,8 @@ impl Body {
|
|||||||
_ => 60,
|
_ => 60,
|
||||||
},
|
},
|
||||||
Body::Object(_) => 0,
|
Body::Object(_) => 0,
|
||||||
Body::Golem(golem) => match golem.species {
|
Body::Golem(_) => 250,
|
||||||
_ => 250,
|
Body::Critter(_) => 10,
|
||||||
},
|
|
||||||
Body::Critter(critter) => match critter.species {
|
|
||||||
_ => 10,
|
|
||||||
},
|
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
||||||
quadruped_low::Species::Crocodile => 50,
|
quadruped_low::Species::Crocodile => 50,
|
||||||
quadruped_low::Species::Alligator => 50,
|
quadruped_low::Species::Alligator => 50,
|
||||||
@ -495,38 +455,21 @@ impl Body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unreachable_patterns)]
|
|
||||||
pub fn base_range(&self) -> f32 {
|
pub fn base_range(&self) -> f32 {
|
||||||
match self {
|
match self {
|
||||||
Body::Humanoid(_) => 5.0,
|
Body::Humanoid(_) => 5.0,
|
||||||
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
|
Body::QuadrupedSmall(_) => 4.5,
|
||||||
_ => 4.5,
|
Body::QuadrupedMedium(_) => 5.5,
|
||||||
},
|
Body::BirdMedium(_) => 3.5,
|
||||||
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
|
|
||||||
_ => 5.5,
|
|
||||||
},
|
|
||||||
Body::BirdMedium(bird_medium) => match bird_medium.species {
|
|
||||||
_ => 3.5,
|
|
||||||
},
|
|
||||||
Body::FishMedium(_) => 3.5,
|
Body::FishMedium(_) => 3.5,
|
||||||
Body::Dragon(dragon) => match dragon.species {
|
Body::Dragon(_) => 12.5,
|
||||||
_ => 12.5,
|
|
||||||
},
|
|
||||||
Body::BirdSmall(_) => 3.0,
|
Body::BirdSmall(_) => 3.0,
|
||||||
Body::FishSmall(_) => 3.0,
|
Body::FishSmall(_) => 3.0,
|
||||||
Body::BipedLarge(biped_large) => match biped_large.species {
|
Body::BipedLarge(_) => 10.0,
|
||||||
_ => 10.0,
|
|
||||||
},
|
|
||||||
Body::Object(_) => 3.0,
|
Body::Object(_) => 3.0,
|
||||||
Body::Golem(golem) => match golem.species {
|
Body::Golem(_) => 7.5,
|
||||||
_ => 7.5,
|
Body::Critter(_) => 3.0,
|
||||||
},
|
Body::QuadrupedLow(_) => 4.5,
|
||||||
Body::Critter(critter) => match critter.species {
|
|
||||||
_ => 3.0,
|
|
||||||
},
|
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
|
||||||
_ => 4.5,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -619,12 +619,12 @@ fn handle_spawn(
|
|||||||
);
|
);
|
||||||
} else if let Some(group) = match alignment {
|
} else if let Some(group) = match alignment {
|
||||||
comp::Alignment::Wild => None,
|
comp::Alignment::Wild => None,
|
||||||
|
comp::Alignment::Passive => None,
|
||||||
comp::Alignment::Enemy => Some(comp::group::ENEMY),
|
comp::Alignment::Enemy => Some(comp::group::ENEMY),
|
||||||
comp::Alignment::Npc | comp::Alignment::Tame => {
|
comp::Alignment::Npc | comp::Alignment::Tame => {
|
||||||
Some(comp::group::NPC)
|
Some(comp::group::NPC)
|
||||||
},
|
},
|
||||||
comp::Alignment::Owned(_) => unreachable!(),
|
comp::Alignment::Owned(_) => unreachable!(),
|
||||||
_ => None,
|
|
||||||
} {
|
} {
|
||||||
let _ =
|
let _ =
|
||||||
server.state.ecs().write_storage().insert(new_entity, group);
|
server.state.ecs().write_storage().insert(new_entity, group);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
use crate::{sys, Server, StateExt};
|
use crate::{sys, Server, StateExt};
|
||||||
use common::{
|
use common::{
|
||||||
comp::{
|
comp::{
|
||||||
self, Agent, Alignment, Body, Gravity, Item, ItemDrop, LightEmitter, Loadout, Pos,
|
self, Agent, Alignment, Body, Gravity, Item, ItemDrop, LightAnimation, LightEmitter,
|
||||||
Projectile, Scale, Stats, Vel, WaypointArea,
|
Loadout, Pos, Projectile, Scale, Stats, Vel, WaypointArea,
|
||||||
},
|
},
|
||||||
outcome::Outcome,
|
outcome::Outcome,
|
||||||
util::Dir,
|
util::Dir,
|
||||||
@ -40,11 +40,11 @@ pub fn handle_create_npc(
|
|||||||
) {
|
) {
|
||||||
let group = match alignment {
|
let group = match alignment {
|
||||||
Alignment::Wild => None,
|
Alignment::Wild => None,
|
||||||
|
Alignment::Passive => None,
|
||||||
Alignment::Enemy => Some(group::ENEMY),
|
Alignment::Enemy => Some(group::ENEMY),
|
||||||
Alignment::Npc | Alignment::Tame => Some(group::NPC),
|
Alignment::Npc | Alignment::Tame => Some(group::NPC),
|
||||||
// TODO: handle
|
// TODO: handle
|
||||||
Alignment::Owned(_) => None,
|
Alignment::Owned(_) => None,
|
||||||
_ => None,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let entity = server
|
let entity = server
|
||||||
@ -124,6 +124,11 @@ pub fn handle_create_waypoint(server: &mut Server, pos: Vec3<f32>) {
|
|||||||
flicker: 1.0,
|
flicker: 1.0,
|
||||||
animated: true,
|
animated: true,
|
||||||
})
|
})
|
||||||
|
.with(LightAnimation {
|
||||||
|
offset: Vec3::new(0.0, 0.0, 2.0),
|
||||||
|
col: Rgb::new(1.0, 0.8, 0.0),
|
||||||
|
strength: 8.0,
|
||||||
|
})
|
||||||
.with(WaypointArea::default())
|
.with(WaypointArea::default())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -233,12 +233,8 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Some(common::comp::Body::QuadrupedMedium(quadruped_medium)) => {
|
Some(common::comp::Body::QuadrupedMedium(_)) => match rng.gen_range(0, 4) {
|
||||||
match quadruped_medium.species {
|
0 => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food"),
|
||||||
_ => match rng.gen_range(0, 4) {
|
|
||||||
0 => assets::load_expect::<Lottery<String>>(
|
|
||||||
"common.loot_tables.loot_table_food",
|
|
||||||
),
|
|
||||||
1 => assets::load_expect::<Lottery<String>>(
|
1 => assets::load_expect::<Lottery<String>>(
|
||||||
"common.loot_tables.loot_table_armor_misc",
|
"common.loot_tables.loot_table_armor_misc",
|
||||||
),
|
),
|
||||||
@ -249,24 +245,15 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
|
|||||||
"common.loot_tables.loot_table_animal_parts",
|
"common.loot_tables.loot_table_animal_parts",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
}
|
Some(common::comp::Body::BirdMedium(_)) => match rng.gen_range(0, 3) {
|
||||||
},
|
0 => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food"),
|
||||||
Some(common::comp::Body::BirdMedium(bird_medium)) => match bird_medium.species {
|
|
||||||
_ => match rng.gen_range(0, 3) {
|
|
||||||
0 => {
|
|
||||||
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food")
|
|
||||||
},
|
|
||||||
1 => assets::load_expect::<Lottery<String>>(
|
1 => assets::load_expect::<Lottery<String>>(
|
||||||
"common.loot_tables.loot_table_armor_misc",
|
"common.loot_tables.loot_table_armor_misc",
|
||||||
),
|
),
|
||||||
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
||||||
},
|
},
|
||||||
},
|
Some(common::comp::Body::BipedLarge(_)) => match rng.gen_range(0, 8) {
|
||||||
Some(common::comp::Body::BipedLarge(biped_large)) => match biped_large.species {
|
0 => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food"),
|
||||||
_ => match rng.gen_range(0, 8) {
|
|
||||||
0 => {
|
|
||||||
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food")
|
|
||||||
},
|
|
||||||
1 => assets::load_expect::<Lottery<String>>(
|
1 => assets::load_expect::<Lottery<String>>(
|
||||||
"common.loot_tables.loot_table_armor_nature",
|
"common.loot_tables.loot_table_armor_nature",
|
||||||
),
|
),
|
||||||
@ -283,12 +270,8 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
|
|||||||
"common.loot_tables.loot_table_cave_large",
|
"common.loot_tables.loot_table_cave_large",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
Some(common::comp::Body::Golem(_)) => match rng.gen_range(0, 9) {
|
||||||
Some(common::comp::Body::Golem(golem)) => match golem.species {
|
0 => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food"),
|
||||||
_ => match rng.gen_range(0, 9) {
|
|
||||||
0 => {
|
|
||||||
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food")
|
|
||||||
},
|
|
||||||
1 => assets::load_expect::<Lottery<String>>(
|
1 => assets::load_expect::<Lottery<String>>(
|
||||||
"common.loot_tables.loot_table_armor_misc",
|
"common.loot_tables.loot_table_armor_misc",
|
||||||
),
|
),
|
||||||
@ -312,28 +295,19 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
|
|||||||
),
|
),
|
||||||
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
||||||
},
|
},
|
||||||
},
|
Some(common::comp::Body::Critter(_)) => {
|
||||||
Some(common::comp::Body::Critter(critter)) => match critter.species {
|
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_animal_parts")
|
||||||
_ => match rng.gen_range(0, 3) {
|
|
||||||
_ => assets::load_expect::<Lottery<String>>(
|
|
||||||
"common.loot_tables.loot_table_animal_parts",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Some(common::comp::Body::Dragon(_)) => {
|
Some(common::comp::Body::Dragon(_)) => {
|
||||||
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_weapon_rare")
|
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_weapon_rare")
|
||||||
},
|
},
|
||||||
Some(common::comp::Body::QuadrupedLow(quadruped_low)) => match quadruped_low.species {
|
Some(common::comp::Body::QuadrupedLow(_)) => match rng.gen_range(0, 3) {
|
||||||
_ => match rng.gen_range(0, 3) {
|
0 => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food"),
|
||||||
0 => {
|
|
||||||
assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table_food")
|
|
||||||
},
|
|
||||||
1 => assets::load_expect::<Lottery<String>>(
|
1 => assets::load_expect::<Lottery<String>>(
|
||||||
"common.loot_tables.loot_table_animal_parts",
|
"common.loot_tables.loot_table_animal_parts",
|
||||||
),
|
),
|
||||||
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
||||||
},
|
},
|
||||||
},
|
|
||||||
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
_ => assets::load_expect::<Lottery<String>>("common.loot_tables.loot_table"),
|
||||||
};
|
};
|
||||||
let drop = drop.choose();
|
let drop = drop.choose();
|
||||||
|
@ -47,7 +47,6 @@ gilrs = { version = "0.7", features = ["serde"] }
|
|||||||
server = { package = "veloren-server", path = "../server", optional = true }
|
server = { package = "veloren-server", path = "../server", optional = true }
|
||||||
|
|
||||||
# Utility
|
# Utility
|
||||||
format_num = "0.1.0"
|
|
||||||
glsl-include = "0.3.1"
|
glsl-include = "0.3.1"
|
||||||
failure = "0.1.6"
|
failure = "0.1.6"
|
||||||
dot_vox = "4.0"
|
dot_vox = "4.0"
|
||||||
|
@ -246,24 +246,20 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
{
|
{
|
||||||
let output_text = format!("x{}", &recipe.output.1.to_string());
|
let output_text = format!("x{}", &recipe.output.1.to_string());
|
||||||
// Output Image
|
// Output Image
|
||||||
|
let (title, desc) = super::util::item_text(&recipe.output.0);
|
||||||
Button::image(
|
Button::image(
|
||||||
self.item_imgs
|
self.item_imgs
|
||||||
.img_id_or_not_found_img((&recipe.output.0).into()),
|
.img_id_or_not_found_img((&recipe.output.0).into()),
|
||||||
)
|
)
|
||||||
.w_h(55.0, 55.0)
|
.w_h(55.0, 55.0)
|
||||||
.middle_of(state.ids.output_img_frame)
|
.middle_of(state.ids.output_img_frame)
|
||||||
.label(if recipe.output.1 > 1 {&output_text} else {""}) // Only show output amount for amounts > 1
|
.label(&output_text)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
.label_font_size(self.fonts.cyri.scale(14))
|
.label_font_size(self.fonts.cyri.scale(14))
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.label_y(conrod_core::position::Relative::Scalar(-24.0))
|
.label_y(conrod_core::position::Relative::Scalar(-24.0))
|
||||||
.label_x(conrod_core::position::Relative::Scalar(24.0))
|
.label_x(conrod_core::position::Relative::Scalar(24.0))
|
||||||
.with_tooltip(
|
.with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip)
|
||||||
self.tooltip_manager,
|
|
||||||
recipe.output.0.name(),
|
|
||||||
recipe.output.0.description(),
|
|
||||||
&item_tooltip,
|
|
||||||
)
|
|
||||||
.set(state.ids.output_img, ui);
|
.set(state.ids.output_img, ui);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -395,13 +391,12 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
};
|
};
|
||||||
frame.set(state.ids.ingredient_frame[i], ui);
|
frame.set(state.ids.ingredient_frame[i], ui);
|
||||||
//Item Image
|
//Item Image
|
||||||
let title = item.name();
|
let (title, desc) = super::util::item_text(&item);
|
||||||
let desc = item.description();
|
|
||||||
Button::image(self.item_imgs.img_id_or_not_found_img(item.into()))
|
Button::image(self.item_imgs.img_id_or_not_found_img(item.into()))
|
||||||
.w_h(22.0, 22.0)
|
.w_h(22.0, 22.0)
|
||||||
.middle_of(state.ids.ingredient_frame[i])
|
.middle_of(state.ids.ingredient_frame[i])
|
||||||
//.image_color(col)
|
//.image_color(col)
|
||||||
.with_tooltip(self.tooltip_manager, title, desc, &item_tooltip)
|
.with_tooltip(self.tooltip_manager, title, &*desc, &item_tooltip)
|
||||||
.set(state.ids.ingredient_img[i], ui);
|
.set(state.ids.ingredient_img[i], ui);
|
||||||
// Ingredients text and amount
|
// Ingredients text and amount
|
||||||
// Don't show inventory amounts above 999 to avoid the widget clipping
|
// Don't show inventory amounts above 999 to avoid the widget clipping
|
||||||
|
@ -1723,7 +1723,7 @@ impl Hud {
|
|||||||
self.show.stats = false;
|
self.show.stats = false;
|
||||||
self.show.bag(false);
|
self.show.bag(false);
|
||||||
self.show.crafting(false);
|
self.show.crafting(false);
|
||||||
if self.show.social == false {
|
if !self.show.social {
|
||||||
self.show.want_grab = true;
|
self.show.want_grab = true;
|
||||||
self.force_ungrab = false;
|
self.force_ungrab = false;
|
||||||
} else {
|
} else {
|
||||||
@ -1805,7 +1805,7 @@ impl Hud {
|
|||||||
self.show.stats = false;
|
self.show.stats = false;
|
||||||
self.show.crafting(false);
|
self.show.crafting(false);
|
||||||
self.show.bag(false);
|
self.show.bag(false);
|
||||||
if self.show.social == false {
|
if !self.show.social {
|
||||||
self.show.want_grab = true;
|
self.show.want_grab = true;
|
||||||
self.force_ungrab = false;
|
self.force_ungrab = false;
|
||||||
} else {
|
} else {
|
||||||
@ -2032,7 +2032,7 @@ impl Hud {
|
|||||||
match event {
|
match event {
|
||||||
social::Event::Close => {
|
social::Event::Close => {
|
||||||
self.show.social(false);
|
self.show.social(false);
|
||||||
if self.show.bag == false {
|
if !self.show.bag {
|
||||||
self.show.want_grab = true;
|
self.show.want_grab = true;
|
||||||
self.force_ungrab = false;
|
self.force_ungrab = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -155,7 +155,9 @@ impl<'a> Widget for Overhead<'a> {
|
|||||||
let hp_percentage =
|
let hp_percentage =
|
||||||
self.stats.health.current() as f64 / self.stats.health.maximum() as f64 * 100.0;
|
self.stats.health.current() as f64 / self.stats.health.maximum() as f64 * 100.0;
|
||||||
let level_comp = self.stats.level.level() as i64 - self.own_level as i64;
|
let level_comp = self.stats.level.level() as i64 - self.own_level as i64;
|
||||||
let name_y = if hp_percentage == 100.0 {
|
let health_current = (self.stats.health.current() / 10) as f64;
|
||||||
|
let health_max = (self.stats.health.maximum() / 10) as f64;
|
||||||
|
let name_y = if (health_current - health_max).abs() < 1e-6 {
|
||||||
MANA_BAR_Y + 20.0
|
MANA_BAR_Y + 20.0
|
||||||
} else if level_comp > 9 {
|
} else if level_comp > 9 {
|
||||||
MANA_BAR_Y + 38.0
|
MANA_BAR_Y + 38.0
|
||||||
@ -163,22 +165,17 @@ impl<'a> Widget for Overhead<'a> {
|
|||||||
MANA_BAR_Y + 32.0
|
MANA_BAR_Y + 32.0
|
||||||
};
|
};
|
||||||
let font_size = if hp_percentage.abs() > 99.9 { 24 } else { 20 };
|
let font_size = if hp_percentage.abs() > 99.9 { 24 } else { 20 };
|
||||||
let health_current = (self.stats.health.current() / 10) as f64;
|
|
||||||
let health_max = (self.stats.health.maximum() / 10) as f64;
|
|
||||||
// Show K for numbers above 10^3 and truncate them
|
// Show K for numbers above 10^3 and truncate them
|
||||||
// Show M for numbers above 10^6 and truncate them
|
// Show M for numbers above 10^6 and truncate them
|
||||||
let health_cur_txt = match health_current as u32 {
|
let health_cur_txt = match health_current as u32 {
|
||||||
0..=999 => format!("{}", (health_current).trunc().max(1.0) as u32),
|
0..=999 => format!("{:.0}", health_current.max(1.0)),
|
||||||
1000..=999999 => format!("{}K", (health_current / 1000.0).trunc() as u32),
|
1000..=999999 => format!("{:.0}K", (health_current / 1000.0).max(1.0)),
|
||||||
_ => format!(
|
_ => format!("{:.0}M", (health_current as f64 / 1.0e6).max(1.0)),
|
||||||
"{}M",
|
|
||||||
(health_current as f64 / 10f64.powf(6.0)).trunc() as u32
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
let health_max_txt = match health_max as u32 {
|
let health_max_txt = match health_max as u32 {
|
||||||
0..=999 => format!("{}", (health_max).trunc() as u32),
|
0..=999 => format!("{:.0}", health_max.max(1.0)),
|
||||||
1000..=999999 => format!("{}K", (health_max / 1000.0).trunc() as u32),
|
1000..=999999 => format!("{:.0}K", (health_max / 1000.0).max(1.0)),
|
||||||
_ => format!("{}M", (health_max / 10f64.powf(6.0)).trunc() as u32),
|
_ => format!("{:.0}M", (health_max as f64 / 1.0e6).max(1.0)),
|
||||||
};
|
};
|
||||||
// Name
|
// Name
|
||||||
Text::new(&self.name)
|
Text::new(&self.name)
|
||||||
@ -195,7 +192,9 @@ impl<'a> Widget for Overhead<'a> {
|
|||||||
GROUP_MEMBER
|
GROUP_MEMBER
|
||||||
/*} else if targets player { //TODO: Add a way to see if the entity is trying to attack the player, their pet(s) or a member of their group and recolour their nametag accordingly
|
/*} else if targets player { //TODO: Add a way to see if the entity is trying to attack the player, their pet(s) or a member of their group and recolour their nametag accordingly
|
||||||
DEFAULT_NPC*/
|
DEFAULT_NPC*/
|
||||||
} else {DEFAULT_NPC})
|
} else {
|
||||||
|
DEFAULT_NPC
|
||||||
|
})
|
||||||
.x_y(0.0, name_y + 1.0)
|
.x_y(0.0, name_y + 1.0)
|
||||||
.parent(id)
|
.parent(id)
|
||||||
.set(state.ids.name, ui);
|
.set(state.ids.name, ui);
|
||||||
|
@ -344,7 +344,7 @@ impl<'a> Widget for Social<'a> {
|
|||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.set(state.ids.online_txt, ui);
|
.set(state.ids.online_txt, ui);
|
||||||
Text::new(&(count - 1).to_string())
|
Text::new(&count.to_string())
|
||||||
.right_from(state.ids.online_txt, 5.0)
|
.right_from(state.ids.online_txt, 5.0)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
|
@ -145,19 +145,19 @@ pub fn apply_scatter_to<'a>(
|
|||||||
// Grass
|
// Grass
|
||||||
(ShortGrass, false, |c| {
|
(ShortGrass, false, |c| {
|
||||||
(
|
(
|
||||||
close(c.temp, 0.3, 0.4).min(close(c.humidity, 0.6, 0.35)) * 0.5,
|
close(c.temp, 0.3, 0.4).min(close(c.humidity, 0.6, 0.35)) * 0.05,
|
||||||
Some((48.0, 0.4)),
|
Some((48.0, 0.4)),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
(MediumGrass, false, |c| {
|
(MediumGrass, false, |c| {
|
||||||
(
|
(
|
||||||
close(c.temp, 0.0, 0.6).min(close(c.humidity, 0.6, 0.35)) * 0.5,
|
close(c.temp, 0.0, 0.6).min(close(c.humidity, 0.6, 0.35)) * 0.05,
|
||||||
Some((48.0, 0.2)),
|
Some((48.0, 0.2)),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
(LongGrass, false, |c| {
|
(LongGrass, false, |c| {
|
||||||
(
|
(
|
||||||
close(c.temp, 0.4, 0.4).min(close(c.humidity, 0.8, 0.2)) * 0.5,
|
close(c.temp, 0.4, 0.4).min(close(c.humidity, 0.8, 0.2)) * 0.08,
|
||||||
Some((48.0, 0.1)),
|
Some((48.0, 0.1)),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
@ -168,7 +168,7 @@ pub fn apply_scatter_to<'a>(
|
|||||||
c.humidity,
|
c.humidity,
|
||||||
CONFIG.jungle_hum,
|
CONFIG.jungle_hum,
|
||||||
0.6,
|
0.6,
|
||||||
)) * 0.5,
|
)) * 0.08,
|
||||||
Some((60.0, 5.0)),
|
Some((60.0, 5.0)),
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
@ -508,7 +508,7 @@ pub fn apply_caves_to<'a>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[allow(clippy::eval_order_dependence)]
|
||||||
pub fn apply_caves_supplement<'a>(
|
pub fn apply_caves_supplement<'a>(
|
||||||
rng: &mut impl Rng,
|
rng: &mut impl Rng,
|
||||||
wpos2d: Vec2<i32>,
|
wpos2d: Vec2<i32>,
|
||||||
|
@ -105,6 +105,7 @@ impl World {
|
|||||||
pub fn sample_blocks(&self) -> BlockGen { BlockGen::new(ColumnGen::new(&self.sim)) }
|
pub fn sample_blocks(&self) -> BlockGen { BlockGen::new(ColumnGen::new(&self.sim)) }
|
||||||
|
|
||||||
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
#[allow(clippy::or_fun_call)] // TODO: Pending review in #587
|
||||||
|
#[allow(clippy::eval_order_dependence)]
|
||||||
pub fn generate_chunk(
|
pub fn generate_chunk(
|
||||||
&self,
|
&self,
|
||||||
index: IndexRef,
|
index: IndexRef,
|
||||||
@ -205,9 +206,9 @@ impl World {
|
|||||||
let mut rng = rand::thread_rng();
|
let mut rng = rand::thread_rng();
|
||||||
|
|
||||||
// Apply layers (paths, caves, etc.)
|
// Apply layers (paths, caves, etc.)
|
||||||
|
layer::apply_caves_to(chunk_wpos2d, sample_get, &mut chunk, index);
|
||||||
layer::apply_scatter_to(chunk_wpos2d, sample_get, &mut chunk, index, sim_chunk);
|
layer::apply_scatter_to(chunk_wpos2d, sample_get, &mut chunk, index, sim_chunk);
|
||||||
layer::apply_paths_to(chunk_wpos2d, sample_get, &mut chunk, index);
|
layer::apply_paths_to(chunk_wpos2d, sample_get, &mut chunk, index);
|
||||||
layer::apply_caves_to(chunk_wpos2d, sample_get, &mut chunk, index);
|
|
||||||
|
|
||||||
// Apply site generation
|
// Apply site generation
|
||||||
sim_chunk.sites.iter().for_each(|site| {
|
sim_chunk.sites.iter().for_each(|site| {
|
||||||
@ -236,12 +237,9 @@ impl World {
|
|||||||
&& sim_chunk.chaos < 0.5
|
&& sim_chunk.chaos < 0.5
|
||||||
&& !sim_chunk.is_underwater()
|
&& !sim_chunk.is_underwater()
|
||||||
{
|
{
|
||||||
|
// TODO: REFACTOR: Define specific alignments in a config file instead of here
|
||||||
let is_hostile: bool;
|
let is_hostile: bool;
|
||||||
let is_giant = if rng.gen_range(0, 8) == 0 {
|
let is_giant = rng.gen_range(0, 8) == 0;
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
};
|
|
||||||
let quadmed = comp::Body::QuadrupedMedium(quadruped_medium::Body::random()); // Not all of them are hostile so we have to do the rng here
|
let quadmed = comp::Body::QuadrupedMedium(quadruped_medium::Body::random()); // Not all of them are hostile so we have to do the rng here
|
||||||
let quadlow = comp::Body::QuadrupedLow(quadruped_low::Body::random()); // Not all of them are hostile so we have to do the rng here
|
let quadlow = comp::Body::QuadrupedLow(quadruped_low::Body::random()); // Not all of them are hostile so we have to do the rng here
|
||||||
let entity = EntityInfo::at(gen_entity_pos())
|
let entity = EntityInfo::at(gen_entity_pos())
|
||||||
|
Loading…
Reference in New Issue
Block a user