Skip to content

Commit

Permalink
Merge pull request #2 from CleverRaven/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Zaweri committed Nov 26, 2013
2 parents 2e8efc3 + 1af62d1 commit e30e864
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 9 deletions.
4 changes: 4 additions & 0 deletions data/json/item_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,8 @@
"id" : "homeguns",
"items":[
["blowgun", 5],
["moss_brownie", 2],
["cop_38", 4],
["rm228", 3],
["dart", 5],
["22_lr", 9],
Expand Down Expand Up @@ -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],
Expand Down
58 changes: 55 additions & 3 deletions data/json/items/ranged.json
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,7 @@
"to_hit": -1,
"ranged_damage": 0,
"range": 5,
"dispersion": 14,
"dispersion": 25,
"recoil": 2,
"durability": 6,
"burst": 0,
Expand All @@ -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",
Expand All @@ -2885,11 +2885,63 @@
"to_hit": -1,
"ranged_damage": -2,
"range": 3,
"dispersion": 21,
"dispersion": 30,
"recoil": 8,
"durability": 6,
"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"],
"flags": "RELOAD_ONE",
"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": 4,
"reload": 100
},
{
"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"],
"flags": "RELOAD_ONE",
"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": 4,
"reload": 100
}
]
14 changes: 10 additions & 4 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<int>(temp_scent + diffusivity * (sum_3_squares_y[x-1][y] + sum_3_squares_y[x][y] + sum_3_squares_y[x+1][y] )) / 1000;

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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<point> discover;
for (int x = 0; x < OMAPX; x++) {
Expand Down
12 changes: 10 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,15 @@ std::string item::info(bool showtext, std::vector<iteminfo> *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 ) {
Expand Down Expand Up @@ -873,7 +881,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")) {
Expand Down

0 comments on commit e30e864

Please sign in to comment.