diff options
author | Daniel Schadt <kingdread@gmx.de> | 2018-06-13 13:07:48 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2018-06-13 13:08:38 +0200 |
commit | fe16699205b6b40aed8cafbe95820835a7052908 (patch) | |
tree | 1c0a7ea744e090f6c18f4f71472bd641764cdfe0 /src/main.rs | |
parent | cb20d6966a4c3d386925f812fe83b00f3f803db3 (diff) | |
download | evtclib-fe16699205b6b40aed8cafbe95820835a7052908.tar.gz evtclib-fe16699205b6b40aed8cafbe95820835a7052908.tar.bz2 evtclib-fe16699205b6b40aed8cafbe95820835a7052908.zip |
rework damage tracker
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs index f632db4..610ba40 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,6 +70,10 @@ pub fn main() -> Result<(), evtclib::raw::parser::ParseError> { let mut count = 0; let mut damage = 0; let mut failed = 0; + let mut boonq = + evtclib::statistics::boon::BoonQueue::new(5, evtclib::statistics::boon::BoonType::Duration); + let mut last_time = 0; + let mut uptime = 0; for event in &result.events { let shiny = if let Some(c) = evtclib::Event::from_raw(event) { c @@ -78,6 +82,8 @@ pub fn main() -> Result<(), evtclib::raw::parser::ParseError> { failed += 1; continue; }; + uptime += boonq.current_stacks() as u64 * (event.time - last_time); + boonq.simulate(event.time - last_time); match shiny.kind { EventKind::Physical { source_agent_addr: src, @@ -98,8 +104,33 @@ pub fn main() -> Result<(), evtclib::raw::parser::ParseError> { damage += dmg as u64; } + EventKind::BuffApplication { + buff_id: 1187, + destination_agent_addr: 5480786193115521456, + duration, + .. + } => { + //println!("{:10} I got might for {}!", shiny.time, duration); + boonq.add_stack(duration as u64); + } + + EventKind::BuffRemove { + source_agent_addr: 5480786193115521456, + buff_id: 736, + removal, + total_duration, + longest_stack, + .. + } => { + println!( + "{:10} Buffremove, removal {:?} dur {:?} longest {:?}", + shiny.time, removal, total_duration, longest_stack + ); + } + _ => (), } + last_time = event.time; } println!("Count: {}, Damage: {}", count, damage); println!("Failed events: {}", failed); @@ -107,23 +138,15 @@ pub fn main() -> Result<(), evtclib::raw::parser::ParseError> { let processed = evtclib::process(&result).unwrap(); //println!("Me: {:#?}", processed.agent_by_addr(5480786193115521456)); let stats = evtclib::statistics::calculate(&processed).unwrap(); - println!("{:#?}", stats); + //println!("{:#?}", stats); let mine = stats.agent_stats.get(&5480786193115521456).unwrap(); - println!("Mine: {:#?}", mine); - println!( - "DPS: {:#?}", - mine.total_damage.total_damage / (mine.combat_time() / 1000) - ); - println!( - "Boss DPS: {:#?}", - mine.boss_damage.total_damage / (mine.combat_time() / 1000) - ); - println!("Boons:"); - for (boon, uptime) in &mine.boon_averages { - let boon = evtclib::statistics::gamedata::get_boon(*boon); - println!("{}: {}", boon.unwrap().1, uptime); - } + let my_addr = 5480786193115521456; + + let my_damage = stats.damage_log.damage(|m| m.source == my_addr); + + println!("Damages: {:?}", stats.damage_log); + println!("My damage: {:?}", my_damage); Ok(()) } |