From fefa8709a05a81b8d1bfe8c6bbd2c8b6ff88395e Mon Sep 17 00:00:00 2001 From: freezerbunny Date: Mon, 25 Nov 2013 07:00:04 +0000 Subject: [PATCH 01/10] Change stabbing weapons to show "Stab:" --- src/item.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index d4056ffbd13ab..7fc441c192b3b 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -363,7 +363,15 @@ std::string item::info(bool showtext, std::vector *dump, game *g, bool dump->push_back(iteminfo("BASE", _("Volume: "), "", volume(), true, "", false, true)); dump->push_back(iteminfo("BASE", _(" Weight: "), "", g->u.convert_weight(weight()), false, "", true, true)); dump->push_back(iteminfo("BASE", _("Bash: "), "", damage_bash(), true, "", false)); - dump->push_back(iteminfo("BASE", (has_flag("SPEAR") || has_flag("STAB") ? _(" Pierce: ") : _(" Cut: ")), "", damage_cut(), true, "", false)); + if (has_flag("SPEAR")) { + dump->push_back(iteminfo("BASE", (_(" Pierce: "), damage_cut(), true, "", false)); + } + else if (has_flag("STAB")) { + dump->push_back(iteminfo("BASE", (_(" Stab: "), damage_cut(), true, "", false)); + } + else { + dump->push_back(iteminfo("BASE", (_(" Cut: "), damage_cut(), true, "", false)); + } dump->push_back(iteminfo("BASE", _(" To-hit bonus: "), ((type->m_to_hit > 0) ? "+" : ""), type->m_to_hit, true, "")); dump->push_back(iteminfo("BASE", _("Moves per attack: "), "", attack_time(), true, "", true, true)); if ( debug == true ) { From 99ac82b4ce0628780ad4e258d535c9953659f82e Mon Sep 17 00:00:00 2001 From: freezerbunny Date: Mon, 25 Nov 2013 07:00:32 +0000 Subject: [PATCH 02/10] Fix extraneous bracket. --- src/item.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/item.cpp b/src/item.cpp index 7fc441c192b3b..d21d17913fb2a 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -364,13 +364,13 @@ std::string item::info(bool showtext, std::vector *dump, game *g, bool dump->push_back(iteminfo("BASE", _(" Weight: "), "", g->u.convert_weight(weight()), false, "", true, true)); dump->push_back(iteminfo("BASE", _("Bash: "), "", damage_bash(), true, "", false)); if (has_flag("SPEAR")) { - dump->push_back(iteminfo("BASE", (_(" Pierce: "), damage_cut(), true, "", false)); + dump->push_back(iteminfo("BASE", _(" Pierce: "), damage_cut(), true, "", false)); } else if (has_flag("STAB")) { - dump->push_back(iteminfo("BASE", (_(" Stab: "), damage_cut(), true, "", false)); + dump->push_back(iteminfo("BASE", _(" Stab: "), damage_cut(), true, "", false)); } else { - dump->push_back(iteminfo("BASE", (_(" Cut: "), damage_cut(), true, "", false)); + dump->push_back(iteminfo("BASE", _(" Cut: "), damage_cut(), true, "", false)); } dump->push_back(iteminfo("BASE", _(" To-hit bonus: "), ((type->m_to_hit > 0) ? "+" : ""), type->m_to_hit, true, "")); dump->push_back(iteminfo("BASE", _("Moves per attack: "), "", attack_time(), true, "", true, true)); From 854ec3ddce3bc562a8717cea75fc1a16415450df Mon Sep 17 00:00:00 2001 From: freezerbunny Date: Mon, 25 Nov 2013 07:06:30 +0000 Subject: [PATCH 03/10] Fix code. --- src/item.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/item.cpp b/src/item.cpp index d21d17913fb2a..409467636cecc 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -364,13 +364,13 @@ std::string item::info(bool showtext, std::vector *dump, game *g, bool dump->push_back(iteminfo("BASE", _(" Weight: "), "", g->u.convert_weight(weight()), false, "", true, true)); dump->push_back(iteminfo("BASE", _("Bash: "), "", damage_bash(), true, "", false)); if (has_flag("SPEAR")) { - dump->push_back(iteminfo("BASE", _(" Pierce: "), damage_cut(), true, "", false)); + dump->push_back(iteminfo("BASE", _(" Pierce: "), "", damage_cut(), true, "", false)); } else if (has_flag("STAB")) { - dump->push_back(iteminfo("BASE", _(" Stab: "), damage_cut(), true, "", false)); + dump->push_back(iteminfo("BASE", _(" Stab: "), "", damage_cut(), true, "", false)); } else { - dump->push_back(iteminfo("BASE", _(" Cut: "), damage_cut(), true, "", false)); + dump->push_back(iteminfo("BASE", _(" Cut: "), "", damage_cut(), true, "", false)); } dump->push_back(iteminfo("BASE", _(" To-hit bonus: "), ((type->m_to_hit > 0) ? "+" : ""), type->m_to_hit, true, "")); dump->push_back(iteminfo("BASE", _("Moves per attack: "), "", attack_time(), true, "", true, true)); From f23ce1269fc76179a002519678d002b6f07361ed Mon Sep 17 00:00:00 2001 From: freezerbunny Date: Mon, 25 Nov 2013 11:57:40 +0000 Subject: [PATCH 04/10] Erase scent when we shift. Fix elevators. --- src/game.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index efbc4199003d2..ccb44ca6560a2 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2632,7 +2632,7 @@ void game::update_scent() (m.move_cost_ter_furn(x,y+1) > 0 || m.has_flag("BASHABLE",x,y+1)) ; } } - + for (int x = u.posx - SCENT_RADIUS; x <= u.posx + SCENT_RADIUS; x++) { for (int y = u.posy - SCENT_RADIUS; y <= u.posy + SCENT_RADIUS; y++) { const int move_cost = m.move_cost_ter_furn(x, y); @@ -2642,7 +2642,7 @@ void game::update_scent() int squares_used = squares_used_y[x-1][y] + squares_used_y[x][y] + squares_used_y[x+1][y]; // take the old scent and subtract what diffuses out temp_scent = grscent[x][y] * (1000 - squares_used * diffusivity); // it's okay if this is slightly negative - // we've already summed neighboring scent values in the y direction in the previous loop. + // we've already summed neighboring scent values in the y direction in the previous loop. // Now we do it for the x direction, multiply by diffusion, and this is what diffuses into our current square. grscent[x][y] = static_cast(temp_scent + diffusivity * (sum_3_squares_y[x-1][y] + sum_3_squares_y[x][y] + sum_3_squares_y[x+1][y] )) / 1000; @@ -11405,8 +11405,7 @@ void game::vertical_move(int movez, bool force) { // Force means we're going down, even if there's no staircase, etc. // This happens with sinkholes and the like. if (!force && ((movez == -1 && !m.has_flag("GOES_DOWN", u.posx, u.posy)) || - (movez == 1 && !m.has_flag("GOES_UP", u.posx, u.posy))) && - !(m.ter(u.posx, u.posy) == t_elevator)) { + (movez == 1 && !m.has_flag("GOES_UP", u.posx, u.posy)))) { if (movez == -1) { add_msg(_("You can't go down here!")); } else { @@ -11498,6 +11497,13 @@ void game::vertical_move(int movez, bool force) { despawn_monsters(); clear_zombies(); + // Clear current scents. + for (int x = u.posx - SCENT_RADIUS; x <= u.posx + SCENT_RADIUS; x++) { + for (int y = u.posy - SCENT_RADIUS; y <= u.posy + SCENT_RADIUS; y++) { + grscent[x][y] = 0; + } + } + // Figure out where we know there are up/down connectors std::vector discover; for (int x = 0; x < OMAPX; x++) { From 834b9fcabd7be8c9b25ca96cd65c8f753e73d707 Mon Sep 17 00:00:00 2001 From: Zaweri Date: Mon, 25 Nov 2013 16:26:57 +0200 Subject: [PATCH 05/10] Fixes typos and increases dispersion --- data/json/items/ranged.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/json/items/ranged.json b/data/json/items/ranged.json index 6fc0708317789..ddac5327b517e 100644 --- a/data/json/items/ranged.json +++ b/data/json/items/ranged.json @@ -2860,7 +2860,7 @@ "to_hit": -1, "ranged_damage": 0, "range": 5, - "dispersion": 14, + "dispersion": 25, "recoil": 2, "durability": 6, "burst": 0, @@ -2873,7 +2873,7 @@ "symbol": "(", "color": "brown", "name": "flintlock pistol", - "description": "A flintlock rifle. It has a hollow handle, containing a short cleaning rod.", + "description": "A flintlock pistol. It has a hollow handle, containing a short cleaning rod.", "price": 350, "material": ["iron", "wood"], "skill": "pistol", @@ -2885,7 +2885,7 @@ "to_hit": -1, "ranged_damage": -2, "range": 3, - "dispersion": 21, + "dispersion": 30, "recoil": 8, "durability": 6, "burst": 0, From ee560b64cf82a26b7297b5ca34c4b2c7b4bafaae Mon Sep 17 00:00:00 2001 From: Zaweri Date: Mon, 25 Nov 2013 17:03:37 +0200 Subject: [PATCH 06/10] Item groups for COP 38 --- data/json/item_groups.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/json/item_groups.json b/data/json/item_groups.json index c59d3bde20bc3..e1db476ee9e14 100644 --- a/data/json/item_groups.json +++ b/data/json/item_groups.json @@ -655,6 +655,8 @@ "id" : "homeguns", "items":[ ["blowgun", 5], + ["moss_brownie", 2], + ["cop_38", 4], ["rm228", 3], ["dart", 5], ["22_lr", 9], @@ -2983,6 +2985,8 @@ ["rifle_flint", 5], ["pistol_flint", 5], ["flint_ammo", 5], + ["moss_brownie", 5], + ["cop_38", 5], ["cigar", 5], ["television", 10], ["microwave", 5], From a28c84b9bf13144ad2a4614a99366afdacc111b1 Mon Sep 17 00:00:00 2001 From: Zaweri Date: Mon, 25 Nov 2013 17:05:40 +0200 Subject: [PATCH 07/10] Adds COP 38 and Mossberg Brownie --- data/json/items/ranged.json | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/data/json/items/ranged.json b/data/json/items/ranged.json index 6fc0708317789..dd8ec1b5d20d1 100644 --- a/data/json/items/ranged.json +++ b/data/json/items/ranged.json @@ -2891,5 +2891,55 @@ "burst": 0, "clip_size": 1, "reload": 800 + }, + { + "id": "moss_brownie", + "type": "GUN", + "symbol": "(", + "color": "brown", + "name": "Mossberg Brownie", + "description": "A four-barreled, .22 Long Rifle pistol, similar to a derringer or pepperbox, produced by O.F. Mossberg & Sons from 1920 to 1932.", + "price": 1100, + "material": ["steel", "wood"], + "skill": "pistol", + "ammo": "22", + "weight": 364, + "volume": 3, + "bashing": 5, + "cutting": 0, + "to_hit": -1, + "ranged_damage": 0, + "range": 3, + "dispersion": 20, + "recoil": 2, + "durability": 6, + "burst": 0, + "clip_size": 1, + "reload": 400 + }, + { + "id": "cop_38", + "type": "GUN", + "symbol": "(", + "color": "brown", + "name": "COP .38", + "description": "The COP 38 is a four-shot derringer-type pistol chambered for the .38 round. It was designed by Robert Hillberg, based on his earlier work on the Hillberg Insurgency Weapon.", + "price": 1200, + "material": ["steel", "wood"], + "skill": "pistol", + "ammo": "38", + "weight": 857, + "volume": 3, + "bashing": 5, + "cutting": 0, + "to_hit": -1, + "ranged_damage": -2, + "range": 3, + "dispersion": 15, + "recoil": 2, + "durability": 6, + "burst": 0, + "clip_size": 1, + "reload": 400 } ] From e65cf2014ae49f93ad44aac6b1f3306902b33581 Mon Sep 17 00:00:00 2001 From: Zaweri Date: Mon, 25 Nov 2013 17:08:52 +0200 Subject: [PATCH 08/10] Fixes typo --- data/json/items/ranged.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/json/items/ranged.json b/data/json/items/ranged.json index dd8ec1b5d20d1..d38bfe60a6af9 100644 --- a/data/json/items/ranged.json +++ b/data/json/items/ranged.json @@ -2939,7 +2939,7 @@ "recoil": 2, "durability": 6, "burst": 0, - "clip_size": 1, + "clip_size": 4, "reload": 400 } ] From 7663defe51aee9af5dd77e52069b0cc46551b396 Mon Sep 17 00:00:00 2001 From: freezerbunny Date: Tue, 26 Nov 2013 00:11:58 +0000 Subject: [PATCH 09/10] Properly check if contained food is rotten. --- src/item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/item.cpp b/src/item.cpp index 346b204a68b90..2f0e412af0e64 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -873,7 +873,7 @@ std::string item::tname(game *g) if (food != NULL && g != NULL && food->has_flag("HOT")) ret << _(" (hot)"); if (food != NULL && g != NULL && food_type->spoils != 0 && - rotten(g)) + food->rotten(g)) ret << _(" (rotten)"); if (has_flag("FIT")) { From 5fad1fc91d2b9874be70d996ec47975efe34d971 Mon Sep 17 00:00:00 2001 From: Zaweri Date: Tue, 26 Nov 2013 09:37:02 +0200 Subject: [PATCH 10/10] Fixes --- data/json/items/ranged.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/data/json/items/ranged.json b/data/json/items/ranged.json index d38bfe60a6af9..a99450148b2cb 100644 --- a/data/json/items/ranged.json +++ b/data/json/items/ranged.json @@ -2901,6 +2901,7 @@ "description": "A four-barreled, .22 Long Rifle pistol, similar to a derringer or pepperbox, produced by O.F. Mossberg & Sons from 1920 to 1932.", "price": 1100, "material": ["steel", "wood"], + "flags": "RELOAD_ONE", "skill": "pistol", "ammo": "22", "weight": 364, @@ -2914,8 +2915,8 @@ "recoil": 2, "durability": 6, "burst": 0, - "clip_size": 1, - "reload": 400 + "clip_size": 4, + "reload": 100 }, { "id": "cop_38", @@ -2926,6 +2927,7 @@ "description": "The COP 38 is a four-shot derringer-type pistol chambered for the .38 round. It was designed by Robert Hillberg, based on his earlier work on the Hillberg Insurgency Weapon.", "price": 1200, "material": ["steel", "wood"], + "flags": "RELOAD_ONE", "skill": "pistol", "ammo": "38", "weight": 857, @@ -2940,6 +2942,6 @@ "durability": 6, "burst": 0, "clip_size": 4, - "reload": 400 + "reload": 100 } ]