Skip to content

Commit

Permalink
Merge pull request CleverRaven#40938 from anothersimulacrum/flaremeto…
Browse files Browse the repository at this point in the history
…themoon

Convert flares to using pyrotechnic
  • Loading branch information
ZhilkinSerg authored May 29, 2020
2 parents 639b535 + 84cd68d commit 8889927
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
12 changes: 12 additions & 0 deletions data/json/items/ammo.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@
"flags": [ "TRADER_AVOID" ],
"ammo_type": "butane"
},
{
"type": "AMMO",
"id": "flare_nitrate",
"name": { "str_sp": "flare pyrotechnic" },
"symbol": "~",
"description": "A pyrotechnic chemical used in flares.",
"volume": "1 ml",
"weight": "1 mg",
"color": "white",
"flags": [ "TRADER_AVOID" ],
"ammo_type": "flare_nitrate"
},
{
"type": "AMMO",
"id": "match",
Expand Down
6 changes: 6 additions & 0 deletions data/json/items/ammo_types.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@
"name": "butane",
"default": "butane"
},
{
"type": "ammunition_type",
"id": "flare_nitrate",
"name": "flare pyrotechnic",
"default": "flare_nitrate"
},
{
"type": "ammunition_type",
"id": "match",
Expand Down
3 changes: 2 additions & 1 deletion data/json/items/tool/lighting.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@
"volume": "250 ml",
"price": 400,
"price_postapoc": 100,
"max_charges": 300,
"pocket_data": [ { "pocket_type": "MAGAZINE", "ammo_restriction": { "flare_nitrate": 300 } } ],
"ammo": "flare_nitrate",
"initial_charges": 300,
"use_action": {
"menu_text": "Strike the striker",
Expand Down
2 changes: 1 addition & 1 deletion data/mods/Aftershock/items/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"menu_text": "Turn off flashlight",
"type": "transform"
},
"flags": [ "WATCH", "LIGHT_25", "CHARGEDIM", "TRADER_AVOID", "ALARMCLOCK", "NO_UNLOAD", "NO_RELOAD" ]
"flags": [ "WATCH", "LIGHT_25", "TRADER_AVOID", "ALARMCLOCK", "NO_UNLOAD", "NO_RELOAD" ]
},
{
"id": "afs_wraitheon_smartphone",
Expand Down
5 changes: 4 additions & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7886,7 +7886,10 @@ bool item::getlight( float &luminance, int &width, int &direction ) const
int item::getlight_emit() const
{
float lumint = type->light_emission;
if( lumint == 0 || ( ammo_required() > 0 && ammo_remaining() == 0 ) ) {
if( ammo_required() == 0 ) {
return lumint;
}
if( lumint == 0 || ammo_remaining() == 0 ) {
return 0;
}
if( has_flag( flag_CHARGEDIM ) && is_tool() && !has_flag( flag_USE_UPS ) ) {
Expand Down

0 comments on commit 8889927

Please sign in to comment.