~neon/dragons-dungeon

f30c989f0caa54f6bab2bd6563dddfd8118ec232 — Jens Pitkanen 3 years ago 51dbce9
RC1
A builds/windows-x86_64/SDL2.dll => builds/windows-x86_64/SDL2.dll +0 -0
A builds/windows-x86_64/sevendrl.exe => builds/windows-x86_64/sevendrl.exe +0 -0
A itch/background.png => itch/background.png +0 -0
A itch/cover.png => itch/cover.png +0 -0
A itch/screenshot-01.png => itch/screenshot-01.png +0 -0
A itch/screenshot-02.png => itch/screenshot-02.png +0 -0
A itch/screenshot-03.png => itch/screenshot-03.png +0 -0
M src/main.rs => src/main.rs +2 -2
@@ 17,7 17,7 @@ use ui::Ui;
use world::{PlayerAction, World};

static LOGGER: Logger = Logger;
pub static TITLE: &str = "7DRL 2020 by neonmoe";
pub static TITLE: &str = "The Dragon's Dungeon";

fn main() -> Result<(), fae::Error> {
    log::set_logger(&LOGGER)


@@ 112,7 112,7 @@ fn main() -> Result<(), fae::Error> {
                            action_queue.push_back(PlayerAction::Wait);
                        } else if input::is_key_next_level(keycode) {
                            action_queue.push_back(PlayerAction::NextLevel);
                        } else if input::is_key_restart(keycode) && game_over {
                        } else if input::is_key_restart(keycode) && (game_over || victory) {
                            world = World::new();
                            action_queue.clear();
                        } else {

M src/sprites.rs => src/sprites.rs +23 -19
@@ 1,23 1,27 @@
pub type SpriteData = (i32, i32, i32, i32);

pub const PLAYER: SpriteData = (0, 0, 16, 16);
pub const WALL: SpriteData = (0, 16, 16, 16);
pub const SKELETON: SpriteData = (0, 48, 16, 16);
pub const ZOMBIE: SpriteData = (0, 192, 16, 16);
pub const DRAGON: SpriteData = (0, 208, 16, 16);
pub const FLAME: SpriteData = (0, 256, 16, 16);
pub const DOOR: SpriteData = (0, 240, 16, 16);
pub const NEXT_LEVEL: SpriteData = (0, 272, 16, 16);
pub const ICONS_HEART: [SpriteData; 4] =
    [(0, 32, 6, 6), (6, 32, 6, 6), (0, 38, 6, 6), (6, 38, 6, 6)];
pub const ITEM_SWORD: SpriteData = (0, 64, 16, 16);
pub const ITEM_SCYTHE: SpriteData = (0, 80, 16, 16);
pub const ITEM_HAMMER: SpriteData = (0, 96, 16, 16);
pub const ITEM_DAGGER: SpriteData = (0, 112, 16, 16);
pub const ITEM_SHIELD: SpriteData = (0, 128, 16, 16);
pub const ITEM_VAMPIRE_TEETH: SpriteData = (0, 144, 16, 16);
pub const ITEM_STOPWATCH: SpriteData = (0, 160, 16, 16);
pub const ITEM_APPLE: SpriteData = (0, 224, 16, 16);
pub const PLAYER: SpriteData = (0 * 2, 0 * 2, 16 * 2, 16 * 2);
pub const WALL: SpriteData = (0 * 2, 16 * 2, 16 * 2, 16 * 2);
pub const SKELETON: SpriteData = (0 * 2, 48 * 2, 16 * 2, 16 * 2);
pub const ZOMBIE: SpriteData = (0 * 2, 192 * 2, 16 * 2, 16 * 2);
pub const DRAGON: SpriteData = (0 * 2, 208 * 2, 16 * 2, 16 * 2);
pub const FLAME: SpriteData = (0 * 2, 256 * 2, 16 * 2, 16 * 2);
pub const DOOR: SpriteData = (0 * 2, 240 * 2, 16 * 2, 16 * 2);
pub const NEXT_LEVEL: SpriteData = (0 * 2, 272 * 2, 16 * 2, 16 * 2);
pub const ICONS_HEART: [SpriteData; 4] = [
    (0 * 2, 32 * 2, 6 * 2, 6 * 2),
    (6 * 2, 32 * 2, 6 * 2, 6 * 2),
    (0 * 2, 38 * 2, 6 * 2, 6 * 2),
    (6 * 2, 38 * 2, 6 * 2, 6 * 2),
];
pub const ITEM_SWORD: SpriteData = (0 * 2, 64 * 2, 16 * 2, 16 * 2);
pub const ITEM_SCYTHE: SpriteData = (0 * 2, 80 * 2, 16 * 2, 16 * 2);
pub const ITEM_HAMMER: SpriteData = (0 * 2, 96 * 2, 16 * 2, 16 * 2);
pub const ITEM_DAGGER: SpriteData = (0 * 2, 112 * 2, 16 * 2, 16 * 2);
pub const ITEM_SHIELD: SpriteData = (0 * 2, 128 * 2, 16 * 2, 16 * 2);
pub const ITEM_VAMPIRE_TEETH: SpriteData = (0 * 2, 144 * 2, 16 * 2, 16 * 2);
pub const ITEM_STOPWATCH: SpriteData = (0 * 2, 160 * 2, 16 * 2, 16 * 2);
pub const ITEM_APPLE: SpriteData = (0 * 2, 224 * 2, 16 * 2, 16 * 2);

#[allow(dead_code)]
pub const COBWEB: SpriteData = (0, 176, 16, 16);
pub const COBWEB: SpriteData = (0 * 2, 176 * 2, 16 * 2, 16 * 2);

M src/tileset.png => src/tileset.png +0 -0
M src/world/entities.rs => src/world/entities.rs +7 -7
@@ 41,7 41,7 @@ pub const PROTO_PLAYER: Entity = Entity {
        max: 12,
    }),
    status_effects: Some(Vec::new()),
    damage: Some(Damage(4)),
    damage: Some(Damage(2)),
    inventory: Some(Inventory::new()),
    ai: None,
    drop: None,


@@ 80,7 80,7 @@ pub const PROTO_SKELETON: Entity = Entity {
        max: 10,
    }),
    status_effects: Some(Vec::new()),
    damage: Some(Damage(4)),
    damage: Some(Damage(2)),
    inventory: None,
    ai: Some(Ai::Skeleton),
    drop: None,


@@ 120,7 120,7 @@ pub const PROTO_ZOMBIE: Entity = Entity {
        max: 12,
    }),
    status_effects: Some(Vec::new()),
    damage: Some(Damage(3)),
    damage: Some(Damage(2)),
    inventory: None,
    ai: Some(Ai::Zombie),
    drop: None,


@@ 137,11 137,11 @@ pub const PROTO_DRAGON: Entity = Entity {
    animation: Animation::default(),
    denies_movement: true,
    health: Some(Health {
        current: 24,
        max: 24,
        current: 4 * 9,
        max: 4 * 9,
    }),
    status_effects: Some(Vec::new()),
    damage: Some(Damage(10)),
    damage: Some(Damage(5)),
    inventory: None,
    ai: Some(Ai::Dragon),
    drop: None,


@@ 159,7 159,7 @@ pub const PROTO_FLAME: Entity = Entity {
    denies_movement: false,
    health: None,
    status_effects: None,
    damage: Some(Damage(5)),
    damage: Some(Damage(3)),
    inventory: None,
    ai: Some(Ai::Flame),
    drop: None,

M src/world/mod.rs => src/world/mod.rs +5 -7
@@ 441,9 441,9 @@ impl World {
            let x = (position.x as f32 + animation.x.current) * tile_size + offset.0;
            let y = (position.y as f32 + animation.y.current) * tile_size + offset.1;
            let mut sprite_data = sprite.0;
            sprite_data.0 += 16 * ai_offset;
            sprite_data.0 += sprite_data.2 * ai_offset;
            if flip {
                sprite_data.0 += 16;
                sprite_data.0 += sprite_data.2;
                sprite_data.2 *= -1;
            }



@@ 671,14 671,12 @@ pub fn attack_direction(

        if let Some(target_status_effects) = &mut target.status_effects {
            if has_item(Item::Dagger) {
                let poison_duration = 2;
                let poison_max_stacks = 2;
                let poison_duration = 6;
                let poisoned_already =
                    target_status_effects
                        .iter_mut()
                        .any(|status_effect| match status_effect {
                            StatusEffect::Poison { stacks, duration } => {
                                *stacks = (*stacks + 1).min(poison_max_stacks);
                            StatusEffect::Poison { duration, .. } => {
                                *duration = poison_duration;
                                true
                            }


@@ 705,7 703,7 @@ pub fn attack_direction(

    if has_item(Item::VampireTeeth) {
        if let Some(health) = health {
            health.current = (health.current + damage_dealt).min(health.max);
            health.current = (health.current + damage_dealt / 2).min(health.max);
        }
    }
}