From 9bc757c5c1be531d4344dd5c30485153d7275ef4 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Sat, 7 Sep 2013 10:47:57 -0500 Subject: [PATCH] Restyle new matchbomb iuse methods. --- iuse.cpp | 51 +++++++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/iuse.cpp b/iuse.cpp index 3aa3a25bacce2..04091d7aa4058 100644 --- a/iuse.cpp +++ b/iuse.cpp @@ -3333,38 +3333,33 @@ void iuse::dynamite(game *g, player *p, item *it, bool t) void iuse::dynamite_act(game *g, player *p, item *it, bool t) { - point pos = g->find_item(it); - if (pos.x == -999 || pos.y == -999) - return; - if (t) // Simple timer effects - g->sound(pos.x, pos.y, 0, _("ssss...")); - else // When that timer runs down... - g->explosion(pos.x, pos.y, 60, 0, false); + point pos = g->find_item(it); + if (pos.x == -999 || pos.y == -999) { return; } + // Simple timer effects + if (t) { g->sound(pos.x, pos.y, 0, _("ssss...")); + // When that timer runs down... + } else { g->explosion(pos.x, pos.y, 60, 0, false); } } -void iuse::matchbomb(game *g, player *p, item *it, bool t) -{ - if (!p->use_charges_if_avail("fire", 1)) - { - it->charges++; - g->add_msg_if_player(p,_("You need a lighter!")); - return; - } - g->add_msg_if_player(p,_("You light the match head bomb.")); - it->make(g->itypes["matchbomb_act"]); - it->charges = 3; - it->active = true; +void iuse::matchbomb(game *g, player *p, item *it, bool t) { + if( !p->use_charges_if_avail("fire", 1) ) { + it->charges++; + g->add_msg_if_player(p,_("You need a lighter!")); + return; + } + g->add_msg_if_player(p,_("You light the match head bomb.")); + it->make( g->itypes["matchbomb_act"] ); + it->charges = 3; + it->active = true; } -void iuse::matchbomb_act(game *g, player *p, item *it, bool t) -{ - point pos = g->find_item(it); - if (pos.x == -999 || pos.y == -999) - return; - if (t) // Simple timer effects - g->sound(pos.x, pos.y, 0, _("ssss...")); - else // When that timer runs down... - g->explosion(pos.x, pos.y, 24, 0, false); +void iuse::matchbomb_act(game *g, player *p, item *it, bool t) { + point pos = g->find_item(it); + if (pos.x == -999 || pos.y == -999) { return; } + // Simple timer effects + if (t) { g->sound(pos.x, pos.y, 0, _("ssss...")); + // When that timer runs down... + } else { g->explosion(pos.x, pos.y, 24, 0, false); } } void iuse::firecracker_pack(game *g, player *p, item *it, bool t)