Skip to content

Commit

Permalink
Fixed H&K G80 requires zero charges with effective emitter gunmod (#3…
Browse files Browse the repository at this point in the history
…4241)

* Changed fixed modifier to multiplier

* Changed gunmods to use new multiplier

* Removed exact date from description

* Removed emitter gunmod from G80

* Remove emitter gunmod slot from coilgun as well
  • Loading branch information
Night-Pryanik authored and ZhilkinSerg committed Sep 26, 2019
1 parent a03f527 commit 9a54879
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions data/json/items/gun/12mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"copy-from": "gun_base",
"type": "GUN",
"name": "H&K G80 Railgun",
"description": "Developed by Heckler & Koch in 2033, the railgun magnetically propels a ferromagnetic projectile using an alternating current. Powered by UPS.",
"description": "Developed by Heckler & Koch in the first quarter of 21st century, the railgun magnetically propels a ferromagnetic projectile using an alternating current. Powered by UPS.",
"weight": "3914 g",
"volume": "2750 ml",
"price": 1920000,
Expand All @@ -19,7 +19,6 @@
"ups_charges": 5,
"valid_mod_locations": [
[ "accessories", 4 ],
[ "emitter", 1 ],
[ "grip", 1 ],
[ "mechanism", 4 ],
[ "rail", 1 ],
Expand Down
1 change: 0 additions & 1 deletion data/json/items/gun/nail.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"ups_charges": 5,
"valid_mod_locations": [
[ "accessories", 4 ],
[ "emitter", 1 ],
[ "grip", 1 ],
[ "sights", 1 ],
[ "sling", 1 ],
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/gunmod/barrel.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"id": "upstest",
"type": "GUNMOD",
"name": "upstest",
"description": "Testmod for UPS drain on mods, this should never spawn, if you see this, it's a bug. 50 UPS drain.",
"description": "Testmod for UPS drain on mods, this should never spawn, if you see this, it's a bug. 50x more UPS drain.",
"weight": "450 g",
"volume": "500 ml",
"price": 20000,
Expand All @@ -31,7 +31,7 @@
"mod_targets": [ "smg", "rifle", "shotgun", "pistol" ],
"damage_modifier": 500,
"dispersion_modifier": 500,
"ups_charges": 50,
"ups_charges_multiplier": 50,
"min_skills": [ [ "gun", 1 ] ]
},
{
Expand Down
6 changes: 3 additions & 3 deletions data/json/items/gunmod/laser_gunmods.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"mod_targets": [ "pistol" ],
"range_modifier": -25,
"damage_modifier": -8,
"ups_charges": 10,
"ups_charges_multiplier": 1.2,
"ammo_effects": [ "BEANBAG" ],
"min_skills": [ [ "weapon", 4 ], [ "electronics", 5 ] ]
},
Expand All @@ -68,7 +68,7 @@
"color": "light_gray",
"location": "emitter",
"mod_targets": [ "pistol", "rifle" ],
"ups_charges": -5,
"ups_charges_multiplier": 0.9,
"min_skills": [ [ "weapon", 4 ], [ "electronics", 5 ] ]
},
{
Expand All @@ -87,7 +87,7 @@
"mod_targets": [ "pistol", "rifle" ],
"range_modifier": 5,
"damage_modifier": 10,
"ups_charges": 20,
"ups_charges_multiplier": 2,
"min_skills": [ [ "weapon", 4 ], [ "electronics", 5 ] ]
}
]
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8771,7 +8771,7 @@ int item::get_gun_ups_drain() const
if( type->gun ) {
draincount += type->gun->ups_charges;
for( const item *mod : gunmods() ) {
draincount += mod->type->gunmod->ups_charges;
draincount *= mod->type->gunmod->ups_charges_multiplier;
}
}
return draincount;
Expand Down
2 changes: 1 addition & 1 deletion src/item_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ void Item_factory::load( islot_gunmod &slot, JsonObject &jo, const std::string &
assign( jo, "consume_chance", slot.consume_chance );
assign( jo, "consume_divisor", slot.consume_divisor );
assign( jo, "ammo_effects", slot.ammo_effects, strict );
assign( jo, "ups_charges", slot.ups_charges );
assign( jo, "ups_charges_multiplier", slot.ups_charges_multiplier );
if( jo.has_int( "time" ) ) {
slot.install_time = jo.get_int( "time" );
} else if( jo.has_string( "time" ) ) {
Expand Down
4 changes: 2 additions & 2 deletions src/itype.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ struct islot_gunmod : common_ranged_data {
/** How many moves does this gunmod take to install? */
int install_time = 0;

/** Increases base gun UPS consumption by this many charges per shot */
int ups_charges = 0;
/** Increases base gun UPS consumption by this many times per shot */
float ups_charges_multiplier = 1.0f;

/** Firing modes added to or replacing those of the base gun */
std::map<gun_mode_id, gun_modifier_data> mode_modifier;
Expand Down

0 comments on commit 9a54879

Please sign in to comment.