Added base ability set

This commit is contained in:
Sam 2021-05-31 19:40:25 -05:00
parent 059dfd2602
commit a82984b925
13 changed files with 122 additions and 7 deletions

10
Cargo.lock generated
View File

@ -2487,6 +2487,15 @@ dependencies = [
"serde",
]
[[package]]
name = "inline_tweak"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7033e97b20277cc0d043226d1940fa7719ff08d2305d1fc7421e53066d00eb4b"
dependencies = [
"lazy_static",
]
[[package]]
name = "inotify"
version = "0.7.1"
@ -6038,6 +6047,7 @@ dependencies = [
"iced_native",
"iced_winit",
"image",
"inline_tweak",
"itertools 0.10.0",
"keyboard-keynames",
"lazy_static",

View File

@ -237,6 +237,14 @@
(None, "common.abilities.custom.claygolem.rocket"),
],
),
Custom("Yeti"): (
primary: "common.abilities.custom.yeti.strike",
secondary: "common.abilities.custom.yeti.icespikes",
abilities: [
(None, "common.abilities.custom.yeti.frostbreath"),
(None, "common.abilities.custom.yeti.snowball"),
],
),
Custom("Bird Large Breathe"): (
primary: "common.abilities.custom.birdlargebreathe.firebomb",
secondary: "common.abilities.custom.birdlargebreathe.triplestrike",

View File

@ -0,0 +1,19 @@
BasicBeam(
buildup_duration: 0.4,
recover_duration: 0.25,
beam_duration: 0.5,
damage: 50,
tick_rate: 1.0,
range: 15.0,
max_angle: 22.5,
damage_effect: Some(Buff((
kind: Frozen,
dur_secs: 3.0,
strength: Value(2.0),
chance: 1.0,
))),
energy_regen: 0,
energy_drain: 0,
orientation_behavior: Normal,
specifier: Frost,
)

View File

@ -0,0 +1,17 @@
Shockwave(
energy_cost: 0,
buildup_duration: 0.6,
swing_duration: 0.12,
recover_duration: 1.2,
damage: 300,
poise_damage: 30,
knockback: (strength: 40.0, direction: Up),
shockwave_angle: 90.0,
shockwave_vertical_angle: 15.0,
shockwave_speed: 25.0,
shockwave_duration: 1.0,
requires_ground: false,
move_efficiency: 0.0,
damage_kind: Piercing,
//specifier: IceSpikes,
)

View File

@ -0,0 +1,13 @@
BasicRanged(
energy_cost: 0,
buildup_duration: 0.5,
recover_duration: 0.4,
projectile: Frostball( // Snowball
damage: 80.0,
radius: 5.0,
),
projectile_body: Object(BoltFire), // Snowball
projectile_speed: 30.0,
num_projectiles: 1,
projectile_spread: 0.0,
)

View File

@ -0,0 +1,13 @@
BasicMelee(
energy_cost: 0,
buildup_duration: 0.8,
swing_duration: 0.2,
recover_duration: 0.5,
base_damage: 150,
base_poise_damage: 50,
knockback: 30.0,
range: 4.0,
max_angle: 20.0,
damage_effect: None,
damage_kind: Crushing,
)

View File

@ -5,8 +5,8 @@ ItemDef(
kind: Hammer,
hands: Two,
stats: Direct((
equip_time_secs: 0.0,
power: 2.0,
equip_time_secs: 0.01,
power: 1.0,
poise_strength: 1.0,
speed: 1.0,
crit_chance: 0.046875,
@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_spec: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Yeti")),
)

View File

@ -144,6 +144,12 @@ vec3 perp_axis2(vec3 axis1, vec3 axis2) {
return normalize(vec3(axis1.y * axis2.z - axis1.z * axis2.y, axis1.z * axis2.x - axis1.x * axis2.z, axis1.x * axis2.y - axis1.y * axis2.x));
}
// Line is the axis of the spiral, it goes from the start position to the end position
// Radius is the distance from the axis the particle is
// Time function is some value that ideally goes from 0 to 1. When it is 0, it is as
// the point (0, 0, 0), when it is 1, it is at the point provided by the coordinates of line
// Frequency increases the frequency of rotation
// Offset is an offset to the angle of the rotation
vec3 spiral_motion(vec3 line, float radius, float time_function, float frequency, float offset) {
vec3 axis2 = perp_axis1(line);
vec3 axis3 = perp_axis2(line, axis2);
@ -420,10 +426,11 @@ void main() {
break;
case ICE:
f_reflect = 0.0; // Ice doesn't reflect to look like magic
float ice_color = 1.9 + rand5 * 0.3;
attr = Attr(
inst_dir * ((rand0+1.0)/2 + 0.4) * slow_end(2.0) + 0.3 * grav_vel(earth_gravity),
vec3((3 * (1 - slow_start(0.1)))),
vec4(0.2, 1.6 + rand5 * 0.3 - 0.4 * percent(), 3, 1),
vec3((5 * (1 - slow_start(.1)))),
vec4(0.8 * ice_color, 0.9 * ice_color, ice_color, 1),
spin_in_axis(vec3(rand6, rand7, rand8), percent() * 10 + 3 * rand9)
);
break;

View File

@ -54,4 +54,5 @@ pub enum FrontendSpecifier {
Cultist,
ClayGolem,
Bubbles,
Frost,
}

View File

@ -104,7 +104,7 @@ treeculler = "0.2"
tokio = { version = "1", default-features = false, features = ["rt-multi-thread"] }
num_cpus = "1.0"
# vec_map = { version = "0.8.2" }
# inline_tweak = "1.0.2"
inline_tweak = "1.0.2"
itertools = "0.10.0"
# Tracy

View File

@ -403,7 +403,7 @@ impl SfxMgr {
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
}
},
beam::FrontendSpecifier::ClayGolem | beam::FrontendSpecifier::Bubbles => {},
beam::FrontendSpecifier::ClayGolem | beam::FrontendSpecifier::Bubbles | beam::FrontendSpecifier::Frost => {},
},
Outcome::BreakBlock { pos, .. } => {
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::BreakBlock);

View File

@ -81,6 +81,7 @@ pub enum ParticleMode {
Laser = 28,
Bubbles = 29,
Water = 30,
IceSpikes = 31,
}
impl ParticleMode {

View File

@ -855,6 +855,32 @@ impl ParticleMgr {
},
);
},
beam::FrontendSpecifier::Frost => {
let mut rng = thread_rng();
use inline_tweak::tweak;
let (from, to) = (Vec3::<f32>::unit_z(), *ori.look_dir());
let m = Mat3::<f32>::rotation_from_to_3d(from, to);
self.particles.resize_with(
self.particles.len() + usize::from(beam_tick_count) / tweak!(4),
|| {
let phi: f32 = rng.gen_range(0.0..beam.properties.angle);
let theta: f32 = rng.gen_range(0.0..2.0 * PI);
let offset_z = Vec3::new(
phi.sin() * theta.cos(),
phi.sin() * theta.sin(),
phi.cos(),
);
let random_ori = offset_z * m * Vec3::new(-1.0, -1.0, 1.0);
Particle::new_directed(
beam.properties.duration,
time,
ParticleMode::Ice,
pos.0,
pos.0 + random_ori * range,
)
},
);
},
}
}
}