From aed21b5eb6dd5422b50ecb46617f2da16f108965 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Thu, 25 Oct 2007 09:49:39 +0000 Subject: [1810433] Ogre hunters start with large rocks. Monster ogres can also throw large rocks but are never generated with rocks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2545 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/externs.h | 2 ++ crawl-ref/source/initfile.cc | 5 ++++- crawl-ref/source/item_use.cc | 13 +++++++++---- crawl-ref/source/itemprop.cc | 4 ++-- crawl-ref/source/mon-util.cc | 4 ++-- crawl-ref/source/newgame.cc | 11 ++++++++++- crawl-ref/source/player.cc | 6 ++++++ 7 files changed, 35 insertions(+), 10 deletions(-) diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 57881ffc4d..fe0cb906f9 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -827,6 +827,8 @@ public: bool cannot_act() const; + bool can_throw_rocks() const; + int armour_class() const; int melee_evasion(const actor *attacker) const; diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index c887384b2d..fbd6685bde 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -261,6 +261,8 @@ static fire_type str_to_fire_types( const std::string &str ) return (FIRE_DART); else if (str == "stone") return (FIRE_STONE); + else if (str == "rock") + return (FIRE_ROCK); else if (str == "dagger") return (FIRE_DAGGER); else if (str == "spear") @@ -706,7 +708,8 @@ void game_options::reset_options() fire_items_start = 2; // start at slot 'c' // Clear fire_order and set up the defaults. - set_fire_order("launcher, javelin / dart / stone / spear"); + set_fire_order("launcher, " + "javelin / dart / stone / rock / spear / net / handaxe"); item_stack_summary_minimum = 5; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 7e482656e4..40c032c3c0 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -2010,7 +2010,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // all weapons that use 'throwing' go here.. if (wepClass == OBJ_WEAPONS || (wepClass == OBJ_MISSILES - && (wepType == MI_STONE || wepType == MI_SLING_BULLET))) + && (wepType == MI_STONE || wepType == MI_LARGE_ROCK))) { // elves with elven weapons if (get_equip_race(item) == ISFLAG_ELVEN @@ -2061,6 +2061,10 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, { switch (wepType) { + case MI_LARGE_ROCK: + if (you.can_throw_rocks()) + baseHit = 1; + break; case MI_DART: // give an appropriate 'tohit' & damage baseHit = 2; @@ -2078,7 +2082,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // Javelins use throwing skill. baseHit = -1; baseDam = property( item, PWPN_DAMAGE ); - exHitBonus += (skill_bump(SK_THROWING) * 7 / 2); + exHitBonus += skill_bump(SK_THROWING) * 3 / 2; exDamBonus += you.skills[SK_THROWING] * 3 / 5; // Adjust for strength and dex. @@ -2114,8 +2118,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, // for launchers. Hand-thrown stones and darts do only half // base damage. Yet another evil 4.0ism. if (wepClass == OBJ_MISSILES - && (wepType == MI_DART || wepType == MI_STONE - || wepType == MI_SLING_BULLET)) + && (wepType == MI_DART || wepType == MI_STONE)) baseDam = div_rand_round(baseDam, 2); // exercise skill @@ -2139,6 +2142,8 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, if (wepType == MI_LARGE_ROCK) { pbolt.range = 1 + random2( you.strength / 5 ); + if (you.can_throw_rocks()) + pbolt.range += random_range(4, 7); if (pbolt.range > 12) pbolt.range = 12; diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index 178f26c778..e794789610 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -351,9 +351,9 @@ static missile_def Missile_prop[NUM_MISSILES] = { MI_DART, "dart", 5, 3, true }, { MI_ARROW, "arrow", 7, 5, false }, { MI_BOLT, "bolt", 9, 5, false }, - { MI_LARGE_ROCK, "large rock", 20, 1000, true }, + { MI_LARGE_ROCK, "large rock", 20, 800, true }, { MI_SLING_BULLET, "sling bullet", 6, 4, false }, - { MI_JAVELIN, "javelin", 10, 40, true }, + { MI_JAVELIN, "javelin", 10, 90, true }, { MI_THROWING_NET, "throwing net", 0, 30, true }, }; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 55bf9cd110..3ada5a9d14 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2647,8 +2647,8 @@ item_def *monsters::weapon(int which_attack) bool monsters::can_throw_rocks() const { - return (type == MONS_STONE_GIANT || type == MONS_CYCLOPS || - type == MONS_POLYPHEMUS); + return (type == MONS_STONE_GIANT || type == MONS_CYCLOPS + || type == MONS_OGRE || type == MONS_POLYPHEMUS); } bool monsters::has_spell_of_type(unsigned disciplines) const diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index d1f9adb491..cb5b6f9c6e 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -3900,9 +3900,18 @@ bool give_items_skills() switch (you.species) { + case SP_OGRE: + // Ogres chop up their food without finesse. + you.inv[0].sub_type = WPN_HAND_AXE; + you.inv[1].quantity = 0; + + // And they get to throw rocks. + you.inv[3].sub_type = MI_LARGE_ROCK; + you.inv[3].quantity = 3; + break; + case SP_HALFLING: case SP_GNOME: - case SP_OGRE: you.inv[3].quantity += random2avg(15, 2); you.inv[3].sub_type = MI_SLING_BULLET; you.inv[1].sub_type = WPN_SLING; diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index e36a13035e..e542da415e 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6245,6 +6245,12 @@ bool player::cannot_act() const return (asleep() || paralysed()); } +bool player::can_throw_rocks() const +{ + return (species == SP_OGRE || species == SP_TROLL + || species == SP_OGRE_MAGE); +} + void player::put_to_sleep(int) { if (duration[DUR_BERSERKER] || asleep()) // No cumulative sleeps. -- cgit v1.2.3-54-g00ecf