Skip to content

Commit

Permalink
Remove dummy
Browse files Browse the repository at this point in the history
As I'm planning on making changes to the builders, it would be best to
not waste effort with the dummy
  • Loading branch information
haihala committed Nov 12, 2024
1 parent 806c7b7 commit f7f83bc
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 83,210 deletions.
3 changes: 1 addition & 2 deletions client/characters/src/actions/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ macro_rules! throw_target {
if situation.on_frame(0) {
vec![
AnimationRequest {
animation: $animation.into(),
invert: true,
..default()
..AnimationRequest::from(Animation::from($animation))
}
.into(),
ActionEvent::ModifyResource(ResourceType::Health, -$damage),
Expand Down
11 changes: 3 additions & 8 deletions client/characters/src/actions/action_event.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bevy::prelude::*;

use wag_core::{
ActionId, Animation, Area, CancelWindow, DummyAnimation, SamuraiAnimation, SoundEffect,
StatusCondition, StatusFlag, VfxRequest, VoiceLine,
ActionId, Animation, Area, CancelWindow, SamuraiAnimation, SoundEffect, StatusCondition,
StatusFlag, VfxRequest, VoiceLine,
};

use crate::{FlashRequest, Movement, ResourceType};
Expand Down Expand Up @@ -70,12 +70,7 @@ impl From<VfxRequest> for ActionEvent {
ActionEvent::RelativeVisualEffect(value)
}
}
// This isn't a great way to do this, but it's the best I can think of for now
impl From<DummyAnimation> for ActionEvent {
fn from(value: DummyAnimation) -> Self {
ActionEvent::Animation(Animation::from(value).into())
}
}

impl From<SamuraiAnimation> for ActionEvent {
fn from(value: SamuraiAnimation) -> Self {
ActionEvent::Animation(Animation::from(value).into())
Expand Down
7 changes: 5 additions & 2 deletions client/characters/src/actions/animation_request.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bevy::prelude::*;
use wag_core::Animation;

#[derive(Debug, Default, Clone, Copy, PartialEq, Reflect)]
#[derive(Debug, Clone, Copy, PartialEq, Reflect)]
pub struct AnimationRequest {
pub animation: Animation,
pub position_offset: Vec2,
Expand All @@ -13,7 +13,10 @@ impl From<Animation> for AnimationRequest {
fn from(animation: Animation) -> Self {
Self {
animation,
..default()
position_offset: Vec2::ZERO,
invert: false,
looping: false,
ignore_action_speed: false,
}
}
}
7 changes: 4 additions & 3 deletions client/characters/src/actions/attack_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub struct AttackBuilder {
open_cancel: Option<CancelWindow>,
air_move: bool,
category: ActionCategory,
animation: Animation,
animation: Option<Animation>,
audio: SoundEffect,
extra_initial_events: Vec<ActionEvent>,
dynamic_initial_events: OptionalDynamic,
Expand Down Expand Up @@ -255,7 +255,7 @@ impl AttackBuilder {

pub fn with_animation(self, animation: impl Into<Animation>) -> Self {
Self {
animation: animation.into(),
animation: Some(animation.into()),
..self
}
}
Expand Down Expand Up @@ -548,7 +548,8 @@ impl AttackBuilder {
let startup = self.startup;
let duration = self.startup + self.recovery;

let mut initial_events: Vec<ActionEvent> = vec![self.animation.into(), self.audio.into()];
let mut initial_events: Vec<ActionEvent> =
vec![self.animation.unwrap().into(), self.audio.into()];
if !self.extra_initial_events.is_empty() {
initial_events.extend(self.extra_initial_events.clone());
}
Expand Down
8 changes: 3 additions & 5 deletions client/characters/src/characters/character.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,13 @@ impl Character {
mod test {
use wag_core::SamuraiAction;

use crate::{
characters::samurai, dummy, ActionEvent, ActionRequirement, ActionTracker, Situation,
};
use crate::{characters::samurai, ActionEvent, ActionRequirement, ActionTracker, Situation};

use super::*;

#[test]
fn all_moves_end() {
for char in [samurai(), dummy()] {
for char in [samurai()] {
for (id, mov) in char.moves.iter() {
// There is a list of exceptions
if matches!(id, ActionId::Samurai(SamuraiAction::FootDiveHold)) {
Expand Down Expand Up @@ -103,7 +101,7 @@ mod test {

#[test]
fn moves_with_inputs_have_starter_requirement() {
for char in [samurai(), dummy()] {
for char in [samurai()] {
for (id, mov) in char.moves.iter() {
dbg!(id);

Expand Down
Loading

0 comments on commit f7f83bc

Please sign in to comment.