More ai work

balance

Lavadrake AI tweaks

feedback tweaks
This commit is contained in:
jiminycrick 2020-11-22 00:09:43 -08:00 committed by Sam
parent d10dd83e5f
commit 1cf0aff5ef
37 changed files with 377 additions and 170 deletions

View File

@ -27,8 +27,8 @@ ComboMelee(
forward_movement: 0.25,
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
initial_energy_gain: 220,
max_energy_gain: 220,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.6,

View File

@ -1,19 +1,19 @@
ComboMelee(
stage_data: [(
stage: 1,
base_damage: 120,
max_damage: 150,
base_damage: 130,
max_damage: 130,
damage_increase: 10,
knockback: 0.0,
range: 3.5,
angle: 20.0,
range: 4.5,
angle: 50.0,
base_buildup_duration: 600,
base_swing_duration: 60,
base_recover_duration: 300,
forward_movement: 0.0,
)],
initial_energy_gain: 0,
max_energy_gain: 100,
initial_energy_gain: 250,
max_energy_gain: 250,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.4,

View File

@ -3,7 +3,7 @@ ComboMelee(
(
stage: 1,
base_damage: 100,
max_damage: 60,
max_damage: 100,
damage_increase: 10,
knockback: 5.0,
range: 3.5,
@ -16,7 +16,7 @@ ComboMelee(
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
energy_increase: 0,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,

View File

@ -2,8 +2,8 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
max_damage: 120,
base_damage: 120,
max_damage: 140,
damage_increase: 10,
knockback: 10.0,
range: 3.5,

View File

@ -0,0 +1,17 @@
DashMelee(
energy_cost: 0,
base_damage: 150,
max_damage: 260,
base_knockback: 8.0,
max_knockback: 25.0,
range: 5.0,
angle: 45.0,
energy_drain: 0,
forward_speed: 4.0,
buildup_duration: 500,
charge_duration: 1000,
swing_duration: 100,
recover_duration: 800,
infinite_charge: true,
is_interruptible: true,
)

View File

@ -6,7 +6,7 @@ ComboMelee(
max_damage: 120,
damage_increase: 10,
knockback: 10.0,
range: 3.5,
range: 4.5,
angle: 30.0,
base_buildup_duration: 900,
base_swing_duration: 100,
@ -46,4 +46,4 @@ ComboMelee(
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -15,8 +15,8 @@ ComboMelee(
),
(
stage: 2,
base_damage: 80,
max_damage: 110,
base_damage: 130,
max_damage: 170,
damage_increase: 15,
knockback: 2.0,
range: 3.5,

View File

@ -2,7 +2,7 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
base_damage: 60,
max_damage: 60,
damage_increase: 10,
knockback: 5.0,

View File

@ -1,8 +1,8 @@
ChargedMelee(
energy_cost: 0,
energy_drain: 0,
initial_damage: 40,
max_damage: 70,
initial_damage: 160,
max_damage: 200,
initial_knockback: 10.0,
max_knockback: 30.0,
range: 6.0,

View File

@ -15,8 +15,8 @@ ComboMelee(
),
(
stage: 2,
base_damage: 80,
max_damage: 110,
base_damage: 120,
max_damage: 140,
damage_increase: 15,
knockback: 10.0,
range: 3.5,

View File

@ -2,16 +2,16 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
max_damage: 60,
base_damage: 120,
max_damage: 120,
damage_increase: 10,
knockback: 5.0,
range: 3.5,
angle: 60.0,
base_buildup_duration: 500,
base_buildup_duration: 650,
base_swing_duration: 150,
base_recover_duration: 400,
forward_movement: 3.0,
forward_movement: 1.0,
),
],
initial_energy_gain: 0,
@ -20,4 +20,4 @@ ComboMelee(
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -2,39 +2,39 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
max_damage: 120,
base_damage: 120,
max_damage: 140,
damage_increase: 10,
knockback: 10.0,
range: 3.5,
angle: 30.0,
base_buildup_duration: 900,
base_swing_duration: 100,
base_recover_duration: 200,
forward_movement: 2.0,
base_recover_duration: 400,
forward_movement: 1.0,
),
(
stage: 2,
base_damage: 80,
max_damage: 110,
base_damage: 120,
max_damage: 140,
damage_increase: 15,
knockback: 10.0,
range: 3.5,
angle: 30.0,
base_buildup_duration: 200,
base_buildup_duration: 300,
base_swing_duration: 100,
base_recover_duration: 200,
forward_movement: 1.0,
forward_movement: 0.0,
),
(
stage: 3,
base_damage: 130,
max_damage: 170,
base_damage: 120,
max_damage: 140,
damage_increase: 20,
knockback: 10.0,
range: 3.5,
angle: 30.0,
base_buildup_duration: 200,
base_buildup_duration: 300,
base_swing_duration: 100,
base_recover_duration: 200,
forward_movement: 1.0,
@ -46,4 +46,4 @@ ComboMelee(
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -1,7 +1,7 @@
DashMelee(
energy_cost: 0,
base_damage: 150,
max_damage: 160,
max_damage: 150,
base_knockback: 8.0,
max_knockback: 25.0,
range: 4.0,
@ -11,7 +11,7 @@ DashMelee(
buildup_duration: 500,
charge_duration: 1200,
swing_duration: 100,
recover_duration: 800,
recover_duration: 1100,
infinite_charge: true,
is_interruptible: true,
)

View File

@ -24,7 +24,7 @@ ComboMelee(
base_buildup_duration: 500,
base_swing_duration: 100,
base_recover_duration: 300,
forward_movement: 1.5,
forward_movement: 0.5,
),
],
initial_energy_gain: 0,
@ -33,4 +33,4 @@ ComboMelee(
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -3,8 +3,8 @@ BasicMelee(
buildup_duration: 600,
swing_duration: 500,
recover_duration: 350,
base_damage: 70,
base_damage: 130,
knockback: 25.0,
range: 2.0,
range: 3.0,
max_angle: 120.0,
)

View File

@ -15,7 +15,7 @@ ComboMelee(
),
(
stage: 2,
base_damage: 80,x
base_damage: 80,
max_damage: 110,
damage_increase: 15,
knockback: 8.0,
@ -33,4 +33,4 @@ ComboMelee(
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -1,13 +1,13 @@
DashMelee(
energy_cost: 0,
base_damage: 30,
max_damage: 40,
base_damage: 130,
max_damage: 130,
base_knockback: 8.0,
max_knockback: 15.0,
range: 2.0,
angle: 45.0,
energy_drain: 0,
forward_speed: 1.5,
forward_speed: 2.0,
buildup_duration: 1200,
charge_duration: 300,
swing_duration: 100,

View File

@ -2,8 +2,8 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
max_damage: 120,
base_damage: 150,
max_damage: 170,
damage_increase: 10,
knockback: 5.0,
range: 3.5,
@ -11,12 +11,12 @@ ComboMelee(
base_buildup_duration: 800,
base_swing_duration: 150,
base_recover_duration: 400,
forward_movement: 3.0,
forward_movement: 0.3,
),
(
stage: 2,
base_damage: 80,
max_damage: 110,
base_damage: 150,
max_damage: 170,
damage_increase: 15,
knockback: 5.0,
range: 3.5,
@ -24,11 +24,11 @@ ComboMelee(
base_buildup_duration: 600,
base_swing_duration: 150,
base_recover_duration: 300,
forward_movement: 3.5,
forward_movement: 0.5,
),
(
stage: 3,
base_damage: 130,
base_damage: 150,
max_damage: 170,
damage_increase: 20,
knockback: 5.0,
@ -37,13 +37,13 @@ ComboMelee(
base_buildup_duration: 600,
base_swing_duration: 150,
base_recover_duration: 300,
forward_movement: 4.5,
forward_movement: 0.5,
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
energy_increase: 0,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -2,8 +2,8 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 10,
max_damage: 20,
base_damage: 30,
max_damage: 30,
damage_increase: 10,
knockback: 5.0,
range: 3.5,

View File

@ -2,8 +2,8 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
max_damage: 60,
base_damage: 150,
max_damage: 150,
damage_increase: 10,
knockback: 5.0,
range: 7.5,

View File

@ -2,8 +2,8 @@ ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 100,
max_damage: 120,
base_damage: 170,
max_damage: 190,
damage_increase: 10,
knockback: 10.0,
range: 7.5,
@ -11,12 +11,12 @@ ComboMelee(
base_buildup_duration: 900,
base_swing_duration: 150,
base_recover_duration: 300,
forward_movement: 3.0,
forward_movement: 1.0,
),
(
stage: 2,
base_damage: 80,
max_damage: 110,
base_damage: 190,
max_damage: 210,
damage_increase: 15,
knockback: 10.0,
range: 5.5,
@ -24,12 +24,12 @@ ComboMelee(
base_buildup_duration: 500,
base_swing_duration: 150,
base_recover_duration: 150,
forward_movement: 2.0,
forward_movement: 1.0,
),
(
stage: 3,
base_damage: 130,
max_damage: 170,
base_damage: 230,
max_damage: 250,
damage_increase: 20,
knockback: 10.0,
range: 5.5,
@ -37,7 +37,7 @@ ComboMelee(
base_buildup_duration: 350,
base_swing_duration: 125,
base_recover_duration: 900,
forward_movement: 2.0,
forward_movement: 1.0,
),
],
initial_energy_gain: 0,
@ -46,4 +46,4 @@ ComboMelee(
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)
)

View File

@ -0,0 +1,23 @@
ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 150,
max_damage: 150,
damage_increase: 10,
knockback: 5.0,
range: 5.5,
angle: 5.0,
base_buildup_duration: 500,
base_swing_duration: 150,
base_recover_duration: 400,
forward_movement: 3.0,
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)

View File

@ -0,0 +1,49 @@
ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 170,
max_damage: 190,
damage_increase: 10,
knockback: 10.0,
range: 4.5,
angle: 5.0,
base_buildup_duration: 900,
base_swing_duration: 150,
base_recover_duration: 300,
forward_movement: 1.0,
),
(
stage: 2,
base_damage: 190,
max_damage: 210,
damage_increase: 15,
knockback: 10.0,
range: 4.0,
angle: 10.0,
base_buildup_duration: 500,
base_swing_duration: 150,
base_recover_duration: 150,
forward_movement: 1.0,
),
(
stage: 3,
base_damage: 230,
max_damage: 250,
damage_increase: 20,
knockback: 10.0,
range: 4.0,
angle: 10.0,
base_buildup_duration: 350,
base_swing_duration: 125,
base_recover_duration: 900,
forward_movement: 1.0,
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_speed_increase: 1.8,
is_interruptible: true,
)

View File

@ -96,7 +96,9 @@
Unique(QuadLowBreathe): (
primary: "common.abilities.unique.quadlowbreathe.flamethrower",
secondary: "common.abilities.unique.quadlowbreathe.triplestrike",
skills: [],
skills: [
"common.abilities.unique.quadlowbreathe.dash",
],
),
Unique(QuadLowTail): (
primary: "common.abilities.unique.quadlowtail.charged",
@ -123,6 +125,11 @@
secondary: "common.abilities.unique.theropodbasic.triplestrike",
skills: [],
),
Unique(TheropodBird): (
primary: "common.abilities.unique.theropodbird.triplestrike",
secondary: "common.abilities.unique.theropodbird.triplestrike",
skills: [],
),
Debug: (
primary: "common.abilities.debug.forwardboost",
secondary: "common.abilities.debug.upboost",
@ -140,4 +147,4 @@
secondary: "common.abilities.empty.basic",
skills: [],
),
})
})

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Theropod Bird",
description: "testing123",
kind: Tool(
(
kind: Unique(TheropodBird),
stats: (
equip_time_millis: 10,
power: 1.00,
speed: 1.00,
),
)
),
quality: Low,
)

View File

@ -76,36 +76,36 @@ impl<'a> From<&'a Body> for Psyche {
aggro: match body {
Body::Humanoid(humanoid) => match humanoid.species {
humanoid::Species::Danari => 0.9,
humanoid::Species::Dwarf => 0.9,
humanoid::Species::Elf => 0.95,
humanoid::Species::Human => 0.95,
humanoid::Species::Orc => 1.0,
humanoid::Species::Undead => 1.0,
humanoid::Species::Dwarf => 0.8,
humanoid::Species::Elf => 0.7,
humanoid::Species::Human => 0.6,
humanoid::Species::Orc => 0.9,
humanoid::Species::Undead => 0.9,
},
Body::QuadrupedSmall(quadruped_small) => match quadruped_small.species {
quadruped_small::Species::Pig => 0.5,
quadruped_small::Species::Fox => 0.4,
quadruped_small::Species::Fox => 0.3,
quadruped_small::Species::Sheep => 0.5,
quadruped_small::Species::Boar => 1.0,
quadruped_small::Species::Boar => 0.8,
quadruped_small::Species::Jackalope => 0.4,
quadruped_small::Species::Skunk => 0.8,
quadruped_small::Species::Skunk => 0.6,
quadruped_small::Species::Cat => 0.2,
quadruped_small::Species::Batfox => 0.7,
quadruped_small::Species::Batfox => 0.6,
quadruped_small::Species::Raccoon => 0.4,
quadruped_small::Species::Quokka => 0.7,
quadruped_small::Species::Quokka => 0.4,
quadruped_small::Species::Dodarock => 0.9,
quadruped_small::Species::Holladon => 1.0,
quadruped_small::Species::Hyena => 0.4,
quadruped_small::Species::Rabbit => 0.1,
quadruped_small::Species::Truffler => 0.8,
quadruped_small::Species::Frog => 0.6,
quadruped_small::Species::Frog => 0.4,
quadruped_small::Species::Hare => 0.2,
_ => 1.0,
_ => 0.0,
},
Body::QuadrupedMedium(quadruped_medium) => match quadruped_medium.species {
quadruped_medium::Species::Tuskram => 0.8,
quadruped_medium::Species::Tuskram => 0.7,
quadruped_medium::Species::Frostfang => 0.9,
quadruped_medium::Species::Mouflon => 0.8,
quadruped_medium::Species::Mouflon => 0.7,
quadruped_medium::Species::Catoblepas => 0.8,
quadruped_medium::Species::Deer => 0.6,
quadruped_medium::Species::Hirdrasil => 0.7,
@ -113,17 +113,17 @@ impl<'a> From<&'a Body> for Psyche {
quadruped_medium::Species::Camel => 0.7,
quadruped_medium::Species::Zebra => 0.7,
quadruped_medium::Species::Antelope => 0.6,
quadruped_medium::Species::Horse => 0.8,
_ => 1.0,
quadruped_medium::Species::Horse => 0.7,
_ => 0.5,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
quadruped_low::Species::Salamander => 0.8,
quadruped_low::Species::Monitor => 0.9,
quadruped_low::Species::Salamander => 0.7,
quadruped_low::Species::Monitor => 0.7,
quadruped_low::Species::Asp => 0.9,
quadruped_low::Species::Pangolin => 0.6,
_ => 1.0,
quadruped_low::Species::Pangolin => 0.4,
_ => 0.6,
},
Body::BirdMedium(_) => 1.0,
Body::BirdMedium(_) => 0.5,
Body::BirdSmall(_) => 0.4,
Body::FishMedium(_) => 0.15,
Body::FishSmall(_) => 0.0,

View File

@ -173,7 +173,12 @@ impl Body {
quadruped_low::Species::Pangolin => 1.3,
_ => 1.6,
},
Body::Theropod(_) => 0.3,
Body::Theropod(body) => match body.species {
theropod::Species::Snowraptor => 0.5,
theropod::Species::Sandraptor => 0.5,
theropod::Species::Woodraptor => 0.5,
_ => 0.9,
},
Body::BirdMedium(_) => 0.35,
Body::FishMedium(_) => 0.35,
Body::Dragon(_) => 8.0,
@ -312,7 +317,11 @@ impl Body {
},
Body::Object(_) => 10000,
Body::Golem(_) => 2740,
Body::Theropod(_) => 1000,
Body::Theropod(theropod) => match theropod.species {
theropod::Species::Archaeos => 3000,
theropod::Species::Odonto => 2700,
_ => 1100,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
quadruped_low::Species::Crocodile => 600,
quadruped_low::Species::Alligator => 600,
@ -325,6 +334,8 @@ impl Body {
quadruped_low::Species::Maneater => 400,
quadruped_low::Species::Sandshark => 600,
quadruped_low::Species::Hakulaq => 400,
quadruped_low::Species::Lavadrake => 900,
_ => 200,
},
}
@ -481,6 +492,7 @@ impl Body {
quadruped_low::Species::Maneater => 14,
quadruped_low::Species::Sandshark => 12,
quadruped_low::Species::Hakulaq => 10,
quadruped_low::Species::Lavadrake => 20,
_ => 10,
},
}
@ -559,11 +571,15 @@ impl Body {
},
Body::Object(_) => 0,
Body::Golem(_) => 250,
Body::Theropod(_) => 10,
Body::Theropod(theropod) => match theropod.species {
theropod::Species::Archaeos => 150,
theropod::Species::Odonto => 130,
_ => 70,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
quadruped_low::Species::Crocodile => 50,
quadruped_low::Species::Alligator => 50,
quadruped_low::Species::Salamander => 30,
quadruped_low::Species::Salamander => 50,
quadruped_low::Species::Monitor => 30,
quadruped_low::Species::Asp => 35,
quadruped_low::Species::Tortoise => 10,

View File

@ -184,4 +184,5 @@ pub enum UniqueKind {
QuadLowBasic,
QuadSmallBasic,
TheropodBasic,
TheropodBird,
}

View File

@ -1,7 +1,7 @@
use crate::comp::{
biped_large, golem,
item::{tool::AbilityMap, Item, ItemKind},
quadruped_low, quadruped_medium, Body, CharacterAbility, ItemConfig, Loadout,
quadruped_low, quadruped_medium, theropod, Body, CharacterAbility, ItemConfig, Loadout,
};
use rand::Rng;
@ -176,6 +176,13 @@ impl LoadoutBuilder {
},
},
Body::Theropod(theropod) => match theropod.species {
theropod::Species::Sandraptor
| theropod::Species::Snowraptor
| theropod::Species::Woodraptor => {
main_tool = Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.theropodbird",
));
},
_ => {
main_tool = Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.theropodbasic",

View File

@ -1,5 +1,5 @@
use crate::{
comp::{beam, CharacterState, EnergyChange, EnergySource, Ori, Pos, StateUpdate},
comp::{beam, Body, CharacterState, EnergyChange, EnergySource, Ori, Pos, StateUpdate},
event::ServerEvent,
states::utils::*,
sync::Uid,
@ -145,11 +145,22 @@ impl CharacterBehavior for Data {
owner: Some(*data.uid),
};
// Gets offsets
let body_offsets = Vec3::new(
data.body.radius() + 2.0 * data.inputs.look_dir.x,
data.body.radius() + 2.0 * data.inputs.look_dir.y,
data.body.eye_height(),
) * 0.55;
let body_offsets = match data.body {
Body::Humanoid(_) => {
Vec3::new(
data.body.radius() + 2.0 * data.inputs.look_dir.x,
data.body.radius() + 2.0 * data.inputs.look_dir.y,
data.body.eye_height(),
) * 0.55
},
_ => {
Vec3::new(
data.body.radius() * 3.0 * data.inputs.look_dir.x,
data.body.radius() * 3.0 * data.inputs.look_dir.y,
data.body.eye_height(),
) * 0.55
},
};
let pos = Pos(data.pos.0 + body_offsets);
// Create beam segment
update.server_events.push_front(ServerEvent::BeamSegment {

View File

@ -43,7 +43,7 @@ impl Body {
quadruped_medium::Species::Saber => 180.0,
quadruped_medium::Species::Tiger => 150.0,
quadruped_medium::Species::Tuskram => 160.0,
quadruped_medium::Species::Lion => 110.0,
quadruped_medium::Species::Lion => 170.0,
quadruped_medium::Species::Tarasque => 100.0,
quadruped_medium::Species::Wolf => 180.0,
quadruped_medium::Species::Frostfang => 180.0,
@ -109,7 +109,7 @@ impl Body {
match self {
Body::Humanoid(_) => 20.0,
Body::QuadrupedSmall(_) => 15.0,
Body::QuadrupedMedium(_) => 10.0,
Body::QuadrupedMedium(_) => 8.0,
Body::BirdMedium(_) => 30.0,
Body::FishMedium(_) => 5.0,
Body::Dragon(_) => 5.0,
@ -119,9 +119,9 @@ impl Body {
Body::Object(_) => 5.0,
Body::Golem(_) => 8.0,
Body::Theropod(theropod) => match theropod.species {
theropod::Species::Archaeos => 1.5,
theropod::Species::Odonto => 1.5,
_ => 10.0,
theropod::Species::Archaeos => 2.5,
theropod::Species::Odonto => 2.5,
_ => 7.0,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
quadruped_low::Species::Monitor => 9.0,
@ -129,6 +129,7 @@ impl Body {
quadruped_low::Species::Tortoise => 3.0,
quadruped_low::Species::Rocksnapper => 4.0,
quadruped_low::Species::Maneater => 5.0,
quadruped_low::Species::Lavadrake => 4.0,
_ => 6.0,
},
}

View File

@ -340,6 +340,8 @@ impl<'a> System<'a> for Sys {
QuadLowQuick,
QuadLowBasic,
QuadMedJump,
Lavadrake,
Theropod,
}
let tactic = match loadout.active_item.as_ref().and_then(|ic| {
@ -374,6 +376,9 @@ impl<'a> System<'a> for Sys {
Some(ToolKind::Unique(UniqueKind::QuadLowBasic)) => {
Tactic::QuadLowBasic
},
Some(ToolKind::Unique(UniqueKind::QuadLowBreathe)) => Tactic::Lavadrake,
Some(ToolKind::Unique(UniqueKind::TheropodBasic)) => Tactic::Theropod,
Some(ToolKind::Unique(UniqueKind::TheropodBird)) => Tactic::Theropod,
_ => Tactic::Melee,
};
@ -396,13 +401,13 @@ impl<'a> System<'a> for Sys {
bodies.get(*target).map_or(0.0, |b| b.eye_height());
if tactic == Tactic::QuadMedJump {
tgt_eye_offset += 2.0;
tgt_eye_offset += 1.0;
}
let distance_offset = match tactic {
Tactic::Bow => 0.0004 * pos.0.distance_squared(tgt_pos.0),
Tactic::Staff => 0.0015 * pos.0.distance_squared(tgt_pos.0),
Tactic::QuadLowRanged => 0.05 * pos.0.distance_squared(tgt_pos.0),
Tactic::QuadLowRanged => 0.02 * pos.0.distance_squared(tgt_pos.0),
_ => 0.0,
};
@ -440,7 +445,11 @@ impl<'a> System<'a> for Sys {
.map(|a| !matches!(a, Alignment::Enemy | Alignment::Owned(_)))
.unwrap_or(true);
if 1.0 - agent.psyche.aggro > damage && flees {
controller.actions.push(ControlAction::Unwield);
if let Some(body) = body {
if body.is_humanoid() {
controller.actions.push(ControlAction::Unwield);
}
}
if dist_sqrd < MAX_FLEE_DIST.powf(2.0) {
if let Some((bearing, speed)) = chaser.chase(
&*terrain,
@ -451,7 +460,7 @@ impl<'a> System<'a> for Sys {
+ (pos.0 - tgt_pos.0)
.try_normalized()
.unwrap_or_else(Vec3::unit_y)
* 8.0,
* 50.0,
TraversalConfig {
min_tgt_dist: 1.25,
..traversal_config
@ -460,15 +469,17 @@ impl<'a> System<'a> for Sys {
inputs.move_dir =
bearing.xy().try_normalized().unwrap_or(Vec2::zero())
* speed
* 0.4; //Let small/slow animals flee slower than the player
* 1.0;
inputs.jump.set_state(bearing.z > 1.5);
inputs.move_z = bearing.z;
}
} else {
do_idle = true;
}
} else if ((tactic == Tactic::Staff || tactic == Tactic::QuadMedJump)
&& dist_sqrd < (5.0 * MIN_ATTACK_DIST * scale).powf(2.0))
} else if (tactic == Tactic::Theropod
&& dist_sqrd < (2.0 * MIN_ATTACK_DIST * scale).powf(2.0))
|| (tactic == Tactic::Lavadrake
&& dist_sqrd < (2.5 * MIN_ATTACK_DIST * scale).powf(2.0))
|| (tactic == Tactic::QuadLowRanged
&& dist_sqrd < (4.0 * MIN_ATTACK_DIST * scale).powf(2.0))
|| (tactic == Tactic::Wolf
@ -477,16 +488,25 @@ impl<'a> System<'a> for Sys {
&& dist_sqrd < (15.0 * MIN_ATTACK_DIST * scale).powf(2.0))
|| ((tactic == Tactic::TailSlap || tactic == Tactic::QuadLowBasic)
&& dist_sqrd < (1.5 * MIN_ATTACK_DIST * scale).powf(2.0))
|| (tactic == Tactic::QuadMedJump
&& dist_sqrd < (1.5 * MIN_ATTACK_DIST * scale).powf(2.0))
|| dist_sqrd < (MIN_ATTACK_DIST * scale).powf(2.0)
{
// Movement
match tactic {
Tactic::Wolf | Tactic::Ram => {
// Run away from target to get clear
inputs.move_dir = (pos.0 - tgt_pos.0)
.xy()
.try_normalized()
.unwrap_or(Vec2::unit_y());
if dist_sqrd < (MIN_ATTACK_DIST * scale).powf(2.0)
&& thread_rng().gen_bool(0.5)
{
inputs.move_dir = Vec2::zero();
inputs.primary.set_state(true);
} else {
inputs.move_dir = (pos.0 - tgt_pos.0)
.xy()
.try_normalized()
.unwrap_or(Vec2::unit_y());
}
},
Tactic::QuadLowRanged => {
inputs.move_dir = (tgt_pos.0 - pos.0)
@ -495,28 +515,15 @@ impl<'a> System<'a> for Sys {
.unwrap_or(Vec2::unit_y());
},
Tactic::TailSlap => {
inputs.move_dir = Vec2::zero();
},
Tactic::QuadLowQuick => {
inputs.move_dir = Vec2::zero();
},
Tactic::QuadLowBasic => {
inputs.move_dir = Vec2::zero();
},
Tactic::QuadMedJump => {
inputs.move_dir = (tgt_pos.0 - pos.0)
.xy()
.try_normalized()
.unwrap_or(Vec2::unit_y())
* 0.05;
},
_ => {
inputs.move_dir = (tgt_pos.0 - pos.0)
.xy()
.try_normalized()
.unwrap_or(Vec2::unit_y())
* 0.1;
},
_ => {
inputs.move_dir = Vec2::zero();
},
}
match tactic {
@ -535,17 +542,6 @@ impl<'a> System<'a> for Sys {
*powerup += dt.0;
}
},
Tactic::Staff => {
// Kind of arbitrary values, but feel right in game
if energy.current() > 800 && thread_rng().gen::<f32>() > 0.8
{
inputs.ability3.set_state(true)
} else if energy.current() > 10 {
inputs.secondary.set_state(true)
} else {
inputs.primary.set_state(true)
}
},
Tactic::Sword => {
if *powerup < 2.0 && energy.current() > 500 {
inputs.ability3.set_state(true);
@ -570,13 +566,14 @@ impl<'a> System<'a> for Sys {
}
},
Tactic::Bow => inputs.roll.set_state(true),
Tactic::Staff => inputs.roll.set_state(true),
Tactic::Melee => inputs.primary.set_state(true),
// Animal attacks
Tactic::TailSlap => {
if *powerup > 4.0 {
inputs.primary.set_state(false);
*powerup = 0.0;
} else if *powerup > 2.0 {
} else if *powerup > 1.0 {
inputs.primary.set_state(true);
*powerup += dt.0;
} else {
@ -597,7 +594,9 @@ impl<'a> System<'a> for Sys {
}
},
Tactic::QuadLowQuick => inputs.secondary.set_state(true),
Tactic::QuadMedJump => inputs.primary.set_state(true),
Tactic::QuadMedJump => inputs.secondary.set_state(true),
Tactic::Lavadrake => inputs.secondary.set_state(true),
Tactic::Theropod => inputs.primary.set_state(true),
_ => {},
}
} else if tactic == Tactic::Wolf
@ -640,6 +639,46 @@ impl<'a> System<'a> for Sys {
&& dist_sqrd > (2.0 * MIN_ATTACK_DIST * scale).powf(2.0)
{
inputs.primary.set_state(true);
} else if tactic == Tactic::QuadMedJump
&& dist_sqrd < (5.0 * MIN_ATTACK_DIST * scale).powf(2.0)
{
inputs.ability3.set_state(true);
} else if tactic == Tactic::Staff
&& dist_sqrd < (5.0 * MIN_ATTACK_DIST * scale).powf(2.0)
{
inputs.move_dir = Vec2::zero();
if energy.current() > 800 && thread_rng().gen::<f32>() > 0.8 {
inputs.ability3.set_state(true);
} else if energy.current() > 10 {
inputs.secondary.set_state(true);
} else {
inputs.primary.set_state(true);
}
} else if tactic == Tactic::Lavadrake
&& dist_sqrd < (7.0 * MIN_ATTACK_DIST * scale).powf(2.0)
{
if *powerup < 2.0 {
inputs.move_dir = (tgt_pos.0 - pos.0)
.xy()
.rotated_z(0.47 * PI)
.try_normalized()
.unwrap_or(Vec2::unit_y());
inputs.primary.set_state(true);
*powerup += dt.0;
} else if *powerup < 4.0 {
inputs.move_dir = (tgt_pos.0 - pos.0)
.xy()
.rotated_z(-0.47 * PI)
.try_normalized()
.unwrap_or(Vec2::unit_y());
inputs.primary.set_state(true);
*powerup += dt.0;
} else if *powerup < 6.0 {
inputs.ability3.set_state(true);
*powerup += dt.0;
} else {
*powerup = 0.0;
}
} else if dist_sqrd < MAX_CHASE_DIST.powf(2.0)
|| (dist_sqrd < SIGHT_DIST.powf(2.0)
&& (!*been_close || !matches!(tactic, Tactic::Melee)))
@ -717,6 +756,17 @@ impl<'a> System<'a> for Sys {
Tactic::QuadLowRanged => {
inputs.secondary.set_state(true);
},
Tactic::QuadMedJump => {
inputs.primary.set_state(true);
},
Tactic::Lavadrake => {
if *powerup > 4.0 {
inputs.ability3.set_state(true);
*powerup = 0.0;
} else {
*powerup += dt.0;
}
},
_ => {},
}
}

View File

@ -46,7 +46,7 @@ impl Animation for AlphaAnimation {
Quaternion::rotation_x(movement1abs * 0.35 + movement2abs * -0.9)
* Quaternion::rotation_y(movement1 * 0.7 + movement2 * -1.0);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.6 + movement2abs * 0.6);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5);
next.chest.orientation = Quaternion::rotation_y(movement1 * -0.08 + movement2 * 0.15)
* Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6);

View File

@ -46,7 +46,7 @@ impl Animation for BetaAnimation {
Quaternion::rotation_x(movement1abs * 0.15 + movement2abs * -0.6)
* Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.15);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -1.0 + movement2abs * 1.0);
next.jaw.orientation = Quaternion::rotation_x(movement1abs * -0.9 + movement2abs * 0.9);
next.chest.orientation = Quaternion::rotation_y(movement1 * 0.08 + movement2 * -0.15)
* Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.3);

View File

@ -18,13 +18,12 @@ impl Animation for DashAnimation {
#[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_dash")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(velocity, global_time, stage_section, timer): Self::Dependency,
(_velocity, global_time, stage_section, timer): Self::Dependency,
anim_time: f64,
_rate: &mut f32,
_s_a: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let speed = (Vec2::<f32>::from(velocity).magnitude()).min(24.0);
let (movement1base, chargemovementbase, movement2base, movement3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.5), 0.0, 0.0, 0.0),
@ -72,27 +71,33 @@ impl Animation for DashAnimation {
next.tail.orientation = Quaternion::rotation_x(
0.15 + movement1abs * -0.4 + movement2abs * 0.2 + chargemovementbase * 0.2,
) * Quaternion::rotation_z(shortalt * 0.15);
if speed < 0.5 {
if mirror == 1.0 {
next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.6);
if let Some(stage_section) = stage_section {
match stage_section {
StageSection::Buildup => {
if mirror == 1.0 {
next.leg_fl.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.foot_fl.orientation =
Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
next.leg_bl.orientation = Quaternion::rotation_x(movement1abs * 0.6);
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
next.leg_bl.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.foot_bl.orientation =
Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
} else {
next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.6);
next.leg_fr.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.foot_fr.orientation =
Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
next.leg_br.orientation = Quaternion::rotation_x(movement1abs * 0.6);
next.leg_br.orientation = Quaternion::rotation_x(movement1abs * 0.8);
next.foot_br.orientation =
Quaternion::rotation_x(movement1abs * -0.6 + twitch1 * 0.3);
Quaternion::rotation_x(movement1abs * -0.8 + twitch1 * 0.5);
}
},
_ => {},
}
}
next

View File

@ -194,9 +194,9 @@ impl<'a> From<&'a Body> for SkeletonAttr {
scaler: match (body.species, body.body_type) {
(Archaeos, _) => (3.0),
(Odonto, _) => (3.0),
(Sandraptor, _) => (7.0),
(Snowraptor, _) => (7.0),
(Woodraptor, _) => (7.0),
(Sandraptor, _) => (8.0),
(Snowraptor, _) => (8.0),
(Woodraptor, _) => (8.0),
},
}
}

View File

@ -75,7 +75,10 @@ impl State {
.as_ref()
.map(|i| i.item.kind())
.filter(|kind| {
use common::comp::item::{tool::ToolKind, ItemKind};
use common::comp::item::{
tool::{ToolKind, UniqueKind},
ItemKind,
};
if let ItemKind::Tool(kind) = kind {
match &kind.kind {
ToolKind::Staff => true,
@ -84,6 +87,8 @@ impl State {
ToolKind::Hammer => true,
ToolKind::Axe => true,
ToolKind::Bow => true,
ToolKind::Unique(UniqueKind::QuadMedQuick) => true,
ToolKind::Unique(UniqueKind::QuadLowBreathe) => true,
_ => false,
}
} else {