death_info -> incident

develop
Quietust 2014-07-29 16:26:14 -05:00
parent 0182e0c980
commit d6162cd189
4 changed files with 15 additions and 15 deletions

@ -1,4 +1,4 @@
/*
/*
https://github.com/peterix/dfhack
Copyright (c) 2011 Petr Mrázek <peterix@gmail.com>
@ -76,7 +76,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "df/historical_entity.h"
#include "df/squad.h"
#include "df/squad_position.h"
#include "df/death_info.h"
#include "df/incident.h"
#include "BasicApi.pb.h"
@ -283,7 +283,7 @@ void DFHack::describeUnit(BasicUnitInfo *info, df::unit *unit,
if (unit->counters.death_id >= 0)
{
info->set_death_id(unit->counters.death_id);
if (auto death = df::death_info::find(unit->counters.death_id))
if (auto death = df::incident::find(unit->counters.death_id))
info->set_death_flags(death->flags.whole);
}
@ -455,7 +455,7 @@ static command_result ListEnums(color_ostream &stream,
BITFIELD(cie_add_tag_mask1);
BITFIELD(cie_add_tag_mask2);
describe_bitfield<df::death_info::T_flags>(out->mutable_death_info_flags());
describe_bitfield<df::incident::T_flags>(out->mutable_incident_flags());
ENUM(profession);

@ -42,7 +42,7 @@ using namespace std;
#include "df/language_name.h"
#include "df/world.h"
#include "df/world_raws.h"
#include "df/death_info.h"
#include "df/incident.h"
using std::vector;
using std::string;
@ -260,7 +260,7 @@ command_result cursecheck (color_ostream &out, vector <string> & parameters)
out.print("Unnamed creature ");
}
auto death = df::death_info::find(unit->counters.death_id);
auto death = df::incident::find(unit->counters.death_id);
bool missing = false;
if (death && !death->flags.bits.discovered)
{

@ -27,7 +27,7 @@
#include "df/historical_figure_info.h"
#include "df/assumed_identity.h"
#include "df/language_name.h"
#include "df/death_info.h"
#include "df/incident.h"
#include "df/criminal_case.h"
#include "df/unit_inventory_item.h"
#include "df/viewscreen_dwarfmodest.h"
@ -1211,7 +1211,7 @@ static command_result tweak(color_ostream &out, vector <string> &parameters)
if (!unit)
return CR_FAILURE;
auto death = df::death_info::find(unit->counters.death_id);
auto death = df::incident::find(unit->counters.death_id);
if (death)
{

@ -417,16 +417,16 @@ function Identity:init(args)
end
end
if u.counters.death_id > -1 then -- if undead/ghostly dead or dead-dead
self.death_info = df.global.world.deaths.all[u.counters.death_id]
if not self.death_info.flags.discovered then
self.incident = df.global.world.incidents.all[u.counters.death_id]
if not self.incident.flags.discovered then
self.missing = true
end
end
-- slaughtered?
if self.death_event then
self.death_date = Time{year = self.death_event.year, ticks = self.death_event.seconds}
elseif self.death_info then
self.death_date = Time{year = self.death_info.event_year, ticks = self.death_info.event_time}
elseif self.incident then
self.death_date = Time{year = self.incident.event_year, ticks = self.incident.event_time}
end
-- age now or age death?
if self.dead and self.death_date then -- if cursed with no age? -- if hacked a ressurection, such that they aren't dead anymore, don't use the death date
@ -753,14 +753,14 @@ function UnitInfoViewer:chunk_Dead()
--str << ", shot by a #{df.world.raws.itemdefs.weapons[e.weapon.bow_item_subtype].name}" if e.weapon.bow_item_type == :WEAPON
str = DEATH_TYPES[i.death_event.death_cause]..PERIOD
pen = pens.MAGENTA
elseif i.death_info then
elseif i.incident then
--str = "The #{u.race_tg.name[0]}"
--str << " #{u.name}" if u.name.has_name
--str << " died"
--str << " in year #{death_info.event_year}" if death_info
--str << " in year #{incident.event_year}" if incident
--str << " (cause: #{u.counters.death_cause.to_s.downcase})," if u.counters.death_cause != -1
--str << " killed by the #{killer.race_tg.name[0]} #{killer.name}" if killer
str = DEATH_TYPES[i.death_info.death_cause]..PERIOD
str = DEATH_TYPES[i.incident.death_cause]..PERIOD
pen = pens.MAGENTA
elseif i.unit.flags2.slaughter and i.unit.flags2.killed then
str = ' was slaughtered.'