Skip to content

Instantly share code, notes, and snippets.

@cgdangelo
Created August 10, 2018 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgdangelo/940ab4c597ba908f5806aaa9eadc39df to your computer and use it in GitHub Desktop.
Save cgdangelo/940ab4c597ba908f5806aaa9eadc39df to your computer and use it in GitHub Desktop.
diff --git a/engine/sim/sc_raid_event.cpp b/engine/sim/sc_raid_event.cpp
index c3486b5060..959129f912 100644
--- a/engine/sim/sc_raid_event.cpp
+++ b/engine/sim/sc_raid_event.cpp
@@ -297,6 +297,37 @@ struct adds_event_t : public raid_event_t
adds[ i ]->dismiss();
}
}
+
+ void output_json( js::JsonOutput& root ) override
+ {
+ raid_event_t::output_json( root );
+
+ root[ "name" ] = name_str;
+ root[ "count" ] = count;
+ root[ "health" ] = health;
+
+ if ( master != nullptr )
+ {
+ root[ "master" ] = master -> name();
+ }
+
+ root[ "count_range" ] = count_range;
+ root[ "adds_to_remove" ] = as<unsigned>( adds_to_remove );
+
+ if ( sim -> distance_targeting_enabled )
+ {
+ root[ "spawn_x_coord" ] = spawn_x_coord;
+ root[ "spawn_y_coord" ] = spawn_y_coord;
+ root[ "spawn_stacked" ] = spawn_stacked;
+ root[ "spawn_radius_min" ] = spawn_radius_min;
+ root[ "spawn_radius_max" ] = spawn_radius_max;
+ root[ "spawn_radius" ] = spawn_radius;
+ root[ "spawn_angle_start" ] = spawn_angle_start;
+ root[ "spawn_angle_end" ] = spawn_angle_end;
+ }
+
+ root[ "race" ] = race;
+ }
};
struct move_enemy_t : public raid_event_t
@@ -1749,6 +1780,28 @@ double raid_event_t::evaluate_raid_event_expression( sim_t* s, std::string& type
;
}
+void raid_event_t::output_json( js::JsonOutput& root )
+{
+ root[ "name" ] = name;
+ root[ "type" ] = type;
+ root[ "first" ] = first;
+ root[ "last" ] = last;
+ root[ "cooldown" ] = cooldown;
+ root[ "cooldown_stddev" ] = cooldown_stddev;
+ root[ "cooldown_min" ] = cooldown_min;
+ root[ "cooldown_max" ] = cooldown_max;
+ root[ "duration" ] = duration;
+ root[ "duration_stddev" ] = duration_stddev;
+ root[ "duration_min" ] = duration_min;
+ root[ "duration_max" ] = duration_max;
+ root[ "distance_min" ] = distance_min;
+ root[ "distance_max" ] = distance_max;
+ root[ "players_only" ] = players_only;
+ root[ "player_chance" ] = player_chance;
+ root[ "affected_role" ] = affected_role;
+ root[ "saved_duration" ] = saved_duration;
+}
+
std::ostream& operator<<( std::ostream& os, const raid_event_t& r )
{
os << fmt::format( "Raid event (type={} name={})", r.type, r.name );
diff --git a/engine/simulationcraft.hpp b/engine/simulationcraft.hpp
index 5c31ea4990..bf7e53f7c1 100644
--- a/engine/simulationcraft.hpp
+++ b/engine/simulationcraft.hpp
@@ -333,6 +333,7 @@ public:
void schedule();
virtual void reset();
void parse_options( const std::string& options_str );
+ virtual void output_json( js::JsonOutput& root );
static std::unique_ptr<raid_event_t> create( sim_t* sim, const std::string& name, const std::string& options_str );
static void init( sim_t* );
static void reset( sim_t* );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment