mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added armor, more ai tweaks.
This commit is contained in:
parent
1c8db241e2
commit
9f8aeb91c0
13
assets/common/items/npc_armor/golem/claygolem.ron
Normal file
13
assets/common/items/npc_armor/golem/claygolem.ron
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
ItemDef(
|
||||||
|
name: "Clay Golem Armor",
|
||||||
|
description: "Worn by clay golem.",
|
||||||
|
kind: Armor((
|
||||||
|
kind: Chest("Clay Golem"),
|
||||||
|
stats: (
|
||||||
|
protection: Normal(180.0),
|
||||||
|
poise_resilience: Normal(1.0),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
quality: Legendary,
|
||||||
|
tags: [],
|
||||||
|
)
|
@ -568,7 +568,7 @@ impl Body {
|
|||||||
},
|
},
|
||||||
Body::BipedSmall(_) => 10,
|
Body::BipedSmall(_) => 10,
|
||||||
Body::Object(_) => 10,
|
Body::Object(_) => 10,
|
||||||
Body::Golem(_) => 260,
|
Body::Golem(_) => 0,
|
||||||
Body::Theropod(_) => 20,
|
Body::Theropod(_) => 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,
|
||||||
@ -602,6 +602,7 @@ 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(_)),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -980,6 +980,15 @@ impl LoadoutBuilder {
|
|||||||
.build(),
|
.build(),
|
||||||
_ => LoadoutBuilder::new().active_item(active_item).build(),
|
_ => LoadoutBuilder::new().active_item(active_item).build(),
|
||||||
},
|
},
|
||||||
|
Body::Golem(g) => match g.species {
|
||||||
|
golem::Species::ClayGolem => LoadoutBuilder::new()
|
||||||
|
.active_item(active_item)
|
||||||
|
.chest(Some(Item::new_from_asset_expect(
|
||||||
|
"common.items.npc_armor.golem.claygolem",
|
||||||
|
)))
|
||||||
|
.build(),
|
||||||
|
_ => LoadoutBuilder::new().active_item(active_item).build(),
|
||||||
|
},
|
||||||
_ => LoadoutBuilder::new().active_item(active_item).build(),
|
_ => LoadoutBuilder::new().active_item(active_item).build(),
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -139,7 +139,7 @@ impl CharacterBehavior for Data {
|
|||||||
specifier: self.static_data.specifier,
|
specifier: self.static_data.specifier,
|
||||||
};
|
};
|
||||||
let body_offsets_z = match data.body {
|
let body_offsets_z = match data.body {
|
||||||
Body::BirdLarge(_) | Body::Golem(_) => data.body.height() * 0.9,
|
Body::BirdLarge(_) | Body::Golem(_) => data.body.height() * 0.8,
|
||||||
_ => data.body.height() * 0.5,
|
_ => data.body.height() * 0.5,
|
||||||
};
|
};
|
||||||
// Gets offsets
|
// Gets offsets
|
||||||
|
@ -1647,6 +1647,18 @@ impl<'a> AgentData<'a> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Tactic::ClayGolem if matches!(self.char_state, CharacterState::BasicRanged(_)) => {
|
||||||
|
const ROCKET_SPEED: f32 = 20.0;
|
||||||
|
aim_projectile(
|
||||||
|
ROCKET_SPEED,
|
||||||
|
Vec3::new(self.pos.0.x, self.pos.0.y, self.pos.0.z + eye_offset),
|
||||||
|
Vec3::new(
|
||||||
|
tgt_data.pos.0.x,
|
||||||
|
tgt_data.pos.0.y,
|
||||||
|
tgt_data.pos.0.z + tgt_eye_offset,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
},
|
||||||
_ => Dir::from_unnormalized(
|
_ => Dir::from_unnormalized(
|
||||||
Vec3::new(
|
Vec3::new(
|
||||||
tgt_data.pos.0.x,
|
tgt_data.pos.0.x,
|
||||||
@ -3493,8 +3505,6 @@ impl<'a> AgentData<'a> {
|
|||||||
} 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) {
|
||||||
// If target is far-ish and moving slow-ish, rocket them
|
// If target is far-ish and moving slow-ish, rocket them
|
||||||
// TODO: Maybe some look_dir shenanigans? Also maybe use condition so they
|
|
||||||
// stop and aim a bit first?
|
|
||||||
controller
|
controller
|
||||||
.actions
|
.actions
|
||||||
.push(ControlAction::basic_input(InputKind::Ability(1)));
|
.push(ControlAction::basic_input(InputKind::Ability(1)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user