Dungeon placement. Tweaks to melee.

This commit is contained in:
Sam 2021-05-06 14:44:25 -04:00
parent 9f8aeb91c0
commit c67c56d194
5 changed files with 33 additions and 16 deletions

View File

@ -1,9 +1,9 @@
BasicMelee( BasicMelee(
energy_cost: 0, energy_cost: 0,
buildup_duration: 0.2, buildup_duration: 0.5,
swing_duration: 0.2, swing_duration: 0.5,
recover_duration: 0.5, recover_duration: 0.5,
base_damage: 250, base_damage: 200,
base_poise_damage: 50, base_poise_damage: 50,
knockback: 10.0, knockback: 10.0,
range: 5.0, range: 5.0,

View File

@ -1,5 +1,5 @@
ItemDef( ItemDef(
name: "Emerald Staff", name: "Emerald Sceptre",
description: "Its stone is the closest thing from perfection", description: "Its stone is the closest thing from perfection",
kind: Tool(( kind: Tool((
kind: Sceptre, kind: Sceptre,

View File

@ -602,7 +602,11 @@ impl Body {
pub fn immune_to(&self, buff: BuffKind) -> bool { pub fn immune_to(&self, buff: BuffKind) -> bool {
match buff { match buff {
BuffKind::Bleeding => matches!(self, Body::Object(_) | Body::Golem(_) | Body::Ship(_)), BuffKind::Bleeding => matches!(self, Body::Object(_) | Body::Golem(_) | Body::Ship(_)),
BuffKind::Burning => matches!(self, Body::Golem(_)), BuffKind::Burning => match self {
Body::Golem(g) => matches!(g.species, golem::Species::ClayGolem),
Body::BipedSmall(b) => matches!(b.species, biped_small::Species::Haniwa),
_ => false,
},
_ => false, _ => false,
} }
} }

View File

@ -3489,6 +3489,12 @@ impl<'a> AgentData<'a> {
} else if attack_data.dist_sqrd < GOLEM_LASER_RANGE.powi(2) { } else if attack_data.dist_sqrd < GOLEM_LASER_RANGE.powi(2) {
if matches!(self.char_state, CharacterState::BasicBeam(c) if c.timer < Duration::from_secs(10)) if matches!(self.char_state, CharacterState::BasicBeam(c) if c.timer < Duration::from_secs(10))
|| target_speed_sqd < GOLEM_TARGET_SPEED.powi(2) || target_speed_sqd < GOLEM_TARGET_SPEED.powi(2)
&& can_see_tgt(
&*read_data.terrain,
self.pos,
tgt_data.pos,
attack_data.dist_sqrd,
)
{ {
// If already lasering, keep lasering if target in range threshold and // If already lasering, keep lasering if target in range threshold and
// haven't been lasering for more than 10 seconds already // haven't been lasering for more than 10 seconds already
@ -3503,7 +3509,14 @@ impl<'a> AgentData<'a> {
.push(ControlAction::basic_input(InputKind::Ability(0))); .push(ControlAction::basic_input(InputKind::Ability(0)));
} }
} else if attack_data.dist_sqrd < GOLEM_LONG_RANGE.powi(2) { } else if attack_data.dist_sqrd < GOLEM_LONG_RANGE.powi(2) {
if target_speed_sqd < GOLEM_TARGET_SPEED.powi(2) { if target_speed_sqd < GOLEM_TARGET_SPEED.powi(2)
&& can_see_tgt(
&*read_data.terrain,
self.pos,
tgt_data.pos,
attack_data.dist_sqrd,
)
{
// If target is far-ish and moving slow-ish, rocket them // If target is far-ish and moving slow-ish, rocket them
controller controller
.actions .actions

View File

@ -810,8 +810,6 @@ impl Floor {
Lottery::<LootSpec>::load_expect("common.loot_tables.fallback") Lottery::<LootSpec>::load_expect("common.loot_tables.fallback")
}, },
}; };
let chosen = chosen.read();
let chosen = chosen.choose();
let entity = match room.difficulty { let entity = match room.difficulty {
0 => { 0 => {
vec![ vec![
@ -823,7 +821,7 @@ impl Floor {
), ),
)) ))
.with_name("Harvester".to_string()) .with_name("Harvester".to_string())
.with_loot_drop(chosen.to_item()), .with_loot_drop(chosen.read().choose().to_item()),
] ]
}, },
1 => { 1 => {
@ -836,7 +834,7 @@ impl Floor {
), ),
)) ))
.with_name("Yeti".to_string()) .with_name("Yeti".to_string())
.with_loot_drop(chosen.to_item()), .with_loot_drop(chosen.read().choose().to_item()),
] ]
}, },
2 => { 2 => {
@ -849,11 +847,12 @@ impl Floor {
), ),
)) ))
.with_name("Tidal Warrior".to_string()) .with_name("Tidal Warrior".to_string())
.with_loot_drop(chosen.to_item()), .with_loot_drop(chosen.read().choose().to_item()),
] ]
}, },
3 => { 3 => {
vec![ let mut entities = Vec::new();
entities.resize_with(2, || {
EntityInfo::at(tile_wcenter.map(|e| e as f32)) EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::Golem( .with_body(comp::Body::Golem(
comp::golem::Body::random_with( comp::golem::Body::random_with(
@ -862,8 +861,9 @@ impl Floor {
), ),
)) ))
.with_name("Clay Golem".to_string()) .with_name("Clay Golem".to_string())
.with_loot_drop(chosen.to_item()), .with_loot_drop(chosen.read().choose().to_item())
] });
entities
}, },
4 => { 4 => {
vec![ vec![
@ -875,7 +875,7 @@ impl Floor {
), ),
)) ))
.with_name("Minotaur".to_string()) .with_name("Minotaur".to_string())
.with_loot_drop(chosen.to_item()), .with_loot_drop(chosen.read().choose().to_item()),
] ]
}, },
5 => { 5 => {
@ -888,7 +888,7 @@ impl Floor {
), ),
)) ))
.with_name("Mindflayer".to_string()) .with_name("Mindflayer".to_string())
.with_loot_drop(chosen.to_item()) .with_loot_drop(chosen.read().choose().to_item())
.with_skillset_config( .with_skillset_config(
common::skillset_builder::SkillSetConfig::Mindflayer, common::skillset_builder::SkillSetConfig::Mindflayer,
), ),