From 7c5c2058e9aea996dc6c76a7e6d9ba4fc2a2bc77 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 30 Jun 2014 16:47:03 -0700 Subject: It's about time I did this --- src/map/battle.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/map/battle.cpp') diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 5219675..c0459a7 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -712,16 +712,16 @@ int battle_get_mdef2(dumb_ptr bl) */ interval_t battle_get_speed(dumb_ptr bl) { - nullpo_retr(std::chrono::seconds(1), bl); + nullpo_retr(1_s, bl); if (bl->bl_type == BL::PC) return bl->is_player()->speed; else { - interval_t speed = std::chrono::seconds(1); + interval_t speed = 1_s; if (bl->bl_type == BL::MOB) speed = static_cast(bl->is_mob()->stats[mob_stat::SPEED]); - return std::max(speed, std::chrono::milliseconds(1)); + return std::max(speed, 1_ms); } } @@ -733,13 +733,13 @@ interval_t battle_get_speed(dumb_ptr bl) // TODO figure out what all the doubling is about interval_t battle_get_adelay(dumb_ptr bl) { - nullpo_retr(std::chrono::seconds(4), bl); + nullpo_retr(4_s, bl); if (bl->bl_type == BL::PC) return bl->is_player()->aspd * 2; else { eptr sc_data = battle_get_sc_data(bl); - interval_t adelay = std::chrono::seconds(4); + interval_t adelay = 4_s; int aspd_rate = 100; if (bl->bl_type == BL::MOB) adelay = static_cast(bl->is_mob()->stats[mob_stat::ADELAY]); @@ -761,13 +761,13 @@ interval_t battle_get_adelay(dumb_ptr bl) interval_t battle_get_amotion(dumb_ptr bl) { - nullpo_retr(std::chrono::seconds(2), bl); + nullpo_retr(2_s, bl); if (bl->bl_type == BL::PC) return bl->is_player()->amotion; else { eptr sc_data = battle_get_sc_data(bl); - interval_t amotion = std::chrono::seconds(2); + interval_t amotion = 2_s; int aspd_rate = 100; if (bl->bl_type == BL::MOB) amotion = static_cast(get_mob_db(bl->is_mob()->mob_class).amotion); @@ -798,7 +798,7 @@ interval_t battle_get_dmotion(dumb_ptr bl) return bl->is_player()->dmotion; } else - return std::chrono::seconds(2); + return 2_s; } LevelElement battle_get_element(dumb_ptr bl) @@ -2052,7 +2052,7 @@ ATK battle_weapon_attack(dumb_ptr src, dumb_ptr target, && (sd->status.weapon == ItemLook::_16 || sd->status.weapon >= ItemLook::SINGLE_HANDED_COUNT) && wd.damage2 == 0) - clif_damage(src, target, tick + std::chrono::milliseconds(10), + clif_damage(src, target, tick + 10_ms, wd.amotion, wd.dmotion, 0, 1, DamageType::NORMAL, 0); } @@ -2580,7 +2580,7 @@ bool battle_config_read(ZString cfgName) void battle_config_check() { { - if (static_cast(battle_config.flooritem_lifetime) < std::chrono::seconds(1)) + if (static_cast(battle_config.flooritem_lifetime) < 1_s) battle_config.flooritem_lifetime = std::chrono::duration_cast(LIFETIME_FLOORITEM).count(); if (battle_config.restart_hp_rate < 0) battle_config.restart_hp_rate = 0; -- cgit v1.2.3-60-g2f50