diff --git a/assets/config/actor.ron b/assets/config/actor.ron index 5de3326..98932d0 100644 --- a/assets/config/actor.ron +++ b/assets/config/actor.ron @@ -11,14 +11,14 @@ ), sprite_animation: SpriteAnimation( frames: [ - SpriteAnimationFrame(index: 0, beats: 8), SpriteAnimationFrame(index: 1, beats: 8), + SpriteAnimationFrame(index: 0, beats: 8), ], ), attack: Attack(color: Srgba(Srgba(red: 0.855, green: 0.576, blue: 0.800, alpha: 1.000))), health: Health(max: 100, current: 100), - deck: Deck(cards: ["step", "pair", "half_rest"]), + deck: Deck(cards: ["eighth_rest", "quarter_rest", "half_rest", "whole_rest"]), ), }, @@ -36,8 +36,8 @@ ), sprite_animation: SpriteAnimation( frames: [ - SpriteAnimationFrame(index: 0, beats: 8), SpriteAnimationFrame(index: 1, beats: 8), + SpriteAnimationFrame(index: 0, beats: 8), ], ), diff --git a/assets/config/card.ron b/assets/config/card.ron index d03c4fa..1dd1ad3 100644 --- a/assets/config/card.ron +++ b/assets/config/card.ron @@ -68,6 +68,10 @@ }, // TODO: "contact damage" -> something more thematic? card_map: { + /********/ + /* Move */ + /********/ + "step": Card( name: "Simple Step", description: "Step forwards for 8 contact damage.\n\n\"fancy footwork starts here\"", @@ -159,6 +163,10 @@ ), ), + /**********/ + /* Attack */ + /**********/ + "eighth_note": Card( name: "Eighth Note", description: "Sing an eighth note.", @@ -296,23 +304,27 @@ ), ), + /********/ + /* Heal */ + /********/ + "eighth_rest": Card( name: "Eighth Rest", - description: "Heal a little bit.", + description: "Restore 5 health.", background: "green", icon: "eighth_rest", max_level: 4, action: Heal, action_modifier: CardActionModifier( - heal_flat: 10, - immunity: 0.5, + heal_flat: 5, + immunity: 0.15, attack: Attack(projectile: Some("eighth_rest"), offset: 8.0), ), ), "quarter_rest": Card( name: "Quarter Rest", - description: "Heal a good amount.", + description: "Restore 10 health.", background: "green", icon: "quarter_rest", min_level: 4, @@ -321,14 +333,14 @@ action: Heal, action_modifier: CardActionModifier( - heal_flat: 30, - immunity: 0.666, + heal_flat: 10, + immunity: 0.25, attack: Attack(projectile: Some("quarter_rest"), offset: 8.0), ), ), "half_rest": Card( name: "Half Rest", - description: "Heal for 25%.", + description: "Restore 25% of missing health.", background: "green", icon: "half_rest", min_level: 6, @@ -337,14 +349,14 @@ action: Heal, action_modifier: CardActionModifier( - heal_percent: 25, - immunity: 0.833, + heal_percent_missing: 25, + immunity: 0.4, attack: Attack(projectile: Some("half_rest"), offset: 8.0), ), ), "whole_rest": Card( name: "Whole Rest", - description: "Heal for 50%.", + description: "Restore 50% of missing health.", background: "green", icon: "whole_rest", min_level: 8, @@ -352,8 +364,8 @@ action: Heal, action_modifier: CardActionModifier( - heal_percent: 50, - immunity: 1.0, + heal_percent_missing: 50, + immunity: 0.65, attack: Attack(projectile: Some("whole_rest"), offset: 8.0), ), ), diff --git a/assets/config/projectile.ron b/assets/config/projectile.ron index 4564085..f88825e 100644 --- a/assets/config/projectile.ron +++ b/assets/config/projectile.ron @@ -3,22 +3,22 @@ "eighth_rest": Projectile( name: "Eighth Rest", texture: "image/projectile/eighth_rest.png", - lifetime: 0.55, + lifetime: 0.3, ), "quarter_rest": Projectile( name: "Quarter Rest", texture: "image/projectile/quarter_rest.png", - lifetime: 0.716, + lifetime: 0.4, ), "half_rest": Projectile( name: "Half Rest", texture: "image/projectile/half_rest.png", - lifetime: 0.9, + lifetime: 0.55, ), "whole_rest": Projectile( name: "Whole Rest", texture: "image/projectile/whole_rest.png", - lifetime: 1.05, + lifetime: 0.8, ), "eighth_note": Projectile( name: "Eighth Note", diff --git a/assets/image/card/icon/half_rest.png b/assets/image/card/icon/half_rest.png index 8aa27c2..8aa4825 100644 Binary files a/assets/image/card/icon/half_rest.png and b/assets/image/card/icon/half_rest.png differ diff --git a/assets/image/card/icon/icons.aseprite b/assets/image/card/icon/icons.aseprite index 50f8dd5..0d17fd3 100644 Binary files a/assets/image/card/icon/icons.aseprite and b/assets/image/card/icon/icons.aseprite differ diff --git a/assets/image/card/icon/whole_rest.png b/assets/image/card/icon/whole_rest.png index 7300b44..6f0f6d3 100644 Binary files a/assets/image/card/icon/whole_rest.png and b/assets/image/card/icon/whole_rest.png differ diff --git a/assets/image/projectile/projectiles.aseprite b/assets/image/projectile/projectiles.aseprite index 3849d54..41905a9 100644 Binary files a/assets/image/projectile/projectiles.aseprite and b/assets/image/projectile/projectiles.aseprite differ diff --git a/assets/image/projectile/quarter_rest.png b/assets/image/projectile/quarter_rest.png index fd705b5..cab4997 100644 Binary files a/assets/image/projectile/quarter_rest.png and b/assets/image/projectile/quarter_rest.png differ diff --git a/src/game/card/action.rs b/src/game/card/action.rs index 19d331a..e95e2c1 100644 --- a/src/game/card/action.rs +++ b/src/game/card/action.rs @@ -96,8 +96,10 @@ impl FromWorld for CardActionMap { let mut entity = r!(world.get_entity_mut(entity)); let mut health = r!(entity.get_mut::()); + health.current += modifier.heal_percent_missing / 100.0 + * (health.max - health.current).max(0.0); + health.current += modifier.heal_percent_max / 100.0 * health.max; health.current += modifier.heal_flat; - health.current += modifier.heal_percent / 100.0 * health.max; let mut attack_controller = r!(entity.get_mut::()); attack_controller.aim = Vec2::Y; @@ -153,18 +155,22 @@ impl Default for CardAction { } #[derive(Reflect, Serialize, Deserialize, Clone)] -#[serde(default)] +#[serde(deny_unknown_fields, default)] pub struct CardActionModifier { /// Remove component after this many eighth-beats. remove_on_beat: usize, /// Remove component when this timer finishes. remove_on_timer: Timer, + + movement: Movement, + attack: Attack, attack_on_beat: usize, - movement: Movement, contact_damage: f32, contact_beats: usize, - heal_percent: f32, + + heal_percent_max: f32, + heal_percent_missing: f32, heal_flat: f32, immunity: f32, } @@ -174,12 +180,16 @@ impl Default for CardActionModifier { Self { remove_on_beat: 0, remove_on_timer: Timer::default(), + + movement: Movement::default(), + attack: Attack::default(), attack_on_beat: 4, - movement: Movement::default(), contact_damage: 0.0, contact_beats: 0, - heal_percent: 0.0, + + heal_percent_max: 0.0, + heal_percent_missing: 0.0, heal_flat: 0.0, immunity: 0.0, }