Skip to content

Commit

Permalink
Renamed debug weather tool, made it rarely spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoes01 committed Nov 13, 2014
1 parent d844fcb commit 0e79416
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
3 changes: 2 additions & 1 deletion data/json/item_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -6531,7 +6531,8 @@
["radiocontrol", 15],
["thermometer", 10],
["hygrometer", 10],
["barometer", 10]
["barometer", 10],
["weather_reader", 1]
]
},{
"type" : "item_group",
Expand Down
40 changes: 20 additions & 20 deletions data/json/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -8369,38 +8369,38 @@
}
},
{
"id": "test_weather_reader",
"id": "weather_reader",
"type": "TOOL",
"symbol": "*",
"color": "white",
"name": "pocket meterologist",
"name_plural": "pocket meterologists",
"description": "A debug tool that reads temperature, humidity and pressure.",
"price": 0,
"material": "plastic",
"weight": 1,
"volume": 1,
"bashing": 0,
"symbol": ";",
"color": "light_gray",
"name": "Doppler Radar Turbo 2000",
"description": "A briefcase with built-in laptop that looks like it's from the 80s. It's vintage monochrome monitor displays a plethora of meteorological data. No sign of the FLDSMDFR, however.",
"price": 200,
"material": ["plastic", "aluminum"],
"weight": 10,
"volume": 10,
"bashing": 1,
"cutting": 0,
"to_hit": -3,
"ammo": "NULL",
"to_hit": -1,
"ammo": "battery",
"revert_to": "null",
"category": "tool",
"use_action": "WEATHER_TOOL",
"max_charges": 0,
"max_charges": 20,
"initial_charges": 0,
"charges_per_use": 0,
"charges_per_use": 1,
"turns_per_charge": 0,
"flags": ["THERMOMETER", "HYGROMETER", "BAROMETER"]
},
{
"id": "thermometer",
"type": "TOOL",
"symbol": ";",
"color": "red",
"name": "thermometer",
"name_plural": "thermometers",
"description": "A plastic thermometer that can read the air temperature.",
"price": 0,
"price": 100,
"material": "plastic",
"weight": 1,
"volume": 1,
Expand All @@ -8417,15 +8417,15 @@
"turns_per_charge": 0,
"flags": ["THERMOMETER"]
},
}
{
"id": "hygrometer",
"type": "TOOL",
"symbol": ";",
"color": "light_blue",
"name": "hygrometer",
"name_plural": "hygrometers",
"description": "A plastic hygrometer that can read the relative humidity in the air.",
"price": 0,
"price": 100,
"material": "plastic",
"weight": 1,
"volume": 1,
Expand All @@ -8442,15 +8442,15 @@
"turns_per_charge": 0,
"flags": ["HYGROMETER"]
},
}
{
"id": "barometer",
"type": "TOOL",
"symbol": ";",
"color": "light_gray",
"name": "barometer",
"name_plural": "barometers",
"description": "A plastic barometer that can read the atmospheric pressure.",
"price": 0,
"price": 100,
"material": "plastic",
"weight": 1,
"volume": 1,
Expand Down
11 changes: 7 additions & 4 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10308,29 +10308,32 @@ int iuse::weather_tool(player *p, item *it, bool, point)
{
w_point weatherPoint = g->weatherGen.get_weather(p->pos(), calendar::turn);

if (it->type->id == "weather_reader") {
p->add_msg_if_player(m_neutral, _("The %s's monitor slowly outputs the data..."), it->tname().c_str());
}
if (it->has_flag("THERMOMETER")) {
if (it->type->id == "thermometer") {
p->add_msg_if_player(m_neutral, _("The %s reads %s."), it->name().c_str(), print_temperature(g->get_temperature()).c_str());
p->add_msg_if_player(m_neutral, _("The %s reads %s."), it->tname().c_str(), print_temperature(g->get_temperature()).c_str());
} else {
p->add_msg_if_player(m_neutral, _("Temperature: %s."), print_temperature(g->get_temperature()).c_str());
}
}
if (it->has_flag("HYGROMETER")) {
if (it->type->id == "hygrometer") {
p->add_msg_if_player(m_neutral, _("The %s reads %s."), it->name().c_str(), print_humidity(get_local_humidity(weatherPoint.humidity, g->weather, g->is_sheltered(g->u.posx, g->u.posy))).c_str());
p->add_msg_if_player(m_neutral, _("The %s reads %s."), it->tname().c_str(), print_humidity(get_local_humidity(weatherPoint.humidity, g->weather, g->is_sheltered(g->u.posx, g->u.posy))).c_str());
} else {
p->add_msg_if_player(m_neutral, _("Relative Humidity: %s."), print_humidity(get_local_humidity(weatherPoint.humidity, g->weather, g->is_sheltered(g->u.posx, g->u.posy))).c_str());
}
}
if (it->has_flag("BAROMETER")) {
if (it->type->id == "barometer") {
p->add_msg_if_player(m_neutral, _("The %s reads %s."), it->name().c_str(), print_pressure((int)weatherPoint.pressure).c_str());
p->add_msg_if_player(m_neutral, _("The %s reads %s."), it->tname().c_str(), print_pressure((int)weatherPoint.pressure).c_str());
} else {
p->add_msg_if_player(m_neutral, _("Pressure: %s."), print_pressure((int)weatherPoint.pressure).c_str());
}
}

if (it->has_flag("BAROMETER") && it->has_flag("HYGROMETER") && it->has_flag("THERMOMETER")) {
if (it->type->id == "weather_reader") {
int vpart = -1;
vehicle *veh = g->m.veh_at( p->posx, p->posy, vpart );
int vehwindspeed = 0;
Expand Down

0 comments on commit 0e79416

Please sign in to comment.