mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
initial setup
This commit is contained in:
parent
eb7d712093
commit
da3c2369e5
BIN
assets/voxygen/element/ui/map/buttons/adlet.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/ui/map/buttons/adlet.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/ui/map/buttons/adlet_bg.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/ui/map/buttons/adlet_bg.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/ui/map/buttons/adlet_hover.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/ui/map/buttons/adlet_hover.png
(Stored with Git LFS)
Normal file
Binary file not shown.
8
assets/world/manifests/site_structures/adlet/igloo.ron
Normal file
8
assets/world/manifests/site_structures/adlet/igloo.ron
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#![enable(unwrap_newtypes)]
|
||||||
|
|
||||||
|
[
|
||||||
|
(
|
||||||
|
specifier: "world.structure.natural.igloo",
|
||||||
|
center: (14, 13, 3),
|
||||||
|
),
|
||||||
|
]
|
@ -150,6 +150,7 @@ pub enum SiteKind {
|
|||||||
Gnarling,
|
Gnarling,
|
||||||
ChapelSite,
|
ChapelSite,
|
||||||
Bridge,
|
Bridge,
|
||||||
|
Adlet,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
@ -532,6 +532,9 @@ image_ids! {
|
|||||||
mmap_site_gnarling: "voxygen.element.ui.map.buttons.gnarling",
|
mmap_site_gnarling: "voxygen.element.ui.map.buttons.gnarling",
|
||||||
mmap_site_gnarling_hover: "voxygen.element.ui.map.buttons.gnarling_hover",
|
mmap_site_gnarling_hover: "voxygen.element.ui.map.buttons.gnarling_hover",
|
||||||
mmap_site_gnarling_bg: "voxygen.element.ui.map.buttons.gnarling_bg",
|
mmap_site_gnarling_bg: "voxygen.element.ui.map.buttons.gnarling_bg",
|
||||||
|
mmap_site_adlet: "voxygen.element.ui.map.buttons.adlet",
|
||||||
|
mmap_site_adlet_hover: "voxygen.element.ui.map.buttons.adlet_hover",
|
||||||
|
mmap_site_adlet_bg: "voxygen.element.ui.map.buttons.adlet_bg",
|
||||||
mmap_site_minotaur: "voxygen.element.ui.map.buttons.minotaur",
|
mmap_site_minotaur: "voxygen.element.ui.map.buttons.minotaur",
|
||||||
mmap_site_minotaur_hover: "voxygen.element.ui.map.buttons.minotaur_hover",
|
mmap_site_minotaur_hover: "voxygen.element.ui.map.buttons.minotaur_hover",
|
||||||
mmap_site_minotaur_bg: "voxygen.element.ui.map.buttons.minotaur_bg",
|
mmap_site_minotaur_bg: "voxygen.element.ui.map.buttons.minotaur_bg",
|
||||||
|
@ -924,6 +924,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
SiteKind::Gnarling => i18n.get_msg("hud-map-gnarling"),
|
SiteKind::Gnarling => i18n.get_msg("hud-map-gnarling"),
|
||||||
SiteKind::ChapelSite => i18n.get_msg("hud-map-chapel_Site"),
|
SiteKind::ChapelSite => i18n.get_msg("hud-map-chapel_Site"),
|
||||||
SiteKind::Bridge => i18n.get_msg("hud-map-bridge"),
|
SiteKind::Bridge => i18n.get_msg("hud-map-bridge"),
|
||||||
|
SiteKind::Adlet => i18n.get_msg("hud.map.adlet"),
|
||||||
});
|
});
|
||||||
let (difficulty, desc) = match &site.kind {
|
let (difficulty, desc) = match &site.kind {
|
||||||
SiteKind::Town => (None, i18n.get_msg("hud-map-town")),
|
SiteKind::Town => (None, i18n.get_msg("hud-map-town")),
|
||||||
@ -950,6 +951,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
SiteKind::Gnarling => (Some(0), i18n.get_msg("hud-map-gnarling")),
|
SiteKind::Gnarling => (Some(0), i18n.get_msg("hud-map-gnarling")),
|
||||||
SiteKind::ChapelSite => (Some(3), i18n.get_msg("hud-map-chapel_site")),
|
SiteKind::ChapelSite => (Some(3), i18n.get_msg("hud-map-chapel_site")),
|
||||||
SiteKind::Bridge => (None, i18n.get_msg("hud-map-bridge")),
|
SiteKind::Bridge => (None, i18n.get_msg("hud-map-bridge")),
|
||||||
|
SiteKind::Adlet => (Some(0), i18n.get_msg("hud.map.adlet")),
|
||||||
};
|
};
|
||||||
let desc = desc.into_owned() + &get_site_economy(site_rich);
|
let desc = desc.into_owned() + &get_site_economy(site_rich);
|
||||||
let site_btn = Button::image(match &site.kind {
|
let site_btn = Button::image(match &site.kind {
|
||||||
@ -959,6 +961,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
SiteKind::Cave => self.imgs.mmap_site_cave,
|
SiteKind::Cave => self.imgs.mmap_site_cave,
|
||||||
SiteKind::Tree => self.imgs.mmap_site_tree,
|
SiteKind::Tree => self.imgs.mmap_site_tree,
|
||||||
SiteKind::Gnarling => self.imgs.mmap_site_gnarling,
|
SiteKind::Gnarling => self.imgs.mmap_site_gnarling,
|
||||||
|
SiteKind::Adlet => self.imgs.mmap_site_adlet,
|
||||||
SiteKind::Dungeon { difficulty } => match difficulty {
|
SiteKind::Dungeon { difficulty } => match difficulty {
|
||||||
4 => self.imgs.mmap_site_minotaur,
|
4 => self.imgs.mmap_site_minotaur,
|
||||||
5 => self.imgs.mmap_site_mindflayer,
|
5 => self.imgs.mmap_site_mindflayer,
|
||||||
@ -979,6 +982,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
SiteKind::Cave => self.imgs.mmap_site_cave_hover,
|
SiteKind::Cave => self.imgs.mmap_site_cave_hover,
|
||||||
SiteKind::Tree => self.imgs.mmap_site_tree_hover,
|
SiteKind::Tree => self.imgs.mmap_site_tree_hover,
|
||||||
SiteKind::Gnarling => self.imgs.mmap_site_gnarling_hover,
|
SiteKind::Gnarling => self.imgs.mmap_site_gnarling_hover,
|
||||||
|
SiteKind::Adlet => self.imgs.mmap_site_adlet_hover,
|
||||||
SiteKind::Dungeon { difficulty } => match difficulty {
|
SiteKind::Dungeon { difficulty } => match difficulty {
|
||||||
4 => self.imgs.mmap_site_minotaur_hover,
|
4 => self.imgs.mmap_site_minotaur_hover,
|
||||||
5 => self.imgs.mmap_site_mindflayer_hover,
|
5 => self.imgs.mmap_site_mindflayer_hover,
|
||||||
@ -995,15 +999,16 @@ impl<'a> Widget for Map<'a> {
|
|||||||
match &site.kind {
|
match &site.kind {
|
||||||
SiteKind::Town => TEXT_COLOR,
|
SiteKind::Town => TEXT_COLOR,
|
||||||
SiteKind::Castle => TEXT_COLOR,
|
SiteKind::Castle => TEXT_COLOR,
|
||||||
SiteKind::Dungeon { .. } | SiteKind::Gnarling | SiteKind::ChapelSite => {
|
SiteKind::Dungeon { .. }
|
||||||
match difficulty {
|
| SiteKind::Gnarling
|
||||||
Some(0) => QUALITY_LOW,
|
| SiteKind::ChapelSite
|
||||||
Some(1) => QUALITY_COMMON,
|
| SiteKind::Adlet => match difficulty {
|
||||||
Some(2) => QUALITY_MODERATE,
|
Some(0) => QUALITY_LOW,
|
||||||
Some(3) => QUALITY_HIGH,
|
Some(1) => QUALITY_COMMON,
|
||||||
Some(4 | 5) => QUALITY_EPIC,
|
Some(2) => QUALITY_MODERATE,
|
||||||
_ => TEXT_COLOR,
|
Some(3) => QUALITY_HIGH,
|
||||||
}
|
Some(4 | 5) => QUALITY_EPIC,
|
||||||
|
_ => TEXT_COLOR,
|
||||||
},
|
},
|
||||||
SiteKind::Cave => TEXT_COLOR,
|
SiteKind::Cave => TEXT_COLOR,
|
||||||
SiteKind::Tree => TEXT_COLOR,
|
SiteKind::Tree => TEXT_COLOR,
|
||||||
@ -1022,9 +1027,10 @@ impl<'a> Widget for Map<'a> {
|
|||||||
// Only display sites that are toggled on
|
// Only display sites that are toggled on
|
||||||
let show_site = match &site.kind {
|
let show_site = match &site.kind {
|
||||||
SiteKind::Town => show_towns,
|
SiteKind::Town => show_towns,
|
||||||
SiteKind::Dungeon { .. } | SiteKind::Gnarling | SiteKind::ChapelSite => {
|
SiteKind::Dungeon { .. }
|
||||||
show_dungeons
|
| SiteKind::Gnarling
|
||||||
},
|
| SiteKind::ChapelSite
|
||||||
|
| SiteKind::Adlet => show_dungeons,
|
||||||
SiteKind::Castle => show_castles,
|
SiteKind::Castle => show_castles,
|
||||||
SiteKind::Cave => show_caves,
|
SiteKind::Cave => show_caves,
|
||||||
SiteKind::Tree => show_trees,
|
SiteKind::Tree => show_trees,
|
||||||
@ -1081,7 +1087,10 @@ impl<'a> Widget for Map<'a> {
|
|||||||
dif_img.set(state.ids.site_difs[i], ui)
|
dif_img.set(state.ids.site_difs[i], ui)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SiteKind::Dungeon { .. } | SiteKind::Gnarling | SiteKind::ChapelSite => {
|
SiteKind::Dungeon { .. }
|
||||||
|
| SiteKind::Gnarling
|
||||||
|
| SiteKind::ChapelSite
|
||||||
|
| SiteKind::Adlet => {
|
||||||
if show_dungeons {
|
if show_dungeons {
|
||||||
dif_img.set(state.ids.site_difs[i], ui)
|
dif_img.set(state.ids.site_difs[i], ui)
|
||||||
}
|
}
|
||||||
|
@ -701,6 +701,7 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
SiteKind::Tree => None,
|
SiteKind::Tree => None,
|
||||||
SiteKind::Gnarling => Some(0),
|
SiteKind::Gnarling => Some(0),
|
||||||
SiteKind::Bridge => None,
|
SiteKind::Bridge => None,
|
||||||
|
SiteKind::Adlet => Some(1),
|
||||||
};
|
};
|
||||||
|
|
||||||
Image::new(match &site.kind {
|
Image::new(match &site.kind {
|
||||||
@ -712,6 +713,7 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
SiteKind::Tree => self.imgs.mmap_site_tree,
|
SiteKind::Tree => self.imgs.mmap_site_tree,
|
||||||
SiteKind::Gnarling => self.imgs.mmap_site_gnarling_bg,
|
SiteKind::Gnarling => self.imgs.mmap_site_gnarling_bg,
|
||||||
SiteKind::Bridge => self.imgs.mmap_site_bridge_bg,
|
SiteKind::Bridge => self.imgs.mmap_site_bridge_bg,
|
||||||
|
SiteKind::Adlet => self.imgs.mmap_site_adlet_bg,
|
||||||
})
|
})
|
||||||
.x_y_position_relative_to(
|
.x_y_position_relative_to(
|
||||||
state.ids.map_layers[0],
|
state.ids.map_layers[0],
|
||||||
@ -738,6 +740,7 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
SiteKind::Tree => self.imgs.mmap_site_tree,
|
SiteKind::Tree => self.imgs.mmap_site_tree,
|
||||||
SiteKind::Gnarling => self.imgs.mmap_site_gnarling,
|
SiteKind::Gnarling => self.imgs.mmap_site_gnarling,
|
||||||
SiteKind::Bridge => self.imgs.mmap_site_bridge,
|
SiteKind::Bridge => self.imgs.mmap_site_bridge,
|
||||||
|
SiteKind::Adlet => self.imgs.mmap_site_adlet,
|
||||||
})
|
})
|
||||||
.middle_of(state.ids.mmap_site_icons_bgs[i])
|
.middle_of(state.ids.mmap_site_icons_bgs[i])
|
||||||
.w_h(20.0, 20.0)
|
.w_h(20.0, 20.0)
|
||||||
|
@ -248,6 +248,10 @@ impl Civs {
|
|||||||
)?,
|
)?,
|
||||||
SiteKind::ChapelSite,
|
SiteKind::ChapelSite,
|
||||||
),
|
),
|
||||||
|
44..=49 => (
|
||||||
|
find_site_loc(&mut ctx, (&this.gnarling_enemies(), 40), SiteKind::Adlet)?,
|
||||||
|
SiteKind::Adlet,
|
||||||
|
),
|
||||||
_ => (
|
_ => (
|
||||||
find_site_loc(
|
find_site_loc(
|
||||||
&mut ctx,
|
&mut ctx,
|
||||||
@ -289,6 +293,7 @@ impl Civs {
|
|||||||
SiteKind::Gnarling => (16i32, 10.0),
|
SiteKind::Gnarling => (16i32, 10.0),
|
||||||
SiteKind::Citadel => (16i32, 0.0),
|
SiteKind::Citadel => (16i32, 0.0),
|
||||||
SiteKind::Bridge(_, _) => (0, 0.0),
|
SiteKind::Bridge(_, _) => (0, 0.0),
|
||||||
|
SiteKind::Adlet => (16i32, 10.0),
|
||||||
};
|
};
|
||||||
|
|
||||||
let (raise, raise_dist, make_waypoint): (f32, i32, bool) = match &site.kind {
|
let (raise, raise_dist, make_waypoint): (f32, i32, bool) = match &site.kind {
|
||||||
@ -420,6 +425,11 @@ impl Civs {
|
|||||||
*a,
|
*a,
|
||||||
*b,
|
*b,
|
||||||
)),
|
)),
|
||||||
|
SiteKind::Adlet => WorldSite::adlet(site2::Site::generate_adlet(
|
||||||
|
&Land::from_sim(ctx.sim),
|
||||||
|
&mut rng,
|
||||||
|
wpos,
|
||||||
|
)),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sim_site.site_tmp = Some(site);
|
sim_site.site_tmp = Some(site);
|
||||||
@ -1260,6 +1270,13 @@ impl Civs {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn adlet_enemies(&self) -> Vec<Vec2<i32>> {
|
||||||
|
self.sites().filter_map(|s| match s.kind {
|
||||||
|
SiteKind::Tree | SiteKind::GiantTree => None,
|
||||||
|
_ => Some(s.center),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
fn chapel_site_enemies(&self) -> impl Iterator<Item = Vec2<i32>> + '_ {
|
fn chapel_site_enemies(&self) -> impl Iterator<Item = Vec2<i32>> + '_ {
|
||||||
self.sites().filter_map(|s| match s.kind {
|
self.sites().filter_map(|s| match s.kind {
|
||||||
SiteKind::Tree | SiteKind::GiantTree => None,
|
SiteKind::Tree | SiteKind::GiantTree => None,
|
||||||
@ -1545,6 +1562,7 @@ pub enum SiteKind {
|
|||||||
Gnarling,
|
Gnarling,
|
||||||
Citadel,
|
Citadel,
|
||||||
Bridge(Vec2<i32>, Vec2<i32>),
|
Bridge(Vec2<i32>, Vec2<i32>),
|
||||||
|
Adlet,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SiteKind {
|
impl SiteKind {
|
||||||
@ -1672,6 +1690,7 @@ impl SiteKind {
|
|||||||
&& (-0.3..0.4).contains(&chunk.temp)
|
&& (-0.3..0.4).contains(&chunk.temp)
|
||||||
&& chunk.tree_density > 0.75
|
&& chunk.tree_density > 0.75
|
||||||
},
|
},
|
||||||
|
SiteKind::Adlet => (-0.8..0.2).contains(&chunk.temp) && chunk.tree_density > 0.2,
|
||||||
SiteKind::GiantTree | SiteKind::Tree => {
|
SiteKind::GiantTree | SiteKind::Tree => {
|
||||||
on_land()
|
on_land()
|
||||||
&& on_flat_terrain()
|
&& on_flat_terrain()
|
||||||
|
@ -177,6 +177,7 @@ impl World {
|
|||||||
civ::SiteKind::ChapelSite => world_msg::SiteKind::ChapelSite,
|
civ::SiteKind::ChapelSite => world_msg::SiteKind::ChapelSite,
|
||||||
civ::SiteKind::Citadel => world_msg::SiteKind::Castle,
|
civ::SiteKind::Citadel => world_msg::SiteKind::Castle,
|
||||||
civ::SiteKind::Bridge(_, _) => world_msg::SiteKind::Bridge,
|
civ::SiteKind::Bridge(_, _) => world_msg::SiteKind::Bridge,
|
||||||
|
civ::SiteKind::Adlet => world_msg::SiteKind::Adlet,
|
||||||
},
|
},
|
||||||
wpos: site.center * TerrainChunkSize::RECT_SIZE.map(|e| e as i32),
|
wpos: site.center * TerrainChunkSize::RECT_SIZE.map(|e| e as i32),
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,7 @@ impl Environment {
|
|||||||
SiteKind::Tree(_) => (),
|
SiteKind::Tree(_) => (),
|
||||||
SiteKind::GiantTree(_) => (),
|
SiteKind::GiantTree(_) => (),
|
||||||
SiteKind::Gnarling(_) => {},
|
SiteKind::Gnarling(_) => {},
|
||||||
|
SiteKind::Adlet(_) => {},
|
||||||
SiteKind::ChapelSite(_) => {},
|
SiteKind::ChapelSite(_) => {},
|
||||||
SiteKind::Bridge(_) => {},
|
SiteKind::Bridge(_) => {},
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ pub enum SiteKind {
|
|||||||
GiantTree(site2::Site),
|
GiantTree(site2::Site),
|
||||||
Gnarling(site2::Site),
|
Gnarling(site2::Site),
|
||||||
Bridge(site2::Site),
|
Bridge(site2::Site),
|
||||||
|
Adlet(site2::Site),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Site {
|
impl Site {
|
||||||
@ -98,6 +99,13 @@ impl Site {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn adlet(g: site2::Site) -> Self {
|
||||||
|
Self {
|
||||||
|
kind: SiteKind::Adlet(g),
|
||||||
|
economy: Economy::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn castle(c: Castle) -> Self {
|
pub fn castle(c: Castle) -> Self {
|
||||||
Self {
|
Self {
|
||||||
kind: SiteKind::Castle(c),
|
kind: SiteKind::Castle(c),
|
||||||
@ -175,6 +183,7 @@ impl Site {
|
|||||||
SiteKind::GiantTree(gt) => gt.radius(),
|
SiteKind::GiantTree(gt) => gt.radius(),
|
||||||
SiteKind::Gnarling(g) => g.radius(),
|
SiteKind::Gnarling(g) => g.radius(),
|
||||||
SiteKind::Bridge(b) => b.radius(),
|
SiteKind::Bridge(b) => b.radius(),
|
||||||
|
SiteKind::Adlet(g) => g.radius(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,6 +201,7 @@ impl Site {
|
|||||||
SiteKind::GiantTree(gt) => gt.origin,
|
SiteKind::GiantTree(gt) => gt.origin,
|
||||||
SiteKind::Gnarling(g) => g.origin,
|
SiteKind::Gnarling(g) => g.origin,
|
||||||
SiteKind::Bridge(b) => b.origin,
|
SiteKind::Bridge(b) => b.origin,
|
||||||
|
SiteKind::Adlet(g) => g.origin,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,6 +219,7 @@ impl Site {
|
|||||||
SiteKind::GiantTree(gt) => gt.spawn_rules(wpos),
|
SiteKind::GiantTree(gt) => gt.spawn_rules(wpos),
|
||||||
SiteKind::Gnarling(g) => g.spawn_rules(wpos),
|
SiteKind::Gnarling(g) => g.spawn_rules(wpos),
|
||||||
SiteKind::Bridge(b) => b.spawn_rules(wpos),
|
SiteKind::Bridge(b) => b.spawn_rules(wpos),
|
||||||
|
SiteKind::Adlet(g) => g.spawn_rules(wpos),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,6 +237,7 @@ impl Site {
|
|||||||
SiteKind::GiantTree(gt) => gt.name(),
|
SiteKind::GiantTree(gt) => gt.name(),
|
||||||
SiteKind::Gnarling(g) => g.name(),
|
SiteKind::Gnarling(g) => g.name(),
|
||||||
SiteKind::Bridge(b) => b.name(),
|
SiteKind::Bridge(b) => b.name(),
|
||||||
|
SiteKind::Adlet(g) => g.name(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,6 +274,7 @@ impl Site {
|
|||||||
SiteKind::GiantTree(gt) => gt.render(canvas, dynamic_rng),
|
SiteKind::GiantTree(gt) => gt.render(canvas, dynamic_rng),
|
||||||
SiteKind::Gnarling(g) => g.render(canvas, dynamic_rng),
|
SiteKind::Gnarling(g) => g.render(canvas, dynamic_rng),
|
||||||
SiteKind::Bridge(b) => b.render(canvas, dynamic_rng),
|
SiteKind::Bridge(b) => b.render(canvas, dynamic_rng),
|
||||||
|
SiteKind::Adlet(g) => g.render(canvas, dynamic_rng),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,6 +305,7 @@ impl Site {
|
|||||||
SiteKind::GiantTree(gt) => gt.apply_supplement(dynamic_rng, wpos2d, supplement),
|
SiteKind::GiantTree(gt) => gt.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
SiteKind::Gnarling(g) => g.apply_supplement(dynamic_rng, wpos2d, supplement),
|
SiteKind::Gnarling(g) => g.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
SiteKind::Bridge(b) => b.apply_supplement(dynamic_rng, wpos2d, supplement),
|
SiteKind::Bridge(b) => b.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
|
SiteKind::Adlet(g) => g.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -643,4 +643,24 @@ impl<'a, R: Rng> NameGen<'a, R> {
|
|||||||
];
|
];
|
||||||
self.generate_theme_from_parts(&start, &middle, &vowel, &end)
|
self.generate_theme_from_parts(&start, &middle, &vowel, &end)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//adlet placeholder
|
||||||
|
pub fn generate_adlet(mut self) -> String {
|
||||||
|
let start = ["gn", "kr", "k", "r", "t", "kn", "tr", "kt", "gr"];
|
||||||
|
let middle = [
|
||||||
|
"t", "tt", "k", "kk", "r", "r", "rl", "lm", "km", "tm", "kn", "kr", "tr", "nk", "gn",
|
||||||
|
"kl", "kt", "lt", "arln", "ln", "k't", "k'n", "k'm", "g'm", "l'k", "t'n", "r'k",
|
||||||
|
"n'kr", "k R", "t K", "rl Gn", "rl K", "k Gn", "t M", "t N", "r K", "r N", "k M",
|
||||||
|
"k T", "rl T", "t Kn", "r Kn",
|
||||||
|
];
|
||||||
|
let vowel = ["e", "a", "i", "o"];
|
||||||
|
let end = [
|
||||||
|
"arak", "orok", "arok", "orak", "attak", "akarl", "okarl", "atok", "anak", "etak",
|
||||||
|
"orek", "arek", "atik", "arik", "etik", "arlak", "arlek", "otek", "almek", "arlnok",
|
||||||
|
"arlnak", "okorl", "eknok", "ottok", "erlek", "akkat", "okkar", "attor", "ittor",
|
||||||
|
"aktor", "okomor", "imor", "inork", "inor", "amakkor", "ikkor", "amarl", "omarl",
|
||||||
|
"ikkarl", "okkarl", "emekk", "akatak", "okatak",
|
||||||
|
];
|
||||||
|
self.generate_theme_from_parts(&start, &middle, &vowel, &end)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ impl Site {
|
|||||||
.filter_map(|plot| match &plot.kind {
|
.filter_map(|plot| match &plot.kind {
|
||||||
PlotKind::Dungeon(d) => Some(d.spawn_rules(wpos)),
|
PlotKind::Dungeon(d) => Some(d.spawn_rules(wpos)),
|
||||||
PlotKind::Gnarling(g) => Some(g.spawn_rules(wpos)),
|
PlotKind::Gnarling(g) => Some(g.spawn_rules(wpos)),
|
||||||
|
PlotKind::Adlet(g) => Some(g.spawn_rules(wpos)),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.fold(base_spawn_rules, |a, b| a.combine(b))
|
.fold(base_spawn_rules, |a, b| a.combine(b))
|
||||||
@ -470,6 +471,34 @@ impl Site {
|
|||||||
site
|
site
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn generate_adlet(land: &Land, rng: &mut impl Rng, origin: Vec2<i32>) -> Self {
|
||||||
|
let mut rng = reseed(rng);
|
||||||
|
let mut site = Site {
|
||||||
|
origin,
|
||||||
|
..Site::default()
|
||||||
|
};
|
||||||
|
site.demarcate_obstacles(land);
|
||||||
|
let adlet_stronghold = plot::AdletStronghold::generate(origin, land, &mut rng);
|
||||||
|
site.name = adlet_stronghold.name().to_string();
|
||||||
|
let size = adlet_stronghold.radius() / tile::TILE_SIZE as i32;
|
||||||
|
let aabr = Aabr {
|
||||||
|
min: Vec2::broadcast(-size),
|
||||||
|
max: Vec2::broadcast(size),
|
||||||
|
};
|
||||||
|
let plot = site.create_plot(Plot {
|
||||||
|
kind: PlotKind::Adlet(adlet_stronghold),
|
||||||
|
root_tile: aabr.center(),
|
||||||
|
tiles: aabr_tiles(aabr).collect(),
|
||||||
|
seed: rng.gen(),
|
||||||
|
});
|
||||||
|
site.blit_aabr(aabr, Tile {
|
||||||
|
kind: TileKind::AdletStronghold,
|
||||||
|
plot: Some(plot),
|
||||||
|
hard_alt: None,
|
||||||
|
});
|
||||||
|
site
|
||||||
|
}
|
||||||
|
|
||||||
pub fn generate_giant_tree(land: &Land, rng: &mut impl Rng, origin: Vec2<i32>) -> Self {
|
pub fn generate_giant_tree(land: &Land, rng: &mut impl Rng, origin: Vec2<i32>) -> Self {
|
||||||
let mut rng = reseed(rng);
|
let mut rng = reseed(rng);
|
||||||
let mut site = Site {
|
let mut site = Site {
|
||||||
@ -1341,6 +1370,7 @@ impl Site {
|
|||||||
PlotKind::SeaChapel(sea_chapel) => sea_chapel.render_collect(self, canvas),
|
PlotKind::SeaChapel(sea_chapel) => sea_chapel.render_collect(self, canvas),
|
||||||
PlotKind::Dungeon(dungeon) => dungeon.render_collect(self, canvas),
|
PlotKind::Dungeon(dungeon) => dungeon.render_collect(self, canvas),
|
||||||
PlotKind::Gnarling(gnarling) => gnarling.render_collect(self, canvas),
|
PlotKind::Gnarling(gnarling) => gnarling.render_collect(self, canvas),
|
||||||
|
PlotKind::Adlet(adlet) => adlet.render_collect(self, canvas),
|
||||||
PlotKind::GiantTree(giant_tree) => giant_tree.render_collect(self, canvas),
|
PlotKind::GiantTree(giant_tree) => giant_tree.render_collect(self, canvas),
|
||||||
PlotKind::CliffTower(cliff_tower) => cliff_tower.render_collect(self, canvas),
|
PlotKind::CliffTower(cliff_tower) => cliff_tower.render_collect(self, canvas),
|
||||||
PlotKind::SavannahPit(savannah_pit) => savannah_pit.render_collect(self, canvas),
|
PlotKind::SavannahPit(savannah_pit) => savannah_pit.render_collect(self, canvas),
|
||||||
@ -1420,6 +1450,7 @@ impl Site {
|
|||||||
match &plot.kind {
|
match &plot.kind {
|
||||||
PlotKind::Dungeon(d) => d.apply_supplement(dynamic_rng, wpos2d, supplement),
|
PlotKind::Dungeon(d) => d.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
PlotKind::Gnarling(g) => g.apply_supplement(dynamic_rng, wpos2d, supplement),
|
PlotKind::Gnarling(g) => g.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
|
PlotKind::Adlet(g) => g.apply_supplement(dynamic_rng, wpos2d, supplement),
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
mod adlet;
|
||||||
mod bridge;
|
mod bridge;
|
||||||
mod castle;
|
mod castle;
|
||||||
mod citadel;
|
mod citadel;
|
||||||
@ -13,10 +14,11 @@ mod sea_chapel;
|
|||||||
mod workshop;
|
mod workshop;
|
||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
bridge::Bridge, castle::Castle, citadel::Citadel, cliff_tower::CliffTower,
|
adlet::AdletStronghold, bridge::Bridge, castle::Castle, citadel::Citadel,
|
||||||
desert_city_multiplot::DesertCityMultiPlot, desert_city_temple::DesertCityTemple,
|
cliff_tower::CliffTower, desert_city_multiplot::DesertCityMultiPlot,
|
||||||
dungeon::Dungeon, giant_tree::GiantTree, gnarling::GnarlingFortification, house::House,
|
desert_city_temple::DesertCityTemple, dungeon::Dungeon, giant_tree::GiantTree,
|
||||||
savannah_pit::SavannahPit, sea_chapel::SeaChapel, workshop::Workshop,
|
gnarling::GnarlingFortification, house::House, savannah_pit::SavannahPit,
|
||||||
|
sea_chapel::SeaChapel, workshop::Workshop,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
@ -67,6 +69,7 @@ pub enum PlotKind {
|
|||||||
Road(Path<Vec2<i32>>),
|
Road(Path<Vec2<i32>>),
|
||||||
Dungeon(Dungeon),
|
Dungeon(Dungeon),
|
||||||
Gnarling(GnarlingFortification),
|
Gnarling(GnarlingFortification),
|
||||||
|
Adlet(AdletStronghold),
|
||||||
GiantTree(GiantTree),
|
GiantTree(GiantTree),
|
||||||
CliffTower(CliffTower),
|
CliffTower(CliffTower),
|
||||||
Citadel(Citadel),
|
Citadel(Citadel),
|
||||||
|
2111
world/src/site2/plot/adlet.rs
Normal file
2111
world/src/site2/plot/adlet.rs
Normal file
File diff suppressed because it is too large
Load Diff
@ -192,6 +192,7 @@ pub enum TileKind {
|
|||||||
Gate,
|
Gate,
|
||||||
GnarlingFortification,
|
GnarlingFortification,
|
||||||
Bridge,
|
Bridge,
|
||||||
|
AdletStronghold,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, PartialEq)]
|
#[derive(Clone, PartialEq)]
|
||||||
|
Loading…
Reference in New Issue
Block a user